@gapi/schematics 1.8.169 → 1.8.170
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/dist/lib/application/application.factory.js +5 -6
- package/dist/lib/application/application.factory.test.ts +5 -1
- package/dist/lib/application/application.factory.ts +1 -0
- package/dist/lib/application/files/ts/src/app.controller.spec.ts +1 -0
- package/dist/lib/application/files/ts/src/app.controller.ts +1 -0
- package/dist/lib/application/files/ts/src/app.module.ts +1 -0
- package/dist/lib/application/files/ts/src/main.ts +1 -0
- package/dist/lib/application/files/ts/test/app.e2e-spec.ts +1 -0
- package/dist/lib/class/class.factory.js +7 -8
- package/dist/lib/class/class.factory.test.ts +9 -6
- package/dist/lib/class/class.factory.ts +2 -1
- package/dist/lib/client-app/angular/angular.factory.js +12 -13
- package/dist/lib/client-app/angular/angular.factory.ts +5 -4
- package/dist/lib/client-app/angular/files/angular.module.ts +1 -0
- package/dist/lib/client-app/angular/files/angular.providers.ts +1 -0
- package/dist/lib/client-app/angular/files/loaders/abstract.loader.ts +1 -0
- package/dist/lib/client-app/angular/files/loaders/express.loader.ts +1 -0
- package/dist/lib/client-app/angular/files/loaders/fastify.loader.ts +1 -0
- package/dist/lib/client-app/angular/files/loaders/noop.loader.ts +1 -0
- package/dist/lib/component/component.factory.js +9 -10
- package/dist/lib/component/component.factory.test.ts +13 -12
- package/dist/lib/component/component.factory.ts +2 -1
- package/dist/lib/configuration/configuration.factory.js +5 -6
- package/dist/lib/configuration/configuration.factory.test.ts +4 -3
- package/dist/lib/configuration/configuration.factory.ts +1 -0
- package/dist/lib/controller/controller.factory.js +9 -10
- package/dist/lib/controller/controller.factory.test.ts +13 -12
- package/dist/lib/controller/controller.factory.ts +2 -1
- package/dist/lib/decorator/decorator.factory.js +6 -7
- package/dist/lib/decorator/decorator.factory.test.ts +7 -6
- package/dist/lib/decorator/decorator.factory.ts +1 -0
- package/dist/lib/effect/effect.factory.js +10 -12
- package/dist/lib/effect/effect.factory.test.ts +12 -11
- package/dist/lib/effect/effect.factory.ts +3 -3
- package/dist/lib/filter/filter.factory.js +7 -8
- package/dist/lib/filter/filter.factory.test.ts +12 -7
- package/dist/lib/filter/filter.factory.ts +2 -1
- package/dist/lib/gateway/gateway.factory.js +9 -10
- package/dist/lib/gateway/gateway.factory.test.ts +7 -6
- package/dist/lib/gateway/gateway.factory.ts +2 -1
- package/dist/lib/guard/guard.factory.js +7 -8
- package/dist/lib/guard/guard.factory.test.ts +7 -6
- package/dist/lib/guard/guard.factory.ts +2 -1
- package/dist/lib/interceptor/interceptor.factory.js +7 -8
- package/dist/lib/interceptor/interceptor.factory.test.ts +7 -6
- package/dist/lib/interceptor/interceptor.factory.ts +2 -1
- package/dist/lib/interface/interface.factory.js +6 -7
- package/dist/lib/interface/interface.factory.test.ts +6 -5
- package/dist/lib/interface/interface.factory.ts +1 -0
- package/dist/lib/library/library.factory.js +13 -14
- package/dist/lib/library/library.factory.test.ts +1 -0
- package/dist/lib/library/library.factory.ts +2 -1
- package/dist/lib/module/module.factory.js +8 -9
- package/dist/lib/module/module.factory.test.ts +7 -6
- package/dist/lib/module/module.factory.ts +1 -0
- package/dist/lib/pipe/pipe.factory.js +7 -8
- package/dist/lib/pipe/pipe.factory.test.ts +7 -6
- package/dist/lib/pipe/pipe.factory.ts +2 -1
- package/dist/lib/plugin/plugin.factory.d.ts +1 -0
- package/dist/lib/plugin/plugin.factory.test.ts +13 -12
- package/dist/lib/plugin/plugin.factory.ts +2 -1
- package/dist/lib/provider/provider.factory.d.ts +1 -0
- package/dist/lib/provider/provider.factory.test.ts +11 -10
- package/dist/lib/provider/provider.factory.ts +2 -1
- package/dist/lib/resolver/resolver.factory.js +9 -10
- package/dist/lib/resolver/resolver.factory.test.ts +13 -12
- package/dist/lib/resolver/resolver.factory.ts +2 -1
- package/dist/lib/service/service.factory.js +10 -12
- package/dist/lib/service/service.factory.test.ts +12 -11
- package/dist/lib/service/service.factory.ts +3 -3
- package/dist/lib/type/type.factory.d.ts +1 -0
- package/dist/lib/type/type.factory.test.ts +13 -12
- package/dist/lib/type/type.factory.ts +2 -1
- package/dist/utils/metadata.manager.js +9 -9
- package/dist/utils/metadata.manager.ts +13 -10
- package/dist/utils/module-import.declarator.js +4 -4
- package/dist/utils/module-import.declarator.ts +3 -2
- package/dist/utils/module.declarator.js +2 -2
- package/dist/utils/module.declarator.ts +2 -0
- package/dist/utils/module.finder.js +2 -2
- package/dist/utils/module.finder.ts +1 -1
- package/dist/utils/name.parser.js +3 -5
- package/dist/utils/name.parser.ts +5 -6
- package/dist/utils/path.solver.js +2 -4
- package/dist/utils/path.solver.ts +2 -3
- package/dist/utils/source-root.helpers.js +6 -6
- package/dist/utils/source-root.helpers.ts +4 -2
- package/eslint.config.mjs +38 -0
- package/package.json +2 -2
- package/src/lib/application/application.factory.test.ts +5 -1
- package/src/lib/application/application.factory.ts +1 -0
- package/src/lib/application/files/ts/src/app.controller.spec.ts +1 -0
- package/src/lib/application/files/ts/src/app.controller.ts +1 -0
- package/src/lib/application/files/ts/src/app.module.ts +1 -0
- package/src/lib/application/files/ts/src/main.ts +1 -0
- package/src/lib/application/files/ts/test/app.e2e-spec.ts +1 -0
- package/src/lib/class/class.factory.test.ts +9 -6
- package/src/lib/class/class.factory.ts +2 -1
- package/src/lib/client-app/angular/angular.factory.ts +5 -4
- package/src/lib/client-app/angular/files/angular.module.ts +1 -0
- package/src/lib/client-app/angular/files/angular.providers.ts +1 -0
- package/src/lib/client-app/angular/files/loaders/abstract.loader.ts +1 -0
- package/src/lib/client-app/angular/files/loaders/express.loader.ts +1 -0
- package/src/lib/client-app/angular/files/loaders/fastify.loader.ts +1 -0
- package/src/lib/client-app/angular/files/loaders/noop.loader.ts +1 -0
- package/src/lib/component/component.factory.test.ts +13 -12
- package/src/lib/component/component.factory.ts +2 -1
- package/src/lib/configuration/configuration.factory.test.ts +4 -3
- package/src/lib/configuration/configuration.factory.ts +1 -0
- package/src/lib/controller/controller.factory.test.ts +13 -12
- package/src/lib/controller/controller.factory.ts +2 -1
- package/src/lib/decorator/decorator.factory.test.ts +7 -6
- package/src/lib/decorator/decorator.factory.ts +1 -0
- package/src/lib/effect/effect.factory.test.ts +12 -11
- package/src/lib/effect/effect.factory.ts +3 -3
- package/src/lib/filter/filter.factory.test.ts +12 -7
- package/src/lib/filter/filter.factory.ts +2 -1
- package/src/lib/gateway/gateway.factory.test.ts +7 -6
- package/src/lib/gateway/gateway.factory.ts +2 -1
- package/src/lib/guard/guard.factory.test.ts +7 -6
- package/src/lib/guard/guard.factory.ts +2 -1
- package/src/lib/interceptor/interceptor.factory.test.ts +7 -6
- package/src/lib/interceptor/interceptor.factory.ts +2 -1
- package/src/lib/interface/interface.factory.test.ts +6 -5
- package/src/lib/interface/interface.factory.ts +1 -0
- package/src/lib/library/library.factory.test.ts +1 -0
- package/src/lib/library/library.factory.ts +2 -1
- package/src/lib/module/module.factory.test.ts +7 -6
- package/src/lib/module/module.factory.ts +1 -0
- package/src/lib/pipe/pipe.factory.test.ts +7 -6
- package/src/lib/pipe/pipe.factory.ts +2 -1
- package/src/lib/plugin/plugin.factory.d.ts +1 -0
- package/src/lib/plugin/plugin.factory.test.ts +13 -12
- package/src/lib/plugin/plugin.factory.ts +2 -1
- package/src/lib/provider/provider.factory.d.ts +1 -0
- package/src/lib/provider/provider.factory.test.ts +11 -10
- package/src/lib/provider/provider.factory.ts +2 -1
- package/src/lib/resolver/resolver.factory.test.ts +13 -12
- package/src/lib/resolver/resolver.factory.ts +2 -1
- package/src/lib/service/service.factory.test.ts +12 -11
- package/src/lib/service/service.factory.ts +3 -3
- package/src/lib/type/type.factory.d.ts +1 -0
- package/src/lib/type/type.factory.test.ts +13 -12
- package/src/lib/type/type.factory.ts +2 -1
- package/src/utils/metadata.manager.ts +13 -10
- package/src/utils/module-import.declarator.ts +3 -2
- package/src/utils/module.declarator.ts +2 -0
- package/src/utils/module.finder.ts +1 -1
- package/src/utils/name.parser.ts +5 -6
- package/src/utils/path.solver.ts +2 -3
- package/src/utils/source-root.helpers.ts +4 -2
|
@@ -1,15 +1,14 @@
|
|
|
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");
|
|
7
7
|
const source_root_helpers_1 = require("../../utils/source-root.helpers");
|
|
8
8
|
function main(options) {
|
|
9
9
|
options = transform(options);
|
|
10
|
-
return schematics_1.chain([source_root_helpers_1.mergeSourceRoot(options), schematics_1.mergeWith(generate(options))]);
|
|
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) {
|
|
@@ -21,13 +20,13 @@ function transform(options) {
|
|
|
21
20
|
target.language = target.language !== undefined ? target.language : 'ts';
|
|
22
21
|
target.path = target.flat
|
|
23
22
|
? target.path
|
|
24
|
-
: core_1.join(target.path, target.name);
|
|
23
|
+
: (0, core_1.join)(target.path, target.name);
|
|
25
24
|
return target;
|
|
26
25
|
}
|
|
27
26
|
function generate(options) {
|
|
28
|
-
return (context) => schematics_1.apply(schematics_1.url(core_1.join('./files', options.language)), [
|
|
29
|
-
options.spec ? schematics_1.noop() : schematics_1.filter(path => !path.endsWith('.spec.ts')),
|
|
30
|
-
schematics_1.template(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
31
|
-
schematics_1.move(options.path),
|
|
27
|
+
return (context) => (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
28
|
+
options.spec ? (0, schematics_1.noop)() : (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts')),
|
|
29
|
+
(0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
30
|
+
(0, schematics_1.move)(options.path),
|
|
32
31
|
])(context);
|
|
33
32
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
UnitTestTree,
|
|
4
4
|
} from '@angular-devkit/schematics/testing';
|
|
5
5
|
import * as path from 'path';
|
|
6
|
+
|
|
6
7
|
import { GuardOptions } from './guard.schema';
|
|
7
8
|
|
|
8
9
|
describe('Guard Factory', () => {
|
|
@@ -18,7 +19,7 @@ describe('Guard Factory', () => {
|
|
|
18
19
|
const tree: UnitTestTree = runner.runSchematic('guard', options);
|
|
19
20
|
const files: string[] = tree.files;
|
|
20
21
|
expect(
|
|
21
|
-
files.find(filename => filename === '/foo.guard.ts'),
|
|
22
|
+
files.find((filename) => filename === '/foo.guard.ts'),
|
|
22
23
|
).not.toBeUndefined();
|
|
23
24
|
expect(tree.readContent('/foo.guard.ts')).toEqual(
|
|
24
25
|
"import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';\n" +
|
|
@@ -42,7 +43,7 @@ describe('Guard Factory', () => {
|
|
|
42
43
|
const tree: UnitTestTree = runner.runSchematic('guard', options);
|
|
43
44
|
const files: string[] = tree.files;
|
|
44
45
|
expect(
|
|
45
|
-
files.find(filename => filename === '/bar/foo.guard.ts'),
|
|
46
|
+
files.find((filename) => filename === '/bar/foo.guard.ts'),
|
|
46
47
|
).not.toBeUndefined();
|
|
47
48
|
expect(tree.readContent('/bar/foo.guard.ts')).toEqual(
|
|
48
49
|
"import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';\n" +
|
|
@@ -67,7 +68,7 @@ describe('Guard Factory', () => {
|
|
|
67
68
|
const tree: UnitTestTree = runner.runSchematic('guard', options);
|
|
68
69
|
const files: string[] = tree.files;
|
|
69
70
|
expect(
|
|
70
|
-
files.find(filename => filename === '/baz/foo.guard.ts'),
|
|
71
|
+
files.find((filename) => filename === '/baz/foo.guard.ts'),
|
|
71
72
|
).not.toBeUndefined();
|
|
72
73
|
expect(tree.readContent('/baz/foo.guard.ts')).toEqual(
|
|
73
74
|
"import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';\n" +
|
|
@@ -91,7 +92,7 @@ describe('Guard Factory', () => {
|
|
|
91
92
|
const tree: UnitTestTree = runner.runSchematic('guard', options);
|
|
92
93
|
const files: string[] = tree.files;
|
|
93
94
|
expect(
|
|
94
|
-
files.find(filename => filename === '/foo-bar.guard.ts'),
|
|
95
|
+
files.find((filename) => filename === '/foo-bar.guard.ts'),
|
|
95
96
|
).not.toBeUndefined();
|
|
96
97
|
expect(tree.readContent('/foo-bar.guard.ts')).toEqual(
|
|
97
98
|
"import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';\n" +
|
|
@@ -115,7 +116,7 @@ describe('Guard Factory', () => {
|
|
|
115
116
|
const tree: UnitTestTree = runner.runSchematic('guard', options);
|
|
116
117
|
const files: string[] = tree.files;
|
|
117
118
|
expect(
|
|
118
|
-
files.find(filename => filename === '/bar-baz/foo.guard.ts'),
|
|
119
|
+
files.find((filename) => filename === '/bar-baz/foo.guard.ts'),
|
|
119
120
|
).not.toBeUndefined();
|
|
120
121
|
expect(tree.readContent('/bar-baz/foo.guard.ts')).toEqual(
|
|
121
122
|
"import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';\n" +
|
|
@@ -140,7 +141,7 @@ describe('Guard Factory', () => {
|
|
|
140
141
|
const tree: UnitTestTree = runner.runSchematic('guard', options);
|
|
141
142
|
const files: string[] = tree.files;
|
|
142
143
|
expect(
|
|
143
|
-
files.find(filename => filename === '/foo.guard.js'),
|
|
144
|
+
files.find((filename) => filename === '/foo.guard.js'),
|
|
144
145
|
).not.toBeUndefined();
|
|
145
146
|
expect(tree.readContent('/foo.guard.js')).toEqual(
|
|
146
147
|
"import { Injectable } from '@nestjs/common';\n" +
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
template,
|
|
14
14
|
url,
|
|
15
15
|
} from '@angular-devkit/schematics';
|
|
16
|
+
|
|
16
17
|
import { Location, NameParser } from '../../utils/name.parser';
|
|
17
18
|
import { mergeSourceRoot } from '../../utils/source-root.helpers';
|
|
18
19
|
import { GuardOptions } from './guard.schema';
|
|
@@ -41,7 +42,7 @@ function transform(options: GuardOptions): GuardOptions {
|
|
|
41
42
|
function generate(options: GuardOptions): Source {
|
|
42
43
|
return (context: SchematicContext) =>
|
|
43
44
|
apply(url(join('./files' as Path, options.language)), [
|
|
44
|
-
options.spec ? noop() : filter(path => !path.endsWith('.spec.ts')),
|
|
45
|
+
options.spec ? noop() : filter((path) => !path.endsWith('.spec.ts')),
|
|
45
46
|
template({
|
|
46
47
|
...strings,
|
|
47
48
|
...options,
|
|
@@ -1,15 +1,14 @@
|
|
|
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");
|
|
7
7
|
const source_root_helpers_1 = require("../../utils/source-root.helpers");
|
|
8
8
|
function main(options) {
|
|
9
9
|
options = transform(options);
|
|
10
|
-
return schematics_1.chain([source_root_helpers_1.mergeSourceRoot(options), schematics_1.mergeWith(generate(options))]);
|
|
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) {
|
|
@@ -21,13 +20,13 @@ function transform(options) {
|
|
|
21
20
|
target.language = target.language !== undefined ? target.language : 'ts';
|
|
22
21
|
target.path = target.flat
|
|
23
22
|
? target.path
|
|
24
|
-
: core_1.join(target.path, target.name);
|
|
23
|
+
: (0, core_1.join)(target.path, target.name);
|
|
25
24
|
return target;
|
|
26
25
|
}
|
|
27
26
|
function generate(options) {
|
|
28
|
-
return (context) => schematics_1.apply(schematics_1.url(core_1.join('./files', options.language)), [
|
|
29
|
-
options.spec ? schematics_1.noop() : schematics_1.filter(path => !path.endsWith('.spec.ts')),
|
|
30
|
-
schematics_1.template(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
31
|
-
schematics_1.move(options.path),
|
|
27
|
+
return (context) => (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
28
|
+
options.spec ? (0, schematics_1.noop)() : (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts')),
|
|
29
|
+
(0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
30
|
+
(0, schematics_1.move)(options.path),
|
|
32
31
|
])(context);
|
|
33
32
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
UnitTestTree,
|
|
4
4
|
} from '@angular-devkit/schematics/testing';
|
|
5
5
|
import * as path from 'path';
|
|
6
|
+
|
|
6
7
|
import { InterceptorOptions } from './interceptor.schema';
|
|
7
8
|
|
|
8
9
|
describe('Interceptor Factory', () => {
|
|
@@ -18,7 +19,7 @@ describe('Interceptor Factory', () => {
|
|
|
18
19
|
const tree: UnitTestTree = runner.runSchematic('interceptor', options);
|
|
19
20
|
const files: string[] = tree.files;
|
|
20
21
|
expect(
|
|
21
|
-
files.find(filename => filename === '/foo.interceptor.ts'),
|
|
22
|
+
files.find((filename) => filename === '/foo.interceptor.ts'),
|
|
22
23
|
).toBeDefined();
|
|
23
24
|
expect(tree.readContent('/foo.interceptor.ts')).toEqual(
|
|
24
25
|
"import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';\n" +
|
|
@@ -40,7 +41,7 @@ describe('Interceptor Factory', () => {
|
|
|
40
41
|
const tree: UnitTestTree = runner.runSchematic('interceptor', options);
|
|
41
42
|
const files: string[] = tree.files;
|
|
42
43
|
expect(
|
|
43
|
-
files.find(filename => filename === '/bar/foo.interceptor.ts'),
|
|
44
|
+
files.find((filename) => filename === '/bar/foo.interceptor.ts'),
|
|
44
45
|
).toBeDefined();
|
|
45
46
|
expect(tree.readContent('/bar/foo.interceptor.ts')).toEqual(
|
|
46
47
|
"import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';\n" +
|
|
@@ -63,7 +64,7 @@ describe('Interceptor Factory', () => {
|
|
|
63
64
|
const tree: UnitTestTree = runner.runSchematic('interceptor', options);
|
|
64
65
|
const files: string[] = tree.files;
|
|
65
66
|
expect(
|
|
66
|
-
files.find(filename => filename === '/baz/foo.interceptor.ts'),
|
|
67
|
+
files.find((filename) => filename === '/baz/foo.interceptor.ts'),
|
|
67
68
|
).toBeDefined();
|
|
68
69
|
expect(tree.readContent('/baz/foo.interceptor.ts')).toEqual(
|
|
69
70
|
"import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';\n" +
|
|
@@ -85,7 +86,7 @@ describe('Interceptor Factory', () => {
|
|
|
85
86
|
const tree: UnitTestTree = runner.runSchematic('interceptor', options);
|
|
86
87
|
const files: string[] = tree.files;
|
|
87
88
|
expect(
|
|
88
|
-
files.find(filename => filename === '/foo-bar.interceptor.ts'),
|
|
89
|
+
files.find((filename) => filename === '/foo-bar.interceptor.ts'),
|
|
89
90
|
).toBeDefined();
|
|
90
91
|
expect(tree.readContent('/foo-bar.interceptor.ts')).toEqual(
|
|
91
92
|
"import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';\n" +
|
|
@@ -107,7 +108,7 @@ describe('Interceptor Factory', () => {
|
|
|
107
108
|
const tree: UnitTestTree = runner.runSchematic('interceptor', options);
|
|
108
109
|
const files: string[] = tree.files;
|
|
109
110
|
expect(
|
|
110
|
-
files.find(filename => filename === '/bar-baz/foo.interceptor.ts'),
|
|
111
|
+
files.find((filename) => filename === '/bar-baz/foo.interceptor.ts'),
|
|
111
112
|
).toBeDefined();
|
|
112
113
|
expect(tree.readContent('/bar-baz/foo.interceptor.ts')).toEqual(
|
|
113
114
|
"import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';\n" +
|
|
@@ -130,7 +131,7 @@ describe('Interceptor Factory', () => {
|
|
|
130
131
|
const tree: UnitTestTree = runner.runSchematic('interceptor', options);
|
|
131
132
|
const files: string[] = tree.files;
|
|
132
133
|
expect(
|
|
133
|
-
files.find(filename => filename === '/foo.interceptor.js'),
|
|
134
|
+
files.find((filename) => filename === '/foo.interceptor.js'),
|
|
134
135
|
).toBeDefined();
|
|
135
136
|
expect(tree.readContent('/foo.interceptor.js')).toEqual(
|
|
136
137
|
"import { Injectable } from '@nestjs/common';\n" +
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
template,
|
|
14
14
|
url,
|
|
15
15
|
} from '@angular-devkit/schematics';
|
|
16
|
+
|
|
16
17
|
import { Location, NameParser } from '../../utils/name.parser';
|
|
17
18
|
import { mergeSourceRoot } from '../../utils/source-root.helpers';
|
|
18
19
|
import { InterceptorOptions } from './interceptor.schema';
|
|
@@ -41,7 +42,7 @@ function transform(options: InterceptorOptions): InterceptorOptions {
|
|
|
41
42
|
function generate(options: InterceptorOptions): Source {
|
|
42
43
|
return (context: SchematicContext) =>
|
|
43
44
|
apply(url(join('./files' as Path, options.language)), [
|
|
44
|
-
options.spec ? noop() : filter(path => !path.endsWith('.spec.ts')),
|
|
45
|
+
options.spec ? noop() : filter((path) => !path.endsWith('.spec.ts')),
|
|
45
46
|
template({
|
|
46
47
|
...strings,
|
|
47
48
|
...options,
|
|
@@ -1,15 +1,14 @@
|
|
|
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");
|
|
7
7
|
const source_root_helpers_1 = require("../../utils/source-root.helpers");
|
|
8
8
|
function main(options) {
|
|
9
9
|
options = transform(options);
|
|
10
|
-
return schematics_1.chain([source_root_helpers_1.mergeSourceRoot(options), schematics_1.mergeWith(generate(options))]);
|
|
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) {
|
|
@@ -20,12 +19,12 @@ function transform(options) {
|
|
|
20
19
|
target.path = core_1.strings.dasherize(location.path);
|
|
21
20
|
target.path = target.flat
|
|
22
21
|
? target.path
|
|
23
|
-
: core_1.join(target.path, target.name);
|
|
22
|
+
: (0, core_1.join)(target.path, target.name);
|
|
24
23
|
return target;
|
|
25
24
|
}
|
|
26
25
|
function generate(options) {
|
|
27
|
-
return (context) => schematics_1.apply(schematics_1.url('./files'), [
|
|
28
|
-
schematics_1.template(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
29
|
-
schematics_1.move(options.path),
|
|
26
|
+
return (context) => (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
27
|
+
(0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
28
|
+
(0, schematics_1.move)(options.path),
|
|
30
29
|
])(context);
|
|
31
30
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
UnitTestTree,
|
|
4
4
|
} from '@angular-devkit/schematics/testing';
|
|
5
5
|
import * as path from 'path';
|
|
6
|
+
|
|
6
7
|
import { InterfaceOptions } from './interface.schema';
|
|
7
8
|
|
|
8
9
|
describe('Interface Factory', () => {
|
|
@@ -18,7 +19,7 @@ describe('Interface Factory', () => {
|
|
|
18
19
|
const tree: UnitTestTree = runner.runSchematic('interface', options);
|
|
19
20
|
const files: string[] = tree.files;
|
|
20
21
|
expect(
|
|
21
|
-
files.find(filename => filename === '/foo.interface.ts'),
|
|
22
|
+
files.find((filename) => filename === '/foo.interface.ts'),
|
|
22
23
|
).toBeDefined();
|
|
23
24
|
expect(tree.readContent('/foo.interface.ts')).toEqual(
|
|
24
25
|
'export interface Foo {}\n',
|
|
@@ -32,7 +33,7 @@ describe('Interface Factory', () => {
|
|
|
32
33
|
const tree: UnitTestTree = runner.runSchematic('interface', options);
|
|
33
34
|
const files: string[] = tree.files;
|
|
34
35
|
expect(
|
|
35
|
-
files.find(filename => filename === '/bar/foo.interface.ts'),
|
|
36
|
+
files.find((filename) => filename === '/bar/foo.interface.ts'),
|
|
36
37
|
).toBeDefined();
|
|
37
38
|
expect(tree.readContent('/bar/foo.interface.ts')).toEqual(
|
|
38
39
|
'export interface Foo {}\n',
|
|
@@ -47,7 +48,7 @@ describe('Interface Factory', () => {
|
|
|
47
48
|
const tree: UnitTestTree = runner.runSchematic('interface', options);
|
|
48
49
|
const files: string[] = tree.files;
|
|
49
50
|
expect(
|
|
50
|
-
files.find(filename => filename === '/baz/foo.interface.ts'),
|
|
51
|
+
files.find((filename) => filename === '/baz/foo.interface.ts'),
|
|
51
52
|
).toBeDefined();
|
|
52
53
|
expect(tree.readContent('/baz/foo.interface.ts')).toEqual(
|
|
53
54
|
'export interface Foo {}\n',
|
|
@@ -61,7 +62,7 @@ describe('Interface Factory', () => {
|
|
|
61
62
|
const tree: UnitTestTree = runner.runSchematic('interface', options);
|
|
62
63
|
const files: string[] = tree.files;
|
|
63
64
|
expect(
|
|
64
|
-
files.find(filename => filename === '/foo-bar.interface.ts'),
|
|
65
|
+
files.find((filename) => filename === '/foo-bar.interface.ts'),
|
|
65
66
|
).toBeDefined();
|
|
66
67
|
expect(tree.readContent('/foo-bar.interface.ts')).toEqual(
|
|
67
68
|
'export interface FooBar {}\n',
|
|
@@ -75,7 +76,7 @@ describe('Interface Factory', () => {
|
|
|
75
76
|
const tree: UnitTestTree = runner.runSchematic('interface', options);
|
|
76
77
|
const files: string[] = tree.files;
|
|
77
78
|
expect(
|
|
78
|
-
files.find(filename => filename === '/bar-baz/foo.interface.ts'),
|
|
79
|
+
files.find((filename) => filename === '/bar-baz/foo.interface.ts'),
|
|
79
80
|
).toBeDefined();
|
|
80
81
|
expect(tree.readContent('/bar-baz/foo.interface.ts')).toEqual(
|
|
81
82
|
'export interface Foo {}\n',
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
template,
|
|
12
12
|
url,
|
|
13
13
|
} from '@angular-devkit/schematics';
|
|
14
|
+
|
|
14
15
|
import { Location, NameParser } from '../../utils/name.parser';
|
|
15
16
|
import { mergeSourceRoot } from '../../utils/source-root.helpers';
|
|
16
17
|
import { InterfaceOptions } from './interface.schema';
|
|
@@ -1,18 +1,17 @@
|
|
|
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 defaults_1 = require("../defaults");
|
|
7
7
|
function main(options) {
|
|
8
8
|
options = transform(options);
|
|
9
|
-
return schematics_1.chain([
|
|
9
|
+
return (0, schematics_1.chain)([
|
|
10
10
|
updateTsConfig(options.name, options.prefix, options.path),
|
|
11
11
|
addLibraryToCliOptions(options.path, options.name),
|
|
12
|
-
schematics_1.branchAndMerge(schematics_1.mergeWith(generate(options))),
|
|
12
|
+
(0, schematics_1.branchAndMerge)((0, schematics_1.mergeWith)(generate(options))),
|
|
13
13
|
]);
|
|
14
14
|
}
|
|
15
|
-
exports.main = main;
|
|
16
15
|
function transform(options) {
|
|
17
16
|
const target = Object.assign({}, options);
|
|
18
17
|
const defaultSourceRoot = options.rootDir !== undefined ? options.rootDir : defaults_1.DEFAULT_LIB_PATH;
|
|
@@ -23,8 +22,8 @@ function transform(options) {
|
|
|
23
22
|
target.name = core_1.strings.dasherize(target.name);
|
|
24
23
|
target.path =
|
|
25
24
|
target.path !== undefined
|
|
26
|
-
? core_1.join(core_1.normalize(defaultSourceRoot), target.path)
|
|
27
|
-
: core_1.normalize(defaultSourceRoot);
|
|
25
|
+
? (0, core_1.join)((0, core_1.normalize)(defaultSourceRoot), target.path)
|
|
26
|
+
: (0, core_1.normalize)(defaultSourceRoot);
|
|
28
27
|
target.prefix = target.prefix || '@app';
|
|
29
28
|
return target;
|
|
30
29
|
}
|
|
@@ -32,7 +31,7 @@ function updateJsonFile(host, path, callback) {
|
|
|
32
31
|
const source = host.read(path);
|
|
33
32
|
if (source) {
|
|
34
33
|
const sourceText = source.toString('utf-8');
|
|
35
|
-
const json = core_1.parseJson(sourceText);
|
|
34
|
+
const json = (0, core_1.parseJson)(sourceText);
|
|
36
35
|
callback(json);
|
|
37
36
|
host.overwrite(path, JSON.stringify(json, null, 2));
|
|
38
37
|
}
|
|
@@ -43,7 +42,7 @@ function updateTsConfig(packageName, packagePrefix, root) {
|
|
|
43
42
|
if (!host.exists('tsconfig.json')) {
|
|
44
43
|
return host;
|
|
45
44
|
}
|
|
46
|
-
const distRoot = core_1.join(root, packageName, 'src');
|
|
45
|
+
const distRoot = (0, core_1.join)(root, packageName, 'src');
|
|
47
46
|
const packageKey = packagePrefix
|
|
48
47
|
? packagePrefix + '/' + packageName
|
|
49
48
|
: packageName;
|
|
@@ -71,8 +70,8 @@ function updateTsConfig(packageName, packagePrefix, root) {
|
|
|
71
70
|
}
|
|
72
71
|
function addLibraryToCliOptions(projectRoot, projectName) {
|
|
73
72
|
const project = {
|
|
74
|
-
root: core_1.join(projectRoot, projectName),
|
|
75
|
-
sourceRoot: core_1.join(projectRoot, projectName, 'src'),
|
|
73
|
+
root: (0, core_1.join)(projectRoot, projectName),
|
|
74
|
+
sourceRoot: (0, core_1.join)(projectRoot, projectName, 'src'),
|
|
76
75
|
};
|
|
77
76
|
return (host) => {
|
|
78
77
|
const nestCliFileExists = host.exists('nest-cli.json');
|
|
@@ -89,9 +88,9 @@ function addLibraryToCliOptions(projectRoot, projectName) {
|
|
|
89
88
|
};
|
|
90
89
|
}
|
|
91
90
|
function generate(options) {
|
|
92
|
-
const path = core_1.join(options.path, options.name);
|
|
93
|
-
return schematics_1.apply(schematics_1.url(core_1.join('./files', options.language)), [
|
|
94
|
-
schematics_1.template(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
95
|
-
schematics_1.move(path),
|
|
91
|
+
const path = (0, core_1.join)(options.path, options.name);
|
|
92
|
+
return (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
93
|
+
(0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
94
|
+
(0, schematics_1.move)(path),
|
|
96
95
|
]);
|
|
97
96
|
}
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
Tree,
|
|
19
19
|
url,
|
|
20
20
|
} from '@angular-devkit/schematics';
|
|
21
|
+
|
|
21
22
|
import { DEFAULT_LANGUAGE, DEFAULT_LIB_PATH } from '../defaults';
|
|
22
23
|
import { LibraryOptions } from './library.schema';
|
|
23
24
|
|
|
@@ -68,7 +69,7 @@ function updateJsonFile<T>(
|
|
|
68
69
|
if (source) {
|
|
69
70
|
const sourceText = source.toString('utf-8');
|
|
70
71
|
const json = parseJson(sourceText);
|
|
71
|
-
callback(
|
|
72
|
+
callback(json as {} as T);
|
|
72
73
|
host.overwrite(path, JSON.stringify(json, null, 2));
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -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");
|
|
@@ -10,28 +10,27 @@ const source_root_helpers_1 = require("../../utils/source-root.helpers");
|
|
|
10
10
|
function main(options) {
|
|
11
11
|
options = transform(options);
|
|
12
12
|
return (tree, context) => {
|
|
13
|
-
return schematics_1.branchAndMerge(schematics_1.chain([
|
|
14
|
-
source_root_helpers_1.mergeSourceRoot(options),
|
|
13
|
+
return (0, schematics_1.branchAndMerge)((0, schematics_1.chain)([
|
|
14
|
+
(0, source_root_helpers_1.mergeSourceRoot)(options),
|
|
15
15
|
addDeclarationToModule(options),
|
|
16
|
-
schematics_1.mergeWith(generate(options)),
|
|
16
|
+
(0, schematics_1.mergeWith)(generate(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';
|
|
24
23
|
target.type = 'module';
|
|
25
24
|
const location = new name_parser_1.NameParser().parse(target);
|
|
26
25
|
target.name = core_1.strings.dasherize(location.name);
|
|
27
|
-
target.path = core_1.join(core_1.strings.dasherize(location.path), target.name);
|
|
26
|
+
target.path = (0, core_1.join)(core_1.strings.dasherize(location.path), target.name);
|
|
28
27
|
target.language = target.language !== undefined ? target.language : 'ts';
|
|
29
28
|
return target;
|
|
30
29
|
}
|
|
31
30
|
function generate(options) {
|
|
32
|
-
return (context) => schematics_1.apply(schematics_1.url(core_1.join('./files', options.language)), [
|
|
33
|
-
schematics_1.template(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
34
|
-
schematics_1.move(options.path),
|
|
31
|
+
return (context) => (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.path),
|
|
35
34
|
])(context);
|
|
36
35
|
}
|
|
37
36
|
function addDeclarationToModule(options) {
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
UnitTestTree,
|
|
5
5
|
} from '@angular-devkit/schematics/testing';
|
|
6
6
|
import * as path from 'path';
|
|
7
|
+
|
|
7
8
|
import { ApplicationOptions } from '../application/application.schema';
|
|
8
9
|
import { ModuleOptions } from './module.schema';
|
|
9
10
|
|
|
@@ -20,7 +21,7 @@ describe('Module Factory', () => {
|
|
|
20
21
|
const tree: UnitTestTree = runner.runSchematic('module', options);
|
|
21
22
|
const files: string[] = tree.files;
|
|
22
23
|
expect(
|
|
23
|
-
files.find(filename => filename === '/foo/foo.module.ts'),
|
|
24
|
+
files.find((filename) => filename === '/foo/foo.module.ts'),
|
|
24
25
|
).not.toBeUndefined();
|
|
25
26
|
expect(tree.readContent('/foo/foo.module.ts')).toEqual(
|
|
26
27
|
"import { Module } from '@nestjs/common';\n" +
|
|
@@ -37,7 +38,7 @@ describe('Module Factory', () => {
|
|
|
37
38
|
const tree: UnitTestTree = runner.runSchematic('module', options);
|
|
38
39
|
const files: string[] = tree.files;
|
|
39
40
|
expect(
|
|
40
|
-
files.find(filename => filename === '/bar/foo/foo.module.ts'),
|
|
41
|
+
files.find((filename) => filename === '/bar/foo/foo.module.ts'),
|
|
41
42
|
).not.toBeUndefined();
|
|
42
43
|
expect(tree.readContent('/bar/foo/foo.module.ts')).toEqual(
|
|
43
44
|
"import { Module } from '@nestjs/common';\n" +
|
|
@@ -55,7 +56,7 @@ describe('Module Factory', () => {
|
|
|
55
56
|
const tree: UnitTestTree = runner.runSchematic('module', options);
|
|
56
57
|
const files: string[] = tree.files;
|
|
57
58
|
expect(
|
|
58
|
-
files.find(filename => filename === '/bar/foo/foo.module.ts'),
|
|
59
|
+
files.find((filename) => filename === '/bar/foo/foo.module.ts'),
|
|
59
60
|
).not.toBeUndefined();
|
|
60
61
|
expect(tree.readContent('/bar/foo/foo.module.ts')).toEqual(
|
|
61
62
|
"import { Module } from '@nestjs/common';\n" +
|
|
@@ -72,7 +73,7 @@ describe('Module Factory', () => {
|
|
|
72
73
|
const tree: UnitTestTree = runner.runSchematic('module', options);
|
|
73
74
|
const files: string[] = tree.files;
|
|
74
75
|
expect(
|
|
75
|
-
files.find(filename => filename === '/foo-bar/foo-bar.module.ts'),
|
|
76
|
+
files.find((filename) => filename === '/foo-bar/foo-bar.module.ts'),
|
|
76
77
|
).not.toBeUndefined();
|
|
77
78
|
expect(tree.readContent('/foo-bar/foo-bar.module.ts')).toEqual(
|
|
78
79
|
"import { Module } from '@nestjs/common';\n" +
|
|
@@ -89,7 +90,7 @@ describe('Module Factory', () => {
|
|
|
89
90
|
const tree: UnitTestTree = runner.runSchematic('module', options);
|
|
90
91
|
const files: string[] = tree.files;
|
|
91
92
|
expect(
|
|
92
|
-
files.find(filename => filename === '/bar-baz/foo/foo.module.ts'),
|
|
93
|
+
files.find((filename) => filename === '/bar-baz/foo/foo.module.ts'),
|
|
93
94
|
).not.toBeUndefined();
|
|
94
95
|
expect(tree.readContent('/bar-baz/foo/foo.module.ts')).toEqual(
|
|
95
96
|
"import { Module } from '@nestjs/common';\n" +
|
|
@@ -107,7 +108,7 @@ describe('Module Factory', () => {
|
|
|
107
108
|
const tree: UnitTestTree = runner.runSchematic('module', options);
|
|
108
109
|
const files: string[] = tree.files;
|
|
109
110
|
expect(
|
|
110
|
-
files.find(filename => filename === '/foo/foo.module.js'),
|
|
111
|
+
files.find((filename) => filename === '/foo/foo.module.js'),
|
|
111
112
|
).not.toBeUndefined();
|
|
112
113
|
expect(tree.readContent('/foo/foo.module.js')).toEqual(
|
|
113
114
|
"import { Module } from '@nestjs/common';\n" +
|
|
@@ -1,15 +1,14 @@
|
|
|
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");
|
|
7
7
|
const source_root_helpers_1 = require("../../utils/source-root.helpers");
|
|
8
8
|
function main(options) {
|
|
9
9
|
options = transform(options);
|
|
10
|
-
return schematics_1.chain([source_root_helpers_1.mergeSourceRoot(options), schematics_1.mergeWith(generate(options))]);
|
|
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) {
|
|
@@ -21,13 +20,13 @@ function transform(options) {
|
|
|
21
20
|
target.language = target.language !== undefined ? target.language : 'ts';
|
|
22
21
|
target.path = target.flat
|
|
23
22
|
? target.path
|
|
24
|
-
: core_1.join(target.path, target.name);
|
|
23
|
+
: (0, core_1.join)(target.path, target.name);
|
|
25
24
|
return target;
|
|
26
25
|
}
|
|
27
26
|
function generate(options) {
|
|
28
|
-
return (context) => schematics_1.apply(schematics_1.url(core_1.join('./files', options.language)), [
|
|
29
|
-
options.spec ? schematics_1.noop() : schematics_1.filter(path => !path.endsWith('.spec.ts')),
|
|
30
|
-
schematics_1.template(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
31
|
-
schematics_1.move(options.path),
|
|
27
|
+
return (context) => (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
28
|
+
options.spec ? (0, schematics_1.noop)() : (0, schematics_1.filter)((path) => !path.endsWith('.spec.ts')),
|
|
29
|
+
(0, schematics_1.template)(Object.assign(Object.assign({}, core_1.strings), options)),
|
|
30
|
+
(0, schematics_1.move)(options.path),
|
|
32
31
|
])(context);
|
|
33
32
|
}
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
UnitTestTree,
|
|
4
4
|
} from '@angular-devkit/schematics/testing';
|
|
5
5
|
import * as path from 'path';
|
|
6
|
+
|
|
6
7
|
import { PipeOptions } from './pipe.schema';
|
|
7
8
|
|
|
8
9
|
describe('Pipe Factory', () => {
|
|
@@ -18,7 +19,7 @@ describe('Pipe Factory', () => {
|
|
|
18
19
|
const tree: UnitTestTree = runner.runSchematic('pipe', options);
|
|
19
20
|
const files: string[] = tree.files;
|
|
20
21
|
expect(
|
|
21
|
-
files.find(filename => filename === '/foo/foo.pipe.ts'),
|
|
22
|
+
files.find((filename) => filename === '/foo/foo.pipe.ts'),
|
|
22
23
|
).not.toBeUndefined();
|
|
23
24
|
expect(tree.readContent('/foo/foo.pipe.ts')).toEqual(
|
|
24
25
|
"import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common';\n" +
|
|
@@ -39,7 +40,7 @@ describe('Pipe Factory', () => {
|
|
|
39
40
|
const tree: UnitTestTree = runner.runSchematic('pipe', options);
|
|
40
41
|
const files: string[] = tree.files;
|
|
41
42
|
expect(
|
|
42
|
-
files.find(filename => filename === '/bar/foo/foo.pipe.ts'),
|
|
43
|
+
files.find((filename) => filename === '/bar/foo/foo.pipe.ts'),
|
|
43
44
|
).not.toBeUndefined();
|
|
44
45
|
expect(tree.readContent('/bar/foo/foo.pipe.ts')).toEqual(
|
|
45
46
|
"import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common';\n" +
|
|
@@ -61,7 +62,7 @@ describe('Pipe Factory', () => {
|
|
|
61
62
|
const tree: UnitTestTree = runner.runSchematic('pipe', options);
|
|
62
63
|
const files: string[] = tree.files;
|
|
63
64
|
expect(
|
|
64
|
-
files.find(filename => filename === '/baz/foo/foo.pipe.ts'),
|
|
65
|
+
files.find((filename) => filename === '/baz/foo/foo.pipe.ts'),
|
|
65
66
|
).not.toBeUndefined();
|
|
66
67
|
expect(tree.readContent('/baz/foo/foo.pipe.ts')).toEqual(
|
|
67
68
|
"import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common';\n" +
|
|
@@ -82,7 +83,7 @@ describe('Pipe Factory', () => {
|
|
|
82
83
|
const tree: UnitTestTree = runner.runSchematic('pipe', options);
|
|
83
84
|
const files: string[] = tree.files;
|
|
84
85
|
expect(
|
|
85
|
-
files.find(filename => filename === '/foo-bar/foo-bar.pipe.ts'),
|
|
86
|
+
files.find((filename) => filename === '/foo-bar/foo-bar.pipe.ts'),
|
|
86
87
|
).not.toBeUndefined();
|
|
87
88
|
expect(tree.readContent('/foo-bar/foo-bar.pipe.ts')).toEqual(
|
|
88
89
|
"import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common';\n" +
|
|
@@ -103,7 +104,7 @@ describe('Pipe Factory', () => {
|
|
|
103
104
|
const tree: UnitTestTree = runner.runSchematic('pipe', options);
|
|
104
105
|
const files: string[] = tree.files;
|
|
105
106
|
expect(
|
|
106
|
-
files.find(filename => filename === '/bar-baz/foo/foo.pipe.ts'),
|
|
107
|
+
files.find((filename) => filename === '/bar-baz/foo/foo.pipe.ts'),
|
|
107
108
|
).not.toBeUndefined();
|
|
108
109
|
expect(tree.readContent('/bar-baz/foo/foo.pipe.ts')).toEqual(
|
|
109
110
|
"import { ArgumentMetadata, Injectable, PipeTransform } from '@nestjs/common';\n" +
|
|
@@ -125,7 +126,7 @@ describe('Pipe Factory', () => {
|
|
|
125
126
|
const tree: UnitTestTree = runner.runSchematic('pipe', options);
|
|
126
127
|
const files: string[] = tree.files;
|
|
127
128
|
expect(
|
|
128
|
-
files.find(filename => filename === '/foo/foo.pipe.js'),
|
|
129
|
+
files.find((filename) => filename === '/foo/foo.pipe.js'),
|
|
129
130
|
).not.toBeUndefined();
|
|
130
131
|
expect(tree.readContent('/foo/foo.pipe.js')).toEqual(
|
|
131
132
|
"import { Injectable } from '@nestjs/common';\n" +
|