@nx/nest 17.0.0-beta.8 → 17.0.0-rc.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 (50) hide show
  1. package/generators.json +15 -15
  2. package/package.json +6 -6
  3. package/src/generators/class/class.d.ts +2 -1
  4. package/src/generators/class/class.js +14 -6
  5. package/src/generators/class/schema.json +9 -3
  6. package/src/generators/controller/controller.d.ts +2 -1
  7. package/src/generators/controller/controller.js +14 -6
  8. package/src/generators/controller/schema.json +9 -3
  9. package/src/generators/decorator/decorator.d.ts +2 -1
  10. package/src/generators/decorator/decorator.js +14 -6
  11. package/src/generators/decorator/schema.json +9 -3
  12. package/src/generators/filter/filter.d.ts +2 -1
  13. package/src/generators/filter/filter.js +14 -6
  14. package/src/generators/filter/schema.json +9 -3
  15. package/src/generators/gateway/gateway.d.ts +2 -1
  16. package/src/generators/gateway/gateway.js +14 -6
  17. package/src/generators/gateway/schema.json +9 -3
  18. package/src/generators/guard/guard.d.ts +2 -1
  19. package/src/generators/guard/guard.js +14 -6
  20. package/src/generators/guard/schema.json +9 -3
  21. package/src/generators/interceptor/interceptor.d.ts +2 -1
  22. package/src/generators/interceptor/interceptor.js +14 -6
  23. package/src/generators/interceptor/schema.json +9 -3
  24. package/src/generators/interface/interface.d.ts +2 -1
  25. package/src/generators/interface/interface.js +11 -4
  26. package/src/generators/interface/schema.json +9 -3
  27. package/src/generators/middleware/middleware.d.ts +2 -1
  28. package/src/generators/middleware/middleware.js +14 -6
  29. package/src/generators/middleware/schema.json +9 -3
  30. package/src/generators/module/module.d.ts +2 -1
  31. package/src/generators/module/module.js +14 -6
  32. package/src/generators/module/schema.json +9 -3
  33. package/src/generators/pipe/pipe.d.ts +2 -1
  34. package/src/generators/pipe/pipe.js +14 -6
  35. package/src/generators/pipe/schema.json +9 -3
  36. package/src/generators/provider/provider.d.ts +2 -1
  37. package/src/generators/provider/provider.js +14 -6
  38. package/src/generators/provider/schema.json +9 -3
  39. package/src/generators/resolver/resolver.d.ts +2 -1
  40. package/src/generators/resolver/resolver.js +14 -6
  41. package/src/generators/resolver/schema.json +4 -3
  42. package/src/generators/resource/resource.d.ts +2 -1
  43. package/src/generators/resource/resource.js +14 -6
  44. package/src/generators/resource/schema.json +4 -3
  45. package/src/generators/service/schema.json +9 -3
  46. package/src/generators/service/service.d.ts +2 -1
  47. package/src/generators/service/service.js +14 -6
  48. package/src/generators/utils/normalize-options.d.ts +1 -1
  49. package/src/generators/utils/normalize-options.js +16 -9
  50. package/src/generators/utils/types.d.ts +2 -0
package/generators.json CHANGED
@@ -25,77 +25,77 @@
25
25
  "description": "Create a new NestJS library."
26
26
  },
27
27
  "class": {
28
- "factory": "./src/generators/class/class",
28
+ "factory": "./src/generators/class/class#classGeneratorInternal",
29
29
  "schema": "./src/generators/class/schema.json",
30
30
  "description": "Run the `class` NestJS generator with Nx project support."
31
31
  },
32
32
  "controller": {
33
- "factory": "./src/generators/controller/controller",
33
+ "factory": "./src/generators/controller/controller#controllerGeneratorInternal",
34
34
  "schema": "./src/generators/controller/schema.json",
35
35
  "description": "Run the `controller` NestJS generator with Nx project support."
36
36
  },
37
37
  "decorator": {
38
- "factory": "./src/generators/decorator/decorator",
38
+ "factory": "./src/generators/decorator/decorator#decoratorGeneratorInternal",
39
39
  "schema": "./src/generators/decorator/schema.json",
40
40
  "description": "Run the `decorator` NestJS generator with Nx project support."
41
41
  },
42
42
  "filter": {
43
- "factory": "./src/generators/filter/filter",
43
+ "factory": "./src/generators/filter/filter#filterGeneratorInternal",
44
44
  "schema": "./src/generators/filter/schema.json",
45
45
  "description": "Run the `filter` NestJS generator with Nx project support."
46
46
  },
47
47
  "gateway": {
48
- "factory": "./src/generators/gateway/gateway",
48
+ "factory": "./src/generators/gateway/gateway#gatewayGeneratorInternal",
49
49
  "schema": "./src/generators/gateway/schema.json",
50
50
  "description": "Run the `gateway` NestJS generator with Nx project support."
51
51
  },
52
52
  "guard": {
53
- "factory": "./src/generators/guard/guard",
53
+ "factory": "./src/generators/guard/guard#guardGeneratorInternal",
54
54
  "schema": "./src/generators/guard/schema.json",
55
55
  "description": "Run the `guard` NestJS generator with Nx project support."
56
56
  },
57
57
  "interceptor": {
58
- "factory": "./src/generators/interceptor/interceptor",
58
+ "factory": "./src/generators/interceptor/interceptor#interceptorGeneratorInternal",
59
59
  "schema": "./src/generators/interceptor/schema.json",
60
60
  "description": "Run the `interceptor` NestJS generator with Nx project support."
61
61
  },
62
62
  "interface": {
63
- "factory": "./src/generators/interface/interface",
63
+ "factory": "./src/generators/interface/interface#interfaceGeneratorInternal",
64
64
  "schema": "./src/generators/interface/schema.json",
65
65
  "description": "Run the `interface` NestJS generator with Nx project support."
66
66
  },
67
67
  "middleware": {
68
- "factory": "./src/generators/middleware/middleware",
68
+ "factory": "./src/generators/middleware/middleware#middlewareGeneratorInternal",
69
69
  "schema": "./src/generators/middleware/schema.json",
70
70
  "description": "Run the `middleware` NestJS generator with Nx project support."
71
71
  },
72
72
  "module": {
73
- "factory": "./src/generators/module/module",
73
+ "factory": "./src/generators/module/module#moduleGeneratorInternal",
74
74
  "schema": "./src/generators/module/schema.json",
75
75
  "description": "Run the `module` NestJS generator with Nx project support."
76
76
  },
77
77
  "pipe": {
78
- "factory": "./src/generators/pipe/pipe",
78
+ "factory": "./src/generators/pipe/pipe#pipeGeneratorInternal",
79
79
  "schema": "./src/generators/pipe/schema.json",
80
80
  "description": "Run the `pipe` NestJS generator with Nx project support."
81
81
  },
82
82
  "provider": {
83
- "factory": "./src/generators/provider/provider",
83
+ "factory": "./src/generators/provider/provider#providerGeneratorInternal",
84
84
  "schema": "./src/generators/provider/schema.json",
85
85
  "description": "Run the `provider` NestJS generator with Nx project support."
86
86
  },
87
87
  "resolver": {
88
- "factory": "./src/generators/resolver/resolver",
88
+ "factory": "./src/generators/resolver/resolver#resolverGeneratorInternal",
89
89
  "schema": "./src/generators/resolver/schema.json",
90
90
  "description": "Run the `resolver` NestJS generator with Nx project support."
91
91
  },
92
92
  "resource": {
93
- "factory": "./src/generators/resource/resource",
93
+ "factory": "./src/generators/resource/resource#resourceGeneratorInternal",
94
94
  "schema": "./src/generators/resource/schema.json",
95
95
  "description": "Run the `resource` NestJS generator with Nx project support."
96
96
  },
97
97
  "service": {
98
- "factory": "./src/generators/service/service",
98
+ "factory": "./src/generators/service/service#serviceGeneratorInternal",
99
99
  "schema": "./src/generators/service/schema.json",
100
100
  "description": "Run the `service` NestJS generator with Nx project support."
101
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/nest",
3
- "version": "17.0.0-beta.8",
3
+ "version": "17.0.0-rc.0",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Nest contains executors and generators for allowing your workspace to create powerful Nest best in class APIs.",
6
6
  "repository": {
@@ -31,13 +31,13 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@nestjs/schematics": "^9.1.0",
34
- "@nx/devkit": "17.0.0-beta.8",
35
- "@nx/js": "17.0.0-beta.8",
36
- "@nx/eslint": "17.0.0-beta.8",
37
- "@nx/node": "17.0.0-beta.8",
34
+ "@nx/devkit": "17.0.0-rc.0",
35
+ "@nx/js": "17.0.0-rc.0",
36
+ "@nx/eslint": "17.0.0-rc.0",
37
+ "@nx/node": "17.0.0-rc.0",
38
38
  "@phenomnomnominal/tsquery": "~5.0.1",
39
39
  "tslib": "^2.3.0",
40
- "@nrwl/nest": "17.0.0-beta.8"
40
+ "@nrwl/nest": "17.0.0-rc.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -1,5 +1,6 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
3
3
  export type ClassGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
4
- export declare function classGenerator(tree: Tree, rawOptions: ClassGeneratorOptions): Promise<any>;
4
+ export declare function classGenerator(tree: Tree, rawOptions: ClassGeneratorOptions): Promise<void>;
5
+ export declare function classGeneratorInternal(tree: Tree, rawOptions: ClassGeneratorOptions): Promise<any>;
5
6
  export default classGenerator;
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.classGenerator = void 0;
3
+ exports.classGeneratorInternal = exports.classGenerator = void 0;
4
4
  const utils_1 = require("../utils");
5
- function classGenerator(tree, rawOptions) {
6
- const options = normalizeClassOptions(tree, rawOptions);
7
- return (0, utils_1.runNestSchematic)(tree, 'class', options);
5
+ async function classGenerator(tree, rawOptions) {
6
+ await classGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
8
10
  }
9
11
  exports.classGenerator = classGenerator;
12
+ async function classGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeClassOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'class', options);
15
+ }
16
+ exports.classGeneratorInternal = classGeneratorInternal;
10
17
  exports.default = classGenerator;
11
- function normalizeClassOptions(tree, options) {
18
+ async function normalizeClassOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'class', '@nx/nest:class', options);
12
20
  return {
13
- ...(0, utils_1.normalizeOptions)(tree, options),
21
+ ...normalizedOptions,
14
22
  language: options.language,
15
23
  spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
16
24
  };
@@ -15,6 +15,11 @@
15
15
  },
16
16
  "x-prompt": "What name would you like to use?"
17
17
  },
18
+ "nameAndDirectoryFormat": {
19
+ "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`).",
20
+ "type": "string",
21
+ "enum": ["as-provided", "derived"]
22
+ },
18
23
  "project": {
19
24
  "description": "The Nest project to target.",
20
25
  "type": "string",
@@ -22,10 +27,10 @@
22
27
  "$source": "projectName"
23
28
  },
24
29
  "alias": "p",
25
- "x-prompt": "What Nest project would you like to target?"
30
+ "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."
26
31
  },
27
32
  "directory": {
28
- "description": "Directory where the generated files are placed.",
33
+ "description": "Directory where the generated files are placed. when `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. otherwise, it will be relative to the workspace root.",
29
34
  "type": "string",
30
35
  "aliases": ["dir", "path"]
31
36
  },
@@ -43,6 +48,7 @@
43
48
  },
44
49
  "flat": {
45
50
  "description": "Flag to indicate if a directory is created.",
51
+ "x-deprecated": "provide the `directory` option instead and use the `as-provided` format. it will be removed in nx v18.",
46
52
  "type": "boolean",
47
53
  "default": true
48
54
  },
@@ -53,5 +59,5 @@
53
59
  }
54
60
  },
55
61
  "additionalProperties": false,
56
- "required": ["name", "project"]
62
+ "required": ["name"]
57
63
  }
@@ -4,5 +4,6 @@ export type ControllerGeneratorOptions = NestGeneratorWithLanguageOption & NestG
4
4
  module?: string;
5
5
  skipImport?: boolean;
6
6
  };
7
- export declare function controllerGenerator(tree: Tree, rawOptions: ControllerGeneratorOptions): Promise<any>;
7
+ export declare function controllerGenerator(tree: Tree, rawOptions: ControllerGeneratorOptions): Promise<void>;
8
+ export declare function controllerGeneratorInternal(tree: Tree, rawOptions: ControllerGeneratorOptions): Promise<any>;
8
9
  export default controllerGenerator;
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.controllerGenerator = void 0;
3
+ exports.controllerGeneratorInternal = exports.controllerGenerator = void 0;
4
4
  const utils_1 = require("../utils");
5
- function controllerGenerator(tree, rawOptions) {
6
- const options = normalizeControllerOptions(tree, rawOptions);
7
- return (0, utils_1.runNestSchematic)(tree, 'controller', options);
5
+ async function controllerGenerator(tree, rawOptions) {
6
+ await controllerGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
8
10
  }
9
11
  exports.controllerGenerator = controllerGenerator;
12
+ async function controllerGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeControllerOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'controller', options);
15
+ }
16
+ exports.controllerGeneratorInternal = controllerGeneratorInternal;
10
17
  exports.default = controllerGenerator;
11
- function normalizeControllerOptions(tree, options) {
18
+ async function normalizeControllerOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'controller', '@nx/nest:controller', options);
12
20
  return {
13
- ...(0, utils_1.normalizeOptions)(tree, options),
21
+ ...normalizedOptions,
14
22
  language: options.language,
15
23
  module: options.module,
16
24
  skipImport: options.skipImport,
@@ -22,10 +22,15 @@
22
22
  "$source": "projectName"
23
23
  },
24
24
  "alias": "p",
25
- "x-prompt": "What Nest project would you like to target?"
25
+ "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."
26
+ },
27
+ "nameAndDirectoryFormat": {
28
+ "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`).",
29
+ "type": "string",
30
+ "enum": ["as-provided", "derived"]
26
31
  },
27
32
  "directory": {
28
- "description": "Directory where the generated files are placed.",
33
+ "description": "Directory where the generated files are placed. when `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. otherwise, it will be relative to the workspace root.",
29
34
  "type": "string",
30
35
  "aliases": ["dir", "path"]
31
36
  },
@@ -43,6 +48,7 @@
43
48
  },
44
49
  "flat": {
45
50
  "description": "Flag to indicate if a directory is created.",
51
+ "x-deprecated": "provide the `directory` option instead and use the `as-provided` format. it will be removed in nx v18.",
46
52
  "type": "boolean",
47
53
  "default": false
48
54
  },
@@ -62,5 +68,5 @@
62
68
  }
63
69
  },
64
70
  "additionalProperties": false,
65
- "required": ["name", "project"]
71
+ "required": ["name"]
66
72
  }
@@ -1,5 +1,6 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { NestGeneratorWithLanguageOption } from '../utils';
3
3
  export type DecoratorGeneratorOptions = NestGeneratorWithLanguageOption;
4
- export declare function decoratorGenerator(tree: Tree, rawOptions: DecoratorGeneratorOptions): Promise<any>;
4
+ export declare function decoratorGenerator(tree: Tree, rawOptions: DecoratorGeneratorOptions): Promise<void>;
5
+ export declare function decoratorGeneratorInternal(tree: Tree, rawOptions: DecoratorGeneratorOptions): Promise<any>;
5
6
  export default decoratorGenerator;
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.decoratorGenerator = void 0;
3
+ exports.decoratorGeneratorInternal = exports.decoratorGenerator = void 0;
4
4
  const utils_1 = require("../utils");
5
- function decoratorGenerator(tree, rawOptions) {
6
- const options = normalizeDecoratorOptions(tree, rawOptions);
7
- return (0, utils_1.runNestSchematic)(tree, 'decorator', options);
5
+ async function decoratorGenerator(tree, rawOptions) {
6
+ await decoratorGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
8
10
  }
9
11
  exports.decoratorGenerator = decoratorGenerator;
12
+ async function decoratorGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeDecoratorOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'decorator', options);
15
+ }
16
+ exports.decoratorGeneratorInternal = decoratorGeneratorInternal;
10
17
  exports.default = decoratorGenerator;
11
- function normalizeDecoratorOptions(tree, options) {
18
+ async function normalizeDecoratorOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'decorator', '@nx/nest:decorator', options);
12
20
  return {
13
- ...(0, utils_1.normalizeOptions)(tree, options),
21
+ ...normalizedOptions,
14
22
  language: options.language,
15
23
  };
16
24
  }
@@ -15,6 +15,11 @@
15
15
  },
16
16
  "x-prompt": "What name would you like to use?"
17
17
  },
18
+ "nameAndDirectoryFormat": {
19
+ "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`).",
20
+ "type": "string",
21
+ "enum": ["as-provided", "derived"]
22
+ },
18
23
  "project": {
19
24
  "description": "The Nest project to target.",
20
25
  "type": "string",
@@ -22,10 +27,10 @@
22
27
  "$source": "projectName"
23
28
  },
24
29
  "alias": "p",
25
- "x-prompt": "What Nest project would you like to target?"
30
+ "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."
26
31
  },
27
32
  "directory": {
28
- "description": "Directory where the generated files are placed.",
33
+ "description": "Directory where the generated files are placed. when `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. otherwise, it will be relative to the workspace root.",
29
34
  "type": "string",
30
35
  "aliases": ["dir", "path"]
31
36
  },
@@ -37,6 +42,7 @@
37
42
  },
38
43
  "flat": {
39
44
  "description": "Flag to indicate if a directory is created.",
45
+ "x-deprecated": "provide the `directory` option instead and use the `as-provided` format. it will be removed in nx v18.",
40
46
  "type": "boolean",
41
47
  "default": true
42
48
  },
@@ -47,5 +53,5 @@
47
53
  }
48
54
  },
49
55
  "additionalProperties": false,
50
- "required": ["name", "project"]
56
+ "required": ["name"]
51
57
  }
@@ -1,5 +1,6 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
3
3
  export type FilterGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
4
- export declare function filterGenerator(tree: Tree, rawOptions: FilterGeneratorOptions): Promise<any>;
4
+ export declare function filterGenerator(tree: Tree, rawOptions: FilterGeneratorOptions): Promise<void>;
5
+ export declare function filterGeneratorInternal(tree: Tree, rawOptions: FilterGeneratorOptions): Promise<any>;
5
6
  export default filterGenerator;
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filterGenerator = void 0;
3
+ exports.filterGeneratorInternal = exports.filterGenerator = void 0;
4
4
  const utils_1 = require("../utils");
5
- function filterGenerator(tree, rawOptions) {
6
- const options = normalizeFilterOptions(tree, rawOptions);
7
- return (0, utils_1.runNestSchematic)(tree, 'filter', options);
5
+ async function filterGenerator(tree, rawOptions) {
6
+ await filterGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
8
10
  }
9
11
  exports.filterGenerator = filterGenerator;
12
+ async function filterGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeFilterOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'filter', options);
15
+ }
16
+ exports.filterGeneratorInternal = filterGeneratorInternal;
10
17
  exports.default = filterGenerator;
11
- function normalizeFilterOptions(tree, options) {
18
+ async function normalizeFilterOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'filter', '@nx/nest:filter', options);
12
20
  return {
13
- ...(0, utils_1.normalizeOptions)(tree, options),
21
+ ...normalizedOptions,
14
22
  language: options.language,
15
23
  spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
16
24
  };
@@ -15,6 +15,11 @@
15
15
  },
16
16
  "x-prompt": "What name would you like to use?"
17
17
  },
18
+ "nameAndDirectoryFormat": {
19
+ "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`).",
20
+ "type": "string",
21
+ "enum": ["as-provided", "derived"]
22
+ },
18
23
  "project": {
19
24
  "description": "The Nest project to target.",
20
25
  "type": "string",
@@ -22,10 +27,10 @@
22
27
  "$source": "projectName"
23
28
  },
24
29
  "alias": "p",
25
- "x-prompt": "What Nest project would you like to target?"
30
+ "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."
26
31
  },
27
32
  "directory": {
28
- "description": "Directory where the generated files are placed.",
33
+ "description": "Directory where the generated files are placed. when `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. otherwise, it will be relative to the workspace root.",
29
34
  "type": "string",
30
35
  "aliases": ["dir", "path"]
31
36
  },
@@ -43,6 +48,7 @@
43
48
  },
44
49
  "flat": {
45
50
  "description": "Flag to indicate if a directory is created.",
51
+ "x-deprecated": "provide the `directory` option instead and use the `as-provided` format. it will be removed in nx v18.",
46
52
  "type": "boolean",
47
53
  "default": true
48
54
  },
@@ -53,5 +59,5 @@
53
59
  }
54
60
  },
55
61
  "additionalProperties": false,
56
- "required": ["name", "project"]
62
+ "required": ["name"]
57
63
  }
@@ -1,5 +1,6 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
3
3
  export type GatewayGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
4
- export declare function gatewayGenerator(tree: Tree, rawOptions: GatewayGeneratorOptions): Promise<any>;
4
+ export declare function gatewayGenerator(tree: Tree, rawOptions: GatewayGeneratorOptions): Promise<void>;
5
+ export declare function gatewayGeneratorInternal(tree: Tree, rawOptions: GatewayGeneratorOptions): Promise<any>;
5
6
  export default gatewayGenerator;
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.gatewayGenerator = void 0;
3
+ exports.gatewayGeneratorInternal = exports.gatewayGenerator = void 0;
4
4
  const utils_1 = require("../utils");
5
- function gatewayGenerator(tree, rawOptions) {
6
- const options = normalizeGatewayOptions(tree, rawOptions);
7
- return (0, utils_1.runNestSchematic)(tree, 'gateway', options);
5
+ async function gatewayGenerator(tree, rawOptions) {
6
+ await gatewayGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
8
10
  }
9
11
  exports.gatewayGenerator = gatewayGenerator;
12
+ async function gatewayGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeGatewayOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'gateway', options);
15
+ }
16
+ exports.gatewayGeneratorInternal = gatewayGeneratorInternal;
10
17
  exports.default = gatewayGenerator;
11
- function normalizeGatewayOptions(tree, options) {
18
+ async function normalizeGatewayOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'gateway', '@nx/nest:gateway', options);
12
20
  return {
13
- ...(0, utils_1.normalizeOptions)(tree, options),
21
+ ...normalizedOptions,
14
22
  language: options.language,
15
23
  spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
16
24
  };
@@ -15,6 +15,11 @@
15
15
  },
16
16
  "x-prompt": "What name would you like to use?"
17
17
  },
18
+ "nameAndDirectoryFormat": {
19
+ "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`).",
20
+ "type": "string",
21
+ "enum": ["as-provided", "derived"]
22
+ },
18
23
  "project": {
19
24
  "description": "The Nest project to target.",
20
25
  "type": "string",
@@ -22,10 +27,10 @@
22
27
  "$source": "projectName"
23
28
  },
24
29
  "alias": "p",
25
- "x-prompt": "What Nest project would you like to target?"
30
+ "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."
26
31
  },
27
32
  "directory": {
28
- "description": "Directory where the generated files are placed.",
33
+ "description": "Directory where the generated files are placed. when `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. otherwise, it will be relative to the workspace root.",
29
34
  "type": "string",
30
35
  "aliases": ["dir", "path"]
31
36
  },
@@ -43,6 +48,7 @@
43
48
  },
44
49
  "flat": {
45
50
  "description": "Flag to indicate if a directory is created.",
51
+ "x-deprecated": "provide the `directory` option instead and use the `as-provided` format. it will be removed in nx v18.",
46
52
  "type": "boolean",
47
53
  "default": true
48
54
  },
@@ -53,5 +59,5 @@
53
59
  }
54
60
  },
55
61
  "additionalProperties": false,
56
- "required": ["name", "project"]
62
+ "required": ["name"]
57
63
  }
@@ -1,5 +1,6 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
3
3
  export type GuardGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
4
- export declare function guardGenerator(tree: Tree, rawOptions: GuardGeneratorOptions): Promise<any>;
4
+ export declare function guardGenerator(tree: Tree, rawOptions: GuardGeneratorOptions): Promise<void>;
5
+ export declare function guardGeneratorInternal(tree: Tree, rawOptions: GuardGeneratorOptions): Promise<any>;
5
6
  export default guardGenerator;
@@ -1,16 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.guardGenerator = void 0;
3
+ exports.guardGeneratorInternal = exports.guardGenerator = void 0;
4
4
  const utils_1 = require("../utils");
5
- function guardGenerator(tree, rawOptions) {
6
- const options = normalizeGuardOptions(tree, rawOptions);
7
- return (0, utils_1.runNestSchematic)(tree, 'guard', options);
5
+ async function guardGenerator(tree, rawOptions) {
6
+ await guardGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
8
10
  }
9
11
  exports.guardGenerator = guardGenerator;
12
+ async function guardGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeGuardOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'guard', options);
15
+ }
16
+ exports.guardGeneratorInternal = guardGeneratorInternal;
10
17
  exports.default = guardGenerator;
11
- function normalizeGuardOptions(tree, options) {
18
+ async function normalizeGuardOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'guard', '@nx/nest:guard', options);
12
20
  return {
13
- ...(0, utils_1.normalizeOptions)(tree, options),
21
+ ...normalizedOptions,
14
22
  language: options.language,
15
23
  spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
16
24
  };
@@ -15,6 +15,11 @@
15
15
  },
16
16
  "x-prompt": "What name would you like to use?"
17
17
  },
18
+ "nameAndDirectoryFormat": {
19
+ "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`).",
20
+ "type": "string",
21
+ "enum": ["as-provided", "derived"]
22
+ },
18
23
  "project": {
19
24
  "description": "The Nest project to target.",
20
25
  "type": "string",
@@ -22,10 +27,10 @@
22
27
  "$source": "projectName"
23
28
  },
24
29
  "alias": "p",
25
- "x-prompt": "What Nest project would you like to target?"
30
+ "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."
26
31
  },
27
32
  "directory": {
28
- "description": "Directory where the generated files are placed.",
33
+ "description": "Directory where the generated files are placed. when `--nameAndDirectoryFormat=as-provided`, it will be relative to the current working directory. otherwise, it will be relative to the workspace root.",
29
34
  "type": "string",
30
35
  "aliases": ["dir", "path"]
31
36
  },
@@ -43,6 +48,7 @@
43
48
  },
44
49
  "flat": {
45
50
  "description": "Flag to indicate if a directory is created.",
51
+ "x-deprecated": "provide the `directory` option instead and use the `as-provided` format. it will be removed in nx v18.",
46
52
  "type": "boolean",
47
53
  "default": true
48
54
  },
@@ -53,5 +59,5 @@
53
59
  }
54
60
  },
55
61
  "additionalProperties": false,
56
- "required": ["name", "project"]
62
+ "required": ["name"]
57
63
  }
@@ -1,5 +1,6 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
3
3
  export type InterceptorGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
4
- export declare function interceptorGenerator(tree: Tree, rawOptions: InterceptorGeneratorOptions): Promise<any>;
4
+ export declare function interceptorGenerator(tree: Tree, rawOptions: InterceptorGeneratorOptions): Promise<void>;
5
+ export declare function interceptorGeneratorInternal(tree: Tree, rawOptions: InterceptorGeneratorOptions): Promise<any>;
5
6
  export default interceptorGenerator;