From 40d59dbc88915974713ca5110bd6840f268702e9 Mon Sep 17 00:00:00 2001 From: Bryce Osterhaus Date: Fri, 17 Mar 2023 13:18:06 +0400 Subject: [PATCH] feat(@liferay/cli): add a way to specify what version of dxp that the target project is supported --- .../js-toolkit/packages/liferay-cli/src/new/index.ts | 10 +++++++++- .../src/new/target-theme-spritemap/index.ts | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/js-toolkit/packages/liferay-cli/src/new/index.ts b/projects/js-toolkit/packages/liferay-cli/src/new/index.ts index 5fb3ca8fc7..4383c5ade9 100644 --- a/projects/js-toolkit/packages/liferay-cli/src/new/index.ts +++ b/projects/js-toolkit/packages/liferay-cli/src/new/index.ts @@ -25,6 +25,7 @@ export interface Facet { } export interface Target extends Facet { + dxpSupport?: string; name: string; } @@ -88,7 +89,14 @@ export default async function newProject( else { options = await prompt(batch, options, [ { - choices: targets.map((target) => target.name), + choices: targets.map((target) => ({ + name: `${target.name} ${ + target.dxpSupport + ? `(Support: ${target.dxpSupport})` + : '' + }`, + value: target.name, + })), default: targets[0].name, message: 'What type of project do you want to create?', name: 'target', diff --git a/projects/js-toolkit/packages/liferay-cli/src/new/target-theme-spritemap/index.ts b/projects/js-toolkit/packages/liferay-cli/src/new/target-theme-spritemap/index.ts index ab3be3a9e3..fa91152027 100644 --- a/projects/js-toolkit/packages/liferay-cli/src/new/target-theme-spritemap/index.ts +++ b/projects/js-toolkit/packages/liferay-cli/src/new/target-theme-spritemap/index.ts @@ -32,7 +32,8 @@ const TARGET_ID = 'target-theme-spritemap'; const platforms = dependencies[TARGET_ID]['platforms']; const target: Target = { - name: 'Liferay Theme Spritemap Client Extension (Experimental)', + dxpSupport: 'experimental', + name: 'Liferay Theme Spritemap Client Extension', async prompt(useDefaults: boolean, options: Options): Promise { options = await facetProject.prompt(useDefaults, options);