Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d081ef9

Browse filesBrowse files
committed
build: replace all ng_package with new rule from rules_angular (#61843)
Replaces all `ng_package` rule with the new rule from `rules_angular`. PR Close #61843
1 parent 579618d commit d081ef9
Copy full SHA for d081ef9

35 files changed

+268-180Lines changed: 268 additions & 180 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx‎

Copy file name to clipboardExpand all lines: .aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.npmrc=-1406867100
55
.pnpmfile.cjs=-2033668682
66
adev/shared-docs/pipeline/api-gen/package.json=939673974
7+
integration/package.json=-239561259
78
modules/package.json=-1315257891
89
package.json=288136953
910
packages/animations/package.json=-678724831
@@ -20,7 +21,7 @@ packages/platform-browser/package.json=-1163479450
2021
packages/router/package.json=860819913
2122
packages/upgrade/package.json=16347051
2223
packages/zone.js/package.json=-1545343303
23-
pnpm-lock.yaml=481102297
24-
pnpm-workspace.yaml=-1489095561
24+
pnpm-lock.yaml=1289250097
25+
pnpm-workspace.yaml=1973735808
2526
tools/bazel/rules_angular_store/package.json=-239561259
2627
yarn.lock=1099737031
Collapse file

‎.bazelignore‎

Copy file name to clipboardExpand all lines: .bazelignore
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ modules/ssr-benchmarks/node_modules
4242
# For rules_js
4343
adev/shared-docs/pipeline/api-gen/node_modules
4444
modules/node_modules
45+
integration/node_modules
4546
packages/animations/node_modules
4647
packages/common/node_modules
4748
packages/localize/node_modules
Collapse file

‎WORKSPACE‎

Copy file name to clipboardExpand all lines: WORKSPACE
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ npm_translate_lock(
111111
"//:package.json",
112112
"//:pnpm-workspace.yaml",
113113
"//adev/shared-docs/pipeline/api-gen:package.json",
114+
"//integration:package.json",
114115
"//modules:package.json",
115116
"//packages/animations:package.json",
116117
"//packages/common:package.json",
Collapse file

‎adev/tools/local_deps/index.bzl‎

Copy file name to clipboardExpand all lines: adev/tools/local_deps/index.bzl
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def link_local_packages(all_deps):
2929
pkg_name = _angular_dep_to_pkg_name(dep)
3030
npm_link(
3131
name = _npm_link_name(pkg_name),
32-
target = to_package_label(pkg_name),
32+
target = to_package_label(pkg_name) + "__adev_link",
3333
package_name = pkg_name,
3434
package_path = native.package_name(),
3535
tags = ["manual"],
Collapse file

‎integration/BUILD.bazel‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
load("@npm2//:defs.bzl", "npm_link_all_packages")
2+
3+
npm_link_all_packages()
Collapse file

‎integration/ng-modules-importability/BUILD.bazel‎

Copy file name to clipboardExpand all lines: integration/ng-modules-importability/BUILD.bazel
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ ts_project(
88
data = [
99
"//packages:package_json",
1010
],
11-
interop_deps = [
12-
"//packages/compiler-cli",
13-
],
1411
tsconfig = "tsconfig.json",
1512
deps = [
1613
"//:node_modules/@types/node",
1714
"//:node_modules/typescript",
15+
"//integration:node_modules/@angular/compiler-cli",
1816
],
1917
)
2018

Collapse file
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
load("@aspect_rules_js//js:defs.bzl", "js_test")
12
load("@bazel_skylib//rules:write_file.bzl", "write_file")
2-
load("//tools:defaults.bzl", "nodejs_test")
33

44
def module_test(name, npm_packages, skipped_entry_points = [], additional_deps = [], **kwargs):
55
write_file(
@@ -11,14 +11,13 @@ def module_test(name, npm_packages, skipped_entry_points = [], additional_deps =
1111
})],
1212
)
1313

14-
nodejs_test(
14+
js_test(
1515
name = "test",
1616
data = [
1717
":%s_config" % name,
18-
"//integration/ng-modules-importability:test_lib",
18+
"//integration/ng-modules-importability:test_lib_rjs",
1919
] + additional_deps + [pkg[0] for pkg in npm_packages.items()],
2020
entry_point = "//integration/ng-modules-importability:index.mjs",
21-
enable_linker = True,
22-
templated_args = ["$(rootpath :%s_config)" % name],
21+
fixed_args = ["$(rootpath :%s_config)" % name],
2322
**kwargs
2423
)
Collapse file

‎integration/ng-modules-importability/index.mts‎

Copy file name to clipboardExpand all lines: integration/ng-modules-importability/index.mts
+10-4Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {performCompilation} from '../../packages/compiler-cli/index.js';
1+
import {performCompilation} from '@angular/compiler-cli';
22
import * as fs from 'fs/promises';
33
import * as path from 'path';
44
import * as os from 'os';
@@ -33,6 +33,11 @@ async function main() {
3333
const testChunkStart = testChunkSize * testShardIndex;
3434
const shardExports = allExports.slice(testChunkStart, testChunkStart + testChunkSize);
3535

36+
// Sub-test directory where the first-party linked node modules end up being available.
37+
const testDir = path.join(tmpDir, 'test');
38+
await fs.mkdir(testDir);
39+
await fs.mkdir(path.join(testDir, 'node_modules/@angular'), {recursive: true});
40+
3641
const testFiles = shardExports.map((e) => ({
3742
content: `
3843
import {NgModule, Component} from '@angular/core';
@@ -46,15 +51,16 @@ async function main() {
4651
@Component({imports: [TestModule], template: ''})
4752
export class TestComponent {}
4853
`,
49-
path: path.join(tmpDir, `${e.symbolName.toLowerCase()}.ts`),
54+
path: path.join(testDir, `${e.symbolName.toLowerCase()}.ts`),
5055
}));
5156

5257
// Prepare node modules to resolve e.g. `@angular/core`
53-
await fs.symlink(path.resolve('./node_modules'), path.join(tmpDir, 'node_modules'));
58+
await fs.symlink(path.resolve('./integration/node_modules'), path.join(tmpDir, 'node_modules'));
59+
5460
// Prepare node modules to resolve e.g. `@angular/cdk`. This is possible
5561
// as we are inside the sandbox, inside our test runfiles directory.
5662
for (const {packagePath, name} of packages) {
57-
await fs.symlink(path.resolve(packagePath), `./node_modules/${name}`);
63+
await fs.symlink(path.resolve(packagePath), path.join(testDir, 'node_modules', name));
5864
}
5965

6066
const diagnostics: ts.Diagnostic[] = [];
Collapse file

‎integration/ng-modules-importability/tsconfig.json‎

Copy file name to clipboardExpand all lines: integration/ng-modules-importability/tsconfig.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"strict": true,
44
"declaration": true,
55
"sourceMap": true,
6-
"module": "node16",
7-
"moduleResolution": "node16",
6+
"module": "esnext",
7+
"moduleResolution": "bundler",
88
"types": ["node"]
99
}
1010
}
Collapse file

‎integration/package.json‎

Copy file name to clipboard
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"@angular/compiler-cli": "workspace:*"
4+
}
5+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.