@nx/angular 20.3.0-canary.20241218-fb40366 → 20.3.0-rc.0
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/migrations.json +18 -0
- package/package.json +8 -8
- package/src/generators/component/lib/normalize-options.js +3 -0
- package/src/generators/library/lib/add-standalone-component.js +1 -1
- package/src/generators/ng-add/utilities/workspace.js +5 -2
- package/src/generators/setup-mf/setup-mf.js +2 -0
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.js +6 -0
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts +2 -0
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.js +18 -0
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
package/migrations.json
CHANGED
|
@@ -332,6 +332,12 @@
|
|
|
332
332
|
},
|
|
333
333
|
"description": "Remove the deprecated 'tailwindConfig' option from ng-packagr executors. Tailwind CSS configurations located at the project or workspace root will be picked up automatically.",
|
|
334
334
|
"factory": "./src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors"
|
|
335
|
+
},
|
|
336
|
+
"ensure-nx-module-federation-package": {
|
|
337
|
+
"cli": "nx",
|
|
338
|
+
"version": "20.3.0-beta.2",
|
|
339
|
+
"description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.",
|
|
340
|
+
"factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package"
|
|
335
341
|
}
|
|
336
342
|
},
|
|
337
343
|
"packageJsonUpdates": {
|
|
@@ -1397,6 +1403,18 @@
|
|
|
1397
1403
|
"alwaysAddToPackageJson": false
|
|
1398
1404
|
}
|
|
1399
1405
|
}
|
|
1406
|
+
},
|
|
1407
|
+
"20.2.3-ngrx": {
|
|
1408
|
+
"version": "20.3.0-beta.2",
|
|
1409
|
+
"requires": {
|
|
1410
|
+
"@angular/core": "^19.0.0"
|
|
1411
|
+
},
|
|
1412
|
+
"packages": {
|
|
1413
|
+
"@ngrx/store": {
|
|
1414
|
+
"version": "^19.0.0",
|
|
1415
|
+
"alwaysAddToPackageJson": false
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1400
1418
|
}
|
|
1401
1419
|
}
|
|
1402
1420
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "20.3.0-
|
|
3
|
+
"version": "20.3.0-rc.0",
|
|
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": {
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
"semver": "^7.5.3",
|
|
72
72
|
"tslib": "^2.3.0",
|
|
73
73
|
"webpack-merge": "^5.8.0",
|
|
74
|
-
"@nx/devkit": "20.3.0-
|
|
75
|
-
"@nx/js": "20.3.0-
|
|
76
|
-
"@nx/eslint": "20.3.0-
|
|
77
|
-
"@nx/webpack": "20.3.0-
|
|
78
|
-
"@nx/module-federation": "20.3.0-
|
|
79
|
-
"@nx/web": "20.3.0-
|
|
80
|
-
"@nx/workspace": "20.3.0-
|
|
74
|
+
"@nx/devkit": "20.3.0-rc.0",
|
|
75
|
+
"@nx/js": "20.3.0-rc.0",
|
|
76
|
+
"@nx/eslint": "20.3.0-rc.0",
|
|
77
|
+
"@nx/webpack": "20.3.0-rc.0",
|
|
78
|
+
"@nx/module-federation": "20.3.0-rc.0",
|
|
79
|
+
"@nx/web": "20.3.0-rc.0",
|
|
80
|
+
"@nx/workspace": "20.3.0-rc.0",
|
|
81
81
|
"piscina": "^4.4.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
@@ -14,6 +14,9 @@ async function normalizeOptions(tree, options) {
|
|
|
14
14
|
allowedFileExtensions: ['ts'],
|
|
15
15
|
fileExtension: 'ts',
|
|
16
16
|
});
|
|
17
|
+
if (name.includes('/')) {
|
|
18
|
+
throw new Error(`The component name '${name}' cannot contain a slash as it must be a valid JS symbol. Please use a different name.`);
|
|
19
|
+
}
|
|
17
20
|
const { className } = (0, devkit_1.names)(name);
|
|
18
21
|
const { className: suffixClassName } = (0, devkit_1.names)(options.type);
|
|
19
22
|
const symbolName = `${className}${suffixClassName}`;
|
|
@@ -8,7 +8,7 @@ const add_load_children_1 = require("./add-load-children");
|
|
|
8
8
|
async function addStandaloneComponent(tree, { libraryOptions, componentOptions }) {
|
|
9
9
|
await (0, component_1.componentGenerator)(tree, {
|
|
10
10
|
...componentOptions,
|
|
11
|
-
name:
|
|
11
|
+
name: (0, devkit_1.names)(libraryOptions.name).className,
|
|
12
12
|
path: (0, devkit_1.joinPathFragments)(libraryOptions.projectRoot, 'src', 'lib', componentOptions.flat
|
|
13
13
|
? `${componentOptions.name}`
|
|
14
14
|
: `${componentOptions.name}/${componentOptions.name}`),
|
|
@@ -54,7 +54,10 @@ function createNxJson(tree, options, defaultProject) {
|
|
|
54
54
|
]
|
|
55
55
|
: []),
|
|
56
56
|
...(targets.lint
|
|
57
|
-
? [
|
|
57
|
+
? [
|
|
58
|
+
'!{projectRoot}/.eslintrc.json',
|
|
59
|
+
'!{projectRoot}/eslint.config.cjs',
|
|
60
|
+
]
|
|
58
61
|
: []),
|
|
59
62
|
].filter(Boolean),
|
|
60
63
|
},
|
|
@@ -75,7 +78,7 @@ function createNxJson(tree, options, defaultProject) {
|
|
|
75
78
|
inputs: [
|
|
76
79
|
'default',
|
|
77
80
|
'{workspaceRoot}/.eslintrc.json',
|
|
78
|
-
'{workspaceRoot}/eslint.config.
|
|
81
|
+
'{workspaceRoot}/eslint.config.cjs',
|
|
79
82
|
],
|
|
80
83
|
cache: true,
|
|
81
84
|
}
|
|
@@ -24,6 +24,7 @@ async function setupMf(tree, rawOptions) {
|
|
|
24
24
|
}, {
|
|
25
25
|
'@nx/web': versions_1.nxVersion,
|
|
26
26
|
'@nx/webpack': versions_1.nxVersion,
|
|
27
|
+
'@nx/module-federation': versions_1.nxVersion,
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -47,6 +48,7 @@ async function setupMf(tree, rawOptions) {
|
|
|
47
48
|
installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
48
49
|
'@nx/webpack': versions_1.nxVersion,
|
|
49
50
|
'@module-federation/enhanced': versions_1.moduleFederationEnhancedVersion,
|
|
51
|
+
'@nx/module-federation': versions_1.nxVersion,
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
54
|
}
|
|
@@ -4,6 +4,7 @@ exports.default = migrateWithMfImport;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
6
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
7
|
+
const versions_1 = require("../../utils/versions");
|
|
7
8
|
const NX_ANGULAR_MODULE_FEDERATION_IMPORT_SELECTOR = 'ImportDeclaration > StringLiteral[value=@nx/angular/module-federation], VariableStatement CallExpression:has(Identifier[name=require]) > StringLiteral[value=@nx/angular/module-federation]';
|
|
8
9
|
const NEW_IMPORT_PATH = `'@nx/module-federation/angular'`;
|
|
9
10
|
async function migrateWithMfImport(tree) {
|
|
@@ -31,5 +32,10 @@ async function migrateWithMfImport(tree) {
|
|
|
31
32
|
tree.write(filePath, contents);
|
|
32
33
|
});
|
|
33
34
|
}
|
|
35
|
+
if (projects.size !== 0) {
|
|
36
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
37
|
+
'@nx/module-federation': versions_1.nxVersion,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
34
40
|
await (0, devkit_1.formatFiles)(tree);
|
|
35
41
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = ensureMfPackage;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
|
+
const versions_1 = require("../../utils/versions");
|
|
7
|
+
async function ensureMfPackage(tree) {
|
|
8
|
+
const projects = new Set();
|
|
9
|
+
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nx/angular:module-federation-dev-server', (options, project, target) => {
|
|
10
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
11
|
+
projects.add(projectConfig.root);
|
|
12
|
+
});
|
|
13
|
+
if (projects.size !== 0) {
|
|
14
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
15
|
+
'@nx/module-federation': versions_1.nxVersion,
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const nxVersion: any;
|
|
|
2
2
|
export declare const angularVersion = "~19.0.0";
|
|
3
3
|
export declare const angularDevkitVersion = "~19.0.0";
|
|
4
4
|
export declare const ngPackagrVersion = "~19.0.0";
|
|
5
|
-
export declare const ngrxVersion = "^
|
|
5
|
+
export declare const ngrxVersion = "^19.0.0";
|
|
6
6
|
export declare const rxjsVersion = "~7.8.0";
|
|
7
7
|
export declare const zoneJsVersion = "~0.15.0";
|
|
8
8
|
export declare const angularJsVersion = "1.7.9";
|
package/src/utils/versions.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.nxVersion = require('../../package.json').version;
|
|
|
5
5
|
exports.angularVersion = '~19.0.0';
|
|
6
6
|
exports.angularDevkitVersion = '~19.0.0';
|
|
7
7
|
exports.ngPackagrVersion = '~19.0.0';
|
|
8
|
-
exports.ngrxVersion = '^
|
|
8
|
+
exports.ngrxVersion = '^19.0.0';
|
|
9
9
|
exports.rxjsVersion = '~7.8.0';
|
|
10
10
|
exports.zoneJsVersion = '~0.15.0';
|
|
11
11
|
exports.angularJsVersion = '1.7.9';
|