@nx/nest 0.0.0-pr-22179-271588f

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 (119) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +68 -0
  3. package/generators.json +103 -0
  4. package/index.d.ts +18 -0
  5. package/index.js +39 -0
  6. package/migrations.json +76 -0
  7. package/package.json +46 -0
  8. package/src/generators/application/application.d.ts +5 -0
  9. package/src/generators/application/application.js +38 -0
  10. package/src/generators/application/files/app/app.controller.spec.ts__tmpl__ +22 -0
  11. package/src/generators/application/files/app/app.controller.ts__tmpl__ +13 -0
  12. package/src/generators/application/files/app/app.module.ts__tmpl__ +11 -0
  13. package/src/generators/application/files/app/app.service.spec.ts__tmpl__ +21 -0
  14. package/src/generators/application/files/app/app.service.ts__tmpl__ +8 -0
  15. package/src/generators/application/files/main.ts__tmpl__ +20 -0
  16. package/src/generators/application/lib/create-files.d.ts +3 -0
  17. package/src/generators/application/lib/create-files.js +12 -0
  18. package/src/generators/application/lib/index.d.ts +3 -0
  19. package/src/generators/application/lib/index.js +6 -0
  20. package/src/generators/application/lib/normalize-options.d.ts +5 -0
  21. package/src/generators/application/lib/normalize-options.js +53 -0
  22. package/src/generators/application/lib/update-tsconfig.d.ts +3 -0
  23. package/src/generators/application/lib/update-tsconfig.js +22 -0
  24. package/src/generators/application/schema.d.ts +25 -0
  25. package/src/generators/application/schema.json +86 -0
  26. package/src/generators/class/class.d.ts +6 -0
  27. package/src/generators/class/class.js +25 -0
  28. package/src/generators/class/schema.json +63 -0
  29. package/src/generators/controller/controller.d.ts +9 -0
  30. package/src/generators/controller/controller.js +27 -0
  31. package/src/generators/controller/schema.json +72 -0
  32. package/src/generators/decorator/decorator.d.ts +6 -0
  33. package/src/generators/decorator/decorator.js +24 -0
  34. package/src/generators/decorator/schema.json +57 -0
  35. package/src/generators/filter/filter.d.ts +6 -0
  36. package/src/generators/filter/filter.js +25 -0
  37. package/src/generators/filter/schema.json +63 -0
  38. package/src/generators/gateway/gateway.d.ts +6 -0
  39. package/src/generators/gateway/gateway.js +25 -0
  40. package/src/generators/gateway/schema.json +63 -0
  41. package/src/generators/guard/guard.d.ts +6 -0
  42. package/src/generators/guard/guard.js +25 -0
  43. package/src/generators/guard/schema.json +63 -0
  44. package/src/generators/init/init.d.ts +4 -0
  45. package/src/generators/init/init.js +17 -0
  46. package/src/generators/init/lib/add-dependencies.d.ts +3 -0
  47. package/src/generators/init/lib/add-dependencies.js +12 -0
  48. package/src/generators/init/lib/index.d.ts +1 -0
  49. package/src/generators/init/lib/index.js +4 -0
  50. package/src/generators/init/schema.d.ts +7 -0
  51. package/src/generators/init/schema.json +28 -0
  52. package/src/generators/interceptor/interceptor.d.ts +6 -0
  53. package/src/generators/interceptor/interceptor.js +25 -0
  54. package/src/generators/interceptor/schema.json +63 -0
  55. package/src/generators/interface/interface.d.ts +6 -0
  56. package/src/generators/interface/interface.js +17 -0
  57. package/src/generators/interface/schema.json +52 -0
  58. package/src/generators/library/files/common/src/lib/__fileName__.module.ts__tmpl__ +11 -0
  59. package/src/generators/library/files/controller/src/lib/__fileName__.controller.spec.ts__tmpl__ +20 -0
  60. package/src/generators/library/files/controller/src/lib/__fileName__.controller.ts__tmpl__ +7 -0
  61. package/src/generators/library/files/service/src/lib/__fileName__.service.spec.ts__tmpl__ +18 -0
  62. package/src/generators/library/files/service/src/lib/__fileName__.service.ts__tmpl__ +4 -0
  63. package/src/generators/library/lib/add-exports-to-barrel.d.ts +3 -0
  64. package/src/generators/library/lib/add-exports-to-barrel.js +25 -0
  65. package/src/generators/library/lib/add-project.d.ts +3 -0
  66. package/src/generators/library/lib/add-project.js +23 -0
  67. package/src/generators/library/lib/create-files.d.ts +3 -0
  68. package/src/generators/library/lib/create-files.js +27 -0
  69. package/src/generators/library/lib/delete-files.d.ts +3 -0
  70. package/src/generators/library/lib/delete-files.js +14 -0
  71. package/src/generators/library/lib/index.d.ts +6 -0
  72. package/src/generators/library/lib/index.js +9 -0
  73. package/src/generators/library/lib/normalize-options.d.ts +5 -0
  74. package/src/generators/library/lib/normalize-options.js +68 -0
  75. package/src/generators/library/lib/update-tsconfig.d.ts +3 -0
  76. package/src/generators/library/lib/update-tsconfig.js +22 -0
  77. package/src/generators/library/library.d.ts +5 -0
  78. package/src/generators/library/library.js +40 -0
  79. package/src/generators/library/schema.d.ts +46 -0
  80. package/src/generators/library/schema.json +147 -0
  81. package/src/generators/middleware/middleware.d.ts +6 -0
  82. package/src/generators/middleware/middleware.js +25 -0
  83. package/src/generators/middleware/schema.json +63 -0
  84. package/src/generators/module/module.d.ts +9 -0
  85. package/src/generators/module/module.js +26 -0
  86. package/src/generators/module/schema.json +67 -0
  87. package/src/generators/pipe/pipe.d.ts +6 -0
  88. package/src/generators/pipe/pipe.js +25 -0
  89. package/src/generators/pipe/schema.json +63 -0
  90. package/src/generators/provider/provider.d.ts +6 -0
  91. package/src/generators/provider/provider.js +25 -0
  92. package/src/generators/provider/schema.json +63 -0
  93. package/src/generators/resolver/resolver.d.ts +6 -0
  94. package/src/generators/resolver/resolver.js +25 -0
  95. package/src/generators/resolver/schema.json +58 -0
  96. package/src/generators/resource/resource.d.ts +6 -0
  97. package/src/generators/resource/resource.js +25 -0
  98. package/src/generators/resource/schema.json +107 -0
  99. package/src/generators/service/schema.json +63 -0
  100. package/src/generators/service/service.d.ts +6 -0
  101. package/src/generators/service/service.js +25 -0
  102. package/src/generators/utils/index.d.ts +3 -0
  103. package/src/generators/utils/index.js +6 -0
  104. package/src/generators/utils/normalize-options.d.ts +4 -0
  105. package/src/generators/utils/normalize-options.js +28 -0
  106. package/src/generators/utils/run-nest-schematic.d.ts +3 -0
  107. package/src/generators/utils/run-nest-schematic.js +15 -0
  108. package/src/generators/utils/testing.d.ts +2 -0
  109. package/src/generators/utils/testing.js +16 -0
  110. package/src/generators/utils/types.d.ts +40 -0
  111. package/src/generators/utils/types.js +2 -0
  112. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
  113. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +9 -0
  114. package/src/migrations/update-16-4-0-cache-manager/nestjs-10-updates.d.ts +5 -0
  115. package/src/migrations/update-16-4-0-cache-manager/nestjs-10-updates.js +81 -0
  116. package/src/utils/ensure-dependencies.d.ts +2 -0
  117. package/src/utils/ensure-dependencies.js +18 -0
  118. package/src/utils/versions.d.ts +6 -0
  119. package/src/utils/versions.js +9 -0
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.libraryGeneratorInternal = exports.libraryGenerator = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const js_1 = require("@nx/js");
6
+ const lib_1 = require("./lib");
7
+ const init_1 = require("../init/init");
8
+ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
9
+ const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
10
+ async function libraryGenerator(tree, rawOptions) {
11
+ return await libraryGeneratorInternal(tree, {
12
+ addPlugin: false,
13
+ projectNameAndRootFormat: 'derived',
14
+ ...rawOptions,
15
+ });
16
+ }
17
+ exports.libraryGenerator = libraryGenerator;
18
+ async function libraryGeneratorInternal(tree, rawOptions) {
19
+ const options = await (0, lib_1.normalizeOptions)(tree, rawOptions);
20
+ await (0, js_1.libraryGenerator)(tree, (0, lib_1.toJsLibraryGeneratorOptions)(options));
21
+ const initTask = await (0, init_1.default)(tree, rawOptions);
22
+ const depsTask = (0, ensure_dependencies_1.ensureDependencies)(tree);
23
+ (0, lib_1.deleteFiles)(tree, options);
24
+ (0, lib_1.createFiles)(tree, options);
25
+ (0, lib_1.addExportsToBarrelFile)(tree, options);
26
+ (0, lib_1.updateTsConfig)(tree, options);
27
+ (0, lib_1.addProject)(tree, options);
28
+ if (!options.skipFormat) {
29
+ await (0, devkit_1.formatFiles)(tree);
30
+ }
31
+ return (0, devkit_1.runTasksInSerial)(...[
32
+ initTask,
33
+ depsTask,
34
+ () => {
35
+ (0, log_show_project_command_1.logShowProjectCommand)(options.projectName);
36
+ },
37
+ ]);
38
+ }
39
+ exports.libraryGeneratorInternal = libraryGeneratorInternal;
40
+ exports.default = libraryGenerator;
@@ -0,0 +1,46 @@
1
+ import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
2
+ import type { Linter } from '@nx/eslint';
3
+ import type { UnitTestRunner } from '../utils';
4
+
5
+ export interface LibraryGeneratorOptions {
6
+ name: string;
7
+ buildable?: boolean;
8
+ controller?: boolean;
9
+ directory?: string;
10
+ projectNameAndRootFormat?: ProjectNameAndRootFormat;
11
+ global?: boolean;
12
+ importPath?: string;
13
+ linter?: Linter;
14
+ publishable?: boolean;
15
+ service?: boolean;
16
+ skipFormat?: boolean;
17
+ skipTsConfig?: boolean;
18
+ strict?: boolean;
19
+ tags?: string;
20
+ target?:
21
+ | 'es5'
22
+ | 'es6'
23
+ | 'esnext'
24
+ | 'es2015'
25
+ | 'es2016'
26
+ | 'es2017'
27
+ | 'es2018'
28
+ | 'es2019'
29
+ | 'es2020'
30
+ | 'es2021';
31
+ testEnvironment?: 'jsdom' | 'node';
32
+ unitTestRunner?: UnitTestRunner;
33
+ standaloneConfig?: boolean;
34
+ setParserOptionsProject?: boolean;
35
+ skipPackageJson?: boolean;
36
+ simpleName?: boolean;
37
+ addPlugin?: boolean;
38
+ }
39
+
40
+ export interface NormalizedOptions extends LibraryGeneratorOptions {
41
+ fileName: string;
42
+ parsedTags: string[];
43
+ prefix: string;
44
+ projectName: string;
45
+ projectRoot: Path;
46
+ }
@@ -0,0 +1,147 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxNestLibraryGenerator",
4
+ "title": "Create a NestJS Library for Nx",
5
+ "description": "Create a NestJS Library for Nx.",
6
+ "cli": "nx",
7
+ "type": "object",
8
+ "examples": [
9
+ {
10
+ "command": "nx g lib mylib --directory=myapp",
11
+ "description": "Generate libs/myapp/mylib"
12
+ }
13
+ ],
14
+ "properties": {
15
+ "name": {
16
+ "description": "Library name.",
17
+ "type": "string",
18
+ "$default": {
19
+ "$source": "argv",
20
+ "index": 0
21
+ },
22
+ "x-prompt": "What name would you like to use for the library?",
23
+ "pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$"
24
+ },
25
+ "directory": {
26
+ "description": "A directory where the library is placed.",
27
+ "type": "string",
28
+ "alias": "dir"
29
+ },
30
+ "projectNameAndRootFormat": {
31
+ "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`).",
32
+ "type": "string",
33
+ "enum": ["as-provided", "derived"]
34
+ },
35
+ "linter": {
36
+ "description": "The tool to use for running lint checks.",
37
+ "type": "string",
38
+ "enum": ["eslint", "none"],
39
+ "default": "eslint"
40
+ },
41
+ "unitTestRunner": {
42
+ "description": "Test runner to use for unit tests.",
43
+ "type": "string",
44
+ "enum": ["jest", "none"],
45
+ "default": "jest"
46
+ },
47
+ "tags": {
48
+ "description": "Add tags to the library (used for linting).",
49
+ "type": "string",
50
+ "alias": "t"
51
+ },
52
+ "skipFormat": {
53
+ "description": "Skip formatting files.",
54
+ "type": "boolean",
55
+ "default": false,
56
+ "x-priority": "internal"
57
+ },
58
+ "skipTsConfig": {
59
+ "description": "Do not update tsconfig.base.json for development experience.",
60
+ "type": "boolean",
61
+ "default": false,
62
+ "x-priority": "internal"
63
+ },
64
+ "publishable": {
65
+ "description": "Create a publishable library.",
66
+ "type": "boolean",
67
+ "x-priority": "important"
68
+ },
69
+ "buildable": {
70
+ "description": "Generate a buildable library.",
71
+ "type": "boolean",
72
+ "default": false,
73
+ "x-priority": "important"
74
+ },
75
+ "importPath": {
76
+ "description": "The library name used to import it, like @myorg/my-awesome-lib. Must be a valid npm name.",
77
+ "type": "string"
78
+ },
79
+ "global": {
80
+ "description": "Add the Global decorator to the generated module.",
81
+ "type": "boolean",
82
+ "default": false
83
+ },
84
+ "service": {
85
+ "description": "Include a service with the library.",
86
+ "type": "boolean",
87
+ "default": false
88
+ },
89
+ "controller": {
90
+ "description": "Include a controller with the library.",
91
+ "type": "boolean",
92
+ "default": false
93
+ },
94
+ "testEnvironment": {
95
+ "description": "The test environment for jest, for node applications this should stay as node unless doing DOM testing.",
96
+ "type": "string",
97
+ "enum": ["jsdom", "node"],
98
+ "default": "node"
99
+ },
100
+ "target": {
101
+ "description": "The ES target, Nest suggest using es2021 or higher.",
102
+ "type": "string",
103
+ "default": "es2021",
104
+ "enum": [
105
+ "es5",
106
+ "es6",
107
+ "esnext",
108
+ "es2015",
109
+ "es2016",
110
+ "es2017",
111
+ "es2018",
112
+ "es2019",
113
+ "es2020",
114
+ "es2021"
115
+ ]
116
+ },
117
+ "strict": {
118
+ "description": "Whether to enable tsconfig strict mode or not.",
119
+ "type": "boolean",
120
+ "default": true
121
+ },
122
+ "standaloneConfig": {
123
+ "description": "Split the project configuration into <projectRoot>/project.json rather than including it inside workspace.json",
124
+ "type": "boolean",
125
+ "default": true,
126
+ "x-deprecated": "Nx only supports standaloneConfig"
127
+ },
128
+ "setParserOptionsProject": {
129
+ "type": "boolean",
130
+ "description": "Whether or not to configure the ESLint \"parserOptions.project\" option. We do not do this by default for lint performance reasons.",
131
+ "default": false
132
+ },
133
+ "skipPackageJson": {
134
+ "description": "Do not add dependencies to `package.json`.",
135
+ "type": "boolean",
136
+ "default": false,
137
+ "x-priority": "internal"
138
+ },
139
+ "simpleName": {
140
+ "description": "Don't include the directory in the name of the module of the library.",
141
+ "type": "boolean",
142
+ "default": false
143
+ }
144
+ },
145
+ "additionalProperties": false,
146
+ "required": ["name"]
147
+ }
@@ -0,0 +1,6 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
3
+ export type MiddlewareGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
4
+ export declare function middlewareGenerator(tree: Tree, rawOptions: MiddlewareGeneratorOptions): Promise<void>;
5
+ export declare function middlewareGeneratorInternal(tree: Tree, rawOptions: MiddlewareGeneratorOptions): Promise<any>;
6
+ export default middlewareGenerator;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.middlewareGeneratorInternal = exports.middlewareGenerator = void 0;
4
+ const utils_1 = require("../utils");
5
+ async function middlewareGenerator(tree, rawOptions) {
6
+ await middlewareGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
10
+ }
11
+ exports.middlewareGenerator = middlewareGenerator;
12
+ async function middlewareGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeMiddlewareOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'middleware', options);
15
+ }
16
+ exports.middlewareGeneratorInternal = middlewareGeneratorInternal;
17
+ exports.default = middlewareGenerator;
18
+ async function normalizeMiddlewareOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'middleware', '@nx/nest:middleware', options);
20
+ return {
21
+ ...normalizedOptions,
22
+ language: options.language,
23
+ spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
24
+ };
25
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxNestMiddlewareGenerator",
4
+ "title": "Nest Middleware Options Schema",
5
+ "description": "Nest Middleware Options Schema.",
6
+ "cli": "nx",
7
+ "type": "object",
8
+ "properties": {
9
+ "name": {
10
+ "description": "The name of the middleware.",
11
+ "type": "string",
12
+ "$default": {
13
+ "$source": "argv",
14
+ "index": 0
15
+ },
16
+ "x-prompt": "What name would you like to use?"
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
+ },
23
+ "project": {
24
+ "description": "The Nest project to target.",
25
+ "type": "string",
26
+ "$default": {
27
+ "$source": "projectName"
28
+ },
29
+ "alias": "p",
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 v19."
31
+ },
32
+ "directory": {
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.",
34
+ "type": "string",
35
+ "aliases": ["dir", "path"]
36
+ },
37
+ "skipFormat": {
38
+ "description": "Skip formatting files.",
39
+ "type": "boolean",
40
+ "default": false,
41
+ "x-priority": "internal"
42
+ },
43
+ "unitTestRunner": {
44
+ "description": "Test runner to use for unit tests.",
45
+ "type": "string",
46
+ "enum": ["jest", "none"],
47
+ "default": "jest"
48
+ },
49
+ "flat": {
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 v19.",
52
+ "type": "boolean",
53
+ "default": true
54
+ },
55
+ "language": {
56
+ "description": "Nest middleware language.",
57
+ "type": "string",
58
+ "enum": ["js", "ts"]
59
+ }
60
+ },
61
+ "additionalProperties": false,
62
+ "required": ["name"]
63
+ }
@@ -0,0 +1,9 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ import type { NestGeneratorWithLanguageOption } from '../utils';
3
+ export type ModuleGeneratorOptions = NestGeneratorWithLanguageOption & {
4
+ module?: string;
5
+ skipImport?: boolean;
6
+ };
7
+ export declare function moduleGenerator(tree: Tree, rawOptions: ModuleGeneratorOptions): Promise<void>;
8
+ export declare function moduleGeneratorInternal(tree: Tree, rawOptions: ModuleGeneratorOptions): Promise<any>;
9
+ export default moduleGenerator;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.moduleGeneratorInternal = exports.moduleGenerator = void 0;
4
+ const utils_1 = require("../utils");
5
+ async function moduleGenerator(tree, rawOptions) {
6
+ await moduleGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
10
+ }
11
+ exports.moduleGenerator = moduleGenerator;
12
+ async function moduleGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeModuleOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'module', options);
15
+ }
16
+ exports.moduleGeneratorInternal = moduleGeneratorInternal;
17
+ exports.default = moduleGenerator;
18
+ async function normalizeModuleOptions(tree, options) {
19
+ const normalizedOption = await (0, utils_1.normalizeOptions)(tree, 'module', '@nx/nest:module', options);
20
+ return {
21
+ ...normalizedOption,
22
+ language: options.language,
23
+ module: options.module,
24
+ skipImport: options.skipImport,
25
+ };
26
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxNestModuleGenerator",
4
+ "title": "Nest Module Options Schema",
5
+ "description": "Nest Module Options Schema.",
6
+ "cli": "nx",
7
+ "type": "object",
8
+ "properties": {
9
+ "name": {
10
+ "description": "The name of the module.",
11
+ "type": "string",
12
+ "$default": {
13
+ "$source": "argv",
14
+ "index": 0
15
+ },
16
+ "x-prompt": "What name would you like to use?"
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
+ },
23
+ "project": {
24
+ "description": "The Nest project to target.",
25
+ "type": "string",
26
+ "$default": {
27
+ "$source": "projectName"
28
+ },
29
+ "alias": "p",
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 v19."
31
+ },
32
+ "directory": {
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.",
34
+ "type": "string",
35
+ "aliases": ["dir", "path"]
36
+ },
37
+ "skipFormat": {
38
+ "description": "Skip formatting files.",
39
+ "type": "boolean",
40
+ "default": false,
41
+ "x-priority": "internal"
42
+ },
43
+ "flat": {
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 v19.",
46
+ "type": "boolean",
47
+ "default": false
48
+ },
49
+ "language": {
50
+ "description": "Nest module language.",
51
+ "type": "string",
52
+ "enum": ["js", "ts"]
53
+ },
54
+ "module": {
55
+ "description": "The path to import the module.",
56
+ "type": "string",
57
+ "format": "path"
58
+ },
59
+ "skipImport": {
60
+ "description": "Flag to skip the module import.",
61
+ "type": "boolean",
62
+ "default": false
63
+ }
64
+ },
65
+ "additionalProperties": false,
66
+ "required": ["name"]
67
+ }
@@ -0,0 +1,6 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
3
+ export type PipeGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
4
+ export declare function pipeGenerator(tree: Tree, rawOptions: PipeGeneratorOptions): Promise<void>;
5
+ export declare function pipeGeneratorInternal(tree: Tree, rawOptions: PipeGeneratorOptions): Promise<any>;
6
+ export default pipeGenerator;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pipeGeneratorInternal = exports.pipeGenerator = void 0;
4
+ const utils_1 = require("../utils");
5
+ async function pipeGenerator(tree, rawOptions) {
6
+ await pipeGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
10
+ }
11
+ exports.pipeGenerator = pipeGenerator;
12
+ async function pipeGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizePipeOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'pipe', options);
15
+ }
16
+ exports.pipeGeneratorInternal = pipeGeneratorInternal;
17
+ exports.default = pipeGenerator;
18
+ async function normalizePipeOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'pipe', '@nx/nest:pipe', options);
20
+ return {
21
+ ...normalizedOptions,
22
+ language: options.language,
23
+ spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
24
+ };
25
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxNestPipeGenerator",
4
+ "title": "Nest Pipe Options Schema",
5
+ "description": "Nest Pipe Options Schema.",
6
+ "cli": "nx",
7
+ "type": "object",
8
+ "properties": {
9
+ "name": {
10
+ "description": "The name of the pipe.",
11
+ "type": "string",
12
+ "$default": {
13
+ "$source": "argv",
14
+ "index": 0
15
+ },
16
+ "x-prompt": "What name would you like to use?"
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
+ },
23
+ "project": {
24
+ "description": "The Nest project to target.",
25
+ "type": "string",
26
+ "$default": {
27
+ "$source": "projectName"
28
+ },
29
+ "alias": "p",
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 v19."
31
+ },
32
+ "directory": {
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.",
34
+ "type": "string",
35
+ "aliases": ["dir", "path"]
36
+ },
37
+ "skipFormat": {
38
+ "description": "Skip formatting files.",
39
+ "type": "boolean",
40
+ "default": false,
41
+ "x-priority": "internal"
42
+ },
43
+ "unitTestRunner": {
44
+ "description": "Test runner to use for unit tests.",
45
+ "type": "string",
46
+ "enum": ["jest", "none"],
47
+ "default": "jest"
48
+ },
49
+ "flat": {
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 v19.",
52
+ "type": "boolean",
53
+ "default": true
54
+ },
55
+ "language": {
56
+ "description": "Nest pipe language.",
57
+ "type": "string",
58
+ "enum": ["js", "ts"]
59
+ }
60
+ },
61
+ "additionalProperties": false,
62
+ "required": ["name"]
63
+ }
@@ -0,0 +1,6 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
3
+ export type ProviderGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
4
+ export declare function providerGenerator(tree: Tree, rawOptions: ProviderGeneratorOptions): Promise<void>;
5
+ export declare function providerGeneratorInternal(tree: Tree, rawOptions: ProviderGeneratorOptions): Promise<any>;
6
+ export default providerGenerator;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.providerGeneratorInternal = exports.providerGenerator = void 0;
4
+ const utils_1 = require("../utils");
5
+ async function providerGenerator(tree, rawOptions) {
6
+ await providerGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
10
+ }
11
+ exports.providerGenerator = providerGenerator;
12
+ async function providerGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeProviderOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'provider', options);
15
+ }
16
+ exports.providerGeneratorInternal = providerGeneratorInternal;
17
+ exports.default = providerGenerator;
18
+ async function normalizeProviderOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'provider', '@nx/nest:provider', options);
20
+ return {
21
+ ...normalizedOptions,
22
+ language: options.language,
23
+ spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
24
+ };
25
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "NxNestProviderGenerator",
4
+ "title": "Nest Provider Options Schema",
5
+ "description": "Nest Provider Options Schema.",
6
+ "cli": "nx",
7
+ "type": "object",
8
+ "properties": {
9
+ "name": {
10
+ "description": "The name of the provider.",
11
+ "type": "string",
12
+ "$default": {
13
+ "$source": "argv",
14
+ "index": 0
15
+ },
16
+ "x-prompt": "What name would you like to use?"
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
+ },
23
+ "project": {
24
+ "description": "The Nest project to target.",
25
+ "type": "string",
26
+ "$default": {
27
+ "$source": "projectName"
28
+ },
29
+ "alias": "p",
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 v19."
31
+ },
32
+ "directory": {
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.",
34
+ "type": "string",
35
+ "aliases": ["dir", "path"]
36
+ },
37
+ "skipFormat": {
38
+ "description": "Skip formatting files.",
39
+ "type": "boolean",
40
+ "default": false,
41
+ "x-priority": "internal"
42
+ },
43
+ "unitTestRunner": {
44
+ "description": "Test runner to use for unit tests.",
45
+ "type": "string",
46
+ "enum": ["jest", "none"],
47
+ "default": "jest"
48
+ },
49
+ "flat": {
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 v19.",
52
+ "type": "boolean",
53
+ "default": true
54
+ },
55
+ "language": {
56
+ "description": "Nest provider language.",
57
+ "type": "string",
58
+ "enum": ["js", "ts"]
59
+ }
60
+ },
61
+ "additionalProperties": false,
62
+ "required": ["name"]
63
+ }
@@ -0,0 +1,6 @@
1
+ import type { Tree } from '@nx/devkit';
2
+ import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
3
+ export type ResolverGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
4
+ export declare function resolverGenerator(tree: Tree, rawOptions: ResolverGeneratorOptions): Promise<void>;
5
+ export declare function resolverGeneratorInternal(tree: Tree, rawOptions: ResolverGeneratorOptions): Promise<any>;
6
+ export default resolverGenerator;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolverGeneratorInternal = exports.resolverGenerator = void 0;
4
+ const utils_1 = require("../utils");
5
+ async function resolverGenerator(tree, rawOptions) {
6
+ await resolverGeneratorInternal(tree, {
7
+ nameAndDirectoryFormat: 'derived',
8
+ ...rawOptions,
9
+ });
10
+ }
11
+ exports.resolverGenerator = resolverGenerator;
12
+ async function resolverGeneratorInternal(tree, rawOptions) {
13
+ const options = await normalizeResolverOptions(tree, rawOptions);
14
+ return (0, utils_1.runNestSchematic)(tree, 'resolver', options);
15
+ }
16
+ exports.resolverGeneratorInternal = resolverGeneratorInternal;
17
+ exports.default = resolverGenerator;
18
+ async function normalizeResolverOptions(tree, options) {
19
+ const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'resolver', '@nx/nest:resolver', options);
20
+ return {
21
+ ...normalizedOptions,
22
+ language: options.language,
23
+ spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
24
+ };
25
+ }