@nx/angular 20.0.0 → 20.0.1

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 CHANGED
@@ -1127,6 +1127,10 @@
1127
1127
  "ng-packagr": {
1128
1128
  "version": "~18.2.0",
1129
1129
  "alwaysAddToPackageJson": false
1130
+ },
1131
+ "zone.js": {
1132
+ "version": "~0.14.10",
1133
+ "alwaysAddToPackageJson": false
1130
1134
  }
1131
1135
  }
1132
1136
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "20.0.0",
3
+ "version": "20.0.1",
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": {
@@ -80,12 +80,12 @@
80
80
  "webpack-merge": "^5.8.0",
81
81
  "webpack": "^5.88.0",
82
82
  "@module-federation/enhanced": "0.6.6",
83
- "@nx/devkit": "20.0.0",
84
- "@nx/js": "20.0.0",
85
- "@nx/eslint": "20.0.0",
86
- "@nx/webpack": "20.0.0",
87
- "@nx/web": "20.0.0",
88
- "@nx/workspace": "20.0.0",
83
+ "@nx/devkit": "20.0.1",
84
+ "@nx/js": "20.0.1",
85
+ "@nx/eslint": "20.0.1",
86
+ "@nx/webpack": "20.0.1",
87
+ "@nx/web": "20.0.1",
88
+ "@nx/workspace": "20.0.1",
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
  }