@nestjs/cli 7.5.2-next.2 → 7.5.2

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.
@@ -41,7 +41,7 @@ class AddAction extends abstract_action_1.AbstractAction {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
42
  const configuration = yield load_configuration_1.loadConfiguration();
43
43
  const configurationProjects = configuration.projects;
44
- const appName = inputs.find(option => option.name === 'project')
44
+ const appName = inputs.find((option) => option.name === 'project')
45
45
  .value;
46
46
  let sourceRoot = appName
47
47
  ? get_value_or_default_1.getValueOrDefault(configuration, 'sourceRoot', appName)
@@ -87,7 +87,7 @@ class AddAction extends abstract_action_1.AbstractAction {
87
87
  return __awaiter(this, void 0, void 0, function* () {
88
88
  console.info(ui_1.MESSAGES.LIBRARY_INSTALLATION_STARTS);
89
89
  const schematicOptions = [];
90
- schematicOptions.push(new schematics_1.SchematicOption('sourceRoot', options.find(option => option.name === 'sourceRoot').value));
90
+ schematicOptions.push(new schematics_1.SchematicOption('sourceRoot', options.find((option) => option.name === 'sourceRoot').value));
91
91
  const extraFlagsString = extraFlags ? extraFlags.join(' ') : undefined;
92
92
  try {
93
93
  const collection = schematics_1.CollectionFactory.create(collectionName);
@@ -102,7 +102,7 @@ class AddAction extends abstract_action_1.AbstractAction {
102
102
  });
103
103
  }
104
104
  getLibraryName(inputs) {
105
- const libraryInput = inputs.find(input => input.name === 'library');
105
+ const libraryInput = inputs.find((input) => input.name === 'library');
106
106
  if (!libraryInput) {
107
107
  throw new Error('No library found in command input');
108
108
  }
@@ -43,9 +43,9 @@ class BuildAction extends abstract_action_1.AbstractAction {
43
43
  handle(inputs, options) {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
45
  try {
46
- const watchModeOption = options.find(option => option.name === 'watch');
46
+ const watchModeOption = options.find((option) => option.name === 'watch');
47
47
  const watchMode = !!(watchModeOption && watchModeOption.value);
48
- const watchAssetsModeOption = options.find(option => option.name === 'watchAssets');
48
+ const watchAssetsModeOption = options.find((option) => option.name === 'watchAssets');
49
49
  const watchAssetsMode = !!(watchAssetsModeOption && watchAssetsModeOption.value);
50
50
  yield this.runBuild(inputs, options, watchMode, watchAssetsMode);
51
51
  }
@@ -61,10 +61,11 @@ class BuildAction extends abstract_action_1.AbstractAction {
61
61
  }
62
62
  runBuild(inputs, options, watchMode, watchAssetsMode, isDebugEnabled = false, onSuccess) {
63
63
  return __awaiter(this, void 0, void 0, function* () {
64
- const configFileName = options.find(option => option.name === 'config')
64
+ const configFileName = options.find((option) => option.name === 'config')
65
65
  .value;
66
66
  const configuration = yield this.loader.load(configFileName);
67
- const appName = inputs.find(input => input.name === 'app').value;
67
+ const appName = inputs.find((input) => input.name === 'app')
68
+ .value;
68
69
  const pathToTsconfig = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.tsConfigPath', appName, 'path', options);
69
70
  const { options: tsOptions } = this.tsConfigProvider.getByConfigFilename(pathToTsconfig);
70
71
  const outDir = tsOptions.outDir || defaults_1.defaultOutDir;
@@ -78,7 +79,7 @@ class BuildAction extends abstract_action_1.AbstractAction {
78
79
  }
79
80
  if (watchMode) {
80
81
  const tsCompilerOptions = {};
81
- const isPreserveWatchOutputEnabled = options.find(option => option.name === 'preserveWatchOutput' && option.value === true);
82
+ const isPreserveWatchOutputEnabled = options.find((option) => option.name === 'preserveWatchOutput' && option.value === true);
82
83
  if (isPreserveWatchOutputEnabled) {
83
84
  tsCompilerOptions.preserveWatchOutput = true;
84
85
  }
@@ -27,13 +27,12 @@ class GenerateAction extends abstract_action_1.AbstractAction {
27
27
  exports.GenerateAction = GenerateAction;
28
28
  const generateFiles = (inputs) => __awaiter(void 0, void 0, void 0, function* () {
29
29
  const configuration = yield load_configuration_1.loadConfiguration();
30
- const collectionOption = inputs.find(option => option.name === 'collection')
30
+ const collectionOption = inputs.find((option) => option.name === 'collection').value;
31
+ const schematic = inputs.find((option) => option.name === 'schematic')
31
32
  .value;
32
- const schematic = inputs.find(option => option.name === 'schematic')
33
+ const appName = inputs.find((option) => option.name === 'project')
33
34
  .value;
34
- const appName = inputs.find(option => option.name === 'project')
35
- .value;
36
- const spec = inputs.find(option => option.name === 'spec');
35
+ const spec = inputs.find((option) => option.name === 'spec');
37
36
  const collection = schematics_1.CollectionFactory.create(collectionOption || configuration.collection);
38
37
  const schematicOptions = mapSchematicOptions(inputs);
39
38
  schematicOptions.push(new schematics_1.SchematicOption('language', configuration.language));
@@ -69,7 +68,7 @@ const generateFiles = (inputs) => __awaiter(void 0, void 0, void 0, function* ()
69
68
  schematicOptions.push(new schematics_1.SchematicOption('sourceRoot', sourceRoot));
70
69
  schematicOptions.push(new schematics_1.SchematicOption('spec', generateSpec));
71
70
  try {
72
- const schematicInput = inputs.find(input => input.name === 'schematic');
71
+ const schematicInput = inputs.find((input) => input.name === 'schematic');
73
72
  if (!schematicInput) {
74
73
  throw new Error('Unable to find a schematic for this configuration');
75
74
  }
@@ -84,7 +83,7 @@ const generateFiles = (inputs) => __awaiter(void 0, void 0, void 0, function* ()
84
83
  const mapSchematicOptions = (inputs) => {
85
84
  const excludedInputNames = ['schematic', 'spec'];
86
85
  const options = [];
87
- inputs.forEach(input => {
86
+ inputs.forEach((input) => {
88
87
  if (!excludedInputNames.includes(input.name) && input.value !== undefined) {
89
88
  options.push(new schematics_1.SchematicOption(input.name, input.value));
90
89
  }
@@ -75,7 +75,7 @@ const readProjectPackageJsonDependencies = () => __awaiter(void 0, void 0, void
75
75
  });
76
76
  });
77
77
  const displayNestVersions = (dependencies) => {
78
- buildNestVersionsMessage(dependencies).forEach(dependency => console.info(dependency.name, chalk.blue(dependency.value)));
78
+ buildNestVersionsMessage(dependencies).forEach((dependency) => console.info(dependency.name, chalk.blue(dependency.value)));
79
79
  };
80
80
  const buildNestVersionsMessage = (dependencies) => {
81
81
  const nestDependencies = collectNestDependencies(dependencies);
@@ -83,7 +83,7 @@ const buildNestVersionsMessage = (dependencies) => {
83
83
  };
84
84
  const collectNestDependencies = (dependencies) => {
85
85
  const nestDependencies = [];
86
- Object.keys(dependencies).forEach(key => {
86
+ Object.keys(dependencies).forEach((key) => {
87
87
  if (key.indexOf('@nestjs') > -1) {
88
88
  nestDependencies.push({
89
89
  name: `${key.replace(/@nestjs\//, '')} version`,
@@ -96,7 +96,7 @@ const collectNestDependencies = (dependencies) => {
96
96
  const format = (dependencies) => {
97
97
  const sorted = dependencies.sort((dependencyA, dependencyB) => dependencyB.name.length - dependencyA.name.length);
98
98
  const length = sorted[0].name.length;
99
- sorted.forEach(dependency => {
99
+ sorted.forEach((dependency) => {
100
100
  if (dependency.name.length < length) {
101
101
  dependency.name = rightPad(dependency.name, length);
102
102
  }
@@ -27,13 +27,13 @@ const abstract_action_1 = require("./abstract.action");
27
27
  class NewAction extends abstract_action_1.AbstractAction {
28
28
  handle(inputs, options) {
29
29
  return __awaiter(this, void 0, void 0, function* () {
30
- const directoryOption = options.find(option => option.name === 'directory');
31
- const dryRunOption = options.find(option => option.name === 'dry-run');
30
+ const directoryOption = options.find((option) => option.name === 'directory');
31
+ const dryRunOption = options.find((option) => option.name === 'dry-run');
32
32
  const isDryRunEnabled = dryRunOption && dryRunOption.value;
33
33
  yield askForMissingInformation(inputs);
34
34
  yield generateApplicationFiles(inputs, options).catch(exports.exit);
35
- const shouldSkipInstall = options.some(option => option.name === 'skip-install' && option.value === true);
36
- const shouldSkipGit = options.some(option => option.name === 'skip-git' && option.value === true);
35
+ const shouldSkipInstall = options.some((option) => option.name === 'skip-install' && option.value === true);
36
+ const shouldSkipGit = options.some((option) => option.name === 'skip-git' && option.value === true);
37
37
  const projectDirectory = getProjectDirectory(getApplicationNameInput(inputs), directoryOption);
38
38
  if (!shouldSkipInstall) {
39
39
  yield installPackages(options, isDryRunEnabled, projectDirectory);
@@ -50,7 +50,7 @@ class NewAction extends abstract_action_1.AbstractAction {
50
50
  }
51
51
  }
52
52
  exports.NewAction = NewAction;
53
- const getApplicationNameInput = (inputs) => inputs.find(input => input.name === 'name');
53
+ const getApplicationNameInput = (inputs) => inputs.find((input) => input.name === 'name');
54
54
  const getProjectDirectory = (applicationName, directoryOption) => {
55
55
  return ((directoryOption && directoryOption.value) ||
56
56
  strings_1.dasherize(applicationName.value));
@@ -68,11 +68,11 @@ const askForMissingInformation = (inputs) => __awaiter(void 0, void 0, void 0, f
68
68
  }
69
69
  });
70
70
  const replaceInputMissingInformation = (inputs, answers) => {
71
- return inputs.map(input => (input.value =
71
+ return inputs.map((input) => (input.value =
72
72
  input.value !== undefined ? input.value : answers[input.name]));
73
73
  };
74
74
  const generateApplicationFiles = (args, options) => __awaiter(void 0, void 0, void 0, function* () {
75
- const collectionName = options.find(option => option.name === 'collection' && option.value != null).value;
75
+ const collectionName = options.find((option) => option.name === 'collection' && option.value != null).value;
76
76
  const collection = schematics_1.CollectionFactory.create(collectionName || schematics_1.Collection.NESTJS);
77
77
  const schematicOptions = mapSchematicOptions(args.concat(options));
78
78
  yield collection.execute('application', schematicOptions);
@@ -88,7 +88,7 @@ const mapSchematicOptions = (options) => {
88
88
  }, []);
89
89
  };
90
90
  const installPackages = (options, dryRunMode, installDirectory) => __awaiter(void 0, void 0, void 0, function* () {
91
- const inputPackageManager = options.find(option => option.name === 'package-manager').value;
91
+ const inputPackageManager = options.find((option) => option.name === 'package-manager').value;
92
92
  let packageManager;
93
93
  if (dryRunMode) {
94
94
  console.info();
@@ -23,17 +23,17 @@ class StartAction extends build_action_1.BuildAction {
23
23
  handle(inputs, options) {
24
24
  return __awaiter(this, void 0, void 0, function* () {
25
25
  try {
26
- const configFileName = options.find(option => option.name === 'config')
26
+ const configFileName = options.find((option) => option.name === 'config')
27
27
  .value;
28
28
  const configuration = yield this.loader.load(configFileName);
29
- const appName = inputs.find(input => input.name === 'app')
29
+ const appName = inputs.find((input) => input.name === 'app')
30
30
  .value;
31
31
  const pathToTsconfig = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.tsConfigPath', appName, 'path', options);
32
- const binaryToRunOption = options.find(option => option.name === 'exec');
33
- const debugModeOption = options.find(option => option.name === 'debug');
34
- const watchModeOption = options.find(option => option.name === 'watch');
32
+ const binaryToRunOption = options.find((option) => option.name === 'exec');
33
+ const debugModeOption = options.find((option) => option.name === 'debug');
34
+ const watchModeOption = options.find((option) => option.name === 'watch');
35
35
  const isWatchEnabled = !!(watchModeOption && watchModeOption.value);
36
- const watchAssetsModeOption = options.find(option => option.name === 'watchAssets');
36
+ const watchAssetsModeOption = options.find((option) => option.name === 'watchAssets');
37
37
  const isWatchAssetsEnabled = !!(watchAssetsModeOption && watchAssetsModeOption.value);
38
38
  const debugFlag = debugModeOption && debugModeOption.value;
39
39
  const binaryToRun = binaryToRunOption && binaryToRunOption.value;
@@ -16,8 +16,8 @@ const abstract_action_1 = require("./abstract.action");
16
16
  class UpdateAction extends abstract_action_1.AbstractAction {
17
17
  handle(inputs, options) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
- const force = options.find(option => option.name === 'force');
20
- const tag = options.find(option => option.name === 'tag');
19
+ const force = options.find((option) => option.name === 'force');
20
+ const tag = options.find((option) => option.name === 'tag');
21
21
  const manager = new dependency_managers_1.NestDependencyManager(yield package_managers_1.PackageManagerFactory.find());
22
22
  yield manager.update(force.value, tag.value);
23
23
  });
@@ -82,7 +82,11 @@ class GenerateCommand extends abstract_command_1.AbstractCommand {
82
82
  };
83
83
  const table = new Table(tableConfig);
84
84
  for (const schematic of nest_collection_1.NestCollection.getSchematics()) {
85
- table.push([chalk.green(schematic.name), chalk.cyan(schematic.alias), schematic.description]);
85
+ table.push([
86
+ chalk.green(schematic.name),
87
+ chalk.cyan(schematic.alias),
88
+ schematic.description,
89
+ ]);
86
90
  }
87
91
  return table.toString();
88
92
  }
@@ -16,7 +16,7 @@ class AssetsManager {
16
16
  */
17
17
  closeWatchers() {
18
18
  const timeoutMs = 300;
19
- const closeFn = () => this.watchers.forEach(watcher => watcher.close());
19
+ const closeFn = () => this.watchers.forEach((watcher) => watcher.close());
20
20
  setTimeout(closeFn, timeoutMs);
21
21
  }
22
22
  copyAssets(configuration, appName, outDir, watchAssetsMode) {
@@ -27,7 +27,7 @@ class AssetsManager {
27
27
  try {
28
28
  let sourceRoot = get_value_or_default_1.getValueOrDefault(configuration, 'sourceRoot', appName);
29
29
  sourceRoot = path_1.join(process.cwd(), sourceRoot);
30
- const filesToCopy = assets.map(item => {
30
+ const filesToCopy = assets.map((item) => {
31
31
  if (typeof item === 'string') {
32
32
  return {
33
33
  glob: path_1.join(sourceRoot, item),
@@ -13,7 +13,7 @@ class Compiler {
13
13
  run(configuration, configFilename, appName, onSuccess) {
14
14
  const tsBinary = this.typescriptLoader.load();
15
15
  const formatHost = {
16
- getCanonicalFileName: path => path,
16
+ getCanonicalFileName: (path) => path,
17
17
  getCurrentDirectory: tsBinary.sys.getCurrentDirectory,
18
18
  getNewLine: () => tsBinary.sys.newLine,
19
19
  };
@@ -30,8 +30,8 @@ class Compiler {
30
30
  const programRef = program.getProgram
31
31
  ? program.getProgram()
32
32
  : program;
33
- const before = plugins.beforeHooks.map(hook => hook(programRef));
34
- const after = plugins.afterHooks.map(hook => hook(programRef));
33
+ const before = plugins.beforeHooks.map((hook) => hook(programRef));
34
+ const after = plugins.afterHooks.map((hook) => hook(programRef));
35
35
  const emitResult = program.emit(undefined, undefined, undefined, undefined, {
36
36
  before: before.concat(tsconfigPathsPlugin),
37
37
  after,
@@ -19,10 +19,7 @@ function dealWith(inPath, up) {
19
19
  if (depth(inPath) < up) {
20
20
  throw new Error('cant go up that far');
21
21
  }
22
- return path.join(...path
23
- .normalize(inPath)
24
- .split(path.sep)
25
- .slice(up));
22
+ return path.join(...path.normalize(inPath).split(path.sep).slice(up));
26
23
  }
27
24
  function depth(string) {
28
25
  return path.normalize(string).split(path.sep).length - 1;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getValueOrDefault = void 0;
4
4
  function getValueOrDefault(configuration, propertyPath, appName, key, options = [], defaultValue) {
5
- const item = options.find(option => option.name === key);
5
+ const item = options.find((option) => option.name === key);
6
6
  const origValue = item && item.value;
7
7
  if (origValue !== undefined && origValue !== null) {
8
8
  return origValue;
@@ -47,6 +47,17 @@ function getNotAliasedPath(sf, matcher, text) {
47
47
  if (os.platform() === 'win32') {
48
48
  result = result.replace(/\\/g, '/');
49
49
  }
50
+ try {
51
+ // Installed packages (node modules) should take precedence over root files with the same name.
52
+ // Ref: https://github.com/nestjs/nest-cli/issues/838
53
+ const packagePath = require.resolve(text, {
54
+ paths: [process.cwd(), ...module.paths],
55
+ });
56
+ if (packagePath) {
57
+ return text;
58
+ }
59
+ }
60
+ catch (_a) { }
50
61
  const resolvedPath = path_1.posix.relative(path_1.dirname(sf.fileName), result) || './';
51
62
  return resolvedPath[0] === '.' ? resolvedPath : './' + resolvedPath;
52
63
  }
@@ -33,8 +33,8 @@ class WatchCompiler {
33
33
  program.emit = (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) => {
34
34
  let transforms = customTransformers;
35
35
  transforms = typeof transforms !== 'object' ? {} : transforms;
36
- const before = plugins.beforeHooks.map(hook => hook(program.getProgram()));
37
- const after = plugins.afterHooks.map(hook => hook(program.getProgram()));
36
+ const before = plugins.beforeHooks.map((hook) => hook(program.getProgram()));
37
+ const after = plugins.afterHooks.map((hook) => hook(program.getProgram()));
38
38
  before.unshift(tsconfigPathsPlugin);
39
39
  transforms.before = before.concat(transforms.before || []);
40
40
  transforms.after = after.concat(transforms.after || []);
@@ -19,7 +19,7 @@ class WorkspaceUtils {
19
19
  if (!isDeleteEnabled) {
20
20
  return;
21
21
  }
22
- yield new Promise((resolve, reject) => rimraf(dirPath, err => (err ? reject(err) : resolve())));
22
+ yield new Promise((resolve, reject) => rimraf(dirPath, (err) => (err ? reject(err) : resolve())));
23
23
  });
24
24
  }
25
25
  }
@@ -20,8 +20,8 @@ class NestDependencyManager {
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
21
  const production = yield this.packageManager.getProduction();
22
22
  return production
23
- .filter(dependency => dependency.name.indexOf('@nestjs') > -1)
24
- .map(dependency => dependency.name);
23
+ .filter((dependency) => dependency.name.indexOf('@nestjs') > -1)
24
+ .map((dependency) => dependency.name);
25
25
  });
26
26
  }
27
27
  update(force, tag = 'latest') {
@@ -60,10 +60,10 @@ class AbstractPackageManager {
60
60
  addProduction(dependencies, tag) {
61
61
  return __awaiter(this, void 0, void 0, function* () {
62
62
  const command = [this.cli.add, this.cli.saveFlag]
63
- .filter(i => i)
63
+ .filter((i) => i)
64
64
  .join(' ');
65
65
  const args = dependencies
66
- .map(dependency => `${dependency}@${tag}`)
66
+ .map((dependency) => `${dependency}@${tag}`)
67
67
  .join(' ');
68
68
  const spinner = ora({
69
69
  spinner: {
@@ -88,7 +88,7 @@ class AbstractPackageManager {
88
88
  return __awaiter(this, void 0, void 0, function* () {
89
89
  const command = `${this.cli.add} ${this.cli.saveDevFlag}`;
90
90
  const args = dependencies
91
- .map(dependency => `${dependency}@${tag}`)
91
+ .map((dependency) => `${dependency}@${tag}`)
92
92
  .join(' ');
93
93
  yield this.add(`${command} ${args}`);
94
94
  });
@@ -168,7 +168,7 @@ class AbstractPackageManager {
168
168
  deleteProduction(dependencies) {
169
169
  return __awaiter(this, void 0, void 0, function* () {
170
170
  const command = [this.cli.remove, this.cli.saveFlag]
171
- .filter(i => i)
171
+ .filter((i) => i)
172
172
  .join(' ');
173
173
  const args = dependencies.join(' ');
174
174
  yield this.delete(`${command} ${args}`);
@@ -27,13 +27,13 @@ class PackageManagerFactory {
27
27
  }
28
28
  static find() {
29
29
  return __awaiter(this, void 0, void 0, function* () {
30
- return new Promise(resolve => {
30
+ return new Promise((resolve) => {
31
31
  fs_1.readdir(process.cwd(), (error, files) => {
32
32
  if (error) {
33
33
  resolve(this.create(package_manager_1.PackageManager.NPM));
34
34
  }
35
35
  else {
36
- if (files.findIndex(filename => filename === 'yarn.lock') > -1) {
36
+ if (files.findIndex((filename) => filename === 'yarn.lock') > -1) {
37
37
  resolve(this.create(package_manager_1.PackageManager.YARN));
38
38
  }
39
39
  else {
@@ -29,9 +29,9 @@ class AbstractRunner {
29
29
  return new Promise((resolve, reject) => {
30
30
  const child = child_process_1.spawn(`${this.binary}`, [...this.args, ...args], options);
31
31
  if (collect) {
32
- child.stdout.on('data', data => resolve(data.toString().replace(/\r\n|\n/, '')));
32
+ child.stdout.on('data', (data) => resolve(data.toString().replace(/\r\n|\n/, '')));
33
33
  }
34
- child.on('close', code => {
34
+ child.on('close', (code) => {
35
35
  if (code === 0) {
36
36
  resolve(null);
37
37
  }
@@ -40,97 +40,101 @@ NestCollection.schematics = [
40
40
  {
41
41
  name: 'application',
42
42
  alias: 'application',
43
- description: 'Generate a new application workspace'
43
+ description: 'Generate a new application workspace',
44
44
  },
45
45
  {
46
46
  name: 'angular-app',
47
47
  alias: 'ng-app',
48
- description: ''
48
+ description: '',
49
49
  },
50
50
  {
51
51
  name: 'class',
52
52
  alias: 'cl',
53
- description: 'Generate a new class'
53
+ description: 'Generate a new class',
54
54
  },
55
55
  {
56
56
  name: 'configuration',
57
57
  alias: 'config',
58
- description: 'Generate a CLI configuration file'
58
+ description: 'Generate a CLI configuration file',
59
59
  },
60
60
  {
61
61
  name: 'controller',
62
62
  alias: 'co',
63
- description: 'Generate a controller declaration'
63
+ description: 'Generate a controller declaration',
64
64
  },
65
65
  {
66
66
  name: 'decorator',
67
67
  alias: 'd',
68
- description: 'Generate a custom decorator'
68
+ description: 'Generate a custom decorator',
69
69
  },
70
70
  {
71
71
  name: 'filter',
72
72
  alias: 'f',
73
- description: 'Generate a filter declaration'
73
+ description: 'Generate a filter declaration',
74
74
  },
75
75
  {
76
76
  name: 'gateway',
77
77
  alias: 'ga',
78
- description: 'Generate a gateway declaration'
78
+ description: 'Generate a gateway declaration',
79
79
  },
80
80
  {
81
81
  name: 'guard',
82
82
  alias: 'gu',
83
- description: 'Generate a guard declaration'
83
+ description: 'Generate a guard declaration',
84
84
  },
85
85
  {
86
86
  name: 'interceptor',
87
87
  alias: 'in',
88
- description: 'Generate an interceptor declaration'
88
+ description: 'Generate an interceptor declaration',
89
89
  },
90
90
  {
91
91
  name: 'interface',
92
92
  alias: 'interface',
93
- description: 'Generate an interface'
93
+ description: 'Generate an interface',
94
94
  },
95
95
  {
96
96
  name: 'middleware',
97
97
  alias: 'mi',
98
- description: 'Generate a middleware declaration'
98
+ description: 'Generate a middleware declaration',
99
99
  },
100
100
  {
101
101
  name: 'module',
102
102
  alias: 'mo',
103
- description: 'Generate a module declaration'
103
+ description: 'Generate a module declaration',
104
104
  },
105
105
  {
106
106
  name: 'pipe',
107
107
  alias: 'pi',
108
- description: 'Generate a pipe declaration'
108
+ description: 'Generate a pipe declaration',
109
109
  },
110
110
  {
111
111
  name: 'provider',
112
112
  alias: 'pr',
113
- description: 'Generate a provider declaration'
113
+ description: 'Generate a provider declaration',
114
114
  },
115
115
  {
116
116
  name: 'resolver',
117
117
  alias: 'r',
118
- description: 'Generate a GraphQL resolver declaration'
118
+ description: 'Generate a GraphQL resolver declaration',
119
119
  },
120
120
  {
121
121
  name: 'service',
122
122
  alias: 's',
123
- description: 'Generate a service declaration'
123
+ description: 'Generate a service declaration',
124
124
  },
125
125
  {
126
126
  name: 'library',
127
127
  alias: 'lib',
128
- description: 'Generate a new library within a monorepo'
128
+ description: 'Generate a new library within a monorepo',
129
129
  },
130
130
  {
131
131
  name: 'sub-app',
132
132
  alias: 'app',
133
- description: 'Generate a new application within a monorepo'
133
+ description: 'Generate a new application within a monorepo',
134
+ },
135
+ {
136
+ name: 'resource',
137
+ alias: 'res',
138
+ description: 'Generate a new CRUD resource',
134
139
  },
135
- { name: 'resource', alias: 'res', description: 'Generate a new CRUD resource' },
136
140
  ];
@@ -61,7 +61,7 @@ exports.askForProjectName = askForProjectName;
61
61
  function moveDefaultProjectToStart(configuration, defaultProjectName, defaultLabel) {
62
62
  let projects = Object.keys(configuration.projects);
63
63
  if (configuration.sourceRoot !== 'src') {
64
- projects = projects.filter(p => p !== defaultProjectName.replace(defaultLabel, ''));
64
+ projects = projects.filter((p) => p !== defaultProjectName.replace(defaultLabel, ''));
65
65
  }
66
66
  projects.unshift(defaultProjectName);
67
67
  return projects;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/cli",
3
- "version": "7.5.2-next.2",
3
+ "version": "7.5.2",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@cli)",
5
5
  "publishConfig": {
6
6
  "access": "public"