diff --git a/packages/create-nx-plugin/bin/create-nx-plugin.ts b/packages/create-nx-plugin/bin/create-nx-plugin.ts index 6b8e1a51586cb..63335256c891e 100644 --- a/packages/create-nx-plugin/bin/create-nx-plugin.ts +++ b/packages/create-nx-plugin/bin/create-nx-plugin.ts @@ -61,6 +61,23 @@ async function determinePluginName( return results.pluginName; } +async function determineCreatePackageName( + parsedArgs: CreateNxPluginArguments +): Promise { + if (parsedArgs.createPackageName) { + return parsedArgs.createPackageName; + } + + const results = await enquirer.prompt<{ createPackageName: string }>([ + { + name: 'createPackageName', + message: `Create a package which can be used by npx to create a new workspace (Leave blank to not create this package)`, + type: 'input', + }, + ]); + return results.createPackageName; +} + interface CreateNxPluginArguments { pluginName: string; createPackageName?: string; @@ -163,6 +180,7 @@ async function normalizeArgsMiddleware( ): Promise { try { const pluginName = await determinePluginName(argv); + const createPackageName = await determineCreatePackageName(argv); const packageManager = await determinePackageManager(argv); const defaultBase = await determineDefaultBase(argv); const nxCloud = await determineNxCloud(argv); @@ -170,6 +188,7 @@ async function normalizeArgsMiddleware( Object.assign(argv, { pluginName, + createPackageName, nxCloud, packageManager, defaultBase,