From e0262f6775178b0c5ddb68a2e2e756a85968f472 Mon Sep 17 00:00:00 2001 From: Min Kim Date: Fri, 27 Sep 2024 17:59:29 -0400 Subject: [PATCH] Utilize built-in prompts and globals for user-specified prompts Signed-off-by: Min Kim --- packages/cli/src/commands/new/new.ts | 70 ++++++++++++++++++- .../templates/alpha/web-library-package.yaml | 11 ++- 2 files changed, 77 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/commands/new/new.ts b/packages/cli/src/commands/new/new.ts index d683aeaa6b..235239d96b 100644 --- a/packages/cli/src/commands/new/new.ts +++ b/packages/cli/src/commands/new/new.ts @@ -25,12 +25,19 @@ import { isMonoRepo } from '@backstage/cli-node'; import { paths } from '../../lib/paths'; import { assertError } from '@backstage/errors'; import { Task } from '../../lib/tasks'; +import { + pluginIdPrompt, + moduleIdIdPrompt, + // ownerPrompt, // 🚨 WIP +} from '../../lib/new/factories/common/prompts'; import defaultTemplates from '../../../templates/alpha/all-default-templates'; type ConfigurablePrompt = | { id: string; prompt: string; + type?: string; + validate?: string; default?: string | boolean; } | string; @@ -113,13 +120,74 @@ async function verifyTemplate({ target }: TemplateLocation): Promise