Skip to content

Commit

Permalink
fix(angular): fix migrations cli type and use @angular-devkit/build-a…
Browse files Browse the repository at this point in the history
…ngular to determine ng devkit version (#16157)
  • Loading branch information
leosvelperez authored Apr 6, 2023
1 parent 00ed85d commit e9f97f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/angular/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"factory": "./src/migrations/update-15-2-0/update-workspace-config"
},
"update-platform-server-exports": {
"cli": "ng",
"cli": "nx",
"version": "15.2.0-beta.0",
"requires": {
"@angular/core": ">=15.0.0"
Expand All @@ -130,7 +130,7 @@
"factory": "./src/migrations/update-15-2-0/remove-platform-server-exports"
},
"update-karma-main-file": {
"cli": "ng",
"cli": "nx",
"version": "15.2.0-beta.0",
"requires": {
"@angular/core": ">=15.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('installed-required-packages', () => {
'@angular/core': '~15.0.0',
},
devDependencies: {
'@angular/cli': '~15.0.0',
'@angular-devkit/build-angular': '~15.0.0',
},
}));

Expand All @@ -36,9 +36,9 @@ describe('installed-required-packages', () => {
`);
expect(pkgJson.devDependencies).toMatchInlineSnapshot(`
Object {
"@angular-devkit/build-angular": "~15.0.0",
"@angular-devkit/core": "~15.0.0",
"@angular-devkit/schematics": "~15.0.0",
"@angular/cli": "~15.0.0",
"@schematics/angular": "~15.0.0",
}
`);
Expand All @@ -53,7 +53,7 @@ describe('installed-required-packages', () => {
'@angular/core': '~14.0.0',
},
devDependencies: {
'@angular/cli': '~14.0.0',
'@angular-devkit/build-angular': '~14.0.0',
},
}));

Expand All @@ -69,9 +69,9 @@ describe('installed-required-packages', () => {
`);
expect(pkgJson.devDependencies).toMatchInlineSnapshot(`
Object {
"@angular-devkit/build-angular": "~14.0.0",
"@angular-devkit/core": "~14.0.0",
"@angular-devkit/schematics": "~14.0.0",
"@angular/cli": "~14.0.0",
"@schematics/angular": "~14.0.0",
}
`);
Expand All @@ -86,7 +86,7 @@ describe('installed-required-packages', () => {
'@angular/core': '~15.0.0',
},
devDependencies: {
'@angular/cli': '~15.0.0',
'@angular-devkit/build-angular': '~15.0.0',
'@angular-devkit/core': '~15.0.0',
'@angular-devkit/schematics': '~15.0.0',
'@schematics/angular': '~15.0.0',
Expand All @@ -105,9 +105,9 @@ describe('installed-required-packages', () => {
`);
expect(pkgJson.devDependencies).toMatchInlineSnapshot(`
Object {
"@angular-devkit/build-angular": "~15.0.0",
"@angular-devkit/core": "~15.0.0",
"@angular-devkit/schematics": "~15.0.0",
"@angular/cli": "~15.0.0",
"@schematics/angular": "~15.0.0",
}
`);
Expand All @@ -122,7 +122,7 @@ describe('installed-required-packages', () => {
'@angular/core': '~14.0.0',
},
devDependencies: {
'@angular/cli': '~14.0.0',
'@angular-devkit/build-angular': '~14.0.0',
'@angular-devkit/core': '~14.0.0',
'@angular-devkit/schematics': '~14.0.0',
'@schematics/angular': '~14.0.0',
Expand All @@ -141,9 +141,9 @@ describe('installed-required-packages', () => {
`);
expect(pkgJson.devDependencies).toMatchInlineSnapshot(`
Object {
"@angular-devkit/build-angular": "~14.0.0",
"@angular-devkit/core": "~14.0.0",
"@angular-devkit/schematics": "~14.0.0",
"@angular/cli": "~14.0.0",
"@schematics/angular": "~14.0.0",
}
`);
Expand All @@ -158,7 +158,7 @@ describe('installed-required-packages', () => {
'@angular/core': '~15.0.0',
},
devDependencies: {
'@angular/cli': '~15.0.0',
'@angular-devkit/build-angular': '~15.0.0',
'@angular-devkit/core': '~15.0.0',
'@schematics/angular': '~15.0.0',
},
Expand All @@ -176,9 +176,9 @@ describe('installed-required-packages', () => {
`);
expect(pkgJson.devDependencies).toMatchInlineSnapshot(`
Object {
"@angular-devkit/build-angular": "~15.0.0",
"@angular-devkit/core": "~15.0.0",
"@angular-devkit/schematics": "~15.0.0",
"@angular/cli": "~15.0.0",
"@schematics/angular": "~15.0.0",
}
`);
Expand All @@ -193,7 +193,7 @@ describe('installed-required-packages', () => {
'@angular/core': '~14.0.0',
},
devDependencies: {
'@angular/cli': '~14.0.0',
'@angular-devkit/build-angular': '~14.0.0',
'@angular-devkit/core': '~14.0.0',
'@schematics/angular': '~14.0.0',
},
Expand All @@ -211,9 +211,9 @@ describe('installed-required-packages', () => {
`);
expect(pkgJson.devDependencies).toMatchInlineSnapshot(`
Object {
"@angular-devkit/build-angular": "~14.0.0",
"@angular-devkit/core": "~14.0.0",
"@angular-devkit/schematics": "~14.0.0",
"@angular/cli": "~14.0.0",
"@schematics/angular": "~14.0.0",
}
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default async function (tree: Tree) {
);

const angularCliVersion =
pkgJson.devDependencies?.['@angular/cli'] ??
pkgJson.dependencies?.['@angular/cli'] ??
pkgJson.devDependencies?.['@angular-devkit/build-angular'] ??
pkgJson.dependencies?.['@angular-devkit/build-angular'] ??
angularDevkitVersion;

const filteredPackages: Record<string, string> = packagesToInstall
Expand Down

0 comments on commit e9f97f8

Please sign in to comment.