@rxdi/schematics 0.7.190 → 0.7.191-nightly.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/component.factory.js +1 -2
- package/lib/controller/controller.factory.js +1 -2
- package/lib/effect/effect.factory.js +2 -4
- package/lib/effect/effect.factory.ts +1 -2
- package/lib/guard/guard.factory.js +1 -2
- package/lib/interceptor/interceptor.factory.js +1 -2
- package/lib/module/module.factory.js +1 -2
- package/lib/service/service.factory.js +2 -4
- package/lib/service/service.factory.ts +1 -2
- package/package.json +8 -8
- package/utils/source-root.helpers.js +2 -3
- package/lib/application/application.factory.d.ts +0 -3
- package/lib/application/application.factory.js +0 -35
- package/lib/application/application.factory.test.ts +0 -88
- package/lib/application/application.factory.ts +0 -54
- package/lib/application/application.schema.d.ts +0 -34
- package/lib/application/files/js/.babelrc +0 -4
- package/lib/application/files/js/.prettierrc +0 -4
- package/lib/application/files/js/README.md +0 -37
- package/lib/application/files/js/index.js +0 -3
- package/lib/application/files/js/jsconfig.json +0 -9
- package/lib/application/files/js/nest-cli.json +0 -5
- package/lib/application/files/js/nodemon.json +0 -6
- package/lib/application/files/js/package.json +0 -46
- package/lib/application/files/js/test/app.e2e-spec.js +0 -23
- package/lib/application/files/js/test/jest-e2e.json +0 -5
- package/lib/application/files/ts/.prettierrc +0 -4
- package/lib/application/files/ts/README.md +0 -75
- package/lib/application/files/ts/nest-cli.json +0 -5
- package/lib/application/files/ts/nodemon-debug.json +0 -6
- package/lib/application/files/ts/nodemon.json +0 -6
- package/lib/application/files/ts/package.json +0 -58
- package/lib/application/files/ts/test/app.e2e-spec.ts +0 -23
- package/lib/application/files/ts/test/jest-e2e.json +0 -9
- package/lib/application/files/ts/tsconfig.build.json +0 -4
- package/lib/application/schema.json +0 -49
- package/lib/class/class.factory.d.ts +0 -3
- package/lib/class/class.factory.js +0 -35
- package/lib/class/class.factory.test.ts +0 -100
- package/lib/class/class.factory.ts +0 -54
- package/lib/class/class.schema.d.ts +0 -28
- package/lib/class/files/js/__name__.js +0 -1
- package/lib/class/files/js/__name__.spec.js +0 -7
- package/lib/class/files/ts/__name__.spec.ts +0 -7
- package/lib/class/files/ts/__name__.ts +0 -1
- package/lib/class/schema.json +0 -39
- package/lib/client-app/angular/angular.factory.d.ts +0 -3
- package/lib/client-app/angular/angular.factory.js +0 -97
- package/lib/client-app/angular/angular.factory.ts +0 -139
- package/lib/client-app/angular/angular.schema.d.ts +0 -32
- package/lib/client-app/angular/files/angular.constants.ts +0 -4
- package/lib/client-app/angular/files/angular.module.ts +0 -41
- package/lib/client-app/angular/files/angular.providers.ts +0 -27
- package/lib/client-app/angular/files/angular.utils.ts +0 -19
- package/lib/client-app/angular/files/interfaces/angular-options.interface.ts +0 -87
- package/lib/client-app/angular/files/loaders/abstract.loader.ts +0 -16
- package/lib/client-app/angular/files/loaders/express.loader.ts +0 -25
- package/lib/client-app/angular/files/loaders/fastify.loader.ts +0 -34
- package/lib/client-app/angular/files/loaders/noop.loader.ts +0 -12
- package/lib/client-app/angular/schema.json +0 -24
- package/lib/configuration/configuration.factory.d.ts +0 -3
- package/lib/configuration/configuration.factory.js +0 -24
- package/lib/configuration/configuration.factory.test.ts +0 -60
- package/lib/configuration/configuration.factory.ts +0 -35
- package/lib/configuration/configuration.schema.d.ts +0 -18
- package/lib/configuration/files/js/nest-cli.json +0 -5
- package/lib/configuration/files/ts/nest-cli.json +0 -5
- package/lib/decorator/decorator.factory.d.ts +0 -3
- package/lib/decorator/decorator.factory.js +0 -32
- package/lib/decorator/decorator.factory.test.ts +0 -111
- package/lib/decorator/decorator.factory.ts +0 -48
- package/lib/decorator/decorator.schema.d.ts +0 -24
- package/lib/decorator/files/js/__name__.decorator.js +0 -3
- package/lib/decorator/files/ts/__name__.decorator.ts +0 -3
- package/lib/decorator/schema.json +0 -35
- package/lib/filter/files/js/__name__.filter.js +0 -6
- package/lib/filter/files/js/__name__.filter.spec.js +0 -7
- package/lib/filter/files/ts/__name__.filter.spec.ts +0 -7
- package/lib/filter/files/ts/__name__.filter.ts +0 -6
- package/lib/filter/filter.factory.d.ts +0 -3
- package/lib/filter/filter.factory.js +0 -33
- package/lib/filter/filter.factory.test.ts +0 -147
- package/lib/filter/filter.factory.ts +0 -51
- package/lib/filter/filter.schema.d.ts +0 -28
- package/lib/filter/schema.json +0 -39
- package/lib/gateway/files/js/__name__.gateway.js +0 -9
- package/lib/gateway/files/js/__name__.gateway.spec.js +0 -18
- package/lib/gateway/files/ts/__name__.gateway.spec.ts +0 -18
- package/lib/gateway/files/ts/__name__.gateway.ts +0 -9
- package/lib/gateway/gateway.factory.d.ts +0 -3
- package/lib/gateway/gateway.factory.js +0 -61
- package/lib/gateway/gateway.factory.test.ts +0 -147
- package/lib/gateway/gateway.factory.ts +0 -92
- package/lib/gateway/gateway.schema.d.ts +0 -36
- package/lib/gateway/schema.json +0 -39
- package/lib/interface/files/__name__.interface.ts +0 -1
- package/lib/interface/interface.factory.d.ts +0 -3
- package/lib/interface/interface.factory.js +0 -31
- package/lib/interface/interface.factory.test.ts +0 -84
- package/lib/interface/interface.factory.ts +0 -47
- package/lib/interface/interface.schema.d.ts +0 -20
- package/lib/interface/schema.json +0 -31
- package/lib/library/files/js/.babelrc +0 -4
- package/lib/library/files/js/jsconfig.json +0 -9
- package/lib/library/files/js/package.json +0 -8
- package/lib/library/files/js/src/__name__.module.js +0 -8
- package/lib/library/files/js/src/__name__.service.js +0 -4
- package/lib/library/files/js/src/__name__.service.spec.js +0 -18
- package/lib/library/files/js/src/index.js +0 -2
- package/lib/library/files/ts/package.json +0 -8
- package/lib/library/files/ts/src/__name__.module.ts +0 -8
- package/lib/library/files/ts/src/__name__.service.spec.ts +0 -18
- package/lib/library/files/ts/src/__name__.service.ts +0 -4
- package/lib/library/files/ts/src/index.ts +0 -2
- package/lib/library/files/ts/tsconfig.lib.json +0 -5
- package/lib/library/library.factory.d.ts +0 -3
- package/lib/library/library.factory.js +0 -97
- package/lib/library/library.factory.test.ts +0 -68
- package/lib/library/library.factory.ts +0 -158
- package/lib/library/library.schema.d.ts +0 -24
- package/lib/library/schema.json +0 -37
- package/lib/pipe/files/js/__name__.pipe.js +0 -8
- package/lib/pipe/files/js/__name__.pipe.spec.js +0 -7
- package/lib/pipe/files/ts/__name__.pipe.spec.ts +0 -7
- package/lib/pipe/files/ts/__name__.pipe.ts +0 -8
- package/lib/pipe/pipe.factory.d.ts +0 -3
- package/lib/pipe/pipe.factory.js +0 -33
- package/lib/pipe/pipe.factory.test.ts +0 -141
- package/lib/pipe/pipe.factory.ts +0 -51
- package/lib/pipe/pipe.schema.d.ts +0 -28
- package/lib/pipe/schema.json +0 -39
- package/lib/resolver/files/js/__name__.resolver.js +0 -4
- package/lib/resolver/files/js/__name__.resolver.spec.js +0 -18
- package/lib/resolver/files/ts/__name__.resolver.spec.ts +0 -18
- package/lib/resolver/files/ts/__name__.resolver.ts +0 -4
- package/lib/resolver/resolver.factory.d.ts +0 -3
- package/lib/resolver/resolver.factory.js +0 -61
- package/lib/resolver/resolver.factory.test.ts +0 -117
- package/lib/resolver/resolver.factory.ts +0 -92
- package/lib/resolver/resolver.schema.d.ts +0 -36
- package/lib/resolver/schema.json +0 -39
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.main =
|
|
3
|
+
exports.main = main;
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const module_declarator_1 = require("../../utils/module.declarator");
|
|
@@ -20,7 +20,6 @@ function main(options) {
|
|
|
20
20
|
]))(tree, context);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
exports.main = main;
|
|
24
23
|
function transform(source) {
|
|
25
24
|
const target = Object.assign({}, source);
|
|
26
25
|
target.metadata = ELEMENT_METADATA;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.main =
|
|
3
|
+
exports.main = main;
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const module_declarator_1 = require("../../utils/module.declarator");
|
|
@@ -20,7 +20,6 @@ function main(options) {
|
|
|
20
20
|
]))(tree, context);
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
exports.main = main;
|
|
24
23
|
function transform(source) {
|
|
25
24
|
const target = Object.assign({}, source);
|
|
26
25
|
target.metadata = ELEMENT_METADATA;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.main =
|
|
3
|
+
exports.main = main;
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
-
const util_1 = require("util");
|
|
7
6
|
const module_declarator_1 = require("../../utils/module.declarator");
|
|
8
7
|
const module_finder_1 = require("../../utils/module.finder");
|
|
9
8
|
const name_parser_1 = require("../../utils/name.parser");
|
|
@@ -18,12 +17,11 @@ function main(options) {
|
|
|
18
17
|
]))(tree, context);
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
exports.main = main;
|
|
22
20
|
function transform(source) {
|
|
23
21
|
const target = Object.assign({}, source);
|
|
24
22
|
target.metadata = 'effects';
|
|
25
23
|
target.type = 'effect';
|
|
26
|
-
if (
|
|
24
|
+
if (target.name === null || target.name === undefined) {
|
|
27
25
|
throw new schematics_1.SchematicsException('Option (name) is required.');
|
|
28
26
|
}
|
|
29
27
|
const location = new name_parser_1.NameParser().parse(target);
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
Tree,
|
|
15
15
|
url,
|
|
16
16
|
} from '@angular-devkit/schematics';
|
|
17
|
-
import { isNullOrUndefined } from 'util';
|
|
18
17
|
import {
|
|
19
18
|
DeclarationOptions,
|
|
20
19
|
ModuleDeclarator,
|
|
@@ -42,7 +41,7 @@ function transform(source: ServiceOptions): ServiceOptions {
|
|
|
42
41
|
target.metadata = 'effects';
|
|
43
42
|
target.type = 'effect';
|
|
44
43
|
|
|
45
|
-
if (
|
|
44
|
+
if (target.name === null || target.name === undefined) {
|
|
46
45
|
throw new SchematicsException('Option (name) is required.');
|
|
47
46
|
}
|
|
48
47
|
const location: Location = new NameParser().parse(target);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.main =
|
|
3
|
+
exports.main = main;
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const name_parser_1 = require("../../utils/name.parser");
|
|
@@ -9,7 +9,6 @@ function main(options) {
|
|
|
9
9
|
options = transform(options);
|
|
10
10
|
return (0, schematics_1.chain)([(0, source_root_helpers_1.mergeSourceRoot)(options), (0, schematics_1.mergeWith)(generate(options))]);
|
|
11
11
|
}
|
|
12
|
-
exports.main = main;
|
|
13
12
|
function transform(options) {
|
|
14
13
|
const target = Object.assign({}, options);
|
|
15
14
|
if (!target.name) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.main =
|
|
3
|
+
exports.main = main;
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const name_parser_1 = require("../../utils/name.parser");
|
|
@@ -9,7 +9,6 @@ function main(options) {
|
|
|
9
9
|
options = transform(options);
|
|
10
10
|
return (0, schematics_1.chain)([(0, source_root_helpers_1.mergeSourceRoot)(options), (0, schematics_1.mergeWith)(generate(options))]);
|
|
11
11
|
}
|
|
12
|
-
exports.main = main;
|
|
13
12
|
function transform(options) {
|
|
14
13
|
const target = Object.assign({}, options);
|
|
15
14
|
if (!target.name) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.main =
|
|
3
|
+
exports.main = main;
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const module_declarator_1 = require("../../utils/module.declarator");
|
|
@@ -17,7 +17,6 @@ function main(options) {
|
|
|
17
17
|
]))(tree, context);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.main = main;
|
|
21
20
|
function transform(source) {
|
|
22
21
|
const target = Object.assign({}, source);
|
|
23
22
|
target.metadata = 'imports';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.main =
|
|
3
|
+
exports.main = main;
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
-
const util_1 = require("util");
|
|
7
6
|
const module_declarator_1 = require("../../utils/module.declarator");
|
|
8
7
|
const module_finder_1 = require("../../utils/module.finder");
|
|
9
8
|
const name_parser_1 = require("../../utils/name.parser");
|
|
@@ -18,12 +17,11 @@ function main(options) {
|
|
|
18
17
|
]))(tree, context);
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
exports.main = main;
|
|
22
20
|
function transform(source) {
|
|
23
21
|
const target = Object.assign({}, source);
|
|
24
22
|
target.metadata = 'providers';
|
|
25
23
|
target.type = 'service';
|
|
26
|
-
if (
|
|
24
|
+
if (target.name === null || target.name === undefined) {
|
|
27
25
|
throw new schematics_1.SchematicsException('Option (name) is required.');
|
|
28
26
|
}
|
|
29
27
|
const location = new name_parser_1.NameParser().parse(target);
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
Tree,
|
|
15
15
|
url,
|
|
16
16
|
} from '@angular-devkit/schematics';
|
|
17
|
-
import { isNullOrUndefined } from 'util';
|
|
18
17
|
import {
|
|
19
18
|
DeclarationOptions,
|
|
20
19
|
ModuleDeclarator,
|
|
@@ -42,7 +41,7 @@ function transform(source: ServiceOptions): ServiceOptions {
|
|
|
42
41
|
target.metadata = 'providers';
|
|
43
42
|
target.type = 'service';
|
|
44
43
|
|
|
45
|
-
if (
|
|
44
|
+
if (target.name === null || target.name === undefined) {
|
|
46
45
|
throw new SchematicsException('Option (name) is required.');
|
|
47
46
|
}
|
|
48
47
|
const location: Location = new NameParser().parse(target);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxdi/schematics",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.191-nightly.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rm -rf utils lib && tsc && cp -r ./src/* .",
|
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
"test": "echo Test Schematics"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@angular-devkit/core": "^
|
|
12
|
-
"@angular-devkit/schematics": "^
|
|
13
|
-
"@angular-devkit/schematics-cli": "^
|
|
11
|
+
"@angular-devkit/core": "^19.2.0",
|
|
12
|
+
"@angular-devkit/schematics": "^19.2.0",
|
|
13
|
+
"@angular-devkit/schematics-cli": "^19.2.0",
|
|
14
|
+
"ts-morph": "^25.0.1",
|
|
14
15
|
"chalk": "^2.4.2",
|
|
15
|
-
"node-emoji": "^1.10.0"
|
|
16
|
-
"ts-morph": "^1.3.1"
|
|
16
|
+
"node-emoji": "^1.10.0"
|
|
17
17
|
},
|
|
18
18
|
"schematics": "./collection.json",
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@types/node": "^
|
|
21
|
-
"typescript": "^
|
|
20
|
+
"@types/node": "^25.0.3",
|
|
21
|
+
"typescript": "^5.9.3"
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isInRootDirectory = isInRootDirectory;
|
|
4
|
+
exports.mergeSourceRoot = mergeSourceRoot;
|
|
4
5
|
const core_1 = require("@angular-devkit/core");
|
|
5
6
|
const defaults_1 = require("../lib/defaults");
|
|
6
7
|
function isInRootDirectory(host, extraFiles = []) {
|
|
7
8
|
const files = ['nest-cli.json', 'nest.json'].concat(extraFiles || []);
|
|
8
9
|
return files.map(file => host.exists(file)).some(isPresent => isPresent);
|
|
9
10
|
}
|
|
10
|
-
exports.isInRootDirectory = isInRootDirectory;
|
|
11
11
|
function mergeSourceRoot(options) {
|
|
12
12
|
return (host) => {
|
|
13
13
|
const isInRoot = isInRootDirectory(host, ['tsconfig.json', 'package.json']);
|
|
@@ -22,4 +22,3 @@ function mergeSourceRoot(options) {
|
|
|
22
22
|
return host;
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
exports.mergeSourceRoot = mergeSourceRoot;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.main = void 0;
|
|
4
|
-
const core_1 = require("@angular-devkit/core");
|
|
5
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
-
const defaults_1 = require("../defaults");
|
|
7
|
-
function main(options) {
|
|
8
|
-
options = transform(options);
|
|
9
|
-
return (0, schematics_1.mergeWith)(generate(options));
|
|
10
|
-
}
|
|
11
|
-
exports.main = main;
|
|
12
|
-
function transform(options) {
|
|
13
|
-
const target = Object.assign({}, options);
|
|
14
|
-
target.author = !!target.author ? target.author : defaults_1.DEFAULT_AUTHOR;
|
|
15
|
-
target.description = !!target.description
|
|
16
|
-
? target.description
|
|
17
|
-
: defaults_1.DEFAULT_DESCRIPTION;
|
|
18
|
-
target.language = !!target.language ? target.language : defaults_1.DEFAULT_LANGUAGE;
|
|
19
|
-
target.name = core_1.strings.dasherize(target.name);
|
|
20
|
-
target.version = !!target.version ? target.version : defaults_1.DEFAULT_VERSION;
|
|
21
|
-
target.packageManager = !!target.packageManager
|
|
22
|
-
? target.packageManager
|
|
23
|
-
: 'npm';
|
|
24
|
-
target.dependencies = !!target.dependencies ? target.dependencies : '';
|
|
25
|
-
target.devDependencies = !!target.devDependencies
|
|
26
|
-
? target.devDependencies
|
|
27
|
-
: '';
|
|
28
|
-
return target;
|
|
29
|
-
}
|
|
30
|
-
function generate(options) {
|
|
31
|
-
return (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
32
|
-
(0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
33
|
-
(0, schematics_1.move)(options.name),
|
|
34
|
-
]);
|
|
35
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import { ApplicationOptions } from './application.schema';
|
|
4
|
-
|
|
5
|
-
describe('Application Factory', () => {
|
|
6
|
-
const runner: SchematicTestRunner = new SchematicTestRunner(
|
|
7
|
-
'.',
|
|
8
|
-
path.join(process.cwd(), 'src/collection.json'),
|
|
9
|
-
);
|
|
10
|
-
it('should manage name only', () => {
|
|
11
|
-
const options: ApplicationOptions = {
|
|
12
|
-
name: 'project',
|
|
13
|
-
};
|
|
14
|
-
const tree: UnitTestTree = runner.runSchematic('application', options);
|
|
15
|
-
const files: string[] = tree.files;
|
|
16
|
-
expect(files).toEqual([
|
|
17
|
-
'/project/.gitignore',
|
|
18
|
-
'/project/.prettierrc',
|
|
19
|
-
'/project/README.md',
|
|
20
|
-
'/project/nest-cli.json',
|
|
21
|
-
'/project/nodemon-debug.json',
|
|
22
|
-
'/project/nodemon.json',
|
|
23
|
-
'/project/package.json',
|
|
24
|
-
'/project/tsconfig.build.json',
|
|
25
|
-
'/project/tsconfig.json',
|
|
26
|
-
'/project/tslint.json',
|
|
27
|
-
'/project/src/app.controller.spec.ts',
|
|
28
|
-
'/project/src/app.controller.ts',
|
|
29
|
-
'/project/src/app.module.ts',
|
|
30
|
-
'/project/src/app.service.ts',
|
|
31
|
-
'/project/src/main.ts',
|
|
32
|
-
'/project/test/app.e2e-spec.ts',
|
|
33
|
-
'/project/test/jest-e2e.json',
|
|
34
|
-
]);
|
|
35
|
-
});
|
|
36
|
-
it('should manage name to dasherize', () => {
|
|
37
|
-
const options: ApplicationOptions = {
|
|
38
|
-
name: 'awesomeProject',
|
|
39
|
-
};
|
|
40
|
-
const tree: UnitTestTree = runner.runSchematic('application', options);
|
|
41
|
-
const files: string[] = tree.files;
|
|
42
|
-
expect(files).toEqual([
|
|
43
|
-
'/awesome-project/.gitignore',
|
|
44
|
-
'/awesome-project/.prettierrc',
|
|
45
|
-
'/awesome-project/README.md',
|
|
46
|
-
'/awesome-project/nest-cli.json',
|
|
47
|
-
'/awesome-project/nodemon-debug.json',
|
|
48
|
-
'/awesome-project/nodemon.json',
|
|
49
|
-
'/awesome-project/package.json',
|
|
50
|
-
'/awesome-project/tsconfig.build.json',
|
|
51
|
-
'/awesome-project/tsconfig.json',
|
|
52
|
-
'/awesome-project/tslint.json',
|
|
53
|
-
'/awesome-project/src/app.controller.spec.ts',
|
|
54
|
-
'/awesome-project/src/app.controller.ts',
|
|
55
|
-
'/awesome-project/src/app.module.ts',
|
|
56
|
-
'/awesome-project/src/app.service.ts',
|
|
57
|
-
'/awesome-project/src/main.ts',
|
|
58
|
-
'/awesome-project/test/app.e2e-spec.ts',
|
|
59
|
-
'/awesome-project/test/jest-e2e.json',
|
|
60
|
-
]);
|
|
61
|
-
});
|
|
62
|
-
it('should manage javascript files', () => {
|
|
63
|
-
const options: ApplicationOptions = {
|
|
64
|
-
name: 'project',
|
|
65
|
-
language: 'js',
|
|
66
|
-
};
|
|
67
|
-
const tree: UnitTestTree = runner.runSchematic('application', options);
|
|
68
|
-
const files: string[] = tree.files;
|
|
69
|
-
expect(files).toEqual([
|
|
70
|
-
'/project/.babelrc',
|
|
71
|
-
'/project/.gitignore',
|
|
72
|
-
'/project/.prettierrc',
|
|
73
|
-
'/project/README.md',
|
|
74
|
-
'/project/index.js',
|
|
75
|
-
'/project/jsconfig.json',
|
|
76
|
-
'/project/nest-cli.json',
|
|
77
|
-
'/project/nodemon.json',
|
|
78
|
-
'/project/package.json',
|
|
79
|
-
'/project/src/app.controller.js',
|
|
80
|
-
'/project/src/app.controller.spec.js',
|
|
81
|
-
'/project/src/app.module.js',
|
|
82
|
-
'/project/src/app.service.js',
|
|
83
|
-
'/project/src/main.js',
|
|
84
|
-
'/project/test/app.e2e-spec.js',
|
|
85
|
-
'/project/test/jest-e2e.json',
|
|
86
|
-
]);
|
|
87
|
-
});
|
|
88
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { join, Path, strings } from '@angular-devkit/core';
|
|
2
|
-
import {
|
|
3
|
-
apply,
|
|
4
|
-
mergeWith,
|
|
5
|
-
move,
|
|
6
|
-
Rule,
|
|
7
|
-
SchematicsException,
|
|
8
|
-
Source,
|
|
9
|
-
template,
|
|
10
|
-
url,
|
|
11
|
-
} from '@angular-devkit/schematics';
|
|
12
|
-
import {
|
|
13
|
-
DEFAULT_AUTHOR,
|
|
14
|
-
DEFAULT_DESCRIPTION,
|
|
15
|
-
DEFAULT_LANGUAGE,
|
|
16
|
-
DEFAULT_VERSION,
|
|
17
|
-
} from '../defaults';
|
|
18
|
-
import { ApplicationOptions } from './application.schema';
|
|
19
|
-
|
|
20
|
-
export function main(options: ApplicationOptions): Rule {
|
|
21
|
-
options = transform(options);
|
|
22
|
-
return mergeWith(generate(options));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function transform(options: ApplicationOptions): ApplicationOptions {
|
|
26
|
-
const target: ApplicationOptions = Object.assign({}, options);
|
|
27
|
-
|
|
28
|
-
target.author = !!target.author ? target.author : DEFAULT_AUTHOR;
|
|
29
|
-
target.description = !!target.description
|
|
30
|
-
? target.description
|
|
31
|
-
: DEFAULT_DESCRIPTION;
|
|
32
|
-
target.language = !!target.language ? target.language : DEFAULT_LANGUAGE;
|
|
33
|
-
target.name = strings.dasherize(target.name);
|
|
34
|
-
target.version = !!target.version ? target.version : DEFAULT_VERSION;
|
|
35
|
-
|
|
36
|
-
target.packageManager = !!target.packageManager
|
|
37
|
-
? target.packageManager
|
|
38
|
-
: 'npm';
|
|
39
|
-
target.dependencies = !!target.dependencies ? target.dependencies : '';
|
|
40
|
-
target.devDependencies = !!target.devDependencies
|
|
41
|
-
? target.devDependencies
|
|
42
|
-
: '';
|
|
43
|
-
return target;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function generate(options: ApplicationOptions): Source {
|
|
47
|
-
return apply(url(join('./files' as Path, options.language)), [
|
|
48
|
-
template({
|
|
49
|
-
...strings,
|
|
50
|
-
...options,
|
|
51
|
-
}),
|
|
52
|
-
move(options.name),
|
|
53
|
-
]);
|
|
54
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export interface ApplicationOptions {
|
|
2
|
-
/**
|
|
3
|
-
* The Nest application name.
|
|
4
|
-
*/
|
|
5
|
-
name: string;
|
|
6
|
-
/**
|
|
7
|
-
* The Nest application author.
|
|
8
|
-
*/
|
|
9
|
-
author?: string;
|
|
10
|
-
/**
|
|
11
|
-
* The Nest application description.
|
|
12
|
-
*/
|
|
13
|
-
description?: string;
|
|
14
|
-
/**
|
|
15
|
-
* The Nest application version.
|
|
16
|
-
*/
|
|
17
|
-
version?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Application language.
|
|
20
|
-
*/
|
|
21
|
-
language?: string;
|
|
22
|
-
/**
|
|
23
|
-
* The used package manager.
|
|
24
|
-
*/
|
|
25
|
-
packageManager?: 'npm' | 'yarn';
|
|
26
|
-
/**
|
|
27
|
-
* The Nest included production dependencies (comma separated values).
|
|
28
|
-
*/
|
|
29
|
-
dependencies?: string;
|
|
30
|
-
/**
|
|
31
|
-
* The Nest included development dependencies (comma separated values).
|
|
32
|
-
*/
|
|
33
|
-
devDependencies?: string;
|
|
34
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# <%= name %>
|
|
2
|
-
|
|
3
|
-
## Description
|
|
4
|
-
|
|
5
|
-
<%= description %>
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
$ <%= packageManager %> install
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Running the app
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# development
|
|
17
|
-
$ <%= packageManager %> run start
|
|
18
|
-
|
|
19
|
-
# watch mode
|
|
20
|
-
$ <%= packageManager %> run start:dev
|
|
21
|
-
|
|
22
|
-
# production mode
|
|
23
|
-
<%= packageManager %> run start:prod
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Test
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# unit tests
|
|
30
|
-
$ <%= packageManager %> run test
|
|
31
|
-
|
|
32
|
-
# e2e tests
|
|
33
|
-
$ <%= packageManager %> run test:e2e
|
|
34
|
-
|
|
35
|
-
# test coverage
|
|
36
|
-
$ <%= packageManager %> run test:cov
|
|
37
|
-
```
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= name %>",
|
|
3
|
-
"version": "<%= version %>",
|
|
4
|
-
"description": "<%= description %>",
|
|
5
|
-
"author": "<%= author %>",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"format": "prettier --write \"**/*.js\"",
|
|
9
|
-
"start": "babel-node index.js",
|
|
10
|
-
"start:dev": "nodemon",
|
|
11
|
-
"test": "jest",
|
|
12
|
-
"test:cov": "jest --coverage",
|
|
13
|
-
"test:e2e": "jest --config ./test/jest-e2e.json"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@nestjs/common": "^6.0.0",
|
|
17
|
-
"@nestjs/core": "^6.0.0",
|
|
18
|
-
"@nestjs/platform-express": "^6.0.0", <% if (dependencies.indexOf('microservices') !== -1) { %>
|
|
19
|
-
"@nestjs/microservices": "^6.0.0", <% } %><% if (dependencies.indexOf('websockets') !== -1) { %>
|
|
20
|
-
"@nestjs/websockets": "^6.0.0", <% } %>
|
|
21
|
-
"reflect-metadata": "^0.1.12",
|
|
22
|
-
"rxjs": "^6.4.1"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@nestjs/testing": "^6.0.0",
|
|
26
|
-
"babel-cli": "^6.26.0",
|
|
27
|
-
"babel-core": "^6.26.0",
|
|
28
|
-
"babel-plugin-transform-decorators-legacy": "^1.3.4",
|
|
29
|
-
"babel-polyfill": "^6.26.0",
|
|
30
|
-
"babel-preset-env": "^1.6.0",
|
|
31
|
-
"babel-preset-stage-0": "^6.24.1",
|
|
32
|
-
"jest": "^22.4.3",
|
|
33
|
-
"nodemon": "^1.14.1",
|
|
34
|
-
"prettier": "^1.11.1",
|
|
35
|
-
"supertest": "^3.0.0"
|
|
36
|
-
},
|
|
37
|
-
"jest": {
|
|
38
|
-
"moduleFileExtensions": [
|
|
39
|
-
"js",
|
|
40
|
-
"json"
|
|
41
|
-
],
|
|
42
|
-
"rootDir": "src",
|
|
43
|
-
"testRegex": ".spec.js$",
|
|
44
|
-
"coverageDirectory": "../coverage"
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Test } from '@nestjs/testing';
|
|
2
|
-
import * as request from 'supertest';
|
|
3
|
-
import { AppModule } from '../src/app.module';
|
|
4
|
-
|
|
5
|
-
describe('AppController (e2e)', () => {
|
|
6
|
-
let app;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
const moduleFixture = await Test.createTestingModule({
|
|
10
|
-
imports: [AppModule],
|
|
11
|
-
}).compile();
|
|
12
|
-
|
|
13
|
-
app = moduleFixture.createNestApplication();
|
|
14
|
-
await app.init();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('/ (GET)', () => {
|
|
18
|
-
return request(app.getHttpServer())
|
|
19
|
-
.get('/')
|
|
20
|
-
.expect(200)
|
|
21
|
-
.expect('Hello World!');
|
|
22
|
-
});
|
|
23
|
-
});
|