Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bazel + js] Allow bazel build //javascript/... to work #13893

Merged
merged 3 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion javascript/grid-ui/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ SRCS = glob(
exclude = [
"src/simple.ts",
"src/**/*.test.tsx",
# "src/assets/**/*",
],
)

Expand All @@ -54,7 +53,9 @@ DEPS = [
ts_project(
name = "transpile_ts",
srcs = SRCS,
allow_js = True,
assets = glob(["src/assets/**/*"]),
resolve_json_module = True,
tsconfig = "tsconfig.json",
deps = DEPS,
)
Expand Down
2 changes: 1 addition & 1 deletion javascript/grid-ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"types": [
"@types/node"
],
"sourceMap": false,
"sourceMap": false
},
"include": [
"src"
Expand Down
90 changes: 57 additions & 33 deletions javascript/node/selenium-webdriver/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm//javascript/node/selenium-webdriver:eslint/package_json.bzl", eslint_bin = "bin")
Expand All @@ -18,31 +19,35 @@ BROWSER_VERSIONS = [
"v124",
]

SRC_FILES = [
"CHANGES.md",
"README.md",
"package.json",
] + glob([
"*.js",
"example/*.js",
"http/*.js",
"io/*.js",
"lib/*.js",
"net/*.js",
"remote/*.js",
"testing/*.js",
"devtools/*.js",
"common/*.js",
"bidi/*.js",
])
js_library(
name = "prod-src-files",
srcs = [
"CHANGES.md",
"README.md",
"package.json",
] + glob([
"*.js",
"example/*.js",
"http/*.js",
"io/*.js",
"lib/*.js",
"net/*.js",
"remote/*.js",
"testing/*.js",
"devtools/*.js",
"common/*.js",
"bidi/*.js",
]),
)

npm_package(
name = "selenium-webdriver",
srcs = SRC_FILES + [
srcs = [
":license",
":manager-linux",
":manager-macos",
":manager-windows",
":prod-src-files",
"//javascript/node/selenium-webdriver/lib/atoms:find-elements",
"//javascript/node/selenium-webdriver/lib/atoms:get_attribute",
"//javascript/node/selenium-webdriver/lib/atoms:is_displayed",
Expand All @@ -64,8 +69,6 @@ pkg_tar(
strip_prefix = "selenium-webdriver",
)

#TEST_FILES = glob(["test/**/*_test.js"])
#
SMALL_TESTS = [
"test/io/io_test.js",
"test/io/zip_test.js",
Expand All @@ -83,17 +86,30 @@ SMALL_TESTS = [
"test/net/portprober_test.js",
]

LARGE_TESTS = glob(
["test/**/*_test.js"],
exclude = SMALL_TESTS,
js_library(
name = "small-test-srcs",
srcs = SMALL_TESTS,
)

TEST_DATA = SRC_FILES + glob(
[
"lib/test/**",
"test/**",
],
exclude = LARGE_TESTS + SMALL_TESTS,
js_library(
name = "large-test-srcs",
srcs = glob(
["test/**/*_test.js"],
exclude = SMALL_TESTS,
),
)

js_library(
name = "test-data",
srcs = glob(
[
"lib/test/**",
"test/**",
],
exclude = [
"test/**/*_test.js",
],
),
)

mocha_test(
Expand All @@ -108,14 +124,16 @@ mocha_test(
":node_modules/sinon",
":node_modules/tmp",
":node_modules/ws",
":small-test-srcs",
":test-data",
"//:node_modules/selenium-webdriver",
"//common/extensions:js-lib",
"//common/src/web:js-lib",
"//javascript/node/selenium-webdriver/lib/atoms:find-elements",
"//javascript/node/selenium-webdriver/lib/atoms:get_attribute",
"//javascript/node/selenium-webdriver/lib/atoms:is_displayed",
"//javascript/node/selenium-webdriver/lib/atoms:mutation-listener",
] + SMALL_TESTS + TEST_DATA,
],
tags = [
"skip-remote",
],
Expand All @@ -127,7 +145,9 @@ mocha_test(
size = "large",
args = ["--retries 1"],
chdir = package_name(),
data = LARGE_TESTS + TEST_DATA + [
data = [
"test-data",
":large-test-srcs",
":node_modules/@bazel/runfiles",
":node_modules/express",
":node_modules/jszip",
Expand Down Expand Up @@ -198,7 +218,7 @@ copy_to_bin(
eslint_bin.eslint_test(
name = "eslint-test",
chdir = package_name(),
data = SRC_FILES + [
data = [
":eslint-config",
":node_modules/@eslint/js",
":node_modules/eslint-plugin-mocha",
Expand All @@ -211,6 +231,7 @@ eslint_bin.eslint_test(
":node_modules/tmp",
":node_modules/ws",
":package-json",
":prod-src-files",
],
tags = [
"lint",
Expand All @@ -231,9 +252,12 @@ prettier_bin.prettier_test(
"--config=.prettierrc",
],
chdir = package_name(),
data = SRC_FILES + SMALL_TESTS + LARGE_TESTS + [
data = [
":large-test-srcs",
":prettier-config",
":prettier-ignore",
":prod-src-files",
":small-test-srcs",
],
tags = [
"lint",
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy