Files
suaveplan/openspec/archive/2026-05-16-add-storage-file-bun-fs-adapter/tasks.md
2026-05-27 23:29:53 +01:00

2.5 KiB

Tasks: add-storage-file-bun-fs-adapter

Implementation

  • 1. Author src/bun-fs/bun-fs.ts exporting defaultBunFs(): NodeFsLike and pickDefaultFs(): NodeFsLike. defaultBunFs() composes over the defaultNodeFs() base, overriding readFile to Bun.file(path).bytes() and writeFile to Bun.write(path, data).
  • 2. Author src/bun-fs/bun-fs.test.ts using @suaveplan/testing/runner. Cover: round-trip via Bun.write+Bun.file, forwarding of every delegated method on a real temp dir, and pickDefaultFs() returning a callable NodeFsLike.
  • 3. Author src/bun-fs/bun-fs.md (sibling doc, §4 conformant — Purpose, Features, Usage Basic, Usage Advanced, API Reference, Implementation Notes; ≥200 words excl. code).
  • 4. Author src/bun-fs/index.ts with explicit named re-exports (§6a — no export *).
  • 5. Switch resolveConfig in src/node-fs-storage/node-fs-storage.helpers.ts from defaultNodeFs() to pickDefaultFs(). Behaviour unchanged when options.fs is provided.
  • 6. Add defaultBunFs and pickDefaultFs to src/index.ts exports.
  • 7. Add ./bun-fs/bun-fs to package.json exports map.
  • 8. Update README.md Modules section to list the new module.

Verification

  • 9. bunx turbo lint typecheck test --filter=@suaveplan/storage-file — all green.
  • 10. bunx turbo test:coverage --filter=@suaveplan/storage-file — 100/100/100/100 on every file in src/.
  • 11. bunx turbo build --filter=@suaveplan/storage-file — green.
  • 12. Banned-pattern scan in src/ (zero output expected): grep -rn "@deprecated\|TODO\|FIXME\|ts-ignore\|ts-expect-error\|\.skip\|\.only" packages/storage/storage-file/src/ --include="*.ts".
  • 13. Test-runner import scan (zero output): grep -rnE "from ['\"](vitest|bun:test)['\"]" packages/storage/storage-file/src/.
  • 14. Subpath export count matches feature-module count.
  • 15. Sibling .md exists for every implementation .ts in src/bun-fs/.

Archive

  • 16. Fold specs/storage-file/spec.md into openspec/specs/storage-file/spec.md.
  • 17. Move openspec/changes/add-storage-file-bun-fs-adapter/ to openspec/archive/<yyyy-mm-dd>-add-storage-file-bun-fs-adapter/.
  • 18. Refresh MANIFEST.md (bun scripts/folder-reorg/generate-manifest.ts) and run bunx markdownlint-cli2 --fix on touched docs.