feat(angular): support angular v19.1 (#29523)
Add support for Angular v19.1.x.
This commit is contained in:
parent
4d0ebe04c9
commit
6d8fe5c5fe
@ -6,7 +6,7 @@ Description of a file change in the Nx virtual file system/
|
||||
|
||||
### Properties
|
||||
|
||||
- [content](../../devkit/documents/FileChange#content): Buffer
|
||||
- [content](../../devkit/documents/FileChange#content): Buffer<ArrayBufferLike>
|
||||
- [options](../../devkit/documents/FileChange#options): TreeWriteOptions
|
||||
- [path](../../devkit/documents/FileChange#path): string
|
||||
- [type](../../devkit/documents/FileChange#type): "CREATE" | "DELETE" | "UPDATE"
|
||||
@ -15,7 +15,7 @@ Description of a file change in the Nx virtual file system/
|
||||
|
||||
### content
|
||||
|
||||
• **content**: `Buffer`
|
||||
• **content**: `Buffer`\<`ArrayBufferLike`\>
|
||||
|
||||
The content of the file or null in case of delete.
|
||||
|
||||
|
||||
@ -135,7 +135,7 @@ Returns the list of currently recorded changes.
|
||||
|
||||
### read
|
||||
|
||||
▸ **read**(`filePath`): `Buffer`
|
||||
▸ **read**(`filePath`): `Buffer`\<`ArrayBufferLike`\>
|
||||
|
||||
Read the contents of a file.
|
||||
|
||||
@ -147,7 +147,7 @@ Read the contents of a file.
|
||||
|
||||
#### Returns
|
||||
|
||||
`Buffer`
|
||||
`Buffer`\<`ArrayBufferLike`\>
|
||||
|
||||
▸ **read**(`filePath`, `encoding`): `string`
|
||||
|
||||
@ -194,9 +194,9 @@ Update the contents of a file or create a new file.
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :--------- | :------------------- |
|
||||
| :--------- | :---------------------------------------- |
|
||||
| `filePath` | `string` |
|
||||
| `content` | `string` \| `Buffer` |
|
||||
| `content` | `string` \| `Buffer`\<`ArrayBufferLike`\> |
|
||||
| `options?` | `TreeWriteOptions` |
|
||||
|
||||
#### Returns
|
||||
|
||||
@ -72,7 +72,7 @@
|
||||
"type": "executor"
|
||||
},
|
||||
"/nx-api/angular/executors/package": {
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds.",
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` and `@angular/build:ng-packagr` builders, with additional support for incremental builds.",
|
||||
"file": "generated/packages/angular/executors/package.json",
|
||||
"hidden": false,
|
||||
"name": "package",
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
"type": "executor"
|
||||
},
|
||||
{
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds.",
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` and `@angular/build:ng-packagr` builders, with additional support for incremental builds.",
|
||||
"file": "generated/packages/angular/executors/package.json",
|
||||
"hidden": false,
|
||||
"name": "package",
|
||||
|
||||
@ -14,6 +14,7 @@ We provide a recommended version, and it is usually the latest minor version of
|
||||
|
||||
| Angular Version | **Nx Version _(recommended)_** | Nx Version _(range)_ |
|
||||
| --------------- | ------------------------------ | ---------------------------------------- |
|
||||
| ~19.1.0 | **latest** | >=20.4.0 <=latest |
|
||||
| ~19.0.0 | **latest** | >=20.2.0 <=latest |
|
||||
| ~18.2.0 | **latest** | >=19.6.0 <=latest |
|
||||
| ~18.1.0 | **latest** | >=19.5.0 <=latest |
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"outputCapture": "direct-nodejs",
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"title": "ng-packagr Target",
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds.",
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` and `@angular/build:ng-packagr` builders, with additional support for incremental builds.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"presets": [
|
||||
@ -44,7 +44,7 @@
|
||||
"project"
|
||||
]
|
||||
},
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds.",
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` and `@angular/build:ng-packagr` builders, with additional support for incremental builds.",
|
||||
"aliases": [],
|
||||
"hidden": false,
|
||||
"path": "/packages/angular/src/executors/package/schema.json",
|
||||
|
||||
@ -14,6 +14,7 @@ We provide a recommended version, and it is usually the latest minor version of
|
||||
|
||||
| Angular Version | **Nx Version _(recommended)_** | Nx Version _(range)_ |
|
||||
| --------------- | ------------------------------ | ---------------------------------------- |
|
||||
| ~19.1.0 | **latest** | >=20.4.0 <=latest |
|
||||
| ~19.0.0 | **latest** | >=20.2.0 <=latest |
|
||||
| ~18.2.0 | **latest** | >=19.6.0 <=latest |
|
||||
| ~18.1.0 | **latest** | >=19.5.0 <=latest |
|
||||
|
||||
36
package.json
36
package.json
@ -27,19 +27,19 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@angular-devkit/architect": "~0.1900.0",
|
||||
"@angular-devkit/build-angular": "~19.0.0",
|
||||
"@angular-devkit/core": "~19.0.0",
|
||||
"@angular-devkit/schematics": "~19.0.0",
|
||||
"@angular-devkit/architect": "~0.1901.0",
|
||||
"@angular-devkit/build-angular": "~19.1.0",
|
||||
"@angular-devkit/core": "~19.1.0",
|
||||
"@angular-devkit/schematics": "~19.1.0",
|
||||
"@angular-eslint/eslint-plugin": "19.0.2",
|
||||
"@angular-eslint/eslint-plugin-template": "19.0.2",
|
||||
"@angular-eslint/template-parser": "19.0.2",
|
||||
"@angular/cli": "~19.0.0",
|
||||
"@angular/common": "~19.0.0",
|
||||
"@angular/compiler": "~19.0.0",
|
||||
"@angular/compiler-cli": "~19.0.0",
|
||||
"@angular/core": "~19.0.0",
|
||||
"@angular/router": "~19.0.0",
|
||||
"@angular/cli": "~19.1.0",
|
||||
"@angular/common": "~19.1.0",
|
||||
"@angular/compiler": "~19.1.0",
|
||||
"@angular/compiler-cli": "~19.1.0",
|
||||
"@angular/core": "~19.1.0",
|
||||
"@angular/router": "~19.1.0",
|
||||
"@babel/core": "^7.23.2",
|
||||
"@babel/helper-create-regexp-features-plugin": "^7.22.9",
|
||||
"@babel/plugin-transform-runtime": "^7.23.2",
|
||||
@ -107,7 +107,7 @@
|
||||
"@rspack/dev-server": "1.0.9",
|
||||
"@rspack/plugin-minify": "^0.7.5",
|
||||
"@rspack/plugin-react-refresh": "^1.0.0",
|
||||
"@schematics/angular": "~19.0.0",
|
||||
"@schematics/angular": "~19.1.0",
|
||||
"@storybook/addon-essentials": "8.4.6",
|
||||
"@storybook/addon-interactions": "8.4.6",
|
||||
"@storybook/core-server": "8.4.6",
|
||||
@ -146,10 +146,10 @@
|
||||
"@types/tmp": "^0.2.0",
|
||||
"@types/yargs": "17.0.10",
|
||||
"@types/yarnpkg__lockfile": "^1.1.5",
|
||||
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
||||
"@typescript-eslint/rule-tester": "^8.13.0",
|
||||
"@typescript-eslint/type-utils": "^8.13.0",
|
||||
"@typescript-eslint/utils": "^8.13.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.19.0",
|
||||
"@typescript-eslint/rule-tester": "^8.19.0",
|
||||
"@typescript-eslint/type-utils": "^8.19.0",
|
||||
"@typescript-eslint/utils": "^8.19.0",
|
||||
"@xstate/immer": "0.3.1",
|
||||
"@xstate/inspect": "0.7.0",
|
||||
"@xstate/react": "3.0.1",
|
||||
@ -246,7 +246,7 @@
|
||||
"mini-css-extract-plugin": "~2.4.7",
|
||||
"minimatch": "9.0.3",
|
||||
"next-sitemap": "^3.1.10",
|
||||
"ng-packagr": "~19.0.0",
|
||||
"ng-packagr": "~19.1.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"npm-package-arg": "11.0.1",
|
||||
"nuxt": "^3.10.0",
|
||||
@ -299,8 +299,8 @@
|
||||
"tsconfig-paths-webpack-plugin": "4.0.0",
|
||||
"typedoc": "0.25.12",
|
||||
"typedoc-plugin-markdown": "3.17.1",
|
||||
"typescript": "~5.6.2",
|
||||
"typescript-eslint": "^8.13.0",
|
||||
"typescript": "~5.7.2",
|
||||
"typescript-eslint": "^8.19.0",
|
||||
"unist-builder": "^4.0.0",
|
||||
"use-sync-external-store": "^1.2.0",
|
||||
"verdaccio": "^5.30.0",
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
"package": {
|
||||
"implementation": "./src/executors/package/package.impl",
|
||||
"schema": "./src/executors/package/schema.json",
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds."
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` and `@angular/build:ng-packagr` builders, with additional support for incremental builds."
|
||||
},
|
||||
"browser-esbuild": {
|
||||
"implementation": "./src/executors/browser-esbuild/browser-esbuild.impl",
|
||||
|
||||
@ -338,6 +338,15 @@
|
||||
"version": "20.3.0-beta.2",
|
||||
"description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.",
|
||||
"factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package"
|
||||
},
|
||||
"update-angular-cli-version-19-1-0": {
|
||||
"cli": "nx",
|
||||
"version": "20.4.0-beta.1",
|
||||
"requires": {
|
||||
"@angular/core": ">=19.1.0"
|
||||
},
|
||||
"description": "Update the @angular/cli package version to ~19.1.0.",
|
||||
"factory": "./src/migrations/update-20-4-0/update-angular-cli"
|
||||
}
|
||||
},
|
||||
"packageJsonUpdates": {
|
||||
@ -1415,6 +1424,67 @@
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"20.4.0": {
|
||||
"version": "20.4.0-beta.1",
|
||||
"x-prompt": "Do you want to update the Angular version to v19.1?",
|
||||
"requires": {
|
||||
"@angular/core": ">=19.0.0 <19.1.0"
|
||||
},
|
||||
"packages": {
|
||||
"@angular-devkit/build-angular": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@angular-devkit/core": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@angular-devkit/schematics": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@angular/build": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@angular/pwa": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@angular/ssr": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@schematics/angular": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@angular-devkit/architect": {
|
||||
"version": "~0.1901.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@angular-devkit/build-webpack": {
|
||||
"version": "~0.1901.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@angular/core": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": true
|
||||
},
|
||||
"@angular/material": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@angular/cdk": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"ng-packagr": {
|
||||
"version": "~19.1.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
"outputCapture": "direct-nodejs",
|
||||
"$schema": "https://json-schema.org/schema",
|
||||
"title": "ng-packagr Target",
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds.",
|
||||
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` and `@angular/build:ng-packagr` builders, with additional support for incremental builds.",
|
||||
"cli": "nx",
|
||||
"type": "object",
|
||||
"presets": [
|
||||
|
||||
@ -66,7 +66,7 @@ describe('addLinting generator', () => {
|
||||
|
||||
const { devDependencies } = readJson(tree, 'package.json');
|
||||
expect(devDependencies['@typescript-eslint/utils']).toMatchInlineSnapshot(
|
||||
`"^8.13.0"`
|
||||
`"^8.19.0"`
|
||||
);
|
||||
delete process.env.ESLINT_USE_FLAT_CONFIG;
|
||||
});
|
||||
|
||||
@ -10,6 +10,7 @@ import type { MoveImplOptions } from './types';
|
||||
|
||||
const libraryExecutors = [
|
||||
'@angular-devkit/build-angular:ng-packagr',
|
||||
'@angular/build:ng-packagr',
|
||||
'@nx/angular:ng-packagr-lite',
|
||||
'@nx/angular:package',
|
||||
// TODO(v17): remove when @nrwl/* scope is removed
|
||||
|
||||
@ -22,7 +22,7 @@ export class AngularDevkitKarmaMigrator extends BuilderMigrator {
|
||||
) {
|
||||
super(
|
||||
tree,
|
||||
'@angular-devkit/build-angular:karma',
|
||||
['@angular-devkit/build-angular:karma'],
|
||||
'karma',
|
||||
project,
|
||||
projectConfig,
|
||||
|
||||
@ -24,7 +24,7 @@ export class AngularDevkitNgPackagrMigrator extends BuilderMigrator {
|
||||
) {
|
||||
super(
|
||||
tree,
|
||||
'@angular-devkit/build-angular:ng-packagr',
|
||||
['@angular-devkit/build-angular:ng-packagr', '@angular/build:ng-packagr'],
|
||||
undefined,
|
||||
project,
|
||||
projectConfig,
|
||||
@ -39,8 +39,11 @@ export class AngularDevkitNgPackagrMigrator extends BuilderMigrator {
|
||||
|
||||
if (!this.targets.size) {
|
||||
this.logger.warn(
|
||||
`There is no target in the project configuration using the ${this.builderName} builder. This might not be an issue. ` +
|
||||
`Skipping updating the build configuration.`
|
||||
`There is no target in the project configuration using the ${this.possibleBuilderNames
|
||||
.map((b) => `"${b}"`)
|
||||
.join(', ')} builder${
|
||||
this.possibleBuilderNames.length > 1 ? 's' : ''
|
||||
}. This might not be an issue. Skipping updating the build configuration.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -27,7 +27,7 @@ export class AngularEslintLintMigrator extends BuilderMigrator {
|
||||
) {
|
||||
super(
|
||||
tree,
|
||||
'@angular-eslint/builder:lint',
|
||||
['@angular-eslint/builder:lint'],
|
||||
'eslint',
|
||||
project,
|
||||
projectConfig,
|
||||
|
||||
@ -20,7 +20,7 @@ export abstract class BuilderMigrator extends Migrator {
|
||||
|
||||
constructor(
|
||||
tree: Tree,
|
||||
public readonly builderName: string,
|
||||
public readonly possibleBuilderNames: string[],
|
||||
public readonly rootFileType: WorkspaceRootFileType | undefined,
|
||||
project: ProjectMigrationInfo,
|
||||
projectConfig: ProjectConfiguration,
|
||||
@ -40,9 +40,9 @@ export abstract class BuilderMigrator extends Migrator {
|
||||
// expanding what's supported.
|
||||
if (this.targets.size > 1) {
|
||||
errors.push({
|
||||
message: `There is more than one target using the builder "${
|
||||
this.builderName
|
||||
}": ${arrayToString([
|
||||
message: `There is more than one target using the builder${
|
||||
this.possibleBuilderNames.length > 1 ? 's' : ''
|
||||
} ${arrayToString(this.possibleBuilderNames)}: ${arrayToString([
|
||||
...this.targets.keys(),
|
||||
])}. This is not currently supported by the automated migration. These targets will be skipped.`,
|
||||
hint: 'Make sure to manually migrate their configuration and any possible associated files.',
|
||||
@ -61,7 +61,7 @@ export abstract class BuilderMigrator extends Migrator {
|
||||
for (const [name, target] of Object.entries(
|
||||
this.projectConfig.targets ?? {}
|
||||
)) {
|
||||
if (target.executor === this.builderName) {
|
||||
if (this.possibleBuilderNames.includes(target.executor)) {
|
||||
this.targets.set(name, target);
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ describe('lib migrator', () => {
|
||||
`The "build" target is using a builder "@not/supported:builder" that's not currently supported by the automated migration. The target will be skipped.`,
|
||||
]);
|
||||
expect(result[0].hint).toMatchInlineSnapshot(
|
||||
`"Make sure to manually migrate the target configuration and any possible associated files. Alternatively, you could revert the migration, change the builder to one of the builders supported by the automated migration ("@angular-devkit/build-angular:ng-packagr", "@angular-devkit/build-angular:karma" and "@angular-eslint/builder:lint"), and run the migration again."`
|
||||
`"Make sure to manually migrate the target configuration and any possible associated files. Alternatively, you could revert the migration, change the builder to one of the builders supported by the automated migration ("@angular-devkit/build-angular:ng-packagr", "@angular/build:ng-packagr", "@angular-devkit/build-angular:karma" and "@angular-eslint/builder:lint"), and run the migration again."`
|
||||
);
|
||||
});
|
||||
|
||||
@ -163,7 +163,7 @@ describe('lib migrator', () => {
|
||||
`The "test" target is using a builder "@other/not-supported:builder" that's not currently supported by the automated migration. The target will be skipped.`,
|
||||
]);
|
||||
expect(result[0].hint).toMatchInlineSnapshot(
|
||||
`"Make sure to manually migrate the target configuration and any possible associated files. Alternatively, you could revert the migration, change the builder to one of the builders supported by the automated migration ("@angular-devkit/build-angular:ng-packagr", "@angular-devkit/build-angular:karma" and "@angular-eslint/builder:lint"), and run the migration again."`
|
||||
`"Make sure to manually migrate the target configuration and any possible associated files. Alternatively, you could revert the migration, change the builder to one of the builders supported by the automated migration ("@angular-devkit/build-angular:ng-packagr", "@angular/build:ng-packagr", "@angular-devkit/build-angular:karma" and "@angular-eslint/builder:lint"), and run the migration again."`
|
||||
);
|
||||
});
|
||||
|
||||
@ -182,7 +182,7 @@ describe('lib migrator', () => {
|
||||
`The "my-build" target is using a builder "@not/supported:builder" that's not currently supported by the automated migration. The target will be skipped.`,
|
||||
]);
|
||||
expect(result[0].hint).toMatchInlineSnapshot(
|
||||
`"Make sure to manually migrate the target configuration and any possible associated files. Alternatively, you could revert the migration, change the builder to one of the builders supported by the automated migration ("@angular-devkit/build-angular:ng-packagr", "@angular-devkit/build-angular:karma" and "@angular-eslint/builder:lint"), and run the migration again."`
|
||||
`"Make sure to manually migrate the target configuration and any possible associated files. Alternatively, you could revert the migration, change the builder to one of the builders supported by the automated migration ("@angular-devkit/build-angular:ng-packagr", "@angular/build:ng-packagr", "@angular-devkit/build-angular:karma" and "@angular-eslint/builder:lint"), and run the migration again."`
|
||||
);
|
||||
});
|
||||
|
||||
@ -200,7 +200,7 @@ describe('lib migrator', () => {
|
||||
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0].message).toBe(
|
||||
'There is more than one target using the builder "@angular-devkit/build-angular:ng-packagr": "build1" and "build2". This is not currently supported by the automated migration. These targets will be skipped.'
|
||||
'There is more than one target using the builders "@angular-devkit/build-angular:ng-packagr" and "@angular/build:ng-packagr": "build1" and "build2". This is not currently supported by the automated migration. These targets will be skipped.'
|
||||
);
|
||||
expect(result[0].hint).toBe(
|
||||
'Make sure to manually migrate their configuration and any possible associated files.'
|
||||
@ -223,7 +223,7 @@ describe('lib migrator', () => {
|
||||
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result[0].message).toBe(
|
||||
'There is more than one target using the builder "@angular-devkit/build-angular:ng-packagr": "build1" and "build2". This is not currently supported by the automated migration. These targets will be skipped.'
|
||||
'There is more than one target using the builders "@angular-devkit/build-angular:ng-packagr" and "@angular/build:ng-packagr": "build1" and "build2". This is not currently supported by the automated migration. These targets will be skipped.'
|
||||
);
|
||||
expect(result[0].hint).toBe(
|
||||
'Make sure to manually migrate their configuration and any possible associated files.'
|
||||
@ -287,7 +287,7 @@ describe('lib migrator', () => {
|
||||
await expect(migrator.migrate()).resolves.not.toThrow();
|
||||
|
||||
expect(mockedLogger.warn).toHaveBeenCalledWith(
|
||||
'There is no target in the project configuration using the @angular-devkit/build-angular:ng-packagr builder. This might not be an issue. Skipping updating the build configuration.'
|
||||
'There is no target in the project configuration using the "@angular-devkit/build-angular:ng-packagr", "@angular/build:ng-packagr" builders. This might not be an issue. Skipping updating the build configuration.'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@ -135,7 +135,9 @@ export class ProjectMigrator<
|
||||
.flat(),
|
||||
];
|
||||
allSupportedBuilders.push(
|
||||
...this.builderMigrators.map((migrator) => migrator.builderName)
|
||||
...this.builderMigrators.flatMap(
|
||||
(migrator) => migrator.possibleBuilderNames
|
||||
)
|
||||
);
|
||||
const unsupportedBuilders: [target: string, builder: string][] = [];
|
||||
|
||||
|
||||
@ -33,6 +33,13 @@ export async function normalizeOptions(
|
||||
} else {
|
||||
options.serverRouting = false;
|
||||
}
|
||||
} else if (
|
||||
options.serverRouting !== undefined &&
|
||||
!isUsingApplicationBuilder
|
||||
) {
|
||||
throw new Error(
|
||||
'Server routing APIs can only be added to a project using `application` builder.'
|
||||
);
|
||||
}
|
||||
|
||||
const isStandaloneApp = isNgStandaloneApp(tree, options.project);
|
||||
|
||||
@ -17,6 +17,7 @@ export function validateBuildTarget(
|
||||
|
||||
const supportedLibraryExecutors = [
|
||||
'@angular-devkit/build-angular:ng-packagr',
|
||||
'@angular/build:ng-packagr',
|
||||
'@nx/angular:ng-packagr-lite',
|
||||
'@nx/angular:package',
|
||||
];
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
import { readJson, Tree, writeJson } from '@nx/devkit';
|
||||
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
||||
import updateAngularCli, { angularCliVersion } from './update-angular-cli';
|
||||
|
||||
describe('update-angular-cli migration', () => {
|
||||
let tree: Tree;
|
||||
|
||||
beforeEach(() => {
|
||||
tree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
||||
});
|
||||
|
||||
it('should update @angular/cli version when defined as a dev dependency', async () => {
|
||||
writeJson(tree, 'package.json', {
|
||||
devDependencies: { '@angular/cli': '~13.3.0' },
|
||||
});
|
||||
|
||||
await updateAngularCli(tree);
|
||||
|
||||
const { devDependencies } = readJson(tree, 'package.json');
|
||||
expect(devDependencies['@angular/cli']).toBe(angularCliVersion);
|
||||
});
|
||||
|
||||
it('should update @angular/cli version when defined as a dependency', async () => {
|
||||
writeJson(tree, 'package.json', {
|
||||
dependencies: { '@angular/cli': '~13.3.0' },
|
||||
});
|
||||
|
||||
await updateAngularCli(tree);
|
||||
|
||||
const { dependencies } = readJson(tree, 'package.json');
|
||||
expect(dependencies['@angular/cli']).toBe(angularCliVersion);
|
||||
});
|
||||
|
||||
it('should not add @angular/cli to package.json when it is not set', async () => {
|
||||
const initialPackageJson = readJson(tree, 'package.json');
|
||||
|
||||
await updateAngularCli(tree);
|
||||
|
||||
const packageJson = readJson(tree, 'package.json');
|
||||
expect(packageJson).toStrictEqual(initialPackageJson);
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,23 @@
|
||||
import { formatFiles, Tree, updateJson } from '@nx/devkit';
|
||||
|
||||
export const angularCliVersion = '~19.1.0';
|
||||
|
||||
export default async function (tree: Tree) {
|
||||
let shouldFormat = false;
|
||||
|
||||
updateJson(tree, 'package.json', (json) => {
|
||||
if (json.devDependencies?.['@angular/cli']) {
|
||||
json.devDependencies['@angular/cli'] = angularCliVersion;
|
||||
shouldFormat = true;
|
||||
} else if (json.dependencies?.['@angular/cli']) {
|
||||
json.dependencies['@angular/cli'] = angularCliVersion;
|
||||
shouldFormat = true;
|
||||
}
|
||||
|
||||
return json;
|
||||
});
|
||||
|
||||
if (shouldFormat) {
|
||||
await formatFiles(tree);
|
||||
}
|
||||
}
|
||||
@ -52,6 +52,7 @@ const knownExecutors = {
|
||||
'@angular-devkit/build-angular:browser-esbuild',
|
||||
'@angular-devkit/build-angular:browser',
|
||||
'@angular-devkit/build-angular:ng-packagr',
|
||||
'@angular/build:ng-packagr',
|
||||
]),
|
||||
devServer: new Set(['@angular-devkit/build-angular:dev-server']),
|
||||
extractI18n: new Set(['@angular-devkit/build-angular:extract-i18n']),
|
||||
@ -371,7 +372,8 @@ async function updateBuildTarget(
|
||||
),
|
||||
];
|
||||
} else if (
|
||||
angularTarget.builder === '@angular-devkit/build-angular:ng-packagr'
|
||||
angularTarget.builder === '@angular-devkit/build-angular:ng-packagr' ||
|
||||
angularTarget.builder === '@angular/build:ng-packagr'
|
||||
) {
|
||||
const outputs = await getNgPackagrOutputs(
|
||||
angularTarget,
|
||||
@ -393,7 +395,10 @@ async function updateBuildTarget(
|
||||
: ['default', '^default'];
|
||||
}
|
||||
|
||||
if (angularTarget.builder === '@angular-devkit/build-angular:ng-packagr') {
|
||||
if (
|
||||
angularTarget.builder === '@angular-devkit/build-angular:ng-packagr' ||
|
||||
angularTarget.builder === '@angular/build:ng-packagr'
|
||||
) {
|
||||
target.metadata.help.example.options = { watch: true };
|
||||
} else {
|
||||
target.metadata.help.example.options = { localize: true };
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
export const nxVersion = require('../../package.json').version;
|
||||
|
||||
export const angularVersion = '~19.0.0';
|
||||
export const angularDevkitVersion = '~19.0.0';
|
||||
export const ngPackagrVersion = '~19.0.0';
|
||||
export const angularVersion = '~19.1.0';
|
||||
export const angularDevkitVersion = '~19.1.0';
|
||||
export const ngPackagrVersion = '~19.1.0';
|
||||
export const ngrxVersion = '^19.0.0';
|
||||
export const rxjsVersion = '~7.8.0';
|
||||
export const zoneJsVersion = '~0.15.0';
|
||||
|
||||
@ -1 +1 @@
|
||||
export const typescriptVersion = '~5.6.2';
|
||||
export const typescriptVersion = '~5.7.2';
|
||||
|
||||
@ -106,6 +106,46 @@
|
||||
"version": "^7.16.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"20.4.0-typescript-eslint": {
|
||||
"version": "20.4.0-beta.1",
|
||||
"requires": {
|
||||
"typescript-eslint": ">8.0.0 <8.19.0"
|
||||
},
|
||||
"packages": {
|
||||
"typescript-eslint": {
|
||||
"version": "^8.19.0"
|
||||
},
|
||||
"@typescript-eslint/parser": {
|
||||
"version": "^8.19.0"
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
"version": "^8.19.0"
|
||||
},
|
||||
"@typescript-eslint/utils": {
|
||||
"version": "^8.19.0"
|
||||
}
|
||||
}
|
||||
},
|
||||
"20.4.0-@typescript-eslint": {
|
||||
"version": "20.4.0-beta.1",
|
||||
"requires": {
|
||||
"@typescript-eslint/eslint-plugin": ">8.0.0 <8.19.0"
|
||||
},
|
||||
"packages": {
|
||||
"typescript-eslint": {
|
||||
"version": "^8.19.0"
|
||||
},
|
||||
"@typescript-eslint/parser": {
|
||||
"version": "^8.19.0"
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
"version": "^8.19.0"
|
||||
},
|
||||
"@typescript-eslint/utils": {
|
||||
"version": "^8.19.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
"@nx/js": "file:../js",
|
||||
"semver": "^7.5.3",
|
||||
"tslib": "^2.3.0",
|
||||
"typescript": "~5.6.2"
|
||||
"typescript": "~5.7.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@zkochan/js-yaml": {
|
||||
|
||||
@ -66,7 +66,7 @@ describe('convert-to-flat-config generator', () => {
|
||||
"@nx/eslint-plugin": "0.0.1",
|
||||
"eslint": "^9.8.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"typescript-eslint": "^8.13.0"
|
||||
"typescript-eslint": "^8.19.0"
|
||||
}
|
||||
}
|
||||
"
|
||||
|
||||
@ -6,6 +6,6 @@ export const eslintConfigPrettierVersion = '^9.0.0';
|
||||
export const typescriptESLintVersion = '^7.16.0';
|
||||
|
||||
// Updated linting stack for ESLint v9, typescript-eslint v8
|
||||
export const eslint9__typescriptESLintVersion = '^8.13.0';
|
||||
export const eslint9__typescriptESLintVersion = '^8.19.0';
|
||||
export const eslint9__eslintVersion = '^9.8.0';
|
||||
export const eslintCompat = '^1.1.1';
|
||||
|
||||
@ -124,6 +124,19 @@
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"20.4.0": {
|
||||
"version": "20.4.0-beta.1",
|
||||
"x-prompt": "Do you want to update to TypeScript v5.7?",
|
||||
"requires": {
|
||||
"typescript": ">=5.6.0 <5.7.0"
|
||||
},
|
||||
"packages": {
|
||||
"typescript": {
|
||||
"version": "~5.7.2",
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ export const typesNodeVersion = '18.16.9';
|
||||
export const verdaccioVersion = '^5.0.4';
|
||||
|
||||
// Typescript
|
||||
export const typescriptVersion = '~5.6.2';
|
||||
export const typescriptVersion = '~5.7.2';
|
||||
/**
|
||||
* The minimum version is currently determined from the lowest version
|
||||
* that's supported by the lowest Angular supported version, e.g.
|
||||
|
||||
@ -159,7 +159,10 @@ function updateProjectOutputs(
|
||||
target.outputs = ['{options.outputPath}'];
|
||||
} else if (target.executor === '@angular-eslint/builder:lint') {
|
||||
target.outputs = ['{options.outputFile}'];
|
||||
} else if (target.executor === '@angular-devkit/build-angular:ng-packagr') {
|
||||
} else if (
|
||||
target.executor === '@angular-devkit/build-angular:ng-packagr' ||
|
||||
target.executor === '@angular/build:ng-packagr'
|
||||
) {
|
||||
try {
|
||||
const ngPackageJsonPath = join(repoRoot, target.options.project);
|
||||
const ngPackageJson = readJsonFile(ngPackageJsonPath);
|
||||
|
||||
@ -1 +1 @@
|
||||
export const typescriptVersion = '~5.6.2';
|
||||
export const typescriptVersion = '~5.7.2';
|
||||
|
||||
@ -9,7 +9,7 @@ export const reactDomVersion = '^18.2.0';
|
||||
export const typesReactVersion = '^18.2.0';
|
||||
export const typesReactDomVersion = '^18.2.0';
|
||||
export const eslintVersion = '^8.56.0';
|
||||
export const typescriptVersion = '~5.6.2';
|
||||
export const typescriptVersion = '~5.7.2';
|
||||
export const tailwindVersion = '^3.3.0';
|
||||
export const postcssVersion = '^8.4.38';
|
||||
export const autoprefixerVersion = '^10.4.19';
|
||||
|
||||
@ -184,7 +184,7 @@ exports[`library should add vue, vite and vitest to package.json 1`] = `
|
||||
"eslint-plugin-vue": "^9.16.1",
|
||||
"jsdom": "~22.1.0",
|
||||
"prettier": "^2.6.2",
|
||||
"typescript": "~5.6.2",
|
||||
"typescript": "~5.7.2",
|
||||
"vite": "^5.0.0",
|
||||
"vitest": "^1.3.1",
|
||||
"vue-tsc": "^2.0.0",
|
||||
|
||||
@ -63,6 +63,19 @@
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"20.4.0": {
|
||||
"version": "20.4.0-beta.1",
|
||||
"x-prompt": "Do you want to update to TypeScript v5.7?",
|
||||
"requires": {
|
||||
"typescript": ">=5.6.0 <5.7.0"
|
||||
},
|
||||
"packages": {
|
||||
"typescript": {
|
||||
"version": "~5.7.2",
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
export const nxVersion = require('../../package.json').version;
|
||||
|
||||
export const typescriptVersion = '~5.6.2';
|
||||
export const typescriptVersion = '~5.7.2';
|
||||
|
||||
// TODO: remove when preset generation is reworked and
|
||||
// deps are not installed from workspace
|
||||
export const angularCliVersion = '~19.0.0';
|
||||
export const angularCliVersion = '~19.1.0';
|
||||
|
||||
4008
pnpm-lock.yaml
generated
4008
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user