Skip to content

Commit 31fb0d4

Browse files
committed
build: support linking of Angular libraries with rules_js
TODO
1 parent dc70692 commit 31fb0d4

File tree

10 files changed

+303
-36
lines changed

10 files changed

+303
-36
lines changed

.aspect/rules/external_repository_action_cache/npm_translate_lock_MzA5NzUwNzMx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# Input hashes for repository rule npm_translate_lock(name = "npm2", pnpm_lock = "@//:pnpm-lock.yaml").
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=-2023857461
5-
package.json=1204886269
6-
pnpm-lock.yaml=1975546108
7-
pnpm-workspace.yaml=1711114604
8-
yarn.lock=824621907
5+
package.json=-1210026051
6+
pnpm-lock.yaml=-803790935
7+
pnpm-workspace.yaml=-1443514472
8+
tools/bazel/angular-linking/index.mjs=475293377
9+
tools/bazel/angular-linking/package.json=-115142019
10+
yarn.lock=-770490238

.bazelignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ integration/yarn-pnp-compat/.yarn/cache
1717
integration/yarn-pnp-compat/.yarn/unplugged
1818
integration/yarn-pnp-compat/.yarn/install-state.gz
1919
integration/yarn-pnp-compat/node_modules
20+
21+
tools/bazel/angular-linking/node_modules

WORKSPACE

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,19 @@ load("@aspect_rules_js//npm:repositories.bzl", "npm_translate_lock")
163163

164164
npm_translate_lock(
165165
name = "npm2",
166+
custom_postinstalls = {
167+
"@angular/animations": "node ../../@devinfra/angular-linking/index.mjs",
168+
"@angular/common": "node ../../@devinfra/angular-linking/index.mjs",
169+
"@angular/forms": "node ../../@devinfra/angular-linking/index.mjs",
170+
"@angular/platform-browser": "node ../../@devinfra/angular-linking/index.mjs",
171+
"@angular/router": "node ../../@devinfra/angular-linking/index.mjs",
172+
"@angular/localize": "node ../../@devinfra/angular-linking/index.mjs",
173+
},
166174
data = [
167175
"//:package.json",
168176
"//:pnpm-workspace.yaml",
177+
"//tools/bazel/angular-linking:index.mjs",
178+
"//tools/bazel/angular-linking:package.json",
169179
],
170180
npmrc = "//:.npmrc",
171181
pnpm_lock = "//:pnpm-lock.yaml",

package.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
"@bazel/runfiles": "5.8.1",
9898
"@bazel/terser": "5.8.1",
9999
"@bazel/worker": "5.8.1",
100+
"@devinfra/angular-linking": "link:tools/bazel/angular-linking",
100101
"@firebase/app-types": "^0.7.0",
101102
"@material/material-color-utilities": "^0.3.0",
102103
"@octokit/rest": "18.3.5",
@@ -186,6 +187,38 @@
186187
"wrap-ansi": "7.0.0"
187188
},
188189
"pnpm": {
189-
"onlyBuiltDependencies": []
190+
"onlyBuiltDependencies": [],
191+
"packageExtensions": {
192+
"@angular/animations": {
193+
"dependencies": {
194+
"@devinfra/angular-linking": "workspace:*"
195+
}
196+
},
197+
"@angular/common": {
198+
"dependencies": {
199+
"@devinfra/angular-linking": "workspace:*"
200+
}
201+
},
202+
"@angular/forms": {
203+
"dependencies": {
204+
"@devinfra/angular-linking": "workspace:*"
205+
}
206+
},
207+
"@angular/platform-browser": {
208+
"dependencies": {
209+
"@devinfra/angular-linking": "workspace:*"
210+
}
211+
},
212+
"@angular/router": {
213+
"dependencies": {
214+
"@devinfra/angular-linking": "workspace:*"
215+
}
216+
},
217+
"@angular/localize": {
218+
"dependencies": {
219+
"@devinfra/angular-linking": "workspace:*"
220+
}
221+
}
222+
}
190223
}
191224
}

0 commit comments

Comments
 (0)