Add plugin support and centralize config resolution in VS Code extension#185
Closed
clavery wants to merge 3 commits intofeature/content-treeviewfrom
Closed
Add plugin support and centralize config resolution in VS Code extension#185clavery wants to merge 3 commits intofeature/content-treeviewfrom
clavery wants to merge 3 commits intofeature/content-treeviewfrom
Conversation
Replace 7 independent resolveConfigWithPlugins() call sites with a single B2CExtensionConfig singleton that caches resolved config and exposes getInstance()/getConfig()/getConfigError()/reset(). - Add dw.json file watcher (RelativePattern + onDidSaveTextDocument) that auto-resets config and fires onDidReset event - WebDAV tree subscribes to onDidReset for automatic refresh on config changes - Silently handle FileNotFound in tree re-expansion after server switch - Delete WebDavConfigProvider (fully replaced by B2CExtensionConfig)
11 tasks
Collaborator
Author
|
Superseded by #186 |
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.
Summary
Stacked on #174.
Plugin support for the VS Code extension
The b2c-cli plugin system (keychain managers, vault integrations, etc.) was only available through oclif hooks. The VS Code extension called
resolveConfig()directly, bypassing all installed plugins. This adds a new SDK module (@salesforce/b2c-tooling-sdk/plugins) that handles plugin discovery and loading without depending on@oclif/core, making it reusable by the extension, MCP server, or any non-oclif consumer.New SDK module (
packages/b2c-tooling-sdk/src/plugins/):discovery.ts— Discover installed plugins by reading the oclif data directoryloader.ts— Hook context shim + dynamic import of hook files (withnew Functionworkaround for esbuild CJS bundling)manager.ts—B2CPluginManagerorchestrator: invokesb2c:config-sources,b2c:http-middleware, andb2c:auth-middlewarehooks with same priority mapping as the CLIindex.ts— Barrel file +./pluginssubpath exportExtension integration (
packages/b2c-vs-extension/src/plugins.ts):B2CPluginManagerduring activation (fire-and-forget, non-fatal)getPluginConfigSources()returns{ sourcesBefore, sourcesAfter }for config resolutionCentralize config resolution
Replace 7 independent
resolveConfigWithPlugins()call sites with a singleB2CExtensionConfigsingleton that lazily resolves, caches, and exposesgetConfig()/getInstance()/getConfigError()/reset().dw.jsonfile watcher (RelativePattern+onDidSaveTextDocument) that auto-resets config and firesonDidReseteventonDidResetfor automatic refresh on config changesFileNotFoundin tree re-expansion after server switch (no error toasts for missing paths)WebDavConfigProvider(fully replaced byB2CExtensionConfig)resolveForDirectory()for the deploy-cartridge case that uses a different working directoryTest plan
pnpm --filter @salesforce/b2c-tooling-sdk run test:agent— plugin discovery, loader, manager testspnpm --filter b2c-vs-extension run typecheck:agent && pnpm --filter b2c-vs-extension run buildpnpm run lint:agentdw.jsonhostname — WebDAV tree should auto-refresh (check[Config]log lines)dw.jsonwhile tree is expanded — no error toasts for missing paths