-
Notifications
You must be signed in to change notification settings - Fork 12
feat: initial revision for app preview on desktop #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1,15 +1,15 @@ | |||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto-generated after running yarn update-snapshots
@@ -6,22 +6,23 @@ | |||
"bugs": "https://github.com/forcedotcom/cli/issues", | |||
"dependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I was pulling in @salesforce/lwc-dev-mobile-core
I also decided to update the rest of the dependencies to the latest version.
@@ -1,16 +0,0 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this file since for now LightningPreviewApp
extends from SfCommand<void>
and does not return anything. As we work on adding more functionalities to LightningPreviewApp
, we can change the return type as needed and auto-generate the new schema
}; | ||
|
||
export default class LightningPreviewApp extends SfCommand<LightningPreviewAppResult> { | ||
export default class LightningPreviewApp extends SfCommand<void> { | ||
public static readonly summary = messages.getMessage('summary'); | ||
public static readonly description = messages.getMessage('description'); | ||
public static readonly examples = messages.getMessages('examples'); | ||
|
||
public static readonly flags = { | ||
name: Flags.string({ | ||
summary: messages.getMessage('flags.name.summary'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per latest discussion here, --name
is now optional.
const platform = flags['device-type']; | ||
|
||
logger.debug('Determining Local Dev Server url'); | ||
// todo: figure out how to make the port dynamic instead of hard-coded value here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the work for automatically starting the dev server progresses, we should have a better idea on how to achieve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cc: @nrkruk
* Given an app name, it queries the org to find the matching app id. To do so, | ||
* it will first attempt at finding the app with a matching DeveloperName. If | ||
* no match is found, it will then attempt at finding the app with a matching | ||
* Label. If multiple matches are found, then the first match is returned. | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See this discussion which lead to the implementation here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Co-authored-by: Kevin Hawkins <khawkins@salesforce.com>
|
||
logger.debug('Determining Local Dev Server url'); | ||
// todo: figure out how to make the port dynamic instead of hard-coded value here | ||
const ldpServerUrl = PreviewUtils.generateWebSocketUrlForLocalDevServer(platform, '8081'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nrkruk et al: I just want to call out that with this line we are (in this moment anyway) officially putting LDP-related utility functionality into the lwc-dev-mobile-core project/package. I think such functionality could live in there, or we could create a new independent package, or we could re-brand the existing one. No action necessary here: I just wanted to call it out for discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks pretty good to me. Just a couple of questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
What does this PR do?
Adds support for
sf lightning preview app
command for desktop only.To run the command, ensure that you have authorized at least one org:
sf lightning preview app
=> should launch the default org and navigate to the default appsf lightning preview app -n Sales
=> should launch the default org and navigate to the Sales appsf lightning preview app -o MyOrg
=> should launch the specified org and navigate to the default appsf lightning preview app -o MyOrg -n Sales
=> should launch the specified org and navigate to the Sales appWhat issues does this PR fix or reference?
@W-15429062@