Skip to content

Commit 64795cc

Browse files
authored
Revert "[PATCH] Migrate to use rules_js based ng_package (#30917)" (#30928)
This reverts commit 89db9f7.
1 parent 89db9f7 commit 64795cc

File tree

45 files changed

+3422
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3422
-158
lines changed

.bazelignore

+2
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ src/material-moment-adapter/node_modules
3131
src/material/node_modules
3232
src/universal-app/node_modules
3333
src/youtube-player/node_modules
34+
35+
tools/bazel/legacy-rnjs/node_modules

BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ load("//src/cdk:config.bzl", "CDK_ENTRYPOINTS")
33
load("//src/cdk-experimental:config.bzl", "CDK_EXPERIMENTAL_ENTRYPOINTS")
44
load("//src/material:config.bzl", "MATERIAL_ENTRYPOINTS", "MATERIAL_TESTING_ENTRYPOINTS")
55
load("//src/material-experimental:config.bzl", "MATERIAL_EXPERIMENTAL_ENTRYPOINTS", "MATERIAL_EXPERIMENTAL_TESTING_ENTRYPOINTS")
6-
load("@npm//:defs.bzl", "npm_link_all_packages")
6+
load("@npm2//:defs.bzl", "npm_link_all_packages")
77

88
package(default_visibility = ["//visibility:public"])
99

WORKSPACE

+30-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ http_archive(
1212
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.4/rules_nodejs-5.8.4.tar.gz"],
1313
)
1414

15-
# Add skylib which contains common Bazel utilities.
15+
# Add skylib which contains common Bazel utilities. Note that `rules_nodejs` would also
16+
# bring in the skylib repository but with an older version that does not support shorthands
17+
# for declaring Bazel build setting flags.
1618
http_archive(
1719
name = "bazel_skylib",
1820
sha256 = "a9c5d3a22461ed7063aa7b088f9c96fa0aaaa8b6984b601f84d705adc47d8a58",
@@ -54,6 +56,8 @@ load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
5456

5557
rules_js_dependencies()
5658

59+
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
60+
5761
NODE_VERSION = "22.0.0"
5862

5963
NODE_REPOSITORIES = {
@@ -66,17 +70,39 @@ NODE_REPOSITORIES = {
6670
"22.0.0-windows_amd64": ("node-v22.0.0-win-x64.zip", "node-v22.0.0-win-x64", "32d639b47d4c0a651ff8f8d7d41a454168a3d4045be37985f9a810cf8cef6174"),
6771
}
6872

73+
nodejs_register_toolchains(
74+
name = "nodejs",
75+
node_repositories = NODE_REPOSITORIES,
76+
node_version = NODE_VERSION,
77+
)
78+
6979
load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")
7080

7181
rules_js_register_toolchains(
7282
node_repositories = NODE_REPOSITORIES,
7383
node_version = NODE_VERSION,
7484
)
7585

86+
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
87+
88+
# TODO(devversion): Remove this once `ng_package` is ported over to `rules_js`.
89+
yarn_install(
90+
name = "npm",
91+
data = [
92+
"//tools/bazel/legacy-rnjs:.yarn/patches/@angular-bazel-https-c46f484fb8.patch",
93+
"//tools/bazel/legacy-rnjs:.yarn/releases/yarn-4.5.0.cjs",
94+
"//tools/bazel/legacy-rnjs:.yarnrc.yml",
95+
],
96+
exports_directories_only = False,
97+
package_json = "//tools/bazel/legacy-rnjs:package.json",
98+
yarn = "//tools/bazel/legacy-rnjs:.yarn/releases/yarn-4.5.0.cjs",
99+
yarn_lock = "//tools/bazel/legacy-rnjs:yarn.lock",
100+
)
101+
76102
load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
77103

78104
npm_translate_lock(
79-
name = "npm",
105+
name = "npm2",
80106
custom_postinstalls = {
81107
"@angular/animations": "node ../../@nginfra/angular-linking/index.mjs",
82108
"@angular/common": "node ../../@nginfra/angular-linking/index.mjs",
@@ -149,7 +175,7 @@ npm_translate_lock(
149175
verify_node_modules_ignored = "//:.bazelignore",
150176
)
151177

152-
load("@npm//:repositories.bzl", "npm_repositories")
178+
load("@npm2//:repositories.bzl", "npm_repositories")
153179

154180
npm_repositories()
155181

@@ -204,7 +230,7 @@ setup_dependencies_2()
204230

205231
git_repository(
206232
name = "rules_angular",
207-
commit = "005c80615934c891d729d5efc1ae661f9e3210c4",
233+
commit = "514eda9ec00a6745dc11b2a62d7be2634199171e",
208234
remote = "https://github.com/devversion/rules_angular.git",
209235
)
210236

docs/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
22
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_library", "js_test")
3-
load("@npm//:defs.bzl", "npm_link_all_packages")
3+
load("@npm2//:defs.bzl", "npm_link_all_packages")
44
load("//docs:defs.bzl", "ng_app")
55

66
package(default_visibility = ["//visibility:public"])

docs/defs.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@npm//:@angular-devkit/architect-cli/package_json.bzl", architect_cli = "bin")
1+
load("@npm2//:@angular-devkit/architect-cli/package_json.bzl", architect_cli = "bin")
22
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
33

44
# NOTE:

integration/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@npm//:defs.bzl", "npm_link_all_packages")
1+
load("@npm2//:defs.bzl", "npm_link_all_packages")
22

33
package(default_visibility = ["//visibility:public"])
44

package.json

-3
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
"karma-jasmine": "^4.0.1",
125125
"karma-parallel": "^0.3.1",
126126
"karma-sourcemap-loader": "^0.3.8",
127-
"magic-string": "0.30.17",
128127
"marked": "^2.0.0",
129128
"minimatch": "^3.0.4",
130129
"node-fetch": "^2.6.0",
@@ -136,8 +135,6 @@
136135
"reflect-metadata": "^0.1.13",
137136
"requirejs": "^2.3.6",
138137
"rollup": "^2.66.1",
139-
"rollup-plugin-dts": "6.2.1",
140-
"rollup-plugin-sourcemaps2": "0.5.0",
141138
"sass": "^1.80.6",
142139
"selenium-webdriver": "^3.6.0",
143140
"semver": "^7.3.5",

packages.bzl

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ PKG_GROUP_REPLACEMENTS = {
2020
# the peer dependencies and versions, primarily in `package.json`s.
2121
NPM_PACKAGE_SUBSTITUTIONS = dict(PKG_GROUP_REPLACEMENTS, **{
2222
# Peer dependency version on the Angular framework.
23-
"0.0.0-NG": "{{STABLE_FRAMEWORK_PEER_DEP_RANGE}}",
23+
"0.0.0-NG": "{STABLE_FRAMEWORK_PEER_DEP_RANGE}",
2424
# Version of the local package being built, generated via the `--workspace_status_command` flag.
25-
"0.0.0-PLACEHOLDER": "{{STABLE_PROJECT_VERSION}}",
25+
"0.0.0-PLACEHOLDER": "{STABLE_PROJECT_VERSION}",
2626
})
2727

2828
NO_STAMP_NPM_PACKAGE_SUBSTITUTIONS = dict(NPM_PACKAGE_SUBSTITUTIONS, **{

pnpm-lock.yaml

+14-72
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cdk-experimental/BUILD.bazel

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
load("//src/cdk-experimental:config.bzl", "CDK_EXPERIMENTAL_TARGETS")
22
load("//tools:defaults.bzl", "ng_package")
33
load("//tools:defaults2.bzl", "ts_project")
4-
load("@npm//:defs.bzl", "npm_link_all_packages")
4+
load("//tools/bazel:legacy_target.bzl", "get_legacy_label")
5+
load("@npm2//:defs.bzl", "npm_link_all_packages")
56

67
package(default_visibility = ["//visibility:public"])
78

@@ -28,5 +29,5 @@ ng_package(
2829
"//integration:__subpackages__",
2930
"//src/material-experimental:__subpackages__",
3031
],
31-
deps = CDK_EXPERIMENTAL_TARGETS,
32+
deps = [get_legacy_label(t) for t in CDK_EXPERIMENTAL_TARGETS],
3233
)

src/cdk-experimental/scrolling/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ ts_project(
5252
e2e_test_suite(
5353
name = "e2e_tests",
5454
deps = [
55-
":e2e_test_sources",
55+
":e2e_test_sources_legacy",
5656
],
5757
)

src/cdk/BUILD.bazel

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
load("//src/cdk:config.bzl", "CDK_ENTRYPOINTS", "CDK_ENTRYPOINTS_WITH_STYLES", "CDK_SCSS_LIBS", "CDK_TARGETS")
22
load("//tools:defaults.bzl", "ng_package", "sass_library")
33
load("//tools:defaults2.bzl", "ts_project")
4-
load("@npm//:defs.bzl", "npm_link_all_packages")
4+
load("//tools/bazel:legacy_target.bzl", "get_legacy_label")
5+
load("@npm2//:defs.bzl", "npm_link_all_packages")
56

67
package(default_visibility = ["//visibility:public"])
78

@@ -67,7 +68,7 @@ ng_package(
6768
"//goldens:__pkg__",
6869
"//integration:__subpackages__",
6970
],
70-
deps = CDK_TARGETS,
71+
deps = [get_legacy_label(t) for t in CDK_TARGETS],
7172
)
7273

7374
filegroup(

src/cdk/overlay/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ts_project(
9494
e2e_test_suite(
9595
name = "e2e_tests",
9696
deps = [
97-
":e2e_test_sources",
97+
":e2e_test_sources_legacy",
9898
],
9999
)
100100

src/cdk/schematics/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
1+
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin")
22
load("//tools:defaults2.bzl", "jasmine_test", "npm_package", "ts_project")
33
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")
44

src/cdk/testing/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ng_web_test_suite(
3838
e2e_test_suite(
3939
name = "protractor_e2e_tests",
4040
deps = [
41-
"//src/cdk/testing/tests:e2e_test_sources",
41+
"//src/cdk/testing/tests:e2e_test_sources_legacy",
4242
],
4343
)
4444

src/components-examples/BUILD.bazel

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ load("//tools/highlight-files:index.bzl", "highlight_files")
33
load("//tools/package-docs-content:index.bzl", "package_docs_content")
44
load(":config.bzl", "ALL_EXAMPLES")
55
load("//tools:defaults2.bzl", "ng_project")
6-
load("@npm//:defs.bzl", "npm_link_all_packages")
6+
load("//tools/bazel:legacy_target.bzl", "get_legacy_label")
7+
load("@npm2//:defs.bzl", "npm_link_all_packages")
78

89
package(default_visibility = ["//visibility:public"])
910

@@ -72,7 +73,7 @@ ng_package(
7273
],
7374
tags = ["docs-package"],
7475
visibility = ["//:__pkg__"],
75-
deps = [":components-examples"] + ALL_EXAMPLES,
76+
deps = [":components-examples_legacy"] + [get_legacy_label(t) for t in ALL_EXAMPLES],
7677
)
7778

7879
genrule(

src/dev-app/BUILD.bazel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("//tools:defaults.bzl", "sass_binary")
22
load("//tools:defaults2.bzl", "http_server", "ng_project")
3-
load("@npm//:defs.bzl", "npm_link_all_packages")
3+
load("@npm2//:defs.bzl", "npm_link_all_packages")
44
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
55
load("@aspect_rules_js//npm:defs.bzl", "npm_package")
66
load("//src/components-examples:config.bzl", "ALL_EXAMPLES")

0 commit comments

Comments
 (0)