Skip to content

Commit 08eabe3

Browse files
committed
refactor: update webapp commands - simplify generate and dev
- Changed webapp generate: -t flag now for template (was target) - Removed target platform options from generate command - Updated webapp dev: simplified flags, default port to 5173 - Removed host/root-dir/no-open flags from dev command - Removed webapp deploy and retrieve commands for now - Updated all tests, schemas, and documentation - All tests passing
1 parent 8a768d6 commit 08eabe3

21 files changed

+72
-855
lines changed

COMMANDS.md

Lines changed: 11 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,21 @@
22

33
<!-- commands -->
44

5-
- [`sf webapp deploy`](#sf-webapp-deploy)
65
- [`sf webapp dev`](#sf-webapp-dev)
76
- [`sf webapp generate`](#sf-webapp-generate)
8-
- [`sf webapp retrieve`](#sf-webapp-retrieve)
9-
10-
## `sf webapp deploy`
11-
12-
Deploy the web app, its assets and associated metadata
13-
14-
```
15-
USAGE
16-
$ sf webapp deploy -n <value> [--json] [--flags-dir <value>] [-o build|validate]
17-
18-
FLAGS
19-
-n, --name=<value> (required) Name of your web app
20-
-o, --options=<option> [default: build] Deployment options (build or validate)
21-
<options: build|validate>
22-
23-
GLOBAL FLAGS
24-
--flags-dir=<value> Import flag values from a directory.
25-
--json Format output as json.
26-
27-
DESCRIPTION
28-
Deploy the web app, its assets and associated metadata
29-
30-
This command deploys your web app, its assets, and associated metadata to your Salesforce org. Use the build option
31-
to build and deploy, or the validate option to check deployment without making changes.
32-
33-
EXAMPLES
34-
Deploy a web app:
35-
36-
$ sf webapp deploy --name myWebApp
37-
38-
Deploy a web app with specific options:
39-
40-
$ sf webapp deploy --name myWebApp --options build
41-
```
427

438
## `sf webapp dev`
449

4510
Preview a web app locally without needing to deploy
4611

4712
```
4813
USAGE
49-
$ sf webapp dev -n <value> [--json] [--flags-dir <value>] [-t <value>] [-r <value>] [-p <value>]
50-
[--host <value>] [--no-open]
14+
$ sf webapp dev -n <value> [--json] [--flags-dir <value>] [-t <value>] [-p <value>]
5115
5216
FLAGS
53-
-n, --name=<value> (required) Identifies the Web Application
54-
-p, --port=<value> [default: 8080] Port for the dev server
55-
-r, --root-dir=<value> Optional override for the local project root of the given Web Application
56-
-t, --target=<value> Selects which Web Application target to use for the preview (e.g., Lightning App, Site)
57-
--host=<value> [default: localhost] Host to bind to
58-
--no-open Do not automatically open the browser
17+
-n, --name=<value> (required) Identifies the Web Application
18+
-p, --port=<value> [default: 5173] Port for the dev server
19+
-t, --target=<value> Selects which Web Application target to use for the preview (e.g., Lightning App, Site)
5920
6021
GLOBAL FLAGS
6122
--flags-dir=<value> Import flag values from a directory.
@@ -76,34 +37,23 @@ EXAMPLES
7637
7738
$ sf webapp dev --name myWebApp --target "LightningApp"
7839
79-
Start the development server on a custom port and host:
80-
81-
$ sf webapp dev --name myWebApp --port 8080 --host 0.0.0.0
82-
83-
Start the development server with custom root directory:
84-
85-
$ sf webapp dev --name myWebApp --root-dir ./webapps/myWebApp
86-
87-
Start the development server without opening the browser:
40+
Start the development server on a custom port:
8841
89-
$ sf webapp dev --name myWebApp --no-open
42+
$ sf webapp dev --name myWebApp --port 8080
9043
```
9144

9245
## `sf webapp generate`
9346

94-
Create a web app and associated metadata
47+
Create a web app and associated metadata.
9548

9649
```
9750
USAGE
98-
$ sf webapp generate -n <value> -l <value> [--json] [--flags-dir <value>] [-t Site|Embed|Lightning]
99-
[-r <value>] [-w]
51+
$ sf webapp generate -n <value> -l <value> [--json] [--flags-dir <value>] [-t <value>] [-w]
10052
10153
FLAGS
10254
-l, --label=<value> (required) Human readable name of your web app
10355
-n, --name=<value> (required) Name of your web app
104-
-r, --template=<value> [default: empty] Template to use for web app generation (pulls from central solution)
105-
-t, --target=<option> [default: empty] Target platform for the web app (Site, Embed, or Lightning)
106-
<options: Site|Embed|Lightning>
56+
-t, --template=<value> [default: empty] Template to use for web app generation (pulls from central solution)
10757
-w, --wizard Run in interactive wizard mode
10858
10959
GLOBAL FLAGS
@@ -121,54 +71,13 @@ EXAMPLES
12171
12272
$ sf webapp generate --name "myWebApp" --label "My first Web App"
12373
124-
Create a web app with a specific target:
74+
Create a web app with a specific template:
12575
126-
$ sf webapp generate --name "myWebApp" --label "My Web App" --target Site
76+
$ sf webapp generate --name "myWebApp" --label "My Web App" --template "React app starter"
12777
12878
Create a web app using the wizard:
12979
13080
$ sf webapp generate --name "myWebApp" --label "My Web App" --wizard
13181
```
13282

133-
## `sf webapp retrieve`
134-
135-
Retrieve the web app, its assets and associated metadata
136-
137-
```
138-
USAGE
139-
$ sf webapp retrieve -n <value> [--json] [--flags-dir <value>] [--no-overwrite] [-i <value>]
140-
141-
FLAGS
142-
-i, --ignore=<value> File pattern to ignore during retrieval (e.g., "dist/**")
143-
-n, --name=<value> (required) Name of your web app to retrieve
144-
--no-overwrite Prevent overwriting existing local files
145-
146-
GLOBAL FLAGS
147-
--flags-dir=<value> Import flag values from a directory.
148-
--json Format output as json.
149-
150-
DESCRIPTION
151-
Retrieve the web app, its assets and associated metadata
152-
153-
This command retrieves your web app, its assets, and associated metadata from your Salesforce org to your local
154-
environment. Useful for syncing remote changes or setting up a local development environment.
155-
156-
EXAMPLES
157-
Retrieve a web app:
158-
159-
$ sf webapp retrieve --name myWebApp
160-
161-
Retrieve a web app with overwrite protection:
162-
163-
$ sf webapp retrieve --name myWebApp --no-overwrite
164-
165-
Retrieve a web app while ignoring specific files:
166-
167-
$ sf webapp retrieve --name myWebApp --ignore "dist/**"
168-
169-
Retrieve with both options:
170-
171-
$ sf webapp retrieve --name "myWebApp" --no-overwrite --ignore "dist/**"
172-
```
173-
17483
<!-- commandsstop -->

command-snapshot.json

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,18 @@
11
[
2-
{
3-
"alias": [],
4-
"command": "webapp:deploy",
5-
"flagAliases": [],
6-
"flagChars": ["n", "o"],
7-
"flags": ["flags-dir", "json", "name", "options"],
8-
"plugin": "@salesforce/plugin-webapp"
9-
},
102
{
113
"alias": [],
124
"command": "webapp:dev",
135
"flagAliases": [],
14-
"flagChars": ["n", "p", "r", "t"],
15-
"flags": ["flags-dir", "host", "json", "name", "no-open", "port", "root-dir", "target"],
6+
"flagChars": ["n", "p", "t"],
7+
"flags": ["flags-dir", "json", "name", "port", "target"],
168
"plugin": "@salesforce/plugin-webapp"
179
},
1810
{
1911
"alias": [],
2012
"command": "webapp:generate",
2113
"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",
29-
"flagAliases": [],
30-
"flagChars": ["i", "n"],
31-
"flags": ["flags-dir", "ignore", "json", "name", "no-overwrite"],
14+
"flagChars": ["l", "n", "t", "w"],
15+
"flags": ["flags-dir", "json", "label", "name", "template", "wizard"],
3216
"plugin": "@salesforce/plugin-webapp"
3317
}
3418
]

messages/webapp.deploy.md

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

messages/webapp.dev.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,10 @@ Identifies the Web Application
1414

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

17-
# flags.root-dir.summary
18-
19-
Optional override for the local project root of the given Web Application
20-
2117
# flags.port.summary
2218

2319
Port for the dev server
2420

25-
# flags.host.summary
26-
27-
Host to bind to
28-
29-
# flags.no-open.summary
30-
31-
Do not automatically open the browser
32-
3321
# examples
3422

3523
- Start the development server:
@@ -40,14 +28,6 @@ Do not automatically open the browser
4028

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

43-
- Start the development server on a custom port and host:
44-
45-
<%= config.bin %> <%= command.id %> --name myWebApp --port 8080 --host 0.0.0.0
46-
47-
- Start the development server with custom root directory:
48-
49-
<%= config.bin %> <%= command.id %> --name myWebApp --root-dir ./webapps/myWebApp
50-
51-
- Start the development server without opening the browser:
31+
- Start the development server on a custom port:
5232

53-
<%= config.bin %> <%= command.id %> --name myWebApp --no-open
33+
<%= config.bin %> <%= command.id %> --name myWebApp --port 8080

messages/webapp.generate.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ Name of your web app
1414

1515
Human readable name of your web app
1616

17-
# flags.target.summary
18-
19-
Target platform for the web app (Site, Embed, or Lightning)
20-
2117
# flags.template.summary
2218

2319
Template to use for web app generation (pulls from central solution)
@@ -32,9 +28,9 @@ Run in interactive wizard mode
3228

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

35-
- Create a web app with a specific target:
31+
- Create a web app with a specific template:
3632

37-
<%= config.bin %> <%= command.id %> --name "myWebApp" --label "My Web App" --target Site
33+
<%= config.bin %> <%= command.id %> --name "myWebApp" --label "My Web App" --template "React app starter"
3834

3935
- Create a web app using the wizard:
4036

messages/webapp.retrieve.md

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

schemas/webapp-deploy.json

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

schemas/webapp-dev.json

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,11 @@
1111
"target": {
1212
"type": "string"
1313
},
14-
"rootDir": {
14+
"url": {
1515
"type": "string"
16-
},
17-
"port": {
18-
"type": "number"
19-
},
20-
"host": {
21-
"type": "string"
22-
},
23-
"noOpen": {
24-
"type": "boolean"
25-
},
26-
"success": {
27-
"type": "boolean"
2816
}
2917
},
30-
"required": ["name", "port", "host", "noOpen", "success"],
18+
"required": ["name", "url"],
3119
"additionalProperties": false
3220
}
3321
}

schemas/webapp-generate.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
"label": {
1212
"type": "string"
1313
},
14-
"target": {
15-
"type": "string"
16-
},
1714
"template": {
1815
"type": "string"
1916
},
2017
"wizard": {
2118
"type": "boolean"
2219
}
2320
},
24-
"required": ["name", "label", "target", "template", "wizard"],
21+
"required": ["name", "label", "template", "wizard"],
2522
"additionalProperties": false
2623
}
2724
}

0 commit comments

Comments
 (0)