Skip to content

Commit 74d8bae

Browse files
committed
feat(symlink_package): Adjust for rules_js npm_link_package_store changes
Moves `@angular/compiler-cli` and `typescript-local` to `dependencies` and removes `src_workspace` calculation in `symlink_package.bzl`. This change is necessary due to https://github.com/jbedard/rules_js/blob/718e3cb1f471beaf7a213f5340b2b8d16ae01fea/npm/private/npm_link_package_store.bzl#L141 where only dependencies are included in the `npm_package_store_infos`.
1 parent baed738 commit 74d8bae

3 files changed

Lines changed: 16 additions & 11 deletions

File tree

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
"pnpm": {
1212
"onlyBuiltDependencies": []
1313
},
14+
"dependencies": {
15+
"@angular/compiler-cli": "20.2.0-next.2",
16+
"typescript-local": "npm:typescript@5.9.2"
17+
},
1418
"devDependencies": {
1519
"@angular/build": "20.2.0-next.2",
1620
"@angular/cli": "20.2.0-next.2",
1721
"@angular/common": "20.2.0-next.2",
1822
"@angular/compiler": "20.2.0-next.2",
19-
"@angular/compiler-cli": "20.2.0-next.2",
2023
"@angular/core": "20.2.0-next.2",
2124
"@angular/platform-browser": "20.2.0-next.2",
2225
"@babel/core": "^7.28.5",
@@ -36,7 +39,6 @@
3639
"rxjs": "^7.8.2",
3740
"tinyglobby": "0.2.12",
3841
"tslib": "^2.8.1",
39-
"typescript-local": "npm:typescript@5.9.2",
4042
"zone.js": "^0.15.0"
4143
}
4244
}

pnpm-lock.yaml

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/private/symlink_package.bzl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ def manifest_path(ctx, file):
1818

1919
def _symlink_impl(ctx):
2020
src = ctx.attr.src
21+
store_info = src[JsInfo].npm_package_store_infos.to_list()
2122

22-
store_info = src[JsInfo].npm_package_store_infos.to_list()[0]
23-
src_dir = store_info.package_store_directory
24-
src_workspace = src.label.workspace_name if src.label.workspace_name != "" else ctx.workspace_name
23+
if len(store_info) == 0:
24+
fail("%s has no \"npm_package_store_infos\". Ensure that is marked as a dependency and not devDependency." % ctx.attr.name)
25+
26+
src_dir = store_info[0].package_store_directory
2527

2628
destination = ctx.actions.declare_symlink(ctx.attr.name)
2729
destination_build = ctx.actions.declare_symlink(

0 commit comments

Comments
 (0)