refactor: improve webapp discovery with SFDX project detection @W-21193297@#18
Merged
deepu-mungamuri94 merged 18 commits intomainfrom Feb 20, 2026
Merged
refactor: improve webapp discovery with SFDX project detection @W-21193297@#18deepu-mungamuri94 merged 18 commits intomainfrom
deepu-mungamuri94 merged 18 commits intomainfrom
Conversation
- Add SFDX project detection for webapp discovery - Simplify webapplications folder detection logic - Condense warning messages, remove verbose JSON examples - Add help tip for configuration options
f015bfc to
a8579b1
Compare
bpbuch
reviewed
Feb 12, 2026
…experimental/proxy (#22) * feat: consume error-page template from @salesforce/webapp-experimental/proxy @W-21111977@ Update plugin-webapp to import the error page HTML template from the @salesforce/webapp-experimental proxy package instead of bundling it locally. Migration changes: - ErrorPageRenderer now uses getErrorPageTemplate() from @salesforce/webapp-experimental/proxy - Removed local error-page.html template (now lives in webapps package) - Removed scripts/copy-templates.cjs (no longer needed) - Removed postbuild script from package.json - Bumped @salesforce/webapp-experimental dependency to ^1.17.0 Bug fixes included: - DevServerManager: emit DevServerError directly instead of wrapping in SfError, so the proxy can display the "Dev Server Error" page when dev server crashes - ProxyServer: add socket error handler to prevent ECONNRESET from crashing the proxy when dev server dies mid-connection Depends on: salesforce-experience-platform-emu/webapps PR for @W-21111977@ Co-authored-by: Cursor <cursoragent@cursor.com> * feat: W-21111977 consume error-page template from @salesforce/webapp-experimental/proxy Update plugin-webapp to import the error page HTML template from the @salesforce/webapp-experimental proxy package (v1.23.0) instead of bundling it locally. Migration changes: - ErrorPageRenderer now uses getErrorPageTemplate() from @salesforce/webapp-experimental/proxy (direct import, no workarounds) - Removed local error-page.html template (now lives in webapps package) - Removed scripts/copy-templates.cjs (no longer needed) - Removed postbuild script from package.json - Bumped @salesforce/webapp-experimental dependency to ^1.23.0 Bug fixes included: - DevServerManager: emit DevServerError directly instead of wrapping in SfError, so the proxy can display the "Dev Server Error" page when dev server crashes - ProxyServer: add socket error handler to prevent ECONNRESET from crashing the proxy when dev server dies mid-connection - ProxyServer: remove label/version from fallback manifest (not in type) Depends on: salesforce-experience-platform-emu/webapps#86 (merged) Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Ankit Singh <singhankit@singhank-ltmg4lv.internal.salesforce.com> Co-authored-by: Cursor <cursoragent@cursor.com>
- messages: specify 'proxy server' in Ctrl+C stop message - ProxyServer: add label and version to fallback WebAppManifest - ErrorPageRenderer: use local template (getErrorPageTemplate not in package) - tests: add label and version to WebAppManifest fixtures Co-authored-by: Cursor <cursoragent@cursor.com>
Keep only the messages change: 'Press Ctrl+C to stop the proxy server'. Revert ErrorPageRenderer, ProxyServer, and test changes - will address separately. Co-authored-by: Cursor <cursoragent@cursor.com>
- no-manifest: log applied defaults (dev command, proxy port) at info level - ready-for-development: show only URL to open in browser (proxy URL) - flags.url: add dev server URL precedence to help text Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
bpbuch
reviewed
Feb 18, 2026
…tive (#23) * feat: add Vite proxy detection and TTY-aware messaging - Detect Vite WebApp proxy via health check, skip standalone proxy when active - Use getErrorPageTemplate from @salesforce/webapp-experimental/proxy - TTY-aware stop message (Ctrl+C in terminal vs VS Code command palette) - Add info.ready-for-development-vite for Vite proxy case - Simplify ready-for-development to show only URL to open - Resolve PR review comments on messaging Co-authored-by: Cursor <cursoragent@cursor.com> * fix: remove label/version to match @salesforce/webapp-experimental 1.x type - Run yarn install to resolve 1.23.0+ (was 0.2.0 from stale lock) - ProxyServer: use minimal fallback { name, outputDir } per PR #22 - Tests: remove label/version from manifest fixtures - ManifestWatcher tests: fix assertions for simplified type Co-authored-by: Cursor <cursoragent@cursor.com> * fix: group ready-for-development messages, simplify Vite message format Co-authored-by: Cursor <cursoragent@cursor.com> * fix: update server-running message - remove bold, add quotes Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
…timeout - Add comprehensive tests for devServerUrl vs actualDevServerUrl mismatch combinations (explicit URL match/mismatch, manifest, skipDevServer cases) - Warn when multiple .webapplication-meta.xml files found in directory; use first match for backward compatibility - Increase dev server startup timeout from 30 to 60 seconds to align with VS Code extension and support slower dev server startups Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
bpbuch
approved these changes
Feb 20, 2026
| > - **Manifest watching**: Disabled | ||
| > - `{name}.webapplication-meta.xml` is **required** to identify a valid webapp | ||
| > - `webapplication.json` is optional for dev configuration. If not present, defaults to: | ||
| > - **Name**: From meta.xml filename or folder name |
Contributor
There was a problem hiding this comment.
This is not a property in webapplication.json
Collaborator
Author
There was a problem hiding this comment.
Right.. Updated doc.
Co-authored-by: Brian Buchanan <5377888+bpbuch@users.noreply.github.com>
Co-authored-by: Brian Buchanan <5377888+bpbuch@users.noreply.github.com>
Co-authored-by: Brian Buchanan <5377888+bpbuch@users.noreply.github.com>
…mmand - Remove name, label from --name option (matches folder name) - Simplify picker format, remove label references - Remove Full Configuration example (name, label, version, outputDir) - Add Dev + Routing example with only dev and routing - Update troubleshooting: --name matches folder name only Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WI : @W-21193297@
Key Changes
Replaced recursive filesystem traversal with deterministic SFDX project detection using SfProject.resolveProjectPath() from @salesforce/core
Discovery now follows a clear priority: upward search → SFDX project path → standalone webapp
Webapps are now identified by the presence of {name}.webapplication-meta.xml file (required)
webapplication.json is now optional and only used for dev configuration (command, URL)
Added pre-check: if the provided URL is already reachable, skip dev server startup (proxy-only mode)
Added mismatch warning: if --url doesn't match the actual dev server URL after startup
Added validation when running from inside a webapp directory with a conflicting --name flag
Provides clear guidance on how to resolve the conflict
What does this PR do?
This PR refactors the webapp discovery algorithm and enhances the sf webapp dev command behavior
What issues does this PR fix or reference?
@W-21193297@