build: migrate @angular/cli tests to use rules_js

Integrates `@angular/cli` into the pnpm workspace and wires up the
native `rules_js` rules.

One nice benefits that highlight here:

- `resolve` runtime dependency is only installed in the CLI folder, and
  we can pull it from there. --> Locally managed deps! :yay:
This commit is contained in:
Paul Gschwendtner 2025-01-16 12:16:57 +00:00
parent 485f0679e6
commit 1a4157d88c
9 changed files with 272 additions and 238 deletions

View File

@ -3,8 +3,11 @@
# This file should be checked into version control along with the pnpm-lock.yaml file. # This file should be checked into version control along with the pnpm-lock.yaml file.
.npmrc=-2023857461 .npmrc=-2023857461
package.json=-1983260945 package.json=-1983260945
packages/angular_devkit/architect/package.json=-107274537 packages/angular/cli/package.json=-1878910022
packages/angular_devkit/architect/package.json=-1496633956
packages/angular_devkit/core/package.json=339935828 packages/angular_devkit/core/package.json=339935828
pnpm-lock.yaml=-2133021503 packages/angular_devkit/schematics/package.json=673943597
pnpm-workspace.yaml=-1853274682 packages/schematics/angular/package.json=251715148
pnpm-lock.yaml=-1580789254
pnpm-workspace.yaml=1839001260
yarn.lock=577341343 yarn.lock=577341343

View File

@ -186,8 +186,11 @@ npm_translate_lock(
data = [ data = [
"//:package.json", "//:package.json",
"//:pnpm-workspace.yaml", "//:pnpm-workspace.yaml",
"//packages/angular/cli:package.json",
"//packages/angular_devkit/architect:package.json", "//packages/angular_devkit/architect:package.json",
"//packages/angular_devkit/core:package.json", "//packages/angular_devkit/core:package.json",
"//packages/angular_devkit/schematics:package.json",
"//packages/schematics/angular:package.json",
], ],
npmrc = "//:.npmrc", npmrc = "//:.npmrc",
patches = { patches = {

View File

@ -3,8 +3,8 @@
# Use of this source code is governed by an MIT-style license that can be # 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 # found in the LICENSE file at https://angular.dev/license
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test") load("@npm2//:defs.bzl", "npm_link_all_packages")
load("//tools:defaults2.bzl", "npm_package", "ts_project") load("//tools:defaults2.bzl", "jasmine_test", "npm_package", "ts_project")
load("//tools:ng_cli_schema_generator.bzl", "cli_json_schema") load("//tools:ng_cli_schema_generator.bzl", "cli_json_schema")
load("//tools:ts_json_schema.bzl", "ts_json_schema") load("//tools:ts_json_schema.bzl", "ts_json_schema")
@ -12,6 +12,8 @@ licenses(["notice"])
package(default_visibility = ["//visibility:public"]) package(default_visibility = ["//visibility:public"])
npm_link_all_packages()
RUNTIME_ASSETS = glob( RUNTIME_ASSETS = glob(
include = [ include = [
"bin/**/*", "bin/**/*",
@ -43,6 +45,10 @@ ts_project(
data = RUNTIME_ASSETS, data = RUNTIME_ASSETS,
module_name = "@angular/cli", module_name = "@angular/cli",
deps = [ deps = [
":node_modules/@angular-devkit/architect",
":node_modules/@angular-devkit/core",
":node_modules/@angular-devkit/schematics",
":node_modules/resolve",
"//:node_modules/@angular/core", "//:node_modules/@angular/core",
"//:node_modules/@inquirer/prompts", "//:node_modules/@inquirer/prompts",
"//:node_modules/@listr2/prompt-adapter-inquirer", "//:node_modules/@listr2/prompt-adapter-inquirer",
@ -62,14 +68,8 @@ ts_project(
"//:node_modules/npm-pick-manifest", "//:node_modules/npm-pick-manifest",
"//:node_modules/pacote", "//:node_modules/pacote",
"//:node_modules/semver", "//:node_modules/semver",
"//:node_modules/symbol-observable",
"//:node_modules/yargs", "//:node_modules/yargs",
"//packages/angular_devkit/architect:architect_rjs",
"//packages/angular_devkit/architect/node:node_rjs",
"//packages/angular_devkit/core:core_rjs",
"//packages/angular_devkit/core/node:node_rjs",
"//packages/angular_devkit/schematics:schematics_rjs",
"//packages/angular_devkit/schematics/tasks:tasks_rjs",
"//packages/angular_devkit/schematics/tools:tools_rjs",
], ],
) )
@ -148,9 +148,9 @@ ts_project(
], ],
) )
jasmine_node_test( jasmine_test(
name = "angular-cli_test", name = "angular-cli_test",
srcs = [":angular-cli_test_lib"], data = [":angular-cli_test_lib_rjs"],
) )
genrule( genrule(

View File

@ -22,12 +22,12 @@
}, },
"homepage": "https://github.com/angular/angular-cli", "homepage": "https://github.com/angular/angular-cli",
"dependencies": { "dependencies": {
"@angular-devkit/architect": "0.0.0-EXPERIMENTAL-PLACEHOLDER", "@angular-devkit/architect": "workspace:0.0.0-EXPERIMENTAL-PLACEHOLDER",
"@angular-devkit/core": "0.0.0-PLACEHOLDER", "@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER", "@angular-devkit/schematics": "workspace:0.0.0-PLACEHOLDER",
"@inquirer/prompts": "7.2.3", "@inquirer/prompts": "7.2.3",
"@listr2/prompt-adapter-inquirer": "2.0.18", "@listr2/prompt-adapter-inquirer": "2.0.18",
"@schematics/angular": "0.0.0-PLACEHOLDER", "@schematics/angular": "workspace:0.0.0-PLACEHOLDER",
"@yarnpkg/lockfile": "1.1.0", "@yarnpkg/lockfile": "1.1.0",
"ini": "5.0.0", "ini": "5.0.0",
"jsonc-parser": "3.3.1", "jsonc-parser": "3.3.1",

View File

@ -6,7 +6,7 @@
"main": "src/index.js", "main": "src/index.js",
"typings": "src/index.d.ts", "typings": "src/index.d.ts",
"dependencies": { "dependencies": {
"@angular-devkit/core": "0.0.0-PLACEHOLDER", "@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
"rxjs": "7.8.1" "rxjs": "7.8.1"
}, },
"builders": "./builders/builders.json" "builders": "./builders/builders.json"

View File

@ -13,7 +13,7 @@
"schematics" "schematics"
], ],
"dependencies": { "dependencies": {
"@angular-devkit/core": "0.0.0-PLACEHOLDER", "@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
"jsonc-parser": "3.3.1", "jsonc-parser": "3.3.1",
"magic-string": "0.30.17", "magic-string": "0.30.17",
"ora": "5.4.1", "ora": "5.4.1",

View File

@ -17,8 +17,8 @@
}, },
"schematics": "./collection.json", "schematics": "./collection.json",
"dependencies": { "dependencies": {
"@angular-devkit/core": "0.0.0-PLACEHOLDER", "@angular-devkit/core": "workspace:0.0.0-PLACEHOLDER",
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER", "@angular-devkit/schematics": "workspace:0.0.0-PLACEHOLDER",
"jsonc-parser": "3.3.1" "jsonc-parser": "3.3.1"
} }
} }

457
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -2,3 +2,6 @@ packages:
- . - .
- packages/angular_devkit/architect - packages/angular_devkit/architect
- packages/angular_devkit/core - packages/angular_devkit/core
- packages/angular_devkit/schematics
- packages/angular/cli
- packages/schematics/angular