@salesforce/plugin-lightning-dev 3.1.1 → 3.2.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/README.md CHANGED
@@ -140,6 +140,7 @@ yarn update-snapshots
140
140
  <!-- commands -->
141
141
 
142
142
  - [`sf lightning dev app`](#sf-lightning-dev-app)
143
+ - [`sf lightning dev component`](#sf-lightning-dev-component)
143
144
  - [`sf lightning dev site`](#sf-lightning-dev-site)
144
145
 
145
146
  ## `sf lightning dev app`
@@ -200,7 +201,41 @@ EXAMPLES
200
201
  $ sf lightning dev app --target-org myOrg --device-type ios --device-id "iPhone 15 Pro Max"
201
202
  ```
202
203
 
203
- _See code: [src/commands/lightning/dev/app.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/3.1.1/src/commands/lightning/dev/app.ts)_
204
+ _See code: [src/commands/lightning/dev/app.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/3.2.0/src/commands/lightning/dev/app.ts)_
205
+
206
+ ## `sf lightning dev component`
207
+
208
+ Preview LWC components in isolation.
209
+
210
+ ```
211
+ USAGE
212
+ $ sf lightning dev component -o <value> [--json] [--flags-dir <value>] [-n <value>]
213
+
214
+ FLAGS
215
+ -n, --name=<value> Description of a flag.
216
+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
217
+ configuration variable is already set.
218
+
219
+ GLOBAL FLAGS
220
+ --flags-dir=<value> Import flag values from a directory.
221
+ --json Format output as json.
222
+
223
+ DESCRIPTION
224
+ Preview LWC components in isolation.
225
+
226
+ Preview LWC components in isolation. Replacement for:
227
+ https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/lwclocaldev.html
228
+
229
+ EXAMPLES
230
+ $ sf lightning dev component
231
+
232
+ FLAG DESCRIPTIONS
233
+ -n, --name=<value> Description of a flag.
234
+
235
+ More information about a flag. Don't repeat the summary.
236
+ ```
237
+
238
+ _See code: [src/commands/lightning/dev/component.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/3.2.0/src/commands/lightning/dev/component.ts)_
204
239
 
205
240
  ## `sf lightning dev site`
206
241
 
@@ -254,6 +289,6 @@ EXAMPLES
254
289
  $ sf lightning dev site --name "Partner Central" --target-org myOrg --get-latest
255
290
  ```
256
291
 
257
- _See code: [src/commands/lightning/dev/site.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/3.1.1/src/commands/lightning/dev/site.ts)_
292
+ _See code: [src/commands/lightning/dev/site.ts](https://github.com/salesforcecli/plugin-lightning-dev/blob/3.2.0/src/commands/lightning/dev/site.ts)_
258
293
 
259
294
  <!-- commandsstop -->
@@ -0,0 +1,14 @@
1
+ import { SfCommand } from '@salesforce/sf-plugins-core';
2
+ export type LightningDevComponentResult = {
3
+ path: string;
4
+ };
5
+ export default class LightningDevComponent extends SfCommand<LightningDevComponentResult> {
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
+ };
13
+ run(): Promise<LightningDevComponentResult>;
14
+ }
@@ -0,0 +1,41 @@
1
+ /*
2
+ * Copyright (c) 2023, 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 { SfCommand, Flags } from '@salesforce/sf-plugins-core';
8
+ import { Messages } from '@salesforce/core';
9
+ import { cmpDev } from '@lwrjs/api';
10
+ Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
11
+ const messages = Messages.loadMessages('@salesforce/plugin-lightning-dev', 'lightning.dev.component');
12
+ export default class LightningDevComponent extends SfCommand {
13
+ static summary = messages.getMessage('summary');
14
+ static description = messages.getMessage('description');
15
+ static examples = messages.getMessages('examples');
16
+ static flags = {
17
+ name: Flags.string({
18
+ summary: messages.getMessage('flags.name.summary'),
19
+ description: messages.getMessage('flags.name.description'),
20
+ char: 'n',
21
+ required: false,
22
+ }),
23
+ // TODO should this be required or optional?
24
+ // We don't technically need this if your components are simple / don't need any data from your org
25
+ 'target-org': Flags.requiredOrg(),
26
+ };
27
+ async run() {
28
+ const { flags } = await this.parse(LightningDevComponent);
29
+ const name = flags.name ?? 'world';
30
+ this.log(`preview component: ${name}`);
31
+ // TODO implement me
32
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
33
+ await cmpDev({
34
+ componentName: name,
35
+ });
36
+ return {
37
+ path: '',
38
+ };
39
+ }
40
+ }
41
+ //# sourceMappingURL=component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/commands/lightning/dev/component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,kCAAkC,EAAE,yBAAyB,CAAC,CAAC;AAMtG,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,SAAsC;IAChF,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,CAAU,WAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;IACjE,MAAM,CAAU,QAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAE5D,MAAM,CAAU,KAAK,GAAG;QAC7B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;YAClD,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;YAC1D,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,4CAA4C;QAC5C,mGAAmG;QACnG,YAAY,EAAE,KAAK,CAAC,WAAW,EAAE;KAClC,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAE1D,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;QAEvC,oBAAoB;QACpB,6DAA6D;QAC7D,MAAM,MAAM,CAAC;YACX,aAAa,EAAE,IAAI;SACpB,CAAC,CAAC;QAEH,OAAO;YACL,IAAI,EAAE,EAAE;SACT,CAAC;IACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ # summary
2
+
3
+ Preview LWC components in isolation.
4
+
5
+ # description
6
+
7
+ Preview LWC components in isolation. Replacement for: https://developer.salesforce.com/docs/platform/sfvscode-extensions/guide/lwclocaldev.html
8
+
9
+ # flags.name.summary
10
+
11
+ Description of a flag.
12
+
13
+ # flags.name.description
14
+
15
+ More information about a flag. Don't repeat the summary.
16
+
17
+ # examples
18
+
19
+ - <%= config.bin %> <%= command.id %>