feat: add json flag / preview url encoding fixes / auto enable / fix 260 dependencies @W-20141594#549
Conversation
| "@inquirer/prompts": "^5.3.8", | ||
| "@inquirer/select": "^2.4.7", | ||
| "@lwc/lwc-dev-server": "~13.3.0", | ||
| "@lwc/sfdc-lwc-compiler": "~13.2.19", |
There was a problem hiding this comment.
This got out of sync with CLCO. Need to downgrade and then branch for 260
| ldpServerId: string, | ||
| componentName?: string | ||
| ): string { | ||
| let url = `${instanceUrl}/lwr/application/e/devpreview/ai/localdev-preview?ldpServerUrl=${ldpServerUrl}&ldpServerId=${ldpServerId}`; |
There was a problem hiding this comment.
updated the path for 260 to local-dev
| @@ -0,0 +1,239 @@ | |||
| /* | |||
| * Copyright 2025, Salesforce, Inc. | |||
There was a problem hiding this comment.
Updating mydomain settings and enabling local dev automatically from vscode
| @@ -22,12 +22,21 @@ import { ComponentUtils } from '../../../shared/componentUtils.js'; | |||
| import { PromptUtils } from '../../../shared/promptUtils.js'; | |||
There was a problem hiding this comment.
Changes are pulling forward the --json changes from 258
| const apiVersion = flags['api-version']; | ||
|
|
||
| // Auto enable local dev | ||
| if (process.env.AUTO_ENABLE_LOCAL_DEV === 'true') { |
There was a problem hiding this comment.
I don't think we should be auto enabling. Can we make this interactive?
There was a problem hiding this comment.
We can but I probably need to do it from the VSCode side of things. Its awkward to handle sending standard input to a spawned CLI process
| }; | ||
|
|
||
| // Open the browser and navigate to the right page (unless OPEN_BROWSER is set to true) | ||
| if (process.env.OPEN_BROWSER !== 'false') { |
There was a problem hiding this comment.
Should this be a command flag?
There was a problem hiding this comment.
we can make one, just wanted to review with CLI folks first before we created a flag for this
What does this PR do?
This PR ports functional changes from the 258-patch branch to main, focusing on improvements for IDE-based component preview and VSCode/Code Builder integration.
Key Changes:
metaUtils.tsutility for auto-enabling Lightning Preview in orgslightning dev componentcommand with:--api-versionflag for API version overrideAUTO_ENABLE_LOCAL_DEVenv var)SF_CONTAINER_MODEandVSCODE_PROXY_URIenv vars)ComponentPreviewResultfor better JSON outputgenerateComponentPreviewUrl()helper method in previewUtilslightning-base-componentsdependency from lwc.config.jsonWhat issues does this PR fix or reference?
@W-20141594@