From f9ef42e8c2f6e278b43ef24c06bc9cd3a13f4521 Mon Sep 17 00:00:00 2001 From: Victor Savkin Date: Tue, 6 Sep 2022 14:56:25 -0400 Subject: [PATCH] cleanup(misc): update to cloud message --- docs/generated/cli/create-nx-workspace.md | 2 +- docs/generated/packages/nx.json | 2 +- packages/add-nx-to-monorepo/src/add-nx-to-monorepo.ts | 4 ++-- .../create-nx-workspace/bin/create-nx-workspace.ts | 10 +--------- .../make-angular-cli-faster/src/utilities/nx-cloud.ts | 4 ++-- packages/nx/src/command-line/connect-to-nx-cloud.ts | 6 ++---- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/docs/generated/cli/create-nx-workspace.md b/docs/generated/cli/create-nx-workspace.md index c4b161ac6d..d4b68352ac 100644 --- a/docs/generated/cli/create-nx-workspace.md +++ b/docs/generated/cli/create-nx-workspace.md @@ -97,7 +97,7 @@ Workspace name (e.g. org name) Type: boolean -Set up distributed caching using Nx Cloud (It's free and doesn't require registration.) +Enable distributed caching to make your CI faster ### packageManager diff --git a/docs/generated/packages/nx.json b/docs/generated/packages/nx.json index 0928f2e441..693fa67041 100644 --- a/docs/generated/packages/nx.json +++ b/docs/generated/packages/nx.json @@ -10,7 +10,7 @@ "name": "create-nx-workspace", "id": "create-nx-workspace", "file": "generated/cli/create-nx-workspace", - "content": "---\ntitle: 'create-nx-workspace - CLI command'\ndescription: 'Create a new Nx workspace'\n---\n\n# create-nx-workspace\n\nCreate a new Nx workspace\n\n## Usage\n\n```bash\ncreate-nx-workspace [name] [options]\n```\n\nInstall `create-nx-workspace` globally to invoke the command directly, or use `npx create-nx-workspace`, `yarn create nx-workspace`, or `pnpx create-nx-workspace`.\n\n## Options\n\n### allPrompts\n\nType: boolean\n\nDefault: false\n\nShow all prompts\n\n### appName\n\nType: string\n\nThe name of the application when a preset with pregenerated app is selected\n\n### ci\n\nType: string\n\nChoices: [github, circleci, azure]\n\nGenerate a CI workflow file\n\n### cli\n\nType: string\n\nChoices: [nx, angular]\n\nCLI to power the Nx workspace\n\n### commit.email\n\nType: string\n\nE-mail of the committer\n\n### commit.message\n\nType: string\n\nDefault: Initial commit\n\nCommit message\n\n### commit.name\n\nType: string\n\nName of the committer\n\n### defaultBase\n\nType: string\n\nDefault: main\n\nDefault base to use for new projects\n\n### help\n\nType: boolean\n\nShow help\n\n### interactive\n\nType: boolean\n\nEnable interactive mode with presets\n\n### name\n\nType: string\n\nWorkspace name (e.g. org name)\n\n### nxCloud\n\nType: boolean\n\nSet up distributed caching using Nx Cloud (It's free and doesn't require registration.)\n\n### packageManager\n\nType: string\n\nChoices: [npm, pnpm, yarn]\n\nDefault: npm\n\nPackage manager to use\n\n### preset\n\nType: string\n\nCustomizes the initial content of your workspace. Default presets include: [\"apps\", \"empty\", \"core\", \"npm\", \"ts\", \"web-components\", \"angular\", \"angular-nest\", \"react\", \"react-express\", \"react-native\", \"next\", \"nest\", \"express\"]. To build your own see https://nx.dev/packages/nx-plugin#preset\n\n### skipGit\n\nType: boolean\n\nDefault: false\n\nSkip initializing a git repository.\n\n### style\n\nType: string\n\nStyle option to be used when a preset with pregenerated app is selected\n\n### version\n\nType: boolean\n\nShow version number\n" + "content": "---\ntitle: 'create-nx-workspace - CLI command'\ndescription: 'Create a new Nx workspace'\n---\n\n# create-nx-workspace\n\nCreate a new Nx workspace\n\n## Usage\n\n```bash\ncreate-nx-workspace [name] [options]\n```\n\nInstall `create-nx-workspace` globally to invoke the command directly, or use `npx create-nx-workspace`, `yarn create nx-workspace`, or `pnpx create-nx-workspace`.\n\n## Options\n\n### allPrompts\n\nType: boolean\n\nDefault: false\n\nShow all prompts\n\n### appName\n\nType: string\n\nThe name of the application when a preset with pregenerated app is selected\n\n### ci\n\nType: string\n\nChoices: [github, circleci, azure]\n\nGenerate a CI workflow file\n\n### cli\n\nType: string\n\nChoices: [nx, angular]\n\nCLI to power the Nx workspace\n\n### commit.email\n\nType: string\n\nE-mail of the committer\n\n### commit.message\n\nType: string\n\nDefault: Initial commit\n\nCommit message\n\n### commit.name\n\nType: string\n\nName of the committer\n\n### defaultBase\n\nType: string\n\nDefault: main\n\nDefault base to use for new projects\n\n### help\n\nType: boolean\n\nShow help\n\n### interactive\n\nType: boolean\n\nEnable interactive mode with presets\n\n### name\n\nType: string\n\nWorkspace name (e.g. org name)\n\n### nxCloud\n\nType: boolean\n\nEnable distributed caching to make your CI faster\n\n### packageManager\n\nType: string\n\nChoices: [npm, pnpm, yarn]\n\nDefault: npm\n\nPackage manager to use\n\n### preset\n\nType: string\n\nCustomizes the initial content of your workspace. Default presets include: [\"apps\", \"empty\", \"core\", \"npm\", \"ts\", \"web-components\", \"angular\", \"angular-nest\", \"react\", \"react-express\", \"react-native\", \"next\", \"nest\", \"express\"]. To build your own see https://nx.dev/packages/nx-plugin#preset\n\n### skipGit\n\nType: boolean\n\nDefault: false\n\nSkip initializing a git repository.\n\n### style\n\nType: string\n\nStyle option to be used when a preset with pregenerated app is selected\n\n### version\n\nType: boolean\n\nShow version number\n" }, { "name": "init", diff --git a/packages/add-nx-to-monorepo/src/add-nx-to-monorepo.ts b/packages/add-nx-to-monorepo/src/add-nx-to-monorepo.ts index 98e57b19d4..8223495e6a 100644 --- a/packages/add-nx-to-monorepo/src/add-nx-to-monorepo.ts +++ b/packages/add-nx-to-monorepo/src/add-nx-to-monorepo.ts @@ -62,12 +62,12 @@ async function askAboutNxCloud(parsedArgs: any) { .prompt([ { name: 'NxCloud', - message: `Set up distributed caching using Nx Cloud (It's free and doesn't require registration.)`, + message: `Enable distributed caching to make your CI faster`, type: 'autocomplete', choices: [ { name: 'Yes', - hint: 'Faster builds, run details, GitHub integration. Learn more at https://nx.app', + hint: 'I want faster builds', }, { diff --git a/packages/create-nx-workspace/bin/create-nx-workspace.ts b/packages/create-nx-workspace/bin/create-nx-workspace.ts index 8b48607cb2..5f93a9969a 100644 --- a/packages/create-nx-workspace/bin/create-nx-workspace.ts +++ b/packages/create-nx-workspace/bin/create-nx-workspace.ts @@ -64,18 +64,10 @@ enum Preset { class PromptMessages { private messages = { nxCloud: [ - { - code: 'set-up-cloud', - message: `Set up distributed caching using Nx Cloud (It's free and doesn't require registration.)`, - }, { code: 'set-up-distributed-caching-ci', message: `Enable distributed caching to make your CI faster`, }, - { - code: 'set-up-distributed-caching', - message: `Enable distributed caching to make your builds and tests faster`, - }, ], }; @@ -95,7 +87,7 @@ class PromptMessages { } codeOfSelectedPromptMessage(key: string): string { - if (!this.selectedMessages[key]) return null; + if (this.selectedMessages[key] === undefined) return null; return this.messages[key][this.selectedMessages[key]].code; } } diff --git a/packages/make-angular-cli-faster/src/utilities/nx-cloud.ts b/packages/make-angular-cli-faster/src/utilities/nx-cloud.ts index 4d49363d14..f3d1b48108 100644 --- a/packages/make-angular-cli-faster/src/utilities/nx-cloud.ts +++ b/packages/make-angular-cli-faster/src/utilities/nx-cloud.ts @@ -6,12 +6,12 @@ export async function promptForNxCloud(): Promise { const { useNxCloud } = await prompt<{ useNxCloud: 'Yes' | 'No' }>([ { name: 'useNxCloud', - message: `Set up distributed caching using Nx Cloud (It's free and doesn't require registration.)`, + message: `Enable distributed caching to make your CI faster`, type: 'autocomplete', choices: [ { name: 'Yes', - hint: 'Yes [Faster builds, run details, Github integration. Learn more at https://nx.app]', + hint: 'I want faster builds', }, { name: 'No' }, ], diff --git a/packages/nx/src/command-line/connect-to-nx-cloud.ts b/packages/nx/src/command-line/connect-to-nx-cloud.ts index a182ea73ea..bb75d6b15e 100644 --- a/packages/nx/src/command-line/connect-to-nx-cloud.ts +++ b/packages/nx/src/command-line/connect-to-nx-cloud.ts @@ -59,14 +59,12 @@ async function connectToNxCloudPrompt(prompt?: string) { .prompt([ { name: 'NxCloud', - message: - prompt ?? - `Set up distributed caching using Nx Cloud (It's free and doesn't require registration.)`, + message: prompt ?? `Enable distributed caching to make your CI faster`, type: 'autocomplete', choices: [ { name: 'Yes', - hint: 'Faster builds, run details, GitHub integration. Learn more at https://nx.app', + hint: 'I want faster builds', }, { name: 'No',