Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
21b892a
refactor: rename webapp dev command and plugin to ui-bundle
deepu-mungamuri94 Mar 27, 2026
e3c9bf5
refactor: rename webapp references to ui-bundle and update package im…
deepu-mungamuri94 Mar 29, 2026
cdcde2c
Merge branch 'main' into rename-webapp-to-ui-bundle
deepu-mungamuri94 Mar 29, 2026
5dbfaf5
docs: update SF_UI_BUNDLE_DEV_GUIDE with ui-bundle naming
deepu-mungamuri94 Mar 29, 2026
58596ad
docs: replace app-based example names with bundle in messages
deepu-mungamuri94 Mar 29, 2026
1e84822
fix: align moduleResolution with ui-bundle package build target
deepu-mungamuri94 Mar 29, 2026
3545a5f
chore: switch @salesforce/ui-bundle from local file link to npm ^1.117.2
deepu-mungamuri94 Mar 29, 2026
204790b
Update schemas/ui__bundle-dev.json
deepu-mungamuri94 Mar 29, 2026
e1d731a
docs: update COMMANDS.md and README.md to ui-bundle naming
deepu-mungamuri94 Mar 29, 2026
f396f44
chore: regenerate json schema after description update
deepu-mungamuri94 Mar 29, 2026
cc79fd5
docs: update package name references to plugin-ui-bundle-dev in README
deepu-mungamuri94 Mar 29, 2026
0068ce1
chore: bump @salesforce/ui-bundle to ^1.117.3
deepu-mungamuri94 Mar 29, 2026
c500f88
fix: update Vite proxy test helper header from WebApp to UiBundle
deepu-mungamuri94 Mar 29, 2026
3cddf3d
Merge branch 'main' into rename-webapp-to-ui-bundle
deepu-mungamuri94 Mar 30, 2026
211001a
docs: expand UI bundle description in command help
garychangsf Mar 30, 2026
6f6f0d1
fix: simplify schema description for command result
garychangsf Mar 30, 2026
7b07fad
docs: update error message examples to use camelCase naming convention
garychangsf Mar 30, 2026
5230a6a
fix: regenerate yarn.lock using yarn registry URLs
garychangsf Mar 30, 2026
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
55 changes: 39 additions & 16 deletions COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,66 @@

<!-- commands -->

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

## `sf webapp dev`
## `sf ui-bundle dev`

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

```
USAGE
$ sf webapp dev -n <value> [--json] [--flags-dir <value>] [-t <value>] [-p <value>]
$ sf ui-bundle dev -o <value> [--json] [--flags-dir <value>] [-n <value>] [-u <value>] [-p <value>] [-b]

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)
-b, --open Automatically open the proxy server URL in your default browser when the dev server is ready.
-n, --name=<value> Name of the UI bundle to preview.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
-p, --port=<value> Local port where the proxy server listens.
-u, --url=<value> URL where your developer server runs, such as https://localhost:5173. All UI, static, and hot
deployment requests are forwarded to this URL.

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
Start a local development proxy server for UI Bundle development with Salesforce authentication.

Starts a local development server for a Web Application, using the local project files. This enables rapid
development with hot reloading and immediate feedback.
This command starts a local development (dev) server so you can preview a UI bundle using the local metadata files in
your DX project. Using a local preview helps you quickly develop UI bundles, because you don't have to continually
deploy metadata to your org.

The command also launches a local proxy server that sits between your UI bundle and Salesforce, automatically
injecting authentication headers from Salesforce CLI's stored tokens. The proxy allows your UI bundle to make
authenticated API calls to Salesforce without exposing credentials.

Even though you're previewing the UI bundle locally and not deploying anything to an org, you're still required to
authorize and specify an org to use this command.

Salesforce UI bundles are represented by the UiBundle metadata type.

EXAMPLES
Start the development server:
Start the local development (dev) server by automatically discovering the UI bundle's ui-bundle.json file; use the
org with alias "myorg":

$ sf ui-bundle dev --target-org myorg

Start the dev server by explicitly specifying the UI bundle's name:

$ sf ui-bundle dev --name myBundle --target-org myorg

Start at the specified dev server URL:

$ sf webapp dev --name myWebApp
$ sf ui-bundle dev --name myBundle --url http://localhost:5173 --target-org myorg

Start the development server with a specific target:
Start with a custom proxy port and automatically open the proxy server URL in your browser:

$ sf webapp dev --name myWebApp --target "LightningApp"
$ sf ui-bundle dev --target-org myorg --port 4546 --open

Start the development server on a custom port:
Start with debug logging enabled by specifying the SF_LOG_LEVEL environment variable before running the command:

$ sf webapp dev --name myWebApp --port 8080
$ SF_LOG_LEVEL=debug sf ui-bundle dev --target-org myorg
```

<!-- commandsstop -->
55 changes: 29 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
# plugin-app-dev
# plugin-ui-bundle-dev

[![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)
[![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)

# Salesforce CLI App Dev Plugin
# Salesforce CLI UI Bundle Dev Plugin

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.
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.

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).

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.

## Features

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

## Quick Start

1. **Install the plugin:**

```bash
sf plugins install @salesforce/plugin-app-dev
sf plugins install @salesforce/plugin-ui-bundle-dev
```

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

3. **Create webapplication.json:**
3. **Create ui-bundle.json:**

```json
{
"name": "myapp",
"label": "My Web App",
"name": "myBundle",
"label": "My UI Bundle",
"version": "1.0.0",
"apiVersion": "60.0",
"outputDir": "dist",
Expand All @@ -50,12 +49,12 @@ We always recommend using the latest version of these commands bundled with the

4. **Start development:**
```bash
sf webapp dev --name myapp --target-org myorg --open
sf ui-bundle dev --name myBundle --target-org myorg --open
```

## Documentation

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

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

```bash
sf plugins install @salesforce/plugin-app-dev@x.y.z
sf plugins install @salesforce/plugin-ui-bundle-dev@x.y.z
```

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

```bash
# Clone the repository
git clone git@github.com:salesforcecli/plugin-app-dev
git clone git@github.com:salesforcecli/plugin-ui-bundle-dev

# Install the dependencies and compile
yarn && yarn build
Expand All @@ -125,27 +124,27 @@ sf plugins

## Commands

### `sf webapp dev`
### `sf ui-bundle dev`

Start a local development proxy server for webapp development with Salesforce authentication.
Start a local development proxy server for UI Bundle development with Salesforce authentication.

**Two operating modes:**

- **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.
- **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.
- **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.

```bash
USAGE
$ sf webapp dev --name <webapp-name> --target-org <org-alias> [options]
$ sf ui-bundle dev --target-org <org-alias> [options]

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

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

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

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

$ sf webapp dev --name myapp --target-org myorg --open
$ sf ui-bundle dev --target-org myorg --open

Explicitly specify the UI bundle name:

$ sf ui-bundle dev --name myBundle --target-org myorg --open

URL-only mode (dev server already running):

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

Custom proxy port:

$ sf webapp dev --name myapp --target-org myorg --port 8080 --open
$ sf ui-bundle dev --target-org myorg --port 8080 --open

SEE ALSO
- Complete Guide: SF_WEBAPP_DEV_GUIDE.md
- Complete Guide: SF_UI_BUNDLE_DEV_GUIDE.md
```

<!-- commandsstop -->
Loading
Loading