2.8 KiB
2.8 KiB
Tasks — Fix storage-uri-plugin-bundle ./node-fetch subpath emit
1. Spec authoring
- 1.1
proposal.md(this change) — including## Impactper §14a - 1.2
specs/storage-uri-plugin-bundle/spec.md— ADDED requirement with three scenarios, each with a**Verified by:**line
2. Implementation
- 2.1 Edit
packages/storage/storage-uri-plugin-bundle/vite.config.ts:- Change
lib: { entry: "src/index.ts", formats: ["es"] }to multi-entry form:lib: { entry: { index: "src/index.ts", "node-fetch/node-fetch": "src/node-fetch/node-fetch.ts" }, formats: ["es"] } - Keep
rollupOptions.output.preserveModules: trueand the existingentryFileNames: "[name].js"pattern - Keep externals as-is (
node:fs/promisesandnode:urlare already there)
- Change
- 2.2
bunx turbo build --filter=@suaveplan/storage-uri-plugin-bundleand verifydist/node-fetch/node-fetch.jsexists, is non-empty, and starts with valid ESM (import/exportstatements)
3. Tests
- 3.1
tests/build/node-fetch-emit.test.ts:- Scenario
"build emits a non-empty dist/node-fetch/node-fetch.js"—node:fs.statSyncthe artifact, assertisFile()andsize > 0 - Scenario
"dist/index.js contains no node: imports"—node:fs.readFileSyncthe root entry, regex-match/from\s+["']node:/, assert zero matches
- Scenario
- 3.2
tests/build/node-fetch-runtime-import.test.ts:- Scenario
"emitted node-fetch.js exports nodeFileFetch as a function"—await import(...)the emitted file, asserttypeof imported.nodeFileFetch === "function"
- Scenario
- 3.3 Both new test files MUST set
{ timeout: 30000 }on everyit(...)(they shell out to a build under the hood — or alternatively they assume the build already ran in the same turbo pipeline; document the chosen approach in the test file's leading comment) - 3.4 Verify every existing
src/node-fetch/node-fetch.test.tsstill passes — no behavior change
4. Pre-archive verification (5-gate triple)
- 4.1
bun run check— Biome 0/0/0/0 - 4.2
bunx turbo lint typecheck test --filter=@suaveplan/storage-uri-plugin-bundle— green - 4.3
bunx turbo test:coverage --filter=@suaveplan/storage-uri-plugin-bundle— 100/100/100/100 - 4.4
bun scripts/openspec-conformance.ts @suaveplan/storage-uri-plugin-bundle— exit 0 - 4.5
bunx turbo build --filter=@suaveplan/storage-uri-plugin-bundle— green - 4.6 Manual:
ls -la packages/storage/storage-uri-plugin-bundle/dist/node-fetch/SHOULD listnode-fetch.js,node-fetch.js.map,node-fetch.d.ts,node-fetch.d.ts.map
5. Archive
- 5.1 Fold the ADDED requirement into
openspec/specs/storage-uri-plugin-bundle/spec.md - 5.2 Move folder to
openspec/archive/2026-05-19-fix-storage-uri-plugin-bundle-node-fetch-emit/ - 5.3 Refresh
MANIFEST.mdif dep graph shifted (it should not — only build config changes)