From 000f660d50f2aa15b100772f26ee785463eb737a Mon Sep 17 00:00:00 2001 From: Damian Glowala Date: Fri, 29 Mar 2024 22:51:41 +0100 Subject: [PATCH 1/2] feat(module): allow adding module to Nuxt config within layer --- src/commands/module/add.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/module/add.ts b/src/commands/module/add.ts index 8544b32a..9e8b9441 100644 --- a/src/commands/module/add.ts +++ b/src/commands/module/add.ts @@ -35,6 +35,10 @@ export default defineCommand({ type: 'boolean', description: 'Skip nuxt.config.ts update', }, + layer: { + type: 'string', + description: 'Layer name' + } }, async setup(ctx) { const cwd = resolve(ctx.args.cwd || '.') @@ -88,7 +92,9 @@ export default defineCommand({ // Update nuxt.config.ts if (!ctx.args.skipConfig) { - await updateNuxtConfig(cwd, (config) => { + const rootDir = ctx.args.layer ? resolve(cwd, ctx.args.layer) : cwd + + await updateNuxtConfig(rootDir, (config) => { if (!config.modules) { config.modules = [] } From e7035dbaeaa006cc06cbdc4b30bad91e266d8d73 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 21:53:52 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- src/commands/module/add.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/module/add.ts b/src/commands/module/add.ts index 9e8b9441..98aaaf49 100644 --- a/src/commands/module/add.ts +++ b/src/commands/module/add.ts @@ -36,9 +36,9 @@ export default defineCommand({ description: 'Skip nuxt.config.ts update', }, layer: { - type: 'string', - description: 'Layer name' - } + type: 'string', + description: 'Layer name', + }, }, async setup(ctx) { const cwd = resolve(ctx.args.cwd || '.')