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

4.9 KiB

Tasks — Slim @suaveplan/currency-providers

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

  • Numbered checklist of every ### Requirement and #### Scenario drafted in specs/currency-providers/spec.md (10 requirements kept/added; see ./specs/currency-providers/spec.md).

Remove concrete provider modules

  • Delete src/providers/ecb/
  • Delete src/providers/fixer/
  • Delete src/providers/open-exchange-rates/
  • Delete src/providers/binance/
  • Delete src/providers/coingecko/
  • Delete src/providers/coinmarketcap/
  • Delete src/providers/cryptocompare/
  • Delete src/providers/kraken/
  • Delete src/providers/virtual/
  • Delete now-empty src/providers/ directory
  • Drop the 9 ./providers/<name>/<name> subpath exports from package.json
  • Drop @suaveplan/currency and @suaveplan/money from dependencies iff no remaining surface needs them — actually @suaveplan/currency stays (registry stores CurrencyProvider instances from that pkg) and @suaveplan/money drops (only the deleted VirtualCurrencyProvider used registerCurrency).

Add slim-core surface

  • Add PROVIDER_NOT_REGISTERED + PROVIDER_ALREADY_REGISTERED codes to CURRENCY_PROVIDER_CODES (src/error-codes/error-codes.ts)
  • Build src/registry/registry.ts — CurrencyProviderRegistry class with register / get / has / list / unregister
  • Build src/registry/registry.md (sibling doc, ≥200 words)
  • Build src/registry/registry.test.ts — covers every method, both registry error codes, list() sort determinism
  • Build src/factory/factory.ts — defineCurrencyProvider factory
  • Build src/factory/factory.md
  • Build src/factory/factory.test.ts
  • Build src/http/http.ts — httpRequest + composeAbortSignal
  • Build src/http/http.md
  • Build src/http/http.test.ts — happy path, HTTP_ERROR on non-2xx, header forwarding, caller-signal abort, timeout-signal abort, both signals abort, composeAbortSignal all four combinations
  • Update src/error-codes/error-codes.test.ts to assert the two new codes and prove they are reachable from registry call sites
  • Update src/index.ts — explicit named barrel with new exports + drop removed provider exports
  • Update package.json exports map: 5 subpaths total (., ./error-codes/error-codes, ./types/configs, ./registry/registry, ./factory/factory, ./http/http)
  • Update tests/dep-graph.test.ts to match the new subpath list (or delete the per-subpath assertions and replace with a check that every <feature>/index.ts is referenced from a subpath export)
  • Update vite.config.ts external list (drop @suaveplan/money)

Documentation

  • Update README.md Modules + Provider summary sections to describe the slim core (registry / factory / httpRequest / shared types) and link to the future sibling packages
  • Confirm every .ts in src/ has a sibling .md (the §13 step-5 grep returns zero)

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-providers and bun run check both green
  • Step 2 — bunx turbo test:coverage --filter=@suaveplan/currency-providers reports 100/100/100/100 via istanbul
  • Step 3 — bunx turbo build --filter=@suaveplan/currency-providers 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 = 5 (matches feature module count)
  • Step 9 — security-scan grep returns zero
  • Step 10 — dependent sweep (bunx turbo test --filter=...@suaveplan/currency-providers)

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
  • Update STATUS.md row for @suaveplan/currency-providers to describe the slim shape
  • Update SUMMARY.md row for @suaveplan/currency-providers likewise
  • bunx markdownlint-cli2 --fix across touched root + change files

Archive (AGENTS.md §14)

  • Fold specs/currency-providers/spec.md into openspec/specs/currency-providers/spec.md (apply REMOVED + ADDED to the canonical spec landed by the 2026-05-17 change)
  • Move openspec/changes/slim-currency-providers/ → openspec/archive/2026-05-17-slim-currency-providers/