diff --git a/command-snapshot.json b/command-snapshot.json index 73d0b2bc..e8f5101b 100644 --- a/command-snapshot.json +++ b/command-snapshot.json @@ -9,7 +9,7 @@ }, { "alias": [], - "command": "lightning:preview:org", + "command": "lightning:preview:app", "flagAliases": [], "flagChars": ["n"], "flags": ["flags-dir", "json", "name"], diff --git a/messages/lightning.preview.org.md b/messages/lightning.preview.app.md similarity index 100% rename from messages/lightning.preview.org.md rename to messages/lightning.preview.app.md diff --git a/messages/lightning.preview.component.md b/messages/lightning.preview.component.md index 8b16fd84..d2362900 100644 --- a/messages/lightning.preview.component.md +++ b/messages/lightning.preview.component.md @@ -4,7 +4,7 @@ Preview LWC component in insolation. # description -Preview components, org, and sites. If no topic is specified, the default action is to preview the org. +Preview components, apps, and sites. If no topic is specified, the default action is to preview the org. In dev preview mode, you can edit local files and see these changes to your Lightning Web Components (LWC) within your {org name} org: diff --git a/schemas/lightning-preview-org.json b/schemas/lightning-preview-app.json similarity index 74% rename from schemas/lightning-preview-org.json rename to schemas/lightning-preview-app.json index 8b95ac0c..d86e83a3 100644 --- a/schemas/lightning-preview-org.json +++ b/schemas/lightning-preview-app.json @@ -1,8 +1,8 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$ref": "#/definitions/LightningPreviewOrgResult", + "$ref": "#/definitions/LightningPreviewAppResult", "definitions": { - "LightningPreviewOrgResult": { + "LightningPreviewAppResult": { "type": "object", "properties": { "path": { diff --git a/src/commands/lightning/preview/org.ts b/src/commands/lightning/preview/app.ts similarity index 80% rename from src/commands/lightning/preview/org.ts rename to src/commands/lightning/preview/app.ts index 4ee33ad1..b634f98e 100644 --- a/src/commands/lightning/preview/org.ts +++ b/src/commands/lightning/preview/app.ts @@ -9,13 +9,13 @@ import { SfCommand, Flags } from '@salesforce/sf-plugins-core'; import { Messages } from '@salesforce/core'; Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); -const messages = Messages.loadMessages('@salesforce/plugin-lightning-dev', 'lightning.preview.org'); +const messages = Messages.loadMessages('@salesforce/plugin-lightning-dev', 'lightning.preview.app'); -export type LightningPreviewOrgResult = { +export type LightningPreviewAppResult = { path: string; }; -export default class LightningPreviewOrg extends SfCommand { +export default class LightningPreviewApp extends SfCommand { public static readonly summary = messages.getMessage('summary'); public static readonly description = messages.getMessage('description'); public static readonly examples = messages.getMessages('examples'); @@ -29,8 +29,8 @@ export default class LightningPreviewOrg extends SfCommand { - const { flags } = await this.parse(LightningPreviewOrg); + public async run(): Promise { + const { flags } = await this.parse(LightningPreviewApp); const name = flags.name ?? 'world'; this.log(`hello ${name} from /Users/nkruk/git/plugin-lightning-dev/src/commands/lightning/preview/org.ts`); diff --git a/test/commands/lightning/preview/org.nut.ts b/test/commands/lightning/preview/app.nut.ts similarity index 100% rename from test/commands/lightning/preview/org.nut.ts rename to test/commands/lightning/preview/app.nut.ts diff --git a/test/commands/lightning/preview/org.test.ts b/test/commands/lightning/preview/app.test.ts similarity index 84% rename from test/commands/lightning/preview/org.test.ts rename to test/commands/lightning/preview/app.test.ts index 8000adf4..4c338006 100644 --- a/test/commands/lightning/preview/org.test.ts +++ b/test/commands/lightning/preview/app.test.ts @@ -7,7 +7,7 @@ import { TestContext } from '@salesforce/core/testSetup'; import { expect } from 'chai'; import { stubSfCommandUx } from '@salesforce/sf-plugins-core'; -import LightningPreviewOrg from '../../../../src/commands/lightning/preview/org.js'; +import LightningPreviewApp from '../../../../src/commands/lightning/preview/app.js'; describe('lightning preview org', () => { const $$ = new TestContext(); @@ -22,7 +22,7 @@ describe('lightning preview org', () => { }); it('runs hello', async () => { - await LightningPreviewOrg.run([]); + await LightningPreviewApp.run([]); const output = sfCommandStubs.log .getCalls() .flatMap((c) => c.args) @@ -31,12 +31,12 @@ describe('lightning preview org', () => { }); it('runs hello with --json and no provided name', async () => { - const result = await LightningPreviewOrg.run([]); + const result = await LightningPreviewApp.run([]); expect(result.path).to.equal('/Users/nkruk/git/plugin-lightning-dev/src/commands/lightning/preview/org.ts'); }); it('runs hello world --name Astro', async () => { - await LightningPreviewOrg.run(['--name', 'Astro']); + await LightningPreviewApp.run(['--name', 'Astro']); const output = sfCommandStubs.log .getCalls() .flatMap((c) => c.args)