@nx/angular 17.0.0-beta.2 → 17.0.0-beta.5

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 (123) hide show
  1. package/executors.json +0 -20
  2. package/generators.d.ts +1 -0
  3. package/generators.js +1 -0
  4. package/generators.json +6 -148
  5. package/package.json +11 -11
  6. package/src/executors/ng-packagr-lite/schema.json +0 -13
  7. package/src/executors/package/package.impl.js +2 -8
  8. package/src/executors/package/schema.d.ts +0 -12
  9. package/src/executors/package/schema.json +0 -13
  10. package/src/generators/directive/directive.js +6 -7
  11. package/src/generators/directive/files/__fileName__.spec.ts__tpl__ +8 -0
  12. package/src/generators/directive/files/{__directiveFileName__.directive.ts__tpl__ → __fileName__.ts__tpl__} +1 -1
  13. package/src/generators/directive/lib/normalize-options.d.ts +1 -1
  14. package/src/generators/directive/lib/normalize-options.js +20 -8
  15. package/src/generators/directive/lib/validate-options.js +0 -2
  16. package/src/generators/directive/schema.d.ts +20 -4
  17. package/src/generators/directive/schema.json +15 -11
  18. package/src/generators/federate-module/federate-module.d.ts +4 -0
  19. package/src/generators/federate-module/federate-module.js +39 -0
  20. package/src/generators/federate-module/lib/add-file-to-remote-tsconfig.d.ts +2 -0
  21. package/src/generators/federate-module/lib/add-file-to-remote-tsconfig.js +15 -0
  22. package/src/generators/federate-module/lib/add-path-to-exposes.d.ts +8 -0
  23. package/src/generators/federate-module/lib/add-path-to-exposes.js +78 -0
  24. package/src/generators/federate-module/lib/add-path-to-ts-config.d.ts +8 -0
  25. package/src/generators/federate-module/lib/add-path-to-ts-config.js +12 -0
  26. package/src/generators/federate-module/lib/add-remote.d.ts +7 -0
  27. package/src/generators/federate-module/lib/add-remote.js +47 -0
  28. package/src/generators/federate-module/lib/check-remote-exists.d.ts +2 -0
  29. package/src/generators/federate-module/lib/check-remote-exists.js +22 -0
  30. package/src/generators/federate-module/lib/index.d.ts +4 -0
  31. package/src/generators/federate-module/lib/index.js +7 -0
  32. package/src/generators/federate-module/schema.d.ts +14 -0
  33. package/src/generators/federate-module/schema.json +77 -0
  34. package/src/generators/pipe/files/__fileName__.spec.ts__tpl__ +8 -0
  35. package/src/generators/pipe/files/{__pipeFileName__.pipe.ts__tpl__ → __fileName__.ts__tpl__} +2 -2
  36. package/src/generators/pipe/lib/normalize-options.d.ts +1 -1
  37. package/src/generators/pipe/lib/normalize-options.js +20 -7
  38. package/src/generators/pipe/lib/validate-options.js +0 -2
  39. package/src/generators/pipe/pipe.js +7 -7
  40. package/src/generators/pipe/schema.d.ts +20 -4
  41. package/src/generators/pipe/schema.json +15 -11
  42. package/src/generators/scam/lib/convert-component-to-scam.js +3 -6
  43. package/src/generators/scam/lib/normalize-options.d.ts +1 -1
  44. package/src/generators/scam/lib/normalize-options.js +18 -5
  45. package/src/generators/scam/scam.js +1 -1
  46. package/src/generators/scam/schema.d.ts +18 -3
  47. package/src/generators/scam/schema.json +25 -18
  48. package/src/generators/scam-directive/lib/convert-directive-to-scam.js +3 -6
  49. package/src/generators/scam-directive/lib/normalize-options.d.ts +1 -1
  50. package/src/generators/scam-directive/lib/normalize-options.js +17 -7
  51. package/src/generators/scam-directive/scam-directive.js +1 -1
  52. package/src/generators/scam-directive/schema.d.ts +18 -5
  53. package/src/generators/scam-directive/schema.json +24 -17
  54. package/src/generators/scam-pipe/lib/convert-pipe-to-scam.js +3 -6
  55. package/src/generators/scam-pipe/lib/normalize-options.d.ts +1 -1
  56. package/src/generators/scam-pipe/lib/normalize-options.js +17 -7
  57. package/src/generators/scam-pipe/scam-pipe.js +1 -1
  58. package/src/generators/scam-pipe/schema.d.ts +18 -5
  59. package/src/generators/scam-pipe/schema.json +23 -16
  60. package/src/executors/browser-esbuild/compat.d.ts +0 -2
  61. package/src/executors/browser-esbuild/compat.js +0 -5
  62. package/src/executors/delegate-build/compat.d.ts +0 -2
  63. package/src/executors/delegate-build/compat.js +0 -5
  64. package/src/executors/ng-packagr-lite/compat.d.ts +0 -2
  65. package/src/executors/ng-packagr-lite/compat.js +0 -5
  66. package/src/executors/package/compat.d.ts +0 -2
  67. package/src/executors/package/compat.js +0 -5
  68. package/src/generators/add-linting/compat.d.ts +0 -2
  69. package/src/generators/add-linting/compat.js +0 -6
  70. package/src/generators/application/application.compat.d.ts +0 -1
  71. package/src/generators/application/application.compat.js +0 -7
  72. package/src/generators/component/component.compat.d.ts +0 -2
  73. package/src/generators/component/component.compat.js +0 -6
  74. package/src/generators/component-cypress-spec/compat.d.ts +0 -2
  75. package/src/generators/component-cypress-spec/compat.js +0 -6
  76. package/src/generators/component-story/compat.d.ts +0 -2
  77. package/src/generators/component-story/compat.js +0 -6
  78. package/src/generators/component-test/compat.d.ts +0 -2
  79. package/src/generators/component-test/compat.js +0 -6
  80. package/src/generators/convert-to-with-mf/convert-to-with-mf.compat.d.ts +0 -2
  81. package/src/generators/convert-to-with-mf/convert-to-with-mf.compat.js +0 -6
  82. package/src/generators/cypress-component-configuration/compat.d.ts +0 -2
  83. package/src/generators/cypress-component-configuration/compat.js +0 -6
  84. package/src/generators/directive/files/__directiveFileName__.directive.spec.ts__tpl__ +0 -8
  85. package/src/generators/host/host.compat.d.ts +0 -2
  86. package/src/generators/host/host.compat.js +0 -6
  87. package/src/generators/init/init.compat.d.ts +0 -1
  88. package/src/generators/init/init.compat.js +0 -7
  89. package/src/generators/library/library.compat.d.ts +0 -1
  90. package/src/generators/library/library.compat.js +0 -7
  91. package/src/generators/library-secondary-entry-point/compat.d.ts +0 -2
  92. package/src/generators/library-secondary-entry-point/compat.js +0 -6
  93. package/src/generators/move/compat.d.ts +0 -1
  94. package/src/generators/move/compat.js +0 -7
  95. package/src/generators/ng-add/compat.d.ts +0 -2
  96. package/src/generators/ng-add/compat.js +0 -5
  97. package/src/generators/ngrx/compat.d.ts +0 -2
  98. package/src/generators/ngrx/compat.js +0 -6
  99. package/src/generators/pipe/files/__pipeFileName__.pipe.spec.ts__tpl__ +0 -8
  100. package/src/generators/remote/remote.compat.d.ts +0 -2
  101. package/src/generators/remote/remote.compat.js +0 -6
  102. package/src/generators/scam/scam.compat.d.ts +0 -2
  103. package/src/generators/scam/scam.compat.js +0 -6
  104. package/src/generators/scam-directive/scam-directive.compat.d.ts +0 -2
  105. package/src/generators/scam-directive/scam-directive.compat.js +0 -6
  106. package/src/generators/scam-pipe/scam-pipe.compat.d.ts +0 -2
  107. package/src/generators/scam-pipe/scam-pipe.compat.js +0 -6
  108. package/src/generators/scam-to-standalone/compat.d.ts +0 -2
  109. package/src/generators/scam-to-standalone/compat.js +0 -6
  110. package/src/generators/setup-mf/setup-mf.compat.d.ts +0 -2
  111. package/src/generators/setup-mf/setup-mf.compat.js +0 -6
  112. package/src/generators/setup-ssr/setup-ssr.compat.d.ts +0 -2
  113. package/src/generators/setup-ssr/setup-ssr.compat.js +0 -6
  114. package/src/generators/setup-tailwind/setup-tailwind.compat.d.ts +0 -2
  115. package/src/generators/setup-tailwind/setup-tailwind.compat.js +0 -6
  116. package/src/generators/stories/compat.d.ts +0 -2
  117. package/src/generators/stories/compat.js +0 -6
  118. package/src/generators/storybook-configuration/compat.d.ts +0 -2
  119. package/src/generators/storybook-configuration/compat.js +0 -6
  120. package/src/generators/utils/warn-for-schematic-usage.d.ts +0 -1
  121. package/src/generators/utils/warn-for-schematic-usage.js +0 -8
  122. package/src/generators/web-worker/compat.d.ts +0 -2
  123. package/src/generators/web-worker/compat.js +0 -6
@@ -6,27 +6,13 @@
6
6
  "type": "object",
7
7
  "examples": [
8
8
  {
9
- "command": "nx g @nx/angular:scam --project=my-lib my-sample",
9
+ "command": "nx g @nx/angular:scam my-sample --directory=my-lib/src/lib/my-sample",
10
10
  "description": "Generate a `MySampleComponent` component in the `my-lib` library."
11
11
  }
12
12
  ],
13
- "description": "Creates a new, generic Angular component definition in the given or default project.",
13
+ "description": "Creates a new Angular SCAM.",
14
14
  "additionalProperties": false,
15
15
  "properties": {
16
- "path": {
17
- "type": "string",
18
- "format": "path",
19
- "description": "The path at which to create the component file, relative to the current workspace. Default is a folder with the same name as the component in the project root.",
20
- "visible": false
21
- },
22
- "project": {
23
- "type": "string",
24
- "description": "The name of the project.",
25
- "$default": {
26
- "$source": "projectName"
27
- },
28
- "x-dropdown": "projects"
29
- },
30
16
  "name": {
31
17
  "type": "string",
32
18
  "description": "The name of the component.",
@@ -36,6 +22,26 @@
36
22
  },
37
23
  "x-prompt": "What name would you like to use for the component?"
38
24
  },
25
+ "directory": {
26
+ "type": "string",
27
+ "description": "The directory at which to create the SCAM files. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
28
+ "aliases": ["dir", "path"],
29
+ "x-priority": "important"
30
+ },
31
+ "nameAndDirectoryFormat": {
32
+ "description": "Whether to generate the SCAM 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`).",
33
+ "type": "string",
34
+ "enum": ["as-provided", "derived"]
35
+ },
36
+ "project": {
37
+ "type": "string",
38
+ "description": "The name of the project.",
39
+ "$default": {
40
+ "$source": "projectName"
41
+ },
42
+ "x-dropdown": "projects",
43
+ "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 v18."
44
+ },
39
45
  "displayBlock": {
40
46
  "description": "Specifies if the style will contain `:host { display: block; }`.",
41
47
  "type": "boolean",
@@ -87,7 +93,8 @@
87
93
  "flat": {
88
94
  "type": "boolean",
89
95
  "description": "Create the new files at the top level of the current project.",
90
- "default": false
96
+ "default": false,
97
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18."
91
98
  },
92
99
  "selector": {
93
100
  "type": "string",
@@ -131,5 +138,5 @@
131
138
  "x-priority": "internal"
132
139
  }
133
140
  },
134
- "required": ["name", "project"]
141
+ "required": ["name"]
135
142
  }
@@ -12,21 +12,18 @@ function convertDirectiveToScam(tree, options) {
12
12
  if (!tsModule) {
13
13
  tsModule = (0, ensure_typescript_1.ensureTypescript)();
14
14
  }
15
- const directiveNames = (0, devkit_1.names)(options.name);
16
- const typeNames = (0, devkit_1.names)('directive');
17
- const directiveClassName = `${directiveNames.className}${typeNames.className}`;
18
15
  if (options.inlineScam) {
19
16
  const currentDirectiveContents = tree.read(options.filePath, 'utf-8');
20
17
  let source = tsModule.createSourceFile(options.filePath, currentDirectiveContents, tsModule.ScriptTarget.Latest, true);
21
18
  source = (0, js_1.insertImport)(tree, source, options.filePath, 'NgModule', '@angular/core');
22
19
  source = (0, js_1.insertImport)(tree, source, options.filePath, 'CommonModule', '@angular/common');
23
20
  let updatedDirectiveSource = source.getText();
24
- updatedDirectiveSource = `${updatedDirectiveSource}${getNgModuleDeclaration(directiveClassName)}`;
21
+ updatedDirectiveSource = `${updatedDirectiveSource}${getNgModuleDeclaration(options.symbolName)}`;
25
22
  tree.write(options.filePath, updatedDirectiveSource);
26
23
  return;
27
24
  }
28
- const scamFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${directiveNames.fileName}.module.ts`);
29
- tree.write(scamFilePath, getModuleFileContent(directiveClassName, options.fileName));
25
+ const scamFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${options.name}.module.ts`);
26
+ tree.write(scamFilePath, getModuleFileContent(options.symbolName, options.fileName));
30
27
  }
31
28
  exports.convertDirectiveToScam = convertDirectiveToScam;
32
29
  function getModuleFileContent(directiveClassName, directiveFileName) {
@@ -1,3 +1,3 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { NormalizedSchema, Schema } from '../schema';
3
- export declare function normalizeOptions(tree: Tree, options: Schema): NormalizedSchema;
3
+ export declare function normalizeOptions(tree: Tree, options: Schema): Promise<NormalizedSchema>;
@@ -1,22 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = void 0;
4
- const path_1 = require("../../utils/path");
5
- function normalizeOptions(tree, options) {
6
- const { directory, fileName, filePath, name, path } = (0, path_1.normalizeNameAndPaths)(tree, {
7
- ...options,
8
- type: 'directive',
4
+ const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
5
+ const devkit_1 = require("@nx/devkit");
6
+ async function normalizeOptions(tree, options) {
7
+ const { artifactName: name, directory, fileName, filePath, project, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
8
+ artifactType: 'directive',
9
+ callingGenerator: '@nx/angular:scam-directive',
10
+ name: options.name,
11
+ directory: options.directory ?? options.path,
12
+ flat: options.flat,
13
+ nameAndDirectoryFormat: options.nameAndDirectoryFormat,
14
+ project: options.project,
15
+ suffix: 'directive',
9
16
  });
17
+ const { className } = (0, devkit_1.names)(name);
18
+ const { className: suffixClassName } = (0, devkit_1.names)('directive');
19
+ const symbolName = `${className}${suffixClassName}`;
10
20
  return {
11
21
  ...options,
12
22
  export: options.export ?? true,
13
- flat: options.flat ?? true,
14
23
  inlineScam: options.inlineScam ?? true,
15
24
  directory,
16
25
  fileName,
17
26
  filePath,
18
- path,
19
27
  name,
28
+ symbolName,
29
+ project,
20
30
  };
21
31
  }
22
32
  exports.normalizeOptions = normalizeOptions;
@@ -15,7 +15,7 @@ async function scamDirectiveGenerator(tree, rawOptions) {
15
15
  standalone: false,
16
16
  skipFormat: true,
17
17
  });
18
- const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
18
+ const options = await (0, lib_1.normalizeOptions)(tree, rawOptions);
19
19
  (0, lib_1.convertDirectiveToScam)(tree, options);
20
20
  (0, export_scam_1.exportScam)(tree, options);
21
21
  await (0, devkit_1.formatFiles)(tree);
@@ -1,13 +1,26 @@
1
+ import { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
2
+
1
3
  export interface Schema {
2
4
  name: string;
3
- project: string;
4
- path?: string;
5
+ directory?: string;
6
+ nameAndDirectoryFormat?: NameAndDirectoryFormat;
5
7
  skipTests?: boolean;
6
8
  inlineScam?: boolean;
7
- flat?: boolean;
8
9
  prefix?: string;
9
10
  selector?: string;
10
11
  export?: boolean;
12
+ /**
13
+ * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18.
14
+ */
15
+ flat?: boolean;
16
+ /**
17
+ * @deprecated Provide the `directory` option instead. It will be removed in Nx v18.
18
+ */
19
+ path?: string;
20
+ /**
21
+ * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v18.
22
+ */
23
+ project?: string;
11
24
  }
12
25
 
13
26
  export interface NormalizedSchema extends Schema {
@@ -15,7 +28,7 @@ export interface NormalizedSchema extends Schema {
15
28
  export: boolean;
16
29
  fileName: string;
17
30
  filePath: string;
18
- flat: boolean;
19
31
  inlineScam: boolean;
20
- path: string;
32
+ symbolName: string;
33
+ project: string;
21
34
  }
@@ -6,27 +6,13 @@
6
6
  "type": "object",
7
7
  "examples": [
8
8
  {
9
- "command": "nx g @nx/angular:scam-directive --project=my-lib --flat=false my-sample",
9
+ "command": "nx g @nx/angular:scam-directive my-sample --directory=my-lib/src/lib/my-sample",
10
10
  "description": "Generate a `MySampleDirective` directive in a `my-sample` folder in the `my-lib` library"
11
11
  }
12
12
  ],
13
13
  "description": "Creates a new, generic Angular directive definition in the given or default project.",
14
14
  "additionalProperties": false,
15
15
  "properties": {
16
- "path": {
17
- "type": "string",
18
- "format": "path",
19
- "description": "The path at which to create the directive file, relative to the current workspace. Default is a folder with the same name as the directive in the project root.",
20
- "visible": false
21
- },
22
- "project": {
23
- "type": "string",
24
- "description": "The name of the project.",
25
- "$default": {
26
- "$source": "projectName"
27
- },
28
- "x-dropdown": "projects"
29
- },
30
16
  "name": {
31
17
  "type": "string",
32
18
  "description": "The name of the directive.",
@@ -37,6 +23,26 @@
37
23
  "x-prompt": "What name would you like to use for the directive?",
38
24
  "x-priority": "important"
39
25
  },
26
+ "directory": {
27
+ "type": "string",
28
+ "description": "The directory at which to create the SCAM Directive files. When `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. Otherwise, it will be relative to the workspace root.",
29
+ "aliases": ["dir", "path"],
30
+ "x-priority": "important"
31
+ },
32
+ "nameAndDirectoryFormat": {
33
+ "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`).",
34
+ "type": "string",
35
+ "enum": ["as-provided", "derived"]
36
+ },
37
+ "project": {
38
+ "type": "string",
39
+ "description": "The name of the project.",
40
+ "$default": {
41
+ "$source": "projectName"
42
+ },
43
+ "x-dropdown": "projects",
44
+ "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 v18."
45
+ },
40
46
  "skipTests": {
41
47
  "type": "boolean",
42
48
  "description": "Do not create `spec.ts` test files for the new directive.",
@@ -51,7 +57,8 @@
51
57
  "flat": {
52
58
  "type": "boolean",
53
59
  "description": "Create the new files at the top level of the current project.",
54
- "default": true
60
+ "default": true,
61
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18."
55
62
  },
56
63
  "selector": {
57
64
  "type": "string",
@@ -79,5 +86,5 @@
79
86
  "x-priority": "important"
80
87
  }
81
88
  },
82
- "required": ["name", "project"]
89
+ "required": ["name"]
83
90
  }
@@ -12,21 +12,18 @@ function convertPipeToScam(tree, options) {
12
12
  if (!tsModule) {
13
13
  tsModule = (0, ensure_typescript_1.ensureTypescript)();
14
14
  }
15
- const pipeNames = (0, devkit_1.names)(options.name);
16
- const typeNames = (0, devkit_1.names)('pipe');
17
- const pipeClassName = `${pipeNames.className}${typeNames.className}`;
18
15
  if (options.inlineScam) {
19
16
  const currentPipeContents = tree.read(options.filePath, 'utf-8');
20
17
  let source = tsModule.createSourceFile(options.filePath, currentPipeContents, tsModule.ScriptTarget.Latest, true);
21
18
  source = (0, js_1.insertImport)(tree, source, options.filePath, 'NgModule', '@angular/core');
22
19
  source = (0, js_1.insertImport)(tree, source, options.filePath, 'CommonModule', '@angular/common');
23
20
  let updatedPipeSource = source.getText();
24
- updatedPipeSource = `${updatedPipeSource}${getNgModuleDeclaration(pipeClassName)}`;
21
+ updatedPipeSource = `${updatedPipeSource}${getNgModuleDeclaration(options.symbolName)}`;
25
22
  tree.write(options.filePath, updatedPipeSource);
26
23
  return;
27
24
  }
28
- const scamFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${pipeNames.fileName}.module.ts`);
29
- tree.write(scamFilePath, getModuleFileContent(pipeClassName, options.fileName));
25
+ const scamFilePath = (0, devkit_1.joinPathFragments)(options.directory, `${options.name}.module.ts`);
26
+ tree.write(scamFilePath, getModuleFileContent(options.symbolName, options.fileName));
30
27
  }
31
28
  exports.convertPipeToScam = convertPipeToScam;
32
29
  function getModuleFileContent(pipeClassName, pipeFileName) {
@@ -1,3 +1,3 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { NormalizedSchema, Schema } from '../schema';
3
- export declare function normalizeOptions(tree: Tree, options: Schema): NormalizedSchema;
3
+ export declare function normalizeOptions(tree: Tree, options: Schema): Promise<NormalizedSchema>;
@@ -1,22 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = void 0;
4
- const path_1 = require("../../utils/path");
5
- function normalizeOptions(tree, options) {
6
- const { directory, fileName, filePath, name, path } = (0, path_1.normalizeNameAndPaths)(tree, {
7
- ...options,
8
- type: 'pipe',
4
+ const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
5
+ const devkit_1 = require("@nx/devkit");
6
+ async function normalizeOptions(tree, options) {
7
+ const { artifactName: name, directory, fileName, filePath, project, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
8
+ artifactType: 'pipe',
9
+ callingGenerator: '@nx/angular:scam-pipe',
10
+ name: options.name,
11
+ directory: options.directory ?? options.path,
12
+ flat: options.flat,
13
+ nameAndDirectoryFormat: options.nameAndDirectoryFormat,
14
+ project: options.project,
15
+ suffix: 'pipe',
9
16
  });
17
+ const { className } = (0, devkit_1.names)(name);
18
+ const { className: suffixClassName } = (0, devkit_1.names)('pipe');
19
+ const symbolName = `${className}${suffixClassName}`;
10
20
  return {
11
21
  ...options,
12
22
  export: options.export ?? true,
13
- flat: options.flat ?? true,
14
23
  inlineScam: options.inlineScam ?? true,
15
24
  directory,
16
25
  fileName,
17
26
  filePath,
18
27
  name,
19
- path,
28
+ symbolName,
29
+ project,
20
30
  };
21
31
  }
22
32
  exports.normalizeOptions = normalizeOptions;
@@ -15,7 +15,7 @@ async function scamPipeGenerator(tree, rawOptions) {
15
15
  standalone: false,
16
16
  skipFormat: true,
17
17
  });
18
- const options = (0, lib_1.normalizeOptions)(tree, rawOptions);
18
+ const options = await (0, lib_1.normalizeOptions)(tree, rawOptions);
19
19
  (0, lib_1.convertPipeToScam)(tree, options);
20
20
  (0, export_scam_1.exportScam)(tree, options);
21
21
  await (0, devkit_1.formatFiles)(tree);
@@ -1,11 +1,24 @@
1
+ import { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
2
+
1
3
  export interface Schema {
2
4
  name: string;
3
- project: string;
4
- path?: string;
5
+ directory?: string;
6
+ nameAndDirectoryFormat?: NameAndDirectoryFormat;
5
7
  skipTests?: boolean;
6
8
  inlineScam?: boolean;
7
- flat?: boolean;
8
9
  export?: boolean;
10
+ /**
11
+ * @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18.
12
+ */
13
+ flat?: boolean;
14
+ /**
15
+ * @deprecated Provide the `directory` option instead. It will be removed in Nx v18.
16
+ */
17
+ path?: string;
18
+ /**
19
+ * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v18.
20
+ */
21
+ project?: string;
9
22
  }
10
23
 
11
24
  export interface NormalizedSchema extends Schema {
@@ -13,7 +26,7 @@ export interface NormalizedSchema extends Schema {
13
26
  export: boolean;
14
27
  fileName: string;
15
28
  filePath: string;
16
- flat: boolean;
17
29
  inlineScam: boolean;
18
- path: string;
30
+ project: string;
31
+ symbolName: string;
19
32
  }
@@ -13,20 +13,6 @@
13
13
  "description": "Creates a new, generic Angular pipe definition in the given or default project.",
14
14
  "additionalProperties": false,
15
15
  "properties": {
16
- "path": {
17
- "type": "string",
18
- "format": "path",
19
- "description": "The path at which to create the pipe file, relative to the current workspace. Default is a folder with the same name as the pipe in the project root.",
20
- "visible": false
21
- },
22
- "project": {
23
- "type": "string",
24
- "description": "The name of the project.",
25
- "$default": {
26
- "$source": "projectName"
27
- },
28
- "x-dropdown": "projects"
29
- },
30
16
  "name": {
31
17
  "type": "string",
32
18
  "description": "The name of the pipe.",
@@ -37,6 +23,26 @@
37
23
  "x-prompt": "What name would you like to use for the pipe?",
38
24
  "x-priority": "important"
39
25
  },
26
+ "directory": {
27
+ "type": "string",
28
+ "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.",
29
+ "aliases": ["dir", "path"],
30
+ "x-priority": "important"
31
+ },
32
+ "nameAndDirectoryFormat": {
33
+ "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`).",
34
+ "type": "string",
35
+ "enum": ["as-provided", "derived"]
36
+ },
37
+ "project": {
38
+ "type": "string",
39
+ "description": "The name of the project.",
40
+ "$default": {
41
+ "$source": "projectName"
42
+ },
43
+ "x-dropdown": "projects",
44
+ "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 v18."
45
+ },
40
46
  "skipTests": {
41
47
  "type": "boolean",
42
48
  "description": "Do not create `spec.ts` test files for the new pipe.",
@@ -51,7 +57,8 @@
51
57
  "flat": {
52
58
  "type": "boolean",
53
59
  "description": "Create the new files at the top level of the current project.",
54
- "default": true
60
+ "default": true,
61
+ "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v18."
55
62
  },
56
63
  "export": {
57
64
  "type": "boolean",
@@ -60,5 +67,5 @@
60
67
  "x-priority": "important"
61
68
  }
62
69
  },
63
- "required": ["name", "project"]
70
+ "required": ["name"]
64
71
  }
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const browser_esbuild_impl_1 = require("./browser-esbuild.impl");
5
- exports.default = (0, devkit_1.convertNxExecutor)(browser_esbuild_impl_1.default);
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const delegate_build_impl_1 = require("./delegate-build.impl");
5
- exports.default = (0, devkit_1.convertNxExecutor)(delegate_build_impl_1.delegateBuildExecutor);
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const ng_packagr_lite_impl_1 = require("./ng-packagr-lite.impl");
5
- exports.default = (0, devkit_1.convertNxExecutor)(ng_packagr_lite_impl_1.ngPackagrLiteExecutor);
@@ -1,2 +0,0 @@
1
- declare const _default: any;
2
- export default _default;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const package_impl_1 = require("./package.impl");
5
- exports.default = (0, devkit_1.convertNxExecutor)(package_impl_1.packageExecutor);
@@ -1,2 +0,0 @@
1
- declare const _default: (generatorOptions: import("./schema").AddLintingGeneratorSchema) => (tree: any, context: any) => Promise<any>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
5
- const add_linting_1 = require("./add-linting");
6
- exports.default = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(add_linting_1.addLintingGenerator));
@@ -1 +0,0 @@
1
- export declare const applicationSchematic: (generatorOptions: Partial<import("./schema").Schema>) => (tree: any, context: any) => Promise<any>;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.applicationSchematic = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
6
- const application_1 = require("./application");
7
- exports.applicationSchematic = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(application_1.default));
@@ -1,2 +0,0 @@
1
- declare const _default: (generatorOptions: import("./schema").Schema) => (tree: any, context: any) => Promise<any>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
5
- const component_1 = require("./component");
6
- exports.default = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(component_1.componentGenerator));
@@ -1,2 +0,0 @@
1
- declare const _default: (generatorOptions: import("./schema").ComponentCypressSpecGeneratorOptions) => (tree: any, context: any) => Promise<any>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
5
- const component_cypress_spec_1 = require("./component-cypress-spec");
6
- exports.default = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(component_cypress_spec_1.componentCypressSpecGenerator));
@@ -1,2 +0,0 @@
1
- declare const _default: (generatorOptions: import("./schema").ComponentStoryGeneratorOptions) => (tree: any, context: any) => Promise<any>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
5
- const component_story_1 = require("./component-story");
6
- exports.default = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(component_story_1.componentStoryGenerator));
@@ -1,2 +0,0 @@
1
- declare const _default: (generatorOptions: import("./schema").ComponentTestSchema) => (tree: any, context: any) => Promise<any>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
5
- const component_test_1 = require("./component-test");
6
- exports.default = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(component_test_1.componentTestGenerator));
@@ -1,2 +0,0 @@
1
- declare const _default: (generatorOptions: import("./schema").Schema) => (tree: any, context: any) => Promise<any>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
5
- const convert_to_with_mf_1 = require("./convert-to-with-mf");
6
- exports.default = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(convert_to_with_mf_1.default));
@@ -1,2 +0,0 @@
1
- declare const _default: (generatorOptions: import("./schema").CypressComponentConfigSchema) => (tree: any, context: any) => Promise<any>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
5
- const cypress_component_configuration_1 = require("./cypress-component-configuration");
6
- exports.default = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(cypress_component_configuration_1.cypressComponentConfiguration));
@@ -1,8 +0,0 @@
1
- import { <%= directiveClassName %>Directive } from './<%= directiveFileName %>.directive';
2
-
3
- describe('<%= directiveClassName %>Directive', () => {
4
- it('should create an instance', () => {
5
- const directive = new <%= directiveClassName %>Directive();
6
- expect(directive).toBeTruthy();
7
- });
8
- });
@@ -1,2 +0,0 @@
1
- declare const _default: (generatorOptions: import("./schema").Schema) => (tree: any, context: any) => Promise<any>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
5
- const host_1 = require("./host");
6
- exports.default = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(host_1.default));
@@ -1 +0,0 @@
1
- export declare const initSchematic: (generatorOptions: import("./schema").Schema) => (tree: any, context: any) => Promise<any>;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initSchematic = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- const warn_for_schematic_usage_1 = require("../utils/warn-for-schematic-usage");
6
- const init_1 = require("./init");
7
- exports.initSchematic = (0, warn_for_schematic_usage_1.warnForSchematicUsage)((0, devkit_1.convertNxGenerator)(init_1.angularInitGenerator));