Skip to content

feat: update org command name -> app #36

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

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"alias": [],
"command": "lightning:preview:org",
"command": "lightning:preview:app",
"flagAliases": [],
"flagChars": ["n"],
"flags": ["flags-dir", "json", "name"],
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion messages/lightning.preview.component.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<LightningPreviewOrgResult> {
export default class LightningPreviewApp extends SfCommand<LightningPreviewAppResult> {
public static readonly summary = messages.getMessage('summary');
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
Expand All @@ -29,8 +29,8 @@ export default class LightningPreviewOrg extends SfCommand<LightningPreviewOrgRe
}),
};

public async run(): Promise<LightningPreviewOrgResult> {
const { flags } = await this.parse(LightningPreviewOrg);
public async run(): Promise<LightningPreviewAppResult> {
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`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)
Expand All @@ -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)
Expand Down
Loading