@nx/angular 19.8.0 → 20.0.0-beta.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.
Files changed (36) hide show
  1. package/generators.json +7 -7
  2. package/package.json +8 -8
  3. package/src/generators/application/application.d.ts +0 -1
  4. package/src/generators/application/application.js +0 -7
  5. package/src/generators/application/lib/normalize-options.js +0 -1
  6. package/src/generators/component/component.d.ts +0 -1
  7. package/src/generators/component/component.js +0 -7
  8. package/src/generators/component/lib/normalize-options.js +1 -5
  9. package/src/generators/component/schema.d.ts +0 -13
  10. package/src/generators/component/schema.json +0 -15
  11. package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +1 -2
  12. package/src/generators/cypress-component-configuration/cypress-component-configuration.js +1 -7
  13. package/src/generators/directive/lib/normalize-options.js +1 -5
  14. package/src/generators/directive/schema.d.ts +0 -12
  15. package/src/generators/directive/schema.json +0 -15
  16. package/src/generators/federate-module/lib/add-remote.js +2 -3
  17. package/src/generators/host/host.d.ts +1 -2
  18. package/src/generators/host/host.js +7 -20
  19. package/src/generators/library/lib/normalize-options.js +0 -1
  20. package/src/generators/library/library.d.ts +0 -1
  21. package/src/generators/library/library.js +0 -9
  22. package/src/generators/move/move.d.ts +0 -1
  23. package/src/generators/move/move.js +1 -8
  24. package/src/generators/pipe/lib/normalize-options.js +1 -5
  25. package/src/generators/pipe/schema.d.ts +0 -12
  26. package/src/generators/pipe/schema.json +0 -6
  27. package/src/generators/remote/remote.d.ts +1 -2
  28. package/src/generators/remote/remote.js +1 -9
  29. package/src/generators/scam/lib/normalize-options.js +1 -5
  30. package/src/generators/scam/schema.d.ts +0 -12
  31. package/src/generators/scam/schema.json +0 -6
  32. package/src/generators/scam-directive/lib/normalize-options.js +1 -5
  33. package/src/generators/scam-directive/schema.d.ts +0 -12
  34. package/src/generators/scam-pipe/lib/normalize-options.js +1 -5
  35. package/src/generators/scam-pipe/schema.d.ts +0 -12
  36. package/src/generators/utils/testing.js +11 -20
package/generators.json CHANGED
@@ -10,14 +10,14 @@
10
10
  "hidden": true
11
11
  },
12
12
  "application": {
13
- "factory": "./src/generators/application/application#applicationGeneratorInternal",
13
+ "factory": "./src/generators/application/application",
14
14
  "schema": "./src/generators/application/schema.json",
15
15
  "aliases": ["app"],
16
16
  "x-type": "application",
17
17
  "description": "Creates an Angular application."
18
18
  },
19
19
  "component": {
20
- "factory": "./src/generators/component/component#componentGeneratorInternal",
20
+ "factory": "./src/generators/component/component",
21
21
  "schema": "./src/generators/component/schema.json",
22
22
  "aliases": ["c"],
23
23
  "description": "Generate an Angular Component."
@@ -63,7 +63,7 @@
63
63
  "hidden": true
64
64
  },
65
65
  "library": {
66
- "factory": "./src/generators/library/library#libraryGeneratorInternal",
66
+ "factory": "./src/generators/library/library",
67
67
  "schema": "./src/generators/library/schema.json",
68
68
  "aliases": ["lib"],
69
69
  "x-type": "library",
@@ -76,13 +76,13 @@
76
76
  "description": "Creates a secondary entry point for an Angular publishable library."
77
77
  },
78
78
  "remote": {
79
- "factory": "./src/generators/remote/remote#remoteInternal",
79
+ "factory": "./src/generators/remote/remote",
80
80
  "schema": "./src/generators/remote/schema.json",
81
81
  "x-type": "application",
82
82
  "description": "Generate a Remote Angular Module Federation Application."
83
83
  },
84
84
  "move": {
85
- "factory": "./src/generators/move/move#angularMoveGeneratorInternal",
85
+ "factory": "./src/generators/move/move#angularMoveGenerator",
86
86
  "schema": "./src/generators/move/schema.json",
87
87
  "aliases": ["mv"],
88
88
  "description": "Moves an Angular application or library to another folder within the workspace and updates the project configuration.",
@@ -94,7 +94,7 @@
94
94
  "description": "Converts an old micro frontend configuration to use the new withModuleFederation helper. It will run successfully if the following conditions are met: \n - Is either a host or remote application \n - Shared npm package configurations have not been modified \n - Name used to identify the Micro Frontend application matches the project name \n\n{% callout type=\"warning\" title=\"Overrides\" %}This generator will overwrite your webpack config. If you have additional custom configuration in your config file, it will be lost!{% /callout %}"
95
95
  },
96
96
  "host": {
97
- "factory": "./src/generators/host/host#hostInternal",
97
+ "factory": "./src/generators/host/host",
98
98
  "schema": "./src/generators/host/schema.json",
99
99
  "x-type": "application",
100
100
  "description": "Generate a Host Angular Module Federation Application."
@@ -173,7 +173,7 @@
173
173
  "description": "Adds Storybook configuration to a project."
174
174
  },
175
175
  "cypress-component-configuration": {
176
- "factory": "./src/generators/cypress-component-configuration/cypress-component-configuration#cypressComponentConfigurationInternal",
176
+ "factory": "./src/generators/cypress-component-configuration/cypress-component-configuration",
177
177
  "schema": "./src/generators/cypress-component-configuration/schema.json",
178
178
  "description": "Setup Cypress component testing for a project."
179
179
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "19.8.0",
3
+ "version": "20.0.0-beta.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": {
@@ -80,14 +80,14 @@
80
80
  "webpack-merge": "^5.8.0",
81
81
  "webpack": "^5.88.0",
82
82
  "@module-federation/enhanced": "~0.6.0",
83
- "@nx/devkit": "19.8.0",
84
- "@nx/js": "19.8.0",
85
- "@nx/eslint": "19.8.0",
86
- "@nx/webpack": "19.8.0",
87
- "@nx/web": "19.8.0",
88
- "@nx/workspace": "19.8.0",
83
+ "@nx/devkit": "20.0.0-beta.0",
84
+ "@nx/js": "20.0.0-beta.0",
85
+ "@nx/eslint": "20.0.0-beta.0",
86
+ "@nx/webpack": "20.0.0-beta.0",
87
+ "@nx/web": "20.0.0-beta.0",
88
+ "@nx/workspace": "20.0.0-beta.0",
89
89
  "piscina": "^4.4.0",
90
- "@nrwl/angular": "19.8.0"
90
+ "@nrwl/angular": "20.0.0-beta.0"
91
91
  },
92
92
  "peerDependencies": {
93
93
  "@angular-devkit/build-angular": ">= 16.0.0 < 19.0.0",
@@ -1,5 +1,4 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
3
  export declare function applicationGenerator(tree: Tree, schema: Partial<Schema>): Promise<GeneratorCallback>;
4
- export declare function applicationGeneratorInternal(tree: Tree, schema: Partial<Schema>): Promise<GeneratorCallback>;
5
4
  export default applicationGenerator;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.applicationGenerator = applicationGenerator;
4
- exports.applicationGeneratorInternal = applicationGeneratorInternal;
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const js_1 = require("@nx/js");
7
6
  const init_1 = require("../init/init");
@@ -11,12 +10,6 @@ const ensure_angular_dependencies_1 = require("../utils/ensure-angular-dependenc
11
10
  const lib_1 = require("./lib");
12
11
  const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
13
12
  async function applicationGenerator(tree, schema) {
14
- return await applicationGeneratorInternal(tree, {
15
- projectNameAndRootFormat: 'derived',
16
- ...schema,
17
- });
18
- }
19
- async function applicationGeneratorInternal(tree, schema) {
20
13
  const options = await (0, lib_1.normalizeOptions)(tree, schema);
21
14
  const rootOffset = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
22
15
  await (0, js_1.initGenerator)(tree, {
@@ -13,7 +13,6 @@ async function normalizeOptions(host, options) {
13
13
  directory: options.directory,
14
14
  projectNameAndRootFormat: options.projectNameAndRootFormat,
15
15
  rootProject: options.rootProject,
16
- callingGenerator: '@nx/angular:application',
17
16
  });
18
17
  options.rootProject = appProjectRoot === '.';
19
18
  options.projectNameAndRootFormat = projectNameAndRootFormat;
@@ -1,5 +1,4 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
3
  export declare function componentGenerator(tree: Tree, rawOptions: Schema): Promise<void>;
4
- export declare function componentGeneratorInternal(tree: Tree, rawOptions: Schema): Promise<void>;
5
4
  export default componentGenerator;
@@ -1,18 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.componentGenerator = componentGenerator;
4
- exports.componentGeneratorInternal = componentGeneratorInternal;
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const utils_1 = require("../utils");
7
6
  const version_utils_1 = require("../utils/version-utils");
8
7
  const lib_1 = require("./lib");
9
8
  async function componentGenerator(tree, rawOptions) {
10
- await componentGeneratorInternal(tree, {
11
- nameAndDirectoryFormat: 'derived',
12
- ...rawOptions,
13
- });
14
- }
15
- async function componentGeneratorInternal(tree, rawOptions) {
16
9
  const options = await (0, lib_1.normalizeOptions)(tree, rawOptions);
17
10
  const { major: angularMajorVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(tree);
18
11
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), options.directory, {
@@ -7,13 +7,9 @@ const selector_1 = require("../../utils/selector");
7
7
  async function normalizeOptions(tree, options) {
8
8
  options.type ??= 'component';
9
9
  const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
10
- artifactType: 'component',
11
- callingGenerator: '@nx/angular:component',
12
10
  name: options.name,
13
- directory: options.directory ?? options.path,
14
- flat: options.flat,
11
+ directory: options.directory,
15
12
  nameAndDirectoryFormat: options.nameAndDirectoryFormat,
16
- project: options.project,
17
13
  suffix: options.type ?? 'component',
18
14
  });
19
15
  const { className } = (0, devkit_1.names)(name);
@@ -20,19 +20,6 @@ export interface Schema {
20
20
  export?: boolean;
21
21
  prefix?: string;
22
22
  skipFormat?: boolean;
23
-
24
- /**
25
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
26
- */
27
- flat?: boolean;
28
- /**
29
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
30
- */
31
- path?: string;
32
- /**
33
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
34
- */
35
- project?: string;
36
23
  }
37
24
 
38
25
  export interface NormalizedSchema extends Schema {
@@ -27,15 +27,6 @@
27
27
  "type": "string",
28
28
  "enum": ["as-provided", "derived"]
29
29
  },
30
- "project": {
31
- "type": "string",
32
- "description": "The name of the project.",
33
- "$default": {
34
- "$source": "projectName"
35
- },
36
- "x-dropdown": "projects",
37
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
38
- },
39
30
  "prefix": {
40
31
  "type": "string",
41
32
  "description": "The prefix to apply to the generated component selector.",
@@ -94,12 +85,6 @@
94
85
  "description": "Do not create `spec.ts` test files for the new component.",
95
86
  "default": false
96
87
  },
97
- "flat": {
98
- "type": "boolean",
99
- "description": "Create the new files at the top level of the current project.",
100
- "default": false,
101
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
102
- },
103
88
  "skipImport": {
104
89
  "type": "boolean",
105
90
  "description": "Do not import this component into the owning NgModule.",
@@ -1,9 +1,8 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import { CypressComponentConfigSchema } from './schema';
3
- export declare function cypressComponentConfiguration(tree: Tree, options: CypressComponentConfigSchema): Promise<import("@nx/devkit").GeneratorCallback>;
4
3
  /**
5
4
  * This is for cypress built in component testing, if you want to test with
6
5
  * storybook + cypress then use the componentCypressGenerator instead.
7
6
  */
8
- export declare function cypressComponentConfigurationInternal(tree: Tree, options: CypressComponentConfigSchema): Promise<import("@nx/devkit").GeneratorCallback>;
7
+ export declare function cypressComponentConfiguration(tree: Tree, options: CypressComponentConfigSchema): Promise<import("@nx/devkit").GeneratorCallback>;
9
8
  export default cypressComponentConfiguration;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.cypressComponentConfiguration = cypressComponentConfiguration;
4
- exports.cypressComponentConfigurationInternal = cypressComponentConfigurationInternal;
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const path_1 = require("path");
7
6
  const versions_1 = require("../../utils/versions");
@@ -10,16 +9,11 @@ const component_info_1 = require("../utils/storybook-ast/component-info");
10
9
  const entry_point_1 = require("../utils/storybook-ast/entry-point");
11
10
  const module_info_1 = require("../utils/storybook-ast/module-info");
12
11
  const update_app_editor_tsconfig_excluded_files_1 = require("../utils/update-app-editor-tsconfig-excluded-files");
13
- function cypressComponentConfiguration(tree, options) {
14
- return cypressComponentConfigurationInternal(tree, {
15
- ...options,
16
- });
17
- }
18
12
  /**
19
13
  * This is for cypress built in component testing, if you want to test with
20
14
  * storybook + cypress then use the componentCypressGenerator instead.
21
15
  */
22
- async function cypressComponentConfigurationInternal(tree, options) {
16
+ async function cypressComponentConfiguration(tree, options) {
23
17
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
24
18
  const { componentConfigurationGenerator: baseCyCTConfig } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
25
19
  const installTask = await baseCyCTConfig(tree, {
@@ -6,13 +6,9 @@ const selector_1 = require("../../utils/selector");
6
6
  const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
7
7
  async function normalizeOptions(tree, options) {
8
8
  const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
9
- artifactType: 'directive',
10
- callingGenerator: '@nx/angular:directive',
11
9
  name: options.name,
12
- directory: options.directory ?? options.path,
13
- flat: options.flat,
10
+ directory: options.directory,
14
11
  nameAndDirectoryFormat: options.nameAndDirectoryFormat,
15
- project: options.project,
16
12
  suffix: 'directive',
17
13
  });
18
14
  const { className } = (0, devkit_1.names)(name);
@@ -12,18 +12,6 @@ export interface Schema {
12
12
  module?: string;
13
13
  export?: boolean;
14
14
  skipFormat?: boolean;
15
- /**
16
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
17
- */
18
- flat?: boolean;
19
- /**
20
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
21
- */
22
- path?: string;
23
- /**
24
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
25
- */
26
- project?: string;
27
15
  }
28
16
 
29
17
  export interface NormalizedSchema extends Schema {
@@ -27,15 +27,6 @@
27
27
  "type": "string",
28
28
  "enum": ["as-provided", "derived"]
29
29
  },
30
- "project": {
31
- "type": "string",
32
- "description": "The name of the project.",
33
- "$default": {
34
- "$source": "projectName"
35
- },
36
- "x-dropdown": "projects",
37
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
38
- },
39
30
  "prefix": {
40
31
  "type": "string",
41
32
  "description": "A prefix to apply to generated selectors.",
@@ -70,12 +61,6 @@
70
61
  "type": "boolean",
71
62
  "default": true
72
63
  },
73
- "flat": {
74
- "type": "boolean",
75
- "description": "When true (the default), creates the new files at the top level of the current project.",
76
- "default": true,
77
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
78
- },
79
64
  "module": {
80
65
  "type": "string",
81
66
  "description": "The filename of the declaring NgModule.",
@@ -16,7 +16,7 @@ async function addRemote(tree, schema) {
16
16
  directory: schema.remoteDirectory,
17
17
  host: schema.host,
18
18
  standalone: schema.standalone,
19
- projectNameAndRootFormat: schema.projectNameAndRootFormat ?? 'derived',
19
+ projectNameAndRootFormat: schema.projectNameAndRootFormat,
20
20
  unitTestRunner: schema.unitTestRunner ?? test_runners_1.UnitTestRunner.Jest,
21
21
  e2eTestRunner: schema.e2eTestRunner ?? test_runners_1.E2eTestRunner.Cypress,
22
22
  skipFormat: true,
@@ -26,8 +26,7 @@ async function addRemote(tree, schema) {
26
26
  name: schema.remote,
27
27
  directory: schema.remoteDirectory,
28
28
  projectType: 'application',
29
- projectNameAndRootFormat: schema.projectNameAndRootFormat ?? 'derived',
30
- callingGenerator: '@nx/angular:federate-module',
29
+ projectNameAndRootFormat: schema.projectNameAndRootFormat,
31
30
  });
32
31
  projectRoot = remoteRoot;
33
32
  remoteName = projectName;
@@ -1,5 +1,4 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
- export declare function host(tree: Tree, options: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
4
- export declare function hostInternal(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
3
+ export declare function host(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
5
4
  export default host;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.host = host;
4
- exports.hostInternal = hostInternal;
5
4
  const tslib_1 = require("tslib");
6
5
  const devkit_1 = require("@nx/devkit");
7
6
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
@@ -12,13 +11,7 @@ const setup_mf_1 = require("../setup-mf/setup-mf");
12
11
  const lib_1 = require("./lib");
13
12
  const add_mf_env_to_inputs_1 = require("../utils/add-mf-env-to-inputs");
14
13
  const js_1 = require("@nx/js");
15
- async function host(tree, options) {
16
- return await hostInternal(tree, {
17
- projectNameAndRootFormat: 'derived',
18
- ...options,
19
- });
20
- }
21
- async function hostInternal(tree, schema) {
14
+ async function host(tree, schema) {
22
15
  const { typescriptConfiguration = true, ...options } = schema;
23
16
  options.standalone = options.standalone ?? true;
24
17
  const projects = (0, devkit_1.getProjects)(tree);
@@ -44,12 +37,11 @@ async function hostInternal(tree, schema) {
44
37
  }
45
38
  });
46
39
  }
47
- const { projectName: hostProjectName, projectNameAndRootFormat } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
40
+ const { projectName: hostProjectName, projectNameAndRootFormat, projectRoot: appRoot, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
48
41
  name: options.name,
49
42
  projectType: 'application',
50
43
  directory: options.directory,
51
44
  projectNameAndRootFormat: options.projectNameAndRootFormat,
52
- callingGenerator: '@nx/angular:host',
53
45
  });
54
46
  options.projectNameAndRootFormat = projectNameAndRootFormat;
55
47
  const appInstallTask = await (0, application_1.default)(tree, {
@@ -83,16 +75,11 @@ async function hostInternal(tree, schema) {
83
75
  installTasks.push(ssrInstallTask);
84
76
  }
85
77
  for (const remote of remotesToGenerate) {
86
- let remoteDirectory = options.directory;
87
- if (options.projectNameAndRootFormat === 'as-provided' &&
88
- options.directory) {
89
- /**
90
- * With the `as-provided` format, the provided directory would be the root
91
- * of the host application. Append the remote name to the host parent
92
- * directory to get the remote directory.
93
- */
94
- remoteDirectory = (0, devkit_1.joinPathFragments)(options.directory, '..', remote);
95
- }
78
+ const remoteDirectory = options.directory
79
+ ? (0, devkit_1.joinPathFragments)(options.directory, '..', remote)
80
+ : appRoot === '.'
81
+ ? remote
82
+ : (0, devkit_1.joinPathFragments)(appRoot, '..', remote);
96
83
  await (0, remote_1.default)(tree, {
97
84
  ...options,
98
85
  name: remote,
@@ -28,7 +28,6 @@ async function normalizeOptions(host, schema) {
28
28
  directory: options.directory,
29
29
  importPath: options.importPath,
30
30
  projectNameAndRootFormat: options.projectNameAndRootFormat,
31
- callingGenerator: '@nx/angular:library',
32
31
  });
33
32
  const fileName = options.simpleName
34
33
  ? projectNames.projectSimpleName
@@ -1,5 +1,4 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { Schema } from './schema';
3
3
  export declare function libraryGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
4
- export declare function libraryGeneratorInternal(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
5
4
  export default libraryGenerator;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.libraryGenerator = libraryGenerator;
4
- exports.libraryGeneratorInternal = libraryGeneratorInternal;
5
4
  const tslib_1 = require("tslib");
6
5
  const devkit_1 = require("@nx/devkit");
7
6
  const eslint_1 = require("@nx/eslint");
@@ -24,14 +23,6 @@ const set_generator_defaults_1 = require("./lib/set-generator-defaults");
24
23
  const ensure_angular_dependencies_1 = require("../utils/ensure-angular-dependencies");
25
24
  const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
26
25
  async function libraryGenerator(tree, schema) {
27
- return await libraryGeneratorInternal(tree, {
28
- // provide a default projectNameAndRootFormat to avoid breaking changes
29
- // to external generators invoking this one
30
- projectNameAndRootFormat: 'derived',
31
- ...schema,
32
- });
33
- }
34
- async function libraryGeneratorInternal(tree, schema) {
35
26
  // Do some validation checks
36
27
  if (!schema.routing && schema.lazy) {
37
28
  throw new Error(`To use "--lazy" option, "--routing" must also be set.`);
@@ -1,4 +1,3 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
3
  export declare function angularMoveGenerator(tree: Tree, schema: Schema): Promise<void>;
4
- export declare function angularMoveGeneratorInternal(tree: Tree, schema: Schema): Promise<void>;
@@ -1,15 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.angularMoveGenerator = angularMoveGenerator;
4
- exports.angularMoveGeneratorInternal = angularMoveGeneratorInternal;
5
4
  const move_1 = require("@nx/workspace/src/generators/move/move");
6
5
  async function angularMoveGenerator(tree, schema) {
7
- await angularMoveGeneratorInternal(tree, {
8
- projectNameAndRootFormat: 'derived',
9
- ...schema,
10
- });
11
- }
12
- async function angularMoveGeneratorInternal(tree, schema) {
13
6
  process.env.NX_ANGULAR_MOVE_INVOKED = 'true';
14
- await (0, move_1.moveGeneratorInternal)(tree, schema);
7
+ await (0, move_1.moveGenerator)(tree, schema);
15
8
  }
@@ -5,13 +5,9 @@ const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/a
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  async function normalizeOptions(tree, options) {
7
7
  const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
8
- artifactType: 'pipe',
9
- callingGenerator: '@nx/angular:pipe',
10
8
  name: options.name,
11
- directory: options.directory ?? options.path,
12
- flat: options.flat,
9
+ directory: options.directory,
13
10
  nameAndDirectoryFormat: options.nameAndDirectoryFormat,
14
- project: options.project,
15
11
  suffix: 'pipe',
16
12
  });
17
13
  const { className } = (0, devkit_1.names)(name);
@@ -10,18 +10,6 @@ export interface Schema {
10
10
  module?: string;
11
11
  export?: boolean;
12
12
  skipFormat?: boolean;
13
- /**
14
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
15
- */
16
- flat?: boolean;
17
- /**
18
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
19
- */
20
- path?: string;
21
- /**
22
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
23
- */
24
- project?: string;
25
13
  }
26
14
 
27
15
  export interface NormalizedSchema extends Schema {
@@ -36,12 +36,6 @@
36
36
  "x-dropdown": "projects",
37
37
  "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
38
38
  },
39
- "flat": {
40
- "type": "boolean",
41
- "default": true,
42
- "description": "When true (the default) creates files at the top level of the project.",
43
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
44
- },
45
39
  "skipTests": {
46
40
  "type": "boolean",
47
41
  "description": "Do not create \"spec.ts\" test files for the new pipe.",
@@ -1,5 +1,4 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
- export declare function remote(tree: Tree, options: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
4
- export declare function remoteInternal(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
3
+ export declare function remote(tree: Tree, schema: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
5
4
  export default remote;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.remote = remote;
4
- exports.remoteInternal = remoteInternal;
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
7
6
  const test_runners_1 = require("../../utils/test-runners");
@@ -10,13 +9,7 @@ const setup_mf_1 = require("../setup-mf/setup-mf");
10
9
  const lib_1 = require("./lib");
11
10
  const versions_1 = require("@nx/js/src/utils/versions");
12
11
  const add_mf_env_to_inputs_1 = require("../utils/add-mf-env-to-inputs");
13
- async function remote(tree, options) {
14
- return await remoteInternal(tree, {
15
- projectNameAndRootFormat: 'derived',
16
- ...options,
17
- });
18
- }
19
- async function remoteInternal(tree, schema) {
12
+ async function remote(tree, schema) {
20
13
  const { typescriptConfiguration = true, ...options } = schema;
21
14
  options.standalone = options.standalone ?? true;
22
15
  const projects = (0, devkit_1.getProjects)(tree);
@@ -28,7 +21,6 @@ async function remoteInternal(tree, schema) {
28
21
  projectType: 'application',
29
22
  directory: options.directory,
30
23
  projectNameAndRootFormat: options.projectNameAndRootFormat,
31
- callingGenerator: '@nx/angular:remote',
32
24
  });
33
25
  options.projectNameAndRootFormat = projectNameAndRootFormat;
34
26
  const port = options.port ?? (0, lib_1.findNextAvailablePort)(tree);
@@ -6,13 +6,9 @@ const devkit_1 = require("@nx/devkit");
6
6
  async function normalizeOptions(tree, options) {
7
7
  options.type ??= 'component';
8
8
  const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
9
- artifactType: options.type,
10
- callingGenerator: '@nx/angular:scam',
11
9
  name: options.name,
12
- directory: options.directory ?? options.path,
13
- flat: options.flat,
10
+ directory: options.directory,
14
11
  nameAndDirectoryFormat: options.nameAndDirectoryFormat,
15
- project: options.project,
16
12
  suffix: options.type ?? 'component',
17
13
  });
18
14
  const { className } = (0, devkit_1.names)(name);
@@ -18,18 +18,6 @@ export interface Schema {
18
18
  skipSelector?: boolean;
19
19
  export?: boolean;
20
20
  skipFormat?: boolean;
21
- /**
22
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
23
- */
24
- flat?: boolean;
25
- /**
26
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
27
- */
28
- path?: string;
29
- /**
30
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
31
- */
32
- project?: string;
33
21
  }
34
22
 
35
23
  export interface NormalizedSchema extends Schema {
@@ -90,12 +90,6 @@
90
90
  "default": true,
91
91
  "x-priority": "important"
92
92
  },
93
- "flat": {
94
- "type": "boolean",
95
- "description": "Create the new files at the top level of the current project.",
96
- "default": false,
97
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
98
- },
99
93
  "selector": {
100
94
  "type": "string",
101
95
  "format": "html-selector",
@@ -5,13 +5,9 @@ const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/a
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  async function normalizeOptions(tree, options) {
7
7
  const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
8
- artifactType: 'directive',
9
- callingGenerator: '@nx/angular:scam-directive',
10
8
  name: options.name,
11
- directory: options.directory ?? options.path,
12
- flat: options.flat,
9
+ directory: options.directory,
13
10
  nameAndDirectoryFormat: options.nameAndDirectoryFormat,
14
- project: options.project,
15
11
  suffix: 'directive',
16
12
  });
17
13
  const { className } = (0, devkit_1.names)(name);
@@ -10,18 +10,6 @@ export interface Schema {
10
10
  selector?: string;
11
11
  export?: boolean;
12
12
  skipFormat?: boolean;
13
- /**
14
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
15
- */
16
- flat?: boolean;
17
- /**
18
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
19
- */
20
- path?: string;
21
- /**
22
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
23
- */
24
- project?: string;
25
13
  }
26
14
 
27
15
  export interface NormalizedSchema extends Schema {
@@ -5,13 +5,9 @@ const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/a
5
5
  const devkit_1 = require("@nx/devkit");
6
6
  async function normalizeOptions(tree, options) {
7
7
  const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
8
- artifactType: 'pipe',
9
- callingGenerator: '@nx/angular:scam-pipe',
10
8
  name: options.name,
11
- directory: options.directory ?? options.path,
12
- flat: options.flat,
9
+ directory: options.directory,
13
10
  nameAndDirectoryFormat: options.nameAndDirectoryFormat,
14
- project: options.project,
15
11
  suffix: 'pipe',
16
12
  });
17
13
  const { className } = (0, devkit_1.names)(name);
@@ -8,18 +8,6 @@ export interface Schema {
8
8
  inlineScam?: boolean;
9
9
  export?: boolean;
10
10
  skipFormat?: boolean;
11
- /**
12
- * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
13
- */
14
- flat?: boolean;
15
- /**
16
- * @deprecated Provide the `directory` option instead. It will be removed in Nx v20.
17
- */
18
- path?: string;
19
- /**
20
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
21
- */
22
- project?: string;
23
11
  }
24
12
 
25
13
  export interface NormalizedSchema extends Schema {
@@ -52,7 +52,7 @@ async function createStorybookTestWorkspaceForLib(libName) {
52
52
  });
53
53
  await (0, component_1.componentGenerator)(tree, {
54
54
  name: 'test-button',
55
- project: libName,
55
+ directory: `${libName}/src/lib/test-button`,
56
56
  standalone: false,
57
57
  skipFormat: true,
58
58
  });
@@ -82,8 +82,7 @@ export class TestButtonComponent {
82
82
  });
83
83
  await (0, component_1.componentGenerator)(tree, {
84
84
  name: 'barrel-button',
85
- project: libName,
86
- path: `${libName}/src/lib/barrel`,
85
+ directory: `${libName}/src/lib/barrel/barrel-button`,
87
86
  module: 'barrel',
88
87
  standalone: false,
89
88
  skipFormat: true,
@@ -105,16 +104,14 @@ export class BarrelModule {}`);
105
104
  });
106
105
  await (0, component_1.componentGenerator)(tree, {
107
106
  name: 'variable-declare-button',
108
- project: libName,
109
- path: `${libName}/src/lib/variable-declare`,
107
+ directory: `${libName}/src/lib/variable-declare/variable-declare-button`,
110
108
  module: 'variable-declare',
111
109
  standalone: false,
112
110
  skipFormat: true,
113
111
  });
114
112
  await (0, component_1.componentGenerator)(tree, {
115
113
  name: 'variable-declare-view',
116
- project: libName,
117
- path: `${libName}/src/lib/variable-declare`,
114
+ directory: `${libName}/src/lib/variable-declare/variable-declare-view`,
118
115
  module: 'variable-declare',
119
116
  standalone: false,
120
117
  skipFormat: true,
@@ -142,24 +139,21 @@ export class VariableDeclareModule {}`);
142
139
  });
143
140
  await (0, component_1.componentGenerator)(tree, {
144
141
  name: 'variable-spread-declare-button',
145
- project: libName,
146
- path: `${libName}/src/lib/variable-spread-declare`,
142
+ directory: `${libName}/src/lib/variable-spread-declare/variable-spread-declare-button`,
147
143
  module: 'variable-spread-declare',
148
144
  standalone: false,
149
145
  skipFormat: true,
150
146
  });
151
147
  await (0, component_1.componentGenerator)(tree, {
152
148
  name: 'variable-spread-declare-view',
153
- project: libName,
154
- path: `${libName}/src/lib/variable-spread-declare`,
149
+ directory: `${libName}/src/lib/variable-spread-declare/variable-spread-declare-view`,
155
150
  module: 'variable-spread-declare',
156
151
  standalone: false,
157
152
  skipFormat: true,
158
153
  });
159
154
  await (0, component_1.componentGenerator)(tree, {
160
155
  name: 'variable-spread-declare-anotherview',
161
- project: libName,
162
- path: `${libName}/src/lib/variable-spread-declare`,
156
+ directory: `${libName}/src/lib/variable-spread-declare/variable-spread-declare-anotherview`,
163
157
  module: 'variable-spread-declare',
164
158
  standalone: false,
165
159
  skipFormat: true,
@@ -187,16 +181,14 @@ export class VariableSpreadDeclareModule {}`);
187
181
  });
188
182
  await (0, component_1.componentGenerator)(tree, {
189
183
  name: 'cmp1',
190
- project: libName,
191
- path: `${libName}/src/lib/static-member-declarations`,
184
+ directory: `${libName}/src/lib/static-member-declarations/cmp1`,
192
185
  module: 'static-member-declarations',
193
186
  standalone: false,
194
187
  skipFormat: true,
195
188
  });
196
189
  await (0, component_1.componentGenerator)(tree, {
197
190
  name: 'cmp2',
198
- project: libName,
199
- path: `${libName}/src/lib/static-member-declarations`,
191
+ directory: `${libName}/src/lib/static-member-declarations/cmp2`,
200
192
  module: 'static-member-declarations',
201
193
  standalone: false,
202
194
  skipFormat: true,
@@ -222,15 +214,14 @@ export class StaticMemberDeclarationsModule {
222
214
  });
223
215
  await (0, component_1.componentGenerator)(tree, {
224
216
  name: 'nested-button',
225
- project: libName,
226
217
  module: 'nested',
227
- path: `${libName}/src/lib/nested`,
218
+ directory: `${libName}/src/lib/nested/nested-button`,
228
219
  standalone: false,
229
220
  skipFormat: true,
230
221
  });
231
222
  await (0, component_1.componentGenerator)(tree, {
232
223
  name: 'test-other',
233
- project: libName,
224
+ directory: `${libName}/src/lib/test-other`,
234
225
  standalone: false,
235
226
  skipFormat: true,
236
227
  });