Files
vscode-cowriting-plugin/esbuild.mjs
T
BenStullsBets 2170a0d282 feat!: sunset the review-panel webview — built-in preview + native diff are the review surfaces (D3/D17, spec §6.10); Keep/Reject lens copy (PUC-2)
Deletes the last bespoke UI surface (TrackChangesPreviewController + its
sealed webview client assets); every entry point re-points at native VS
Code chrome per spec §5: the #41 right-click entries become
cowriting.openReviewPreview (enter coediting if needed -> "Open Preview to
the Side"), Ctrl+Alt+R/Cmd+Alt+R moves to cowriting.reviewChanges (native
diff), and the F12 CodeLens per-proposal titles read "Keep"/"Reject" with
a top-of-file "Keep all (N)"/"Reject all" pair once >=2 proposals are
pending. EditFlow drops its own askClaude/askEditInstruction (the
webview's only caller) and its now-unused constructor params.

Coverage that lived only in the webview's test seams (renderHtmlFor,
receiveMessage, isOpen, ...) moves to direct calls against the surviving
controllers/pure renderReview (test/e2e/suite/helpers.ts gains a shared
renderHtmlFor probe); a genuine gap (pending-proposal + unchanged-block
rendering) is backfilled in test/previewAnnotations.test.ts. README's "how
it works" is rewritten as the native-surface map; the superseded F6/F7/F9/
F10/F11 sections are kept as a marked historical record rather than
deleted outright.

292 unit + 91 E2E green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 14:51:18 -07:00

63 lines
1.8 KiB
JavaScript

import { build, context } from "esbuild";
const watch = process.argv.includes("--watch");
/** @type {import('esbuild').BuildOptions} */
const options = {
entryPoints: ["src/extension.ts"],
outfile: "out/extension.cjs",
bundle: true,
platform: "node",
format: "cjs",
target: "node22",
sourcemap: true,
// vscode is provided by the host; @cline/sdk is ESM-only and is loaded at
// runtime via dynamic import() from node_modules, so keep both external.
external: ["vscode", "@cline/sdk"],
logLevel: "info",
};
/** @type {import('esbuild').BuildOptions} */
const liveTurnOptions = {
entryPoints: ["src/liveTurn.ts"],
outfile: "out/liveTurn.mjs",
bundle: true,
platform: "node",
format: "esm",
target: "node22",
sourcemap: true,
external: ["vscode", "@cline/sdk"],
logLevel: "info",
};
/** @type {import('esbuild').BuildOptions} */
const previewMermaidOptions = {
entryPoints: ["media/preview-mermaid.ts"],
outfile: "out/media/preview-mermaid.js",
bundle: true,
// Task 7 (Q4): contributed via markdown.previewScripts into the BUILT-IN
// preview's webview (a browser context) — mermaid is bundled IN (and ONLY
// in) this asset so it never bloats the extension-host bundle (the
// @cline/sdk size discipline).
platform: "browser",
format: "iife",
target: "es2020",
sourcemap: true,
logLevel: "info",
};
if (watch) {
const ctx = await context(options);
const ctxLive = await context(liveTurnOptions);
const ctxPreviewMermaid = await context(previewMermaidOptions);
await Promise.all([ctx.watch(), ctxLive.watch(), ctxPreviewMermaid.watch()]);
console.log("esbuild: watching…");
} else {
await build(options);
await build(liveTurnOptions);
await build(previewMermaidOptions);
console.log(
"esbuild: build complete → out/extension.cjs + out/liveTurn.mjs + out/media/preview-mermaid.js",
);
}