@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.
- package/LICENSE +22 -0
- package/README.md +68 -0
- package/generators.json +103 -0
- package/index.d.ts +18 -0
- package/index.js +39 -0
- package/migrations.json +76 -0
- package/package.json +46 -0
- package/src/generators/application/application.d.ts +5 -0
- package/src/generators/application/application.js +38 -0
- package/src/generators/application/files/app/app.controller.spec.ts__tmpl__ +22 -0
- package/src/generators/application/files/app/app.controller.ts__tmpl__ +13 -0
- package/src/generators/application/files/app/app.module.ts__tmpl__ +11 -0
- package/src/generators/application/files/app/app.service.spec.ts__tmpl__ +21 -0
- package/src/generators/application/files/app/app.service.ts__tmpl__ +8 -0
- package/src/generators/application/files/main.ts__tmpl__ +20 -0
- package/src/generators/application/lib/create-files.d.ts +3 -0
- package/src/generators/application/lib/create-files.js +12 -0
- package/src/generators/application/lib/index.d.ts +3 -0
- package/src/generators/application/lib/index.js +6 -0
- package/src/generators/application/lib/normalize-options.d.ts +5 -0
- package/src/generators/application/lib/normalize-options.js +53 -0
- package/src/generators/application/lib/update-tsconfig.d.ts +3 -0
- package/src/generators/application/lib/update-tsconfig.js +22 -0
- package/src/generators/application/schema.d.ts +25 -0
- package/src/generators/application/schema.json +86 -0
- package/src/generators/class/class.d.ts +6 -0
- package/src/generators/class/class.js +25 -0
- package/src/generators/class/schema.json +63 -0
- package/src/generators/controller/controller.d.ts +9 -0
- package/src/generators/controller/controller.js +27 -0
- package/src/generators/controller/schema.json +72 -0
- package/src/generators/decorator/decorator.d.ts +6 -0
- package/src/generators/decorator/decorator.js +24 -0
- package/src/generators/decorator/schema.json +57 -0
- package/src/generators/filter/filter.d.ts +6 -0
- package/src/generators/filter/filter.js +25 -0
- package/src/generators/filter/schema.json +63 -0
- package/src/generators/gateway/gateway.d.ts +6 -0
- package/src/generators/gateway/gateway.js +25 -0
- package/src/generators/gateway/schema.json +63 -0
- package/src/generators/guard/guard.d.ts +6 -0
- package/src/generators/guard/guard.js +25 -0
- package/src/generators/guard/schema.json +63 -0
- package/src/generators/init/init.d.ts +4 -0
- package/src/generators/init/init.js +17 -0
- package/src/generators/init/lib/add-dependencies.d.ts +3 -0
- package/src/generators/init/lib/add-dependencies.js +12 -0
- package/src/generators/init/lib/index.d.ts +1 -0
- package/src/generators/init/lib/index.js +4 -0
- package/src/generators/init/schema.d.ts +7 -0
- package/src/generators/init/schema.json +28 -0
- package/src/generators/interceptor/interceptor.d.ts +6 -0
- package/src/generators/interceptor/interceptor.js +25 -0
- package/src/generators/interceptor/schema.json +63 -0
- package/src/generators/interface/interface.d.ts +6 -0
- package/src/generators/interface/interface.js +17 -0
- package/src/generators/interface/schema.json +52 -0
- package/src/generators/library/files/common/src/lib/__fileName__.module.ts__tmpl__ +11 -0
- package/src/generators/library/files/controller/src/lib/__fileName__.controller.spec.ts__tmpl__ +20 -0
- package/src/generators/library/files/controller/src/lib/__fileName__.controller.ts__tmpl__ +7 -0
- package/src/generators/library/files/service/src/lib/__fileName__.service.spec.ts__tmpl__ +18 -0
- package/src/generators/library/files/service/src/lib/__fileName__.service.ts__tmpl__ +4 -0
- package/src/generators/library/lib/add-exports-to-barrel.d.ts +3 -0
- package/src/generators/library/lib/add-exports-to-barrel.js +25 -0
- package/src/generators/library/lib/add-project.d.ts +3 -0
- package/src/generators/library/lib/add-project.js +23 -0
- package/src/generators/library/lib/create-files.d.ts +3 -0
- package/src/generators/library/lib/create-files.js +27 -0
- package/src/generators/library/lib/delete-files.d.ts +3 -0
- package/src/generators/library/lib/delete-files.js +14 -0
- package/src/generators/library/lib/index.d.ts +6 -0
- package/src/generators/library/lib/index.js +9 -0
- package/src/generators/library/lib/normalize-options.d.ts +5 -0
- package/src/generators/library/lib/normalize-options.js +68 -0
- package/src/generators/library/lib/update-tsconfig.d.ts +3 -0
- package/src/generators/library/lib/update-tsconfig.js +22 -0
- package/src/generators/library/library.d.ts +5 -0
- package/src/generators/library/library.js +40 -0
- package/src/generators/library/schema.d.ts +46 -0
- package/src/generators/library/schema.json +147 -0
- package/src/generators/middleware/middleware.d.ts +6 -0
- package/src/generators/middleware/middleware.js +25 -0
- package/src/generators/middleware/schema.json +63 -0
- package/src/generators/module/module.d.ts +9 -0
- package/src/generators/module/module.js +26 -0
- package/src/generators/module/schema.json +67 -0
- package/src/generators/pipe/pipe.d.ts +6 -0
- package/src/generators/pipe/pipe.js +25 -0
- package/src/generators/pipe/schema.json +63 -0
- package/src/generators/provider/provider.d.ts +6 -0
- package/src/generators/provider/provider.js +25 -0
- package/src/generators/provider/schema.json +63 -0
- package/src/generators/resolver/resolver.d.ts +6 -0
- package/src/generators/resolver/resolver.js +25 -0
- package/src/generators/resolver/schema.json +58 -0
- package/src/generators/resource/resource.d.ts +6 -0
- package/src/generators/resource/resource.js +25 -0
- package/src/generators/resource/schema.json +107 -0
- package/src/generators/service/schema.json +63 -0
- package/src/generators/service/service.d.ts +6 -0
- package/src/generators/service/service.js +25 -0
- package/src/generators/utils/index.d.ts +3 -0
- package/src/generators/utils/index.js +6 -0
- package/src/generators/utils/normalize-options.d.ts +4 -0
- package/src/generators/utils/normalize-options.js +28 -0
- package/src/generators/utils/run-nest-schematic.d.ts +3 -0
- package/src/generators/utils/run-nest-schematic.js +15 -0
- package/src/generators/utils/testing.d.ts +2 -0
- package/src/generators/utils/testing.js +16 -0
- package/src/generators/utils/types.d.ts +40 -0
- package/src/generators/utils/types.js +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +9 -0
- package/src/migrations/update-16-4-0-cache-manager/nestjs-10-updates.d.ts +5 -0
- package/src/migrations/update-16-4-0-cache-manager/nestjs-10-updates.js +81 -0
- package/src/utils/ensure-dependencies.d.ts +2 -0
- package/src/utils/ensure-dependencies.js +18 -0
- package/src/utils/versions.d.ts +6 -0
- package/src/utils/versions.js +9 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
|
2
|
+
import type { Linter } from '@nx/eslint';
|
|
3
|
+
|
|
4
|
+
export interface ApplicationGeneratorOptions {
|
|
5
|
+
name: string;
|
|
6
|
+
directory?: string;
|
|
7
|
+
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
|
8
|
+
frontendProject?: string;
|
|
9
|
+
linter?: Linter;
|
|
10
|
+
skipFormat?: boolean;
|
|
11
|
+
skipPackageJson?: boolean;
|
|
12
|
+
standaloneConfig?: boolean;
|
|
13
|
+
tags?: string;
|
|
14
|
+
unitTestRunner?: 'jest' | 'none';
|
|
15
|
+
e2eTestRunner?: 'jest' | 'none';
|
|
16
|
+
setParserOptionsProject?: boolean;
|
|
17
|
+
rootProject?: boolean;
|
|
18
|
+
strict?: boolean;
|
|
19
|
+
addPlugin?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface NormalizedOptions extends ApplicationGeneratorOptions {
|
|
23
|
+
appProjectName: string;
|
|
24
|
+
appProjectRoot: Path;
|
|
25
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "NxNestApplicationGenerator",
|
|
4
|
+
"title": "Nx Application Options Schema",
|
|
5
|
+
"description": "Nx Application Options Schema.",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"description": "The name of the application.",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"$default": {
|
|
13
|
+
"$source": "argv",
|
|
14
|
+
"index": 0
|
|
15
|
+
},
|
|
16
|
+
"x-prompt": "What name would you like to use for the node application?",
|
|
17
|
+
"pattern": "^[a-zA-Z][^:]*$"
|
|
18
|
+
},
|
|
19
|
+
"directory": {
|
|
20
|
+
"description": "The directory of the new application.",
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"projectNameAndRootFormat": {
|
|
24
|
+
"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`).",
|
|
25
|
+
"type": "string",
|
|
26
|
+
"enum": ["as-provided", "derived"]
|
|
27
|
+
},
|
|
28
|
+
"skipFormat": {
|
|
29
|
+
"description": "Skip formatting files.",
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"default": false,
|
|
32
|
+
"x-priority": "internal"
|
|
33
|
+
},
|
|
34
|
+
"skipPackageJson": {
|
|
35
|
+
"description": "Do not add dependencies to `package.json`.",
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": false,
|
|
38
|
+
"x-priority": "internal"
|
|
39
|
+
},
|
|
40
|
+
"linter": {
|
|
41
|
+
"description": "The tool to use for running lint checks.",
|
|
42
|
+
"type": "string",
|
|
43
|
+
"enum": ["eslint", "none"],
|
|
44
|
+
"default": "eslint"
|
|
45
|
+
},
|
|
46
|
+
"unitTestRunner": {
|
|
47
|
+
"description": "Test runner to use for unit tests.",
|
|
48
|
+
"type": "string",
|
|
49
|
+
"enum": ["jest", "none"],
|
|
50
|
+
"default": "jest"
|
|
51
|
+
},
|
|
52
|
+
"e2eTestRunner": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"enum": ["jest", "none"],
|
|
55
|
+
"description": "Test runner to use for end to end (e2e) tests",
|
|
56
|
+
"default": "jest"
|
|
57
|
+
},
|
|
58
|
+
"tags": {
|
|
59
|
+
"description": "Add tags to the application (used for linting).",
|
|
60
|
+
"type": "string"
|
|
61
|
+
},
|
|
62
|
+
"frontendProject": {
|
|
63
|
+
"description": "Frontend project that needs to access this application. This sets up proxy configuration.",
|
|
64
|
+
"type": "string",
|
|
65
|
+
"x-priority": "important"
|
|
66
|
+
},
|
|
67
|
+
"standaloneConfig": {
|
|
68
|
+
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
|
69
|
+
"type": "boolean",
|
|
70
|
+
"default": true,
|
|
71
|
+
"x-deprecated": "Nx only supports standaloneConfig"
|
|
72
|
+
},
|
|
73
|
+
"setParserOptionsProject": {
|
|
74
|
+
"type": "boolean",
|
|
75
|
+
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
76
|
+
"default": false
|
|
77
|
+
},
|
|
78
|
+
"strict": {
|
|
79
|
+
"type": "boolean",
|
|
80
|
+
"description": "Adds strictNullChecks, noImplicitAny, strictBindCallApply, forceConsistentCasingInFileNames and noFallthroughCasesInSwitch to tsconfig.",
|
|
81
|
+
"default": false
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"additionalProperties": false,
|
|
85
|
+
"required": ["name"]
|
|
86
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Tree } from '@nx/devkit';
|
|
2
|
+
import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
|
|
3
|
+
export type ClassGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
|
|
4
|
+
export declare function classGenerator(tree: Tree, rawOptions: ClassGeneratorOptions): Promise<void>;
|
|
5
|
+
export declare function classGeneratorInternal(tree: Tree, rawOptions: ClassGeneratorOptions): Promise<any>;
|
|
6
|
+
export default classGenerator;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.classGeneratorInternal = exports.classGenerator = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
async function classGenerator(tree, rawOptions) {
|
|
6
|
+
await classGeneratorInternal(tree, {
|
|
7
|
+
nameAndDirectoryFormat: 'derived',
|
|
8
|
+
...rawOptions,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
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;
|
|
17
|
+
exports.default = classGenerator;
|
|
18
|
+
async function normalizeClassOptions(tree, options) {
|
|
19
|
+
const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'class', '@nx/nest:class', 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": "NxNestClassGenerator",
|
|
4
|
+
"title": "Nest Class Options Schema",
|
|
5
|
+
"description": "Nest Class Options Schema.",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"description": "The name of the class.",
|
|
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 class 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, NestGeneratorWithTestOption } from '../utils';
|
|
3
|
+
export type ControllerGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption & {
|
|
4
|
+
module?: string;
|
|
5
|
+
skipImport?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function controllerGenerator(tree: Tree, rawOptions: ControllerGeneratorOptions): Promise<void>;
|
|
8
|
+
export declare function controllerGeneratorInternal(tree: Tree, rawOptions: ControllerGeneratorOptions): Promise<any>;
|
|
9
|
+
export default controllerGenerator;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.controllerGeneratorInternal = exports.controllerGenerator = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
async function controllerGenerator(tree, rawOptions) {
|
|
6
|
+
await controllerGeneratorInternal(tree, {
|
|
7
|
+
nameAndDirectoryFormat: 'derived',
|
|
8
|
+
...rawOptions,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
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;
|
|
17
|
+
exports.default = controllerGenerator;
|
|
18
|
+
async function normalizeControllerOptions(tree, options) {
|
|
19
|
+
const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'controller', '@nx/nest:controller', options);
|
|
20
|
+
return {
|
|
21
|
+
...normalizedOptions,
|
|
22
|
+
language: options.language,
|
|
23
|
+
module: options.module,
|
|
24
|
+
skipImport: options.skipImport,
|
|
25
|
+
spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "NxNestControllerGenerator",
|
|
4
|
+
"title": "Nest Controller Options Schema",
|
|
5
|
+
"description": "Nest Controller Options Schema.",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"description": "The name of the controller.",
|
|
11
|
+
"type": "string",
|
|
12
|
+
"$default": {
|
|
13
|
+
"$source": "argv",
|
|
14
|
+
"index": 0
|
|
15
|
+
},
|
|
16
|
+
"x-prompt": "What name would you like to use?"
|
|
17
|
+
},
|
|
18
|
+
"project": {
|
|
19
|
+
"description": "The Nest project to target.",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"$default": {
|
|
22
|
+
"$source": "projectName"
|
|
23
|
+
},
|
|
24
|
+
"alias": "p",
|
|
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 v19."
|
|
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"]
|
|
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": false
|
|
54
|
+
},
|
|
55
|
+
"language": {
|
|
56
|
+
"description": "Nest controller language.",
|
|
57
|
+
"type": "string",
|
|
58
|
+
"enum": ["js", "ts"]
|
|
59
|
+
},
|
|
60
|
+
"skipImport": {
|
|
61
|
+
"description": "Flag to skip the module import.",
|
|
62
|
+
"type": "boolean",
|
|
63
|
+
"default": false
|
|
64
|
+
},
|
|
65
|
+
"module": {
|
|
66
|
+
"description": "Allows specification of the declaring module.",
|
|
67
|
+
"type": "string"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"required": ["name"]
|
|
72
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Tree } from '@nx/devkit';
|
|
2
|
+
import type { NestGeneratorWithLanguageOption } from '../utils';
|
|
3
|
+
export type DecoratorGeneratorOptions = NestGeneratorWithLanguageOption;
|
|
4
|
+
export declare function decoratorGenerator(tree: Tree, rawOptions: DecoratorGeneratorOptions): Promise<void>;
|
|
5
|
+
export declare function decoratorGeneratorInternal(tree: Tree, rawOptions: DecoratorGeneratorOptions): Promise<any>;
|
|
6
|
+
export default decoratorGenerator;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decoratorGeneratorInternal = exports.decoratorGenerator = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
async function decoratorGenerator(tree, rawOptions) {
|
|
6
|
+
await decoratorGeneratorInternal(tree, {
|
|
7
|
+
nameAndDirectoryFormat: 'derived',
|
|
8
|
+
...rawOptions,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
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;
|
|
17
|
+
exports.default = decoratorGenerator;
|
|
18
|
+
async function normalizeDecoratorOptions(tree, options) {
|
|
19
|
+
const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'decorator', '@nx/nest:decorator', options);
|
|
20
|
+
return {
|
|
21
|
+
...normalizedOptions,
|
|
22
|
+
language: options.language,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "NxNestDecoratorGenerator",
|
|
4
|
+
"title": "Nest Decorator Options Schema",
|
|
5
|
+
"description": "Nest Decorator Options Schema.",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"description": "The name of the decorator.",
|
|
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": true
|
|
48
|
+
},
|
|
49
|
+
"language": {
|
|
50
|
+
"description": "Nest decorator language.",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"enum": ["js", "ts"]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": ["name"]
|
|
57
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Tree } from '@nx/devkit';
|
|
2
|
+
import type { NestGeneratorWithLanguageOption, NestGeneratorWithTestOption } from '../utils';
|
|
3
|
+
export type FilterGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
|
|
4
|
+
export declare function filterGenerator(tree: Tree, rawOptions: FilterGeneratorOptions): Promise<void>;
|
|
5
|
+
export declare function filterGeneratorInternal(tree: Tree, rawOptions: FilterGeneratorOptions): Promise<any>;
|
|
6
|
+
export default filterGenerator;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterGeneratorInternal = exports.filterGenerator = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
async function filterGenerator(tree, rawOptions) {
|
|
6
|
+
await filterGeneratorInternal(tree, {
|
|
7
|
+
nameAndDirectoryFormat: 'derived',
|
|
8
|
+
...rawOptions,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
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;
|
|
17
|
+
exports.default = filterGenerator;
|
|
18
|
+
async function normalizeFilterOptions(tree, options) {
|
|
19
|
+
const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'filter', '@nx/nest:filter', 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": "NxNestFilterGenerator",
|
|
4
|
+
"title": "Nest Filter Options Schema",
|
|
5
|
+
"description": "Nest Filter Options Schema.",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"description": "The name of the filter.",
|
|
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
|
+
"type": "boolean",
|
|
39
|
+
"description": "Skip formatting files.",
|
|
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 filter 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 GatewayGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
|
|
4
|
+
export declare function gatewayGenerator(tree: Tree, rawOptions: GatewayGeneratorOptions): Promise<void>;
|
|
5
|
+
export declare function gatewayGeneratorInternal(tree: Tree, rawOptions: GatewayGeneratorOptions): Promise<any>;
|
|
6
|
+
export default gatewayGenerator;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.gatewayGeneratorInternal = exports.gatewayGenerator = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
async function gatewayGenerator(tree, rawOptions) {
|
|
6
|
+
await gatewayGeneratorInternal(tree, {
|
|
7
|
+
nameAndDirectoryFormat: 'derived',
|
|
8
|
+
...rawOptions,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
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;
|
|
17
|
+
exports.default = gatewayGenerator;
|
|
18
|
+
async function normalizeGatewayOptions(tree, options) {
|
|
19
|
+
const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'gateway', '@nx/nest:gateway', 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": "NxNestGatewayGenerator",
|
|
4
|
+
"title": "Nest Gateway Options Schema",
|
|
5
|
+
"description": "Nest Gateway Options Schema.",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": {
|
|
10
|
+
"description": "The name of the gateway.",
|
|
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 gateway 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 GuardGeneratorOptions = NestGeneratorWithLanguageOption & NestGeneratorWithTestOption;
|
|
4
|
+
export declare function guardGenerator(tree: Tree, rawOptions: GuardGeneratorOptions): Promise<void>;
|
|
5
|
+
export declare function guardGeneratorInternal(tree: Tree, rawOptions: GuardGeneratorOptions): Promise<any>;
|
|
6
|
+
export default guardGenerator;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.guardGeneratorInternal = exports.guardGenerator = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
async function guardGenerator(tree, rawOptions) {
|
|
6
|
+
await guardGeneratorInternal(tree, {
|
|
7
|
+
nameAndDirectoryFormat: 'derived',
|
|
8
|
+
...rawOptions,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
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;
|
|
17
|
+
exports.default = guardGenerator;
|
|
18
|
+
async function normalizeGuardOptions(tree, options) {
|
|
19
|
+
const normalizedOptions = await (0, utils_1.normalizeOptions)(tree, 'guard', '@nx/nest:guard', options);
|
|
20
|
+
return {
|
|
21
|
+
...normalizedOptions,
|
|
22
|
+
language: options.language,
|
|
23
|
+
spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner),
|
|
24
|
+
};
|
|
25
|
+
}
|