@nx/angular 17.0.0-rc.1 → 17.0.0-rc.3

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "17.0.0-rc.1",
3
+ "version": "17.0.0-rc.3",
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, 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- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -79,15 +79,15 @@
79
79
  "webpack": "^5.80.0",
80
80
  "webpack-merge": "^5.8.0",
81
81
  "enquirer": "^2.3.6",
82
- "@nx/devkit": "17.0.0-rc.1",
83
- "@nx/cypress": "17.0.0-rc.1",
84
- "@nx/jest": "17.0.0-rc.1",
85
- "@nx/js": "17.0.0-rc.1",
86
- "@nx/eslint": "17.0.0-rc.1",
87
- "@nx/webpack": "17.0.0-rc.1",
88
- "@nx/web": "17.0.0-rc.1",
89
- "@nx/workspace": "17.0.0-rc.1",
90
- "@nrwl/angular": "17.0.0-rc.1"
82
+ "@nx/devkit": "17.0.0-rc.3",
83
+ "@nx/cypress": "17.0.0-rc.3",
84
+ "@nx/jest": "17.0.0-rc.3",
85
+ "@nx/js": "17.0.0-rc.3",
86
+ "@nx/eslint": "17.0.0-rc.3",
87
+ "@nx/webpack": "17.0.0-rc.3",
88
+ "@nx/web": "17.0.0-rc.3",
89
+ "@nx/workspace": "17.0.0-rc.3",
90
+ "@nrwl/angular": "17.0.0-rc.3"
91
91
  },
92
92
  "peerDependencies": {
93
93
  "@angular-devkit/build-angular": ">= 14.0.0 < 17.0.0",
@@ -2,6 +2,6 @@ import { GeneratorCallback, type Tree } from '@nx/devkit';
2
2
  import { type Schema } from '../schema';
3
3
  export declare function addRemote(tree: Tree, schema: Schema): Promise<{
4
4
  tasks: GeneratorCallback[];
5
- projectRoot: string;
6
- remoteName: string;
5
+ projectRoot: any;
6
+ remoteName: any;
7
7
  }>;
@@ -11,6 +11,7 @@ const test_runners_1 = require("../../../utils/test-runners");
11
11
  async function addRemote(tree, schema) {
12
12
  const tasks = [];
13
13
  const remote = (0, check_remote_exists_1.getRemoteIfExists)(tree, schema.remote);
14
+ let projectRoot, remoteName;
14
15
  if (!remote) {
15
16
  const installedAngularVersionInfo = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
16
17
  if ((0, semver_1.lt)(installedAngularVersionInfo.version, '14.1.0') &&
@@ -20,6 +21,7 @@ async function addRemote(tree, schema) {
20
21
  }
21
22
  const remoteGeneratorCallback = await (0, remote_1.default)(tree, {
22
23
  name: schema.remote,
24
+ directory: schema.remoteDirectory,
23
25
  host: schema.host,
24
26
  standalone: schema.standalone,
25
27
  projectNameAndRootFormat: schema.projectNameAndRootFormat ?? 'derived',
@@ -28,15 +30,20 @@ async function addRemote(tree, schema) {
28
30
  skipFormat: true,
29
31
  });
30
32
  tasks.push(remoteGeneratorCallback);
33
+ const { projectName, projectRoot: remoteRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
34
+ name: schema.remote,
35
+ directory: schema.remoteDirectory,
36
+ projectType: 'application',
37
+ projectNameAndRootFormat: schema.projectNameAndRootFormat ?? 'derived',
38
+ callingGenerator: '@nx/angular:federate-module',
39
+ });
40
+ projectRoot = remoteRoot;
41
+ remoteName = projectName;
42
+ }
43
+ else {
44
+ projectRoot = remote.root;
45
+ remoteName = remote.name;
31
46
  }
32
- const { projectName, projectRoot: remoteRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
33
- name: schema.remote,
34
- projectType: 'application',
35
- projectNameAndRootFormat: schema.projectNameAndRootFormat ?? 'derived',
36
- callingGenerator: '@nx/angular:federate-module',
37
- });
38
- const projectRoot = remote ? remote.root : remoteRoot;
39
- const remoteName = remote ? remote.name : projectName;
40
47
  // TODO(Colum): add implicit dependency if the path points to a file in a different project
41
48
  return {
42
49
  tasks,
@@ -5,6 +5,7 @@ export interface Schema {
5
5
  name: string;
6
6
  path: string;
7
7
  remote: string;
8
+ remoteDirectory?: string;
8
9
  host?: string;
9
10
  projectNameAndRootFormat?: ProjectNameAndRootFormat;
10
11
  unitTestRunner?: UnitTestRunner;
@@ -6,7 +6,7 @@
6
6
  "description": "Create a federated module, which is exposed by a remote and can be subsequently loaded by a host.",
7
7
  "examples": [
8
8
  {
9
- "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app",
9
+ "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app --remoteDirectory=apps/my-remote-app",
10
10
  "description": "Create a federated module from my-remote-app, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
11
11
  }
12
12
  ],
@@ -33,6 +33,10 @@
33
33
  "description": "The name of the remote.",
34
34
  "x-prompt": "What is/should the remote be named?"
35
35
  },
36
+ "remoteDirectory": {
37
+ "description": "The directory of the new remote application if one needs to be created.",
38
+ "type": "string"
39
+ },
36
40
  "projectNameAndRootFormat": {
37
41
  "description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
38
42
  "type": "string",