Skip to content

Post migration cleanups #30146

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

Merged
merged 2 commits into from
Apr 23, 2025
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
1 change: 0 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ packages/schematics/angular/node_modules
modules/testing/builder/node_modules
tests/node_modules
tools/baseline_browserslist/node_modules
tools/legacy-rnjs/node_modules
16 changes: 0 additions & 16 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,6 @@ rules_js_register_toolchains(
node_version = DEFAULT_NODE_VERSION,
)

load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")

# TODO(devversion): Remove this once `ng_package` is ported over to `rules_js`.
yarn_install(
name = "npm",
data = [
"//tools/legacy-rnjs:.yarn/patches/@angular-bazel-https-67c38b3c32.patch",
"//tools/legacy-rnjs:.yarn/releases/yarn-4.5.0.cjs",
"//tools/legacy-rnjs:.yarnrc.yml",
],
exports_directories_only = False,
package_json = "//tools/legacy-rnjs:package.json",
yarn = "//tools/legacy-rnjs:.yarn/releases/yarn-4.5.0.cjs",
yarn_lock = "//tools/legacy-rnjs:yarn.lock",
)

http_archive(
name = "aspect_bazel_lib",
sha256 = "0b9b764ee5af1cbec01bcd2ca9ebd4aa4bbd700b17d7b8bb015769195fd88d20",
Expand Down
1 change: 0 additions & 1 deletion packages/angular/build/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ ts_project(
"//packages/angular/build:src/builders/ng-packagr/schema.ts",
],
data = RUNTIME_ASSETS,
module_name = "@angular/build",
deps = [
":node_modules/@ampproject/remapping",
":node_modules/@angular-devkit/architect",
Expand Down
3 changes: 1 addition & 2 deletions packages/angular/build/private/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

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

ts_project(
name = "private",
srcs = ["index.ts"],
module_name = "@angular/build/private",
deps = [
"//packages/angular/build",
],
Expand Down
1 change: 0 additions & 1 deletion packages/angular/cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ ts_project(
"//packages/angular/cli:src/commands/update/schematic/schema.ts",
],
data = RUNTIME_ASSETS,
module_name = "@angular/cli",
deps = [
":node_modules/@angular-devkit/architect",
":node_modules/@angular-devkit/core",
Expand Down
1 change: 0 additions & 1 deletion packages/angular/create/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ ts_project(
"src/*.ts",
]),
data = RUNTIME_ASSETS,
module_name = "@angular/create",
deps = [
"//:node_modules/@types/node",
"//packages/angular/cli:angular-cli",
Expand Down
1 change: 0 additions & 1 deletion packages/angular/pwa/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ ts_project(
"//packages/angular/pwa:pwa/schema.ts",
],
data = RUNTIME_ASSETS,
module_name = "@angular/pwa",
deps = [
":node_modules/@angular-devkit/schematics",
":node_modules/@schematics/angular",
Expand Down
1 change: 0 additions & 1 deletion packages/angular/ssr/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ ts_project(
data = [
"//packages/angular/ssr/third_party/beasties:beasties_bundled",
],
module_name = "@angular/ssr",
source_map = True,
tsconfig = "//:build-tsconfig-esm",
deps = [
Expand Down
3 changes: 1 addition & 2 deletions packages/angular/ssr/node/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

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

Expand All @@ -16,7 +16,6 @@ ts_project(
],
# TODO: Fix strict_deps failure
ignore_strict_deps = True,
module_name = "@angular/ssr/node",
source_map = True,
tsconfig = "//:build-tsconfig-esm",
deps = [
Expand Down
1 change: 0 additions & 1 deletion packages/angular/ssr/schematics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ ts_project(
"//packages/angular/ssr/schematics:" + src.replace(".json", ".ts")
for (src, _) in ALL_SCHEMA_TARGETS
],
module_name = "@angular/ssr/schematics",
deps = [
"//packages/angular/ssr:node_modules/@angular-devkit/schematics",
"//packages/angular/ssr:node_modules/@schematics/angular",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/architect/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ ts_project(
],
# Ensure tests can execute the output JS, relying on schemas/JSON files.
data = JSON_FILES,
module_name = "@angular-devkit/architect",
deps = [
":node_modules/@angular-devkit/core",
":node_modules/rxjs",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/architect/node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ ts_project(
include = ["**/*.ts"],
exclude = ["**/*_spec.ts"],
),
module_name = "@angular-devkit/architect/node",
deps = [
"//:node_modules/@types/node",
"//packages/angular_devkit/architect",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/architect/node/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

ts_project(
name = "test_lib",
Expand Down
3 changes: 1 addition & 2 deletions packages/angular_devkit/architect/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.dev/license

load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

licenses(["notice"])

Expand All @@ -15,7 +15,6 @@ ts_project(
include = ["**/*.ts"],
exclude = ["**/*_spec.ts"],
),
module_name = "@angular-devkit/architect/testing",
deps = [
"//:node_modules/@types/node",
"//packages/angular_devkit/architect",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/architect_cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ ts_project(
srcs = [
"bin/architect.ts",
] + glob(["src/**/*.ts"]),
module_name = "@angular-devkit/architect-cli",
deps = [
":node_modules/@angular-devkit/architect",
":node_modules/@angular-devkit/core",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/build_angular/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ ts_project(
"//packages/angular_devkit/build_angular:src/builders/web-test-runner/schema.ts",
],
data = RUNTIME_ASSETS,
module_name = "@angular-devkit/build-angular",
deps = [
":node_modules/@ampproject/remapping",
":node_modules/@angular-devkit/architect",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/build_webpack/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ ts_project(
"//packages/angular_devkit/build_webpack:src/builders/webpack/schema.ts",
],
data = RUNTIME_ASSETS,
module_name = "@angular-devkit/build-webpack",
deps = [
":node_modules/@angular-devkit/architect",
":node_modules/rxjs",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ ts_project(
],
) + ["index.ts"],
data = RUNTIME_ASSETS,
module_name = "@angular-devkit/core",
deps = [
":node_modules/ajv",
":node_modules/ajv-formats",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/core/node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ ts_project(
"**/*_spec.ts",
],
),
module_name = "@angular-devkit/core/node",
deps = [
"//:node_modules/@types/node",
"//packages/angular_devkit/core",
Expand Down
3 changes: 1 addition & 2 deletions packages/angular_devkit/core/node/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

# Copyright Google Inc. All Rights Reserved.
#
Expand All @@ -16,7 +16,6 @@ ts_project(
"**/*_spec.ts",
],
),
module_name = "@angular-devkit/core/node/testing",
deps = [
"//:node_modules/@types/jasmine",
"//:node_modules/@types/node",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/schematics/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ ts_project(
data = [
"package.json",
],
module_name = "@angular-devkit/schematics",
deps = [
":node_modules/@angular-devkit/core",
":node_modules/jsonc-parser",
Expand Down
3 changes: 1 addition & 2 deletions packages/angular_devkit/schematics/tasks/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

# Copyright Google Inc. All Rights Reserved.
#
Expand All @@ -18,7 +18,6 @@ ts_project(
],
),
data = ["package.json"],
module_name = "@angular-devkit/schematics/tasks",
deps = [
"//:node_modules/@types/node",
"//packages/angular_devkit/schematics",
Expand Down
3 changes: 1 addition & 2 deletions packages/angular_devkit/schematics/tasks/node/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

# Copyright Google Inc. All Rights Reserved.
#
Expand All @@ -16,7 +16,6 @@ ts_project(
"**/*_spec.ts",
],
),
module_name = "@angular-devkit/schematics/tasks/node",
deps = [
"//:node_modules/@types/node",
"//packages/angular_devkit/core",
Expand Down
3 changes: 1 addition & 2 deletions packages/angular_devkit/schematics/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

# Copyright Google Inc. All Rights Reserved.
#
Expand All @@ -14,7 +14,6 @@ ts_project(
include = ["**/*.ts"],
),
data = ["package.json"],
module_name = "@angular-devkit/schematics/testing",
deps = [
"//packages/angular_devkit/schematics",
"//packages/angular_devkit/schematics:node_modules/@angular-devkit/core",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/schematics/tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ ts_project(
],
),
data = ["package.json"],
module_name = "@angular-devkit/schematics/tools",
deps = [
"//:node_modules/@types/node",
"//packages/angular_devkit/schematics",
Expand Down
1 change: 0 additions & 1 deletion packages/angular_devkit/schematics_cli/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ ts_project(
"//packages/angular_devkit/schematics_cli:schematic/schema.ts",
],
data = RUNTIME_ASSETS,
module_name = "@angular-devkit/schematics-cli",
deps = [
":node_modules/@angular-devkit/core",
":node_modules/@angular-devkit/schematics",
Expand Down
1 change: 0 additions & 1 deletion packages/ngtools/webpack/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ ts_project(
data = [
"package.json",
],
module_name = "@ngtools/webpack",
deps = [
":node_modules/webpack",
"//:node_modules/@angular/compiler-cli",
Expand Down
1 change: 0 additions & 1 deletion packages/schematics/angular/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ ts_project(
for (src, _) in ALL_SCHEMA_TARGETS
],
data = RUNTIME_ASSETS,
module_name = "@schematics/angular",
deps = [
":node_modules/@angular-devkit/core",
":node_modules/@angular-devkit/schematics",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

# files fetched on 2025-03-03 from
# https://github.com/microsoft/TypeScript/releases/tag/v5.8.2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

# Copyright Google Inc. All Rights Reserved.
#
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@aspect_bazel_lib//lib:directory_path.bzl", "directory_path")
load("@npm2//:rollup/package_json.bzl", rollup = "bin")
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")
load(":e2e.bzl", "e2e_suites")

package(default_visibility = ["//visibility:public"])
Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/initialize/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

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

Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/setup/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

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

Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

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

Expand Down
2 changes: 1 addition & 1 deletion tests/legacy-cli/e2e/utils/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//tools:interop.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_project")

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

Expand Down
37 changes: 34 additions & 3 deletions tools/defaults.bzl
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", _copy_to_bin = "copy_to_bin")
load("@aspect_rules_jasmine//jasmine:defs.bzl", _jasmine_test = "jasmine_test")
load("@aspect_rules_js//js:defs.bzl", _js_binary = "js_binary")
load("@aspect_rules_ts//ts:defs.bzl", _ts_project = "ts_project")
load("@devinfra//bazel/ts_project:index.bzl", "strict_deps_test")
load("@rules_angular//src/ng_package:index.bzl", _ng_package = "ng_package")
load("//tools:interop.bzl", _ts_project = "ts_project")
load("//tools:substitutions.bzl", "substitutions")
load("//tools/bazel:npm_package.bzl", _npm_package = "npm_package")

def ts_project(**kwargs):
_ts_project(**kwargs)
def ts_project(
name,
deps = [],
tsconfig = None,
testonly = False,
visibility = None,
ignore_strict_deps = False,
**kwargs):
if tsconfig == None:
tsconfig = "//:test-tsconfig" if testonly else "//:build-tsconfig"

_ts_project(
name = name,
testonly = testonly,
declaration = True,
tsconfig = tsconfig,
visibility = visibility,
# Use the worker from our own Angular rules, as the default worker
# from `rules_ts` is incompatible with TS5+ and abandoned. We need
# worker for efficient, fast DX and avoiding Windows no-sandbox issues.
supports_workers = 1,
tsc_worker = "//tools:vanilla_ts_worker",
deps = deps,
**kwargs
)

if not ignore_strict_deps:
strict_deps_test(
name = "%s_strict_deps_test" % name,
srcs = kwargs.get("srcs", []),
deps = deps,
)

def npm_package(**kwargs):
_npm_package(**kwargs)
Expand Down
Loading
Loading