Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add vitepress template #16

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/customize/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export async function customize(prompts: PromptsData) {
case 'vue-ts':
await import('./vue').then(({ customize }) => customize(prompts))
break
case 'vitepress':
case 'vitepress-ts':
await import('./vitepress').then(({ customize }) => customize(prompts))
break
case 'react':
case 'react-ts':
await import('./react').then(({ customize }) => customize(prompts))
Expand Down
5 changes: 5 additions & 0 deletions src/customize/vitepress.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type { PromptsData } from '../types'

export function customize(_prompts: PromptsData) {

}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ async function init() {
const [command, ...args] = fullCustomCommand.split(' ')
// we replace TARGET_DIR here because targetDir may include a space
const replacedArgs = args.map(arg => arg.replace('TARGET_DIR', targetDir))
console.log(replacedArgs)
const { status } = spawn.sync(command, replacedArgs, {
stdio: 'inherit',
})
Expand Down
14 changes: 13 additions & 1 deletion src/prompts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ export const FRAMEWORKS = (<Framework[]>[
customCommand: 'npm exec nuxi init TARGET_DIR',
enabled: true,
},
{
name: 'vitepress-ts',
display: 'VitePress + TypeScript',
color: blue,
enabled: true,
},
{
name: 'vitepress',
display: 'VitePress + JavaScript',
color: yellow,
enabled: true,
},
],
},
{
Expand Down Expand Up @@ -159,7 +171,7 @@ export const FRAMEWORKS = (<Framework[]>[
{
name: 'custom-svelte-kit',
display: 'SvelteKit ↗',
color: red,
color: cyan,
customCommand: 'npm create svelte@latest TARGET_DIR',
enabled: true,
},
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface Framework {

export type FrameworkVariantKey =
| 'vanilla' | 'vanilla-ts'
| 'vue' | 'vue-ts' | 'custom-nuxt'
| 'vue' | 'vue-ts' | 'custom-nuxt' | 'vitepress' | 'vitepress-ts'
| 'react' | 'react-ts'
| 'preact' | 'preact-ts'
| 'svelte' | 'svelte-ts' | 'custom-svelte-kit'
Expand Down