@nx/nest 16.0.0-beta.1
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/CHANGELOG.md +8 -0
- package/LICENSE +22 -0
- package/README.md +63 -0
- package/generators.json +211 -0
- package/index.d.ts +19 -0
- package/index.js +42 -0
- package/index.js.map +1 -0
- package/migrations.json +47 -0
- package/package.json +46 -0
- package/src/generators/application/application.d.ts +5 -0
- package/src/generators/application/application.js +29 -0
- package/src/generators/application/application.js.map +1 -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 +13 -0
- package/src/generators/application/lib/create-files.js.map +1 -0
- package/src/generators/application/lib/index.d.ts +3 -0
- package/src/generators/application/lib/index.js +7 -0
- package/src/generators/application/lib/index.js.map +1 -0
- package/src/generators/application/lib/normalize-options.d.ts +5 -0
- package/src/generators/application/lib/normalize-options.js +38 -0
- package/src/generators/application/lib/normalize-options.js.map +1 -0
- package/src/generators/application/lib/update-tsconfig.d.ts +3 -0
- package/src/generators/application/lib/update-tsconfig.js +13 -0
- package/src/generators/application/lib/update-tsconfig.js.map +1 -0
- package/src/generators/application/schema.d.ts +20 -0
- package/src/generators/application/schema.json +75 -0
- package/src/generators/class/class.d.ts +6 -0
- package/src/generators/class/class.js +16 -0
- package/src/generators/class/class.js.map +1 -0
- package/src/generators/class/schema.json +57 -0
- package/src/generators/controller/controller.d.ts +9 -0
- package/src/generators/controller/controller.js +16 -0
- package/src/generators/controller/controller.js.map +1 -0
- package/src/generators/controller/schema.json +66 -0
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.d.ts +4 -0
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js +128 -0
- package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js.map +1 -0
- package/src/generators/convert-tslint-to-eslint/schema.json +44 -0
- package/src/generators/decorator/decorator.d.ts +6 -0
- package/src/generators/decorator/decorator.js +16 -0
- package/src/generators/decorator/decorator.js.map +1 -0
- package/src/generators/decorator/schema.json +51 -0
- package/src/generators/filter/filter.d.ts +6 -0
- package/src/generators/filter/filter.js +16 -0
- package/src/generators/filter/filter.js.map +1 -0
- package/src/generators/filter/schema.json +57 -0
- package/src/generators/gateway/gateway.d.ts +6 -0
- package/src/generators/gateway/gateway.js +16 -0
- package/src/generators/gateway/gateway.js.map +1 -0
- package/src/generators/gateway/schema.json +57 -0
- package/src/generators/guard/guard.d.ts +6 -0
- package/src/generators/guard/guard.js +16 -0
- package/src/generators/guard/guard.js.map +1 -0
- package/src/generators/guard/schema.json +57 -0
- package/src/generators/init/init.d.ts +5 -0
- package/src/generators/init/init.js +27 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/lib/add-dependencies.d.ts +2 -0
- package/src/generators/init/lib/add-dependencies.js +21 -0
- package/src/generators/init/lib/add-dependencies.js.map +1 -0
- package/src/generators/init/lib/index.d.ts +2 -0
- package/src/generators/init/lib/index.js +6 -0
- package/src/generators/init/lib/index.js.map +1 -0
- package/src/generators/init/lib/normalize-options.d.ts +2 -0
- package/src/generators/init/lib/normalize-options.js +9 -0
- package/src/generators/init/lib/normalize-options.js.map +1 -0
- package/src/generators/init/schema.d.ts +7 -0
- package/src/generators/init/schema.json +29 -0
- package/src/generators/interceptor/interceptor.d.ts +6 -0
- package/src/generators/interceptor/interceptor.js +16 -0
- package/src/generators/interceptor/interceptor.js.map +1 -0
- package/src/generators/interceptor/schema.json +57 -0
- package/src/generators/interface/interface.d.ts +6 -0
- package/src/generators/interface/interface.js +13 -0
- package/src/generators/interface/interface.js.map +1 -0
- package/src/generators/interface/schema.json +46 -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 +24 -0
- package/src/generators/library/lib/add-exports-to-barrel.js.map +1 -0
- package/src/generators/library/lib/add-project.d.ts +3 -0
- package/src/generators/library/lib/add-project.js +26 -0
- package/src/generators/library/lib/add-project.js.map +1 -0
- package/src/generators/library/lib/create-files.d.ts +3 -0
- package/src/generators/library/lib/create-files.js +22 -0
- package/src/generators/library/lib/create-files.js.map +1 -0
- package/src/generators/library/lib/delete-files.d.ts +3 -0
- package/src/generators/library/lib/delete-files.js +15 -0
- package/src/generators/library/lib/delete-files.js.map +1 -0
- package/src/generators/library/lib/index.d.ts +6 -0
- package/src/generators/library/lib/index.js +10 -0
- package/src/generators/library/lib/index.js.map +1 -0
- package/src/generators/library/lib/normalize-options.d.ts +5 -0
- package/src/generators/library/lib/normalize-options.js +46 -0
- package/src/generators/library/lib/normalize-options.js.map +1 -0
- package/src/generators/library/lib/update-tsconfig.d.ts +3 -0
- package/src/generators/library/lib/update-tsconfig.js +16 -0
- package/src/generators/library/lib/update-tsconfig.js.map +1 -0
- package/src/generators/library/library.d.ts +5 -0
- package/src/generators/library/library.js +28 -0
- package/src/generators/library/library.js.map +1 -0
- package/src/generators/library/schema.d.ts +43 -0
- package/src/generators/library/schema.json +135 -0
- package/src/generators/middleware/middleware.d.ts +6 -0
- package/src/generators/middleware/middleware.js +16 -0
- package/src/generators/middleware/middleware.js.map +1 -0
- package/src/generators/middleware/schema.json +57 -0
- package/src/generators/module/module.d.ts +9 -0
- package/src/generators/module/module.js +16 -0
- package/src/generators/module/module.js.map +1 -0
- package/src/generators/module/schema.json +61 -0
- package/src/generators/pipe/pipe.d.ts +6 -0
- package/src/generators/pipe/pipe.js +16 -0
- package/src/generators/pipe/pipe.js.map +1 -0
- package/src/generators/pipe/schema.json +57 -0
- package/src/generators/provider/provider.d.ts +6 -0
- package/src/generators/provider/provider.js +16 -0
- package/src/generators/provider/provider.js.map +1 -0
- package/src/generators/provider/schema.json +57 -0
- package/src/generators/resolver/resolver.d.ts +6 -0
- package/src/generators/resolver/resolver.js +16 -0
- package/src/generators/resolver/resolver.js.map +1 -0
- package/src/generators/resolver/schema.json +57 -0
- package/src/generators/resource/resource.d.ts +6 -0
- package/src/generators/resource/resource.js +16 -0
- package/src/generators/resource/resource.js.map +1 -0
- package/src/generators/resource/schema.json +106 -0
- package/src/generators/service/schema.json +57 -0
- package/src/generators/service/service.d.ts +6 -0
- package/src/generators/service/service.js +16 -0
- package/src/generators/service/service.js.map +1 -0
- package/src/generators/utils/index.d.ts +3 -0
- package/src/generators/utils/index.js +7 -0
- package/src/generators/utils/index.js.map +1 -0
- package/src/generators/utils/normalize-options.d.ts +4 -0
- package/src/generators/utils/normalize-options.js +15 -0
- package/src/generators/utils/normalize-options.js.map +1 -0
- package/src/generators/utils/run-nest-schematic.d.ts +3 -0
- package/src/generators/utils/run-nest-schematic.js +19 -0
- package/src/generators/utils/run-nest-schematic.js.map +1 -0
- package/src/generators/utils/testing.d.ts +2 -0
- package/src/generators/utils/testing.js +17 -0
- package/src/generators/utils/testing.js.map +1 -0
- package/src/generators/utils/types.d.ts +32 -0
- package/src/generators/utils/types.js +3 -0
- package/src/generators/utils/types.js.map +1 -0
- package/src/migrations/update-13-2-0/update-to-nest-8.d.ts +2 -0
- package/src/migrations/update-13-2-0/update-to-nest-8.js +67 -0
- package/src/migrations/update-13-2-0/update-to-nest-8.js.map +1 -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 +13 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/utils/versions.d.ts +5 -0
- package/src/utils/versions.js +9 -0
- package/src/utils/versions.js.map +1 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./create-files"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./normalize-options"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./update-tsconfig"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/nest/src/generators/application/lib/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,8DAAoC;AACpC,4DAAkC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
import type { Schema as NodeApplicationGeneratorOptions } from '@nx/node/src/generators/application/schema';
|
|
3
|
+
import type { ApplicationGeneratorOptions, NormalizedOptions } from '../schema';
|
|
4
|
+
export declare function normalizeOptions(tree: Tree, options: ApplicationGeneratorOptions): NormalizedOptions;
|
|
5
|
+
export declare function toNodeApplicationGeneratorOptions(options: NormalizedOptions): NodeApplicationGeneratorOptions;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toNodeApplicationGeneratorOptions = exports.normalizeOptions = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const devkit_2 = require("@nx/devkit");
|
|
6
|
+
const linter_1 = require("@nx/linter");
|
|
7
|
+
function normalizeOptions(tree, options) {
|
|
8
|
+
var _a, _b, _c;
|
|
9
|
+
const { layoutDirectory, projectDirectory } = (0, devkit_1.extractLayoutDirectory)(options.directory);
|
|
10
|
+
const appDirectory = projectDirectory
|
|
11
|
+
? `${(0, devkit_2.names)(projectDirectory).fileName}/${(0, devkit_2.names)(options.name).fileName}`
|
|
12
|
+
: (0, devkit_2.names)(options.name).fileName;
|
|
13
|
+
const appProjectRoot = options.rootProject
|
|
14
|
+
? '.'
|
|
15
|
+
: (0, devkit_2.joinPathFragments)(layoutDirectory !== null && layoutDirectory !== void 0 ? layoutDirectory : (0, devkit_2.getWorkspaceLayout)(tree).appsDir, appDirectory);
|
|
16
|
+
return Object.assign(Object.assign({}, options), { appProjectRoot, linter: (_a = options.linter) !== null && _a !== void 0 ? _a : linter_1.Linter.EsLint, unitTestRunner: (_b = options.unitTestRunner) !== null && _b !== void 0 ? _b : 'jest', e2eTestRunner: (_c = options.e2eTestRunner) !== null && _c !== void 0 ? _c : 'jest' });
|
|
17
|
+
}
|
|
18
|
+
exports.normalizeOptions = normalizeOptions;
|
|
19
|
+
function toNodeApplicationGeneratorOptions(options) {
|
|
20
|
+
return {
|
|
21
|
+
name: options.name,
|
|
22
|
+
directory: options.directory,
|
|
23
|
+
frontendProject: options.frontendProject,
|
|
24
|
+
linter: options.linter,
|
|
25
|
+
skipFormat: true,
|
|
26
|
+
skipPackageJson: options.skipPackageJson,
|
|
27
|
+
standaloneConfig: options.standaloneConfig,
|
|
28
|
+
tags: options.tags,
|
|
29
|
+
unitTestRunner: options.unitTestRunner,
|
|
30
|
+
e2eTestRunner: options.e2eTestRunner,
|
|
31
|
+
setParserOptionsProject: options.setParserOptionsProject,
|
|
32
|
+
rootProject: options.rootProject,
|
|
33
|
+
bundler: 'webpack',
|
|
34
|
+
isNest: true,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.toNodeApplicationGeneratorOptions = toNodeApplicationGeneratorOptions;
|
|
38
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/nest/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":";;;AAAA,uCAA0D;AAC1D,uCAA0E;AAC1E,uCAAoC;AAIpC,SAAgB,gBAAgB,CAC9B,IAAU,EACV,OAAoC;;IAEpC,MAAM,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,IAAA,+BAAsB,EAClE,OAAO,CAAC,SAAS,CAClB,CAAC;IAEF,MAAM,YAAY,GAAG,gBAAgB;QACnC,CAAC,CAAC,GAAG,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAC,QAAQ,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;QACvE,CAAC,CAAC,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;IAEjC,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW;QACxC,CAAC,CAAC,GAAG;QACL,CAAC,CAAC,IAAA,0BAAiB,EACf,eAAe,aAAf,eAAe,cAAf,eAAe,GAAI,IAAA,2BAAkB,EAAC,IAAI,CAAC,CAAC,OAAO,EACnD,YAAY,CACb,CAAC;IAEN,uCACK,OAAO,KACV,cAAc,EACd,MAAM,EAAE,MAAA,OAAO,CAAC,MAAM,mCAAI,eAAM,CAAC,MAAM,EACvC,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,MAAM,EAChD,aAAa,EAAE,MAAA,OAAO,CAAC,aAAa,mCAAI,MAAM,IAC9C;AACJ,CAAC;AA1BD,4CA0BC;AAED,SAAgB,iCAAiC,CAC/C,OAA0B;IAE1B,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,UAAU,EAAE,IAAI;QAChB,eAAe,EAAE,OAAO,CAAC,eAAe;QACxC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;QAC1C,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,uBAAuB,EAAE,OAAO,CAAC,uBAAuB;QACxD,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,SAAS;QAClB,MAAM,EAAE,IAAI;KACb,CAAC;AACJ,CAAC;AAnBD,8EAmBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateTsConfig = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function updateTsConfig(tree, options) {
|
|
6
|
+
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'), (json) => {
|
|
7
|
+
json.compilerOptions.emitDecoratorMetadata = true;
|
|
8
|
+
json.compilerOptions.target = 'es2015';
|
|
9
|
+
return json;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.updateTsConfig = updateTsConfig;
|
|
13
|
+
//# sourceMappingURL=update-tsconfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-tsconfig.js","sourceRoot":"","sources":["../../../../../../../packages/nest/src/generators/application/lib/update-tsconfig.ts"],"names":[],"mappings":";;;AACA,uCAA2D;AAG3D,SAAgB,cAAc,CAAC,IAAU,EAAE,OAA0B;IACnE,IAAA,mBAAU,EACR,IAAI,EACJ,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,CAAC,EAC9D,CAAC,IAAI,EAAE,EAAE;QACP,IAAI,CAAC,eAAe,CAAC,qBAAqB,GAAG,IAAI,CAAC;QAClD,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,QAAQ,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC,CACF,CAAC;AACJ,CAAC;AAVD,wCAUC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Linter } from '@nx/linter';
|
|
2
|
+
|
|
3
|
+
export interface ApplicationGeneratorOptions {
|
|
4
|
+
name: string;
|
|
5
|
+
directory?: string;
|
|
6
|
+
frontendProject?: string;
|
|
7
|
+
linter?: Linter;
|
|
8
|
+
skipFormat?: boolean;
|
|
9
|
+
skipPackageJson?: boolean;
|
|
10
|
+
standaloneConfig?: boolean;
|
|
11
|
+
tags?: string;
|
|
12
|
+
unitTestRunner?: 'jest' | 'none';
|
|
13
|
+
e2eTestRunner?: 'jest' | 'none';
|
|
14
|
+
setParserOptionsProject?: boolean;
|
|
15
|
+
rootProject?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface NormalizedOptions extends ApplicationGeneratorOptions {
|
|
19
|
+
appProjectRoot: Path;
|
|
20
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://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
|
+
},
|
|
18
|
+
"directory": {
|
|
19
|
+
"description": "The directory of the new application.",
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"skipFormat": {
|
|
23
|
+
"description": "Skip formatting files.",
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": false,
|
|
26
|
+
"x-priority": "internal"
|
|
27
|
+
},
|
|
28
|
+
"skipPackageJson": {
|
|
29
|
+
"description": "Do not add dependencies to `package.json`.",
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"default": false,
|
|
32
|
+
"x-priority": "internal"
|
|
33
|
+
},
|
|
34
|
+
"linter": {
|
|
35
|
+
"description": "The tool to use for running lint checks.",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"enum": ["eslint", "none"],
|
|
38
|
+
"default": "eslint"
|
|
39
|
+
},
|
|
40
|
+
"unitTestRunner": {
|
|
41
|
+
"description": "Test runner to use for unit tests.",
|
|
42
|
+
"type": "string",
|
|
43
|
+
"enum": ["jest", "none"],
|
|
44
|
+
"default": "jest"
|
|
45
|
+
},
|
|
46
|
+
"e2eTestRunner": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"enum": ["jest", "none"],
|
|
49
|
+
"description": "Test runner to use for end to end (e2e) tests",
|
|
50
|
+
"default": "jest"
|
|
51
|
+
},
|
|
52
|
+
"tags": {
|
|
53
|
+
"description": "Add tags to the application (used for linting).",
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"frontendProject": {
|
|
57
|
+
"description": "Frontend project that needs to access this application. This sets up proxy configuration.",
|
|
58
|
+
"type": "string",
|
|
59
|
+
"x-priority": "important"
|
|
60
|
+
},
|
|
61
|
+
"standaloneConfig": {
|
|
62
|
+
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
|
63
|
+
"type": "boolean",
|
|
64
|
+
"default": true,
|
|
65
|
+
"x-deprecated": "Nx only supports standaloneConfig"
|
|
66
|
+
},
|
|
67
|
+
"setParserOptionsProject": {
|
|
68
|
+
"type": "boolean",
|
|
69
|
+
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
70
|
+
"default": false
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"additionalProperties": false,
|
|
74
|
+
"required": ["name"]
|
|
75
|
+
}
|
|
@@ -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<any>;
|
|
5
|
+
export default classGenerator;
|
|
6
|
+
export declare const classSchematic: (generatorOptions: ClassGeneratorOptions) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.classSchematic = exports.classGenerator = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
function classGenerator(tree, rawOptions) {
|
|
7
|
+
const options = normalizeClassOptions(tree, rawOptions);
|
|
8
|
+
return (0, utils_1.runNestSchematic)(tree, 'class', options);
|
|
9
|
+
}
|
|
10
|
+
exports.classGenerator = classGenerator;
|
|
11
|
+
exports.default = classGenerator;
|
|
12
|
+
exports.classSchematic = (0, devkit_1.convertNxGenerator)(classGenerator);
|
|
13
|
+
function normalizeClassOptions(tree, options) {
|
|
14
|
+
return Object.assign(Object.assign({}, (0, utils_1.normalizeOptions)(tree, options)), { language: options.language, spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner) });
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class.js","sourceRoot":"","sources":["../../../../../../packages/nest/src/generators/class/class.ts"],"names":[],"mappings":";;;AACA,uCAAgD;AAMhD,oCAIkB;AAKlB,SAAgB,cAAc,CAC5B,IAAU,EACV,UAAiC;IAEjC,MAAM,OAAO,GAAG,qBAAqB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAExD,OAAO,IAAA,wBAAgB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAClD,CAAC;AAPD,wCAOC;AAED,kBAAe,cAAc,CAAC;AAEjB,QAAA,cAAc,GAAG,IAAA,2BAAkB,EAAC,cAAc,CAAC,CAAC;AAEjE,SAAS,qBAAqB,CAC5B,IAAU,EACV,OAA8B;IAE9B,uCACK,IAAA,wBAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,KAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,IAAI,EAAE,IAAA,4BAAoB,EAAC,OAAO,CAAC,cAAc,CAAC,IAClD;AACJ,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://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
|
+
"project": {
|
|
19
|
+
"description": "The Nest project to target.",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"$default": {
|
|
22
|
+
"$source": "projectName"
|
|
23
|
+
},
|
|
24
|
+
"alias": "p",
|
|
25
|
+
"x-prompt": "What Nest project would you like to target?"
|
|
26
|
+
},
|
|
27
|
+
"directory": {
|
|
28
|
+
"description": "Directory where the generated files are placed.",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"aliases": ["dir", "path"]
|
|
31
|
+
},
|
|
32
|
+
"skipFormat": {
|
|
33
|
+
"description": "Skip formatting files.",
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"default": false,
|
|
36
|
+
"x-priority": "internal"
|
|
37
|
+
},
|
|
38
|
+
"unitTestRunner": {
|
|
39
|
+
"description": "Test runner to use for unit tests.",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"enum": ["jest", "none"],
|
|
42
|
+
"default": "jest"
|
|
43
|
+
},
|
|
44
|
+
"flat": {
|
|
45
|
+
"description": "Flag to indicate if a directory is created.",
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"default": true
|
|
48
|
+
},
|
|
49
|
+
"language": {
|
|
50
|
+
"description": "Nest class language.",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"enum": ["js", "ts"]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"additionalProperties": false,
|
|
56
|
+
"required": ["name", "project"]
|
|
57
|
+
}
|
|
@@ -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<any>;
|
|
8
|
+
export default controllerGenerator;
|
|
9
|
+
export declare const controllerSchematic: (generatorOptions: ControllerGeneratorOptions) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.controllerSchematic = exports.controllerGenerator = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
function controllerGenerator(tree, rawOptions) {
|
|
7
|
+
const options = normalizeControllerOptions(tree, rawOptions);
|
|
8
|
+
return (0, utils_1.runNestSchematic)(tree, 'controller', options);
|
|
9
|
+
}
|
|
10
|
+
exports.controllerGenerator = controllerGenerator;
|
|
11
|
+
exports.default = controllerGenerator;
|
|
12
|
+
exports.controllerSchematic = (0, devkit_1.convertNxGenerator)(controllerGenerator);
|
|
13
|
+
function normalizeControllerOptions(tree, options) {
|
|
14
|
+
return Object.assign(Object.assign({}, (0, utils_1.normalizeOptions)(tree, options)), { language: options.language, module: options.module, skipImport: options.skipImport, spec: (0, utils_1.unitTestRunnerToSpec)(options.unitTestRunner) });
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../../../../../packages/nest/src/generators/controller/controller.ts"],"names":[],"mappings":";;;AACA,uCAAgD;AAMhD,oCAIkB;AAQlB,SAAgB,mBAAmB,CACjC,IAAU,EACV,UAAsC;IAEtC,MAAM,OAAO,GAAG,0BAA0B,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAE7D,OAAO,IAAA,wBAAgB,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC;AAPD,kDAOC;AAED,kBAAe,mBAAmB,CAAC;AAEtB,QAAA,mBAAmB,GAAG,IAAA,2BAAkB,EAAC,mBAAmB,CAAC,CAAC;AAE3E,SAAS,0BAA0B,CACjC,IAAU,EACV,OAAmC;IAEnC,uCACK,IAAA,wBAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,KAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAC1B,MAAM,EAAE,OAAO,CAAC,MAAM,EACtB,UAAU,EAAE,OAAO,CAAC,UAAU,EAC9B,IAAI,EAAE,IAAA,4BAAoB,EAAC,OAAO,CAAC,cAAc,CAAC,IAClD;AACJ,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://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-prompt": "What Nest project would you like to target?"
|
|
26
|
+
},
|
|
27
|
+
"directory": {
|
|
28
|
+
"description": "Directory where the generated files are placed.",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"aliases": ["dir", "path"]
|
|
31
|
+
},
|
|
32
|
+
"skipFormat": {
|
|
33
|
+
"description": "Skip formatting files.",
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"default": false,
|
|
36
|
+
"x-priority": "internal"
|
|
37
|
+
},
|
|
38
|
+
"unitTestRunner": {
|
|
39
|
+
"description": "Test runner to use for unit tests.",
|
|
40
|
+
"type": "string",
|
|
41
|
+
"enum": ["jest", "none"],
|
|
42
|
+
"default": "jest"
|
|
43
|
+
},
|
|
44
|
+
"flat": {
|
|
45
|
+
"description": "Flag to indicate if a directory is created.",
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"default": false
|
|
48
|
+
},
|
|
49
|
+
"language": {
|
|
50
|
+
"description": "Nest controller language.",
|
|
51
|
+
"type": "string",
|
|
52
|
+
"enum": ["js", "ts"]
|
|
53
|
+
},
|
|
54
|
+
"skipImport": {
|
|
55
|
+
"description": "Flag to skip the module import.",
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"default": false
|
|
58
|
+
},
|
|
59
|
+
"module": {
|
|
60
|
+
"description": "Allows specification of the declaring module.",
|
|
61
|
+
"type": "string"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"additionalProperties": false,
|
|
65
|
+
"required": ["name", "project"]
|
|
66
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
import { ConvertTSLintToESLintSchema } from '@nx/linter';
|
|
3
|
+
export declare function conversionGenerator(host: Tree, options: ConvertTSLintToESLintSchema): Promise<() => Promise<void>>;
|
|
4
|
+
export declare const conversionSchematic: (generatorOptions: ConvertTSLintToESLintSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.conversionSchematic = exports.conversionGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const linter_1 = require("@nx/linter");
|
|
7
|
+
const application_1 = require("@nx/node/src/generators/application/application");
|
|
8
|
+
const library_1 = require("@nx/js/src/generators/library/library");
|
|
9
|
+
function conversionGenerator(host, options) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
/**
|
|
12
|
+
* The ProjectConverter instance encapsulates all the standard operations we need
|
|
13
|
+
* to perform in order to convert a project from TSLint to ESLint, as well as some
|
|
14
|
+
* extensibility points for adjusting the behavior on a per package basis.
|
|
15
|
+
*
|
|
16
|
+
* E.g. @nrwl/angular projects might need to make different changes to the final
|
|
17
|
+
* ESLint config when compared with @nrwl/nest projects.
|
|
18
|
+
*
|
|
19
|
+
* See the ProjectConverter implementation for a full breakdown of what it does.
|
|
20
|
+
*/
|
|
21
|
+
const projectConverter = new linter_1.ProjectConverter({
|
|
22
|
+
host,
|
|
23
|
+
projectName: options.project,
|
|
24
|
+
ignoreExistingTslintConfig: options.ignoreExistingTslintConfig,
|
|
25
|
+
eslintInitializer: ({ projectName, projectConfig }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
/**
|
|
27
|
+
* Using .js is not an option with NestJS, so we always set it to false when
|
|
28
|
+
* delegating to the external (more generic) generators below.
|
|
29
|
+
*/
|
|
30
|
+
const js = false;
|
|
31
|
+
/**
|
|
32
|
+
* We set the parserOptions.project config just in case the converted config uses
|
|
33
|
+
* rules which require type-checking. Later in the conversion we check if it actually
|
|
34
|
+
* does and remove the config again if it doesn't, so that it is most efficient.
|
|
35
|
+
*/
|
|
36
|
+
const setParserOptionsProject = true;
|
|
37
|
+
if (projectConfig.projectType === 'application') {
|
|
38
|
+
yield (0, application_1.addLintingToApplication)(host, {
|
|
39
|
+
linter: 'eslint',
|
|
40
|
+
name: projectName,
|
|
41
|
+
appProjectRoot: projectConfig.root,
|
|
42
|
+
js,
|
|
43
|
+
setParserOptionsProject,
|
|
44
|
+
parsedTags: [],
|
|
45
|
+
skipFormat: options.skipFormat,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (projectConfig.projectType === 'library') {
|
|
49
|
+
yield (0, library_1.addLint)(host, {
|
|
50
|
+
linter: 'eslint',
|
|
51
|
+
name: projectName,
|
|
52
|
+
projectRoot: projectConfig.root,
|
|
53
|
+
js,
|
|
54
|
+
setParserOptionsProject,
|
|
55
|
+
projectDirectory: '',
|
|
56
|
+
fileName: '',
|
|
57
|
+
parsedTags: [],
|
|
58
|
+
skipFormat: true,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* If root eslint configuration already exists it will not be recreated
|
|
65
|
+
* but we also don't want to re-run the tslint config conversion
|
|
66
|
+
* as it was likely already done
|
|
67
|
+
*/
|
|
68
|
+
const rootEslintConfigExists = host.exists('.eslintrc.json');
|
|
69
|
+
/**
|
|
70
|
+
* Create the standard (which is applicable to the current package) ESLint setup
|
|
71
|
+
* for converting the project.
|
|
72
|
+
*/
|
|
73
|
+
const eslintInitInstallTask = yield projectConverter.initESLint();
|
|
74
|
+
/**
|
|
75
|
+
* Convert the root tslint.json and apply the converted rules to the root .eslintrc.json.
|
|
76
|
+
*/
|
|
77
|
+
const rootConfigInstallTask = yield projectConverter.convertRootTSLintConfig((json) => removeCodelyzerRelatedRules(json), rootEslintConfigExists);
|
|
78
|
+
/**
|
|
79
|
+
* Convert the project's tslint.json to an equivalent ESLint config.
|
|
80
|
+
*/
|
|
81
|
+
const projectConfigInstallTask = yield projectConverter.convertProjectConfig((json) => json);
|
|
82
|
+
/**
|
|
83
|
+
* Clean up the original TSLint configuration for the project.
|
|
84
|
+
*/
|
|
85
|
+
projectConverter.removeProjectTSLintFile();
|
|
86
|
+
// Only project shouldn't be added as a default
|
|
87
|
+
const { project } = options, defaults = tslib_1.__rest(options, ["project"]);
|
|
88
|
+
/**
|
|
89
|
+
* Store user preferences for the collection
|
|
90
|
+
*/
|
|
91
|
+
projectConverter.setDefaults('@nrwl/nest', defaults);
|
|
92
|
+
/**
|
|
93
|
+
* Based on user preference and remaining usage, remove TSLint from the workspace entirely.
|
|
94
|
+
*/
|
|
95
|
+
let uninstallTSLintTask = () => Promise.resolve(undefined);
|
|
96
|
+
if (options.removeTSLintIfNoMoreTSLintTargets &&
|
|
97
|
+
!projectConverter.isTSLintUsedInWorkspace()) {
|
|
98
|
+
uninstallTSLintTask = projectConverter.removeTSLintFromWorkspace();
|
|
99
|
+
}
|
|
100
|
+
if (!options.skipFormat) {
|
|
101
|
+
yield (0, devkit_1.formatFiles)(host);
|
|
102
|
+
}
|
|
103
|
+
return () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
yield eslintInitInstallTask();
|
|
105
|
+
yield rootConfigInstallTask();
|
|
106
|
+
yield projectConfigInstallTask();
|
|
107
|
+
yield uninstallTSLintTask();
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
exports.conversionGenerator = conversionGenerator;
|
|
112
|
+
exports.conversionSchematic = (0, devkit_1.convertNxGenerator)(conversionGenerator);
|
|
113
|
+
/**
|
|
114
|
+
* Remove any @angular-eslint rules that were applied as a result of converting prior codelyzer
|
|
115
|
+
* rules, because they are only relevant for Angular projects.
|
|
116
|
+
*/
|
|
117
|
+
function removeCodelyzerRelatedRules(json) {
|
|
118
|
+
for (const ruleName of Object.keys(json.rules)) {
|
|
119
|
+
if (ruleName.startsWith('@angular-eslint')) {
|
|
120
|
+
delete json.rules[ruleName];
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (json.plugins) {
|
|
124
|
+
json.plugins = json.plugins.filter((plugin) => !plugin.startsWith('@angular-eslint'));
|
|
125
|
+
}
|
|
126
|
+
return json;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=convert-tslint-to-eslint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convert-tslint-to-eslint.js","sourceRoot":"","sources":["../../../../../../packages/nest/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "nest-convert-tslint-to-eslint",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"title": "Convert a NestJS project from TSLint to ESLint",
|
|
6
|
+
"description": "Convert a NestJS project from TSLint to ESLint. \n_NOTE: Does not work in `--dry-run` mode_.",
|
|
7
|
+
"examples": [
|
|
8
|
+
{
|
|
9
|
+
"command": "nx g convert-tslint-to-eslint myapp",
|
|
10
|
+
"description": "Convert the NestJS project `myapp` from TSLint to ESLint"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"project": {
|
|
16
|
+
"description": "The name of the NestJS project to convert.",
|
|
17
|
+
"type": "string",
|
|
18
|
+
"$default": {
|
|
19
|
+
"$source": "argv",
|
|
20
|
+
"index": 0
|
|
21
|
+
},
|
|
22
|
+
"x-prompt": "Which NestJS project would you like to convert from TSLint to ESLint?"
|
|
23
|
+
},
|
|
24
|
+
"ignoreExistingTslintConfig": {
|
|
25
|
+
"description": "If true we will not use existing TSLint config as a reference, we will just reset the project with the latest recommended ESLint config.",
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"default": false,
|
|
28
|
+
"x-prompt": "Would you like to ignore the existing TSLint config? Recommended if the TSLint config has not been altered much as it makes the new ESLint config cleaner."
|
|
29
|
+
},
|
|
30
|
+
"removeTSLintIfNoMoreTSLintTargets": {
|
|
31
|
+
"description": "If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration.",
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"default": true,
|
|
34
|
+
"x-prompt": "Would you like to remove TSLint and its related config if there are no TSLint projects remaining after this conversion?"
|
|
35
|
+
},
|
|
36
|
+
"skipFormat": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"description": "Skip formatting files.",
|
|
39
|
+
"default": false,
|
|
40
|
+
"x-priority": "internal"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"required": ["project"]
|
|
44
|
+
}
|
|
@@ -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<any>;
|
|
5
|
+
export default decoratorGenerator;
|
|
6
|
+
export declare const decoratorSchematic: (generatorOptions: NestGeneratorWithLanguageOption) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decoratorSchematic = exports.decoratorGenerator = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
function decoratorGenerator(tree, rawOptions) {
|
|
7
|
+
const options = normalizeDecoratorOptions(tree, rawOptions);
|
|
8
|
+
return (0, utils_1.runNestSchematic)(tree, 'decorator', options);
|
|
9
|
+
}
|
|
10
|
+
exports.decoratorGenerator = decoratorGenerator;
|
|
11
|
+
exports.default = decoratorGenerator;
|
|
12
|
+
exports.decoratorSchematic = (0, devkit_1.convertNxGenerator)(decoratorGenerator);
|
|
13
|
+
function normalizeDecoratorOptions(tree, options) {
|
|
14
|
+
return Object.assign(Object.assign({}, (0, utils_1.normalizeOptions)(tree, options)), { language: options.language });
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../../../../packages/nest/src/generators/decorator/decorator.ts"],"names":[],"mappings":";;;AACA,uCAAgD;AAKhD,oCAA8D;AAI9D,SAAgB,kBAAkB,CAChC,IAAU,EACV,UAAqC;IAErC,MAAM,OAAO,GAAG,yBAAyB,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAE5D,OAAO,IAAA,wBAAgB,EAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAPD,gDAOC;AAED,kBAAe,kBAAkB,CAAC;AAErB,QAAA,kBAAkB,GAAG,IAAA,2BAAkB,EAAC,kBAAkB,CAAC,CAAC;AAEzE,SAAS,yBAAyB,CAChC,IAAU,EACV,OAAkC;IAElC,uCACK,IAAA,wBAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,KAClC,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAC1B;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://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
|
+
"project": {
|
|
19
|
+
"description": "The Nest project to target.",
|
|
20
|
+
"type": "string",
|
|
21
|
+
"$default": {
|
|
22
|
+
"$source": "projectName"
|
|
23
|
+
},
|
|
24
|
+
"alias": "p",
|
|
25
|
+
"x-prompt": "What Nest project would you like to target?"
|
|
26
|
+
},
|
|
27
|
+
"directory": {
|
|
28
|
+
"description": "Directory where the generated files are placed.",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"aliases": ["dir", "path"]
|
|
31
|
+
},
|
|
32
|
+
"skipFormat": {
|
|
33
|
+
"description": "Skip formatting files.",
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"default": false,
|
|
36
|
+
"x-priority": "internal"
|
|
37
|
+
},
|
|
38
|
+
"flat": {
|
|
39
|
+
"description": "Flag to indicate if a directory is created.",
|
|
40
|
+
"type": "boolean",
|
|
41
|
+
"default": true
|
|
42
|
+
},
|
|
43
|
+
"language": {
|
|
44
|
+
"description": "Nest decorator language.",
|
|
45
|
+
"type": "string",
|
|
46
|
+
"enum": ["js", "ts"]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"additionalProperties": false,
|
|
50
|
+
"required": ["name", "project"]
|
|
51
|
+
}
|
|
@@ -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<any>;
|
|
5
|
+
export default filterGenerator;
|
|
6
|
+
export declare const filterSchematic: (generatorOptions: FilterGeneratorOptions) => (tree: any, context: any) => Promise<any>;
|