-
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): do not error when yarn version of publish branch…
… is older Currently there is one surprising issue within the release tool that breaks the release of LTS versions. If the ng-dev release tool is invoked through Yarn. e.g. `yarn ng-dev`, Yarn will create a temporary directory and create wrappers for a binary called `yarn` that will directly point to the checked-in Yarn file that originally invoked the `ng-dev` tool. This means that child processes calling to `yarn` will actually depend on the checked-in Yarn version that invoked the `ng-dev` tool. This logic works fine for most scripts/commands, but it breaks if the release tool checks out an LTS branch and runs `yarn`. The checked-in Yarn file from the original invocation may not exist anymore. We fix this by resolving Yarn directly within the project, falling back to the NPM global bin, or ultimately by leaving to the process `PATH` standard resolution. This prevents this issue in all of our Angular repositories where we check-in Yarn and have a `yarnrc` configuration.
- Loading branch information
1 parent
a480a99
commit 1516a4e
Showing
19 changed files
with
345 additions
and
46 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
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,18 @@ | ||
/** | ||
* @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 | ||
*/ | ||
|
||
/** | ||
* Type narrowing function that becomes true if the given error is of type `T`. | ||
* The narrowed type will include the NodeJS `ErrnoException` properties. | ||
*/ | ||
export function isNodeJSWrappedError<T extends new (...args: any) => Error>( | ||
value: Error | unknown, | ||
errorType: T, | ||
): value is InstanceType<T> & NodeJS.ErrnoException { | ||
return value instanceof errorType; | ||
} |
Oops, something went wrong.