@nx/angular 0.0.0-pr-27957-a99d5ea → 0.0.0-pr-28229-afe192c

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 (87) hide show
  1. package/generators.d.ts +0 -1
  2. package/generators.js +0 -1
  3. package/generators.json +7 -13
  4. package/package.json +11 -11
  5. package/plugin.d.ts +1 -0
  6. package/plugin.js +5 -0
  7. package/src/builders/utilities/webpack.js +30 -4
  8. package/src/generators/application/application.d.ts +0 -1
  9. package/src/generators/application/application.js +0 -7
  10. package/src/generators/application/lib/normalize-options.js +3 -5
  11. package/src/generators/application/schema.d.ts +2 -4
  12. package/src/generators/application/schema.json +7 -12
  13. package/src/generators/component/component.d.ts +0 -1
  14. package/src/generators/component/component.js +0 -7
  15. package/src/generators/component/lib/normalize-options.js +1 -6
  16. package/src/generators/component/schema.d.ts +2 -18
  17. package/src/generators/component/schema.json +7 -28
  18. package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +1 -2
  19. package/src/generators/cypress-component-configuration/cypress-component-configuration.js +1 -7
  20. package/src/generators/directive/lib/normalize-options.js +1 -6
  21. package/src/generators/directive/schema.d.ts +2 -15
  22. package/src/generators/directive/schema.json +8 -29
  23. package/src/generators/federate-module/lib/add-remote.js +0 -3
  24. package/src/generators/federate-module/schema.d.ts +0 -2
  25. package/src/generators/federate-module/schema.json +0 -5
  26. package/src/generators/host/host.d.ts +1 -2
  27. package/src/generators/host/host.js +8 -22
  28. package/src/generators/host/schema.d.ts +2 -4
  29. package/src/generators/host/schema.json +10 -13
  30. package/src/generators/init/init.js +12 -0
  31. package/src/generators/init/schema.d.ts +3 -0
  32. package/src/generators/library/lib/add-standalone-component.js +3 -2
  33. package/src/generators/library/lib/normalize-options.js +1 -2
  34. package/src/generators/library/lib/normalized-schema.d.ts +2 -2
  35. package/src/generators/library/library.d.ts +0 -1
  36. package/src/generators/library/library.js +0 -9
  37. package/src/generators/library/schema.d.ts +2 -4
  38. package/src/generators/library/schema.json +7 -13
  39. package/src/generators/move/move.d.ts +0 -1
  40. package/src/generators/move/move.js +1 -8
  41. package/src/generators/move/schema.d.ts +0 -3
  42. package/src/generators/move/schema.json +0 -5
  43. package/src/generators/pipe/lib/normalize-options.js +1 -6
  44. package/src/generators/pipe/schema.d.ts +2 -15
  45. package/src/generators/pipe/schema.json +7 -28
  46. package/src/generators/remote/remote.d.ts +1 -2
  47. package/src/generators/remote/remote.js +3 -12
  48. package/src/generators/remote/schema.d.ts +2 -4
  49. package/src/generators/remote/schema.json +10 -13
  50. package/src/generators/scam/lib/normalize-options.js +1 -6
  51. package/src/generators/scam/scam.js +0 -2
  52. package/src/generators/scam/schema.d.ts +3 -15
  53. package/src/generators/scam/schema.json +8 -29
  54. package/src/generators/scam-directive/lib/normalize-options.js +1 -6
  55. package/src/generators/scam-directive/scam-directive.js +0 -2
  56. package/src/generators/scam-directive/schema.d.ts +3 -15
  57. package/src/generators/scam-directive/schema.json +8 -3
  58. package/src/generators/scam-pipe/lib/normalize-options.js +1 -6
  59. package/src/generators/scam-pipe/scam-pipe.js +0 -2
  60. package/src/generators/scam-pipe/schema.d.ts +3 -15
  61. package/src/generators/scam-pipe/schema.json +8 -23
  62. package/src/generators/stories/schema.d.ts +0 -2
  63. package/src/generators/stories/schema.json +0 -10
  64. package/src/generators/stories/stories.js +0 -19
  65. package/src/generators/storybook-configuration/lib/generate-stories.js +0 -6
  66. package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +0 -2
  67. package/src/generators/storybook-configuration/schema.d.ts +0 -3
  68. package/src/generators/storybook-configuration/schema.json +0 -15
  69. package/src/generators/storybook-configuration/storybook-configuration.js +0 -3
  70. package/src/generators/utils/testing.js +14 -26
  71. package/src/plugins/plugin.d.ts +19 -0
  72. package/src/plugins/plugin.js +418 -0
  73. package/src/utils/versions.d.ts +1 -1
  74. package/src/utils/versions.js +1 -1
  75. package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +0 -4
  76. package/src/generators/component-cypress-spec/component-cypress-spec.js +0 -35
  77. package/src/generators/component-cypress-spec/files/__componentFileName__.__fileExt__ +0 -17
  78. package/src/generators/component-cypress-spec/lib/get-args-default-value.d.ts +0 -2
  79. package/src/generators/component-cypress-spec/lib/get-args-default-value.js +0 -24
  80. package/src/generators/component-cypress-spec/lib/get-component-selector.d.ts +0 -2
  81. package/src/generators/component-cypress-spec/lib/get-component-selector.js +0 -23
  82. package/src/generators/component-cypress-spec/schema.d.ts +0 -10
  83. package/src/generators/component-cypress-spec/schema.json +0 -66
  84. package/src/generators/stories/lib/get-e2e-project.d.ts +0 -2
  85. package/src/generators/stories/lib/get-e2e-project.js +0 -14
  86. package/src/generators/storybook-configuration/lib/validate-options.d.ts +0 -2
  87. package/src/generators/storybook-configuration/lib/validate-options.js +0 -8
package/generators.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export * from './src/generators/add-linting/add-linting';
2
2
  export * from './src/generators/application/application';
3
- export * from './src/generators/component-cypress-spec/component-cypress-spec';
4
3
  export * from './src/generators/component-story/component-story';
5
4
  export * from './src/generators/component/component';
6
5
  export * from './src/generators/directive/directive';
package/generators.js CHANGED
@@ -4,7 +4,6 @@ exports.cypressComponentConfiguration = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  tslib_1.__exportStar(require("./src/generators/add-linting/add-linting"), exports);
6
6
  tslib_1.__exportStar(require("./src/generators/application/application"), exports);
7
- tslib_1.__exportStar(require("./src/generators/component-cypress-spec/component-cypress-spec"), exports);
8
7
  tslib_1.__exportStar(require("./src/generators/component-story/component-story"), exports);
9
8
  tslib_1.__exportStar(require("./src/generators/component/component"), exports);
10
9
  tslib_1.__exportStar(require("./src/generators/directive/directive"), exports);
package/generators.json CHANGED
@@ -10,24 +10,18 @@
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."
24
24
  },
25
- "component-cypress-spec": {
26
- "factory": "./src/generators/component-cypress-spec/component-cypress-spec",
27
- "schema": "./src/generators/component-cypress-spec/schema.json",
28
- "description": "Creates a Cypress spec for a UI component that has a story.",
29
- "hidden": true
30
- },
31
25
  "component-story": {
32
26
  "factory": "./src/generators/component-story/component-story",
33
27
  "schema": "./src/generators/component-story/schema.json",
@@ -63,7 +57,7 @@
63
57
  "hidden": true
64
58
  },
65
59
  "library": {
66
- "factory": "./src/generators/library/library#libraryGeneratorInternal",
60
+ "factory": "./src/generators/library/library",
67
61
  "schema": "./src/generators/library/schema.json",
68
62
  "aliases": ["lib"],
69
63
  "x-type": "library",
@@ -76,13 +70,13 @@
76
70
  "description": "Creates a secondary entry point for an Angular publishable library."
77
71
  },
78
72
  "remote": {
79
- "factory": "./src/generators/remote/remote#remoteInternal",
73
+ "factory": "./src/generators/remote/remote",
80
74
  "schema": "./src/generators/remote/schema.json",
81
75
  "x-type": "application",
82
76
  "description": "Generate a Remote Angular Module Federation Application."
83
77
  },
84
78
  "move": {
85
- "factory": "./src/generators/move/move#angularMoveGeneratorInternal",
79
+ "factory": "./src/generators/move/move#angularMoveGenerator",
86
80
  "schema": "./src/generators/move/schema.json",
87
81
  "aliases": ["mv"],
88
82
  "description": "Moves an Angular application or library to another folder within the workspace and updates the project configuration.",
@@ -94,7 +88,7 @@
94
88
  "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
89
  },
96
90
  "host": {
97
- "factory": "./src/generators/host/host#hostInternal",
91
+ "factory": "./src/generators/host/host",
98
92
  "schema": "./src/generators/host/schema.json",
99
93
  "x-type": "application",
100
94
  "description": "Generate a Host Angular Module Federation Application."
@@ -173,7 +167,7 @@
173
167
  "description": "Adds Storybook configuration to a project."
174
168
  },
175
169
  "cypress-component-configuration": {
176
- "factory": "./src/generators/cypress-component-configuration/cypress-component-configuration#cypressComponentConfigurationInternal",
170
+ "factory": "./src/generators/cypress-component-configuration/cypress-component-configuration",
177
171
  "schema": "./src/generators/cypress-component-configuration/schema.json",
178
172
  "description": "Setup Cypress component testing for a project."
179
173
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "0.0.0-pr-27957-a99d5ea",
3
+ "version": "0.0.0-pr-28229-afe192c",
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": {
@@ -22,6 +22,7 @@
22
22
  "./executors.json": "./executors.json",
23
23
  "./generators": "./generators.js",
24
24
  "./executors": "./executors.js",
25
+ "./plugin": "./plugin.js",
25
26
  "./tailwind": "./tailwind.js",
26
27
  "./module-federation": "./module-federation/index.js",
27
28
  "./src/utils": "./src/utils/index.js",
@@ -78,15 +79,14 @@
78
79
  "tslib": "^2.3.0",
79
80
  "webpack-merge": "^5.8.0",
80
81
  "webpack": "^5.88.0",
81
- "@module-federation/enhanced": "~0.6.0",
82
- "@nx/devkit": "0.0.0-pr-27957-a99d5ea",
83
- "@nx/js": "0.0.0-pr-27957-a99d5ea",
84
- "@nx/eslint": "0.0.0-pr-27957-a99d5ea",
85
- "@nx/webpack": "0.0.0-pr-27957-a99d5ea",
86
- "@nx/web": "0.0.0-pr-27957-a99d5ea",
87
- "@nx/workspace": "0.0.0-pr-27957-a99d5ea",
88
- "piscina": "^4.4.0",
89
- "@nrwl/angular": "0.0.0-pr-27957-a99d5ea"
82
+ "@module-federation/enhanced": "0.6.6",
83
+ "@nx/devkit": "0.0.0-pr-28229-afe192c",
84
+ "@nx/js": "0.0.0-pr-28229-afe192c",
85
+ "@nx/eslint": "0.0.0-pr-28229-afe192c",
86
+ "@nx/webpack": "0.0.0-pr-28229-afe192c",
87
+ "@nx/web": "0.0.0-pr-28229-afe192c",
88
+ "@nx/workspace": "0.0.0-pr-28229-afe192c",
89
+ "piscina": "^4.4.0"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "@angular-devkit/build-angular": ">= 16.0.0 < 19.0.0",
@@ -101,4 +101,4 @@
101
101
  "module": "fesm2022/nx-angular.mjs",
102
102
  "typings": "index.d.ts",
103
103
  "sideEffects": false
104
- }
104
+ }
package/plugin.d.ts ADDED
@@ -0,0 +1 @@
1
+ export { createNodesV2 } from './src/plugins/plugin';
package/plugin.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createNodesV2 = void 0;
4
+ var plugin_1 = require("./src/plugins/plugin");
5
+ Object.defineProperty(exports, "createNodesV2", { enumerable: true, get: function () { return plugin_1.createNodesV2; } });
@@ -7,6 +7,7 @@ const webpack_merge_1 = require("webpack-merge");
7
7
  const internal_1 = require("@nx/js/src/internal");
8
8
  const devkit_1 = require("@nx/devkit");
9
9
  const path_1 = require("path");
10
+ const fs_1 = require("fs");
10
11
  async function mergeCustomWebpackConfig(baseWebpackConfig, pathToWebpackConfig, options, target) {
11
12
  const customWebpackConfiguration = resolveCustomWebpackConfig(pathToWebpackConfig, options.tsConfig.startsWith(devkit_1.workspaceRoot)
12
13
  ? options.tsConfig
@@ -15,14 +16,39 @@ async function mergeCustomWebpackConfig(baseWebpackConfig, pathToWebpackConfig,
15
16
  // `module.exports = new Promise(...)`. If it exports a single object, but not a Promise,
16
17
  // then await will just resolve that object.
17
18
  const config = await customWebpackConfiguration;
18
- // The extra Webpack configuration file can export a synchronous or asynchronous function,
19
- // for instance: `module.exports = async config => { ... }`.
19
+ let newConfig;
20
20
  if (typeof config === 'function') {
21
- return config(baseWebpackConfig, options, target);
21
+ // The extra Webpack configuration file can export a synchronous or asynchronous function,
22
+ // for instance: `module.exports = async config => { ... }`.
23
+ newConfig = await config(baseWebpackConfig, options, target);
22
24
  }
23
25
  else {
24
- return (0, webpack_merge_1.merge)(baseWebpackConfig, config);
26
+ newConfig = (0, webpack_merge_1.merge)(baseWebpackConfig, config);
25
27
  }
28
+ // license-webpack-plugin will at times try to scan the monorepo's root package.json
29
+ // This will result in an error being thrown
30
+ // Ensure root package.json is excluded
31
+ const licensePlugin = newConfig.plugins.find((p) => p.constructor.name === 'LicenseWebpackPlugin');
32
+ if (licensePlugin) {
33
+ let rootPackageJsonName;
34
+ const pathToRootPackageJson = (0, path_1.join)(newConfig.context.root ?? devkit_1.workspaceRoot, 'package.json');
35
+ if ((0, fs_1.existsSync)(pathToRootPackageJson)) {
36
+ try {
37
+ const rootPackageJson = JSON.parse((0, fs_1.readFileSync)(pathToRootPackageJson, 'utf-8'));
38
+ rootPackageJsonName = rootPackageJson.name;
39
+ licensePlugin.pluginOptions.excludedPackageTest = (pkgName) => {
40
+ if (!rootPackageJsonName) {
41
+ return false;
42
+ }
43
+ return pkgName === rootPackageJsonName;
44
+ };
45
+ }
46
+ catch {
47
+ // do nothing
48
+ }
49
+ }
50
+ }
51
+ return newConfig;
26
52
  }
27
53
  function resolveCustomWebpackConfig(path, tsConfig) {
28
54
  const cleanupTranspiler = (0, internal_1.registerTsProject)(tsConfig);
@@ -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, {
@@ -7,17 +7,14 @@ const eslint_1 = require("@nx/eslint");
7
7
  const test_runners_1 = require("../../../utils/test-runners");
8
8
  const version_utils_1 = require("../../utils/version-utils");
9
9
  async function normalizeOptions(host, options) {
10
- const { projectName: appProjectName, projectRoot: appProjectRoot, projectNameAndRootFormat, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
10
+ await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'application');
11
+ const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
11
12
  name: options.name,
12
13
  projectType: 'application',
13
14
  directory: options.directory,
14
- projectNameAndRootFormat: options.projectNameAndRootFormat,
15
15
  rootProject: options.rootProject,
16
- callingGenerator: '@nx/angular:application',
17
16
  });
18
17
  options.rootProject = appProjectRoot === '.';
19
- options.projectNameAndRootFormat = projectNameAndRootFormat;
20
- const nxJson = (0, devkit_1.readNxJson)(host);
21
18
  const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
22
19
  const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
23
20
  const parsedTags = options.tags
@@ -41,6 +38,7 @@ async function normalizeOptions(host, options) {
41
38
  linter: eslint_1.Linter.EsLint,
42
39
  strict: true,
43
40
  standalone: true,
41
+ directory: appProjectRoot,
44
42
  ...options,
45
43
  prefix: options.prefix || 'app',
46
44
  name: appProjectName,
@@ -1,10 +1,10 @@
1
- import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
2
1
  import type { Linter, LinterType } from '@nx/eslint';
3
2
  import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
4
3
  import type { Styles } from '../utils/types';
5
4
 
6
5
  export interface Schema {
7
- name: string;
6
+ directory: string;
7
+ name?: string;
8
8
  addTailwind?: boolean;
9
9
  skipFormat?: boolean;
10
10
  inlineStyle?: boolean;
@@ -14,8 +14,6 @@ export interface Schema {
14
14
  prefix?: string;
15
15
  style?: Styles;
16
16
  skipTests?: boolean;
17
- directory?: string;
18
- projectNameAndRootFormat?: ProjectNameAndRootFormat;
19
17
  tags?: string;
20
18
  linter?: Linter | LinterType;
21
19
  unitTestRunner?: UnitTestRunner;
@@ -6,26 +6,21 @@
6
6
  "type": "object",
7
7
  "cli": "nx",
8
8
  "properties": {
9
- "name": {
10
- "description": "The name of the application.",
9
+ "directory": {
10
+ "description": "The directory of the new application.",
11
11
  "type": "string",
12
12
  "$default": {
13
13
  "$source": "argv",
14
14
  "index": 0
15
15
  },
16
- "x-prompt": "What name would you like to use for the application?",
17
- "pattern": "^[a-zA-Z][^:]*$"
16
+ "x-prompt": "Which directory do you want to create the application in?"
18
17
  },
19
- "directory": {
20
- "description": "The directory of the new application.",
18
+ "name": {
19
+ "description": "The name of the application.",
21
20
  "type": "string",
21
+ "pattern": "^[a-zA-Z][^:]*$",
22
22
  "x-priority": "important"
23
23
  },
24
- "projectNameAndRootFormat": {
25
- "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`).",
26
- "type": "string",
27
- "enum": ["as-provided", "derived"]
28
- },
29
24
  "style": {
30
25
  "description": "The file extension to be used for style files.",
31
26
  "type": "string",
@@ -187,6 +182,6 @@
187
182
  }
188
183
  },
189
184
  "additionalProperties": false,
190
- "required": ["name"],
185
+ "required": ["directory"],
191
186
  "examplesFile": "../../../docs/application-examples.md"
192
187
  }
@@ -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,8 @@ 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,
15
- nameAndDirectoryFormat: options.nameAndDirectoryFormat,
16
- project: options.project,
11
+ path: options.path,
17
12
  suffix: options.type ?? 'component',
18
13
  });
19
14
  const { className } = (0, devkit_1.names)(name);
@@ -1,9 +1,6 @@
1
- import type { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
2
-
3
1
  export interface Schema {
4
- name: string;
5
- directory?: string;
6
- nameAndDirectoryFormat?: NameAndDirectoryFormat;
2
+ path: string;
3
+ name?: string;
7
4
  displayBlock?: boolean;
8
5
  inlineStyle?: boolean;
9
6
  inlineTemplate?: boolean;
@@ -20,19 +17,6 @@ export interface Schema {
20
17
  export?: boolean;
21
18
  prefix?: string;
22
19
  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
20
  }
37
21
 
38
22
  export interface NormalizedSchema extends Schema {
@@ -7,34 +7,19 @@
7
7
  "description": "Creates a new Angular component.",
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
- "name": {
10
+ "path": {
11
11
  "type": "string",
12
- "description": "The name of the component.",
12
+ "description": "The path at which to create the component file, relative to the workspace root. By default, it is set to the root of the project.",
13
13
  "$default": {
14
14
  "$source": "argv",
15
15
  "index": 0
16
16
  },
17
- "x-prompt": "What name would you like to use for the component?"
18
- },
19
- "directory": {
20
- "type": "string",
21
- "description": "The directory at which to create the component file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
22
- "aliases": ["dir", "path"],
23
- "x-priority": "important"
24
- },
25
- "nameAndDirectoryFormat": {
26
- "description": "Whether to generate the component in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
27
- "type": "string",
28
- "enum": ["as-provided", "derived"]
17
+ "x-prompt": "Where to create the component?"
29
18
  },
30
- "project": {
19
+ "name": {
31
20
  "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."
21
+ "description": "The name of the component.",
22
+ "x-prompt": "What name would you like to use for the component?"
38
23
  },
39
24
  "prefix": {
40
25
  "type": "string",
@@ -94,12 +79,6 @@
94
79
  "description": "Do not create `spec.ts` test files for the new component.",
95
80
  "default": false
96
81
  },
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
82
  "skipImport": {
104
83
  "type": "boolean",
105
84
  "description": "Do not import this component into the owning NgModule.",
@@ -133,6 +112,6 @@
133
112
  "x-priority": "internal"
134
113
  }
135
114
  },
136
- "required": ["name"],
115
+ "required": ["path"],
137
116
  "examplesFile": "../../../docs/component-examples.md"
138
117
  }
@@ -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,8 @@ 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,
14
- nameAndDirectoryFormat: options.nameAndDirectoryFormat,
15
- project: options.project,
10
+ path: options.path,
16
11
  suffix: 'directive',
17
12
  });
18
13
  const { className } = (0, devkit_1.names)(name);
@@ -1,9 +1,8 @@
1
1
  import { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
2
2
 
3
3
  export interface Schema {
4
- name: string;
5
- directory?: string;
6
- nameAndDirectoryFormat?: NameAndDirectoryFormat;
4
+ path: string;
5
+ name?: string;
7
6
  prefix?: string;
8
7
  skipTests?: boolean;
9
8
  skipImport?: boolean;
@@ -12,18 +11,6 @@ export interface Schema {
12
11
  module?: string;
13
12
  export?: boolean;
14
13
  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
14
  }
28
15
 
29
16
  export interface NormalizedSchema extends Schema {
@@ -7,34 +7,19 @@
7
7
  "description": "Creates a new Angular directive.",
8
8
  "additionalProperties": false,
9
9
  "properties": {
10
- "name": {
10
+ "path": {
11
11
  "type": "string",
12
- "description": "The name of the new directive.",
12
+ "description": "The path at which to create the directive file.",
13
+ "x-prompt": "Where to put the directive?",
13
14
  "$default": {
14
15
  "$source": "argv",
15
16
  "index": 0
16
- },
17
- "x-prompt": "What name would you like to use for the directive?"
18
- },
19
- "directory": {
20
- "type": "string",
21
- "description": "The directory at which to create the directive file. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
22
- "aliases": ["dir", "path"],
23
- "x-priority": "important"
24
- },
25
- "nameAndDirectoryFormat": {
26
- "description": "Whether to generate the directive in the directory as provided, relative to the current working directory and ignoring the project (`as-provided`) or generate it using the project and directory relative to the workspace root (`derived`).",
27
- "type": "string",
28
- "enum": ["as-provided", "derived"]
17
+ }
29
18
  },
30
- "project": {
19
+ "name": {
31
20
  "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."
21
+ "description": "The name of the new directive.",
22
+ "x-prompt": "What name would you like to use for the directive?"
38
23
  },
39
24
  "prefix": {
40
25
  "type": "string",
@@ -70,12 +55,6 @@
70
55
  "type": "boolean",
71
56
  "default": true
72
57
  },
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
58
  "module": {
80
59
  "type": "string",
81
60
  "description": "The filename of the declaring NgModule.",
@@ -92,5 +71,5 @@
92
71
  "description": "Skip formatting of files."
93
72
  }
94
73
  },
95
- "required": ["name"]
74
+ "required": ["path"]
96
75
  }
@@ -16,7 +16,6 @@ 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',
20
19
  unitTestRunner: schema.unitTestRunner ?? test_runners_1.UnitTestRunner.Jest,
21
20
  e2eTestRunner: schema.e2eTestRunner ?? test_runners_1.E2eTestRunner.Cypress,
22
21
  skipFormat: true,
@@ -26,8 +25,6 @@ async function addRemote(tree, schema) {
26
25
  name: schema.remote,
27
26
  directory: schema.remoteDirectory,
28
27
  projectType: 'application',
29
- projectNameAndRootFormat: schema.projectNameAndRootFormat ?? 'derived',
30
- callingGenerator: '@nx/angular:federate-module',
31
28
  });
32
29
  projectRoot = remoteRoot;
33
30
  remoteName = projectName;
@@ -1,4 +1,3 @@
1
- import { type ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
2
1
  import { UnitTestRunner, E2eTestRunner } from '../utils/testing';
3
2
 
4
3
  export interface Schema {
@@ -7,7 +6,6 @@ export interface Schema {
7
6
  remote: string;
8
7
  remoteDirectory?: string;
9
8
  host?: string;
10
- projectNameAndRootFormat?: ProjectNameAndRootFormat;
11
9
  unitTestRunner?: UnitTestRunner;
12
10
  e2eTestRunner?: E2eTestRunner;
13
11
  standalone?: boolean;