diff --git a/packages/create-nx-workspace/bin/create-nx-workspace.ts b/packages/create-nx-workspace/bin/create-nx-workspace.ts index 8a25b98a62..59911cdbf2 100644 --- a/packages/create-nx-workspace/bin/create-nx-workspace.ts +++ b/packages/create-nx-workspace/bin/create-nx-workspace.ts @@ -7,7 +7,6 @@ import { createWorkspace } from '../src/create-workspace'; import { isKnownPreset, Preset } from '../src/utils/preset/preset'; import { CLIErrorMessageConfig, output } from '../src/utils/output'; import { nxVersion } from '../src/utils/nx/nx-version'; -import { pointToTutorialAndCourse } from '../src/utils/preset/point-to-tutorial-and-course'; import { yargsDecorator } from './decorator'; import { getPackageNameFromThirdPartyPreset } from '../src/utils/preset/get-third-party-preset'; @@ -29,6 +28,7 @@ import { messages, recordStat } from '../src/utils/nx/ab-testing'; import { mapErrorToBodyLines } from '../src/utils/error-utils'; import { existsSync } from 'fs'; import { isCI } from '../src/utils/ci/is-ci'; +import { printSocialInformation } from '../src/utils/social-information'; interface BaseArguments extends CreateWorkspaceOptions { preset: Preset; @@ -234,11 +234,11 @@ async function main(parsedArgs: yargs.Arguments) { }); if (parsedArgs.nxCloud && workspaceInfo.nxCloudInfo) { - console.log(workspaceInfo.nxCloudInfo); + process.stdout.write(workspaceInfo.nxCloudInfo); } if (isKnownPreset(parsedArgs.preset)) { - pointToTutorialAndCourse(parsedArgs.preset as Preset); + printSocialInformation(); } else { output.log({ title: `Successfully applied preset: ${parsedArgs.preset}`, diff --git a/packages/create-nx-workspace/src/utils/output.ts b/packages/create-nx-workspace/src/utils/output.ts index d6e4a01f42..721a463fcf 100644 --- a/packages/create-nx-workspace/src/utils/output.ts +++ b/packages/create-nx-workspace/src/utils/output.ts @@ -167,8 +167,6 @@ export class CLIOutput { }); this.writeOptionalOutputBody(bodyLines); - - this.addNewline(); } logSingleLine(message: string) { diff --git a/packages/create-nx-workspace/src/utils/preset/point-to-tutorial-and-course.ts b/packages/create-nx-workspace/src/utils/preset/point-to-tutorial-and-course.ts deleted file mode 100644 index a1925d4d93..0000000000 --- a/packages/create-nx-workspace/src/utils/preset/point-to-tutorial-and-course.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { output } from '../output'; -import { Preset } from './preset'; - -export function pointToTutorialAndCourse(preset: Preset) { - const title = `First time using Nx? Check out this interactive Nx tutorial.`; - switch (preset) { - case Preset.NPM: - case Preset.Apps: - output.addVerticalSeparator(); - output.note({ - title, - bodyLines: [ - `https://nx.dev/getting-started/tutorials/npm-workspaces-tutorial`, - ], - }); - break; - - case Preset.TS: - output.addVerticalSeparator(); - output.note({ - title, - bodyLines: [ - `https://nx.dev/getting-started/tutorials/integrated-repo-tutorial`, - ], - }); - break; - case Preset.ReactStandalone: - output.addVerticalSeparator(); - output.note({ - title, - bodyLines: [ - `https://nx.dev/getting-started/tutorials/react-standalone-tutorial`, - ], - }); - break; - case Preset.ReactMonorepo: - case Preset.NextJs: - case Preset.NextJsStandalone: - output.addVerticalSeparator(); - output.note({ - title, - bodyLines: [`https://nx.dev/react-tutorial/1-code-generation`], - }); - break; - case Preset.AngularStandalone: - output.addVerticalSeparator(); - output.note({ - title, - bodyLines: [ - `https://nx.dev/getting-started/tutorials/angular-standalone-tutorial`, - ], - }); - break; - case Preset.AngularMonorepo: - output.addVerticalSeparator(); - output.note({ - title, - bodyLines: [`https://nx.dev/angular-tutorial/1-code-generation`], - }); - break; - case Preset.Express: - case Preset.NodeStandalone: - output.addVerticalSeparator(); - output.note({ - title, - bodyLines: [ - `https://nx.dev/getting-started/tutorials/node-server-tutorial`, - ], - }); - break; - } -} diff --git a/packages/create-nx-workspace/src/utils/preset/preset-options.ts b/packages/create-nx-workspace/src/utils/preset/preset-options.ts deleted file mode 100644 index 29282480b1..0000000000 --- a/packages/create-nx-workspace/src/utils/preset/preset-options.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Preset } from './preset'; - -export const presetOptions: { name: Preset; message: string }[] = [ - { - name: Preset.Apps, - message: - 'apps [an empty monorepo with no plugins with a layout that works best for building apps]', - }, - { - name: Preset.TS, - message: - 'ts [an empty monorepo with the JS/TS plugin preinstalled]', - }, - { - name: Preset.ReactMonorepo, - message: 'react [a monorepo with a single React application]', - }, - { - name: Preset.AngularMonorepo, - message: 'angular [a monorepo with a single Angular application]', - }, - { - name: Preset.VueMonorepo, - message: 'vue [a monorepo with a single Vue application]', - }, - { - name: Preset.Nuxt, - message: 'nuxt [a monorepo with a single Nuxt application]', - }, - { - name: Preset.NextJs, - message: 'next.js [a monorepo with a single Next.js application]', - }, - { - name: Preset.Nest, - message: 'nest [a monorepo with a single Nest application]', - }, - { - name: Preset.ReactNative, - message: - 'react-native [a monorepo with a single React Native application]', - }, -]; diff --git a/packages/create-nx-workspace/src/utils/social-information.ts b/packages/create-nx-workspace/src/utils/social-information.ts new file mode 100644 index 0000000000..4e02f34476 --- /dev/null +++ b/packages/create-nx-workspace/src/utils/social-information.ts @@ -0,0 +1,12 @@ +import { output } from './output'; + +export function printSocialInformation() { + output.success({ + title: 'Welcome to the Nx community! 👋', + bodyLines: [ + '🌟 Star Nx on GitHub: https://github.com/nrwl/nx', + '📢 Stay up to date on X: https://x.com/nxdevtools', + '💬 Discuss Nx on Discord: https://go.nx.dev/community', + ], + }); +}