Skip to content

Commit

Permalink
feat(misc): replace tutorials with social links in create-nx-workspace (
Browse files Browse the repository at this point in the history
#29085)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Currently, `create-nx-workspace` links to tutorials which in most cases,
users are in the middle of doing or have already done in the past.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Rather than tutorials, `create-nx-workspace` will welcome users to the
Nx community and give them ways to show their appreciation, stay up to
date, and chat about Nx.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #
  • Loading branch information
FrozenPandaz authored Nov 26, 2024
1 parent 4030494 commit 0d0d6c7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 120 deletions.
6 changes: 3 additions & 3 deletions packages/create-nx-workspace/bin/create-nx-workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down Expand Up @@ -234,11 +234,11 @@ async function main(parsedArgs: yargs.Arguments<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}`,
Expand Down
2 changes: 0 additions & 2 deletions packages/create-nx-workspace/src/utils/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ export class CLIOutput {
});

this.writeOptionalOutputBody(bodyLines);

this.addNewline();
}

logSingleLine(message: string) {
Expand Down

This file was deleted.

43 changes: 0 additions & 43 deletions packages/create-nx-workspace/src/utils/preset/preset-options.ts

This file was deleted.

12 changes: 12 additions & 0 deletions packages/create-nx-workspace/src/utils/social-information.ts
Original file line number Diff line number Diff line change
@@ -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',
],
});
}

0 comments on commit 0d0d6c7

Please sign in to comment.