From 5ffe8513bf14a8c0cfb430d8592f3dcf6c57dcae Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Tue, 4 Jun 2024 14:51:49 +0300 Subject: [PATCH] fix(dev-env): demo code is displayed as `[demo-image]` --- src/lib/dev-environment/dev-environment-cli.ts | 4 ++-- src/lib/dev-environment/dev-environment-core.ts | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/dev-environment/dev-environment-cli.ts b/src/lib/dev-environment/dev-environment-cli.ts index 4dab86e875..18658cab73 100644 --- a/src/lib/dev-environment/dev-environment-cli.ts +++ b/src/lib/dev-environment/dev-environment-cli.ts @@ -231,7 +231,7 @@ interface LocalComponent { interface ImageComponent { mode: 'image'; - tag: string; + tag: string | undefined; } export function processComponentOptionInput( @@ -258,7 +258,7 @@ export function processComponentOptionInput( return { mode: 'image', - tag: param, + tag: param === 'demo' ? undefined : param, }; } diff --git a/src/lib/dev-environment/dev-environment-core.ts b/src/lib/dev-environment/dev-environment-core.ts index 5c590baefe..2a6f2d72b9 100644 --- a/src/lib/dev-environment/dev-environment-core.ts +++ b/src/lib/dev-environment/dev-environment-core.ts @@ -305,6 +305,11 @@ function parseComponentForInfo( component: ComponentConfig | WordPressConfig ): if ( component.mode === 'local' ) { return component.dir ?? ''; } + + if ( component.tag === 'demo' ) { + component.tag = undefined; + } + return component.tag ?? '[demo-image]'; }