Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
68bab95
feat: implement webapp commands for One Runtime Apps with Agentforce …
lesya7 Nov 4, 2025
1f51195
docs: use generic context instead of Agentforce Vibes references
lesya7 Nov 4, 2025
3912930
fix: change deploy options from 'value' to 'validate'
lesya7 Nov 5, 2025
c966040
feat: add webapp version create command with optional version flag
lesya7 Nov 5, 2025
c2a536e
feat: add --no-overwrite and --ignore flags to webapp retrieve command
lesya7 Nov 5, 2025
94b85a6
feat: update webapp dev command with target, root-dir, host, and no-o…
lesya7 Nov 5, 2025
dc18bf4
docs: simplify webapp generate description
lesya7 Nov 5, 2025
c995404
docs: simplify webapp deploy description
lesya7 Nov 5, 2025
4ec88a7
docs: update webapp deploy description to avoid duplication
lesya7 Nov 5, 2025
4df6aeb
docs: revert webapp deploy description to match summary
lesya7 Nov 5, 2025
e11684c
docs: simplify webapp dev name flag description
lesya7 Nov 5, 2025
1996678
docs: simplify webapp dev description
lesya7 Nov 5, 2025
87997f2
docs: add detailed description and validate example for webapp deploy
lesya7 Nov 5, 2025
a2a695c
docs: refine webapp deploy description wording
lesya7 Nov 5, 2025
fa5d8e2
docs: add detailed description for webapp generate
lesya7 Nov 5, 2025
3c3fa0d
docs: simplify webapp generate description
lesya7 Nov 5, 2025
c678dae
docs: add .ignore file explanation to webapp retrieve
lesya7 Nov 5, 2025
e9e9fda
revert: remove .ignore file documentation from webapp retrieve
lesya7 Nov 5, 2025
1906135
docs: add comprehensive command reference documentation
lesya7 Nov 6, 2025
48eea53
docs: align command documentation with spec requirements
lesya7 Nov 6, 2025
8db649a
docs: add proper description for webapp version topic
lesya7 Nov 6, 2025
8a768d6
refactor: remove webapp version create command
lesya7 Nov 6, 2025
08eabe3
refactor: update webapp commands - simplify generate and dev
lesya7 Nov 20, 2025
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
83 changes: 83 additions & 0 deletions COMMANDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Commands

<!-- commands -->

- [`sf webapp dev`](#sf-webapp-dev)
- [`sf webapp generate`](#sf-webapp-generate)

## `sf webapp dev`

Preview a web app locally without needing to deploy

```
USAGE
$ sf webapp dev -n <value> [--json] [--flags-dir <value>] [-t <value>] [-p <value>]

FLAGS
-n, --name=<value> (required) Identifies the Web Application
-p, --port=<value> [default: 5173] Port for the dev server
-t, --target=<value> Selects which Web Application target to use for the preview (e.g., Lightning App, Site)

GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.

DESCRIPTION
Preview a web app locally without needing to deploy

Starts a local development server for a Web Application, using the local project files. This enables rapid
development with hot reloading and immediate feedback.

EXAMPLES
Start the development server:

$ sf webapp dev --name myWebApp

Start the development server with a specific target:

$ sf webapp dev --name myWebApp --target "LightningApp"

Start the development server on a custom port:

$ sf webapp dev --name myWebApp --port 8080
```

## `sf webapp generate`

Create a web app and associated metadata.

```
USAGE
$ sf webapp generate -n <value> -l <value> [--json] [--flags-dir <value>] [-t <value>] [-w]

FLAGS
-l, --label=<value> (required) Human readable name of your web app
-n, --name=<value> (required) Name of your web app
-t, --template=<value> [default: empty] Template to use for web app generation (pulls from central solution)
-w, --wizard Run in interactive wizard mode

GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.

DESCRIPTION
Create a web app and associated metadata.

This command creates a new web app with the specified configuration, including the basic structure and metadata
files.

EXAMPLES
Create an empty web app:

$ sf webapp generate --name "myWebApp" --label "My first Web App"

Create a web app with a specific template:

$ sf webapp generate --name "myWebApp" --label "My Web App" --template "React app starter"

Create a web app using the wizard:

$ sf webapp generate --name "myWebApp" --label "My Web App" --wizard
```

<!-- commandsstop -->
14 changes: 11 additions & 3 deletions command-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
[
{
"alias": [],
"command": "hello:world",
"command": "webapp:dev",
"flagAliases": [],
"flagChars": ["n"],
"flags": ["flags-dir", "json", "name"],
"flagChars": ["n", "p", "t"],
"flags": ["flags-dir", "json", "name", "port", "target"],
"plugin": "@salesforce/plugin-webapp"
},
{
"alias": [],
"command": "webapp:generate",
"flagAliases": [],
"flagChars": ["l", "n", "t", "w"],
"flags": ["flags-dir", "json", "label", "name", "template", "wizard"],
"plugin": "@salesforce/plugin-webapp"
}
]
29 changes: 0 additions & 29 deletions messages/hello.world.md

This file was deleted.

33 changes: 33 additions & 0 deletions messages/webapp.dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# summary

Preview a web app locally without needing to deploy

# description

Starts a local development server for a Web Application, using the local project files. This enables rapid development with hot reloading and immediate feedback.

# flags.name.summary

Identifies the Web Application

# flags.target.summary

Selects which Web Application target to use for the preview (e.g., Lightning App, Site)

# flags.port.summary

Port for the dev server

# examples

- Start the development server:

<%= config.bin %> <%= command.id %> --name myWebApp

- Start the development server with a specific target:

<%= config.bin %> <%= command.id %> --name myWebApp --target "LightningApp"

- Start the development server on a custom port:

<%= config.bin %> <%= command.id %> --name myWebApp --port 8080
37 changes: 37 additions & 0 deletions messages/webapp.generate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# summary

Create a web app and associated metadata.

# description

This command creates a new web app with the specified configuration, including the basic structure and metadata files.

# flags.name.summary

Name of your web app

# flags.label.summary

Human readable name of your web app

# flags.template.summary

Template to use for web app generation (pulls from central solution)

# flags.wizard.summary

Run in interactive wizard mode

# examples

- Create an empty web app:

<%= config.bin %> <%= command.id %> --name "myWebApp" --label "My first Web App"

- Create a web app with a specific template:

<%= config.bin %> <%= command.id %> --name "myWebApp" --label "My Web App" --template "React app starter"

- Create a web app using the wizard:

<%= config.bin %> <%= command.id %> --name "myWebApp" --label "My Web App" --wizard
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
"@salesforce/plugin-command-reference"
],
"topics": {
"hello": {
"description": "Commands to say hello."
"webapp": {
"description": "Work with Salesforce Web Apps"
}
},
"flexibleTaxonomy": true
Expand Down
11 changes: 7 additions & 4 deletions schemas/hello-world.json → schemas/webapp-dev.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/HelloWorldResult",
"$ref": "#/definitions/WebappDevResult",
"definitions": {
"HelloWorldResult": {
"WebappDevResult": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"time": {
"target": {
"type": "string"
},
"url": {
"type": "string"
}
},
"required": ["name", "time"],
"required": ["name", "url"],
"additionalProperties": false
}
}
Expand Down
25 changes: 25 additions & 0 deletions schemas/webapp-generate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$ref": "#/definitions/WebappGenerateResult",
"definitions": {
"WebappGenerateResult": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"label": {
"type": "string"
},
"template": {
"type": "string"
},
"wizard": {
"type": "boolean"
}
},
"required": ["name", "label", "template", "wizard"],
"additionalProperties": false
}
}
}
50 changes: 38 additions & 12 deletions src/commands/hello/world.ts → src/commands/webapp/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,60 @@ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
import { Messages } from '@salesforce/core';

Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
const messages = Messages.loadMessages('@salesforce/plugin-webapp', 'hello.world');
const messages = Messages.loadMessages('@salesforce/plugin-webapp', 'webapp.dev');

export type HelloWorldResult = {
export type WebappDevResult = {
name: string;
time: string;
target?: string;
url: string;
};

export default class World extends SfCommand<HelloWorldResult> {
export default class WebappDev extends SfCommand<WebappDevResult> {
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({
char: 'n',
summary: messages.getMessage('flags.name.summary'),
description: messages.getMessage('flags.name.description'),
default: 'World',
char: 'n',
required: true,
}),
target: Flags.string({
summary: messages.getMessage('flags.target.summary'),
char: 't',
required: false,
}),
port: Flags.integer({
summary: messages.getMessage('flags.port.summary'),
char: 'p',
default: 5173,
}),
};

public async run(): Promise<HelloWorldResult> {
const { flags } = await this.parse(World);
const time = new Date().toDateString();
this.log(messages.getMessage('info.hello', [flags.name, time]));
public async run(): Promise<WebappDevResult> {
const { flags } = await this.parse(WebappDev);

this.log(`Starting development server for web app: ${flags.name}`);
if (flags.target) {
this.log(`Using target: ${flags.target}`);
}

const url = `http://localhost:${flags.port}`;
this.log(`Server running on ${url}`);
this.log('Opening browser...');

// TODO: Implement dev server logic
// This would typically involve:
// 1. Starting a local development server
// 2. Watching for file changes
// 3. Hot reloading
// 4. Opening browser

return {
name: flags.name,
time,
target: flags.target,
url,
};
}
}
Loading
Loading