- Component: ${name}
+ Component: ${opts.name}
`
-})
+ }
+}
const composable: Template = ({ name }) => {
const nameWithUsePrefix = name.startsWith('use') ? name : `use${upperFirst(name)}`
From 46c8674d9e73ecdd17136bfc0665acd88f59fd57 Mon Sep 17 00:00:00 2001
From: Dizzy Rogers <19627670+Diizzayy@users.noreply.github.com>
Date: Sun, 27 Mar 2022 13:46:00 +0000
Subject: [PATCH 03/20] remove global flag
---
packages/nuxi/src/commands/add.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/nuxi/src/commands/add.ts b/packages/nuxi/src/commands/add.ts
index 1d02d2f8b5a..ef12ca06da1 100644
--- a/packages/nuxi/src/commands/add.ts
+++ b/packages/nuxi/src/commands/add.ts
@@ -36,7 +36,7 @@ export default defineNuxtCommand({
const extRegex = /\.[a-z]+$/
const extProvided = name.match(extRegex)?.[0]
- const modeProvided = name.match(/\.(client|server)/g)?.[0]
+ const modeProvided = name.match(/\.(client|server)/)?.[0]
if (extProvided && extProvided !== modeProvided) {
name = name.replace(extRegex, '')
From 6bdc666b55a8acf66ba49f0f4c90c2fb486da4c8 Mon Sep 17 00:00:00 2001
From: Dizzy Rogers <19627670+Diizzayy@users.noreply.github.com>
Date: Sun, 27 Mar 2022 13:57:41 +0000
Subject: [PATCH 04/20] fix(docs): clarify behavior
---
docs/content/3.docs/1.usage/8.cli.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/content/3.docs/1.usage/8.cli.md b/docs/content/3.docs/1.usage/8.cli.md
index 3c6daa9c050..08ddcd1fceb 100644
--- a/docs/content/3.docs/1.usage/8.cli.md
+++ b/docs/content/3.docs/1.usage/8.cli.md
@@ -115,8 +115,8 @@ Option | Default | Description
`NAME` | - | Specify a name of the file that will be created.
`--cwd` | `.` | The directory of the target application.
`--force` | `false` | Force override file if already exsits.
-`--client` | - | Indicate that this entity is client only.
-`--server` | - | Indicate that this entity is server only.
+`--client` | - | When applicable, this flag indicates that the entity is client only.
+`--server` | - | When applicable, this flag indicates that the entity is server only.
**Example:**
From 818fa1228b26ba84ee1b1baf72ac113818b2eff6 Mon Sep 17 00:00:00 2001
From: Dizzy Rogers <19627670+Diizzayy@users.noreply.github.com>
Date: Mon, 28 Mar 2022 08:46:43 -0400
Subject: [PATCH 05/20] provide `mode` types
Co-authored-by: pooya parsa