fix(core): accept vue as preset in cnw (#21262)

This commit is contained in:
Katerina Skroumpelou 2024-01-22 19:22:33 +02:00 committed by GitHub
parent e2a819ef18
commit 33e13910b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 4 deletions

View File

@ -139,7 +139,7 @@ Package manager to use
Type: `string` Type: `string`
Customizes the initial content of your workspace. Default presets include: ["apps", "empty", "core", "npm", "ts", "web-components", "angular-monorepo", "angular-standalone", "react-monorepo", "react-standalone", "vue-monorepo", "vue-standalone", "nuxt", "nuxt-standalone", "next", "nextjs-standalone", "react-native", "expo", "nest", "express", "react", "angular", "node-standalone", "node-monorepo", "ts-standalone"]. To build your own see https://nx.dev/extending-nx/recipes/create-preset Customizes the initial content of your workspace. Default presets include: ["apps", "empty", "core", "npm", "ts", "web-components", "angular-monorepo", "angular-standalone", "react-monorepo", "react-standalone", "vue-monorepo", "vue-standalone", "nuxt", "nuxt-standalone", "next", "nextjs-standalone", "react-native", "expo", "nest", "express", "react", "vue", "angular", "node-standalone", "node-monorepo", "ts-standalone"]. To build your own see https://nx.dev/extending-nx/recipes/create-preset
### routing ### routing

View File

@ -139,7 +139,7 @@ Package manager to use
Type: `string` Type: `string`
Customizes the initial content of your workspace. Default presets include: ["apps", "empty", "core", "npm", "ts", "web-components", "angular-monorepo", "angular-standalone", "react-monorepo", "react-standalone", "vue-monorepo", "vue-standalone", "nuxt", "nuxt-standalone", "next", "nextjs-standalone", "react-native", "expo", "nest", "express", "react", "angular", "node-standalone", "node-monorepo", "ts-standalone"]. To build your own see https://nx.dev/extending-nx/recipes/create-preset Customizes the initial content of your workspace. Default presets include: ["apps", "empty", "core", "npm", "ts", "web-components", "angular-monorepo", "angular-standalone", "react-monorepo", "react-standalone", "vue-monorepo", "vue-standalone", "nuxt", "nuxt-standalone", "next", "nextjs-standalone", "react-native", "expo", "nest", "express", "react", "vue", "angular", "node-standalone", "node-monorepo", "ts-standalone"]. To build your own see https://nx.dev/extending-nx/recipes/create-preset
### routing ### routing

View File

@ -381,6 +381,7 @@ async function determineStack(
case Preset.NextJs: case Preset.NextJs:
case Preset.NextJsStandalone: case Preset.NextJsStandalone:
return 'react'; return 'react';
case Preset.Vue:
case Preset.VueStandalone: case Preset.VueStandalone:
case Preset.VueMonorepo: case Preset.VueMonorepo:
case Preset.Nuxt: case Preset.Nuxt:
@ -638,7 +639,7 @@ async function determineVueOptions(
let appName: string; let appName: string;
let e2eTestRunner: undefined | 'none' | 'cypress' | 'playwright' = undefined; let e2eTestRunner: undefined | 'none' | 'cypress' | 'playwright' = undefined;
if (parsedArgs.preset) { if (parsedArgs.preset && parsedArgs.preset !== Preset.Vue) {
preset = parsedArgs.preset; preset = parsedArgs.preset;
if (preset === Preset.VueStandalone || preset === Preset.NuxtStandalone) { if (preset === Preset.VueStandalone || preset === Preset.NuxtStandalone) {
appName = parsedArgs.appName ?? parsedArgs.name; appName = parsedArgs.appName ?? parsedArgs.name;
@ -646,13 +647,14 @@ async function determineVueOptions(
appName = await determineAppName(parsedArgs); appName = await determineAppName(parsedArgs);
} }
} else { } else {
const framework = await determineVueFramework(parsedArgs);
const workspaceType = await determineStandaloneOrMonorepo(); const workspaceType = await determineStandaloneOrMonorepo();
if (workspaceType === 'standalone') { if (workspaceType === 'standalone') {
appName = parsedArgs.appName ?? parsedArgs.name; appName = parsedArgs.appName ?? parsedArgs.name;
} else { } else {
appName = await determineAppName(parsedArgs); appName = await determineAppName(parsedArgs);
} }
const framework = await determineVueFramework(parsedArgs);
if (framework === 'nuxt') { if (framework === 'nuxt') {
if (workspaceType === 'standalone') { if (workspaceType === 'standalone') {

View File

@ -20,6 +20,7 @@ export enum Preset {
Nest = 'nest', Nest = 'nest',
Express = 'express', Express = 'express',
React = 'react', React = 'react',
Vue = 'vue',
Angular = 'angular', Angular = 'angular',
NodeStandalone = 'node-standalone', NodeStandalone = 'node-standalone',
NodeMonorepo = 'node-monorepo', NodeMonorepo = 'node-monorepo',