Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2289955
feat: @W-20242483@ Support for sf webapp dev command
deepu-mungamuri94 Nov 24, 2025
d8cca00
docs: add comprehensive documentation for sf webapp dev command
deepu-mungamuri94 Nov 24, 2025
596e5a7
docs: simplify docs README and remove unnecessary sections
deepu-mungamuri94 Nov 24, 2025
4c12d03
docs: clean up documentation by removing internal references
deepu-mungamuri94 Nov 24, 2025
91446ed
fix: restore build script to copy schemas and templates
deepu-mungamuri94 Nov 24, 2025
c154a5a
feat: add runtime error detection and display system
deepu-mungamuri94 Nov 24, 2025
efa3bd0
fix: normalize path separators in test for Windows compatibility
deepu-mungamuri94 Nov 24, 2025
08da248
feat: add manifest hot reload support for dev.url changes
deepu-mungamuri94 Dec 2, 2025
1ae3b82
docs: consolidate documentation into comprehensive guide
deepu-mungamuri94 Dec 2, 2025
3cc590e
docs: move guide to root and update README references
deepu-mungamuri94 Dec 2, 2025
84cb674
feat: improve error page UI and add dev server error parsing
deepu-mungamuri94 Dec 2, 2025
ccf50a7
fix: use volta
nrkruk Dec 3, 2025
d326b31
fix(dev): resolve Ctrl+C not exiting when using explicit URL mode
deepu-mungamuri94 Dec 3, 2025
399c864
refactor: cleanup logging, remove debug flag, and remove GlobalErrorC…
deepu-mungamuri94 Dec 3, 2025
e6efd62
chore: update yarn.lock to use public npm registry
deepu-mungamuri94 Dec 3, 2025
58b23e5
chore: resolved review comments
deepu-mungamuri94 Dec 4, 2025
28b7ed2
fix: add fallback template when error-page.html fails to load
deepu-mungamuri94 Dec 4, 2025
3c80ea5
refactor: simplify WebAppDevResult to only url and devServerUrl
deepu-mungamuri94 Dec 4, 2025
c1fdca5
feat: make --name flag optional with intelligent webapp discovery
deepu-mungamuri94 Dec 11, 2025
606ecd0
feat: make --name optional with interactive webapp selection
deepu-mungamuri94 Dec 11, 2025
dce0e3d
feat: migrate to @salesforce/webapp-experimental package
deepu-mungamuri94 Jan 15, 2026
7174d34
refactor: simplify DevServerManager by removing auto-restart logic
deepu-mungamuri94 Jan 29, 2026
36cb85a
refactor: remove duplicate error handling in ProxyServer
deepu-mungamuri94 Jan 29, 2026
48013a4
refactor: delete src/auth/org.ts and inline getAuthHeaders
deepu-mungamuri94 Jan 29, 2026
db4eee0
refactor: use Logger.childFromRoot() for synchronous logger initializ…
deepu-mungamuri94 Jan 29, 2026
c8877e9
chore: remove unnecessary entries from files array
deepu-mungamuri94 Jan 30, 2026
165e7ec
refactor: remove webapp generate command
deepu-mungamuri94 Jan 30, 2026
6b5295e
fix: add copy-resources to build dependencies
deepu-mungamuri94 Jan 30, 2026
03ab3ae
refactor: remove duplicate signal handling from ProxyServer
deepu-mungamuri94 Jan 30, 2026
159a3ed
fix: add copy-resources to build dependencies
deepu-mungamuri94 Jan 30, 2026
83d53f2
fix: use postbuild script to copy HTML templates
deepu-mungamuri94 Jan 30, 2026
698dae3
chore: remove redundant copy-resources wireit task
deepu-mungamuri94 Jan 30, 2026
a40b511
fix: use cross-platform node script for postbuild
deepu-mungamuri94 Jan 30, 2026
9c4835c
fix: use dedicated script for cross-platform template copy
deepu-mungamuri94 Jan 30, 2026
a3fe80d
chore: undo package.json files changes
nrkruk Jan 30, 2026
269b433
fix: package versions
nrkruk Jan 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
39 changes: 0 additions & 39 deletions COMMANDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<!-- commands -->

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

## `sf webapp dev`

Expand Down Expand Up @@ -42,42 +41,4 @@ EXAMPLES
$ 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 -->
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Apache License Version 2.0

Copyright (c) 2025 Salesforce, Inc.
Copyright (c) 2026 Salesforce, Inc.
All rights reserved.

Apache License
Expand Down
125 changes: 101 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,69 @@ Additionally, there are some additional tests that the Salesforce CLI will enfor
- [@salesforce/dev-config](https://github.com/forcedotcom/dev-config)
- [@salesforce/dev-scripts](https://github.com/forcedotcom/dev-scripts)

# Everything past here is only a suggestion as to what should be in your specific plugin's description
# Salesforce CLI Webapp Plugin

A Salesforce CLI plugin for building and deploying web applications that integrate with Salesforce. This plugin provides tools for local development, packaging, and deployment of webapps 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
- 🌐 **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 `webapp.json` changes automatically

## Quick Start

1. **Install the plugin:**

```bash
sf plugins install @salesforce/plugin-webapp
```

2. **Authenticate with Salesforce:**

```bash
sf org login web --alias myorg
```

3. **Create webapp.json:**

```json
{
"name": "myapp",
"label": "My Web App",
"version": "1.0.0",
"apiVersion": "60.0",
"outputDir": "dist",
"dev": {
"command": "npm run dev"
}
}
```

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

## Documentation

📚 **[Complete Guide](SF_WEBAPP_DEV_GUIDE.md)** - Comprehensive documentation covering:
- Overview and architecture
- Getting started (5-minute quick start)
- Building the plugin
- Command usage and options
- File structure and components
- VSCode integration
- Advanced features (hot reload, error capture, etc.)
- Troubleshooting and FAQ

## Install

```bash
Expand Down Expand Up @@ -105,45 +162,65 @@ sf plugins

## Commands

<!-- commands -->
### `sf webapp dev`

- [`sf hello world`](#sf-hello-world)
Start a local development proxy server for webapp development with Salesforce authentication.

## `sf hello world`

Say hello.

```
```bash
USAGE
$ sf hello world [--json] [--flags-dir <value>] [-n <value>]
$ sf webapp dev --name <webapp-name> --target-org <org-alias> [options]

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

FLAGS
-n, --name=<value> [default: World] The name of the person you'd like to say hello to.
OPTIONAL FLAGS
-u, --url=<value> Dev server URL (overrides webapp.json)
-p, --port=<value> Proxy server port (default: 4545)
--open Open browser automatically

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

DESCRIPTION
Say hello.
Start a local development proxy server for webapp development.

Say hello either to the world or someone you know.
This command starts a local HTTP proxy server that handles Salesforce
authentication and routes requests between your local dev server and
Salesforce APIs. It automatically spawns and monitors your dev server,
detects the URL, and provides health monitoring.

EXAMPLES
Say hello to the world:
Start proxy with automatic dev server management:

$ sf hello world
$ sf webapp dev --name myapp --target-org myorg --open

Say hello to someone you know:
Use existing dev server:

$ sf hello world --name Astro
$ sf webapp dev --name myapp --target-org myorg --url http://localhost:5173 --open

FLAG DESCRIPTIONS
-n, --name=<value> The name of the person you'd like to say hello to.
Use custom proxy port:

This person can be anyone in the world!
```
$ sf webapp dev --name myapp --target-org myorg --port 8080 --open

_See code: [src/commands/hello/world.ts](https://github.com/salesforcecli/plugin-webapp/blob/1.1.73/src/commands/hello/world.ts)_
SUPPORTED DEV SERVERS
- Vite
- Create React App (Webpack)
- Next.js
- Any server that outputs http://localhost:PORT

FEATURES
- Automatic Salesforce authentication injection
- Intelligent request routing (Salesforce vs dev server)
- WebSocket support for Hot Module Replacement (HMR)
- Beautiful HTML error pages with auto-refresh
- Periodic health monitoring (every 5s)
- Configuration file watching (webapp.json)
- Graceful shutdown on Ctrl+C

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

<!-- commandsstop -->
Loading