Skip to content

Commit da7fbb4

Browse files
josephperrottAndrewKushnir
authored andcommitted
fix(compiler-cli): detect when the linker is working in unpublished angular and widen supported versions (#54439)
When the linker is running using an unpublished version of angular, locally built, the version will be `0.0.0`. When encountering this situation, the range that for the linker map support is considered to be `*.*.*` allowing for the linker to work at build time with packages built with versioned angular. Most notably this allows for us to properly use the linker in building our documentation site with the locally built version of angular. PR Close #54439
1 parent 36bd7d3 commit da7fbb4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/compiler-cli/linker/src/file_linker/partial_linkers/partial_linker_selector.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ export class PartialLinkerSelector<TExpression> {
185185
* @returns A semver range for the provided `version` and comparator.
186186
*/
187187
function getRange(comparator: '<='|'>=', versionStr: string): semver.Range {
188+
// If the provided version is exactly `0.0.0` then we are known to be running with an unpublished
189+
// version of angular and assume that all ranges are compatible.
190+
if (versionStr === '0.0.0' && (PLACEHOLDER_VERSION as string) === '0.0.0') {
191+
return new semver.Range('*.*.*');
192+
}
188193
const version = new semver.SemVer(versionStr);
189194
// Wipe out any prerelease versions
190195
version.prerelease = [];

0 commit comments

Comments
 (0)