@salesforce/plugin-lightning-dev 1.0.26-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +12 -0
- package/README.md +225 -0
- package/lib/commands/lightning/dev/app.d.ts +29 -0
- package/lib/commands/lightning/dev/app.js +288 -0
- package/lib/commands/lightning/dev/app.js.map +1 -0
- package/lib/commands/lightning/dev/site.d.ts +12 -0
- package/lib/commands/lightning/dev/site.js +77 -0
- package/lib/commands/lightning/dev/site.js.map +1 -0
- package/lib/configMeta.d.ts +28 -0
- package/lib/configMeta.js +74 -0
- package/lib/configMeta.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib/lwc-dev-server/index.d.ts +7 -0
- package/lib/lwc-dev-server/index.js +102 -0
- package/lib/lwc-dev-server/index.js.map +1 -0
- package/lib/shared/configUtils.d.ts +27 -0
- package/lib/shared/configUtils.js +108 -0
- package/lib/shared/configUtils.js.map +1 -0
- package/lib/shared/experience/expSite.d.ts +70 -0
- package/lib/shared/experience/expSite.js +200 -0
- package/lib/shared/experience/expSite.js.map +1 -0
- package/lib/shared/orgUtils.d.ts +14 -0
- package/lib/shared/orgUtils.js +36 -0
- package/lib/shared/orgUtils.js.map +1 -0
- package/lib/shared/previewUtils.d.ts +126 -0
- package/lib/shared/previewUtils.js +397 -0
- package/lib/shared/previewUtils.js.map +1 -0
- package/lib/shared/prompt.d.ts +4 -0
- package/lib/shared/prompt.js +25 -0
- package/lib/shared/prompt.js.map +1 -0
- package/messages/lightning.dev.app.md +171 -0
- package/messages/lightning.dev.site.md +37 -0
- package/messages/shared.utils.md +27 -0
- package/npm-shrinkwrap.json +29260 -0
- package/oclif.lock +15886 -0
- package/oclif.manifest.json +174 -0
- package/package.json +226 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2024, Salesforce.com, Inc.
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# plugin-lightning-dev
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@salesforce/plugin-lightning-dev) [](https://npmjs.org/package/@salesforce/plugin-lightning-dev) [](https://raw.githubusercontent.com/salesforcecli/plugin-lightning-dev/main/LICENSE.txt)
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
Prereqs:
|
|
8
|
+
|
|
9
|
+
1. Setup an Experience Site and publish it
|
|
10
|
+
|
|
11
|
+
2. Run the following:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yarn && yarn build
|
|
15
|
+
yarn link-lwr
|
|
16
|
+
sf org login web --instance-url ${orgfarmUrl}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Run the command
|
|
20
|
+
|
|
21
|
+
Then run the following for your environment:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
./bin/dev.js lightning dev site
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
or for debugging:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
NODE_OPTIONS='--inspect-brk' ./bin/dev.js lightning dev site
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
No need to recompile or watch typescript files as this happens automagically.
|
|
34
|
+
|
|
35
|
+
## Fix Snapshots
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
node --loader ts-node/esm --no-warnings=ExperimentalWarning ./bin/dev.js snapshot:compare
|
|
39
|
+
node --loader ts-node/esm --no-warnings=ExperimentalWarning ./bin/dev.js schema:compare
|
|
40
|
+
yarn && yarn build
|
|
41
|
+
yarn update-snapshots
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## TODO Update
|
|
45
|
+
|
|
46
|
+
This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
|
|
47
|
+
|
|
48
|
+
We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed.
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
sf plugins install @salesforce/plugin-lightning-dev@x.y.z
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Issues
|
|
57
|
+
|
|
58
|
+
Please report any issues at https://github.com/forcedotcom/cli/issues
|
|
59
|
+
|
|
60
|
+
## Contributing
|
|
61
|
+
|
|
62
|
+
1. Please read our [Code of Conduct](CODE_OF_CONDUCT.md)
|
|
63
|
+
2. Create a new issue before starting your project so that we can keep track of
|
|
64
|
+
what you are trying to add/fix. That way, we can also offer suggestions or
|
|
65
|
+
let you know if there is already an effort in progress.
|
|
66
|
+
3. Fork this repository.
|
|
67
|
+
4. [Build the plugin locally](#build)
|
|
68
|
+
5. Create a _topic_ branch in your fork. Note, this step is recommended but technically not required if contributing using a fork.
|
|
69
|
+
6. Edit the code in your fork.
|
|
70
|
+
7. Write appropriate tests for your changes. Try to achieve at least 95% code coverage on any new code. No pull request will be accepted without unit tests.
|
|
71
|
+
8. Sign CLA (see [CLA](#cla) below).
|
|
72
|
+
9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in.
|
|
73
|
+
|
|
74
|
+
### CLA
|
|
75
|
+
|
|
76
|
+
External contributors will be required to sign a Contributor's License
|
|
77
|
+
Agreement. You can do so by going to https://cla.salesforce.com/sign-cla.
|
|
78
|
+
|
|
79
|
+
### Build
|
|
80
|
+
|
|
81
|
+
To build the plugin locally, make sure to have yarn installed and run the following commands:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Clone the repository
|
|
85
|
+
git clone git@github.com:salesforcecli/plugin-lightning-dev
|
|
86
|
+
|
|
87
|
+
# Install the dependencies and compile
|
|
88
|
+
yarn && yarn build
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
To use your plugin, run using the local `./bin/dev` or `./bin/dev.cmd` file.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
# Run using local run file.
|
|
95
|
+
./bin/dev hello world
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Link your plugin to the sf cli
|
|
102
|
+
sf plugins link .
|
|
103
|
+
# To verify
|
|
104
|
+
sf plugins
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Commands
|
|
108
|
+
|
|
109
|
+
<!-- commands -->
|
|
110
|
+
|
|
111
|
+
- [`sf lightning dev app`](#sf-lightning-dev-app)
|
|
112
|
+
- [`sf lightning dev site`](#sf-lightning-dev-site)
|
|
113
|
+
|
|
114
|
+
## `sf lightning dev app`
|
|
115
|
+
|
|
116
|
+
Preview a Lightning Experience app locally and in real-time, without deploying it.
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
USAGE
|
|
120
|
+
$ sf lightning dev app -o <value> [--json] [--flags-dir <value>] [-n <value>] [-t desktop|ios|android] [-i <value>]
|
|
121
|
+
|
|
122
|
+
FLAGS
|
|
123
|
+
-i, --device-id=<value> ID of the mobile device to display the preview if device type is set to `ios` or
|
|
124
|
+
`android`. The default value is the ID of the first available mobile device.
|
|
125
|
+
-n, --name=<value> Name of the Lightning Experience app to preview.
|
|
126
|
+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
|
|
127
|
+
configuration variable is already set.
|
|
128
|
+
-t, --device-type=<option> [default: desktop] Type of device to display the app preview.
|
|
129
|
+
<options: desktop|ios|android>
|
|
130
|
+
|
|
131
|
+
GLOBAL FLAGS
|
|
132
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
133
|
+
--json Format output as json.
|
|
134
|
+
|
|
135
|
+
DESCRIPTION
|
|
136
|
+
Preview a Lightning Experience app locally and in real-time, without deploying it.
|
|
137
|
+
|
|
138
|
+
Use Local Dev (Beta) to see local changes to your app in a real-time preview that you don't have to deploy or manually
|
|
139
|
+
refresh. To let you quickly iterate on your Lightning web components (LWCs) and pages, your app preview automatically
|
|
140
|
+
refreshes when Local Dev detects source code changes.
|
|
141
|
+
|
|
142
|
+
When you edit these local files with Local Dev enabled, your org automatically reflects these changes.
|
|
143
|
+
|
|
144
|
+
- Basic HTML and CSS edits to LWCs
|
|
145
|
+
- JavaScript changes to LWCs that don't affect the component's public API
|
|
146
|
+
- Importing new custom LWCs
|
|
147
|
+
- Importing another instance of an existing LWC
|
|
148
|
+
|
|
149
|
+
To apply any other local changes not listed above, you must deploy them to your org using the `sf project deploy
|
|
150
|
+
start` command.
|
|
151
|
+
|
|
152
|
+
When you make changes directly in your org (like saving new component properties), they're automatically deployed to
|
|
153
|
+
your live app. To update your local version of the app with those changes, you must retrieve them from your org using
|
|
154
|
+
the `sf project retrieve start` command.
|
|
155
|
+
|
|
156
|
+
To learn more about Local Dev enablement, considerations, and limitations, see the Lightning Web Components Developer
|
|
157
|
+
Guide.
|
|
158
|
+
|
|
159
|
+
EXAMPLES
|
|
160
|
+
Preview the default app for the target org "myOrg" in a desktop environment:
|
|
161
|
+
|
|
162
|
+
$ sf lightning dev app --target-org myOrg
|
|
163
|
+
|
|
164
|
+
Preview the app "myApp" for the target org "myOrg" in a desktop environment:
|
|
165
|
+
|
|
166
|
+
$ sf lightning dev app --name MyApp --target-org myOrg --device-type desktop
|
|
167
|
+
|
|
168
|
+
Preview the default app for target org "myOrg" on an iOS device:
|
|
169
|
+
|
|
170
|
+
$ sf lightning dev app --target-org myOrg --device-type ios --device-id "iPhone 15 Pro Max"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
_See code: [src/commands/lightning/dev/app.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/0.1.0-alpha.0/src/commands/lightning/dev/app.ts)_
|
|
174
|
+
|
|
175
|
+
## `sf lightning dev site`
|
|
176
|
+
|
|
177
|
+
Preview an Experience Builder site locally and in real-time, without deploying it.
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
USAGE
|
|
181
|
+
$ sf lightning dev site [--json] [--flags-dir <value>] [-n <value>] [--debug] [-o <value>]
|
|
182
|
+
|
|
183
|
+
FLAGS
|
|
184
|
+
-n, --name=<value> Name of the Experience Builder site to preview. It has to match a site name from the current
|
|
185
|
+
org.
|
|
186
|
+
-o, --target-org=<value> Username or alias of the target org. Not required if the `target-org` configuration variable
|
|
187
|
+
is already set.
|
|
188
|
+
--debug Enable Node Inspector to debug server-side rendering.
|
|
189
|
+
|
|
190
|
+
GLOBAL FLAGS
|
|
191
|
+
--flags-dir=<value> Import flag values from a directory.
|
|
192
|
+
--json Format output as json.
|
|
193
|
+
|
|
194
|
+
DESCRIPTION
|
|
195
|
+
Preview an Experience Builder site locally and in real-time, without deploying it.
|
|
196
|
+
|
|
197
|
+
Enable Local Dev to see local changes to your site in a real-time preview that you don't have to deploy or manually
|
|
198
|
+
refresh. To let you quickly iterate on your Lightning web components (LWCs) and pages, your site preview automatically
|
|
199
|
+
refreshes when Local Dev detects source code changes.
|
|
200
|
+
|
|
201
|
+
When you edit these local files with Local Dev enabled, your org automatically reflects these changes.
|
|
202
|
+
|
|
203
|
+
- Basic HTML and CSS edits to LWCs
|
|
204
|
+
- JavaScript changes to LWCs that don't affect the component's public API
|
|
205
|
+
- Importing new custom LWCs
|
|
206
|
+
- Importing another instance of an existing LWC
|
|
207
|
+
|
|
208
|
+
To apply any other local changes not listed above, you must deploy them to your org using the `sf project deploy
|
|
209
|
+
start` command. Then republish your site and restart the server for the Local Dev experience.
|
|
210
|
+
|
|
211
|
+
For more considerations and limitations, see the Lightning Web Components Developer Guide.
|
|
212
|
+
|
|
213
|
+
EXAMPLES
|
|
214
|
+
Preview the site "Partner Central" from the org "myOrg":
|
|
215
|
+
|
|
216
|
+
$ sf lightning dev site --name "Partner Central" --target-org myOrg
|
|
217
|
+
|
|
218
|
+
Preview the site "Partner Central" from the org "myOrg" with Node Inspector enabled:
|
|
219
|
+
|
|
220
|
+
$ sf lightning dev site --name "Partner Central" --target-org myOrg --debug
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
_See code: [src/commands/lightning/dev/site.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/0.1.0-alpha.0/src/commands/lightning/dev/site.ts)_
|
|
224
|
+
|
|
225
|
+
<!-- commandsstop -->
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AndroidAppPreviewConfig, AndroidVirtualDevice, IOSAppPreviewConfig, IOSSimulatorDevice, Platform } from '@salesforce/lwc-dev-mobile-core';
|
|
2
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
3
|
+
export declare const iOSSalesforceAppPreviewConfig: IOSAppPreviewConfig;
|
|
4
|
+
export declare const androidSalesforceAppPreviewConfig: AndroidAppPreviewConfig;
|
|
5
|
+
export default class LightningDevApp extends SfCommand<void> {
|
|
6
|
+
static readonly summary: string;
|
|
7
|
+
static readonly description: string;
|
|
8
|
+
static readonly examples: string[];
|
|
9
|
+
static readonly flags: {
|
|
10
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'device-type': import("@oclif/core/interfaces").OptionFlag<Platform, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'device-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
private static waitForKeyPress;
|
|
16
|
+
waitForUserToInstallCert(platform: Platform.ios | Platform.android, device: IOSSimulatorDevice | AndroidVirtualDevice, certFilePath: string): Promise<void>;
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
private desktopPreview;
|
|
19
|
+
private mobilePreview;
|
|
20
|
+
/**
|
|
21
|
+
* In order to preview on mobile, the user's environment should meet certain requirements
|
|
22
|
+
* (such as having the right mobile tooling installed). This method verifies that these
|
|
23
|
+
* requirements are met.
|
|
24
|
+
*
|
|
25
|
+
* @param platform A mobile platform (iOS or Android)
|
|
26
|
+
* @param logger An optional logger to be used for logging
|
|
27
|
+
*/
|
|
28
|
+
private verifyMobileRequirements;
|
|
29
|
+
}
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024, salesforce.com, inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import * as readline from 'node:readline';
|
|
9
|
+
import { Logger, Messages, SfProject } from '@salesforce/core';
|
|
10
|
+
import { Setup as LwcDevMobileCoreSetup, Platform, } from '@salesforce/lwc-dev-mobile-core';
|
|
11
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
12
|
+
import chalk from 'chalk';
|
|
13
|
+
import { OrgUtils } from '../../../shared/orgUtils.js';
|
|
14
|
+
import { startLWCServer } from '../../../lwc-dev-server/index.js';
|
|
15
|
+
import { PreviewUtils } from '../../../shared/previewUtils.js';
|
|
16
|
+
import { ConfigUtils } from '../../../shared/configUtils.js';
|
|
17
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
18
|
+
const messages = Messages.loadMessages('@salesforce/plugin-lightning-dev', 'lightning.dev.app');
|
|
19
|
+
export const iOSSalesforceAppPreviewConfig = {
|
|
20
|
+
name: 'Salesforce Mobile App',
|
|
21
|
+
id: 'com.salesforce.chatter',
|
|
22
|
+
};
|
|
23
|
+
export const androidSalesforceAppPreviewConfig = {
|
|
24
|
+
name: 'Salesforce Mobile App',
|
|
25
|
+
id: 'com.salesforce.chatter',
|
|
26
|
+
activity: 'com.salesforce.chatter.Chatter',
|
|
27
|
+
};
|
|
28
|
+
const maxInt32 = 2_147_483_647; // maximum 32-bit signed integer value
|
|
29
|
+
class AppServerIdentityTokenService {
|
|
30
|
+
connection;
|
|
31
|
+
constructor(connection) {
|
|
32
|
+
this.connection = connection;
|
|
33
|
+
}
|
|
34
|
+
async saveTokenToServer(token) {
|
|
35
|
+
const sobject = this.connection.sobject('UserLocalWebServerIdentity');
|
|
36
|
+
const result = await sobject.insert({ LocalWebServerIdentityToken: token });
|
|
37
|
+
if (result.success) {
|
|
38
|
+
return result.id;
|
|
39
|
+
}
|
|
40
|
+
throw new Error('Could not save the token to the server');
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export default class LightningDevApp extends SfCommand {
|
|
44
|
+
static summary = messages.getMessage('summary');
|
|
45
|
+
static description = messages.getMessage('description');
|
|
46
|
+
static examples = messages.getMessages('examples');
|
|
47
|
+
static flags = {
|
|
48
|
+
name: Flags.string({
|
|
49
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
50
|
+
char: 'n',
|
|
51
|
+
}),
|
|
52
|
+
'target-org': Flags.requiredOrg({
|
|
53
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
54
|
+
}),
|
|
55
|
+
'device-type': Flags.option({
|
|
56
|
+
summary: messages.getMessage('flags.device-type.summary'),
|
|
57
|
+
char: 't',
|
|
58
|
+
options: [Platform.desktop, Platform.ios, Platform.android],
|
|
59
|
+
default: Platform.desktop,
|
|
60
|
+
})(),
|
|
61
|
+
'device-id': Flags.string({
|
|
62
|
+
summary: messages.getMessage('flags.device-id.summary'),
|
|
63
|
+
char: 'i',
|
|
64
|
+
}),
|
|
65
|
+
};
|
|
66
|
+
static async waitForKeyPress() {
|
|
67
|
+
return new Promise((resolve) => {
|
|
68
|
+
const rl = readline.createInterface({
|
|
69
|
+
input: process.stdin,
|
|
70
|
+
output: process.stdout,
|
|
71
|
+
});
|
|
72
|
+
// eslint-disable-next-line no-console
|
|
73
|
+
console.log(`\n${messages.getMessage('certificate.waiting')}\n`);
|
|
74
|
+
process.stdin.setRawMode(true);
|
|
75
|
+
process.stdin.resume();
|
|
76
|
+
process.stdin.once('data', () => {
|
|
77
|
+
process.stdin.setRawMode(false);
|
|
78
|
+
process.stdin.pause();
|
|
79
|
+
rl.close();
|
|
80
|
+
resolve();
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
async waitForUserToInstallCert(platform, device, certFilePath) {
|
|
85
|
+
// eslint-disable-next-line no-console
|
|
86
|
+
console.log(`\n${messages.getMessage('certificate.installation.notice')}`);
|
|
87
|
+
const skipInstall = await this.confirm({
|
|
88
|
+
message: messages.getMessage('certificate.installation.skip.message'),
|
|
89
|
+
defaultAnswer: true,
|
|
90
|
+
ms: maxInt32, // simulate no timeout and wait for user to answer
|
|
91
|
+
});
|
|
92
|
+
if (skipInstall) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
let installationSteps = '';
|
|
96
|
+
if (platform === Platform.ios) {
|
|
97
|
+
installationSteps = messages.getMessage('certificate.installation.steps.ios');
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
const apiLevel = device.apiLevel.toString();
|
|
101
|
+
let subStepMessageKey = '';
|
|
102
|
+
if (apiLevel.startsWith('24.') || apiLevel.startsWith('25.')) {
|
|
103
|
+
subStepMessageKey = 'certificate.installation.steps.android.nav-target-api-24-25';
|
|
104
|
+
}
|
|
105
|
+
else if (apiLevel.startsWith('26.') || apiLevel.startsWith('27.')) {
|
|
106
|
+
subStepMessageKey = 'certificate.installation.steps.android.nav-target-api-26-27';
|
|
107
|
+
}
|
|
108
|
+
else if (apiLevel.startsWith('28.')) {
|
|
109
|
+
subStepMessageKey = 'certificate.installation.steps.android.nav-target-api-28';
|
|
110
|
+
}
|
|
111
|
+
else if (apiLevel.startsWith('29.')) {
|
|
112
|
+
subStepMessageKey = 'certificate.installation.steps.android.nav-target-api-29';
|
|
113
|
+
}
|
|
114
|
+
else if (apiLevel.startsWith('30.') || apiLevel.startsWith('31.') || apiLevel.startsWith('32.')) {
|
|
115
|
+
subStepMessageKey = 'certificate.installation.steps.android.nav-target-api-30-32';
|
|
116
|
+
}
|
|
117
|
+
else if (apiLevel.startsWith('33.')) {
|
|
118
|
+
subStepMessageKey = 'certificate.installation.steps.android.nav-target-api-33';
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
subStepMessageKey = 'certificate.installation.steps.android.nav-target-api-34-up';
|
|
122
|
+
}
|
|
123
|
+
installationSteps = messages.getMessage('certificate.installation.steps.android', [
|
|
124
|
+
messages.getMessage(subStepMessageKey),
|
|
125
|
+
]);
|
|
126
|
+
}
|
|
127
|
+
let message = messages.getMessage('certificate.installation.description', [certFilePath, installationSteps]);
|
|
128
|
+
// use chalk to format every substring wrapped in `` so they would stand out when printed on screen
|
|
129
|
+
message = message.replace(/`([^`]*)`/g, chalk.yellow('$1'));
|
|
130
|
+
// eslint-disable-next-line no-console
|
|
131
|
+
console.log(message);
|
|
132
|
+
return LightningDevApp.waitForKeyPress();
|
|
133
|
+
}
|
|
134
|
+
async run() {
|
|
135
|
+
const { flags } = await this.parse(LightningDevApp);
|
|
136
|
+
const logger = await Logger.child(this.ctor.name);
|
|
137
|
+
const appName = flags['name'];
|
|
138
|
+
const platform = flags['device-type'];
|
|
139
|
+
const targetOrg = flags['target-org'];
|
|
140
|
+
const deviceId = flags['device-id'];
|
|
141
|
+
let sfdxProjectRootPath = '';
|
|
142
|
+
try {
|
|
143
|
+
sfdxProjectRootPath = await SfProject.resolveProjectPath();
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
return Promise.reject(new Error(messages.getMessage('error.no-project', [error?.message ?? ''])));
|
|
147
|
+
}
|
|
148
|
+
logger.debug('Configuring local web server identity');
|
|
149
|
+
const connection = targetOrg.getConnection(undefined);
|
|
150
|
+
const username = connection.getUsername();
|
|
151
|
+
if (!username) {
|
|
152
|
+
return Promise.reject(new Error(messages.getMessage('error.username')));
|
|
153
|
+
}
|
|
154
|
+
const tokenService = new AppServerIdentityTokenService(connection);
|
|
155
|
+
const token = await ConfigUtils.getOrCreateIdentityToken(username, tokenService);
|
|
156
|
+
let appId;
|
|
157
|
+
if (appName) {
|
|
158
|
+
logger.debug(`Determining App Id for ${appName}`);
|
|
159
|
+
// The appName is optional but if the user did provide an appName then it must be
|
|
160
|
+
// a valid one.... meaning that it should resolve to a valid appId.
|
|
161
|
+
appId = await OrgUtils.getAppId(connection, appName);
|
|
162
|
+
if (!appId) {
|
|
163
|
+
return Promise.reject(new Error(messages.getMessage('error.fetching.app-id', [appName])));
|
|
164
|
+
}
|
|
165
|
+
logger.debug(`App Id is ${appId}`);
|
|
166
|
+
}
|
|
167
|
+
logger.debug('Determining the next available port for Local Dev Server');
|
|
168
|
+
const serverPorts = await PreviewUtils.getNextAvailablePorts();
|
|
169
|
+
logger.debug(`Next available ports are http=${serverPorts.httpPort} , https=${serverPorts.httpsPort}`);
|
|
170
|
+
logger.debug('Determining Local Dev Server url');
|
|
171
|
+
const ldpServerUrl = PreviewUtils.generateWebSocketUrlForLocalDevServer(platform, serverPorts, logger);
|
|
172
|
+
logger.debug(`Local Dev Server url is ${ldpServerUrl}`);
|
|
173
|
+
const entityId = await PreviewUtils.getEntityId(username);
|
|
174
|
+
if (platform === Platform.desktop) {
|
|
175
|
+
await this.desktopPreview(sfdxProjectRootPath, serverPorts, token, entityId, ldpServerUrl, appId, logger);
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
await this.mobilePreview(platform, sfdxProjectRootPath, serverPorts, token, entityId, ldpServerUrl, appName, appId, deviceId, logger);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async desktopPreview(sfdxProjectRootPath, serverPorts, token, entityId, ldpServerUrl, appId, logger) {
|
|
182
|
+
if (!appId) {
|
|
183
|
+
logger.debug('No Lightning Experience application name provided.... using the default app instead.');
|
|
184
|
+
}
|
|
185
|
+
// There are various ways to pass in a target org (as an alias, as a username, etc).
|
|
186
|
+
// We could have LightningPreviewApp parse its --target-org flag which will be resolved
|
|
187
|
+
// to an Org object (see https://github.com/forcedotcom/sfdx-core/blob/main/src/org/org.ts)
|
|
188
|
+
// then write a bunch of code to look at this Org object to try to determine whether
|
|
189
|
+
// it was initialized using Alias, Username, etc. and get a string representation of the
|
|
190
|
+
// org to be forwarded to OrgOpenCommand.
|
|
191
|
+
//
|
|
192
|
+
// Or we could simply look at the raw arguments passed to the LightningPreviewApp command,
|
|
193
|
+
// find the raw value for --target-org flag and forward that raw value to OrgOpenCommand.
|
|
194
|
+
// The OrgOpenCommand will then parse the raw value automatically. If the value is
|
|
195
|
+
// valid then OrgOpenCommand will consume it and continue. And if the value is invalid then
|
|
196
|
+
// OrgOpenCommand simply throws an error which will get bubbled up to LightningPreviewApp.
|
|
197
|
+
//
|
|
198
|
+
// Here we've chosen the second approach
|
|
199
|
+
const idx = this.argv.findIndex((item) => item.toLowerCase() === '-o' || item.toLowerCase() === '--target-org');
|
|
200
|
+
let targetOrg;
|
|
201
|
+
if (idx >= 0 && idx < this.argv.length - 1) {
|
|
202
|
+
targetOrg = this.argv[idx + 1];
|
|
203
|
+
}
|
|
204
|
+
if (ldpServerUrl.startsWith('wss')) {
|
|
205
|
+
this.log(`\n${messages.getMessage('trust.local.dev.server')}`);
|
|
206
|
+
}
|
|
207
|
+
const launchArguments = PreviewUtils.generateDesktopPreviewLaunchArguments(ldpServerUrl, entityId, appId, targetOrg);
|
|
208
|
+
// Start the LWC Dev Server
|
|
209
|
+
await startLWCServer(logger, sfdxProjectRootPath, token, serverPorts);
|
|
210
|
+
// Open the browser and navigate to the right page
|
|
211
|
+
await this.config.runCommand('org:open', launchArguments);
|
|
212
|
+
}
|
|
213
|
+
async mobilePreview(platform, sfdxProjectRootPath, serverPorts, token, entityId, ldpServerUrl, appName, appId, deviceId, logger) {
|
|
214
|
+
try {
|
|
215
|
+
// Verify that user environment is set up for mobile (i.e. has right tooling)
|
|
216
|
+
await this.verifyMobileRequirements(platform, logger);
|
|
217
|
+
// Fetch the target device
|
|
218
|
+
const device = await PreviewUtils.getMobileDevice(platform, deviceId, logger);
|
|
219
|
+
if (!device) {
|
|
220
|
+
throw new Error(messages.getMessage('error.device.notfound', [deviceId ?? '']));
|
|
221
|
+
}
|
|
222
|
+
// Boot the device if not already booted
|
|
223
|
+
this.spinner.start(messages.getMessage('spinner.device.boot', [device.toString()]));
|
|
224
|
+
const resolvedDeviceId = platform === Platform.ios ? device.udid : device.name;
|
|
225
|
+
const emulatorPort = await PreviewUtils.bootMobileDevice(platform, resolvedDeviceId, logger);
|
|
226
|
+
this.spinner.stop();
|
|
227
|
+
// Configure certificates for dev server secure connection
|
|
228
|
+
this.spinner.start(messages.getMessage('spinner.cert.gen'));
|
|
229
|
+
const { certData, certFilePath } = await PreviewUtils.generateSelfSignedCert(platform, sfdxProjectRootPath);
|
|
230
|
+
this.spinner.stop();
|
|
231
|
+
// Show message and wait for user to install the certificate on their device
|
|
232
|
+
await this.waitForUserToInstallCert(platform, device, certFilePath);
|
|
233
|
+
// Check if Salesforce Mobile App is installed on the device
|
|
234
|
+
const appConfig = platform === Platform.ios ? iOSSalesforceAppPreviewConfig : androidSalesforceAppPreviewConfig;
|
|
235
|
+
const appInstalled = await PreviewUtils.verifyMobileAppInstalled(platform, appConfig, resolvedDeviceId, emulatorPort, logger);
|
|
236
|
+
// If Salesforce Mobile App is not installed, download and install it
|
|
237
|
+
let bundlePath;
|
|
238
|
+
if (!appInstalled) {
|
|
239
|
+
const proceedWithDownload = await this.confirm({
|
|
240
|
+
message: messages.getMessage('mobileapp.download', [appConfig.name]),
|
|
241
|
+
defaultAnswer: false,
|
|
242
|
+
ms: maxInt32, // simulate no timeout and wait for user to answer
|
|
243
|
+
});
|
|
244
|
+
if (!proceedWithDownload) {
|
|
245
|
+
throw new Error(messages.getMessage('mobileapp.notfound', [appConfig.name]));
|
|
246
|
+
}
|
|
247
|
+
// downloadSalesforceMobileAppBundle() will show a progress bar
|
|
248
|
+
bundlePath = await PreviewUtils.downloadSalesforceMobileAppBundle(platform, logger, this.spinner, this.progress);
|
|
249
|
+
// on iOS the bundle comes as a ZIP archive so we need to extract it first
|
|
250
|
+
if (platform === Platform.ios) {
|
|
251
|
+
this.spinner.start(messages.getMessage('spinner.extract.archive'));
|
|
252
|
+
const outputDir = path.dirname(bundlePath);
|
|
253
|
+
const finalBundlePath = path.join(outputDir, 'Chatter.app');
|
|
254
|
+
await PreviewUtils.extractZIPArchive(bundlePath, outputDir, logger);
|
|
255
|
+
this.spinner.stop();
|
|
256
|
+
bundlePath = finalBundlePath;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
// Start the LWC Dev Server
|
|
260
|
+
await startLWCServer(logger, sfdxProjectRootPath, token, serverPorts, certData);
|
|
261
|
+
// Launch the native app for previewing (launchMobileApp will show its own spinner)
|
|
262
|
+
// eslint-disable-next-line camelcase
|
|
263
|
+
appConfig.launch_arguments = PreviewUtils.generateMobileAppPreviewLaunchArguments(ldpServerUrl, entityId, appName, appId);
|
|
264
|
+
await PreviewUtils.launchMobileApp(platform, appConfig, resolvedDeviceId, emulatorPort, bundlePath, logger);
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
// stop progress & spinner UX (that may still be running in case of an error)
|
|
268
|
+
this.progress.stop();
|
|
269
|
+
this.spinner.stop();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* In order to preview on mobile, the user's environment should meet certain requirements
|
|
274
|
+
* (such as having the right mobile tooling installed). This method verifies that these
|
|
275
|
+
* requirements are met.
|
|
276
|
+
*
|
|
277
|
+
* @param platform A mobile platform (iOS or Android)
|
|
278
|
+
* @param logger An optional logger to be used for logging
|
|
279
|
+
*/
|
|
280
|
+
async verifyMobileRequirements(platform, logger) {
|
|
281
|
+
logger.debug(`Verifying environment meets requirements for previewing on ${platform}`);
|
|
282
|
+
const setupCommand = new LwcDevMobileCoreSetup(['-p', platform], this.config);
|
|
283
|
+
await setupCommand.init();
|
|
284
|
+
await setupCommand.run();
|
|
285
|
+
logger.debug('Requirements are met'); // if we make it here then all is good
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
//# sourceMappingURL=app.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../../../../src/commands/light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BAAgB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;QAC9G,CAAC;gBAAS,CAAC;YACT,6EAA6E;YAC7E,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACrB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACtB,CAAC;IACH,CAAC;IAED;;;;;;;OAOG;IACK,KAAK,CAAC,wBAAwB,CAAC,QAAyC,EAAE,MAAc;QAC9F,MAAM,CAAC,KAAK,CAAC,8DAA8D,QAAQ,EAAE,CAAC,CAAC;QAEvF,MAAM,YAAY,GAAG,IAAI,qBAAqB,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9E,MAAM,YAAY,CAAC,IAAI,EAAE,CAAC;QAC1B,MAAM,YAAY,CAAC,GAAG,EAAE,CAAC;QAEzB,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,sCAAsC;IAC9E,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export default class LightningDevSite extends SfCommand<void> {
|
|
3
|
+
static readonly summary: string;
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
debug: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|