Skip to content

Commit a200dd6

Browse files
deepu-mungamuri94bpbuchgarychangsf
authored
refactor: rename webapp dev command and plugin to ui-bundle @W-21575874@ (#41)
* refactor: rename webapp dev command and plugin to ui-bundle Rename `sf webapp dev` command to `sf ui-bundle dev` and update plugin identity: - Rename src/commands/webapp/dev.ts to src/commands/ui-bundle/dev.ts - Rename messages/webapp.dev.md to messages/ui-bundle.dev.md - Rename schemas/webapp-dev.json to schemas/ui-bundle-dev.json - Rename SF_WEBAPP_DEV_GUIDE.md to SF_UI_BUNDLE_DEV_GUIDE.md - Rename test/commands/webapp/ to test/commands/ui-bundle/ - Rename plugin from @salesforce/plugin-app-dev to @salesforce/plugin-ui-bundle-dev - Update command-snapshot.json: webapp:dev → ui-bundle:dev - Update package.json: topics webapp → ui-bundle, homepage and repository URLs - Update webappDiscovery.ts: path segment and folder constant webui → uiBundles - Update COMMANDS.md and README.md with ui-bundle command and package references - Update src/proxy/ProxyServer.ts with associated changes W-21575874 Made-with: Cursor * refactor: rename webapp references to ui-bundle and update package imports - Rename dev command, messages, schemas, and configs from webapp to ui-bundle - Update imports from @salesforce/webapp-experimental to @salesforce/ui-bundle - Remove ErrorPageRenderer (template inlined upstream) - Update all test helpers and NUT references Made-with: Cursor * docs: update SF_UI_BUNDLE_DEV_GUIDE with ui-bundle naming - Replace webui/, webapplication.json, .webapplication-meta.xml references - Replace app-based example names with bundle equivalents - Delete SF_WEBAPP_DEV_GUIDE.md (superseded by SF_UI_BUNDLE_DEV_GUIDE.md) - Fix title, debug log grep pattern, and project structure Made-with: Cursor * docs: replace app-based example names with bundle in messages - MyApp → MyBundle in flags.name.description - myUiBundle → myBundle in command examples Made-with: Cursor * fix: align moduleResolution with ui-bundle package build target Switch tsconfig from Node16 to Preserve/Bundler to match how @salesforce/ui-bundle generates its .d.ts files. The old @salesforce/webapp-experimental included .js extensions in d.ts imports (Node16-compatible), but @salesforce/ui-bundle dropped them (Bundler-style), causing ESLint type resolution failures. Also corrects UIBundleManifest import casing to match the actual export name. Made-with: Cursor * chore: switch @salesforce/ui-bundle from local file link to npm ^1.117.2 Made-with: Cursor * Update schemas/ui__bundle-dev.json Co-authored-by: Brian Buchanan <5377888+bpbuch@users.noreply.github.com> * docs: update COMMANDS.md and README.md to ui-bundle naming Replace all webapp/webapplication references with ui-bundle conventions, update command from sf webapp dev to sf ui-bundle dev, and align example names to use bundle-style naming (myBundle). Made-with: Cursor * chore: regenerate json schema after description update Made-with: Cursor * docs: update package name references to plugin-ui-bundle-dev in README Made-with: Cursor * chore: bump @salesforce/ui-bundle to ^1.117.3 Made-with: Cursor * fix: update Vite proxy test helper header from WebApp to UiBundle startViteProxyServer was sending X-Salesforce-WebApp-Proxy but dev.ts checks X-Salesforce-UiBundle-Proxy, causing the Vite proxy detection NUT to always fail. Made-with: Cursor * docs: expand UI bundle description in command help * fix: simplify schema description for command result Update JSDoc and schema to use concise description. * docs: update error message examples to use camelCase naming convention * fix: regenerate yarn.lock using yarn registry URLs --------- Co-authored-by: Brian Buchanan <5377888+bpbuch@users.noreply.github.com> Co-authored-by: gary-chang <gary.chang@salesforce.com>
1 parent 0bdacc1 commit a200dd6

31 files changed

Lines changed: 1676 additions & 1938 deletions

COMMANDS.md

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,66 @@
22

33
<!-- commands -->
44

5-
- [`sf webapp dev`](#sf-webapp-dev)
5+
- [`sf ui-bundle dev`](#sf-ui-bundle-dev)
66

7-
## `sf webapp dev`
7+
## `sf ui-bundle dev`
88

9-
Preview a web app locally without needing to deploy
9+
Start a local development proxy server for UI Bundle development with Salesforce authentication.
1010

1111
```
1212
USAGE
13-
$ sf webapp dev -n <value> [--json] [--flags-dir <value>] [-t <value>] [-p <value>]
13+
$ sf ui-bundle dev -o <value> [--json] [--flags-dir <value>] [-n <value>] [-u <value>] [-p <value>] [-b]
1414
1515
FLAGS
16-
-n, --name=<value> (required) Identifies the Web Application
17-
-p, --port=<value> [default: 5173] Port for the dev server
18-
-t, --target=<value> Selects which Web Application target to use for the preview (e.g., Lightning App, Site)
16+
-b, --open Automatically open the proxy server URL in your default browser when the dev server is ready.
17+
-n, --name=<value> Name of the UI bundle to preview.
18+
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
19+
configuration variable is already set.
20+
-p, --port=<value> Local port where the proxy server listens.
21+
-u, --url=<value> URL where your developer server runs, such as https://localhost:5173. All UI, static, and hot
22+
deployment requests are forwarded to this URL.
1923
2024
GLOBAL FLAGS
2125
--flags-dir=<value> Import flag values from a directory.
2226
--json Format output as json.
2327
2428
DESCRIPTION
25-
Preview a web app locally without needing to deploy
29+
Start a local development proxy server for UI Bundle development with Salesforce authentication.
2630
27-
Starts a local development server for a Web Application, using the local project files. This enables rapid
28-
development with hot reloading and immediate feedback.
31+
This command starts a local development (dev) server so you can preview a UI bundle using the local metadata files in
32+
your DX project. Using a local preview helps you quickly develop UI bundles, because you don't have to continually
33+
deploy metadata to your org.
34+
35+
The command also launches a local proxy server that sits between your UI bundle and Salesforce, automatically
36+
injecting authentication headers from Salesforce CLI's stored tokens. The proxy allows your UI bundle to make
37+
authenticated API calls to Salesforce without exposing credentials.
38+
39+
Even though you're previewing the UI bundle locally and not deploying anything to an org, you're still required to
40+
authorize and specify an org to use this command.
41+
42+
Salesforce UI bundles are represented by the UiBundle metadata type.
2943
3044
EXAMPLES
31-
Start the development server:
45+
Start the local development (dev) server by automatically discovering the UI bundle's ui-bundle.json file; use the
46+
org with alias "myorg":
47+
48+
$ sf ui-bundle dev --target-org myorg
49+
50+
Start the dev server by explicitly specifying the UI bundle's name:
51+
52+
$ sf ui-bundle dev --name myBundle --target-org myorg
53+
54+
Start at the specified dev server URL:
3255
33-
$ sf webapp dev --name myWebApp
56+
$ sf ui-bundle dev --name myBundle --url http://localhost:5173 --target-org myorg
3457
35-
Start the development server with a specific target:
58+
Start with a custom proxy port and automatically open the proxy server URL in your browser:
3659
37-
$ sf webapp dev --name myWebApp --target "LightningApp"
60+
$ sf ui-bundle dev --target-org myorg --port 4546 --open
3861
39-
Start the development server on a custom port:
62+
Start with debug logging enabled by specifying the SF_LOG_LEVEL environment variable before running the command:
4063
41-
$ sf webapp dev --name myWebApp --port 8080
64+
$ SF_LOG_LEVEL=debug sf ui-bundle dev --target-org myorg
4265
```
4366

4467
<!-- commandsstop -->

README.md

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
# plugin-app-dev
1+
# plugin-ui-bundle-dev
22

3-
[![NPM](https://img.shields.io/npm/v/@salesforce/plugin-app-dev.svg?label=@salesforce/plugin-app-dev)](https://www.npmjs.com/package/@salesforce/plugin-app-dev) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/plugin-app-dev.svg)](https://npmjs.org/package/@salesforce/plugin-app-dev) [![License](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/license/apache-2-0)
3+
[![NPM](https://img.shields.io/npm/v/@salesforce/plugin-ui-bundle-dev.svg?label=@salesforce/plugin-ui-bundle-dev)](https://www.npmjs.com/package/@salesforce/plugin-ui-bundle-dev) [![Downloads/week](https://img.shields.io/npm/dw/@salesforce/plugin-ui-bundle-dev.svg)](https://npmjs.org/package/@salesforce/plugin-ui-bundle-dev) [![License](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](https://opensource.org/license/apache-2-0)
44

5-
# Salesforce CLI App Dev Plugin
5+
# Salesforce CLI UI Bundle Dev Plugin
66

7-
A Salesforce CLI plugin for building web applications that integrate with Salesforce. This plugin provides tools for local development, packaging, and deployment of webapps with built-in Salesforce authentication.
7+
A Salesforce CLI plugin for building UI bundles that integrate with Salesforce. This plugin provides tools for local development of UI bundles with built-in Salesforce authentication.
88

99
This plugin is bundled with the [Salesforce CLI](https://developer.salesforce.com/tools/sfdxcli). For more information on the CLI, read the [getting started guide](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_intro.htm).
1010

1111
We always recommend using the latest version of these commands bundled with the CLI, however, you can install a specific version or tag if needed.
1212

1313
## Features
1414

15-
- 🔐 **Local Development Proxy** - Run webapps locally with automatic Salesforce authentication
15+
- 🔐 **Local Development Proxy** - Run UI bundles locally with automatic Salesforce authentication
1616
- 🌐 **Intelligent Request Routing** - Automatically routes requests between Salesforce APIs and dev servers
1717
- 🔄 **Dev Server Management** - Spawns and monitors dev servers (Vite, CRA, Next.js)
18-
- 🎨 **Beautiful Error Handling** - HTML error pages with auto-refresh and diagnostics
1918
- 💚 **Health Monitoring** - Periodic health checks with status updates
20-
- 🔧 **Hot Config Reload** - Detects `webapplication.json` changes automatically
19+
- 🔧 **Hot Config Reload** - Detects `ui-bundle.json` changes automatically
2120

2221
## Quick Start
2322

2423
1. **Install the plugin:**
2524

2625
```bash
27-
sf plugins install @salesforce/plugin-app-dev
26+
sf plugins install @salesforce/plugin-ui-bundle-dev
2827
```
2928

3029
2. **Authenticate with Salesforce:**
@@ -33,12 +32,12 @@ We always recommend using the latest version of these commands bundled with the
3332
sf org login web --alias myorg
3433
```
3534

36-
3. **Create webapplication.json:**
35+
3. **Create ui-bundle.json:**
3736

3837
```json
3938
{
40-
"name": "myapp",
41-
"label": "My Web App",
39+
"name": "myBundle",
40+
"label": "My UI Bundle",
4241
"version": "1.0.0",
4342
"apiVersion": "60.0",
4443
"outputDir": "dist",
@@ -50,12 +49,12 @@ We always recommend using the latest version of these commands bundled with the
5049

5150
4. **Start development:**
5251
```bash
53-
sf webapp dev --name myapp --target-org myorg --open
52+
sf ui-bundle dev --name myBundle --target-org myorg --open
5453
```
5554

5655
## Documentation
5756

58-
📚 **[Complete Guide](SF_WEBAPP_DEV_GUIDE.md)** - Comprehensive documentation covering:
57+
📚 **[Complete Guide](SF_UI_BUNDLE_DEV_GUIDE.md)** - Comprehensive documentation covering:
5958

6059
- Overview and architecture
6160
- Getting started (5-minute quick start)
@@ -69,7 +68,7 @@ We always recommend using the latest version of these commands bundled with the
6968
## Install
7069

7170
```bash
72-
sf plugins install @salesforce/plugin-app-dev@x.y.z
71+
sf plugins install @salesforce/plugin-ui-bundle-dev@x.y.z
7372
```
7473

7574
## Issues
@@ -101,7 +100,7 @@ To build the plugin locally, make sure to have yarn installed and run the follow
101100

102101
```bash
103102
# Clone the repository
104-
git clone git@github.com:salesforcecli/plugin-app-dev
103+
git clone git@github.com:salesforcecli/plugin-ui-bundle-dev
105104

106105
# Install the dependencies and compile
107106
yarn && yarn build
@@ -125,27 +124,27 @@ sf plugins
125124

126125
## Commands
127126

128-
### `sf webapp dev`
127+
### `sf ui-bundle dev`
129128

130-
Start a local development proxy server for webapp development with Salesforce authentication.
129+
Start a local development proxy server for UI Bundle development with Salesforce authentication.
131130

132131
**Two operating modes:**
133132

134-
- **Command mode** (default): When `dev.command` is set in `webapplication.json` (or default `npm run dev`), the CLI starts the dev server. URL defaults to `http://localhost:5173`; override with `dev.url` or `--url` if needed.
133+
- **Command mode** (default): When `dev.command` is set in `ui-bundle.json` (or default `npm run dev`), the CLI starts the dev server. URL defaults to `http://localhost:5173`; override with `dev.url` or `--url` if needed.
135134
- **URL-only mode**: When only `dev.url` or `--url` is provided (no command), the CLI assumes the dev server is already running and does not start it. Proxy only.
136135

137136
```bash
138137
USAGE
139-
$ sf webapp dev --name <webapp-name> --target-org <org-alias> [options]
138+
$ sf ui-bundle dev --target-org <org-alias> [options]
140139

141140
REQUIRED FLAGS
142-
-n, --name=<value> Name of the webapp (must match webapplication.json)
143141
-o, --target-org=<value> Salesforce org to authenticate against
144142

145143
OPTIONAL FLAGS
144+
-n, --name=<value> Name of the UI bundle (must match ui-bundle.json)
146145
-u, --url=<value> Dev server URL. Command mode: override default 5173. URL-only: required (server must be running)
147146
-p, --port=<value> Proxy server port (default: 4545)
148-
--open Open browser automatically
147+
-b, --open Open browser automatically
149148

150149
DESCRIPTION
151150
Starts a local HTTP proxy that injects Salesforce authentication and routes
@@ -154,20 +153,24 @@ DESCRIPTION
154153
URL-only mode, connects to an already-running dev server.
155154

156155
EXAMPLES
157-
Command mode (CLI starts dev server, default port 5173):
156+
Start dev server by auto-discovering the UI bundle:
158157

159-
$ sf webapp dev --name myapp --target-org myorg --open
158+
$ sf ui-bundle dev --target-org myorg --open
159+
160+
Explicitly specify the UI bundle name:
161+
162+
$ sf ui-bundle dev --name myBundle --target-org myorg --open
160163

161164
URL-only mode (dev server already running):
162165

163-
$ sf webapp dev --name myapp --target-org myorg --url http://localhost:5173 --open
166+
$ sf ui-bundle dev --name myBundle --target-org myorg --url http://localhost:5173 --open
164167

165168
Custom proxy port:
166169

167-
$ sf webapp dev --name myapp --target-org myorg --port 8080 --open
170+
$ sf ui-bundle dev --target-org myorg --port 8080 --open
168171

169172
SEE ALSO
170-
- Complete Guide: SF_WEBAPP_DEV_GUIDE.md
173+
- Complete Guide: SF_UI_BUNDLE_DEV_GUIDE.md
171174
```
172175

173176
<!-- commandsstop -->

0 commit comments

Comments
 (0)