Skip to content

Commit

Permalink
Merge branch 'trunk' into add/media-import-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aagam-shah authored Jun 5, 2024
2 parents 358dc79 + 5024519 commit d4784d0
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 13 deletions.
15 changes: 15 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
## Changelog

### 3.0.0

* fix(dev-env): demo code is displayed as `[demo-image]`
* build(deps-dev): bump @types/node from 18.19.33 to 18.19.34
* build(deps): bump debug from 4.3.4 to 4.3.5
* ci: remove duplicate check
* Update the dev-env commands to follow the VIP-CLI style guide
* build(deps-dev): bump the babel group with 4 updates
* ci: add publish prerelease workflow
* build(deps): bump step-security/harden-runner from 2.7.1 to 2.8.0
* build(deps): bump ini from 4.1.2 to 4.1.3
* Integrate media import v2 flow and expand on media import error report messaging

**Full Changelog**: https://github.com/Automattic/vip-cli/compare/2.39.7...3.0.0

### 2.39.7

* Fix promptForBoolean to display the default initial value capitalized
Expand Down
16 changes: 8 additions & 8 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/vip",
"version": "2.39.8-dev.0",
"version": "3.1.0-dev.0",
"description": "The VIP Javascript library & CLI",
"main": "index.js",
"bin": {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/dev-environment/dev-environment-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ interface LocalComponent {

interface ImageComponent {
mode: 'image';
tag: string;
tag: string | undefined;
}

export function processComponentOptionInput(
Expand All @@ -258,7 +258,7 @@ export function processComponentOptionInput(

return {
mode: 'image',
tag: param,
tag: param === 'demo' ? undefined : param,
};
}

Expand Down Expand Up @@ -412,10 +412,10 @@ async function processWordPress(
let result: WordPressConfig;
const allowLocal = false;
const defaultObject = defaultValue
? processComponentOptionInput( defaultValue, allowLocal )
? ( processComponentOptionInput( defaultValue, allowLocal ) as WordPressConfig )
: null;
if ( preselectedValue ) {
result = processComponentOptionInput( preselectedValue, allowLocal );
result = processComponentOptionInput( preselectedValue, allowLocal ) as WordPressConfig;
} else {
result = await promptForWordPress( defaultObject );
}
Expand Down
6 changes: 6 additions & 0 deletions src/lib/dev-environment/dev-environment-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ function parseComponentForInfo( component: ComponentConfig | WordPressConfig ):
if ( component.mode === 'local' ) {
return component.dir ?? '';
}

// Environments created by the old code will have `component.tag` set to `demo` instead of `undefined`.
if ( component.tag === 'demo' ) {
component.tag = undefined;
}

return component.tag ?? '[demo-image]';
}

Expand Down

0 comments on commit d4784d0

Please sign in to comment.