Skip to content

Commit 168d782

Browse files
authored
test: add rules_js v3 e2e test (#177)
A basic test with rules_js v3 and bazel-lib v3. ### Changes are visible to end-users: no ### Test plan - Covered by existing test cases - New test cases added
1 parent 06a8f20 commit 168d782

15 files changed

Lines changed: 2747 additions & 0 deletions

File tree

.aspect/workflows/config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ workspaces:
2424
queue: aspect-medium
2525
- buildifier:
2626
without: true
27+
e2e/smoke_rjs3:
28+
icon: bazel
29+
tasks:
30+
- test:
31+
queue: aspect-medium
32+
- buildifier:
33+
without: true
2734
e2e/worker:
2835
icon: bazel
2936
tasks:

.github/workflows/ci.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
- '.'
6767
- 'e2e/loaders'
6868
- 'e2e/smoke'
69+
- 'e2e/smoke_rjs3'
6970
- 'e2e/worker'
7071
exclude:
7172
# Don't test MacOS and Windows against secondary bazel version to minimize minutes (billed at 10X and 2X respectively)
@@ -82,6 +83,12 @@ jobs:
8283
# TODO
8384
- folder: e2e/worker
8485
bzlmod: 1
86+
# rules_js v3 is bzlmod-only and requires bazel 7+
87+
- folder: e2e/smoke_rjs3
88+
bzlmod: 0
89+
- folder: e2e/smoke_rjs3
90+
bazel-version:
91+
major: 6
8592
# bazel 7 linux tested on Aspect Workflows
8693
- os: ubuntu
8794
bazel-version:

e2e/smoke_rjs3/.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

e2e/smoke_rjs3/.bazelrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Import Aspect bazelrc presets
2+
try-import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc
3+
import %workspace%/../../.aspect/bazelrc/convenience.bazelrc
4+
import %workspace%/../../.aspect/bazelrc/correctness.bazelrc
5+
import %workspace%/../../.aspect/bazelrc/debug.bazelrc
6+
import %workspace%/../../.aspect/bazelrc/javascript.bazelrc
7+
import %workspace%/../../.aspect/bazelrc/performance.bazelrc
8+
9+
### YOUR PROJECT SPECIFIC OPTIONS GO HERE ###
10+
11+
# Load any settings & overrides specific to the current user from `.aspect/bazelrc/user.bazelrc`.
12+
# This file should appear in `.gitignore` so that settings are not shared with team members. This
13+
# should be last statement in this config so the user configuration is able to overwrite flags from
14+
# this file. See https://bazel.build/configure/best-practices#bazelrc-file.
15+
try-import %workspace%/../../.aspect/bazelrc/user.bazelrc

e2e/smoke_rjs3/.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.7.1

e2e/smoke_rjs3/.npmrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Disabling pnpm [hoisting](https://pnpm.io/npmrc#hoist) by setting `hoist=false` is recommended on
2+
# projects using rules_js so that pnpm outside of Bazel lays out a node_modules tree similar to what
3+
# rules_js lays out under Bazel (without a hidden node_modules/.pnpm/node_modules)
4+
hoist=false

e2e/smoke_rjs3/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
load("@npm//:defs.bzl", "npm_link_all_packages")
2+
3+
npm_link_all_packages(name = "node_modules")

e2e/smoke_rjs3/MODULE.bazel

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
bazel_dep(name = "aspect_rules_webpack", version = "0.0.0", dev_dependency = True)
2+
local_path_override(
3+
module_name = "aspect_rules_webpack",
4+
path = "../..",
5+
)
6+
7+
bazel_dep(name = "bazel_lib", version = "3.1.0", dev_dependency = True)
8+
bazel_dep(name = "aspect_rules_js", version = "3.0.0-alpha.4", dev_dependency = True)
9+
10+
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
11+
npm.npm_translate_lock(
12+
name = "npm",
13+
data = ["//:pnpm-workspace.yaml"],
14+
npmrc = "//:.npmrc",
15+
pnpm_lock = "//:pnpm-lock.yaml",
16+
)
17+
use_repo(npm, "npm")

e2e/smoke_rjs3/package.json

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+
"webpack": "5.76.2",
5+
"webpack-cli": "5.0.1",
6+
"webpack-dev-server": "4.13.1"
7+
}
8+
}

0 commit comments

Comments
 (0)