Skip to content

Commit 1db02a7

Browse files
committed
build: migrate @angular/pwa to npm_package
This allows us to use the package in the RJS pnpm workspace.
1 parent ecadcae commit 1db02a7

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

packages/angular/pwa/BUILD.bazel

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,33 @@
44
# found in the LICENSE file at https://angular.dev/license
55

66
load("@npm//@bazel/jasmine:index.bzl", "jasmine_node_test")
7-
load("//tools:defaults.bzl", "pkg_npm")
8-
load("//tools:interop.bzl", "ts_project")
7+
load("//tools:defaults2.bzl", "npm_package", "ts_project")
98
load("//tools:ts_json_schema.bzl", "ts_json_schema")
109

1110
licenses(["notice"])
1211

1312
package(default_visibility = ["//visibility:public"])
1413

14+
RUNTIME_ASSETS = glob(
15+
include = [
16+
"pwa/*.js",
17+
"pwa/*.mjs",
18+
"pwa/files/**/*.png",
19+
],
20+
) + [
21+
"package.json",
22+
"collection.json",
23+
"pwa/schema.json",
24+
"pwa/files/assets/manifest.webmanifest",
25+
]
26+
1527
ts_project(
1628
name = "pwa",
1729
srcs = [
1830
"pwa/index.ts",
1931
"//packages/angular/pwa:pwa/schema.ts",
2032
],
21-
data = [
22-
"collection.json",
23-
"pwa/schema.json",
24-
] + glob(
25-
include = [
26-
"pwa/files/**/*",
27-
],
28-
),
33+
data = RUNTIME_ASSETS,
2934
module_name = "@angular/pwa",
3035
deps = [
3136
"//:root_modules/@types/node",
@@ -63,16 +68,16 @@ genrule(
6368
cmd = "cp $(execpath //:LICENSE) $@",
6469
)
6570

66-
pkg_npm(
67-
name = "npm_package",
71+
npm_package(
72+
name = "pkg",
6873
pkg_deps = [
6974
"//packages/angular_devkit/schematics:package.json",
7075
"//packages/schematics/angular:package.json",
7176
],
7277
tags = ["release-package"],
73-
deps = [
78+
deps = RUNTIME_ASSETS + [
7479
":README.md",
7580
":license",
76-
":pwa",
81+
":pwa_rjs",
7782
],
7883
)

0 commit comments

Comments
 (0)