diff --git a/README.md b/README.md index 6761308..8dc6e76 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@

-Create a project quickly and easily in VSCode +Kickstart your project with a Starter Template in VSCode

## Why @@ -17,12 +17,12 @@ Create a project quickly and easily in VSCode - [Create Vue](https://github.com/vuejs/create-vue) - The recommended way to start a Vite-powered Vue project. - [Vitesse](https://github.com/antfu/vitesse) - Opinionated starter template. - [Vitesse Lite](https://github.com/antfu/vitesse-lite) - Lightweight version of Vitesse. +- [Nuxt3 Minimal Starter](https://github.com/nuxt/starter/tree/v3) - Create a new Nuxt project, module, layer or start from a theme with our collection of starters. - [Vitesse Nuxt3](https://github.com/antfu/vitesse-nuxt3) - Vitesse for Nuxt 3. - [Vitesse WebExt](https://github.com/antfu/vitesse-webext) - WebExtension Vite Starter Template. - [Starter TS](https://github.com/antfu/starter-ts) - Starter template for TypeScript library. - ... - ## License MIT License © 2023 [YRM](https://github.com/yrming) diff --git a/package-lock.json b/package-lock.json index 226272c..8f9b032 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "starter-templates", - "version": "0.1.6", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "starter-templates", - "version": "0.1.6", + "version": "0.2.0", "license": "MIT", "dependencies": { "degit": "^2.8.4", diff --git a/package.json b/package.json index 9bff84c..a5cc477 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "publisher": "YRM", "name": "starter-templates", "displayName": "Starter Templates", - "version": "0.1.6", - "description": "Create a project quickly and easily in VSCode", + "version": "0.2.0", + "description": "Kickstart your project with a Starter Template in VSCode", "license": "MIT", "repository": { "type": "git", @@ -89,6 +89,35 @@ "scope": "window" } } + }, + { + "title": "Nuxt3 Minimal Starter(Official)", + "order": 2, + "properties": { + "starterTemplates.nuxt3MinimalStarter.needsGitInit": { + "type": "boolean", + "default": true, + "markdownDescription": "Initialize git repository", + "scope": "window" + }, + "starterTemplates.nuxt3MinimalStarter.needsInstall": { + "type": "boolean", + "default": true, + "markdownDescription": "Install project dependencies", + "scope": "window" + }, + "starterTemplates.nuxt3MinimalStarter.packageManager": { + "enum": [ + "pnpm", + "npm", + "yarn", + "bun" + ], + "default": "pnpm", + "description": "Package manager choice", + "scope": "window" + } + } } ] }, diff --git a/src/commands/starter.ts b/src/commands/starter.ts index 5a09cf6..e9fbf95 100644 --- a/src/commands/starter.ts +++ b/src/commands/starter.ts @@ -70,6 +70,10 @@ export class StarterCommands extends BaseCommands { break case 'vitesse-lite': await degit('antfu/vitesse-lite').clone(`${projectPath}`) + break + case 'nuxt3-minimal-starter': + await degit('nuxt/starter/#v3').clone(`${projectPath}`) + break case 'vitesse-nuxt3': await degit('antfu/vitesse-nuxt3').clone(`${projectPath}`) @@ -127,11 +131,11 @@ export class StarterCommands extends BaseCommands { kind: QuickPickItemKind.Separator, label: 'Nuxt', }, - // { - // label: "Nuxi(Official)", - // detail: "⚡️ Nuxt Generation CLI Experience", - // template: { id: "nuxi", defaultProjectName: 'nuxt-project' }, - // }, + { + label: 'Nuxt3 Minimal Starter(Official)', + detail: 'Create a new Nuxt project, module, layer or start from a theme with our collection of starters.', + template: { id: 'nuxt3-minimal-starter', defaultProjectName: 'nuxt-project' }, + }, { label: 'Vitesse Nuxt3(Anthony Fu)', detail: 'Vitesse for Nuxt 3 🏔💚⚡️', @@ -203,7 +207,7 @@ export class StarterCommands extends BaseCommands { title: 'Project Name', validation: s => this.validateProjectName(s, folderPath), value: defaultName, - enableSetting: template.id === 'create-vue', + enableSetting: template.id === 'create-vue' || template.id === 'nuxt3-minimal-starter', }, ) @@ -304,9 +308,35 @@ export class StarterCommands extends BaseCommands { }, ) } - return createVueSettings - + case 'nuxt3-minimal-starter': + return [ + { + currentValue: config.nuxt3MinimalStarterNeedsGitInit ? 'Yes' : 'No', + description: config.nuxt3MinimalStarterNeedsGitInit ? 'Yes' : 'No', + detail: '', + label: 'Initialize git repository?', + setValue: (newValue: boolean) => config.setNuxt3MinimalStarterNeedsGitInit(newValue), + settingKind: 'BOOL', + }, + { + currentValue: config.nuxt3MinimalStarterNeedsInstall ? 'Yes' : 'No', + description: config.nuxt3MinimalStarterNeedsInstall ? 'Yes' : 'No', + detail: '', + label: 'Install project dependencies?', + setValue: (newValue: boolean) => config.setNuxt3MinimalStarterNeedsInstall(newValue), + settingKind: 'BOOL', + }, + { + currentValue: config.nuxt3MinimalStarterPackageManager || 'pnpm', + description: config.nuxt3MinimalStarterPackageManager || 'pnpm', + detail: '', + enumValues: ['pnpm', 'npm', 'yarn', 'bun'], + label: 'Package manager choice?', + setValue: (newValue: 'pnpm' | 'npm' | 'yarn' | 'bun') => config.setNuxt3MinimalStarterPackageManager(newValue), + settingKind: 'ENUM', + }, + ] default: return [] } diff --git a/src/config.ts b/src/config.ts index 4694738..4f10aa3 100644 --- a/src/config.ts +++ b/src/config.ts @@ -38,6 +38,7 @@ class Config { get projectSearchDepth(): number { return this.getConfig('projectSearchDepth', 5) } + // create vue get createVueNeedsTypeScript(): boolean { return this.getConfig('createVue.needsTypeScript', true) } get createVueNeedsJsx(): boolean { return this.getConfig('createVue.needsJsx', true) } get createVueNeedsRouter(): boolean { return this.getConfig('createVue.needsRouter', true) } @@ -46,7 +47,12 @@ class Config { get createVueEndToEndTestingSolution(): 'Cypress' | 'Nightwatch' | 'Playwright' | 'No' { return this.getConfig<'Cypress' | 'Nightwatch' | 'Playwright' | 'No'>('createVue.endToEndTestingSolution', 'Cypress') } get createVueNeedsEslint(): boolean { return this.getConfig('createVue.needsEslint', true) } get createVueNeedsPrettier(): boolean { return this.getConfig('createVue.needsPrettier', true) } + // nuxt3 minimal starter + get nuxt3MinimalStarterNeedsGitInit(): boolean { return this.getConfig('nuxt3MinimalStarter.needsGitInit', true) } + get nuxt3MinimalStarterNeedsInstall(): boolean { return this.getConfig('nuxt3MinimalStarter.needsInstall', true) } + get nuxt3MinimalStarterPackageManager(): 'pnpm' | 'npm' | 'yarn' | 'bun' { return this.getConfig<'pnpm' | 'npm' | 'yarn' | 'bun'>('nuxt3MinimalStarter.packageManager', 'pnpm') } + // create vue public setCreateVueNeedsTypeScript(value: boolean): Promise { return this.setConfig('createVue.needsTypeScript', value, ConfigurationTarget.Global) } public setCreateVueNeedsJsx(value: boolean): Promise { return this.setConfig('createVue.needsJsx', value, ConfigurationTarget.Global) } public setCreateVueNeedsRouter(value: boolean): Promise { return this.setConfig('createVue.needsRouter', value, ConfigurationTarget.Global) } @@ -55,6 +61,10 @@ class Config { public setCreateVueEndToEndTestingSolution(value: 'Cypress' | 'Nightwatch' | 'Playwright' | 'No'): Promise { return this.setConfig('createVue.endToEndTestingSolution', value, ConfigurationTarget.Global) } public setCreateVueNeedsEslint(value: boolean): Promise { return this.setConfig('createVue.needsEslint', value, ConfigurationTarget.Global) } public setCreateVueNeedsPrettier(value: boolean): Promise { return this.setConfig('createVue.needsPrettier', value, ConfigurationTarget.Global) } + // nuxt3 minimal starter + public setNuxt3MinimalStarterNeedsGitInit(value: boolean): Promise { return this.setConfig('nuxt3MinimalStarter.needsGitInit', value, ConfigurationTarget.Global) } + public setNuxt3MinimalStarterNeedsInstall(value: boolean): Promise { return this.setConfig('nuxt3MinimalStarter.needsInstall', value, ConfigurationTarget.Global) } + public setNuxt3MinimalStarterPackageManager(value: 'pnpm' | 'npm' | 'yarn' | 'bun'): Promise { return this.setConfig('nuxt3MinimalStarter.packageManager', value, ConfigurationTarget.Global) } public for(uri?: Uri): ResourceConfig { return new ResourceConfig(uri)