Skip to content

build: add missing packageGroup fields and packages in package.json #30486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions packages.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,27 @@
TSLIB_PACKAGE_VERSION = "^2.3.0"
RXJS_PACKAGE_VERSION = "^6.5.3 || ^7.4.0"

# Packages which are versioned together on npm
ANGULAR_COMPONENTS_SCOPED_PACKAGES = ["@angular/%s" % p for p in [
"material",
"cdk",
"cdk-experimental",
"material-experimental",
"material-luxon-adapter",
"material-moment-adapter",
"material-date-fns-adapter",
]]

PKG_GROUP_REPLACEMENTS = {
"\"NG_UPDATE_PACKAGE_GROUP\"": """[
%s
]""" % ",\n ".join(["\"%s\"" % s for s in ANGULAR_COMPONENTS_SCOPED_PACKAGES]),
}

# Each placeholder is used to stamp versions during the build process, replacing the key with its
# value pair. These replacements occur during building of `npm_package` and `ng_package` stamping in
# the peer dependencies and versions, primarily in `package.json`s.
NPM_PACKAGE_SUBSTITUTIONS = {
NPM_PACKAGE_SUBSTITUTIONS = dict(PKG_GROUP_REPLACEMENTS, **{
# Peer dependency version on the Angular framework.
"0.0.0-NG": "{STABLE_FRAMEWORK_PEER_DEP_RANGE}",
# Version of `tslib`
Expand All @@ -16,7 +33,7 @@ NPM_PACKAGE_SUBSTITUTIONS = {
"0.0.0-PLACEHOLDER": "{STABLE_PROJECT_VERSION}",
# Version of `rxjs`
"0.0.0-RXJS": RXJS_PACKAGE_VERSION,
}
})

NO_STAMP_NPM_PACKAGE_SUBSTITUTIONS = dict(NPM_PACKAGE_SUBSTITUTIONS, **{
# When building NPM packages for tests (where stamping is disabled),
Expand Down
3 changes: 3 additions & 0 deletions src/cdk-experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
"dependencies": {
"tslib": "0.0.0-TSLIB"
},
"ng-update": {
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
},
"sideEffects": false
}
5 changes: 1 addition & 4 deletions src/cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@
"schematics": "./schematics/collection.json",
"ng-update": {
"migrations": "./schematics/migration.json",
"packageGroup": [
"@angular/material",
"@angular/cdk"
]
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
},
"sideEffects": false
}
6 changes: 1 addition & 5 deletions src/material-date-fns-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
"tslib": "0.0.0-TSLIB"
},
"ng-update": {
"packageGroup": [
"@angular/material",
"@angular/cdk",
"@angular/material-date-fns-adapter"
]
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
},
"schematics": "./schematics/collection.json",
"sideEffects": false
Expand Down
3 changes: 3 additions & 0 deletions src/material-experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@
"dependencies": {
"tslib": "0.0.0-TSLIB"
},
"ng-update": {
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
},
"sideEffects": false
}
6 changes: 1 addition & 5 deletions src/material-luxon-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
"tslib": "0.0.0-TSLIB"
},
"ng-update": {
"packageGroup": [
"@angular/material",
"@angular/cdk",
"@angular/material-luxon-adapter"
]
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
},
"schematics": "./schematics/collection.json",
"sideEffects": false
Expand Down
6 changes: 1 addition & 5 deletions src/material-moment-adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
"tslib": "0.0.0-TSLIB"
},
"ng-update": {
"packageGroup": [
"@angular/material",
"@angular/cdk",
"@angular/material-moment-adapter"
]
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
},
"schematics": "./schematics/collection.json",
"sideEffects": false
Expand Down
8 changes: 1 addition & 7 deletions src/material/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,7 @@
"schematics": "./schematics/collection.json",
"ng-update": {
"migrations": "./schematics/migration.json",
"packageGroup": [
"@angular/material",
"@angular/cdk",
"@angular/material-moment-adapter",
"@angular/material-luxon-adapter",
"@angular/material-date-fns-adapter"
]
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
},
"sideEffects": false
}
Loading