Skip to content

Commit 1728288

Browse files
committed
refactor(bazel): complete removal of old @npm// and rules_nodejs usages from bazel (#2936)
Remove the remaining @npm// and rules_nodejs usages from the bazel directory PR Close #2936
1 parent 44944bb commit 1728288

File tree

16 files changed

+119
-38
lines changed

16 files changed

+119
-38
lines changed

bazel/BUILD.bazel

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,11 @@ filegroup(
1616
name = "static_files",
1717
srcs = [
1818
"BUILD.bazel",
19-
"defaults.bzl",
2019
"expand_template.bzl",
21-
"extract_js_module_output.bzl",
2220
"extract_types.bzl",
2321
"filter_outputs.bzl",
2422
"//bazel/api-golden:files",
2523
"//bazel/constraints:files",
26-
"//bazel/esbuild:files",
2724
"//bazel/git-toolchain:files",
2825
"//bazel/http-server:files",
2926
"//bazel/private:files",

bazel/defaults.bzl

Lines changed: 0 additions & 15 deletions
This file was deleted.

bazel/integration/tests/custom_env_variables/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ integration_test(
88
commands = [
99
"node ./test.js",
1010
],
11-
data = ["@npm//:node_modules/semver/package.json"],
11+
data = ["@devinfra//bazel:node_modules/semver/dir"],
1212
environment = {
1313
"CUSTOM_VAR": "yes!",
14-
"RESOLVED_BIN": "$(rootpath @npm//:node_modules/semver/package.json)",
15-
"MANUAL_ROOT_PATH": "../npm/node_modules/semver/package.json",
14+
"RESOLVED_BIN": "$(rootpath @devinfra//bazel:node_modules/semver/dir)/package.json",
15+
"MANUAL_ROOT_PATH": "../bazel/node_modules/semver/package.json",
1616
"BAZELISK_HOME": "<TMP>",
1717
"BAZELISK_HOME_2": "<TMP>",
1818
},

bazel/integration/tests/custom_env_variables/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (require(process.env.RESOLVED_BIN).name !== 'semver') {
1515
process.exit(1);
1616
}
1717

18-
if (process.env.MANUAL_ROOT_PATH !== '../npm/node_modules/semver/package.json') {
18+
if (process.env.MANUAL_ROOT_PATH !== '../bazel/node_modules/semver/package.json') {
1919
console.error('Expected `MANUAL_ROOT_PATH` to be unmodified as it is not an expanded value.');
2020
process.exit(1);
2121
}

bazel/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"wait-on": "^8.0.3",
1919
"yargs": "18.0.0",
2020
"protractor": "7.0.0",
21+
"semver": "7.7.2",
2122
"selenium-webdriver": "4.34.0",
2223
"tinyglobby": "0.2.14"
2324
},

bazel/pnpm-lock.yaml

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

bazel/spec-bundling/test/core_apf_esm_test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
// This is an ESM import that would usually break within `jasmine_node_test` because it
2-
// consumes devmode CommonJS sources and `rules_nodejs` does not support ESM well yet.
3-
import {VERSION} from '@angular/core';
41
import * as core from '@angular/core';
52
import '@angular/compiler';
63

74
describe('@angular/core ESM import', () => {
85
it('should work', () => {
9-
expect(VERSION.major).toBeGreaterThanOrEqual(13);
6+
expect(core.VERSION.major).toBeGreaterThanOrEqual(13);
107
});
118

129
it('should have run the linker', () => {

bazel/spec-bundling/test/core_invalid_linker_decl.spec.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
// This is an ESM import that would usually break within `jasmine_node_test` because it
2-
// consumes devmode CommonJS sources and `rules_nodejs` does not support ESM well yet.
3-
import {VERSION} from '@angular/core';
41
import * as core from '@angular/core';
52
import '@angular/compiler';
63

74
describe('@angular/core ESM import', () => {
85
it('should work', () => {
9-
expect(VERSION.major).toBeGreaterThanOrEqual(13);
6+
expect(core.VERSION.major).toBeGreaterThanOrEqual(13);
107
});
118

129
it('should have run the linker', () => {

bazel/test/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
load("@aspect_rules_js//js:defs.bzl", "js_test")
12
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
2-
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test")
33
load("//bazel:extract_types.bzl", "extract_types")
44

55
ts_project(
@@ -31,9 +31,9 @@ extract_types(
3131
deps = [":test_lib"],
3232
)
3333

34-
nodejs_test(
34+
js_test(
3535
name = "extract_types_test",
3636
data = [":extract_types_target"],
3737
entry_point = "extract_types_test.js",
38-
templated_args = ["$(rootpaths :extract_types_target)"],
38+
fixed_args = ["$(rootpaths :extract_types_target)"],
3939
)

tools/esbuild.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test")
2-
load("//bazel:extract_js_module_output.bzl", "extract_js_module_output")
2+
load("//tools/esbuild/old-esbuild:extract_js_module_output.bzl", "extract_js_module_output")
33
load(
4-
"//bazel/esbuild:index.bzl",
4+
"//tools/esbuild/old-esbuild:index.bzl",
55
_esbuild = "esbuild",
66
_esbuild_cjs_bundle = "esbuild_cjs_bundle",
77
_esbuild_config = "esbuild_config",

0 commit comments

Comments
 (0)