@nestjs/cli 8.1.8 → 8.2.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.
Files changed (41) hide show
  1. package/actions/add.action.js +5 -5
  2. package/actions/build.action.js +4 -4
  3. package/actions/generate.action.js +7 -7
  4. package/actions/info.action.js +4 -4
  5. package/actions/new.action.js +8 -8
  6. package/actions/start.action.js +7 -7
  7. package/bin/nest.js +2 -2
  8. package/commands/add.command.js +1 -1
  9. package/lib/compiler/assets-manager.js +9 -9
  10. package/lib/compiler/compiler.js +2 -2
  11. package/lib/compiler/defaults/webpack-defaults.js +2 -2
  12. package/lib/compiler/helpers/append-extension.js +1 -1
  13. package/lib/compiler/helpers/tsconfig-provider.js +2 -2
  14. package/lib/compiler/hooks/tsconfig-paths.hook.js +7 -2
  15. package/lib/compiler/plugins-loader.js +4 -4
  16. package/lib/compiler/watch-compiler.js +2 -2
  17. package/lib/compiler/webpack-compiler.js +11 -11
  18. package/lib/compiler/workspace-utils.js +1 -1
  19. package/lib/package-managers/abstract.package-manager.js +7 -5
  20. package/lib/package-managers/npm.package-manager.js +1 -0
  21. package/lib/package-managers/package-manager-commands.d.ts +1 -0
  22. package/lib/package-managers/package-manager.factory.js +1 -1
  23. package/lib/package-managers/pnpm.package-manager.js +1 -0
  24. package/lib/package-managers/yarn.package-manager.js +1 -0
  25. package/lib/runners/abstract.runner.d.ts +5 -0
  26. package/lib/runners/abstract.runner.js +9 -1
  27. package/lib/ui/emojis.js +17 -17
  28. package/lib/ui/messages.d.ts +1 -1
  29. package/lib/ui/messages.js +1 -1
  30. package/lib/utils/local-binaries.js +1 -1
  31. package/lib/utils/project-utils.js +3 -3
  32. package/lib/utils/tree-kill.js +2 -2
  33. package/package.json +22 -22
  34. package/test/lib/compiler/hooks/__snapshots__/tsconfig-paths.hook.spec.ts.snap +45 -0
  35. package/test/lib/compiler/hooks/fixtures/aliased-imports/src/bar.tsx +1 -0
  36. package/test/lib/compiler/hooks/fixtures/aliased-imports/src/baz.js +1 -0
  37. package/test/lib/compiler/hooks/fixtures/aliased-imports/src/qux.jsx +1 -0
  38. package/.commitlintrc.json +0 -28
  39. package/.eslintignore +0 -3
  40. package/.eslintrc.js +0 -25
  41. package/.release-it.json +0 -9
@@ -39,14 +39,14 @@ class AddAction extends abstract_action_1.AbstractAction {
39
39
  }
40
40
  getSourceRoot(inputs) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
- const configuration = yield load_configuration_1.loadConfiguration();
42
+ const configuration = yield (0, load_configuration_1.loadConfiguration)();
43
43
  const configurationProjects = configuration.projects;
44
44
  const appName = inputs.find((option) => option.name === 'project')
45
45
  .value;
46
46
  let sourceRoot = appName
47
- ? get_value_or_default_1.getValueOrDefault(configuration, 'sourceRoot', appName)
47
+ ? (0, get_value_or_default_1.getValueOrDefault)(configuration, 'sourceRoot', appName)
48
48
  : configuration.sourceRoot;
49
- const shouldAsk = project_utils_1.shouldAskForProject(schematicName, configurationProjects, appName);
49
+ const shouldAsk = (0, project_utils_1.shouldAskForProject)(schematicName, configurationProjects, appName);
50
50
  if (shouldAsk) {
51
51
  const defaultLabel = ' [ Default ]';
52
52
  let defaultProjectName = configuration.sourceRoot + defaultLabel;
@@ -57,8 +57,8 @@ class AddAction extends abstract_action_1.AbstractAction {
57
57
  break;
58
58
  }
59
59
  }
60
- const projects = project_utils_1.moveDefaultProjectToStart(configuration, defaultProjectName, defaultLabel);
61
- const answers = yield project_utils_1.askForProjectName(ui_1.MESSAGES.LIBRARY_PROJECT_SELECTION_QUESTION, projects);
60
+ const projects = (0, project_utils_1.moveDefaultProjectToStart)(configuration, defaultProjectName, defaultLabel);
61
+ const answers = yield (0, project_utils_1.askForProjectName)(ui_1.MESSAGES.LIBRARY_PROJECT_SELECTION_QUESTION, projects);
62
62
  const project = answers.appName.replace(defaultLabel, '');
63
63
  if (project !== configuration.sourceRoot) {
64
64
  sourceRoot = configurationProjects[project].sourceRoot;
@@ -66,14 +66,14 @@ class BuildAction extends abstract_action_1.AbstractAction {
66
66
  const configuration = yield this.loader.load(configFileName);
67
67
  const appName = inputs.find((input) => input.name === 'app')
68
68
  .value;
69
- const pathToTsconfig = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.tsConfigPath', appName, 'path', options);
69
+ const pathToTsconfig = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.tsConfigPath', appName, 'path', options);
70
70
  const { options: tsOptions } = this.tsConfigProvider.getByConfigFilename(pathToTsconfig);
71
71
  const outDir = tsOptions.outDir || defaults_1.defaultOutDir;
72
- const isWebpackEnabled = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.webpack', appName, 'webpack', options);
72
+ const isWebpackEnabled = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.webpack', appName, 'webpack', options);
73
73
  yield this.workspaceUtils.deleteOutDirIfEnabled(configuration, appName, outDir);
74
74
  this.assetsManager.copyAssets(configuration, appName, outDir, watchAssetsMode);
75
75
  if (isWebpackEnabled) {
76
- const webpackPath = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.webpackConfigPath', appName, 'webpackPath', options);
76
+ const webpackPath = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.webpackConfigPath', appName, 'webpackPath', options);
77
77
  const webpackConfigFactoryOrConfig = this.getWebpackConfigFactoryByPath(webpackPath, configuration.compilerOptions.webpackConfigPath);
78
78
  return this.webpackCompiler.run(configuration, webpackConfigFactoryOrConfig, pathToTsconfig, appName, isDebugEnabled, watchMode, this.assetsManager, onSuccess);
79
79
  }
@@ -92,7 +92,7 @@ class BuildAction extends abstract_action_1.AbstractAction {
92
92
  });
93
93
  }
94
94
  getWebpackConfigFactoryByPath(webpackPath, defaultPath) {
95
- const pathToWebpackFile = path_1.join(process.cwd(), webpackPath);
95
+ const pathToWebpackFile = (0, path_1.join)(process.cwd(), webpackPath);
96
96
  try {
97
97
  return require(pathToWebpackFile);
98
98
  }
@@ -26,7 +26,7 @@ class GenerateAction extends abstract_action_1.AbstractAction {
26
26
  }
27
27
  exports.GenerateAction = GenerateAction;
28
28
  const generateFiles = (inputs) => __awaiter(void 0, void 0, void 0, function* () {
29
- const configuration = yield load_configuration_1.loadConfiguration();
29
+ const configuration = yield (0, load_configuration_1.loadConfiguration)();
30
30
  const collectionOption = inputs.find((option) => option.name === 'collection').value;
31
31
  const schematic = inputs.find((option) => option.name === 'schematic')
32
32
  .value;
@@ -38,14 +38,14 @@ const generateFiles = (inputs) => __awaiter(void 0, void 0, void 0, function* ()
38
38
  schematicOptions.push(new schematics_1.SchematicOption('language', configuration.language));
39
39
  const configurationProjects = configuration.projects;
40
40
  let sourceRoot = appName
41
- ? get_value_or_default_1.getValueOrDefault(configuration, 'sourceRoot', appName)
41
+ ? (0, get_value_or_default_1.getValueOrDefault)(configuration, 'sourceRoot', appName)
42
42
  : configuration.sourceRoot;
43
43
  const specValue = spec.value;
44
44
  const specOptions = spec.options;
45
- let generateSpec = project_utils_1.shouldGenerateSpec(configuration, schematic, appName, specValue, specOptions.passedAsInput);
45
+ let generateSpec = (0, project_utils_1.shouldGenerateSpec)(configuration, schematic, appName, specValue, specOptions.passedAsInput);
46
46
  // If you only add a `lib` we actually don't have monorepo: true BUT we do have "projects"
47
47
  // Ensure we don't run for new app/libs schematics
48
- if (project_utils_1.shouldAskForProject(schematic, configurationProjects, appName)) {
48
+ if ((0, project_utils_1.shouldAskForProject)(schematic, configurationProjects, appName)) {
49
49
  const defaultLabel = ' [ Default ]';
50
50
  let defaultProjectName = configuration.sourceRoot + defaultLabel;
51
51
  for (const property in configurationProjects) {
@@ -54,15 +54,15 @@ const generateFiles = (inputs) => __awaiter(void 0, void 0, void 0, function* ()
54
54
  break;
55
55
  }
56
56
  }
57
- const projects = project_utils_1.moveDefaultProjectToStart(configuration, defaultProjectName, defaultLabel);
58
- const answers = yield project_utils_1.askForProjectName(ui_1.MESSAGES.PROJECT_SELECTION_QUESTION, projects);
57
+ const projects = (0, project_utils_1.moveDefaultProjectToStart)(configuration, defaultProjectName, defaultLabel);
58
+ const answers = yield (0, project_utils_1.askForProjectName)(ui_1.MESSAGES.PROJECT_SELECTION_QUESTION, projects);
59
59
  const project = answers.appName.replace(defaultLabel, '');
60
60
  if (project !== configuration.sourceRoot) {
61
61
  sourceRoot = configurationProjects[project].sourceRoot;
62
62
  }
63
63
  if (answers.appName !== defaultProjectName) {
64
64
  // Only overwrite if the appName is not the default- as it has already been loaded above
65
- generateSpec = project_utils_1.shouldGenerateSpec(configuration, schematic, answers.appName, specValue, specOptions.passedAsInput);
65
+ generateSpec = (0, project_utils_1.shouldGenerateSpec)(configuration, schematic, answers.appName, specValue, specOptions.passedAsInput);
66
66
  }
67
67
  }
68
68
  schematicOptions.push(new schematics_1.SchematicOption('sourceRoot', sourceRoot));
@@ -33,7 +33,7 @@ class InfoAction extends abstract_action_1.AbstractAction {
33
33
  displaySystemInformation() {
34
34
  return __awaiter(this, void 0, void 0, function* () {
35
35
  console.info(chalk.green('[System Information]'));
36
- console.info('OS Version :', chalk.blue(osName(os_1.platform(), os_1.release())));
36
+ console.info('OS Version :', chalk.blue(osName((0, os_1.platform)(), (0, os_1.release)())));
37
37
  console.info('NodeJS Version :', chalk.blue(process.version));
38
38
  yield this.displayPackageManagerVersion();
39
39
  });
@@ -69,10 +69,10 @@ class InfoAction extends abstract_action_1.AbstractAction {
69
69
  }
70
70
  displayCliVersion() {
71
71
  console.info(chalk.green('[Nest CLI]'));
72
- console.info('Nest CLI Version :', chalk.blue(JSON.parse(fs_1.readFileSync(path_1.join(__dirname, '../package.json')).toString()).version), '\n');
72
+ console.info('Nest CLI Version :', chalk.blue(JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(__dirname, '../package.json')).toString()).version), '\n');
73
73
  }
74
74
  readProjectPackageDependencies() {
75
- const buffer = fs_1.readFileSync(path_1.join(process.cwd(), 'package.json'));
75
+ const buffer = (0, fs_1.readFileSync)((0, path_1.join)(process.cwd(), 'package.json'));
76
76
  const pack = JSON.parse(buffer.toString());
77
77
  const dependencies = Object.assign(Object.assign({}, pack.dependencies), pack.devDependencies);
78
78
  Object.keys(dependencies).forEach((key) => {
@@ -94,7 +94,7 @@ class InfoAction extends abstract_action_1.AbstractAction {
94
94
  Object.keys(dependencies).forEach((key) => {
95
95
  if (key.indexOf('@nestjs') > -1) {
96
96
  const depPackagePath = require.resolve(key + '/package.json', { paths: [process.cwd()] });
97
- const depPackage = fs_1.readFileSync(depPackagePath).toString();
97
+ const depPackage = (0, fs_1.readFileSync)(depPackagePath).toString();
98
98
  const value = JSON.parse(depPackage).version;
99
99
  nestDependencies.push({
100
100
  name: `${key.replace(/@nestjs\//, '').replace(/@.*/, '')} version`,
@@ -53,7 +53,7 @@ exports.NewAction = NewAction;
53
53
  const getApplicationNameInput = (inputs) => inputs.find((input) => input.name === 'name');
54
54
  const getProjectDirectory = (applicationName, directoryOption) => {
55
55
  return ((directoryOption && directoryOption.value) ||
56
- strings_1.dasherize(applicationName.value));
56
+ (0, strings_1.dasherize)(applicationName.value));
57
57
  };
58
58
  const askForMissingInformation = (inputs) => __awaiter(void 0, void 0, void 0, function* () {
59
59
  console.info(ui_1.MESSAGES.PROJECT_INFORMATION_START);
@@ -62,7 +62,7 @@ const askForMissingInformation = (inputs) => __awaiter(void 0, void 0, void 0, f
62
62
  const nameInput = getApplicationNameInput(inputs);
63
63
  if (!nameInput.value) {
64
64
  const message = 'What name would you like to use for the new project?';
65
- const questions = [questions_1.generateInput('name', message)('nest-app')];
65
+ const questions = [(0, questions_1.generateInput)('name', message)('nest-app')];
66
66
  const answers = yield prompt(questions);
67
67
  replaceInputMissingInformation(inputs, answers);
68
68
  }
@@ -118,7 +118,7 @@ const selectPackageManager = () => __awaiter(void 0, void 0, void 0, function* (
118
118
  });
119
119
  const askForPackageManager = () => __awaiter(void 0, void 0, void 0, function* () {
120
120
  const questions = [
121
- questions_1.generateSelect('package-manager')(ui_1.MESSAGES.PACKAGE_MANAGER_QUESTION)([
121
+ (0, questions_1.generateSelect)('package-manager')(ui_1.MESSAGES.PACKAGE_MANAGER_QUESTION)([
122
122
  package_managers_1.PackageManager.NPM,
123
123
  package_managers_1.PackageManager.YARN,
124
124
  package_managers_1.PackageManager.PNPM
@@ -129,7 +129,7 @@ const askForPackageManager = () => __awaiter(void 0, void 0, void 0, function* (
129
129
  });
130
130
  const initializeGitRepository = (dir) => __awaiter(void 0, void 0, void 0, function* () {
131
131
  const runner = new git_runner_1.GitRunner();
132
- yield runner.run('init', true, path_1.join(process.cwd(), dir)).catch(() => {
132
+ yield runner.run('init', true, (0, path_1.join)(process.cwd(), dir)).catch(() => {
133
133
  console.error(chalk.red(ui_1.MESSAGES.GIT_INITIALIZATION_ERROR));
134
134
  });
135
135
  });
@@ -145,8 +145,8 @@ const initializeGitRepository = (dir) => __awaiter(void 0, void 0, void 0, funct
145
145
  */
146
146
  const createGitIgnoreFile = (dir, content) => {
147
147
  const fileContent = content || defaults_1.defaultGitIgnore;
148
- const filePath = path_1.join(process.cwd(), dir, '.gitignore');
149
- return util_1.promisify(fs.writeFile)(filePath, fileContent);
148
+ const filePath = (0, path_1.join)(process.cwd(), dir, '.gitignore');
149
+ return (0, util_1.promisify)(fs.writeFile)(filePath, fileContent);
150
150
  };
151
151
  const printCollective = () => {
152
152
  const dim = print('dim');
@@ -162,7 +162,7 @@ const printCollective = () => {
162
162
  emptyLine();
163
163
  };
164
164
  const print = (color = null) => (str = '') => {
165
- const terminalCols = exports.retrieveCols();
165
+ const terminalCols = (0, exports.retrieveCols)();
166
166
  const strLength = str.replace(/\u001b\[[0-9]{2}m/g, '').length;
167
167
  const leftPaddingLength = Math.floor((terminalCols - strLength) / 2);
168
168
  const leftPadding = ' '.repeat(Math.max(leftPaddingLength, 0));
@@ -174,7 +174,7 @@ const print = (color = null) => (str = '') => {
174
174
  const retrieveCols = () => {
175
175
  const defaultCols = 80;
176
176
  try {
177
- const terminalCols = child_process_1.execSync('tput cols', {
177
+ const terminalCols = (0, child_process_1.execSync)('tput cols', {
178
178
  stdio: ['pipe', 'pipe', 'ignore'],
179
179
  });
180
180
  return parseInt(terminalCols.toString(), 10) || defaultCols;
@@ -29,7 +29,7 @@ class StartAction extends build_action_1.BuildAction {
29
29
  const configuration = yield this.loader.load(configFileName);
30
30
  const appName = inputs.find((input) => input.name === 'app')
31
31
  .value;
32
- const pathToTsconfig = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.tsConfigPath', appName, 'path', options);
32
+ const pathToTsconfig = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.tsConfigPath', appName, 'path', options);
33
33
  const binaryToRunOption = options.find((option) => option.name === 'exec');
34
34
  const debugModeOption = options.find((option) => option.name === 'debug');
35
35
  const watchModeOption = options.find((option) => option.name === 'watch');
@@ -54,10 +54,10 @@ class StartAction extends build_action_1.BuildAction {
54
54
  });
55
55
  }
56
56
  createOnSuccessHook(configuration, appName, debugFlag, outDirName, binaryToRun = 'node') {
57
- const sourceRoot = get_value_or_default_1.getValueOrDefault(configuration, 'sourceRoot', appName);
58
- const entryFile = get_value_or_default_1.getValueOrDefault(configuration, 'entryFile', appName);
57
+ const sourceRoot = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'sourceRoot', appName);
58
+ const entryFile = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'entryFile', appName);
59
59
  let childProcessRef;
60
- process.on('exit', () => childProcessRef && tree_kill_1.treeKillSync(childProcessRef.pid));
60
+ process.on('exit', () => childProcessRef && (0, tree_kill_1.treeKillSync)(childProcessRef.pid));
61
61
  return () => {
62
62
  if (childProcessRef) {
63
63
  childProcessRef.removeAllListeners('exit');
@@ -78,9 +78,9 @@ class StartAction extends build_action_1.BuildAction {
78
78
  };
79
79
  }
80
80
  spawnChildProcess(entryFile, sourceRoot, debug, outDirName, binaryToRun) {
81
- let outputFilePath = path_1.join(outDirName, sourceRoot, entryFile);
81
+ let outputFilePath = (0, path_1.join)(outDirName, sourceRoot, entryFile);
82
82
  if (!fs.existsSync(outputFilePath + '.js')) {
83
- outputFilePath = path_1.join(outDirName, entryFile);
83
+ outputFilePath = (0, path_1.join)(outDirName, entryFile);
84
84
  }
85
85
  let childProcessArgs = [];
86
86
  const argsStartIndex = process.argv.indexOf('--');
@@ -97,7 +97,7 @@ class StartAction extends build_action_1.BuildAction {
97
97
  if (this.isSourceMapSupportPkgAvailable()) {
98
98
  processArgs.unshift('-r source-map-support/register');
99
99
  }
100
- return child_process_1.spawn(binaryToRun, processArgs, {
100
+ return (0, child_process_1.spawn)(binaryToRun, processArgs, {
101
101
  stdio: 'inherit',
102
102
  shell: true,
103
103
  });
package/bin/nest.js CHANGED
@@ -10,8 +10,8 @@ const bootstrap = () => {
10
10
  .version(require('../package.json').version, '-v, --version', 'Output the current version.')
11
11
  .usage('<command> [options]')
12
12
  .helpOption('-h, --help', 'Output usage information.');
13
- if (local_binaries_1.localBinExists()) {
14
- const localCommandLoader = local_binaries_1.loadLocalBinCommandLoader();
13
+ if ((0, local_binaries_1.localBinExists)()) {
14
+ const localCommandLoader = (0, local_binaries_1.loadLocalBinCommandLoader)();
15
15
  localCommandLoader.load(program);
16
16
  }
17
17
  else {
@@ -30,7 +30,7 @@ class AddCommand extends abstract_command_1.AbstractCommand {
30
30
  });
31
31
  const inputs = [];
32
32
  inputs.push({ name: 'library', value: library });
33
- const flags = remaining_flags_1.getRemainingFlags(program);
33
+ const flags = (0, remaining_flags_1.getRemainingFlags)(program);
34
34
  try {
35
35
  yield this.action.handle(inputs, options, flags);
36
36
  }
@@ -33,29 +33,29 @@ class AssetsManager {
33
33
  setTimeout(closeFn, timeoutMs);
34
34
  }
35
35
  copyAssets(configuration, appName, outDir, watchAssetsMode) {
36
- const assets = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.assets', appName) || [];
36
+ const assets = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.assets', appName) || [];
37
37
  if (assets.length <= 0) {
38
38
  return;
39
39
  }
40
40
  try {
41
- let sourceRoot = get_value_or_default_1.getValueOrDefault(configuration, 'sourceRoot', appName);
42
- sourceRoot = path_1.join(process.cwd(), sourceRoot);
41
+ let sourceRoot = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'sourceRoot', appName);
42
+ sourceRoot = (0, path_1.join)(process.cwd(), sourceRoot);
43
43
  const filesToCopy = assets.map((item) => {
44
44
  if (typeof item === 'string') {
45
45
  return {
46
- glob: path_1.join(sourceRoot, item),
46
+ glob: (0, path_1.join)(sourceRoot, item),
47
47
  outDir,
48
48
  };
49
49
  }
50
50
  return {
51
51
  outDir: item.outDir || outDir,
52
- glob: path_1.join(sourceRoot, item.include),
53
- exclude: item.exclude ? path_1.join(sourceRoot, item.exclude) : undefined,
52
+ glob: (0, path_1.join)(sourceRoot, item.include),
53
+ exclude: item.exclude ? (0, path_1.join)(sourceRoot, item.exclude) : undefined,
54
54
  flat: item.flat,
55
55
  watchAssets: item.watchAssets,
56
56
  };
57
57
  });
58
- const isWatchEnabled = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.watchAssets', appName) || watchAssetsMode;
58
+ const isWatchEnabled = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.watchAssets', appName) || watchAssetsMode;
59
59
  for (const item of filesToCopy) {
60
60
  const option = {
61
61
  action: 'change',
@@ -88,10 +88,10 @@ class AssetsManager {
88
88
  this.watchAssetsKeyValue[path] = true;
89
89
  // Set action to true to avoid watches getting cutoff
90
90
  this.actionInProgress = true;
91
- const dest = copy_path_resolve_1.copyPathResolve(path, item.outDir, sourceRoot.split(path_1.sep).length);
91
+ const dest = (0, copy_path_resolve_1.copyPathResolve)(path, item.outDir, sourceRoot.split(path_1.sep).length);
92
92
  // Copy to output dir if file is changed or added
93
93
  if (action === 'change') {
94
- shell.mkdir('-p', path_1.dirname(dest));
94
+ shell.mkdir('-p', (0, path_1.dirname)(dest));
95
95
  shell.cp(path, dest);
96
96
  }
97
97
  else if (action === 'unlink') {
@@ -24,9 +24,9 @@ class Compiler {
24
24
  projectReferences,
25
25
  options,
26
26
  });
27
- const pluginsConfig = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.plugins', appName);
27
+ const pluginsConfig = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.plugins', appName);
28
28
  const plugins = this.pluginsLoader.load(pluginsConfig);
29
- const tsconfigPathsPlugin = tsconfig_paths_hook_1.tsconfigPathsBeforeHookFactory(options);
29
+ const tsconfigPathsPlugin = (0, tsconfig_paths_hook_1.tsconfigPathsBeforeHookFactory)(options);
30
30
  const programRef = program.getProgram
31
31
  ? program.getProgram()
32
32
  : program;
@@ -9,11 +9,11 @@ const append_extension_1 = require("../helpers/append-extension");
9
9
  const webpack = require("webpack");
10
10
  const nodeExternals = require("webpack-node-externals");
11
11
  const webpackDefaultsFactory = (sourceRoot, relativeSourceRoot, entryFilename, isDebugEnabled = false, tsConfigFile = defaults_1.defaultConfiguration.compilerOptions.tsConfigPath, plugins) => ({
12
- entry: append_extension_1.appendTsExtension(path_1.join(sourceRoot, entryFilename)),
12
+ entry: (0, append_extension_1.appendTsExtension)((0, path_1.join)(sourceRoot, entryFilename)),
13
13
  devtool: isDebugEnabled ? 'inline-source-map' : false,
14
14
  target: 'node',
15
15
  output: {
16
- filename: path_1.join(relativeSourceRoot, `${entryFilename}.js`),
16
+ filename: (0, path_1.join)(relativeSourceRoot, `${entryFilename}.js`),
17
17
  },
18
18
  ignoreWarnings: [/^(?!CriticalDependenciesWarning$)/],
19
19
  externals: [nodeExternals()],
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.appendTsExtension = void 0;
4
4
  const path_1 = require("path");
5
5
  function appendTsExtension(path) {
6
- return path_1.extname(path) === '.ts' ? path : path + '.ts';
6
+ return (0, path_1.extname)(path) === '.ts' ? path : path + '.ts';
7
7
  }
8
8
  exports.appendTsExtension = appendTsExtension;
@@ -9,8 +9,8 @@ class TsConfigProvider {
9
9
  this.typescriptLoader = typescriptLoader;
10
10
  }
11
11
  getByConfigFilename(configFilename) {
12
- const configPath = path_1.join(process.cwd(), configFilename);
13
- if (!fs_1.existsSync(configPath)) {
12
+ const configPath = (0, path_1.join)(process.cwd(), configFilename);
13
+ if (!(0, fs_1.existsSync)(configPath)) {
14
14
  throw new Error(ui_1.CLI_ERRORS.MISSING_TYPESCRIPT(configFilename));
15
15
  }
16
16
  const tsBinary = this.typescriptLoader.load();
@@ -42,7 +42,12 @@ function tsconfigPathsBeforeHookFactory(compilerOptions) {
42
42
  }
43
43
  exports.tsconfigPathsBeforeHookFactory = tsconfigPathsBeforeHookFactory;
44
44
  function getNotAliasedPath(sf, matcher, text) {
45
- let result = matcher(text, undefined, undefined, ['.ts', '.js']);
45
+ let result = matcher(text, undefined, undefined, [
46
+ '.ts',
47
+ '.tsx',
48
+ '.js',
49
+ '.jsx',
50
+ ]);
46
51
  if (!result) {
47
52
  return;
48
53
  }
@@ -60,6 +65,6 @@ function getNotAliasedPath(sf, matcher, text) {
60
65
  }
61
66
  }
62
67
  catch (_a) { }
63
- const resolvedPath = path_1.posix.relative(path_1.dirname(sf.fileName), result) || './';
68
+ const resolvedPath = path_1.posix.relative((0, path_1.dirname)(sf.fileName), result) || './';
64
69
  return resolvedPath[0] === '.' ? resolvedPath : './' + resolvedPath;
65
70
  }
@@ -7,15 +7,15 @@ const ui_1 = require("../ui");
7
7
  const PLUGIN_ENTRY_FILENAME = 'plugin';
8
8
  class PluginsLoader {
9
9
  load(plugins = []) {
10
- const pluginNames = plugins.map((entry) => util_1.isObject(entry) ? entry.name : entry);
10
+ const pluginNames = plugins.map((entry) => (0, util_1.isObject)(entry) ? entry.name : entry);
11
11
  const nodeModulePaths = [
12
- path_1.join(process.cwd(), 'node_modules'),
12
+ (0, path_1.join)(process.cwd(), 'node_modules'),
13
13
  ...module.paths,
14
14
  ];
15
15
  const pluginRefs = pluginNames.map((item) => {
16
16
  try {
17
17
  try {
18
- const binaryPath = require.resolve(path_1.join(item, PLUGIN_ENTRY_FILENAME), {
18
+ const binaryPath = require.resolve((0, path_1.join)(item, PLUGIN_ENTRY_FILENAME), {
19
19
  paths: nodeModulePaths,
20
20
  });
21
21
  return require(binaryPath);
@@ -35,7 +35,7 @@ class PluginsLoader {
35
35
  if (!plugin.before && !plugin.after && !plugin.afterDeclarations) {
36
36
  throw new Error(ui_1.CLI_ERRORS.WRONG_PLUGIN(pluginNames[index]));
37
37
  }
38
- const options = util_1.isObject(plugins[index])
38
+ const options = (0, util_1.isObject)(plugins[index])
39
39
  ? plugins[index].options || {}
40
40
  : {};
41
41
  plugin.before &&
@@ -21,13 +21,13 @@ class WatchCompiler {
21
21
  const origDiagnosticReporter = tsBin.createDiagnosticReporter(tsBin.sys, true);
22
22
  const origWatchStatusReporter = tsBin.createWatchStatusReporter(tsBin.sys, true);
23
23
  const host = tsBin.createWatchCompilerHost(configPath, tsCompilerOptions, tsBin.sys, createProgram, this.createDiagnosticReporter(origDiagnosticReporter), this.createWatchStatusChanged(origWatchStatusReporter, onSuccess));
24
- const pluginsConfig = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.plugins', appName);
24
+ const pluginsConfig = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.plugins', appName);
25
25
  const plugins = this.pluginsLoader.load(pluginsConfig);
26
26
  const origCreateProgram = host.createProgram;
27
27
  host.createProgram = (rootNames, options,
28
28
  // tslint:disable-next-line:no-shadowed-variable
29
29
  host, oldProgram) => {
30
- const tsconfigPathsPlugin = tsconfig_paths_hook_1.tsconfigPathsBeforeHookFactory(options);
30
+ const tsconfigPathsPlugin = (0, tsconfig_paths_hook_1.tsconfigPathsBeforeHookFactory)(options);
31
31
  const program = origCreateProgram(rootNames, options, host, oldProgram, undefined, projectReferences);
32
32
  const origProgramEmit = program.emit;
33
33
  program.emit = (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) => {
@@ -13,20 +13,20 @@ class WebpackCompiler {
13
13
  }
14
14
  run(configuration, webpackConfigFactoryOrConfig, tsConfigPath, appName, isDebugEnabled = false, watchMode = false, assetsManager, onSuccess) {
15
15
  const cwd = process.cwd();
16
- const configPath = path_1.join(cwd, tsConfigPath);
17
- if (!fs_1.existsSync(configPath)) {
16
+ const configPath = (0, path_1.join)(cwd, tsConfigPath);
17
+ if (!(0, fs_1.existsSync)(configPath)) {
18
18
  throw new Error(`Could not find TypeScript configuration file "${tsConfigPath}".`);
19
19
  }
20
- const pluginsConfig = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.plugins', appName);
20
+ const pluginsConfig = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.plugins', appName);
21
21
  const plugins = this.pluginsLoader.load(pluginsConfig);
22
- const relativeRootPath = path_1.dirname(path_1.relative(cwd, configPath));
23
- const sourceRoot = get_value_or_default_1.getValueOrDefault(configuration, 'sourceRoot', appName);
24
- const pathToSource = path_1.normalize(sourceRoot).indexOf(path_1.normalize(relativeRootPath)) >= 0
25
- ? path_1.join(cwd, sourceRoot)
26
- : path_1.join(cwd, relativeRootPath, sourceRoot);
27
- const entryFile = get_value_or_default_1.getValueOrDefault(configuration, 'entryFile', appName);
28
- const entryFileRoot = get_value_or_default_1.getValueOrDefault(configuration, 'root', appName) || '';
29
- const defaultOptions = webpack_defaults_1.webpackDefaultsFactory(pathToSource, entryFileRoot, entryFile, isDebugEnabled, tsConfigPath, plugins);
22
+ const relativeRootPath = (0, path_1.dirname)((0, path_1.relative)(cwd, configPath));
23
+ const sourceRoot = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'sourceRoot', appName);
24
+ const pathToSource = (0, path_1.normalize)(sourceRoot).indexOf((0, path_1.normalize)(relativeRootPath)) >= 0
25
+ ? (0, path_1.join)(cwd, sourceRoot)
26
+ : (0, path_1.join)(cwd, relativeRootPath, sourceRoot);
27
+ const entryFile = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'entryFile', appName);
28
+ const entryFileRoot = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'root', appName) || '';
29
+ const defaultOptions = (0, webpack_defaults_1.webpackDefaultsFactory)(pathToSource, entryFileRoot, entryFile, isDebugEnabled, tsConfigPath, plugins);
30
30
  const projectWebpackOptions = typeof webpackConfigFactoryOrConfig !== 'function'
31
31
  ? webpackConfigFactoryOrConfig
32
32
  : webpackConfigFactoryOrConfig(defaultOptions, webpack);
@@ -15,7 +15,7 @@ const get_value_or_default_1 = require("./helpers/get-value-or-default");
15
15
  class WorkspaceUtils {
16
16
  deleteOutDirIfEnabled(configuration, appName, dirPath) {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
- const isDeleteEnabled = get_value_or_default_1.getValueOrDefault(configuration, 'compilerOptions.deleteOutDir', appName);
18
+ const isDeleteEnabled = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.deleteOutDir', appName);
19
19
  if (!isDeleteEnabled) {
20
20
  return;
21
21
  }
@@ -31,10 +31,10 @@ class AbstractPackageManager {
31
31
  });
32
32
  spinner.start();
33
33
  try {
34
- const commandArguments = `${this.cli.install} --silent`;
34
+ const commandArgs = `${this.cli.install} ${this.cli.silentFlag}`;
35
35
  const collect = true;
36
- const dasherizedDirectory = strings_1.dasherize(directory);
37
- yield this.runner.run(commandArguments, collect, path_1.join(process.cwd(), dasherizedDirectory));
36
+ const dasherizedDirectory = (0, strings_1.dasherize)(directory);
37
+ yield this.runner.run(commandArgs, collect, (0, path_1.join)(process.cwd(), dasherizedDirectory));
38
38
  spinner.succeed();
39
39
  console.info();
40
40
  console.info(ui_1.MESSAGES.PACKAGE_MANAGER_INSTALLATION_SUCCEED(directory));
@@ -46,7 +46,9 @@ class AbstractPackageManager {
46
46
  }
47
47
  catch (_a) {
48
48
  spinner.fail();
49
- console.error(chalk.red(ui_1.MESSAGES.PACKAGE_MANAGER_INSTALLATION_FAILED));
49
+ const commandArgs = this.cli.install;
50
+ const commandToRun = this.runner.rawFullCommand(commandArgs);
51
+ console.error(chalk.red(ui_1.MESSAGES.PACKAGE_MANAGER_INSTALLATION_FAILED(chalk.bold(commandToRun))));
50
52
  }
51
53
  });
52
54
  }
@@ -124,7 +126,7 @@ class AbstractPackageManager {
124
126
  readPackageJson() {
125
127
  return __awaiter(this, void 0, void 0, function* () {
126
128
  return new Promise((resolve, reject) => {
127
- fs_1.readFile(path_1.join(process.cwd(), 'package.json'), (error, buffer) => {
129
+ (0, fs_1.readFile)((0, path_1.join)(process.cwd(), 'package.json'), (error, buffer) => {
128
130
  if (error !== undefined && error !== null) {
129
131
  reject(error);
130
132
  }
@@ -19,6 +19,7 @@ class NpmPackageManager extends abstract_package_manager_1.AbstractPackageManage
19
19
  remove: 'uninstall',
20
20
  saveFlag: '--save',
21
21
  saveDevFlag: '--save-dev',
22
+ silentFlag: '--silent',
22
23
  };
23
24
  }
24
25
  }
@@ -5,4 +5,5 @@ export interface PackageManagerCommands {
5
5
  remove: string;
6
6
  saveFlag: string;
7
7
  saveDevFlag: string;
8
+ silentFlag: string;
8
9
  }
@@ -31,7 +31,7 @@ class PackageManagerFactory {
31
31
  static find() {
32
32
  return __awaiter(this, void 0, void 0, function* () {
33
33
  return new Promise((resolve) => {
34
- fs_1.readdir(process.cwd(), (error, files) => {
34
+ (0, fs_1.readdir)(process.cwd(), (error, files) => {
35
35
  if (error) {
36
36
  resolve(this.create(package_manager_1.PackageManager.NPM));
37
37
  }
@@ -20,6 +20,7 @@ class PnpmPackageManager extends abstract_package_manager_1.AbstractPackageManag
20
20
  remove: 'uninstall',
21
21
  saveFlag: '--save',
22
22
  saveDevFlag: '--save-dev',
23
+ silentFlag: '--reporter=silent',
23
24
  };
24
25
  }
25
26
  }
@@ -19,6 +19,7 @@ class YarnPackageManager extends abstract_package_manager_1.AbstractPackageManag
19
19
  remove: 'remove',
20
20
  saveFlag: '',
21
21
  saveDevFlag: '-D',
22
+ silentFlag: '--silent',
22
23
  };
23
24
  }
24
25
  }
@@ -3,4 +3,9 @@ export declare class AbstractRunner {
3
3
  protected args: string[];
4
4
  constructor(binary: string, args?: string[]);
5
5
  run(command: string, collect?: boolean, cwd?: string): Promise<null | string>;
6
+ /**
7
+ * @param command
8
+ * @returns The entire command that will be ran when calling `run(command)`.
9
+ */
10
+ rawFullCommand(command: string): string;
6
11
  }
@@ -27,7 +27,7 @@ class AbstractRunner {
27
27
  shell: true,
28
28
  };
29
29
  return new Promise((resolve, reject) => {
30
- const child = child_process_1.spawn(`${this.binary}`, [...this.args, ...args], options);
30
+ const child = (0, child_process_1.spawn)(`${this.binary}`, [...this.args, ...args], options);
31
31
  if (collect) {
32
32
  child.stdout.on('data', (data) => resolve(data.toString().replace(/\r\n|\n/, '')));
33
33
  }
@@ -43,5 +43,13 @@ class AbstractRunner {
43
43
  });
44
44
  });
45
45
  }
46
+ /**
47
+ * @param command
48
+ * @returns The entire command that will be ran when calling `run(command)`.
49
+ */
50
+ rawFullCommand(command) {
51
+ const commandArgs = [...this.args, command];
52
+ return `${this.binary} ${commandArgs.join(' ')}`;
53
+ }
46
54
  }
47
55
  exports.AbstractRunner = AbstractRunner;
package/lib/ui/emojis.js CHANGED
@@ -3,21 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EMOJIS = void 0;
4
4
  const node_emoji_1 = require("node-emoji");
5
5
  exports.EMOJIS = {
6
- HEART: node_emoji_1.get('heart'),
7
- COFFEE: node_emoji_1.get('coffee'),
8
- BEER: node_emoji_1.get('beer'),
9
- BROKEN_HEART: node_emoji_1.get('broken_heart'),
10
- CRYING: node_emoji_1.get('crying_cat_face'),
11
- HEART_EYES: node_emoji_1.get('heart_eyes_cat'),
12
- JOY: node_emoji_1.get('joy_cat'),
13
- KISSING: node_emoji_1.get('kissing_cat'),
14
- SCREAM: node_emoji_1.get('scream_cat'),
15
- ROCKET: node_emoji_1.get('rocket'),
16
- SMIRK: node_emoji_1.get('smirk_cat'),
17
- RAISED_HANDS: node_emoji_1.get('raised_hands'),
18
- POINT_RIGHT: node_emoji_1.get('point_right'),
19
- ZAP: node_emoji_1.get('zap'),
20
- BOOM: node_emoji_1.get('boom'),
21
- PRAY: node_emoji_1.get('pray'),
22
- WINE: node_emoji_1.get('wine_glass'),
6
+ HEART: (0, node_emoji_1.get)('heart'),
7
+ COFFEE: (0, node_emoji_1.get)('coffee'),
8
+ BEER: (0, node_emoji_1.get)('beer'),
9
+ BROKEN_HEART: (0, node_emoji_1.get)('broken_heart'),
10
+ CRYING: (0, node_emoji_1.get)('crying_cat_face'),
11
+ HEART_EYES: (0, node_emoji_1.get)('heart_eyes_cat'),
12
+ JOY: (0, node_emoji_1.get)('joy_cat'),
13
+ KISSING: (0, node_emoji_1.get)('kissing_cat'),
14
+ SCREAM: (0, node_emoji_1.get)('scream_cat'),
15
+ ROCKET: (0, node_emoji_1.get)('rocket'),
16
+ SMIRK: (0, node_emoji_1.get)('smirk_cat'),
17
+ RAISED_HANDS: (0, node_emoji_1.get)('raised_hands'),
18
+ POINT_RIGHT: (0, node_emoji_1.get)('point_right'),
19
+ ZAP: (0, node_emoji_1.get)('zap'),
20
+ BOOM: (0, node_emoji_1.get)('boom'),
21
+ PRAY: (0, node_emoji_1.get)('pray'),
22
+ WINE: (0, node_emoji_1.get)('wine_glass'),
23
23
  };
@@ -14,7 +14,7 @@ export declare const MESSAGES: {
14
14
  GET_STARTED_INFORMATION: string;
15
15
  CHANGE_DIR_COMMAND: (name: string) => string;
16
16
  START_COMMAND: (name: string) => string;
17
- PACKAGE_MANAGER_INSTALLATION_FAILED: string;
17
+ PACKAGE_MANAGER_INSTALLATION_FAILED: (commandToRunManually: string) => string;
18
18
  NEST_INFORMATION_PACKAGE_MANAGER_FAILED: string;
19
19
  LIBRARY_INSTALLATION_FAILED_BAD_PACKAGE: (name: string) => string;
20
20
  LIBRARY_INSTALLATION_FAILED_NO_LIBRARY: string;
@@ -21,7 +21,7 @@ exports.MESSAGES = {
21
21
  GET_STARTED_INFORMATION: `${emojis_1.EMOJIS.POINT_RIGHT} Get started with the following commands:`,
22
22
  CHANGE_DIR_COMMAND: (name) => `$ cd ${name}`,
23
23
  START_COMMAND: (name) => `$ ${name} run start`,
24
- PACKAGE_MANAGER_INSTALLATION_FAILED: `${emojis_1.EMOJIS.SCREAM} Packages installation failed, see above`,
24
+ PACKAGE_MANAGER_INSTALLATION_FAILED: (commandToRunManually) => `${emojis_1.EMOJIS.SCREAM} Packages installation failed!\nIn case you don't see any errors above, consider manually running the failed command ${commandToRunManually} to see more details on why it errored out.`,
25
25
  // tslint:disable-next-line:max-line-length
26
26
  NEST_INFORMATION_PACKAGE_MANAGER_FAILED: `${emojis_1.EMOJIS.SMIRK} cannot read your project package.json file, are you inside your project directory?`,
27
27
  LIBRARY_INSTALLATION_FAILED_BAD_PACKAGE: (name) => `Unable to install library ${name} because package did not install. Please check package name.`,
@@ -5,7 +5,7 @@ const fs_1 = require("fs");
5
5
  const path_1 = require("path");
6
6
  const localBinPathSegments = [process.cwd(), 'node_modules', '@nestjs', 'cli'];
7
7
  function localBinExists() {
8
- return fs_1.existsSync(path_1.join(...localBinPathSegments));
8
+ return (0, fs_1.existsSync)((0, path_1.join)(...localBinPathSegments));
9
9
  }
10
10
  exports.localBinExists = localBinExists;
11
11
  function loadLocalBinCommandLoader() {
@@ -25,7 +25,7 @@ function shouldGenerateSpec(configuration, schematic, appName, specValue, specPa
25
25
  // CLI parameters has the highest priority
26
26
  return specValue;
27
27
  }
28
- let specConfiguration = get_value_or_default_1.getValueOrDefault(configuration, 'generateOptions.spec', appName || '');
28
+ let specConfiguration = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.spec', appName || '');
29
29
  if (typeof specConfiguration === 'boolean') {
30
30
  return specConfiguration;
31
31
  }
@@ -36,7 +36,7 @@ function shouldGenerateSpec(configuration, schematic, appName, specValue, specPa
36
36
  if (typeof specConfiguration === 'object' && appName) {
37
37
  // The appName has a generateOption spec, but not for the schematic trying to generate
38
38
  // Check if the global generateOptions has a spec to use instead
39
- specConfiguration = get_value_or_default_1.getValueOrDefault(configuration, 'generateOptions.spec', '');
39
+ specConfiguration = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'generateOptions.spec', '');
40
40
  if (typeof specConfiguration === 'boolean') {
41
41
  return specConfiguration;
42
42
  }
@@ -51,7 +51,7 @@ exports.shouldGenerateSpec = shouldGenerateSpec;
51
51
  function askForProjectName(promptQuestion, projects) {
52
52
  return __awaiter(this, void 0, void 0, function* () {
53
53
  const questions = [
54
- questions_1.generateSelect('appName')(promptQuestion)(projects),
54
+ (0, questions_1.generateSelect)('appName')(promptQuestion)(projects),
55
55
  ];
56
56
  const prompt = inquirer.createPromptModule();
57
57
  return prompt(questions);
@@ -4,7 +4,7 @@ exports.treeKillSync = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  function treeKillSync(pid, signal) {
6
6
  if (process.platform === 'win32') {
7
- child_process_1.execSync('taskkill /pid ' + pid + ' /T /F');
7
+ (0, child_process_1.execSync)('taskkill /pid ' + pid + ' /T /F');
8
8
  return;
9
9
  }
10
10
  const childs = getAllChilds(pid);
@@ -16,7 +16,7 @@ function treeKillSync(pid, signal) {
16
16
  }
17
17
  exports.treeKillSync = treeKillSync;
18
18
  function getAllPid() {
19
- const rows = child_process_1.execSync('ps -A -o pid,ppid')
19
+ const rows = (0, child_process_1.execSync)('ps -A -o pid,ppid')
20
20
  .toString()
21
21
  .trim()
22
22
  .split('\n')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/cli",
3
- "version": "8.1.8",
3
+ "version": "8.2.2",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@cli)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -43,15 +43,15 @@
43
43
  },
44
44
  "homepage": "https://github.com/nestjs/nest-cli#readme",
45
45
  "dependencies": {
46
- "@angular-devkit/core": "13.1.2",
47
- "@angular-devkit/schematics": "13.1.2",
48
- "@angular-devkit/schematics-cli": "13.1.2",
46
+ "@angular-devkit/core": "13.2.5",
47
+ "@angular-devkit/schematics": "13.2.5",
48
+ "@angular-devkit/schematics-cli": "13.2.5",
49
49
  "@nestjs/schematics": "^8.0.3",
50
50
  "chalk": "3.0.0",
51
- "chokidar": "3.5.2",
51
+ "chokidar": "3.5.3",
52
52
  "cli-table3": "0.6.1",
53
53
  "commander": "4.1.1",
54
- "fork-ts-checker-webpack-plugin": "6.5.0",
54
+ "fork-ts-checker-webpack-plugin": "7.2.1",
55
55
  "inquirer": "7.3.3",
56
56
  "node-emoji": "1.11.0",
57
57
  "ora": "5.4.1",
@@ -62,38 +62,38 @@
62
62
  "tree-kill": "1.2.2",
63
63
  "tsconfig-paths": "3.12.0",
64
64
  "tsconfig-paths-webpack-plugin": "3.5.2",
65
- "typescript": "4.3.5",
66
- "webpack": "5.65.0",
65
+ "typescript": "4.6.2",
66
+ "webpack": "5.66.0",
67
67
  "webpack-node-externals": "3.0.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@commitlint/cli": "16.0.2",
71
- "@commitlint/config-angular": "16.0.0",
70
+ "@commitlint/cli": "16.2.1",
71
+ "@commitlint/config-angular": "16.2.1",
72
72
  "@types/copyfiles": "2.4.1",
73
73
  "@types/inquirer": "7.3.3",
74
- "@types/jest": "27.4.0",
75
- "@types/node": "16.11.19",
74
+ "@types/jest": "27.4.1",
75
+ "@types/node": "16.11.26",
76
76
  "@types/node-emoji": "1.8.1",
77
77
  "@types/ora": "3.2.0",
78
78
  "@types/os-name": "3.1.0",
79
79
  "@types/rimraf": "3.0.2",
80
- "@types/shelljs": "0.8.10",
80
+ "@types/shelljs": "0.8.11",
81
81
  "@types/webpack-node-externals": "2.5.3",
82
- "@typescript-eslint/eslint-plugin": "5.9.0",
83
- "@typescript-eslint/parser": "5.9.0",
82
+ "@typescript-eslint/eslint-plugin": "5.13.0",
83
+ "@typescript-eslint/parser": "5.13.0",
84
84
  "delete-empty": "3.0.0",
85
- "eslint": "8.6.0",
86
- "eslint-config-prettier": "8.3.0",
85
+ "eslint": "8.10.0",
86
+ "eslint-config-prettier": "8.5.0",
87
87
  "eslint-plugin-import": "2.25.4",
88
88
  "gulp": "4.0.2",
89
89
  "gulp-clean": "0.4.0",
90
90
  "husky": "7.0.4",
91
- "jest": "27.4.7",
91
+ "jest": "27.5.1",
92
92
  "prettier": "2.5.1",
93
- "release-it": "14.12.1",
94
- "ts-jest": "27.1.2",
95
- "ts-loader": "9.2.6",
96
- "ts-node": "10.4.0"
93
+ "release-it": "14.12.5",
94
+ "ts-jest": "27.1.3",
95
+ "ts-loader": "9.2.7",
96
+ "ts-node": "10.6.0"
97
97
  },
98
98
  "husky": {
99
99
  "hooks": {
@@ -21,3 +21,48 @@ Object.defineProperty(exports, \\"__esModule\\", { value: true });
21
21
  ",
22
22
  }
23
23
  `;
24
+
25
+ exports[`tsconfig paths hooks should replace path of every import using a path alias by its relative path 1`] = `
26
+ Map {
27
+ "dist/foo.js" => "\\"use strict\\";
28
+ Object.defineProperty(exports, \\"__esModule\\", { value: true });
29
+ exports.Foo = void 0;
30
+ class Foo {
31
+ }
32
+ exports.Foo = Foo;
33
+ ",
34
+ "dist/bar.jsx" => "\\"use strict\\";
35
+ Object.defineProperty(exports, \\"__esModule\\", { value: true });
36
+ exports.Bar = void 0;
37
+ class Bar {
38
+ }
39
+ exports.Bar = Bar;
40
+ ",
41
+ "dist/baz.js" => "\\"use strict\\";
42
+ Object.defineProperty(exports, \\"__esModule\\", { value: true });
43
+ exports.Baz = void 0;
44
+ class Baz {
45
+ }
46
+ exports.Baz = Baz;
47
+ ",
48
+ "dist/qux.jsx" => "\\"use strict\\";
49
+ Object.defineProperty(exports, \\"__esModule\\", { value: true });
50
+ exports.Qux = void 0;
51
+ class Qux {
52
+ }
53
+ exports.Qux = Qux;
54
+ ",
55
+ "dist/main.js" => "\\"use strict\\";
56
+ Object.defineProperty(exports, \\"__esModule\\", { value: true });
57
+ const foo_1 = require(\\"./foo\\");
58
+ const bar_1 = require(\\"./bar\\");
59
+ const baz_1 = require(\\"./baz\\");
60
+ const qux_1 = require(\\"./qux\\");
61
+ // use the imports so they do not get eliminated
62
+ console.log(foo_1.Foo);
63
+ console.log(bar_1.Bar);
64
+ console.log(baz_1.Baz);
65
+ console.log(qux_1.Qux);
66
+ ",
67
+ }
68
+ `;
@@ -0,0 +1 @@
1
+ export class Bar {}
@@ -0,0 +1 @@
1
+ export class Baz {}
@@ -0,0 +1 @@
1
+ export class Qux {}
@@ -1,28 +0,0 @@
1
- {
2
- "extends": ["@commitlint/config-angular"],
3
- "rules": {
4
- "subject-case": [
5
- 2,
6
- "always",
7
- ["sentence-case", "start-case", "pascal-case", "upper-case", "lower-case"]
8
- ],
9
- "type-enum": [
10
- 2,
11
- "always",
12
- [
13
- "build",
14
- "chore",
15
- "ci",
16
- "docs",
17
- "feat",
18
- "fix",
19
- "perf",
20
- "refactor",
21
- "revert",
22
- "style",
23
- "test",
24
- "sample"
25
- ]
26
- ]
27
- }
28
- }
package/.eslintignore DELETED
@@ -1,3 +0,0 @@
1
- src/**/*.test.ts
2
- src/**/files/**
3
- test/**
package/.eslintrc.js DELETED
@@ -1,25 +0,0 @@
1
- module.exports = {
2
- parser: '@typescript-eslint/parser',
3
- parserOptions: {
4
- project: 'tsconfig.json',
5
- sourceType: 'module',
6
- },
7
- plugins: ['@typescript-eslint/eslint-plugin'],
8
- extends: [
9
- 'plugin:@typescript-eslint/eslint-recommended',
10
- 'plugin:@typescript-eslint/recommended',
11
- 'prettier'
12
- ],
13
- root: true,
14
- env: {
15
- node: true,
16
- jest: true,
17
- },
18
- rules: {
19
- '@typescript-eslint/interface-name-prefix': 'off',
20
- '@typescript-eslint/explicit-function-return-type': 'off',
21
- '@typescript-eslint/no-explicit-any': 'off',
22
- '@typescript-eslint/no-use-before-define': 'off',
23
- '@typescript-eslint/no-non-null-assertion': 'off',
24
- },
25
- };
package/.release-it.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "git": {
3
- "tagName": "${version}",
4
- "commitMessage": "chore(): release v${version}"
5
- },
6
- "github": {
7
- "release": true
8
- }
9
- }