Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# @generated
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-2023857461
package.json=584705354
pnpm-lock.yaml=-183886713
pnpm-workspace.yaml=1711114604
yarn.lock=1731700542
6 changes: 4 additions & 2 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 Expand Up @@ -129,8 +133,6 @@ build:remote --jobs=150

# Setup the toolchain and platform for the remote build execution. The platform
# is provided by the shared dev-infra package and targets k8 remote containers.
build:remote --crosstool_top=@npm//@angular/build-tooling/bazel/remote-execution/cpp:cc_toolchain_suite
build:remote --extra_toolchains=@npm//@angular/build-tooling/bazel/remote-execution/cpp:cc_toolchain
build:remote --extra_execution_platforms=@npm//@angular/build-tooling/bazel/remote-execution:platform_with_network
build:remote --host_platform=@npm//@angular/build-tooling/bazel/remote-execution:platform_with_network
build:remote --platforms=@npm//@angular/build-tooling/bazel/remote-execution:platform_with_network
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
2 changes: 0 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
"import/newline-after-import": "error",
"import/no-absolute-path": "error",
"import/no-duplicates": "error",
"import/no-extraneous-dependencies": ["off", { "devDependencies": false }],
"import/no-unassigned-import": ["error", { "allow": ["symbol-observable"] }],
"import/order": [
"error",
Expand Down Expand Up @@ -142,7 +141,6 @@
{
"files": ["!packages/**", "**/*_spec.ts"],
"rules": {
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
"max-lines-per-function": "off",
"no-case-declarations": "off",
"no-console": "off"
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ jobs:
run: yarn install --immutable
- name: Run module and package tests
run: yarn bazel test //modules/... //packages/...
env:
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1'

e2e:
strategy:
Expand All @@ -75,12 +77,6 @@ jobs:
subset: [npm, esbuild]
shard: [0, 1, 2, 3, 4, 5]
exclude:
# Skip yarn subset on Windows
- os: windows-latest
subset: yarn
# Skip pnpm subset on Windows
- os: windows-latest
subset: pnpm
# Skip Node.js v18 tests on Windows
- os: windows-latest
node: 18
Expand All @@ -89,6 +85,10 @@ jobs:
node: 20
runs-on: ${{ matrix.os }}
steps:
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
# TODO(devversion): Remove when Aspect lib issue is fixed.
- run: choco install gzip
if: ${{matrix.os == 'windows-latest'}}
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@40b2cbdbcc40f36f125d721c4e8decd3bb607ea4
- name: Install node modules
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ jobs:
run: yarn install --immutable
- name: Run module and package tests
run: yarn bazel test //modules/... //packages/...
env:
ASPECT_RULES_JS_FROZEN_PNPM_LOCK: '1'

e2e:
strategy:
Expand All @@ -124,6 +126,9 @@ jobs:
e2e-windows-subset:
runs-on: windows-latest
steps:
# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
# TODO(devversion): Remove when Aspect lib issue is fixed.
- run: choco install gzip
- name: Initialize environment
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@40b2cbdbcc40f36f125d721c4e8decd3bb607ea4
- name: Install node modules
Expand Down
8 changes: 7 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
engine-strict = true
# Yarn Berry doesn't check engines at all, so pnpm shouldn't either.
engine-strict = false

# 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
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
dist/
/tests/legacy-cli/e2e/assets/
/tools/test/*.json
pnpm-lock.yaml
25 changes: 25 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,28 @@ exports_files([
"package.json",
])

npm_link_all_packages(
name = "root_modules",
)

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

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

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

DEFAULT_NODE_VERSION = "18.19.1"

# Workaround for: https://github.com/bazel-contrib/bazel-lib/issues/968.
# Override toolchain for tar on windows.
register_toolchains(
"//tools:windows_tar_system_toolchain",
)

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

http_archive(
name = "bazel_skylib",
Expand All @@ -30,6 +35,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 = "3388abe9b9728ef68ea8d8301f932b11b2c9a271d74741ddd5f3b34d1db843ac",
strip_prefix = "rules_js-2.1.1",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.1.1/rules_js-v2.1.1.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 +89,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 +122,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 +178,49 @@ 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",
data = [
"//:package.json",
"//:pnpm-workspace.yaml",
],
npmrc = "//:.npmrc",
patches = {
# Note: Patches not needed as the existing patches are only
# for `rules_nodejs` dependencies :)
},
pnpm_lock = "//:pnpm-lock.yaml",
update_pnpm_lock = True,
verify_node_modules_ignored = "//:.bazelignore",
yarn_lock = "//:yarn.lock",
)

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

npm_repositories()

http_archive(
name = "aspect_rules_ts",
patch_args = ["-p1"],
patches = ["//tools:rules_ts_windows.patch"],
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",
)

http_file(
name = "tsc_worker",
sha256 = "",
urls = ["https://raw.githubusercontent.com/devversion/rules_angular/a270a74d1e64577bddba96a5484c7c5d2c5d2770/dist/worker.mjs"],
)
26 changes: 10 additions & 16 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 All @@ -42,19 +41,11 @@
"url": "https://github.com/angular/angular-cli/issues"
},
"homepage": "https://github.com/angular/angular-cli",
"workspaces": {
"packages": [
"packages/angular/*",
"packages/angular_devkit/*",
"packages/ngtools/*",
"packages/schematics/*"
]
},
"devDependencies": {
"@ampproject/remapping": "2.3.0",
"@angular/animations": "19.0.0",
"@angular/bazel": "patch:@angular/bazel@https%3A//github.com/angular/bazel-builds.git%23commit=07617f0f8540d27f8895b1820a6f994e1e5b7277#~/.yarn/patches/@angular-bazel-https-9848736cf4.patch",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#3ba5a1f997a072caffcf19f9c767e7e570043898",
"@angular/bazel": "https://github.com/angular/bazel-builds.git#07617f0f8540d27f8895b1820a6f994e1e5b7277",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a35ad7f4e30ae1fc531517867efcae89cce5afa2",
"@angular/cdk": "19.0.0-rc.3",
"@angular/common": "19.0.0",
"@angular/compiler": "19.0.0",
Expand All @@ -81,8 +72,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 @@ -175,6 +166,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 @@ -225,8 +217,10 @@
"built": true
}
},
"pnpm": {
"onlyBuiltDependencies": []
},
"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"
"typescript": "5.6.3"
}
}
Loading
Loading