Skip to content

Commit 4dd75eb

Browse files
committed
test: move babel test deps into test/node-patches/package.json
1 parent e758431 commit 4dd75eb

9 files changed

Lines changed: 82 additions & 57 deletions

File tree

.aspect/rules/external_repository_action_cache/npm_translate_lock_LTE4Nzc1MDcwNjU=

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ js/private/coverage/bundle/package.json=-1582937149
2525
js/private/devserver/src/package.json=-1257402713
2626
js/private/test/image/package.json=1430754959
2727
js/private/test/js_run_devserver/package.json=-459994543
28+
js/private/test/node-patches/package.json=-799607277
2829
js/private/worker/src/package.json=251852959
2930
npm/private/test/npm_package/package.json=-1991705133
3031
npm/private/test/npm_package_publish/package.json=-646566766
3132
npm/private/test/package.json=1871823604
3233
npm/private/test/vendored/is-odd/package.json=1041695223
3334
npm/private/test/vendored/lodash-4.17.21.tgz=-1206623349
3435
npm/private/test/vendored/semver-max/package.json=578664053
35-
package.json=-1957263621
36-
pnpm-lock.yaml=1902914053
36+
package.json=-2040565922
37+
pnpm-lock.yaml=1670268491
3738
pnpm-workspace.yaml=-1336981113

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ js/private/coverage/bundle/node_modules
2626
js/private/devserver/src/node_modules/
2727
js/private/test/image/node_modules
2828
js/private/test/js_run_devserver/node_modules
29+
js/private/test/node-patches/node_modules
2930
js/private/worker/src/node_modules
3031
node_modules/
3132
npm/private/test/node_modules/

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ npm.npm_translate_lock(
205205
"//js/private/devserver/src:package.json",
206206
"//js/private/test/image:package.json",
207207
"//js/private/test/js_run_devserver:package.json",
208+
"//js/private/test/node-patches:package.json",
208209
"//js/private/worker/src:package.json",
209210
"//npm/private/test:package.json",
210211
"//npm/private/test:vendored/lodash-4.17.21.tgz",

js/private/test/node-patches/BUILD.bazel

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
2-
load("@npm//:@babel/cli/package_json.bzl", babel_bin = "bin")
3-
load("//js:defs.bzl", "js_test")
2+
load("@npm//:defs.bzl", "npm_link_all_packages")
3+
load("@npm//js/private/test/node-patches:@babel/cli/package_json.bzl", babel_bin = "bin")
4+
load("//js:defs.bzl", "js_library", "js_test")
45

56
TESTS = [
67
"escape.js",
@@ -37,6 +38,8 @@ TOOLCHAINS_VERSIONS = [
3738
for n in TOOLCHAINS_NAMES
3839
]
3940

41+
npm_link_all_packages()
42+
4043
# We need to copy the entry points to the bin so that the tests below don't follow the execroot
4144
# symlink back to the source tree since the fs patches are not on for the tests as they are the code
4245
# under test
@@ -48,12 +51,17 @@ TOOLCHAINS_VERSIONS = [
4851
for t in TESTS + MJS_TESTS
4952
]
5053

54+
js_library(
55+
name = "babel_config",
56+
srcs = ["babel.config.js"],
57+
deps = [
58+
":node_modules/@babel/plugin-transform-modules-commonjs",
59+
],
60+
)
61+
5162
babel_bin.babel(
5263
name = "babel_mjs2js",
53-
srcs = MJS_TESTS + [
54-
"babel.config.js",
55-
"//:node_modules/@babel/plugin-transform-modules-commonjs",
56-
],
64+
srcs = MJS_TESTS + [":babel_config"],
5765
outs = [t.replace(".mjs", ".cjs") for t in MJS_TESTS],
5866
args = [
5967
"--extensions",
@@ -77,7 +85,7 @@ babel_bin.babel(
7785
toolchain_name,
7886
),
7987
data = [
80-
"//:node_modules/inline-fixtures",
88+
":node_modules/inline-fixtures",
8189
"//js/private/node-patches/src:compile",
8290
],
8391
entry_point = "copy_entry_{}".format(t),
@@ -98,7 +106,7 @@ babel_bin.babel(
98106
toolchain_name,
99107
),
100108
data = [
101-
"//:node_modules/inline-fixtures",
109+
":node_modules/inline-fixtures",
102110
"//js/private/node-patches/src:compile",
103111
],
104112
entry_point = t,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"private": true,
3+
"devDependencies": {
4+
"@babel/cli": "^7.28.3",
5+
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
6+
"inline-fixtures": "1.1.0"
7+
}
8+
}

npm/private/test/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ build_test(
6767
":node_modules/@figma",
6868
":node_modules/@kubernetes",
6969
":node_modules/@plotly",
70+
71+
# odd URL/protocol versions
72+
":node_modules/@kubernetes/client-node",
73+
":node_modules/inline-fixtures",
74+
":node_modules/protoc-gen-grpc",
75+
":node_modules/syncpack",
7076
],
7177
)
7278

npm/private/test/snapshots/npm_defs.bzl

Lines changed: 30 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"@babel/cli": "^7.28.3",
5-
"@babel/core": "^7.28.4",
6-
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
74
"@types/node": "18.19.54",
85
"chalk": "5.1.1",
9-
"inline-fixtures": "1.1.0",
106
"jsonpath-plus": "7.2.0",
117
"typescript": "^5.8.0"
128
}

pnpm-lock.yaml

Lines changed: 17 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)