Skip to content

Commit ac907d6

Browse files
committed
build: install snapshot builds for angular-devkit and schematics
Our snapshot build jobs should also install the snapshots for the devkit and schematics packages (owned by the tooling team). These need to match up with the CLI package that is currently already updated by the snapshot setup script.
1 parent 4f13d25 commit ac907d6

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

scripts/circleci/setup-angular-snapshots.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
* Read more here: https://yarnpkg.com/lang/en/docs/package-json/#toc-resolutions
1515
*/
1616

17+
/**
18+
* Regular expression matching packages we would like to install snapshots for.
19+
*
20+
* Assumes that all matched packages will have corresponding snapshot Github
21+
* repositories under the Angular organization.
22+
*
23+
* Note that specific packages can be excluded in the `ignorePackages` array below.
24+
*/
25+
const targetPackageRegex = /^@(angular|angular-devkit|schematics)\//;
26+
1727
/** List of packages which should not be updated to a snapshot build. */
1828
const ignorePackages = [
1929
// Skip update for the shared dev-infra package. We do not want to update to a snapshot
@@ -41,15 +51,18 @@ const snapshotPackages = Object.keys({
4151
...packageJson.dependencies,
4252
...packageJson.devDependencies,
4353
}).filter(
44-
packageName => packageName.startsWith('@angular/') && !ignorePackages.includes(packageName),
54+
packageName => targetPackageRegex.test(packageName) && !ignorePackages.includes(packageName),
4555
);
4656

4757
console.log('Setting up snapshot builds for:\n');
4858
console.log(` ${snapshotPackages.map(n => `${n}${packageSuffix}`).join('\n ')}\n`);
4959

5060
// Setup the snapshot version for each Angular package specified in the "package.json" file.
5161
snapshotPackages.forEach(packageName => {
52-
const buildsUrl = `github:angular/${packageName.split('/')[1]}-builds${tag ? `#${tag}` : ''}`;
62+
const parts = packageName.split('/');
63+
const scopeName = parts[0].substring(1);
64+
const snapshotRepoPrefix = scopeName === 'angular' ? parts[1] : `${scopeName}-${parts[1]}`;
65+
const buildsUrl = `github:angular/${snapshotRepoPrefix}-builds${tag ? `#${tag}` : ''}`;
5366

5467
// Add resolutions for each package in the format "**/{PACKAGE}" so that all
5568
// nested versions of that specific Angular package will have the same version.

0 commit comments

Comments
 (0)