Files
suaveplan/openspec/archive/2026-05-17-add-currency-provider-virtual/tasks.md
2026-05-27 23:29:53 +01:00

3.5 KiB

Tasks — Add @suaveplan/currency-provider-virtual

Spec-completeness preflight (AGENTS.md §12a)

  • Numbered checklist of every ### Requirement and #### Scenario drafted in specs/currency-provider-virtual/spec.md (5 requirements, 16 scenarios).

Package scaffold

  • packages/finance/currency-provider-virtual/package.json (0.0.0, universal, sideEffects: false)
  • tsconfig.json, tsconfig.lib.json
  • vite.config.ts (externals: @suaveplan/currency, @suaveplan/currency-providers, @suaveplan/error, @suaveplan/types, tslib)
  • vitest.config.ts (istanbul, 100/100/100/100, polyfills setup)
  • tests/setup/polyfills.ts
  • README.md (≥200 words, Modules section)

Implementation

  • src/error-codes/error-codes.ts — re-export UNKNOWN_CURRENCY code + CurrencyProviderError from slim core for ergonomic access
  • src/error-codes/error-codes.md
  • src/provider/provider.types.ts — VirtualCurrencyProviderConfig, VirtualCurrencyProviderOptions, VirtualRateEntry shapes
  • src/provider/provider.ts — VirtualCurrencyProvider class
  • src/provider/provider.md
  • src/index.ts — explicit named barrel
  • src/provider/index.ts (feature barrel)

Tests

  • src/provider/provider.test.ts — covers constructor, setRate, removeRate, clear, hasRate, getRate, listCurrencies, fetchRates (default base, custom base, target filter, empty table), UNKNOWN_CURRENCY error path, FakeClock-driven timestamp, supportsVirtual flag
  • tests/dep-graph.test.ts — root barrel has no export *; feature barrels have no export *; subpath exports match feature modules

Documentation

  • Every implementation .ts has a sibling .md (§13 step 5 grep returns zero)
  • README.md at package root with Install / Quick start / Features / Modules sections

Pre-archive gates (AGENTS.md §13)

  • Step 0 — spec reconciliation: every ### Requirement and **Verified by:** resolves to a real file + verbatim test name
  • Step 1 — bunx turbo lint typecheck test --filter=@suaveplan/currency-provider-virtual
  • Step 2 — bunx turbo test:coverage --filter=@suaveplan/currency-provider-virtual reports 100/100/100/100 via istanbul
  • Step 3 — bunx turbo build --filter=@suaveplan/currency-provider-virtual green
  • Step 4 — banned-pattern grep returns zero
  • Step 4a — barrel-shape grep returns zero
  • Step 4b — test-runner-import grep returns zero
  • Step 5 — missing-.md grep returns zero
  • Step 6 — README present
  • Step 7 — bare-version grep returns zero
  • Step 8 — subpath-export count matches feature module count
  • Step 9 — security-scan grep returns zero

Root-doc refresh (AGENTS.md §13b)

  • Re-run bun scripts/folder-reorg/generate-manifest.ts to refresh MANIFEST.md
  • Re-run bun scripts/generate-missing.ts to refresh MISSING.yml
  • Add @suaveplan/currency-provider-virtual row to STATUS.md
  • Add @suaveplan/currency-provider-virtual row to SUMMARY.md
  • bunx markdownlint-cli2 --fix across touched root + change files

Archive (AGENTS.md §14)

  • Fold specs/currency-provider-virtual/spec.md into openspec/specs/currency-provider-virtual/spec.md
  • Move openspec/changes/add-currency-provider-virtual/ → openspec/archive/2026-05-17-add-currency-provider-virtual/