feat(node): add Node standlone prompt using CNW (#14439)

This commit is contained in:
Nicholas Cunningham 2023-01-17 11:52:18 -07:00 committed by GitHub
parent 07f07374fd
commit da4959a324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 8 deletions

View File

@ -335,6 +335,8 @@ async function getConfiguration(
preset = Preset.ReactStandalone;
} else if (monorepoStyle === 'angular') {
preset = Preset.AngularStandalone;
} else if (monorepoStyle === 'node-server') {
preset = Preset.NodeServer;
} else {
preset = await determinePreset(argv);
}
@ -348,17 +350,19 @@ async function getConfiguration(
if (
preset === Preset.ReactStandalone ||
preset === Preset.AngularStandalone
preset === Preset.AngularStandalone ||
preset === Preset.NodeServer
) {
appName =
argv.appName ?? argv.name ?? (await determineAppName(preset, argv));
name = argv.name ?? appName;
} else {
name = await determineRepoName(argv);
appName = await determineAppName(preset, argv);
if (preset === Preset.NodeServer) {
framework = await determineFramework(preset, argv);
}
} else {
name = await determineRepoName(argv);
appName = await determineAppName(preset, argv);
}
style = await determineStyle(preset, argv);
}
@ -459,22 +463,27 @@ function determineMonorepoStyle(): Promise<string> {
{
name: 'package-based',
message:
'Package-based monorepo: Nx makes it fast, but lets you run things your way.',
'Package-based monorepo: Nx makes it fast, but lets you run things your way.',
},
{
name: 'integrated',
message:
'Integrated monorepo: Nx configures your favorite frameworks and lets you focus on shipping features.',
'Integrated monorepo: Nx configures your favorite frameworks and lets you focus on shipping features.',
},
{
name: 'react',
message:
'Standalone React app: Nx configures Vite, Vitest, ESLint, and Cypress.',
'Standalone React app: Nx configures Vite, Vitest, ESLint, and Cypress.',
},
{
name: 'angular',
message:
'Standalone Angular app: Nx configures Jest, ESLint and Cypress.',
'Standalone Angular app: Nx configures Jest, ESLint and Cypress.',
},
{
name: 'node-server',
message:
'Standalone Node Server app: Nx configures your framework of choice (e.g. Express) along with esbuild, Eslint and Jest.',
},
],
},

View File

@ -298,6 +298,7 @@ function updateTsConfigOptions(tree: Tree, options: NormalizedSchema) {
compilerOptions: {
...shared.tsConfigBaseOptions,
...json.compilerOptions,
esModuleInterop: true,
},
...json,
extends: undefined,