@nestjs/schematics 12.0.0-alpha.3 → 12.0.0-alpha.4

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.
@@ -1,3 +1,3 @@
1
- import { SetMetadata } from '@nestjs/common';
1
+ import { Reflector } from '@nestjs/core';
2
2
 
3
- export const <%= classify(name) %> = (...args) => SetMetadata('<%= name %>', args);
3
+ export const <%= classify(name) %> = Reflector.createDecorator();
@@ -1,3 +1,3 @@
1
- import { SetMetadata } from '@nestjs/common';
1
+ import { Reflector } from '@nestjs/core';
2
2
 
3
- export const <%= classify(name) %> = (...args: string[]) => SetMetadata('<%= name %>', args);
3
+ export const <%= classify(name) %> = Reflector.createDecorator<string[]>();
@@ -6,5 +6,5 @@
6
6
  "outDir": "../../dist/libs/<%= name %>"
7
7
  },
8
8
  "include": ["src/**/*"],
9
- "exclude": ["node_modules", "dist", "test", "**/*spec.ts"]
9
+ "exclude": ["node_modules", "dist", "test", "**/*<%= specFileSuffix %>.ts"]
10
10
  }
@@ -46,6 +46,7 @@ function transform(options) {
46
46
  ? join(normalize(defaultSourceRoot), target.path)
47
47
  : normalize(defaultSourceRoot);
48
48
  target.prefix = target.prefix || getDefaultLibraryPrefix();
49
+ target.specFileSuffix = normalizeToKebabOrSnakeCase(target.specFileSuffix ?? 'spec');
49
50
  return target;
50
51
  }
51
52
  function updatePackageJson(options) {
@@ -145,6 +146,11 @@ function updateTsConfig(packageName, _packagePrefix, root) {
145
146
  }
146
147
  delete tsconfig.compilerOptions.baseUrl;
147
148
  delete tsconfig.compilerOptions.paths;
149
+ if (!tsconfig.files) {
150
+ tsconfig.files = [];
151
+ }
152
+ delete tsconfig.include;
153
+ delete tsconfig.exclude;
148
154
  if (!tsconfig.references) {
149
155
  tsconfig.references = [];
150
156
  }
@@ -31,6 +31,11 @@
31
31
  "type": "string",
32
32
  "format": "path",
33
33
  "description": "The libraries root directory."
34
+ },
35
+ "specFileSuffix": {
36
+ "type": "string",
37
+ "default": "spec",
38
+ "description": "Specifies the file suffix of spec files."
34
39
  }
35
40
  },
36
41
  "required": ["name", "prefix"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/schematics",
3
- "version": "12.0.0-alpha.3",
3
+ "version": "12.0.0-alpha.4",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@schematics)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",