From 24c2626ef335ac0c0040f1c36a67713372b0d7f8 Mon Sep 17 00:00:00 2001 From: Min Kim Date: Tue, 17 Dec 2024 17:19:46 -0500 Subject: [PATCH] Only format moduleVar if moduleId exists Signed-off-by: Min Kim --- packages/cli/src/commands/new/new.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/cli/src/commands/new/new.ts b/packages/cli/src/commands/new/new.ts index 66c29fea8e..a114771212 100644 --- a/packages/cli/src/commands/new/new.ts +++ b/packages/cli/src/commands/new/new.ts @@ -73,9 +73,11 @@ export default async () => { plugin: template.plugin ?? true, }); - const moduleVar = `${camelCase(options.id)}Module${camelCase( - options.moduleId, - )[0].toUpperCase()}${camelCase(options.moduleId).slice(1)}`; // used in default-backend-module template + const moduleVar = + options.moduleId ?? + `${camelCase(options.id)}Module${camelCase( + options.moduleId, + )[0].toUpperCase()}${camelCase(options.moduleId).slice(1)}`; // used in default-backend-module template const extension = `${upperFirst(camelCase(options.id))}Page`; // used in default-plugin template const pluginVar = `${camelCase(options.id)}Plugin`; // used in default-backend-plugin and default-plugin template