diff --git a/src/commands/make/component.ts b/src/commands/make/component.ts index b39269a..9049b91 100644 --- a/src/commands/make/component.ts +++ b/src/commands/make/component.ts @@ -24,9 +24,9 @@ export default async function makeComponent(filePath?: string) { p.text({ message: 'Directory to place it in', placeholder: './components', + initialValue: './components', validate: value => { if (!value) return 'Please enter a path.' - if (value[0] !== '.') return 'Please enter a relative path.' }, }), }, diff --git a/src/commands/make/config.ts b/src/commands/make/config.ts index 3c0cd29..16ce5f1 100644 --- a/src/commands/make/config.ts +++ b/src/commands/make/config.ts @@ -18,7 +18,7 @@ export default async function makeConfig(name?: string) { placeholder: 'production', validate: value => { if (!value) return 'Please enter a config name.' - if (value.includes(' ')) return 'Use - instead of spaces.' + if (value.includes(' ')) return 'Use - or . instead of spaces.' }, }), }, diff --git a/src/commands/make/layout.ts b/src/commands/make/layout.ts index b0fe329..0bd5909 100644 --- a/src/commands/make/layout.ts +++ b/src/commands/make/layout.ts @@ -4,7 +4,7 @@ import { scaffold, onCancel } from './scaffold.ts' export default async function makeLayout(filePath?: string) { if (filePath) { - await scaffold(filePath, 'layout.vue') + await scaffold(filePath, 'Layout.vue') return } @@ -24,14 +24,14 @@ export default async function makeLayout(filePath?: string) { p.text({ message: 'Directory to place it in', placeholder: './components', + initialValue: './components', validate: value => { if (!value) return 'Please enter a path.' - if (value[0] !== '.') return 'Please enter a relative path.' }, }), }, { onCancel }, ) - await scaffold(`${result.path}/${result.filename}`, 'layout.vue') + await scaffold(`${result.path}/${result.filename}`, 'Layout.vue') } diff --git a/src/commands/make/scaffold.ts b/src/commands/make/scaffold.ts index 84b7792..11e673c 100644 --- a/src/commands/make/scaffold.ts +++ b/src/commands/make/scaffold.ts @@ -30,6 +30,6 @@ export async function scaffold(filePath: string, stubName: string) { } export function onCancel() { - p.cancel('Cancelled.') + p.cancel('Canceled.') process.exit(0) } diff --git a/src/commands/make/stubs/Layout.vue b/src/commands/make/stubs/Layout.vue new file mode 100644 index 0000000..448728e --- /dev/null +++ b/src/commands/make/stubs/Layout.vue @@ -0,0 +1,146 @@ + + + diff --git a/src/commands/make/stubs/component.vue b/src/commands/make/stubs/component.vue index e9f0816..1d21767 100644 --- a/src/commands/make/stubs/component.vue +++ b/src/commands/make/stubs/component.vue @@ -1,7 +1,5 @@ -