Skip to content

Commit 2fb7836

Browse files
authored
build: add missing packageGroup fields and packages in package.json (#30486)
This commit fixes multiple `package.json` files by adding the missing `packageGroup` field. Additionally, it ensures that all required packages are included within `packageGroup`. These updates are necessary because the affected packages have peer dependencies on `@angular/cdk` or `@angular/material`, and updating them individually.
1 parent c40c701 commit 2fb7836

File tree

8 files changed

+30
-28
lines changed

8 files changed

+30
-28
lines changed

packages.bzl

+19-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,27 @@
44
TSLIB_PACKAGE_VERSION = "^2.3.0"
55
RXJS_PACKAGE_VERSION = "^6.5.3 || ^7.4.0"
66

7+
# Packages which are versioned together on npm
8+
ANGULAR_COMPONENTS_SCOPED_PACKAGES = ["@angular/%s" % p for p in [
9+
"material",
10+
"cdk",
11+
"cdk-experimental",
12+
"material-experimental",
13+
"material-luxon-adapter",
14+
"material-moment-adapter",
15+
"material-date-fns-adapter",
16+
]]
17+
18+
PKG_GROUP_REPLACEMENTS = {
19+
"\"NG_UPDATE_PACKAGE_GROUP\"": """[
20+
%s
21+
]""" % ",\n ".join(["\"%s\"" % s for s in ANGULAR_COMPONENTS_SCOPED_PACKAGES]),
22+
}
23+
724
# Each placeholder is used to stamp versions during the build process, replacing the key with its
825
# value pair. These replacements occur during building of `npm_package` and `ng_package` stamping in
926
# the peer dependencies and versions, primarily in `package.json`s.
10-
NPM_PACKAGE_SUBSTITUTIONS = {
27+
NPM_PACKAGE_SUBSTITUTIONS = dict(PKG_GROUP_REPLACEMENTS, **{
1128
# Peer dependency version on the Angular framework.
1229
"0.0.0-NG": "{STABLE_FRAMEWORK_PEER_DEP_RANGE}",
1330
# Version of `tslib`
@@ -16,7 +33,7 @@ NPM_PACKAGE_SUBSTITUTIONS = {
1633
"0.0.0-PLACEHOLDER": "{STABLE_PROJECT_VERSION}",
1734
# Version of `rxjs`
1835
"0.0.0-RXJS": RXJS_PACKAGE_VERSION,
19-
}
36+
})
2037

2138
NO_STAMP_NPM_PACKAGE_SUBSTITUTIONS = dict(NPM_PACKAGE_SUBSTITUTIONS, **{
2239
# When building NPM packages for tests (where stamping is disabled),

src/cdk-experimental/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
"dependencies": {
1919
"tslib": "0.0.0-TSLIB"
2020
},
21+
"ng-update": {
22+
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
23+
},
2124
"sideEffects": false
2225
}

src/cdk/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@
5858
"schematics": "./schematics/collection.json",
5959
"ng-update": {
6060
"migrations": "./schematics/migration.json",
61-
"packageGroup": [
62-
"@angular/material",
63-
"@angular/cdk"
64-
]
61+
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
6562
},
6663
"sideEffects": false
6764
}

src/material-date-fns-adapter/package.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020
"tslib": "0.0.0-TSLIB"
2121
},
2222
"ng-update": {
23-
"packageGroup": [
24-
"@angular/material",
25-
"@angular/cdk",
26-
"@angular/material-date-fns-adapter"
27-
]
23+
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
2824
},
2925
"schematics": "./schematics/collection.json",
3026
"sideEffects": false

src/material-experimental/package.json

+3
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,8 @@
2727
"dependencies": {
2828
"tslib": "0.0.0-TSLIB"
2929
},
30+
"ng-update": {
31+
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
32+
},
3033
"sideEffects": false
3134
}

src/material-luxon-adapter/package.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020
"tslib": "0.0.0-TSLIB"
2121
},
2222
"ng-update": {
23-
"packageGroup": [
24-
"@angular/material",
25-
"@angular/cdk",
26-
"@angular/material-luxon-adapter"
27-
]
23+
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
2824
},
2925
"schematics": "./schematics/collection.json",
3026
"sideEffects": false

src/material-moment-adapter/package.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@
2020
"tslib": "0.0.0-TSLIB"
2121
},
2222
"ng-update": {
23-
"packageGroup": [
24-
"@angular/material",
25-
"@angular/cdk",
26-
"@angular/material-moment-adapter"
27-
]
23+
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
2824
},
2925
"schematics": "./schematics/collection.json",
3026
"sideEffects": false

src/material/package.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,7 @@
6969
"schematics": "./schematics/collection.json",
7070
"ng-update": {
7171
"migrations": "./schematics/migration.json",
72-
"packageGroup": [
73-
"@angular/material",
74-
"@angular/cdk",
75-
"@angular/material-moment-adapter",
76-
"@angular/material-luxon-adapter",
77-
"@angular/material-date-fns-adapter"
78-
]
72+
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
7973
},
8074
"sideEffects": false
8175
}

0 commit comments

Comments
 (0)