Skip to content

Document VS Code extension and expand test coverage#409

Merged
clavery merged 10 commits into
mainfrom
feature/vscode-docs
May 13, 2026
Merged

Document VS Code extension and expand test coverage#409
clavery merged 10 commits into
mainfrom
feature/vscode-docs

Conversation

@clavery
Copy link
Copy Markdown
Collaborator

@clavery clavery commented May 8, 2026

Summary

  • New `/vscode-extension/` docs section (overview with Developer Preview banner, installation with dynamic VSIX download link, configuration reference, feature tour) parallel to the MCP Server section. Sidebar/nav wired up; `ide-integration.md` cross-links so it stays focused on Prophet/IntelliJ.
  • Replace the placeholder activation test with a real Extension Host integration suite (`src/test/integration/activation.test.ts`) that asserts activation, command-registration parity with `package.json`, declared debug type, and view focus-command registration.
  • Fix the long-standing `tsconfig.test.json` `rootDir: src/test` trap. Tests now import production modules directly (deleted the `sandbox-clone-helpers.ts` mirror).
  • New unit tests for `WebDavMappingsProvider` and `SandboxConfigProvider` (no `vscode` import where avoidable). 22 → 66 passing.
  • Extend `ci-vs-extension.yml` path filter to also fire on SDK changes (extension bundles the SDK via esbuild, so SDK regressions can break activation) and lockfile/workspace catalog changes; cache `.vscode-test` binary.
  • Bumped `@vscode/vsce` floor to `^3.9.1`; added `c8` for coverage (no thresholds yet — Extension Host runs out-of-process so reported coverage is a low-bound).
  • Doc-only changeset (`@salesforce/b2c-dx-docs: patch`).

Notes for reviewers

  • Screenshots are placeholders. Each `.png` under `docs/vscode-extension/images/` is a 1×1 PNG so the build resolves; every image site has a `` HTML comment immediately above it. Grep for that marker to find every slot awaiting a real image.
  • VSIX download link is dynamic. `docs/vscode-extension/release.data.ts` is a VitePress build-time data loader that lists GitHub releases, picks the newest `b2c-vs-extension@X.Y.Z`, and exports `{ version, vsixDownloadUrl, ... }`. On any failure (rate-limit, no releases yet, parse error) it returns `unavailable: true` and the page falls back to a "Browse releases" link. This means the docs build never breaks because of a missing release.
  • Release/docs cadence: the floating `b2c-vs-extension@latest` git tag is moved on every VSCE publish but the docs workflow won't auto-rebuild on that — so a freshly published VSCE may briefly trail by one version until the next docs build. Adding a docs-rebuild trigger on `b2c-vs-extension@*` tag pushes is a reasonable separate follow-up.
  • CI coverage: `ci-vs-extension.yml` now also fires on SDK changes and caches the VS Code binary (~150 MB). Marginal cost on SDK PRs is ~90s once the cache warms.

Test plan

  • CI: `ci-vs-extension.yml` runs (66 tests pass under `xvfb-run` on Linux); `ci.yml` runs typecheck + lint for the extension; main CI green for SDK and other packages.
  • Local: `pnpm --filter b2c-vs-extension run test` → 66 passing.
  • Local: `pnpm run docs:build` → clean. Open `docs/.vitepress/dist/vscode-extension/installation.html` and confirm the dynamic VSIX download link renders (or fallback if API was unavailable).
  • Local: `pnpm run lint:agent && pnpm run typecheck:agent` → clean.
  • Visual review of the four new doc pages — install/configuration/features structure, sidebar wiring, top-nav "VS Code" entry.
  • Future: replace placeholder PNGs with real screenshots.

Add a /vscode-extension/ docs section (overview, installation with dynamic
VSIX download link, configuration, features) parallel to the MCP Server
section. Replace the placeholder activation test with a real Extension
Host integration suite, fix the rootDir trap so unit tests can import
production code directly, and add unit tests for WebDavMappingsProvider
and SandboxConfigProvider. Extend ci-vs-extension.yml to also run on SDK
changes and cache the .vscode-test binary.
@github-actions github-actions Bot added the needs-3pl-review PR introduces net-new third-party dependencies and needs discussion label May 8, 2026
@clavery clavery added 3pl-approved Maintainer approved net-new third-party dependency additions and removed needs-3pl-review PR introduces net-new third-party dependencies and needs discussion labels May 8, 2026
- Drop unimplemented "Compare with Instance" diff from features.md and
  remove its placeholder image; the diffCartridge command is stub
  functionality.
- Fix project-root pinning docs: "Use as B2C Commerce Root" only shows on
  a workspace-root folder when the workspace has more than one folder
  open; "Reset" is palette-only.
- Replace internal-source pointer with an inline rule in the cloned
  sandbox indicators paragraph.
- Add 24h TTL to the VSIX release data loader cache so a maintainer who
  cuts a release won't see a stale version on the next local docs build.
- Include pnpm-lock.yaml in the .vscode-test cache key so a test-cli /
  test-electron version bump invalidates the cache.
- Comment the activation test's command-registration check to explain why
  it doubles as a swallowed-failure detector.
- Tidy webdav-mappings.test.ts stub.
@clavery clavery marked this pull request as ready for review May 8, 2026 00:41
clavery added 8 commits May 8, 2026 13:35
Replace the invisible 1x1 PNG placeholders with per-slot SVG placeholders
that render as dashed-border boxes with the slot title, description, and
a "replace with <slot>.png" hint. Reviewers and the user can now see
exactly where each screenshot belongs on the rendered page.

Updated TODO comments to spell out the swap path
(.svg -> .png) and added images/README.md with the replacement workflow.
Telemetry:
- Wire SDK Telemetry into the VS Code extension (project=b2c-vs-extension)
  using the same App Insights connection string as the MCP server.
- Lifecycle events (EXTENSION_ACTIVATED / DEACTIVATED / ACTIVATION_FAILED)
  plus per-command COMMAND_INVOKED with outcome and duration via
  registerSafeCommand. Exceptions reported through sendException.
- Honors vscode.env.isTelemetryEnabled (telemetry.telemetryLevel) plus
  SFCC_DISABLE_TELEMETRY / SF_DISABLE_TELEMETRY. Persists anonymous cliId
  in globalStorageUri.

Docs:
- Lead Configuration with "Connecting to a B2C Instance" — a per-feature
  credential requirements table modeled on the CLI's per-command auth
  sections (sandbox.md, scapi-schemas.md). Adds an example dw.json with
  inline comments tagging each block to features.
- Demote b2c-dx.* settings to a "Settings reference" section near the
  bottom with a clear "you usually don't need to change these" callout.
- Add Telemetry section documenting what's collected, what's not, and
  three independent opt-out paths.
- Add per-feature "Requires" callouts on every feature in features.md
  plus a top-of-page jump nav.
- initTelemetry is now fire-and-forget — client.start() runs in the
  background so activation never blocks on it. trackEvent() was already
  in-memory + batched, so subsequent sendEvent calls are non-blocking.
- Drop per-command COMMAND_INVOKED events. Replace with FEATURE_USED,
  bucketed by broad category (sandbox/webdav/content/codeSync/apiBrowser/
  debugger/scaffold/cap/pageDesigner/logs/instance) and deduped to one
  event per category per session.
- Add b2c-dx.telemetry.enabled setting (default true). Telemetry is off
  if any of the three signals say off: VS Code's telemetry.telemetryLevel,
  this setting, or the SF/SFCC env var.
- Strip the Telemetry section from the docs site — the setting's
  description in the VS Code Settings UI is the disclosure surface. Add
  the row to the configuration page's settings reference table.
- Wire markFeatureUsed into the page-designer command and the script
  debugger factory so non-safety-wrapped features still register usage.
- Soften the intro and per-feature copy on index.md / installation.md;
  remove dw.json/SFCC_* jargon from outward-facing prose.
- Reorder highlights and add screenshots for the three biggest ones
  (Sandbox Realm Explorer, Library Explorer, Script Debugger). Make
  highlight images clickable so the inline thumbnail can be expanded
  to the full-resolution capture.
- Rename Cartridge Code Sync -> "Cartridge Management and Code Watch/
  Upload"; add SCAPI API Explorer as a dedicated highlight.
- Drop the Page Designer Assistant highlight; promote Scaffolding to a
  highlight in its place (covers cartridges, controllers, hooks, jobs).
- Expand the Script Debugger blurb to call out controllers, jobs,
  custom scripts, SCAPI hooks, Custom APIs, breakpoints, and log points.
- Delete features.md; fold Log Tailing, Active Instance Status Bar, and
  B2C CLI Plugin Support onto index.md and update sidebar / cross-links.
- Drop Project Root Pinning from configuration.md (uncommon use case).
- Mention the VS Code Extension on docs/guide/index.md with a quick-
  install block parallel to the CLI/MCP installs, using the existing
  release.data.ts loader.
@clavery clavery merged commit ec31234 into main May 13, 2026
7 checks passed
@clavery clavery deleted the feature/vscode-docs branch May 13, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3pl-approved Maintainer approved net-new third-party dependency additions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant