Skip to content

Commit

Permalink
feat(add): add layer template (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
clemcode authored Jan 5, 2025
1 parent a6dff27 commit a5e5bd8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pnpm i
# Generate type stubs
pnpm dev:prepare

# Go the the playground directory
# Go to the playground directory
cd playground

# And run any commands
Expand Down
10 changes: 10 additions & 0 deletions src/utils/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,15 @@ const page: Template = ({ name, nuxtOptions }) => ({
`,
})

const layer: Template = ({ name, nuxtOptions }) => {
return {
path: resolve(nuxtOptions.srcDir, `layers/${name}/nuxt.config.ts`),
contents: `
export default defineNuxtConfig({})
`,
}
}

export const templates = {
api,
plugin,
Expand All @@ -120,6 +129,7 @@ export const templates = {
middleware,
layout,
page,
layer,
} as Record<string, Template>

// -- internal utils --
Expand Down

0 comments on commit a5e5bd8

Please sign in to comment.