Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/config/uiBundleDiscovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ import type { UiBundleManifest } from './manifest.js';
const logger = Logger.childFromRoot('UiBundleDiscovery');

/**
* Default command to run when no ui-bundle.json manifest is found
* Default dev command when `ui-bundle.json` does not specify `dev.command`.
*
* Set to `npm run dev:design` so that design-mode clients (notably the Live
* Preview VS Code extension) get hybrid-editor support automatically. The
* bundle's `package.json` must define a `dev:design` script for this
* default to resolve. Bundles that need a different command should set
* `dev.command` in `ui-bundle.json`.
*/
export const DEFAULT_DEV_COMMAND = 'npm run dev';
export const DEFAULT_DEV_COMMAND = 'npm run dev:design';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package.json of the UIBundle, seems to have the below scripts already added.

    "dev": "vite",
    "dev:design": "vite --mode design",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have approved it for now, I will let my team explore the boarder implications of this a bit more. In case we see any startup time degradation for the dev server that's noticeable, we will have to revisit this.


/**
* Standard metadata path segment for uiBundles (relative to package directory).
Expand Down
4 changes: 2 additions & 2 deletions test/config/uiBundleDiscovery.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ describe('uiBundleDiscovery', () => {
});

describe('DEFAULT_DEV_COMMAND', () => {
it('should be npm run dev', () => {
expect(DEFAULT_DEV_COMMAND).to.equal('npm run dev');
it('should be npm run dev:design', () => {
expect(DEFAULT_DEV_COMMAND).to.equal('npm run dev:design');
});
});

Expand Down
Loading