Skip to content

@W-22653715 adding docs browser in vs extension#487

Draft
charithaT07 wants to merge 21 commits into
mainfrom
W-22653715-Docs-browser
Draft

@W-22653715 adding docs browser in vs extension#487
charithaT07 wants to merge 21 commits into
mainfrom
W-22653715-Docs-browser

Conversation

@charithaT07

@charithaT07 charithaT07 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Brief description of what this PR does.

What this PR does

Adds a new Docs Browser to the B2C DX VS Code extension. It's an
offline-first, in-editor reference for the SFCC Script API (dw.*) — every
class, interface, enum, method, property, and constant on the Script API
surface, available without leaving your editor.

Right-click any dw.* symbol in a JavaScript or TypeScript cartridge file
View B2C Docs → reader panel opens beside your code with the
signature, parameters, return type, throws, examples, and full description.
Class pages list all members inline so you can navigate without going back
to the sidebar.

Why

B2C developers lose 15–30 minutes a day context-switching between VS Code
and the official documentation site to look up Script API methods. The Docs
Browser eliminates that switch and removes the network dependency: 7,366
entries ship inside the VSIX and work fully offline.

This is also a Prophet-parity feature — Prophet's Script API browser is one
of the most-used parts of that extension, and we needed a first-party
equivalent.

Where the data comes from

JSDoc comments inside @salesforce/b2c-script-types .d.ts files vendored
into this repo at version 26.7.0. The same data already powers the
extension's IntelliSense — the Docs Browser is its rich reader complement.

Features

  • Sidebar tree under B2C-DX → Docs. Browse all dw.* packages and classes.
  • Reader panel beside the editor. Reused across opens, theme-aware.
  • Class pages show inline tables of constants, properties, and methods
    with full signatures. Every row is clickable.
  • Search — sidebar quick-pick or panel search box. Treats dot/slash forms
    as equivalent (dw.order.BasketMgr and dw/order/BasketMgr match the same entry).
  • Right-click → View B2C Docs in .js/.ts cartridge files. Resolves
    via Go-to-Definition for accuracy (no scraping).
  • Keyboard shortcuts:
    • Alt+D → search docs
    • Alt+Shift+D → view docs at cursor (cartridge files only)
  • Recently viewed — last 10 entries persist across restart.
  • Friendly "no match" toast with a one-click "Search Docs" recovery button.
  • Feature flag b2c-dx.features.docsBrowser to disable everything.

Architecture

  • Build pipeline (scripts/build-docs-index/) parses .d.ts files with
    ts-morph into a normalized DocEntry[] schema. Output is byte-deterministic
    and gated by CI to prevent stale committed JSON.
  • Runtime (src/docs-browser/) lazy-loads three tiers:
    1. Manifest on first call.
    2. Lightweight search dictionary on first sidebar/panel open.
    3. Full source file only when an entry is actually opened.
      Class member tables read straight from the search dictionary, so opening a
      class page never blocks the UI thread on the multi-megabyte full source.
  • Webview uses strict CSP with per-load nonces, no unsafe-eval, and
    HTML built entirely host-side from a tiny allowlist Markdown renderer.

Test plan

  • pnpm --filter b2c-vs-extension run typecheck:agent — clean
  • pnpm --filter b2c-vs-extension run lint:agent — clean
  • pnpm --filter b2c-vs-extension run test — 264 unit + 4 integration
    tests passing, 0 failing
  • pnpm --filter b2c-vs-extension run build:docs-index deterministic
    across rebuilds (CI gate fails on drift)

What changed

  • New module src/docs-browser/ (loader, search, tree, webview, recents,
    symbol resolver, entry renderer, Markdown renderer).
  • Build pipeline scripts/build-docs-index/ plus generated index in
    resources/docs/.
  • Two new keybindings (Alt+D, Alt+Shift+D) and four new commands.
  • New CI step verifies the committed docs index is up to date.
  • New Vitepress page docs/vscode-extension/docs-browser.md.
  • New devDependency ts-morph (build-time only, not bundled).

Testing

How was this tested?

Dependencies

  • No net-new third-party dependencies were added
  • If net-new third-party dependencies were added, rationale/discussion is included and 3pl-approved is set by a maintainer

  • Tests pass (pnpm test)
  • Code is formatted (pnpm run format)

charithaT07 and others added 10 commits May 27, 2026 22:55
* @W-22210602 CIP analytics vs extension dashboard

* CIP analytics VS extension UX changes - claude assisted

* @W-22210602: Adding Analytics report support in VS Code extension (#402)

* @W-22210602: Adding CIP analytics to a new menu

* @W-22210602: Adding Analytics report support in VS Code extension

* @W-22210602: Adding Analytics report support in VS Code extension

* fixing the result exports in csv and json

* @W-22210602: Adding Analytics report support in VS Code extension

* @W-22210602: Adding Analytics report support in VS Code extension

* @W-22210602: Adding Analytics report support in VS Code extension

* @W-22210602: Adding Analytics report support in VS Code extension

* cip analytics report ux refinements

---------

Co-authored-by: CharithaT07 <charitha.tadakanti777@gmail.com>

* adding some changes in query builder

* added some changes in cip analytics vs extension

* initial changes for supporting multi realm in CIP

* adding save query and multi realm support

* adding save query and multi realm support

* fixing lint

* refactored to make the ux resuable

* refactored to make the ux resuable

* Merge remote-tracking branch 'upstream/main' into W-22210602-CIP-Analytics-VS-extension

* docs: add page-specific SEO descriptions to SCAPI schemas and CI/CD pages

These two pages were falling back to the site-wide default meta
description. Add concise page-specific descriptions and a doc-only
changeset.

* fix: bump qs and picomatch to resolve CVE-2026-2391 and CVE-2026-33671 (#450)

- qs: 6.14.1 → 6.15.2 (fixes CWE-770 resource allocation without limits)
- picomatch: 2.3.1 → 2.3.2, 4.0.3 → 4.0.4 (fixes ReDoS vulnerability)

* addressing the review comments

* addressing the review comments

* fix: dedupe @salesforce/b2c-tooling-sdk in vs-extension package.json after merge

---------

Co-authored-by: amit-kumar8-sf <amit.kumar.sf1408@gmail.com>
Co-authored-by: Charles Lavery <clavery@salesforce.com>
Co-authored-by: Kevin He <kevin.he@salesforce.com>
* @W-22619604 initial changes for ISML support

* @W-22619604 ISML support in vs extension

* temporary change in workflows to trigger build on develop

* Fixing the lint

* minor refactors
* @W-22653726 adding XSD valiation in vs extension

* adding XSD valiation in vs extension

* adding XSD valiation in vs extension

* adding XSD valiation in vs extension

* adding XSD valiation in vs extension
* Onboarding walkthrough for B2C VS Code extension

@W-22210602

Adds a 5-phase getting-started walkthrough that guides users through CLI
install, dw.json setup, OAuth/Basic auth, cartridge deploy, and scaffold
generation. Includes a role-based onboarding panel with persona-specific
paths (Storefront, API/Integration, DevOps, AI-augmented).

Resolved Config inspect panel:
- Mask secrets as a lock pill instead of first-4 preview
- Stats strip with field/source/secret counts
- Source-tinted pills, zebra-striped table, accent-bordered group cards

Scaffold:
- Always generate cartridges into <workspace>/cartridges so the
  Cartridges view picks them up without dw.json configuration
- Explicit Cartridges-view refresh after .project creation, since the
  **/.project FileSystemWatcher can race scaffold writes

* @W-22799934: Creation of walkthrough on VS Code

* @W-22799934: Update eslint.config.mjs

* @W-22799934: Update package.json

* @W-22799934: Changes for onboarding walkthrough
# Conflicts:
#	packages/b2c-vs-extension/README.md
#	packages/b2c-vs-extension/package.json
#	packages/b2c-vs-extension/scripts/esbuild-bundle.mjs
#	packages/b2c-vs-extension/src/code-sync/deploy-command.ts
#	packages/b2c-vs-extension/src/extension.ts
#	packages/b2c-vs-extension/src/safety.ts
#	packages/b2c-vs-extension/src/telemetry.ts
…ce behavior (#483)

* ci: use RENOVATE_TOKEN for Renovate to enable vulnerability alert access

The default GITHUB_TOKEN cannot read Dependabot/vulnerability alerts,
causing 'Cannot access vulnerability alerts' on the Dependency Dashboard.
Switch to the RENOVATE_TOKEN secret which can be granted alert read access.

* fix(vs-extension): make extension resilient offline and when instance unreachable

A malformed dw.json could throw out of activateInner() and disable the
entire extension, leaving only the two fallback commands — which broke
local code browsing (cartridge discovery, Script API IntelliSense,
cartridge-path require resolution, CAP detection, scaffolding), none of
which need a connection.

- extension.ts: guard updateInstanceStatusBar() so a garbled/empty dw.json
  can never escape the activation path; gate on hasB2CInstanceConfig()
  instead of mere config truthiness (fixes a "$(cloud) unnamed" mislabel).
- SDK DwJsonSource.listInstances(): tolerate a malformed dw.json (log +
  return []) like the resolver already does — defense in depth for all
  callers (instance-manager, instance switcher, CLI setup:instance:*).
- Connection-down failures on the WebDAV/Content/Sandbox trees now collapse
  into a single throttled notification (notify.ts) instead of one toast per
  expand/refresh/poll tick; log tailing de-dups consecutive identical errors.
- Sandbox view distinguishes "missing OAuth credentials" from "no realm" via
  a b2c-dx.sandbox.needsOAuth context key + welcome variant.
- Remove leftover debug temp-zip write/console.log from the Content FS provider.
- Add SDK unit test + a malformed-dw.json activation regression config.
@github-actions github-actions Bot added the needs-3pl-review PR introduces net-new third-party dependencies and needs discussion label Jun 9, 2026
@charithaT07 charithaT07 marked this pull request as ready for review June 10, 2026 16:26
clavery and others added 6 commits June 10, 2026 12:57
…ISML scanner (#488)

The ISML scanner loaded vscode-html-languageservice via createRequire()
+ deep-path require() calls. esbuild treated the local `require` binding
as user-shadowed and left the calls as runtime requires in the bundle,
so the scanner code was never inlined. Because the VSIX is packaged
with `vsce --no-dependencies`, the deep submodule paths were unresolvable
at runtime and `Module._resolveFilename` threw during activation.

The crash fired on the first activation event (onLanguage:isml, which
also activates redhat.vscode-xml). With activation cached as failed,
every other event was short-circuited — no "B2C DX" output channel, no
instance selector, no commands worked.

Switch to direct ESM imports so esbuild bundles the scanner code inline.
The built dist/extension.cjs now has zero `vscode-html-languageservice`
references; the extension activates cleanly under --no-dependencies.
* @W-22961131 fix adding quotes for reserved keywords

* adding group by in the query builder

* adding better date time filtering

* added saved queries to the side view

* added the new curated reports aligning sdk

* fixing lint

* minor changes in reports
@clavery

clavery commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

@charithaT07 Can you look at this in light of the new docs work I did for the CLI and MCP. There is significant changes there and any IDE extension related to docs should be building on top of that.

Base automatically changed from develop to main July 12, 2026 20:22
@charithaT07 charithaT07 marked this pull request as draft July 13, 2026 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-3pl-review PR introduces net-new third-party dependencies and needs discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants