Files
2026-05-27 23:29:53 +01:00

3.4 KiB

Tasks — add-currency-provider-fixer

1. Package scaffold

  • packages/finance/currency-provider-fixer/package.json — 0.1.0, sideEffects: false, deps on @suaveplan/currency / @suaveplan/currency-providers / @suaveplan/types / tslib, devDeps via catalog refs.
  • tsconfig.json + tsconfig.lib.json extending the repo base.
  • vite.config.ts with preserveModules and externals matching deps.
  • vitest.config.ts with pool: "forks", setupFiles polyfill stub, provider: "istanbul", thresholds 100/100/100/100.
  • tests/setup/polyfills.ts empty universal-tier stub.

2. Implementation

  • src/fixer/fixer.ts — FixerProvider implements CurrencyProvider:
    • constructor takes ApiKeyConfig, raises MISSING_CONFIG on empty apiKey.
    • resolves baseUrl (default https://data.fixer.io/api) and fetch (default globalThis.fetch).
    • fetchRates(options?) builds URLSearchParams (access_key, base, optional symbols), calls slim-core httpRequest, parses JSON, discriminates envelope, returns canonical RateFetchResult or raises typed error.
  • src/fixer/index.ts — explicit named barrel for the feature module (FixerProvider).
  • src/index.ts — explicit named barrel re-exporting FixerProvider.

3. Docs

  • src/fixer/fixer.md — Purpose / Features / Usage Basic / Usage Advanced / API Reference / Implementation Notes (≥200 words excluding code blocks).
  • README.md at package root with Install / Quick start / Features / Modules / Status.

4. Tests

  • src/fixer/fixer.test.ts covers every requirement in specs/currency-provider-fixer/spec.md. All tests import from @suaveplan/testing/runner; every it(...) has { timeout: 5000 }. No mocks — every fetch is a recording FetchLike closure.

5. Pre-ship gates (§13)

  • Spec reconciliation (step 0): every ### Requirement and every **Verified by:** matches a test that exists in src/fixer/fixer.test.ts.
  • bunx turbo lint typecheck test --filter=@suaveplan/currency-provider-fixer green.
  • bun run check from package dir green.
  • bunx turbo test:coverage --filter=@suaveplan/currency-provider-fixer green at 100/100/100/100.
  • bunx turbo build --filter=@suaveplan/currency-provider-fixer green.
  • Banned-pattern grep zero (TODO / FIXME / @deprecated / ts-ignore / ts-expect-error / .skip / .only / console.log).
  • Barrel-shape grep zero (no export * in <feature>/index.ts).
  • Test-runner-import grep zero (no direct from "vitest" / from "bun:test").
  • Missing .md grep zero.
  • README.md present.
  • No bare versions in package.json (every dep uses catalog: or workspace:^).
  • Subpath-export count matches feature count (1).
  • Security grep zero (no hardcoded keys / tokens / passwords).

6. Root-doc refresh (§13b)

  • bun scripts/folder-reorg/generate-manifest.ts — refresh MANIFEST.md.
  • Update STATUS.md (add currency-provider-fixer row under Completed).
  • Update SUMMARY.md (add per-package paragraph).
  • bunx markdownlint-cli2 --fix across touched files.

7. Archive (§14)

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