Skip to content

Commit

Permalink
feat: show template icon
Browse files Browse the repository at this point in the history
  • Loading branch information
yrming committed Dec 29, 2023
1 parent 6d37433 commit f9c2212
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"publisher": "YRM",
"name": "starter-templates",
"displayName": "Starter Templates",
"version": "0.3.0",
"version": "0.4.0",
"description": "Kickstart your project with a Starter Template in VSCode",
"license": "MIT",
"repository": {
Expand Down
1 change: 1 addition & 0 deletions resources/nuxt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/ts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/vue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/web-ext.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 42 additions & 14 deletions src/commands/starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,36 @@ export class StarterCommands extends BaseCommands {
}

private getTemplates(): Array<QuickPickItem & { template?: ProjectTemplate }> {
const templates = [
const templates: Array<QuickPickItem & { template?: ProjectTemplate }> = [
{
kind: QuickPickItemKind.Separator,
label: 'Vue',
},
{
label: 'Create Vue(Official)',
detail: '🛠️ The recommended way to start a Vite-powered Vue project',
iconPath: {
dark: Uri.file(this.context.asAbsolutePath('resources/vue.svg')),
light: Uri.file(this.context.asAbsolutePath('resources/vue.svg')),
},
detail: 'The recommended way to start a Vite-powered Vue project',
template: { id: 'create-vue', defaultProjectName: 'vue-project' },
},
{
label: 'Vitesse(Anthony Fu)',
detail: '🏕 Opinionated Vite + Vue Starter Template',
iconPath: {
dark: Uri.file(this.context.asAbsolutePath('resources/vue.svg')),
light: Uri.file(this.context.asAbsolutePath('resources/vue.svg')),
},
detail: 'Opinionated Vite + Vue Starter Template',
template: { id: 'vitesse', defaultProjectName: 'vue-vitesse-project' },
},
{
label: 'Vitesse Lite(Anthony Fu)',
detail: '⛺️ Lightweight version of Vitesse',
iconPath: {
dark: Uri.file(this.context.asAbsolutePath('resources/vue.svg')),
light: Uri.file(this.context.asAbsolutePath('resources/vue.svg')),
},
detail: 'Lightweight version of Vitesse',
template: { id: 'vitesse-lite', defaultProjectName: 'vue-vitesse-lite-project' },
},
{
Expand All @@ -154,31 +166,47 @@ export class StarterCommands extends BaseCommands {
},
{
label: 'Nuxt3 Minimal Starter(Official)',
detail: 'Create a new Nuxt project, module, layer or start from a theme with our collection of starters.',
iconPath: {
dark: Uri.file(this.context.asAbsolutePath('resources/nuxt.svg')),
light: Uri.file(this.context.asAbsolutePath('resources/nuxt.svg')),
},
detail: 'Create a new Nuxt project',
template: { id: 'nuxt3-minimal-starter', defaultProjectName: 'nuxt-project' },
},
{
label: 'Vitesse Nuxt3(Anthony Fu)',
detail: 'Vitesse for Nuxt 3 🏔💚⚡️',
iconPath: {
dark: Uri.file(this.context.asAbsolutePath('resources/nuxt.svg')),
light: Uri.file(this.context.asAbsolutePath('resources/nuxt.svg')),
},
detail: 'Vitesse for Nuxt 3',
template: { id: 'vitesse-nuxt3', defaultProjectName: 'nuxt-vitesse-project' },
},
{
kind: QuickPickItemKind.Separator,
label: 'Web Extension',
label: 'TypeScript Library',
},
{
label: 'Vitesse WebExt(Anthony Fu)',
detail: '⚡️ WebExtension Vite Starter Template',
template: { id: 'vitesse-webext', defaultProjectName: 'webext-vitesse-project' },
label: 'Starter TS(Anthony Fu)',
iconPath: {
dark: Uri.file(this.context.asAbsolutePath('resources/ts.svg')),
light: Uri.file(this.context.asAbsolutePath('resources/ts.svg')),
},
detail: 'Starter template for TypeScript library',
template: { id: 'starter-ts', defaultProjectName: 'ts-library-project' },
},
{
kind: QuickPickItemKind.Separator,
label: 'TypeScript Library',
label: 'Web Extension',
},
{
label: 'Starter TS(Anthony Fu)',
detail: 'Starter template for TypeScript library',
template: { id: 'starter-ts', defaultProjectName: 'ts-library-project' },
label: 'Vitesse WebExt(Anthony Fu)',
iconPath: {
dark: Uri.file(this.context.asAbsolutePath('resources/web-ext.svg')),
light: Uri.file(this.context.asAbsolutePath('resources/web-ext.svg')),
},
detail: 'WebExtension Vite Starter Template',
template: { id: 'vitesse-webext', defaultProjectName: 'webext-vitesse-project' },
},
]
return templates
Expand Down

0 comments on commit f9c2212

Please sign in to comment.