@nx/angular 20.1.0-canary.20241011-37a7eb1 → 20.1.0-canary.20241015-1badac8
Sign up to get free protection for your applications and to get access to all the features.
- package/migrations.json +4 -0
- package/package.json +8 -8
- package/src/generators/ngrx-root-store/lib/add-imports.js +4 -4
- package/src/generators/remote/remote.js +8 -0
- package/src/generators/setup-mf/lib/add-remote-to-host.js +2 -2
- package/src/generators/setup-mf/lib/setup-tspath-for-remote.js +1 -1
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
package/migrations.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/angular",
|
3
|
-
"version": "20.1.0-canary.
|
3
|
+
"version": "20.1.0-canary.20241015-1badac8",
|
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": {
|
@@ -79,13 +79,13 @@
|
|
79
79
|
"tslib": "^2.3.0",
|
80
80
|
"webpack-merge": "^5.8.0",
|
81
81
|
"webpack": "^5.88.0",
|
82
|
-
"@module-federation/enhanced": "0.6.
|
83
|
-
"@nx/devkit": "20.1.0-canary.
|
84
|
-
"@nx/js": "20.1.0-canary.
|
85
|
-
"@nx/eslint": "20.1.0-canary.
|
86
|
-
"@nx/webpack": "20.1.0-canary.
|
87
|
-
"@nx/web": "20.1.0-canary.
|
88
|
-
"@nx/workspace": "20.1.0-canary.
|
82
|
+
"@module-federation/enhanced": "0.6.9",
|
83
|
+
"@nx/devkit": "20.1.0-canary.20241015-1badac8",
|
84
|
+
"@nx/js": "20.1.0-canary.20241015-1badac8",
|
85
|
+
"@nx/eslint": "20.1.0-canary.20241015-1badac8",
|
86
|
+
"@nx/webpack": "20.1.0-canary.20241015-1badac8",
|
87
|
+
"@nx/web": "20.1.0-canary.20241015-1badac8",
|
88
|
+
"@nx/workspace": "20.1.0-canary.20241015-1badac8",
|
89
89
|
"piscina": "^4.4.0"
|
90
90
|
},
|
91
91
|
"peerDependencies": {
|
@@ -87,14 +87,14 @@ function addImportsToModule(tree, options) {
|
|
87
87
|
sourceFile = addImport(sourceFile, 'StoreModule', '@ngrx/store');
|
88
88
|
sourceFile = addImport(sourceFile, 'EffectsModule', '@ngrx/effects');
|
89
89
|
}
|
90
|
-
sourceFile = addRootStoreImport(tree, isParentStandalone, sourceFile, parentPath, provideRootStore, storeForRoot);
|
91
90
|
sourceFile = addRootEffectsImport(tree, isParentStandalone, sourceFile, parentPath, provideRootEffects, effectsForEmptyRoot);
|
91
|
+
if (options.addDevTools) {
|
92
|
+
sourceFile = addStoreDevTools(tree, sourceFile, parentPath, isParentStandalone, addImport);
|
93
|
+
}
|
94
|
+
sourceFile = addRootStoreImport(tree, isParentStandalone, sourceFile, parentPath, provideRootStore, storeForRoot);
|
92
95
|
// this is just a heuristic
|
93
96
|
const hasRouter = sourceText.indexOf('RouterModule') > -1;
|
94
97
|
if (hasRouter && !isParentStandalone) {
|
95
98
|
sourceFile = addRouterStoreImport(tree, sourceFile, addImport, parentPath, storeRouterModule);
|
96
99
|
}
|
97
|
-
if (options.addDevTools) {
|
98
|
-
sourceFile = addStoreDevTools(tree, sourceFile, parentPath, isParentStandalone, addImport);
|
99
|
-
}
|
100
100
|
}
|
@@ -24,6 +24,14 @@ async function remote(tree, schema) {
|
|
24
24
|
projectType: 'application',
|
25
25
|
directory: options.directory,
|
26
26
|
});
|
27
|
+
const REMOTE_NAME_REGEX = '^[a-zA-Z_$][a-zA-Z_$0-9]*$';
|
28
|
+
const remoteNameRegex = new RegExp(REMOTE_NAME_REGEX);
|
29
|
+
if (!remoteNameRegex.test(remoteProjectName)) {
|
30
|
+
throw new Error((0, devkit_1.stripIndents) `Invalid remote name: ${remoteProjectName}. Remote project names must:
|
31
|
+
- Start with a letter, dollar sign ($) or underscore (_)
|
32
|
+
- Followed by any valid character (letters, digits, underscores, or dollar signs)
|
33
|
+
The regular expression used is ${REMOTE_NAME_REGEX}.`);
|
34
|
+
}
|
27
35
|
const port = options.port ?? (0, lib_1.findNextAvailablePort)(tree);
|
28
36
|
const appInstallTask = await (0, application_1.applicationGenerator)(tree, {
|
29
37
|
...options,
|
@@ -86,8 +86,8 @@ function addLazyLoadedRouteToHostAppModule(tree, options, hostFederationType) {
|
|
86
86
|
? 'remoteRoutes'
|
87
87
|
: 'RemoteEntryModule';
|
88
88
|
const routeToAdd = hostFederationType === 'dynamic'
|
89
|
-
? `loadRemoteModule('${options.appName}', './${routePathName}')`
|
90
|
-
: `import('${options.appName}/${routePathName}')`;
|
89
|
+
? `loadRemoteModule('${options.appName.replace(/-/g, '_')}', './${routePathName}')`
|
90
|
+
: `import('${options.appName.replace(/-/g, '_')}/${routePathName}')`;
|
91
91
|
(0, route_utils_1.addRoute)(tree, pathToHostRootRouting, `{
|
92
92
|
path: '${options.appName}',
|
93
93
|
loadChildren: () => ${routeToAdd}.then(m => m.${exportedRemote})
|
@@ -9,7 +9,7 @@ function setupTspathForRemote(tree, options) {
|
|
9
9
|
? `./src/app/remote-entry/entry.routes.ts`
|
10
10
|
: `./src/app/remote-entry/entry.module.ts`;
|
11
11
|
const exportName = options.standalone ? 'Routes' : 'Module';
|
12
|
-
(0, js_1.addTsConfigPath)(tree, `${options.appName}/${exportName}`, [
|
12
|
+
(0, js_1.addTsConfigPath)(tree, `${options.appName.replace(/-/g, '_')}/${exportName}`, [
|
13
13
|
(0, devkit_1.joinPathFragments)(project.root, exportPath),
|
14
14
|
]);
|
15
15
|
}
|
package/src/utils/versions.d.ts
CHANGED
@@ -13,7 +13,7 @@ export declare const expressVersion = "~4.18.2";
|
|
13
13
|
export declare const typesExpressVersion = "4.17.14";
|
14
14
|
export declare const browserSyncVersion = "^3.0.0";
|
15
15
|
export declare const moduleFederationNodeVersion = "~2.5.0";
|
16
|
-
export declare const moduleFederationEnhancedVersion = "0.6.
|
16
|
+
export declare const moduleFederationEnhancedVersion = "0.6.9";
|
17
17
|
export declare const angularEslintVersion = "^18.3.0";
|
18
18
|
export declare const typescriptEslintVersion = "^7.16.0";
|
19
19
|
export declare const tailwindVersion = "^3.0.2";
|
package/src/utils/versions.js
CHANGED
@@ -16,7 +16,7 @@ exports.expressVersion = '~4.18.2';
|
|
16
16
|
exports.typesExpressVersion = '4.17.14';
|
17
17
|
exports.browserSyncVersion = '^3.0.0';
|
18
18
|
exports.moduleFederationNodeVersion = '~2.5.0';
|
19
|
-
exports.moduleFederationEnhancedVersion = '0.6.
|
19
|
+
exports.moduleFederationEnhancedVersion = '0.6.9';
|
20
20
|
exports.angularEslintVersion = '^18.3.0';
|
21
21
|
exports.typescriptEslintVersion = '^7.16.0';
|
22
22
|
exports.tailwindVersion = '^3.0.2';
|