refactor(misc): merge tutorial and course notes

This commit is contained in:
Victor Savkin 2020-01-15 10:26:09 -05:00
parent f43897978c
commit 3160639d2e

View File

@ -81,8 +81,7 @@ determineWorkspaceName(parsedArgs).then(name => {
createApp(tmpDir, cli, parsedArgs, name, preset, appName, style);
showCliWarning(preset, parsedArgs);
showNxWarning(name);
pointToTutorial(preset);
pointToCourse();
pointToTutorialAndCourse(preset);
});
});
});
@ -480,41 +479,49 @@ function showCliWarning(preset: Preset, parsedArgs: yargsParser.Arguments) {
}
}
function pointToTutorial(preset: Preset) {
function pointToTutorialAndCourse(preset: Preset) {
const title = `First time using Nx? Check out this interactive Nx tutorial.`;
switch (preset) {
case Preset.React:
case Preset.ReactWithExpress:
case Preset.NextJs:
output.addVerticalSeparator();
output.note({
title: `First time using Nx? Check out this interactive Nx tutorial.`,
bodyLines: [`https://nx.dev/react/tutorial/01-create-application`]
title: title,
bodyLines: [
`https://nx.dev/react/tutorial/01-create-application`,
...pointToCourse()
]
});
break;
case Preset.Angular:
case Preset.AngularWithNest:
output.addVerticalSeparator();
output.note({
title: `First time using Nx? Check out this interactive Nx tutorial.`,
bodyLines: [`https://nx.dev/angular/tutorial/01-create-application`]
title: title,
bodyLines: [
`https://nx.dev/angular/tutorial/01-create-application`,
...pointToCourse()
]
});
break;
case Preset.WebComponents:
output.addVerticalSeparator();
output.note({
title: `First time using Nx? Check out this interactive Nx tutorial.`,
bodyLines: [`https://nx.dev/web/tutorial/01-create-application`]
title: title,
bodyLines: [
`https://nx.dev/web/tutorial/01-create-application`,
...pointToCourse()
]
});
break;
}
}
function pointToCourse(): void {
output.addVerticalSeparator();
output.note({
title: `Prefer watching videos? We made en entire course for Nx available on YouTube.`,
bodyLines: [
`https://www.youtube.com/watch?v=2mYLe9Kp9VM&list=PLakNactNC1dH38AfqmwabvOszDmKriGco`
]
});
function pointToCourse(): string[] {
return [
``,
`Prefer watching videos? Check out this free Nx course on YouTube.`,
`https://www.youtube.com/watch?v=2mYLe9Kp9VM&list=PLakNactNC1dH38AfqmwabvOszDmKriGco`
];
}