create-nx-workspace 17.0.5 → 17.0.6

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.
@@ -11,26 +11,26 @@ const git_1 = require("./utils/git/git");
11
11
  const get_third_party_preset_1 = require("./utils/preset/get-third-party-preset");
12
12
  const error_utils_1 = require("./utils/error-utils");
13
13
  async function createWorkspace(preset, options) {
14
- const { packageManager, name, nxCloud, skipGit = false, defaultBase = 'main', commit, cliName, } = options;
14
+ const { packageManager, name, nxCloud, ci = '', skipGit = false, defaultBase = 'main', commit, cliName, } = options;
15
15
  if (cliName) {
16
16
  output_1.output.setCliName(cliName ?? 'NX');
17
17
  }
18
18
  const tmpDir = await (0, create_sandbox_1.createSandbox)(packageManager);
19
- // nx new requires a preset currently. We should probably make it optional.
19
+ // nx new requires preset currently. We should probably make it optional.
20
20
  const directory = await (0, create_empty_workspace_1.createEmptyWorkspace)(tmpDir, name, packageManager, { ...options, preset });
21
21
  // If the preset is a third-party preset, we need to call createPreset to install it
22
- // For first-party presets, it will be created by createEmptyWorkspace instead.
22
+ // For first-party presets, it will created by createEmptyWorkspace instead.
23
23
  // In createEmptyWorkspace, it will call `nx new` -> `@nx/workspace newGenerator` -> `@nx/workspace generatePreset`.
24
24
  const thirdPartyPreset = await (0, get_third_party_preset_1.getThirdPartyPreset)(preset);
25
25
  if (thirdPartyPreset) {
26
26
  await (0, create_preset_1.createPreset)(thirdPartyPreset, options, packageManager, directory);
27
27
  }
28
28
  let nxCloudInstallRes;
29
- if (nxCloud !== 'skip') {
30
- nxCloudInstallRes = await (0, nx_cloud_1.setupNxCloud)(directory, packageManager, nxCloud);
31
- if (nxCloud !== 'yes') {
32
- await (0, setup_ci_1.setupCI)(directory, nxCloud, packageManager, nxCloudInstallRes?.code === 0);
33
- }
29
+ if (nxCloud) {
30
+ nxCloudInstallRes = await (0, nx_cloud_1.setupNxCloud)(directory, packageManager);
31
+ }
32
+ if (ci) {
33
+ await (0, setup_ci_1.setupCI)(directory, ci, packageManager, nxCloud && nxCloudInstallRes?.code === 0);
34
34
  }
35
35
  if (!skipGit && commit) {
36
36
  try {
@@ -1,9 +1,13 @@
1
1
  import * as yargs from 'yargs';
2
+ import { CI } from '../utils/ci/ci-list';
2
3
  import { PackageManager } from '../utils/package-manager';
3
- import { NxCloud } from '../utils/nx/nx-cloud';
4
4
  export declare function determineNxCloud(parsedArgs: yargs.Arguments<{
5
- nxCloud: NxCloud;
6
- }>): Promise<NxCloud>;
5
+ nxCloud: boolean;
6
+ }>): Promise<boolean>;
7
+ export declare function determineCI(parsedArgs: yargs.Arguments<{
8
+ ci?: CI;
9
+ allPrompts?: boolean;
10
+ }>, nxCloud: boolean): Promise<string>;
7
11
  export declare function determineDefaultBase(parsedArgs: yargs.Arguments<{
8
12
  defaultBase?: string;
9
13
  }>): Promise<string>;
@@ -1,44 +1,79 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.determinePackageManager = exports.determineDefaultBase = exports.determineNxCloud = void 0;
3
+ exports.determinePackageManager = exports.determineDefaultBase = exports.determineCI = exports.determineNxCloud = void 0;
4
4
  const ab_testing_1 = require("../utils/nx/ab-testing");
5
5
  const output_1 = require("../utils/output");
6
6
  const default_base_1 = require("../utils/git/default-base");
7
7
  const package_manager_1 = require("../utils/package-manager");
8
8
  const string_utils_1 = require("../utils/string-utils");
9
9
  const enquirer = require("enquirer");
10
- const chalk = require("chalk");
11
10
  async function determineNxCloud(parsedArgs) {
12
11
  if (parsedArgs.nxCloud === undefined) {
13
- return nxCloudPrompt('setupCI');
12
+ return enquirer
13
+ .prompt([
14
+ {
15
+ name: 'NxCloud',
16
+ message: ab_testing_1.messages.getPromptMessage('nxCloudCreation'),
17
+ type: 'autocomplete',
18
+ choices: [
19
+ {
20
+ name: 'Yes',
21
+ hint: 'I want faster builds',
22
+ },
23
+ {
24
+ name: 'No',
25
+ },
26
+ ],
27
+ initial: 'Yes',
28
+ },
29
+ ])
30
+ .then((a) => a.NxCloud === 'Yes');
14
31
  }
15
32
  else {
16
33
  return parsedArgs.nxCloud;
17
34
  }
18
35
  }
19
36
  exports.determineNxCloud = determineNxCloud;
20
- async function nxCloudPrompt(key) {
21
- const { message, choices, initial, fallback, footer, hint } = ab_testing_1.messages.getPrompt(key);
22
- const promptConfig = {
23
- name: 'NxCloud',
24
- message,
25
- type: 'autocomplete',
26
- choices,
27
- initial,
28
- }; // meeroslav: types in enquirer are not up to date
29
- if (footer) {
30
- promptConfig.footer = () => chalk.dim(footer);
37
+ async function determineCI(parsedArgs, nxCloud) {
38
+ if (!nxCloud) {
39
+ if (parsedArgs.ci) {
40
+ output_1.output.warn({
41
+ title: 'Invalid CI value',
42
+ bodyLines: [
43
+ `CI option only works when Nx Cloud is enabled.`,
44
+ `The value provided will be ignored.`,
45
+ ],
46
+ });
47
+ }
48
+ return '';
31
49
  }
32
- if (hint) {
33
- promptConfig.hint = () => chalk.dim(hint);
50
+ if (parsedArgs.ci) {
51
+ return parsedArgs.ci;
34
52
  }
35
- return enquirer.prompt([promptConfig]).then((a) => {
36
- if (fallback && a.NxCloud === fallback.value) {
37
- return nxCloudPrompt(fallback.key);
38
- }
39
- return a.NxCloud;
40
- });
53
+ if (parsedArgs.allPrompts) {
54
+ return (enquirer
55
+ .prompt([
56
+ {
57
+ name: 'CI',
58
+ message: `CI workflow file to generate? `,
59
+ type: 'autocomplete',
60
+ initial: '',
61
+ choices: [
62
+ { message: 'none', name: '' },
63
+ { message: 'GitHub Actions', name: 'github' },
64
+ { message: 'Circle CI', name: 'circleci' },
65
+ { message: 'Azure DevOps', name: 'azure' },
66
+ ],
67
+ },
68
+ ])
69
+ // enquirer ignores name and value if they are falsy and takes
70
+ // first field that has a truthy value, so wee need to explicitly
71
+ // check for none
72
+ .then((a) => (a.CI !== 'none' ? a.CI : '')));
73
+ }
74
+ return '';
41
75
  }
76
+ exports.determineCI = determineCI;
42
77
  async function determineDefaultBase(parsedArgs) {
43
78
  if (parsedArgs.defaultBase) {
44
79
  return Promise.resolve(parsedArgs.defaultBase);
@@ -89,7 +124,7 @@ async function determinePackageManager(parsedArgs) {
89
124
  {
90
125
  name: 'packageManager',
91
126
  message: `Which package manager to use`,
92
- initial: 0,
127
+ initial: 'npm',
93
128
  type: 'autocomplete',
94
129
  choices: [
95
130
  { name: 'npm', message: 'NPM' },
@@ -1,6 +1,9 @@
1
1
  import yargs = require('yargs');
2
2
  export declare function withNxCloud<T = unknown>(argv: yargs.Argv<T>): yargs.Argv<T & {
3
- nxCloud: string | undefined;
3
+ nxCloud: boolean | undefined;
4
+ }>;
5
+ export declare function withCI<T = unknown>(argv: yargs.Argv<T>): yargs.Argv<T & {
6
+ ci: string | undefined;
4
7
  }>;
5
8
  export declare function withAllPrompts<T = unknown>(argv: yargs.Argv<T>): yargs.Argv<T & {
6
9
  allPrompts: boolean;
@@ -1,20 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.withOptions = exports.withGitOptions = exports.withPackageManager = exports.withAllPrompts = exports.withNxCloud = void 0;
3
+ exports.withOptions = exports.withGitOptions = exports.withPackageManager = exports.withAllPrompts = exports.withCI = exports.withNxCloud = void 0;
4
4
  const chalk = require("chalk");
5
+ const ci_list_1 = require("../utils/ci/ci-list");
5
6
  const ab_testing_1 = require("../utils/nx/ab-testing");
6
7
  const package_manager_1 = require("../utils/package-manager");
7
8
  function withNxCloud(argv) {
8
- const { message } = ab_testing_1.messages.getPrompt('setupCI');
9
9
  const result = argv.option('nxCloud', {
10
- alias: 'ci',
11
- describe: chalk.dim(message),
12
- choices: ab_testing_1.NxCloudChoices,
13
- type: 'string',
10
+ describe: chalk.dim(ab_testing_1.messages.getPromptMessage('nxCloudCreation')),
11
+ type: 'boolean',
14
12
  });
15
13
  return result;
16
14
  }
17
15
  exports.withNxCloud = withNxCloud;
16
+ function withCI(argv) {
17
+ return argv.option('ci', {
18
+ describe: chalk.dim `Generate a CI workflow file`,
19
+ choices: ci_list_1.ciList,
20
+ defaultDescription: '',
21
+ type: 'string',
22
+ });
23
+ }
24
+ exports.withCI = withCI;
18
25
  function withAllPrompts(argv) {
19
26
  return argv.option('allPrompts', {
20
27
  alias: 'a',
@@ -0,0 +1,2 @@
1
+ export declare const ciList: string[];
2
+ export type CI = typeof ciList[number];
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ciList = void 0;
4
+ exports.ciList = [
5
+ 'github',
6
+ 'circleci',
7
+ 'azure',
8
+ 'bitbucket-pipelines',
9
+ 'gitlab',
10
+ ];
@@ -1,67 +1,17 @@
1
- export declare const NxCloudChoices: string[];
2
1
  declare const messageOptions: {
3
- readonly setupCI: readonly [{
4
- readonly code: "enable-nx-cloud";
5
- readonly message: "Do you want Nx Cloud to make your CI fast?";
6
- readonly initial: 1;
7
- readonly choices: readonly [{
8
- readonly value: "yes";
9
- readonly name: "Yes, enable Nx Cloud";
10
- }, {
11
- readonly value: "github";
12
- readonly name: "Yes, configure Nx Cloud for GitHub Actions";
13
- }, {
14
- readonly value: "circleci";
15
- readonly name: "Yes, configure Nx Cloud for Circle CI";
16
- }, {
17
- readonly value: "skip";
18
- readonly name: "Skip for now";
19
- }];
20
- readonly footer: "\nRead more about remote cache at https://nx.dev/ci/features/remote-cache";
21
- readonly hint: "\n(it's free and can be disabled any time)";
22
- readonly fallback: undefined;
23
- }, {
24
- readonly code: "set-up-ci";
25
- readonly message: "Set up CI with caching, distribution and test deflaking";
26
- readonly initial: 0;
27
- readonly choices: readonly [{
28
- readonly value: "github";
29
- readonly name: "Yes, for GitHub Actions with Nx Cloud";
30
- }, {
31
- readonly value: "circleci";
32
- readonly name: "Yes, for CircleCI with Nx Cloud";
33
- }, {
34
- readonly value: "skip";
35
- readonly name: "Skip for now";
36
- }];
37
- readonly footer: "\nRead more about CI benefits with Nx at https://nx.dev/ci/intro/ci-with-nx";
38
- readonly hint: "\n(it's free and can be disabled any time)";
39
- readonly fallback: {
40
- readonly value: "skip";
41
- readonly key: "setupNxCloud";
42
- };
2
+ readonly nxCloudCreation: readonly [{
3
+ readonly code: "set-up-distributed-caching-ci";
4
+ readonly message: "Enable distributed caching to make your CI faster";
43
5
  }];
44
- readonly setupNxCloud: readonly [{
45
- readonly code: "enable-caching";
46
- readonly message: "Would you like remote caching to make your build faster?";
47
- readonly initial: 0;
48
- readonly choices: readonly [{
49
- readonly value: "yes";
50
- readonly name: "Yes";
51
- }, {
52
- readonly value: "skip";
53
- readonly name: "Skip for now";
54
- }];
55
- readonly footer: "\nRead more about remote caching at https://nx.dev/ci/features/remote-cache";
56
- readonly hint: "\n(it's free and can be disabled any time)";
57
- readonly fallback: undefined;
6
+ readonly nxCloudMigration: readonly [{
7
+ readonly code: "make-ci-faster";
8
+ readonly message: "Enable distributed caching to make your CI faster?";
58
9
  }];
59
10
  };
60
- export type MessageKey = keyof typeof messageOptions;
61
- type MessageData = typeof messageOptions[MessageKey][number];
11
+ type MessageKey = keyof typeof messageOptions;
62
12
  export declare class PromptMessages {
63
13
  private selectedMessages;
64
- getPrompt(key: MessageKey): MessageData;
14
+ getPromptMessage(key: MessageKey): string;
65
15
  codeOfSelectedPromptMessage(key: MessageKey): string;
66
16
  }
67
17
  export declare const messages: PromptMessages;
@@ -73,6 +23,6 @@ export declare function recordStat(opts: {
73
23
  command: string;
74
24
  nxVersion: string;
75
25
  useCloud: boolean;
76
- meta: string[];
26
+ meta: string;
77
27
  }): Promise<void>;
78
28
  export {};
@@ -1,50 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.recordStat = exports.messages = exports.PromptMessages = exports.NxCloudChoices = void 0;
3
+ exports.recordStat = exports.messages = exports.PromptMessages = void 0;
4
4
  const is_ci_1 = require("../ci/is-ci");
5
- exports.NxCloudChoices = ['yes', 'github', 'circleci', 'skip'];
6
5
  const messageOptions = {
7
- setupCI: [
6
+ nxCloudCreation: [
8
7
  {
9
- code: 'enable-nx-cloud',
10
- message: `Do you want Nx Cloud to make your CI fast?`,
11
- initial: 1,
12
- choices: [
13
- { value: 'yes', name: 'Yes, enable Nx Cloud' },
14
- { value: 'github', name: 'Yes, configure Nx Cloud for GitHub Actions' },
15
- { value: 'circleci', name: 'Yes, configure Nx Cloud for Circle CI' },
16
- { value: 'skip', name: 'Skip for now' },
17
- ],
18
- footer: '\nRead more about remote cache at https://nx.dev/ci/features/remote-cache',
19
- hint: `\n(it's free and can be disabled any time)`,
20
- fallback: undefined,
21
- },
22
- {
23
- code: 'set-up-ci',
24
- message: `Set up CI with caching, distribution and test deflaking`,
25
- initial: 0,
26
- choices: [
27
- { value: 'github', name: 'Yes, for GitHub Actions with Nx Cloud' },
28
- { value: 'circleci', name: 'Yes, for CircleCI with Nx Cloud' },
29
- { value: 'skip', name: 'Skip for now' },
30
- ],
31
- footer: '\nRead more about CI benefits with Nx at https://nx.dev/ci/intro/ci-with-nx',
32
- hint: `\n(it's free and can be disabled any time)`,
33
- fallback: { value: 'skip', key: 'setupNxCloud' },
8
+ code: 'set-up-distributed-caching-ci',
9
+ message: `Enable distributed caching to make your CI faster`,
34
10
  },
35
11
  ],
36
- setupNxCloud: [
12
+ nxCloudMigration: [
37
13
  {
38
- code: 'enable-caching',
39
- message: `Would you like remote caching to make your build faster?`,
40
- initial: 0,
41
- choices: [
42
- { value: 'yes', name: 'Yes' },
43
- { value: 'skip', name: 'Skip for now' },
44
- ],
45
- footer: '\nRead more about remote caching at https://nx.dev/ci/features/remote-cache',
46
- hint: `\n(it's free and can be disabled any time)`,
47
- fallback: undefined,
14
+ code: 'make-ci-faster',
15
+ message: `Enable distributed caching to make your CI faster?`,
48
16
  },
49
17
  ],
50
18
  };
@@ -52,7 +20,7 @@ class PromptMessages {
52
20
  constructor() {
53
21
  this.selectedMessages = {};
54
22
  }
55
- getPrompt(key) {
23
+ getPromptMessage(key) {
56
24
  if (this.selectedMessages[key] === undefined) {
57
25
  if (process.env.NX_GENERATE_DOCS_PROCESS === 'true') {
58
26
  this.selectedMessages[key] = 0;
@@ -61,12 +29,12 @@ class PromptMessages {
61
29
  this.selectedMessages[key] = Math.floor(Math.random() * messageOptions[key].length);
62
30
  }
63
31
  }
64
- return messageOptions[key][this.selectedMessages[key]];
32
+ return messageOptions[key][this.selectedMessages[key]].message;
65
33
  }
66
34
  codeOfSelectedPromptMessage(key) {
67
35
  const selected = this.selectedMessages[key];
68
36
  if (selected === undefined) {
69
- return '';
37
+ return messageOptions[key][0].code;
70
38
  }
71
39
  else {
72
40
  return messageOptions[key][selected].code;
@@ -97,7 +65,7 @@ async function recordStat(opts) {
97
65
  command: opts.command,
98
66
  isCI: (0, is_ci_1.isCI)(),
99
67
  useCloud: opts.useCloud,
100
- meta: opts.meta.filter((v) => !!v).join(','),
68
+ meta: opts.meta,
101
69
  });
102
70
  }
103
71
  catch (e) {
@@ -1,6 +1,5 @@
1
1
  import { PackageManager } from '../package-manager';
2
- export type NxCloud = 'yes' | 'github' | 'circleci' | 'skip';
3
- export declare function setupNxCloud(directory: string, packageManager: PackageManager, nxCloud: NxCloud): Promise<{
2
+ export declare function setupNxCloud(directory: string, packageManager: PackageManager): Promise<{
4
3
  code: number;
5
4
  stdout: string;
6
5
  }>;
@@ -6,24 +6,19 @@ const child_process_utils_1 = require("../child-process-utils");
6
6
  const output_1 = require("../output");
7
7
  const package_manager_1 = require("../package-manager");
8
8
  const error_utils_1 = require("../error-utils");
9
- async function setupNxCloud(directory, packageManager, nxCloud) {
10
- const nxCloudSpinner = ora(`Setting up Nx Cloud`).start();
9
+ async function setupNxCloud(directory, packageManager) {
10
+ const nxCloudSpinner = ora(`Setting up NxCloud`).start();
11
11
  try {
12
12
  const pmc = (0, package_manager_1.getPackageManagerCommand)(packageManager);
13
13
  const res = await (0, child_process_utils_1.execAndWait)(`${pmc.exec} nx g nx:connect-to-nx-cloud --no-interactive --quiet`, directory);
14
- if (nxCloud !== 'yes') {
15
- nxCloudSpinner.succeed('CI workflow with Nx Cloud has been generated successfully');
16
- }
17
- else {
18
- nxCloudSpinner.succeed('Nx Cloud has been set up successfully');
19
- }
14
+ nxCloudSpinner.succeed('NxCloud has been set up successfully');
20
15
  return res;
21
16
  }
22
17
  catch (e) {
23
18
  nxCloudSpinner.fail();
24
19
  if (e instanceof Error) {
25
20
  output_1.output.error({
26
- title: `Failed to setup Nx Cloud`,
21
+ title: `Failed to setup NxCloud`,
27
22
  bodyLines: (0, error_utils_1.mapErrorToBodyLines)(e),
28
23
  });
29
24
  }
@@ -38,19 +33,12 @@ async function setupNxCloud(directory, packageManager, nxCloud) {
38
33
  }
39
34
  exports.setupNxCloud = setupNxCloud;
40
35
  function printNxCloudSuccessMessage(nxCloudOut) {
41
- // remove leading Nx carret and any new lines
42
- const logContent = nxCloudOut.split('NX ')[1];
43
- const indexOfTitleEnd = logContent.indexOf('\n');
44
- const title = logContent.slice(0, logContent.indexOf('\n')).trim();
45
- const bodyLines = logContent
46
- .slice(indexOfTitleEnd)
47
- .replace(/^\n*/, '') // remove leading new lines
48
- .replace(/\n*$/, '') // remove trailing new lines
49
- .split('\n')
50
- .map((r) => r.trim());
51
- output_1.output.warn({
52
- title,
53
- bodyLines,
36
+ const bodyLines = nxCloudOut
37
+ .split('Distributed caching via Nx Cloud has been enabled')[1]
38
+ .trim();
39
+ output_1.output.note({
40
+ title: `Distributed caching via Nx Cloud has been enabled`,
41
+ bodyLines: bodyLines.split('\n').map((r) => r.trim()),
54
42
  });
55
43
  }
56
44
  exports.printNxCloudSuccessMessage = printNxCloudSuccessMessage;
@@ -4,7 +4,6 @@ exports.showNxWarning = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  const path_1 = require("path");
6
6
  const output_1 = require("../output");
7
- const package_manager_1 = require("../package-manager");
8
7
  function showNxWarning(workspaceName) {
9
8
  try {
10
9
  const pathToRunNxCommand = (0, path_1.resolve)(process.cwd(), workspaceName);
@@ -15,13 +14,12 @@ function showNxWarning(workspaceName) {
15
14
  }
16
15
  catch (e) {
17
16
  // no nx found
18
- const { exec, globalAdd } = (0, package_manager_1.getPackageManagerCommand)();
19
17
  output_1.output.addVerticalSeparator();
20
18
  output_1.output.note({
21
19
  title: `Nx CLI is not installed globally.`,
22
20
  bodyLines: [
23
- `This means that you will have to use "${exec} nx" to execute commands in the workspace.`,
24
- `Run "${globalAdd} nx" to be able to execute command directly.`,
21
+ `This means that you might have to use "yarn nx" or "npx nx" to execute commands in the workspace.`,
22
+ `Run "yarn global add nx" or "npm install -g nx" to be able to execute command directly.`,
25
23
  ],
26
24
  });
27
25
  }
@@ -16,6 +16,7 @@ export interface CLISuccessMessageConfig {
16
16
  bodyLines?: string[];
17
17
  }
18
18
  declare class CLIOutput {
19
+ readonly X_PADDING = " ";
19
20
  /**
20
21
  * Longer dash character which forms more of a continuous line when place side to side
21
22
  * with itself, unlike the standard dash character
@@ -16,6 +16,7 @@ if ((0, is_ci_1.isCI)()) {
16
16
  }
17
17
  class CLIOutput {
18
18
  constructor() {
19
+ this.X_PADDING = ' ';
19
20
  /**
20
21
  * Expose some color and other utility functions so that other parts of the codebase that need
21
22
  * more fine-grained control of message bodies are still using a centralized
@@ -39,7 +40,7 @@ class CLIOutput {
39
40
  */
40
41
  get VERTICAL_SEPARATOR() {
41
42
  let divider = '';
42
- for (let i = 0; i < process.stdout.columns - 1; i++) {
43
+ for (let i = 0; i < process.stdout.columns - this.X_PADDING.length * 2; i++) {
43
44
  divider += '\u2014';
44
45
  }
45
46
  return divider;
@@ -48,14 +49,14 @@ class CLIOutput {
48
49
  process.stdout.write(str);
49
50
  }
50
51
  writeOutputTitle({ color, title, }) {
51
- this.writeToStdOut(`${this.applyCLIPrefix(color, title)}${os_1.EOL}`);
52
+ this.writeToStdOut(` ${this.applyCLIPrefix(color, title)}${os_1.EOL}`);
52
53
  }
53
54
  writeOptionalOutputBody(bodyLines) {
54
55
  if (!bodyLines) {
55
56
  return;
56
57
  }
57
58
  this.addNewline();
58
- bodyLines.forEach((bodyLine) => this.writeToStdOut(`${bodyLine}${os_1.EOL}`));
59
+ bodyLines.forEach((bodyLine) => this.writeToStdOut(` ${bodyLine}${os_1.EOL}`));
59
60
  }
60
61
  setCliName(name) {
61
62
  this.cliName = name;
@@ -63,10 +64,10 @@ class CLIOutput {
63
64
  applyCLIPrefix(color = 'cyan', text) {
64
65
  let cliPrefix = '';
65
66
  if (chalk[color]) {
66
- cliPrefix = chalk.reset.inverse.bold[color](` ${this.cliName} `);
67
+ cliPrefix = `${chalk[color]('>')} ${chalk.reset.inverse.bold[color](` ${this.cliName} `)}`;
67
68
  }
68
69
  else {
69
- cliPrefix = chalk.reset.inverse.bold.keyword(color)(` ${this.cliName} `);
70
+ cliPrefix = `${chalk.keyword(color)('>')} ${chalk.reset.inverse.bold.keyword(color)(` ${this.cliName} `)}`;
70
71
  }
71
72
  return `${cliPrefix} ${text}`;
72
73
  }
@@ -79,7 +80,7 @@ class CLIOutput {
79
80
  this.addNewline();
80
81
  }
81
82
  addVerticalSeparatorWithoutNewLines(color = 'gray') {
82
- this.writeToStdOut(`${chalk.dim[color](this.VERTICAL_SEPARATOR)}${os_1.EOL}`);
83
+ this.writeToStdOut(`${this.X_PADDING}${chalk.dim[color](this.VERTICAL_SEPARATOR)}${os_1.EOL}`);
83
84
  }
84
85
  error({ title, bodyLines }) {
85
86
  this.addNewline();
@@ -17,7 +17,6 @@ export declare function getPackageManagerCommand(packageManager?: PackageManager
17
17
  install: string;
18
18
  exec: string;
19
19
  preInstall?: string;
20
- globalAdd: string;
21
20
  };
22
21
  export declare function generatePackageManagerFiles(root: string, packageManager?: PackageManager): void;
23
22
  export declare function getPackageManagerVersion(packageManager: PackageManager, cwd?: string): string;
@@ -43,7 +43,6 @@ function getPackageManagerCommand(packageManager = detectPackageManager()) {
43
43
  : `${installCommand} --ignore-scripts`,
44
44
  // using npx is necessary to avoid yarn classic manipulating the version detection when using berry
45
45
  exec: useBerry ? 'npx' : 'yarn',
46
- globalAdd: 'yarn global add',
47
46
  };
48
47
  case 'pnpm':
49
48
  let useExec = false;
@@ -53,13 +52,11 @@ function getPackageManagerCommand(packageManager = detectPackageManager()) {
53
52
  return {
54
53
  install: 'pnpm install --no-frozen-lockfile --silent --ignore-scripts',
55
54
  exec: useExec ? 'pnpm exec' : 'pnpx',
56
- globalAdd: 'pnpm add -g',
57
55
  };
58
56
  case 'npm':
59
57
  return {
60
58
  install: 'npm install --silent --ignore-scripts',
61
59
  exec: 'npx',
62
- globalAdd: 'npm i -g',
63
60
  };
64
61
  }
65
62
  }
@@ -12,7 +12,7 @@ function pointToTutorialAndCourse(preset) {
12
12
  output_1.output.note({
13
13
  title,
14
14
  bodyLines: [
15
- `https://nx.dev/getting-started/tutorials/npm-workspaces-tutorial`,
15
+ `https://nx.dev/getting-started/tutorials/package-based-repo-tutorial`,
16
16
  ],
17
17
  });
18
18
  break;
@@ -23,10 +23,6 @@ exports.presetOptions = [
23
23
  name: preset_1.Preset.VueMonorepo,
24
24
  message: 'vue [a monorepo with a single Vue application]',
25
25
  },
26
- {
27
- name: preset_1.Preset.Nuxt,
28
- message: 'nuxt [a monorepo with a single Nuxt application]',
29
- },
30
26
  {
31
27
  name: preset_1.Preset.NextJs,
32
28
  message: 'next.js [a monorepo with a single Next.js application]',
@@ -1,7 +1,7 @@
1
1
  export declare enum Preset {
2
2
  Apps = "apps",
3
- Empty = "empty",// same as apps, deprecated
4
- Core = "core",// same as npm, deprecated
3
+ Empty = "empty",
4
+ Core = "core",
5
5
  NPM = "npm",
6
6
  TS = "ts",
7
7
  WebComponents = "web-components",
@@ -11,18 +11,13 @@ export declare enum Preset {
11
11
  ReactStandalone = "react-standalone",
12
12
  VueMonorepo = "vue-monorepo",
13
13
  VueStandalone = "vue-standalone",
14
- Nuxt = "nuxt",
15
- NuxtStandalone = "nuxt-standalone",
16
14
  NextJs = "next",
17
15
  NextJsStandalone = "nextjs-standalone",
18
- RemixMonorepo = "remix-monorepo",
19
- RemixStandalone = "remix-standalone",
20
16
  ReactNative = "react-native",
21
17
  Expo = "expo",
22
18
  Nest = "nest",
23
19
  Express = "express",
24
20
  React = "react",
25
- Vue = "vue",
26
21
  Angular = "angular",
27
22
  NodeStandalone = "node-standalone",
28
23
  NodeMonorepo = "node-monorepo",