Skip to content

Commit 68bab95

Browse files
committed
feat: implement webapp commands for One Runtime Apps with Agentforce Vibes
- Add webapp:generate command with name, label, target, template, and wizard flags - Add webapp:deploy command with name and options (build/value) flags - Add webapp:retrieve command with name flag - Add webapp:dev command with optional name and port flags - Remove hello world example code - Add comprehensive unit tests and NUT tests (18 tests total, all passing) - Add message files with examples for all commands - Generate JSON schemas for all webapp commands - Update command snapshot for deprecation policy - Update package.json topics from 'hello' to 'webapp' All commands support JSON output and follow Salesforce CLI conventions. Commands include TODO comments for future business logic implementation.
1 parent 8c5b614 commit 68bab95

23 files changed

Lines changed: 798 additions & 86 deletions

command-snapshot.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,31 @@
11
[
22
{
33
"alias": [],
4-
"command": "hello:world",
4+
"command": "webapp:deploy",
5+
"flagAliases": [],
6+
"flagChars": ["n", "o"],
7+
"flags": ["flags-dir", "json", "name", "options"],
8+
"plugin": "@salesforce/plugin-webapp"
9+
},
10+
{
11+
"alias": [],
12+
"command": "webapp:dev",
13+
"flagAliases": [],
14+
"flagChars": ["n", "p"],
15+
"flags": ["flags-dir", "json", "name", "port"],
16+
"plugin": "@salesforce/plugin-webapp"
17+
},
18+
{
19+
"alias": [],
20+
"command": "webapp:generate",
21+
"flagAliases": [],
22+
"flagChars": ["l", "n", "r", "t", "w"],
23+
"flags": ["flags-dir", "json", "label", "name", "target", "template", "wizard"],
24+
"plugin": "@salesforce/plugin-webapp"
25+
},
26+
{
27+
"alias": [],
28+
"command": "webapp:retrieve",
529
"flagAliases": [],
630
"flagChars": ["n"],
731
"flags": ["flags-dir", "json", "name"],

messages/hello.world.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

messages/webapp.deploy.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# summary
2+
3+
Deploy the web app, its assets and associated metadata
4+
5+
# description
6+
7+
This command builds and deploys your web app and associated metadata to your Salesforce org. It packages all assets, applies configurations, and ensures proper deployment of all components. One Runtime in Agentforce Vibes goes from Code → Metadata/Files. The default "build" option will run the necessary commands to produce the bundle and metadata to deploy the One Runtime App.
8+
9+
# flags.name.summary
10+
11+
Name of your web app
12+
13+
# flags.options.summary
14+
15+
Deployment options (build or value)
16+
17+
# examples
18+
19+
- Deploy a web app:
20+
21+
<%= config.bin %> <%= command.id %> --name myWebApp
22+
23+
- Deploy a web app with specific options:
24+
25+
<%= config.bin %> <%= command.id %> --name myWebApp --options build

messages/webapp.dev.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# summary
2+
3+
Preview a web app locally without needing to deploy
4+
5+
# description
6+
7+
Start a local development server to preview your web app without deploying to Salesforce. This enables rapid development with hot reloading and immediate feedback.
8+
9+
# flags.name.summary
10+
11+
Name of your web app
12+
13+
# flags.port.summary
14+
15+
Port number for the development server
16+
17+
# examples
18+
19+
- Start the development server:
20+
21+
<%= config.bin %> <%= command.id %>
22+
23+
- Start the development server for a specific web app:
24+
25+
<%= config.bin %> <%= command.id %> --name myWebApp
26+
27+
- Start the development server on a custom port:
28+
29+
<%= config.bin %> <%= command.id %> --name myWebApp --port 8080

messages/webapp.generate.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# summary
2+
3+
Create a web app and associated metadata
4+
5+
# description
6+
7+
Generate a new Salesforce web app with the specified configuration. This command creates the basic structure, metadata, and configuration files needed for a One Runtime App with Agentforce Vibes integration.
8+
9+
# flags.name.summary
10+
11+
Name of your web app
12+
13+
# flags.label.summary
14+
15+
Human readable name of your web app
16+
17+
# flags.target.summary
18+
19+
Target platform for the web app (Site, Embed, or Lightning)
20+
21+
# flags.template.summary
22+
23+
Template to use for web app generation (pulls from central solution)
24+
25+
# flags.wizard.summary
26+
27+
Run in interactive wizard mode
28+
29+
# examples
30+
31+
- Create an empty web app:
32+
33+
<%= config.bin %> <%= command.id %> --name "myWebApp" --label "My first Web App"
34+
35+
- Create a web app with a specific target:
36+
37+
<%= config.bin %> <%= command.id %> --name "myWebApp" --label "My Web App" --target Site
38+
39+
- Create a web app using the wizard:
40+
41+
<%= config.bin %> <%= command.id %> --name "myWebApp" --label "My Web App" --wizard

messages/webapp.retrieve.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# summary
2+
3+
Retrieve the web app, its assets and associated metadata
4+
5+
# description
6+
7+
This command retrieves your web app, its assets, and associated metadata from your Salesforce org to your local environment. Useful for syncing remote changes or setting up a local development environment.
8+
9+
# flags.name.summary
10+
11+
Name of your web app to retrieve
12+
13+
# examples
14+
15+
- Retrieve a web app:
16+
17+
<%= config.bin %> <%= command.id %> --name myWebApp

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
"@salesforce/plugin-command-reference"
5353
],
5454
"topics": {
55-
"hello": {
56-
"description": "Commands to say hello."
55+
"webapp": {
56+
"description": "Work with Salesforce Web Apps"
5757
}
5858
},
5959
"flexibleTaxonomy": true

schemas/webapp-deploy.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/WebappDeployResult",
4+
"definitions": {
5+
"WebappDeployResult": {
6+
"type": "object",
7+
"properties": {
8+
"name": {
9+
"type": "string"
10+
},
11+
"options": {
12+
"type": "string"
13+
},
14+
"success": {
15+
"type": "boolean"
16+
}
17+
},
18+
"required": ["name", "options", "success"],
19+
"additionalProperties": false
20+
}
21+
}
22+
}

schemas/webapp-dev.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/WebappDevResult",
4+
"definitions": {
5+
"WebappDevResult": {
6+
"type": "object",
7+
"properties": {
8+
"name": {
9+
"type": "string"
10+
},
11+
"port": {
12+
"type": "number"
13+
},
14+
"success": {
15+
"type": "boolean"
16+
}
17+
},
18+
"required": ["port", "success"],
19+
"additionalProperties": false
20+
}
21+
}
22+
}

schemas/webapp-generate.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$ref": "#/definitions/WebappGenerateResult",
4+
"definitions": {
5+
"WebappGenerateResult": {
6+
"type": "object",
7+
"properties": {
8+
"name": {
9+
"type": "string"
10+
},
11+
"label": {
12+
"type": "string"
13+
},
14+
"target": {
15+
"type": "string"
16+
},
17+
"template": {
18+
"type": "string"
19+
},
20+
"wizard": {
21+
"type": "boolean"
22+
}
23+
},
24+
"required": ["name", "label", "target", "template", "wizard"],
25+
"additionalProperties": false
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)