Skip to content

Commit 2ab9d83

Browse files
committed
fixup! docs: split qraft tree-shaking plans
1 parent a4d829b commit 2ab9d83

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

docs/superpowers/plans/2026-05-08-qraft-tree-shaking-source-maps.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. When spawning workers, prefer a mini model and keep `reasoning_effort` at `high` or lower. Steps use checkbox (`- [ ]`) syntax for tracking.
44
5-
**Goal:** Thread incoming bundler source maps through the tree-shaking transform so rewritten call sites remain traceable to original user code.
5+
**Goal:** Thread incoming bundler source maps through the tree-shaking transform so rewritten user call sites remain traceable to original source code.
66

7-
**Architecture:** This spec builds on the pipeline split. `src/lib/plugin/create-qraft-tree-shake-plugin.ts` forwards `this.inputSourceMap` into `transformQraftTreeShaking`. `src/core.ts` accepts the incoming map and passes it to Babel generator through `inputSourceMap`. Unit tests assert the composed map with `@jridgewell/trace-mapping`, while the external `tree-shaking-bundlers` fixture confirms the change does not break real bundler output.
7+
**Architecture:** This spec builds on the pipeline split. `src/lib/plugin/create-qraft-tree-shake-plugin.ts` forwards `this.inputSourceMap` into `transformQraftTreeShaking` as part of the plugin contract. `src/core.ts` accepts the incoming map and passes it to Babel generator through `inputSourceMap`. The composition scope is intentionally narrow: only rewritten user call sites must resolve back to original source positions. Synthetic inserts at the top level or other generated-only regions may remain mapped to generated code if that keeps the implementation simple and predictable. Unit tests assert the composed map with `@jridgewell/trace-mapping`, while the external `tree-shaking-bundlers` fixture confirms the change does not break real bundler output.
88

99
**Tech Stack:** TypeScript, Babel generator, unplugin, `@jridgewell/trace-mapping`, Vitest, Yarn 4.
1010

@@ -108,15 +108,15 @@ handler(this: any, code, id) {
108108
Use this generator call in `src/core.ts`:
109109

110110
```ts
111-
const result = generate(ast, {
112-
sourceMaps: true,
113-
sourceFileName: id,
114-
inputSourceMap,
115-
jsescOption: { minimal: true },
116-
});
111+
const result = generate(ast, {
112+
sourceMaps: true,
113+
sourceFileName: id,
114+
inputSourceMap,
115+
jsescOption: { minimal: true },
116+
});
117117
```
118118

119-
Keep the rest of the transform unchanged. This spec is only about source-map composition.
119+
Keep the rest of the transform unchanged. This spec is only about source-map composition for rewritten user call sites; synthetic generated statements do not need bespoke original-source mapping.
120120

121121
- [ ] **Step 3: Re-run the focused source-map test**
122122

0 commit comments

Comments
 (0)