UNPKG

1.47 kBJavaScriptView Raw
1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.latestVersions = void 0;
11/** Retrieve the minor version for the provided version string. */
12function getAngularEarliestMinorVersion(version) {
13 const versionMatching = version.match(/^(\d+)\.(\d+)\.\d+(-\w+)?/);
14 if (versionMatching === null) {
15 throw Error('Unable to determine the minor version for the provided version');
16 }
17 const [_, major, minor, prerelease = ''] = versionMatching;
18 return `~${major}.${minor}.0${prerelease}`;
19}
20exports.latestVersions = {
21 // We could have used TypeScripts' `resolveJsonModule` to make the `latestVersion` object typesafe,
22 // but ts_library doesn't support JSON inputs.
23 ...require('./latest-versions/package.json')['dependencies'],
24 // As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
25 Angular: getAngularEarliestMinorVersion(require('../package.json')['version']),
26 // Since @angular-devkit/build-angular and @schematics/angular are always
27 // published together from the same monorepo, and they are both
28 // non-experimental, they will always have the same version.
29 DevkitBuildAngular: '~' + require('../package.json')['version'],
30};