@gapi/schematics 1.8.169 → 1.8.171

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/dist/lib/application/application.factory.js +5 -6
  2. package/dist/lib/application/application.factory.test.ts +5 -1
  3. package/dist/lib/application/application.factory.ts +1 -0
  4. package/dist/lib/application/files/ts/src/app.controller.spec.ts +1 -0
  5. package/dist/lib/application/files/ts/src/app.controller.ts +1 -0
  6. package/dist/lib/application/files/ts/src/app.module.ts +1 -0
  7. package/dist/lib/application/files/ts/src/main.ts +1 -0
  8. package/dist/lib/application/files/ts/test/app.e2e-spec.ts +1 -0
  9. package/dist/lib/class/class.factory.js +7 -8
  10. package/dist/lib/class/class.factory.test.ts +9 -6
  11. package/dist/lib/class/class.factory.ts +2 -1
  12. package/dist/lib/client-app/angular/angular.factory.js +12 -13
  13. package/dist/lib/client-app/angular/angular.factory.ts +5 -4
  14. package/dist/lib/client-app/angular/files/angular.module.ts +1 -0
  15. package/dist/lib/client-app/angular/files/angular.providers.ts +1 -0
  16. package/dist/lib/client-app/angular/files/loaders/abstract.loader.ts +1 -0
  17. package/dist/lib/client-app/angular/files/loaders/express.loader.ts +1 -0
  18. package/dist/lib/client-app/angular/files/loaders/fastify.loader.ts +1 -0
  19. package/dist/lib/client-app/angular/files/loaders/noop.loader.ts +1 -0
  20. package/dist/lib/component/component.factory.js +9 -10
  21. package/dist/lib/component/component.factory.test.ts +13 -12
  22. package/dist/lib/component/component.factory.ts +2 -1
  23. package/dist/lib/configuration/configuration.factory.js +5 -6
  24. package/dist/lib/configuration/configuration.factory.test.ts +4 -3
  25. package/dist/lib/configuration/configuration.factory.ts +1 -0
  26. package/dist/lib/controller/controller.factory.js +9 -10
  27. package/dist/lib/controller/controller.factory.test.ts +13 -12
  28. package/dist/lib/controller/controller.factory.ts +2 -1
  29. package/dist/lib/decorator/decorator.factory.js +6 -7
  30. package/dist/lib/decorator/decorator.factory.test.ts +7 -6
  31. package/dist/lib/decorator/decorator.factory.ts +1 -0
  32. package/dist/lib/effect/effect.factory.js +10 -12
  33. package/dist/lib/effect/effect.factory.test.ts +12 -11
  34. package/dist/lib/effect/effect.factory.ts +3 -3
  35. package/dist/lib/filter/filter.factory.js +7 -8
  36. package/dist/lib/filter/filter.factory.test.ts +12 -7
  37. package/dist/lib/filter/filter.factory.ts +2 -1
  38. package/dist/lib/gateway/gateway.factory.js +9 -10
  39. package/dist/lib/gateway/gateway.factory.test.ts +7 -6
  40. package/dist/lib/gateway/gateway.factory.ts +2 -1
  41. package/dist/lib/guard/guard.factory.js +7 -8
  42. package/dist/lib/guard/guard.factory.test.ts +7 -6
  43. package/dist/lib/guard/guard.factory.ts +2 -1
  44. package/dist/lib/interceptor/interceptor.factory.js +7 -8
  45. package/dist/lib/interceptor/interceptor.factory.test.ts +7 -6
  46. package/dist/lib/interceptor/interceptor.factory.ts +2 -1
  47. package/dist/lib/interface/interface.factory.js +6 -7
  48. package/dist/lib/interface/interface.factory.test.ts +6 -5
  49. package/dist/lib/interface/interface.factory.ts +1 -0
  50. package/dist/lib/library/library.factory.js +13 -14
  51. package/dist/lib/library/library.factory.test.ts +1 -0
  52. package/dist/lib/library/library.factory.ts +2 -1
  53. package/dist/lib/module/module.factory.js +8 -9
  54. package/dist/lib/module/module.factory.test.ts +7 -6
  55. package/dist/lib/module/module.factory.ts +1 -0
  56. package/dist/lib/pipe/pipe.factory.js +7 -8
  57. package/dist/lib/pipe/pipe.factory.test.ts +7 -6
  58. package/dist/lib/pipe/pipe.factory.ts +2 -1
  59. package/dist/lib/plugin/plugin.factory.d.ts +1 -0
  60. package/dist/lib/plugin/plugin.factory.test.ts +13 -12
  61. package/dist/lib/plugin/plugin.factory.ts +2 -1
  62. package/dist/lib/provider/provider.factory.d.ts +1 -0
  63. package/dist/lib/provider/provider.factory.test.ts +11 -10
  64. package/dist/lib/provider/provider.factory.ts +2 -1
  65. package/dist/lib/resolver/resolver.factory.js +9 -10
  66. package/dist/lib/resolver/resolver.factory.test.ts +13 -12
  67. package/dist/lib/resolver/resolver.factory.ts +2 -1
  68. package/dist/lib/service/service.factory.js +10 -12
  69. package/dist/lib/service/service.factory.test.ts +12 -11
  70. package/dist/lib/service/service.factory.ts +3 -3
  71. package/dist/lib/type/type.factory.d.ts +1 -0
  72. package/dist/lib/type/type.factory.test.ts +13 -12
  73. package/dist/lib/type/type.factory.ts +2 -1
  74. package/dist/utils/metadata.manager.js +9 -9
  75. package/dist/utils/metadata.manager.ts +13 -10
  76. package/dist/utils/module-import.declarator.js +4 -4
  77. package/dist/utils/module-import.declarator.ts +3 -2
  78. package/dist/utils/module.declarator.js +2 -2
  79. package/dist/utils/module.declarator.ts +2 -0
  80. package/dist/utils/module.finder.js +2 -2
  81. package/dist/utils/module.finder.ts +1 -1
  82. package/dist/utils/name.parser.js +3 -5
  83. package/dist/utils/name.parser.ts +5 -6
  84. package/dist/utils/path.solver.js +2 -4
  85. package/dist/utils/path.solver.ts +2 -3
  86. package/dist/utils/source-root.helpers.js +6 -6
  87. package/dist/utils/source-root.helpers.ts +4 -2
  88. package/eslint.config.mjs +38 -0
  89. package/package.json +2 -2
  90. package/src/lib/application/application.factory.test.ts +5 -1
  91. package/src/lib/application/application.factory.ts +1 -0
  92. package/src/lib/application/files/ts/src/app.controller.spec.ts +1 -0
  93. package/src/lib/application/files/ts/src/app.controller.ts +1 -0
  94. package/src/lib/application/files/ts/src/app.module.ts +1 -0
  95. package/src/lib/application/files/ts/src/main.ts +1 -0
  96. package/src/lib/application/files/ts/test/app.e2e-spec.ts +1 -0
  97. package/src/lib/class/class.factory.test.ts +9 -6
  98. package/src/lib/class/class.factory.ts +2 -1
  99. package/src/lib/client-app/angular/angular.factory.ts +5 -4
  100. package/src/lib/client-app/angular/files/angular.module.ts +1 -0
  101. package/src/lib/client-app/angular/files/angular.providers.ts +1 -0
  102. package/src/lib/client-app/angular/files/loaders/abstract.loader.ts +1 -0
  103. package/src/lib/client-app/angular/files/loaders/express.loader.ts +1 -0
  104. package/src/lib/client-app/angular/files/loaders/fastify.loader.ts +1 -0
  105. package/src/lib/client-app/angular/files/loaders/noop.loader.ts +1 -0
  106. package/src/lib/component/component.factory.test.ts +13 -12
  107. package/src/lib/component/component.factory.ts +2 -1
  108. package/src/lib/configuration/configuration.factory.test.ts +4 -3
  109. package/src/lib/configuration/configuration.factory.ts +1 -0
  110. package/src/lib/controller/controller.factory.test.ts +13 -12
  111. package/src/lib/controller/controller.factory.ts +2 -1
  112. package/src/lib/decorator/decorator.factory.test.ts +7 -6
  113. package/src/lib/decorator/decorator.factory.ts +1 -0
  114. package/src/lib/effect/effect.factory.test.ts +12 -11
  115. package/src/lib/effect/effect.factory.ts +3 -3
  116. package/src/lib/filter/filter.factory.test.ts +12 -7
  117. package/src/lib/filter/filter.factory.ts +2 -1
  118. package/src/lib/gateway/gateway.factory.test.ts +7 -6
  119. package/src/lib/gateway/gateway.factory.ts +2 -1
  120. package/src/lib/guard/guard.factory.test.ts +7 -6
  121. package/src/lib/guard/guard.factory.ts +2 -1
  122. package/src/lib/interceptor/interceptor.factory.test.ts +7 -6
  123. package/src/lib/interceptor/interceptor.factory.ts +2 -1
  124. package/src/lib/interface/interface.factory.test.ts +6 -5
  125. package/src/lib/interface/interface.factory.ts +1 -0
  126. package/src/lib/library/library.factory.test.ts +1 -0
  127. package/src/lib/library/library.factory.ts +2 -1
  128. package/src/lib/module/module.factory.test.ts +7 -6
  129. package/src/lib/module/module.factory.ts +1 -0
  130. package/src/lib/pipe/pipe.factory.test.ts +7 -6
  131. package/src/lib/pipe/pipe.factory.ts +2 -1
  132. package/src/lib/plugin/plugin.factory.d.ts +1 -0
  133. package/src/lib/plugin/plugin.factory.test.ts +13 -12
  134. package/src/lib/plugin/plugin.factory.ts +2 -1
  135. package/src/lib/provider/provider.factory.d.ts +1 -0
  136. package/src/lib/provider/provider.factory.test.ts +11 -10
  137. package/src/lib/provider/provider.factory.ts +2 -1
  138. package/src/lib/resolver/resolver.factory.test.ts +13 -12
  139. package/src/lib/resolver/resolver.factory.ts +2 -1
  140. package/src/lib/service/service.factory.test.ts +12 -11
  141. package/src/lib/service/service.factory.ts +3 -3
  142. package/src/lib/type/type.factory.d.ts +1 -0
  143. package/src/lib/type/type.factory.test.ts +13 -12
  144. package/src/lib/type/type.factory.ts +2 -1
  145. package/src/utils/metadata.manager.ts +13 -10
  146. package/src/utils/module-import.declarator.ts +3 -2
  147. package/src/utils/module.declarator.ts +2 -0
  148. package/src/utils/module.finder.ts +1 -1
  149. package/src/utils/name.parser.ts +5 -6
  150. package/src/utils/path.solver.ts +2 -3
  151. package/src/utils/source-root.helpers.ts +4 -2
@@ -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,
@@ -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,
@@ -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';
@@ -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 { LibraryOptions } from './library.schema';
7
8
 
8
9
  describe('Library Factory', () => {
@@ -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((json as {}) as T);
72
+ callback(json as {} as T);
72
73
  host.overwrite(path, JSON.stringify(json, null, 2));
73
74
  }
74
75
 
@@ -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" +
@@ -11,6 +11,7 @@ import {
11
11
  Tree,
12
12
  url,
13
13
  } from '@angular-devkit/schematics';
14
+
14
15
  import {
15
16
  DeclarationOptions,
16
17
  ModuleDeclarator,
@@ -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" +
@@ -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 { PipeOptions } from './pipe.schema';
@@ -41,7 +42,7 @@ function transform(options: PipeOptions): PipeOptions {
41
42
  function generate(options: PipeOptions): 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,3 +1,4 @@
1
1
  import { Rule } from '@angular-devkit/schematics';
2
+
2
3
  import { ControllerOptions } from './controller.schema';
3
4
  export declare function main(options: ControllerOptions): Rule;
@@ -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/module.schema';
9
10
  import { ControllerOptions } from './controller.schema';
@@ -24,10 +25,10 @@ describe('Controller Factory', () => {
24
25
  const files: string[] = tree.files;
25
26
 
26
27
  expect(
27
- files.find(filename => filename === '/foo/foo.controller.ts'),
28
+ files.find((filename) => filename === '/foo/foo.controller.ts'),
28
29
  ).toBeDefined();
29
30
  expect(
30
- files.find(filename => filename === '/foo/foo.controller.spec.ts'),
31
+ files.find((filename) => filename === '/foo/foo.controller.spec.ts'),
31
32
  ).not.toBeDefined();
32
33
  expect(tree.readContent('/foo/foo.controller.ts')).toEqual(
33
34
  "import { Controller } from '@nestjs/common';\n" +
@@ -44,10 +45,10 @@ describe('Controller Factory', () => {
44
45
  const tree: UnitTestTree = runner.runSchematic('controller', options);
45
46
  const files: string[] = tree.files;
46
47
  expect(
47
- files.find(filename => filename === '/bar/foo/foo.controller.ts'),
48
+ files.find((filename) => filename === '/bar/foo/foo.controller.ts'),
48
49
  ).toBeDefined();
49
50
  expect(
50
- files.find(filename => filename === '/bar/foo/foo.controller.spec.ts'),
51
+ files.find((filename) => filename === '/bar/foo/foo.controller.spec.ts'),
51
52
  ).toBeDefined();
52
53
  expect(tree.readContent('/bar/foo/foo.controller.ts')).toEqual(
53
54
  "import { Controller } from '@nestjs/common';\n" +
@@ -65,10 +66,10 @@ describe('Controller Factory', () => {
65
66
  const tree: UnitTestTree = runner.runSchematic('controller', options);
66
67
  const files: string[] = tree.files;
67
68
  expect(
68
- files.find(filename => filename === '/bar/foo/foo.controller.ts'),
69
+ files.find((filename) => filename === '/bar/foo/foo.controller.ts'),
69
70
  ).toBeDefined();
70
71
  expect(
71
- files.find(filename => filename === '/bar/foo/foo.controller.spec.ts'),
72
+ files.find((filename) => filename === '/bar/foo/foo.controller.spec.ts'),
72
73
  ).toBeDefined();
73
74
  expect(tree.readContent('/bar/foo/foo.controller.ts')).toEqual(
74
75
  "import { Controller } from '@nestjs/common';\n" +
@@ -85,11 +86,11 @@ describe('Controller Factory', () => {
85
86
  const tree: UnitTestTree = runner.runSchematic('controller', options);
86
87
  const files: string[] = tree.files;
87
88
  expect(
88
- files.find(filename => filename === '/foo-bar/foo-bar.controller.ts'),
89
+ files.find((filename) => filename === '/foo-bar/foo-bar.controller.ts'),
89
90
  ).toBeDefined();
90
91
  expect(
91
92
  files.find(
92
- filename => filename === '/foo-bar/foo-bar.controller.spec.ts',
93
+ (filename) => filename === '/foo-bar/foo-bar.controller.spec.ts',
93
94
  ),
94
95
  ).toBeDefined();
95
96
  expect(tree.readContent('/foo-bar/foo-bar.controller.ts')).toEqual(
@@ -107,11 +108,11 @@ describe('Controller Factory', () => {
107
108
  const tree: UnitTestTree = runner.runSchematic('controller', options);
108
109
  const files: string[] = tree.files;
109
110
  expect(
110
- files.find(filename => filename === '/bar-baz/foo/foo.controller.ts'),
111
+ files.find((filename) => filename === '/bar-baz/foo/foo.controller.ts'),
111
112
  ).toBeDefined();
112
113
  expect(
113
114
  files.find(
114
- filename => filename === '/bar-baz/foo/foo.controller.spec.ts',
115
+ (filename) => filename === '/bar-baz/foo/foo.controller.spec.ts',
115
116
  ),
116
117
  ).toBeDefined();
117
118
  expect(tree.readContent('/bar-baz/foo/foo.controller.ts')).toEqual(
@@ -130,10 +131,10 @@ describe('Controller Factory', () => {
130
131
  const tree: UnitTestTree = runner.runSchematic('controller', options);
131
132
  const files: string[] = tree.files;
132
133
  expect(
133
- files.find(filename => filename === '/foo/foo.controller.js'),
134
+ files.find((filename) => filename === '/foo/foo.controller.js'),
134
135
  ).toBeDefined();
135
136
  expect(
136
- files.find(filename => filename === '/foo/foo.controller.spec.js'),
137
+ files.find((filename) => filename === '/foo/foo.controller.spec.js'),
137
138
  ).toBeDefined();
138
139
  expect(tree.readContent('/foo/foo.controller.js')).toEqual(
139
140
  "import { Controller } from '@nestjs/common';\n" +
@@ -13,6 +13,7 @@ import {
13
13
  Tree,
14
14
  url,
15
15
  } from '@angular-devkit/schematics';
16
+
16
17
  import {
17
18
  DeclarationOptions,
18
19
  ModuleDeclarator,
@@ -59,7 +60,7 @@ function transform(source: PluginOptions): PluginOptions {
59
60
  function generate(options: PluginOptions) {
60
61
  return (context: SchematicContext) =>
61
62
  apply(url(join('./files' as Path, options.language)), [
62
- options.spec ? noop() : filter(path => !path.endsWith('.spec.ts')),
63
+ options.spec ? noop() : filter((path) => !path.endsWith('.spec.ts')),
63
64
  template({
64
65
  ...strings,
65
66
  ...options,
@@ -1,3 +1,4 @@
1
1
  import { Rule } from '@angular-devkit/schematics';
2
+
2
3
  import { ProviderOptions } from './provider.schema';
3
4
  export declare function main(options: ProviderOptions): Rule;
@@ -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/module.schema';
9
10
  import { ProviderOptions } from './provider.schema';
@@ -20,8 +21,8 @@ describe('Provider Factory', () => {
20
21
  };
21
22
  const tree: UnitTestTree = runner.runSchematic('provider', options);
22
23
  const files: string[] = tree.files;
23
- expect(files.find(filename => filename === '/foo.ts')).toBeDefined();
24
- expect(files.find(filename => filename === '/foo.spec.ts')).toBeDefined();
24
+ expect(files.find((filename) => filename === '/foo.ts')).toBeDefined();
25
+ expect(files.find((filename) => filename === '/foo.spec.ts')).toBeDefined();
25
26
  expect(tree.readContent('/foo.ts')).toEqual(
26
27
  "import { Injectable } from '@nestjs/common';\n" +
27
28
  '\n' +
@@ -36,9 +37,9 @@ describe('Provider Factory', () => {
36
37
  };
37
38
  const tree: UnitTestTree = runner.runSchematic('provider', options);
38
39
  const files: string[] = tree.files;
39
- expect(files.find(filename => filename === '/bar/foo.ts')).toBeDefined();
40
+ expect(files.find((filename) => filename === '/bar/foo.ts')).toBeDefined();
40
41
  expect(
41
- files.find(filename => filename === '/bar/foo.spec.ts'),
42
+ files.find((filename) => filename === '/bar/foo.spec.ts'),
42
43
  ).toBeDefined();
43
44
  expect(tree.readContent('/bar/foo.ts')).toEqual(
44
45
  "import { Injectable } from '@nestjs/common';\n" +
@@ -55,9 +56,9 @@ describe('Provider Factory', () => {
55
56
  };
56
57
  const tree: UnitTestTree = runner.runSchematic('provider', options);
57
58
  const files: string[] = tree.files;
58
- expect(files.find(filename => filename === '/bar/foo.ts')).toBeDefined();
59
+ expect(files.find((filename) => filename === '/bar/foo.ts')).toBeDefined();
59
60
  expect(
60
- files.find(filename => filename === '/bar/foo.spec.ts'),
61
+ files.find((filename) => filename === '/bar/foo.spec.ts'),
61
62
  ).toBeDefined();
62
63
  expect(tree.readContent('/bar/foo.ts')).toEqual(
63
64
  "import { Injectable } from '@nestjs/common';\n" +
@@ -73,9 +74,9 @@ describe('Provider Factory', () => {
73
74
  };
74
75
  const tree: UnitTestTree = runner.runSchematic('provider', options);
75
76
  const files: string[] = tree.files;
76
- expect(files.find(filename => filename === '/bar-foo.ts')).toBeDefined();
77
+ expect(files.find((filename) => filename === '/bar-foo.ts')).toBeDefined();
77
78
  expect(
78
- files.find(filename => filename === '/bar-foo.spec.ts'),
79
+ files.find((filename) => filename === '/bar-foo.spec.ts'),
79
80
  ).toBeDefined();
80
81
  expect(tree.readContent('/bar-foo.ts')).toEqual(
81
82
  "import { Injectable } from '@nestjs/common';\n" +
@@ -92,8 +93,8 @@ describe('Provider Factory', () => {
92
93
  };
93
94
  const tree: UnitTestTree = runner.runSchematic('provider', options);
94
95
  const files: string[] = tree.files;
95
- expect(files.find(filename => filename === '/foo.js')).toBeDefined();
96
- expect(files.find(filename => filename === '/foo.spec.js')).toBeDefined();
96
+ expect(files.find((filename) => filename === '/foo.js')).toBeDefined();
97
+ expect(files.find((filename) => filename === '/foo.spec.js')).toBeDefined();
97
98
  expect(tree.readContent('/foo.js')).toEqual(
98
99
  "import { Injectable } from '@nestjs/common';\n" +
99
100
  '\n' +
@@ -14,6 +14,7 @@ import {
14
14
  Tree,
15
15
  url,
16
16
  } from '@angular-devkit/schematics';
17
+
17
18
  import {
18
19
  DeclarationOptions,
19
20
  ModuleDeclarator,
@@ -57,7 +58,7 @@ function transform(options: ProviderOptions): ProviderOptions {
57
58
  function generate(options: ProviderOptions) {
58
59
  return (context: SchematicContext) =>
59
60
  apply(url(join('./files' as Path, options.language)), [
60
- options.spec ? noop() : filter(path => !path.endsWith('.spec.ts')),
61
+ options.spec ? noop() : filter((path) => !path.endsWith('.spec.ts')),
61
62
  template({
62
63
  ...strings,
63
64
  ...options,