-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ng-dev/release): properly ensure local ng-dev version is up-to-date
Fixes that the ng-dev release tool currently relies on a historically broken `yarn check` command for ensuring it is up-to-date. This check has proven to not work well within the Angular repositories, so we switch to a more future-proof and reliable approach by checking the lock file and comparing with the running version through a substitued placeholder.
- Loading branch information
1 parent
88d1b37
commit 0474a28
Showing
14 changed files
with
140 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
// Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1033 | ||
// TODO: Remove when the type resolution is fixed. | ||
declare module '@yarnpkg/lockfile' { | ||
export * from 'yarnpkg__lockfile'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @license | ||
* Copyright Google LLC All Rights Reserved. | ||
* | ||
* Use of this source code is governed by an MIT-style license that can be | ||
* found in the LICENSE file at https://angular.io/license | ||
*/ | ||
|
||
/** NPM package name that is used for the `ng-dev` tool. */ | ||
export const ngDevNpmPackageName = '@angular/dev-infra-private'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
stampSubstitutions = { | ||
# The variables are special statuses generated within the Bazel workspace | ||
# status command stamping script. | ||
"{SCM_HEAD_SHA}": "{BUILD_SCM_COMMIT_SHA}", | ||
} | ||
|
||
noStampSubstitutions = dict(stampSubstitutions, **{}) | ||
|
||
basePackageSubstitutions = { | ||
" \"prepare\": \"husky install\",\n": "", | ||
"@dev-infra//bazel/": "@npm//@angular/dev-infra-private/bazel/", | ||
"//bazel/": "@npm//@angular/dev-infra-private/bazel/", | ||
"//bazel:": "@npm//@angular/dev-infra-private/bazel:", | ||
"//ng-dev/": "@npm//@angular/dev-infra-private/ng-dev/", | ||
"//ng-dev:": "@npm//@angular/dev-infra-private/ng-dev:", | ||
"//tslint-rules/": "@npm//@angular/dev-infra-private/tslint-rules/", | ||
"//tslint-rules:": "@npm//@angular/dev-infra-private/tslint-rules:", | ||
"//:tsconfig.json": "@npm//@angular/dev-infra-private:tsconfig.json", | ||
} | ||
|
||
NPM_PACKAGE_SUBSTITUTIONS = select({ | ||
"//tools:stamp": dict(basePackageSubstitutions, **stampSubstitutions), | ||
"//conditions:default": dict(basePackageSubstitutions, **noStampSubstitutions), | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
# This BUILD.bazel file needs to exist to allow for //tools to be considered a package. | ||
package(default_visibility = ["//visibility:public"]) | ||
|
||
# Detect if the build is running with stamping enabled. | ||
config_setting( | ||
name = "stamp", | ||
values = {"stamp": "true"}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters