@nx/angular 21.3.0-canary.20250618-5c2fdc9 → 21.3.0-canary.20250621-57e70d0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/src/generators/library/library.js +4 -0
- package/src/generators/library/schema.json +2 -1
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +2 -2
- package/src/migrations/update-17-1-0/replace-nguniversal-engines.js +2 -2
- package/src/migrations/update-17-1-0/update-zone-js-deep-import.js +3 -3
- package/src/migrations/update-20-2-0/disable-angular-eslint-prefer-standalone.js +3 -2
- package/src/migrations/update-20-2-0/remove-angular-eslint-rules.js +3 -2
- package/src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.js +3 -3
- package/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.js +2 -2
- package/src/migrations/update-21-2-0/migrate-provide-server-rendering-import.js +3 -3
- package/src/migrations/update-21-2-0/replace-provide-server-routing.js +3 -3
- package/src/migrations/update-21-2-0/update-module-resolution.js +3 -3
- package/src/migrations/utils/projects.d.ts +2 -5
- package/src/migrations/utils/projects.js +2 -5
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/angular",
|
3
|
-
"version": "21.3.0-canary.
|
3
|
+
"version": "21.3.0-canary.20250621-57e70d0",
|
4
4
|
"private": false,
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
6
6
|
"repository": {
|
@@ -58,14 +58,14 @@
|
|
58
58
|
"migrations": "./migrations.json"
|
59
59
|
},
|
60
60
|
"dependencies": {
|
61
|
-
"@nx/devkit": "21.3.0-canary.
|
62
|
-
"@nx/eslint": "21.3.0-canary.
|
63
|
-
"@nx/js": "21.3.0-canary.
|
64
|
-
"@nx/module-federation": "21.3.0-canary.
|
65
|
-
"@nx/rspack": "21.3.0-canary.
|
66
|
-
"@nx/web": "21.3.0-canary.
|
67
|
-
"@nx/webpack": "21.3.0-canary.
|
68
|
-
"@nx/workspace": "21.3.0-canary.
|
61
|
+
"@nx/devkit": "21.3.0-canary.20250621-57e70d0",
|
62
|
+
"@nx/eslint": "21.3.0-canary.20250621-57e70d0",
|
63
|
+
"@nx/js": "21.3.0-canary.20250621-57e70d0",
|
64
|
+
"@nx/module-federation": "21.3.0-canary.20250621-57e70d0",
|
65
|
+
"@nx/rspack": "21.3.0-canary.20250621-57e70d0",
|
66
|
+
"@nx/web": "21.3.0-canary.20250621-57e70d0",
|
67
|
+
"@nx/webpack": "21.3.0-canary.20250621-57e70d0",
|
68
|
+
"@nx/workspace": "21.3.0-canary.20250621-57e70d0",
|
69
69
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
70
70
|
"@typescript-eslint/type-utils": "^8.0.0",
|
71
71
|
"enquirer": "~2.3.6",
|
@@ -33,6 +33,10 @@ async function libraryGenerator(tree, schema) {
|
|
33
33
|
if (schema.publishable === true && !schema.importPath) {
|
34
34
|
throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
|
35
35
|
}
|
36
|
+
if (schema.simpleName !== undefined && schema.simpleName !== false) {
|
37
|
+
// TODO(v22): Remove simpleName as user should be using name.
|
38
|
+
devkit_1.logger.warn(`The "--simpleName" option is deprecated and will be removed in Nx 22. Please use the "--name" option to provide the exact name you want for the library.`);
|
39
|
+
}
|
36
40
|
if (schema.addTailwind && !schema.buildable && !schema.publishable) {
|
37
41
|
throw new Error(`To use "--addTailwind" option, you have to set either "--buildable" or "--publishable".`);
|
38
42
|
}
|
@@ -47,7 +47,8 @@
|
|
47
47
|
"simpleName": {
|
48
48
|
"description": "Don't include the directory in the name of the module or standalone component entry of the library.",
|
49
49
|
"type": "boolean",
|
50
|
-
"default": false
|
50
|
+
"default": false,
|
51
|
+
"x-deprecated": "Use the --name option to provide the exact name instead. This option will be removed in Nx 22."
|
51
52
|
},
|
52
53
|
"addModuleSpec": {
|
53
54
|
"description": "Add a module spec file.",
|
@@ -18,7 +18,7 @@ const dataPersistenceOperators = [
|
|
18
18
|
];
|
19
19
|
const newImportPath = '@ngrx/router-store/data-persistence';
|
20
20
|
async function default_1(tree) {
|
21
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
21
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(angularPluginTargetNames);
|
22
22
|
if (!projects.length) {
|
23
23
|
return;
|
24
24
|
}
|
@@ -26,7 +26,7 @@ async function default_1(tree) {
|
|
26
26
|
tsquery = require('@phenomnomnominal/tsquery').tsquery;
|
27
27
|
const cachedFileMap = (0, nx_deps_cache_1.readFileMapCache)().fileMap.projectFileMap;
|
28
28
|
const filesWithNxAngularImports = [];
|
29
|
-
for (const
|
29
|
+
for (const graphNode of projects) {
|
30
30
|
const files = filterFilesWithNxAngularDep(cachedFileMap[graphNode.name] || []);
|
31
31
|
filesWithNxAngularImports.push(...files);
|
32
32
|
}
|
@@ -26,11 +26,11 @@ async function default_1(tree) {
|
|
26
26
|
if (!UNIVERSAL_PACKAGES.some((pkg) => packageJson.dependencies?.[pkg] || packageJson.devDependencies?.[pkg])) {
|
27
27
|
return;
|
28
28
|
}
|
29
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
29
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
30
30
|
'npm:@nguniversal/common',
|
31
31
|
'npm:@nguniversal/express-engine',
|
32
32
|
]);
|
33
|
-
for (const { project } of projects) {
|
33
|
+
for (const { data: project } of projects) {
|
34
34
|
if (project.projectType !== 'application') {
|
35
35
|
continue;
|
36
36
|
}
|
@@ -4,7 +4,7 @@ exports.default = default_1;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
5
|
const projects_1 = require("../utils/projects");
|
6
6
|
async function default_1(tree) {
|
7
|
-
const angularProjects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
7
|
+
const angularProjects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
8
8
|
'npm:@angular/core',
|
9
9
|
]);
|
10
10
|
if (!angularProjects.length) {
|
@@ -12,8 +12,8 @@ async function default_1(tree) {
|
|
12
12
|
}
|
13
13
|
const zoneJsImportRegex = /(['"`])zone\.js\/dist\/zone(['"`])/g;
|
14
14
|
const zoneJsTestingImportRegex = /(['"`])zone\.js\/dist\/zone-testing(['"`])/g;
|
15
|
-
for (const
|
16
|
-
(0, devkit_1.visitNotIgnoredFiles)(tree,
|
15
|
+
for (const graphNode of angularProjects) {
|
16
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, graphNode.data.root, (file) => {
|
17
17
|
// we are only interested in .ts files
|
18
18
|
if (!file.endsWith('.ts')) {
|
19
19
|
return;
|
@@ -6,10 +6,11 @@ const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
|
|
6
6
|
const projects_1 = require("../utils/projects");
|
7
7
|
const preferStandaloneRule = '@angular-eslint/prefer-standalone';
|
8
8
|
async function default_1(tree) {
|
9
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
9
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
10
10
|
'npm:@angular/core',
|
11
11
|
]);
|
12
|
-
for (const
|
12
|
+
for (const graphNode of projects) {
|
13
|
+
const root = graphNode.data.root;
|
13
14
|
if (!(0, eslint_file_1.isEslintConfigSupported)(tree, root)) {
|
14
15
|
// ESLint config is not supported, skip
|
15
16
|
continue;
|
@@ -11,11 +11,12 @@ exports.rulesToRemove = [
|
|
11
11
|
'@angular-eslint/prefer-standalone-component',
|
12
12
|
];
|
13
13
|
async function default_1(tree) {
|
14
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
14
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
15
15
|
'npm:@angular/core',
|
16
16
|
]);
|
17
17
|
let hasRootProject = false;
|
18
|
-
for (const
|
18
|
+
for (const graphNode of projects) {
|
19
|
+
const root = graphNode.data.root;
|
19
20
|
if (!(0, eslint_file_1.isEslintConfigSupported)(tree, root)) {
|
20
21
|
// ESLint config is not supported, skip
|
21
22
|
continue;
|
@@ -7,11 +7,11 @@ const ts = tslib_1.__importStar(require("typescript"));
|
|
7
7
|
const file_change_recorder_1 = require("../../utils/file-change-recorder");
|
8
8
|
const projects_1 = require("../utils/projects");
|
9
9
|
async function default_1(tree) {
|
10
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
10
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
11
11
|
'npm:@angular/ssr',
|
12
12
|
]);
|
13
|
-
for (const
|
14
|
-
(0, devkit_1.visitNotIgnoredFiles)(tree,
|
13
|
+
for (const graphNode of projects) {
|
14
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, graphNode.data.root, (path) => {
|
15
15
|
if (!path.endsWith('.ts') || path.endsWith('.d.ts')) {
|
16
16
|
return;
|
17
17
|
}
|
@@ -18,7 +18,7 @@ const dataPersistenceOperators = [
|
|
18
18
|
];
|
19
19
|
const newImportPath = '@ngrx/router-store/data-persistence';
|
20
20
|
async function default_1(tree) {
|
21
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
21
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(angularPluginTargetNames);
|
22
22
|
if (!projects.length) {
|
23
23
|
return;
|
24
24
|
}
|
@@ -26,7 +26,7 @@ async function default_1(tree) {
|
|
26
26
|
tsquery = require('@phenomnomnominal/tsquery').tsquery;
|
27
27
|
const cachedFileMap = (0, nx_deps_cache_1.readFileMapCache)().fileMap.projectFileMap;
|
28
28
|
const filesWithNxAngularImports = [];
|
29
|
-
for (const
|
29
|
+
for (const graphNode of projects) {
|
30
30
|
const files = filterFilesWithNxAngularDep(cachedFileMap[graphNode.name] || []);
|
31
31
|
filesWithNxAngularImports.push(...files);
|
32
32
|
}
|
@@ -8,15 +8,15 @@ const file_change_recorder_1 = require("../../utils/file-change-recorder");
|
|
8
8
|
const versions_1 = require("../../utils/versions");
|
9
9
|
const projects_1 = require("../utils/projects");
|
10
10
|
async function default_1(tree) {
|
11
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
11
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
12
12
|
'npm:@angular/platform-server',
|
13
13
|
]);
|
14
14
|
if (!projects.length) {
|
15
15
|
return;
|
16
16
|
}
|
17
17
|
let isSsrInstalled = false;
|
18
|
-
for (const
|
19
|
-
(0, devkit_1.visitNotIgnoredFiles)(tree,
|
18
|
+
for (const graphNode of projects) {
|
19
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, graphNode.data.root, (file) => {
|
20
20
|
if (!file.endsWith('.ts') || file.endsWith('.d.ts')) {
|
21
21
|
return;
|
22
22
|
}
|
@@ -8,14 +8,14 @@ const ts = tslib_1.__importStar(require("typescript"));
|
|
8
8
|
const file_change_recorder_1 = require("../../utils/file-change-recorder");
|
9
9
|
const projects_1 = require("../utils/projects");
|
10
10
|
async function default_1(tree) {
|
11
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
11
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
12
12
|
'npm:@angular/ssr',
|
13
13
|
]);
|
14
14
|
if (!projects.length) {
|
15
15
|
return;
|
16
16
|
}
|
17
|
-
for (const
|
18
|
-
(0, devkit_1.visitNotIgnoredFiles)(tree,
|
17
|
+
for (const graphNode of projects) {
|
18
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, graphNode.data.root, (file) => {
|
19
19
|
if (!file.endsWith('.ts') || file.endsWith('.d.ts')) {
|
20
20
|
return;
|
21
21
|
}
|
@@ -6,11 +6,11 @@ const targets_1 = require("../../utils/targets");
|
|
6
6
|
const projects_1 = require("../utils/projects");
|
7
7
|
async function default_1(tree) {
|
8
8
|
const uniqueTsConfigs = new Set();
|
9
|
-
const projects = await (0, projects_1.getProjectsFilteredByDependencies)(
|
9
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
10
10
|
'npm:@angular/core',
|
11
11
|
]);
|
12
|
-
for (const
|
13
|
-
for (const [, target] of (0, targets_1.allProjectTargets)(
|
12
|
+
for (const graphNode of projects) {
|
13
|
+
for (const [, target] of (0, targets_1.allProjectTargets)(graphNode.data)) {
|
14
14
|
for (const [, options] of (0, targets_1.allTargetOptions)(target)) {
|
15
15
|
if (typeof options?.tsConfig === 'string') {
|
16
16
|
uniqueTsConfigs.add(options.tsConfig);
|
@@ -1,5 +1,2 @@
|
|
1
|
-
import type {
|
2
|
-
export declare function getProjectsFilteredByDependencies(
|
3
|
-
project: ProjectConfiguration;
|
4
|
-
graphNode: ProjectGraphProjectNode;
|
5
|
-
}>>;
|
1
|
+
import type { ProjectGraphProjectNode } from '@nx/devkit';
|
2
|
+
export declare function getProjectsFilteredByDependencies(dependencies: string[]): Promise<ProjectGraphProjectNode[]>;
|
@@ -2,13 +2,10 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getProjectsFilteredByDependencies = getProjectsFilteredByDependencies;
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
|
-
async function getProjectsFilteredByDependencies(
|
5
|
+
async function getProjectsFilteredByDependencies(dependencies) {
|
6
6
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
7
7
|
return Object.entries(projectGraph.dependencies)
|
8
8
|
.filter(([node, deps]) => !projectGraph.externalNodes?.[node] &&
|
9
9
|
deps.some(({ target }) => dependencies.includes(target)))
|
10
|
-
.map(([projectName]) =>
|
11
|
-
project: (0, devkit_1.readProjectConfiguration)(tree, projectName),
|
12
|
-
graphNode: projectGraph.nodes[projectName],
|
13
|
-
}));
|
10
|
+
.map(([projectName]) => projectGraph.nodes[projectName]);
|
14
11
|
}
|