Skip to content

Commit a4c2e61

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

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

packages/angular/create/BUILD.bazel

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@ load("//tools:defaults2.bzl", "npm_package", "ts_project")
77

88
licenses(["notice"])
99

10-
RUNTIME_ASSETS = glob(
11-
include = [
12-
"src/*.js",
13-
"src/*.mjs",
14-
],
15-
) + [
10+
RUNTIME_ASSETS = [
1611
"package.json",
1712
]
1813

@@ -21,7 +16,6 @@ ts_project(
2116
srcs = glob([
2217
"src/*.ts",
2318
]),
24-
data = RUNTIME_ASSETS,
2519
module_name = "@angular/create",
2620
deps = [
2721
"//:root_modules/@types/node",

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)