Skip to content
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
4 changes: 4 additions & 0 deletions constants.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Engine versions to stamp in a release package.json
RELEASE_ENGINES_NODE = "^12.20.0 || ^14.15.0 || >=16.10.0"
RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0"
RELEASE_ENGINES_YARN = ">= 1.13.0"
3 changes: 2 additions & 1 deletion packages/angular/cli/models/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export class Version {
}
}

// TODO: Convert this to use build-time version stamping once implemented in the build system
// TODO: Convert this to use build-time version stamping after flipping the build script to use bazel
// export const VERSION = new Version('0.0.0-PLACEHOLDER');
export const VERSION = new Version(
(
JSON.parse(readFileSync(resolve(__dirname, '../package.json'), 'utf-8')) as { version: string }
Expand Down
22 changes: 11 additions & 11 deletions packages/angular/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular/cli",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "CLI tool for Angular",
"main": "lib/cli/index.js",
"bin": {
Expand All @@ -25,10 +25,10 @@
},
"homepage": "https://github.com/angular/angular-cli",
"dependencies": {
"@angular-devkit/architect": "0.0.0",
"@angular-devkit/core": "0.0.0",
"@angular-devkit/schematics": "0.0.0",
"@schematics/angular": "0.0.0",
"@angular-devkit/architect": "0.0.0-PLACEHOLDER",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER",
"@schematics/angular": "0.0.0-PLACEHOLDER",
"@yarnpkg/lockfile": "1.1.0",
"ansi-colors": "4.1.1",
"debug": "4.3.3",
Expand All @@ -51,12 +51,12 @@
"ng-update": {
"migrations": "@schematics/angular/migrations/migration-collection.json",
"packageGroup": {
"@angular/cli": "0.0.0",
"@angular-devkit/architect": "0.0.0",
"@angular-devkit/build-angular": "0.0.0",
"@angular-devkit/build-webpack": "0.0.0",
"@angular-devkit/core": "0.0.0",
"@angular-devkit/schematics": "0.0.0"
"@angular/cli": "0.0.0-PLACEHOLDER",
"@angular-devkit/architect": "0.0.0-PLACEHOLDER",
"@angular-devkit/build-angular": "0.0.0-PLACEHOLDER",
"@angular-devkit/build-webpack": "0.0.0-PLACEHOLDER",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER"
}
}
}
6 changes: 3 additions & 3 deletions packages/angular/pwa/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular/pwa",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "PWA schematics for Angular",
"keywords": [
"blueprints",
Expand All @@ -12,8 +12,8 @@
"save": false
},
"dependencies": {
"@angular-devkit/schematics": "0.0.0",
"@schematics/angular": "0.0.0",
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER",
"@schematics/angular": "0.0.0-PLACEHOLDER",
"parse5-html-rewriting-stream": "6.0.1"
}
}
4 changes: 2 additions & 2 deletions packages/angular_devkit/architect/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "@angular-devkit/architect",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular Build Facade",
"experimental": true,
"main": "src/index.js",
"typings": "src/index.d.ts",
"dependencies": {
"@angular-devkit/core": "0.0.0",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"rxjs": "6.6.7"
},
"builders": "./builders/builders.json"
Expand Down
6 changes: 3 additions & 3 deletions packages/angular_devkit/architect_cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-devkit/architect-cli",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular Architect CLI",
"homepage": "https://github.com/angular/angular-cli",
"experimental": true,
Expand All @@ -14,8 +14,8 @@
"tooling"
],
"dependencies": {
"@angular-devkit/architect": "0.0.0",
"@angular-devkit/core": "0.0.0",
"@angular-devkit/architect": "0.0.0-PLACEHOLDER",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"ansi-colors": "4.1.1",
"minimist": "1.2.5",
"progress": "2.0.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/angular_devkit/benchmark/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-devkit/benchmark",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"private": true,
"description": "Angular Benchmark",
"bin": {
Expand All @@ -10,7 +10,7 @@
"benchmark"
],
"dependencies": {
"@angular-devkit/core": "0.0.0",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"ansi-colors": "4.1.1",
"minimist": "1.2.5",
"pidusage": "3.0.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/angular_devkit/build_angular/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@angular-devkit/build-angular",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular Webpack Build Facade",
"main": "src/index.js",
"typings": "src/index.d.ts",
"builders": "builders.json",
"dependencies": {
"@ampproject/remapping": "1.0.2",
"@angular-devkit/architect": "0.0.0",
"@angular-devkit/build-webpack": "0.0.0",
"@angular-devkit/core": "0.0.0",
"@angular-devkit/architect": "0.0.0-PLACEHOLDER",
"@angular-devkit/build-webpack": "0.0.0-PLACEHOLDER",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@babel/core": "7.16.7",
"@babel/generator": "7.16.7",
"@babel/helper-annotate-as-pure": "7.16.7",
Expand All @@ -20,7 +20,7 @@
"@babel/runtime": "7.16.7",
"@babel/template": "7.16.7",
"@discoveryjs/json-ext": "0.5.6",
"@ngtools/webpack": "0.0.0",
"@ngtools/webpack": "0.0.0-PLACEHOLDER",
"ansi-colors": "4.1.1",
"babel-loader": "8.2.3",
"babel-plugin-istanbul": "6.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/build_optimizer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-devkit/build-optimizer",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular Build Optimizer",
"experimental": true,
"main": "src/index.js",
Expand Down
6 changes: 3 additions & 3 deletions packages/angular_devkit/build_webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "@angular-devkit/build-webpack",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Webpack Builder for Architect",
"experimental": true,
"main": "src/index.js",
"typings": "src/index.d.ts",
"builders": "builders.json",
"dependencies": {
"@angular-devkit/architect": "0.0.0",
"@angular-devkit/architect": "0.0.0-PLACEHOLDER",
"rxjs": "6.6.7"
},
"devDependencies": {
"@angular-devkit/core": "0.0.0",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"node-fetch": "2.6.1",
"webpack": "5.65.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/angular_devkit/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-devkit/core",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular DevKit - Core Utility Library",
"main": "src/index.js",
"typings": "src/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/angular_devkit/schematics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-devkit/schematics",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular Schematics - Library",
"main": "src/index.js",
"typings": "src/index.d.ts",
Expand All @@ -13,7 +13,7 @@
"schematics"
],
"dependencies": {
"@angular-devkit/core": "0.0.0",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"jsonc-parser": "3.0.0",
"magic-string": "0.25.7",
"ora": "5.4.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/angular_devkit/schematics_cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-devkit/schematics-cli",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Angular Schematics - CLI",
"homepage": "https://github.com/angular/angular-cli",
"bin": {
Expand All @@ -16,8 +16,8 @@
],
"schematics": "./collection.json",
"dependencies": {
"@angular-devkit/core": "0.0.0",
"@angular-devkit/schematics": "0.0.0",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER",
"ansi-colors": "4.1.1",
"inquirer": "8.2.0",
"minimist": "1.2.5",
Expand Down
4 changes: 2 additions & 2 deletions packages/ngtools/webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngtools/webpack",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Webpack plugin that AoT compiles your Angular components and modules.",
"main": "./src/index.js",
"typings": "src/index.d.ts",
Expand All @@ -27,7 +27,7 @@
"webpack": "^5.30.0"
},
"devDependencies": {
"@angular-devkit/core": "0.0.0",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular/compiler": "13.1.1",
"@angular/compiler-cli": "13.1.1",
"typescript": "4.5.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/schematics/angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@schematics/angular",
"version": "0.0.0",
"version": "0.0.0-PLACEHOLDER",
"description": "Schematics specific to Angular",
"homepage": "https://github.com/angular/angular-cli",
"keywords": [
Expand All @@ -10,8 +10,8 @@
],
"schematics": "./collection.json",
"dependencies": {
"@angular-devkit/core": "0.0.0",
"@angular-devkit/schematics": "0.0.0",
"@angular-devkit/core": "0.0.0-PLACEHOLDER",
"@angular-devkit/schematics": "0.0.0-PLACEHOLDER",
"jsonc-parser": "3.0.0"
}
}
4 changes: 2 additions & 2 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ export default async function (
} else {
obj[depName] = `github:${pkg.snapshotRepo}#${pkg.snapshotHash}`;
}
} else if ((obj[depName] as string).match(/\b0\.0\.0\b/)) {
obj[depName] = (obj[depName] as string).replace(/\b0\.0\.0\b/, v);
} else if ((obj[depName] as string).match(/\b0\.0\.0-PLACEHOLDER\b/)) {
Comment thread
josephperrott marked this conversation as resolved.
obj[depName] = (obj[depName] as string).replace(/\b0\.0\.0-PLACEHOLDER\b/, v);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/validate-licenses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const ignoredPackages = [

// Ignore own packages (all MIT)
for (const packageName of Object.keys(packages)) {
ignoredPackages.push(`${packageName}@0.0.0`);
ignoredPackages.push(`${packageName}@0.0.0-PLACEHOLDER`);
}

// Find all folders directly under a `node_modules` that have a package.json.
Expand Down
24 changes: 13 additions & 11 deletions tools/defaults.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ load("@aspect_bazel_lib//lib:utils.bzl", "to_label")
load("@aspect_bazel_lib//lib:jq.bzl", "jq")
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("//tools:link_package_json_to_tarballs.bzl", "link_package_json_to_tarballs")
load("//:constants.bzl", "RELEASE_ENGINES_NODE", "RELEASE_ENGINES_NPM", "RELEASE_ENGINES_YARN")

_DEFAULT_TSCONFIG = "//:tsconfig-build.json"
_DEFAULT_TSCONFIG_TEST = "//:tsconfig-test.json"
Expand Down Expand Up @@ -64,15 +65,16 @@ def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):

visibility = kwargs.pop("visibility", None)

common_substitutions = dict(kwargs.pop("substitutions", {}))
substitutions = dict(common_substitutions, **{
# TODO: Current build script relies on 0.0.0 in package.json; uncomment after replacing build script.
#"0.0.0-PLACEHOLDER": "0.0.0",
})
stamped_substitutions = dict(common_substitutions, **{
# TODO: Current build script relies on 0.0.0 in package.json; uncomment after replacing build script.
#"0.0.0-PLACEHOLDER": "{BUILD_SCM_VERSION}",
"0.0.0": "{BUILD_SCM_VERSION}",
NPM_PACKAGE_SUBSTITUTIONS = {
# Version of the local package being built, generated via the `--workspace_status_command` flag.
"0.0.0-PLACEHOLDER": "{BUILD_SCM_VERSION}",
"0.0.0-ENGINES-NODE": RELEASE_ENGINES_NODE,
"0.0.0-ENGINES-NPM": RELEASE_ENGINES_NPM,
"0.0.0-ENGINES-YARN": RELEASE_ENGINES_YARN,
}

NO_STAMP_PACKAGE_SUBSTITUTIONS = dict(NPM_PACKAGE_SUBSTITUTIONS, **{
"0.0.0-PLACEHOLDER": "0.0.0",
})

deps = kwargs.pop("deps", [])
Expand Down Expand Up @@ -164,8 +166,8 @@ def pkg_npm(name, pkg_deps = [], use_prodmode_output = False, **kwargs):
package_name = None,
validate = False,
substitutions = select({
"//:stamp": stamped_substitutions,
"//conditions:default": substitutions,
"//:stamp": NPM_PACKAGE_SUBSTITUTIONS,
"//conditions:default": NO_STAMP_PACKAGE_SUBSTITUTIONS,
}),
visibility = visibility,
nested_packages = ["package"],
Expand Down
4 changes: 2 additions & 2 deletions tools/package_json_release_filter.jq
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
# Remove devDependencies
| del(.devDependencies)

# Add engines
+ {"engines": {"node": "^12.20.0 || ^14.15.0 || >=16.10.0", "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", "yarn": ">= 1.13.0"}}
# Add engines; versions substituted via pkg_npm
+ {"engines": {"node": "0.0.0-ENGINES-NODE", "npm": "0.0.0-ENGINES-NPM", "yarn": "0.0.0-ENGINES-YARN"}}