Skip to content
Closed
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
4 changes: 4 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Disable NG CLI TTY mode
build --action_env=NG_FORCE_TTY=false

# Required by `rules_ts`.
common --@aspect_rules_ts//ts:skipLibCheck=always
common --@aspect_rules_ts//ts:default_to_tsc_transpiler

# Make TypeScript compilation fast, by keeping a few copies of the compiler
# running as daemons, and cache SourceFile AST's to reduce parse time.
build --strategy=TypeScriptCompile=worker
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.4.1
6.5.0
5 changes: 5 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
engine-strict = true

# Disabling pnpm [hoisting](https://pnpm.io/npmrc#hoist) by setting `hoist=false` is recommended on
# projects using rules_js so that pnpm outside of Bazel lays out a node_modules tree similar to what
# rules_js lays out under Bazel (without a hidden node_modules/.pnpm/node_modules)
hoist=false
16 changes: 16 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
load("@aspect_rules_ts//ts:defs.bzl", rules_js_tsconfig = "ts_config")

# Copyright Google Inc. All Rights Reserved.
#
# 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("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("@build_bazel_rules_nodejs//:index.bzl", "copy_to_bin")
load("@npm//@bazel/concatjs:index.bzl", "ts_config")
load("@npm2//:defs.bzl", "npm_link_all_packages")

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

Expand All @@ -19,6 +22,19 @@ exports_files([
"package.json",
])

npm_link_all_packages(
name = "node_modules",
)

rules_js_tsconfig(
name = "build-tsconfig",
src = "tsconfig-build.json",
deps = [
"tsconfig.json",
"//:node_modules/@types/node",
],
)

# Files required by e2e tests
copy_to_bin(
name = "config-files",
Expand Down
69 changes: 58 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
workspace(
name = "angular_cli",
managed_directories = {"@npm": ["node_modules"]},
)
workspace(name = "angular_cli")

DEFAULT_NODE_VERSION = "18.19.1"

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

Expand Down Expand Up @@ -30,6 +29,17 @@ load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_d

build_bazel_rules_nodejs_dependencies()

http_archive(
name = "aspect_rules_js",
sha256 = "75c25a0f15a9e4592bbda45b57aa089e4bf17f9176fd735351e8c6444df87b52",
strip_prefix = "rules_js-2.1.0",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.1.0/rules_js-v2.1.0.tar.gz",
)

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()

http_archive(
name = "rules_pkg",
sha256 = "8c20f74bca25d2d442b327ae26768c02cf3c99e93fad0381f32be9aab1967675",
Expand Down Expand Up @@ -73,7 +83,7 @@ nodejs_register_toolchains(
name = "nodejs",
# The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701
node_repositories = NODE_18_REPO,
node_version = "18.19.1",
node_version = DEFAULT_NODE_VERSION,
)

nodejs_register_toolchains(
Expand Down Expand Up @@ -106,25 +116,29 @@ nodejs_register_toolchains(
node_version = "22.0.0",
)

load("@aspect_rules_js//js:toolchains.bzl", "rules_js_register_toolchains")

rules_js_register_toolchains(
node_repositories = NODE_18_REPO,
node_version = DEFAULT_NODE_VERSION,
)

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

yarn_install(
name = "npm",
data = [
"//:.yarn/patches/@angular-bazel-https-9848736cf4.patch",
"//:.yarn/patches/@bazel-concatjs-npm-5.8.1-1bf81df846.patch",
"//:.yarn/patches/@bazel-jasmine-npm-5.8.1-3370fee155.patch",
"//:.yarn/releases/yarn-4.5.0.cjs",
"//:.yarnrc.yml",
"//:patches/@angular+bazel+19.0.0-next.7.patch",
"//:patches/@bazel+concatjs+5.8.1.patch",
"//:patches/@bazel+jasmine+5.8.1.patch",
],
# Currently disabled due to:
# 1. Missing Windows support currently.
# 2. Incompatibilites with the `ts_library` rule.
exports_directories_only = False,
package_json = "//:package.json",
# We prefer to symlink the `node_modules` to only maintain a single install.
# See https://github.com/angular/dev-infra/pull/446#issuecomment-1059820287 for details.
symlink_node_modules = True,
yarn = "//:.yarn/releases/yarn-4.5.0.cjs",
yarn_lock = "//:yarn.lock",
)
Expand Down Expand Up @@ -158,3 +172,36 @@ load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "
esbuild_repositories(
npm_repository = "npm",
)

load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")

npm_translate_lock(
name = "npm2",
npmrc = "//:.npmrc",
patches = {
# Note: Patches not needed as the existing patches are only
# for `rules_nodejs` dependencies :)
},
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
yarn_lock = "yarn.lock",
)

load("@npm2//:repositories.bzl", "npm_repositories")

npm_repositories()

http_archive(
name = "aspect_rules_ts",
sha256 = "9acd128abe77397505148eaa6895faed57839560dbf2177dd6285e51235e2724",
strip_prefix = "rules_ts-3.3.1",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.3.1/rules_ts-v3.3.1.tar.gz",
)

load("@aspect_rules_ts//ts:repositories.bzl", "rules_ts_dependencies")

rules_ts_dependencies(
# ts_version_from = "//:package.json",
# TODO: Support in https://github.com/aspect-build/rules_ts/blob/main/ts/private/npm_repositories.bzl
ts_version = "5.6.2",
)
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
"sdk",
"Angular DevKit"
],
"packageManager": "[email protected]",
"scripts": {
"admin": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only ./scripts/devkit-admin.mjs",
"test": "bazel test //packages/...",
"build": "yarn admin build",
"lint": "eslint --cache --max-warnings=0 \"**/*.@(ts|mts|cts)\"",
"templates": "yarn admin templates",
"validate": "yarn admin validate",
"postinstall": "yarn webdriver-update && yarn husky",
"postinstall": "patch-package && yarn webdriver-update && yarn husky",
"//webdriver-update-README": "ChromeDriver version must match Puppeteer Chromium version, see https://github.com/GoogleChrome/puppeteer/releases http://chromedriver.chromium.org/downloads",
"webdriver-update": "webdriver-manager update --standalone false --gecko false --versions.chrome 106.0.5249.21",
"public-api:check": "node goldens/public-api/manage.js test",
Expand Down Expand Up @@ -53,7 +52,7 @@
"devDependencies": {
"@ampproject/remapping": "2.3.0",
"@angular/animations": "19.0.0-rc.1",
"@angular/bazel": "patch:@angular/bazel@https%3A//github.com/angular/bazel-builds.git%23commit=07617f0f8540d27f8895b1820a6f994e1e5b7277#~/.yarn/patches/@angular-bazel-https-9848736cf4.patch",
"@angular/bazel": "https://github.com/angular/bazel-builds.git#07617f0f8540d27f8895b1820a6f994e1e5b7277",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#05c3497d4fd04f5eb711a02dd24d0bca2766c93b",
"@angular/cdk": "19.0.0-rc.2",
"@angular/common": "19.0.0-rc.1",
Expand Down Expand Up @@ -81,8 +80,8 @@
"@babel/runtime": "7.26.0",
"@bazel/bazelisk": "1.23.0",
"@bazel/buildifier": "7.3.1",
"@bazel/concatjs": "patch:@bazel/concatjs@npm%3A5.8.1#~/.yarn/patches/@bazel-concatjs-npm-5.8.1-1bf81df846.patch",
"@bazel/jasmine": "patch:@bazel/jasmine@npm%3A5.8.1#~/.yarn/patches/@bazel-jasmine-npm-5.8.1-3370fee155.patch",
"@bazel/concatjs": "5.8.1",
"@bazel/jasmine": "5.8.1",
"@bazel/rollup": "^5.8.1",
"@bazel/runfiles": "^5.8.1",
"@discoveryjs/json-ext": "0.6.3",
Expand Down Expand Up @@ -176,6 +175,7 @@
"ora": "5.4.1",
"pacote": "20.0.0",
"parse5-html-rewriting-stream": "7.0.0",
"patch-package": "^8.0.0",
"picomatch": "4.0.2",
"piscina": "4.7.0",
"postcss": "8.4.49",
Expand Down Expand Up @@ -226,8 +226,7 @@
"built": true
}
},
"resolutions": {
"@bazel/concatjs@npm:5.8.1": "patch:@bazel/concatjs@npm%3A5.8.1#~/.yarn/patches/@bazel-concatjs-npm-5.8.1-1bf81df846.patch",
"@microsoft/api-extractor/typescript": "5.6.3"
"pnpm": {
"onlyBuiltDependencies": []
}
}
9 changes: 6 additions & 3 deletions packages/angular_devkit/architect/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@
# 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("@aspect_rules_ts//ts:defs.bzl", "ts_project")
load("//tools:defaults.bzl", "ts_library")

licenses(["notice"])

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

ts_library(
ts_project(
name = "testing",
srcs = glob(
include = ["**/*.ts"],
exclude = ["**/*_spec.ts"],
),
module_name = "@angular-devkit/architect/testing",
module_root = "index.d.ts",
declaration = True,
#module_name = "@angular-devkit/architect/testing",
# module_root = "index.d.ts",
tsconfig = "//:build-tsconfig",
deps = [
"//packages/angular_devkit/architect",
"//packages/angular_devkit/core",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/src/ng_package/packager.mjs b/src/ng_package/packager.mjs
diff --git a/node_modules/@angular/bazel/src/ng_package/packager.mjs b/node_modules/@angular/bazel/src/ng_package/packager.mjs
index 5c1f3a2c72e28a90b666c96b2fe9755cdafd5259..47034ceeb0b9ab9c1e9bee50239723a51d2e2e19 100755
--- a/src/ng_package/packager.mjs
+++ b/src/ng_package/packager.mjs
--- a/node_modules/@angular/bazel/src/ng_package/packager.mjs
+++ b/node_modules/@angular/bazel/src/ng_package/packager.mjs
@@ -7,7 +7,7 @@
*/
import * as fs from 'fs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
diff --git a/internal/build_defs.bzl b/internal/build_defs.bzl
diff --git a/node_modules/@bazel/concatjs/internal/build_defs.bzl b/node_modules/@bazel/concatjs/internal/build_defs.bzl
index 9e5cda684f0456b61d1b6c0f9c56ae021594713f..6c45196bda5880531d32618dfca0dee44c035cb9 100755
--- a/internal/build_defs.bzl
+++ b/internal/build_defs.bzl
--- a/node_modules/@bazel/concatjs/internal/build_defs.bzl
+++ b/node_modules/@bazel/concatjs/internal/build_defs.bzl
@@ -76,7 +76,7 @@ _TYPESCRIPT_TYPINGS = Label(
"//typescript:typescript__typings",
)

-_TYPESCRIPT_SCRIPT_TARGETS = ["es3", "es5", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020", "esnext"]
+_TYPESCRIPT_SCRIPT_TARGETS = ["es3", "es5", "es2015", "es2016", "es2017", "es2018", "es2019", "es2020", "es2022", "esnext"]
_TYPESCRIPT_MODULE_KINDS = ["none", "commonjs", "amd", "umd", "system", "es2015", "esnext"]

_DEVMODE_TARGET_DEFAULT = "es2015"
diff --git a/internal/common/tsconfig.bzl b/internal/common/tsconfig.bzl
diff --git a/node_modules/@bazel/concatjs/internal/common/tsconfig.bzl b/node_modules/@bazel/concatjs/internal/common/tsconfig.bzl
index b01c999f5e02b388f51a508b0b608cf69db9b664..847c23fe4829d0c847e9b4bd1ad698e1ccea720e 100755
--- a/internal/common/tsconfig.bzl
+++ b/internal/common/tsconfig.bzl
--- a/node_modules/@bazel/concatjs/internal/common/tsconfig.bzl
+++ b/node_modules/@bazel/concatjs/internal/common/tsconfig.bzl
@@ -211,9 +211,6 @@ def create_tsconfig(
# will convert that to goog.module syntax.
"module": "umd" if devmode_manifest or has_node_runtime else "esnext",

- # Has no effect in closure/ES2015 mode. Always true just for simplicity.
- "downlevelIteration": True,
-
Expand All @@ -28,7 +28,7 @@ index b01c999f5e02b388f51a508b0b608cf69db9b664..847c23fe4829d0c847e9b4bd1ad698e1
@@ -248,13 +245,6 @@ def create_tsconfig(
# "short name" mappings for npm packages, such as "@angular/core"
"paths": mapped_module_roots,

- # Inline const enums.
- "preserveConstEnums": False,
-
Expand All @@ -38,7 +38,7 @@ index b01c999f5e02b388f51a508b0b608cf69db9b664..847c23fe4829d0c847e9b4bd1ad698e1
-
# Interpret JSX as React calls (until someone asks for something different)
"jsx": "react",

@@ -277,12 +267,6 @@ def create_tsconfig(
# always emit declaration files in the same location as outDir.
"declarationDir": "/".join([workspace_path, outdir_path]),
Expand All @@ -50,12 +50,12 @@ index b01c999f5e02b388f51a508b0b608cf69db9b664..847c23fe4829d0c847e9b4bd1ad698e1
- # Implied by inlineSourceMap: True
- "sourceMap": False,
}

# "node_modules" still checked for backward compat for ng_module
diff --git a/internal/tsetse/rules/must_use_promises_rule.js b/internal/tsetse/rules/must_use_promises_rule.js
diff --git a/node_modules/@bazel/concatjs/internal/tsetse/rules/must_use_promises_rule.js b/node_modules/@bazel/concatjs/internal/tsetse/rules/must_use_promises_rule.js
index e404d01cf80ab4da4b9cca89005b14a60b7d8c79..85488d9a339982af4495d2b5f4c30effb98a538b 100755
--- a/internal/tsetse/rules/must_use_promises_rule.js
+++ b/internal/tsetse/rules/must_use_promises_rule.js
--- a/node_modules/@bazel/concatjs/internal/tsetse/rules/must_use_promises_rule.js
+++ b/node_modules/@bazel/concatjs/internal/tsetse/rules/must_use_promises_rule.js
@@ -30,6 +30,10 @@ function checkCallExpression(checker, node) {
if (tsutils.isExpressionValueUsed(node) || !inAsyncFunction(node)) {
return;
Expand Down
8 changes: 4 additions & 4 deletions [email protected] → patches/@bazel+jasmine+5.8.1.patch
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
diff --git a/jasmine_runner.js b/jasmine_runner.js
diff --git a/node_modules/@bazel/jasmine/jasmine_runner.js b/node_modules/@bazel/jasmine/jasmine_runner.js
index 097eb920357f5f02e5b6592e0e4be27c0b4bf25d..bd55c2dad833b32a9e644fed8c7d6b626cd01128 100755
--- a/jasmine_runner.js
+++ b/jasmine_runner.js
--- a/node_modules/@bazel/jasmine/jasmine_runner.js
+++ b/node_modules/@bazel/jasmine/jasmine_runner.js
@@ -147,7 +147,7 @@ async function main(args) {
// TODO(6.0): remove support for deprecated versions of Jasmine that use the old API &
// remember to update the `peerDependencies` as well.
// Jasmine versions prior to 4.0.0 should use the old API.
- if (jrunner.coreVersion().charAt(0) !== '4') {
+ if (+jrunner.coreVersion().charAt(0) < 4) {
console.warn(`DEPRECATED: Support for Jasmine versions prior to '4.0.x' is deprecated in '@bazel/jasmine'.`);

// Old Jasmine API.
Loading