93 lines
4.2 KiB
Markdown
93 lines
4.2 KiB
Markdown
# Tasks — Add @suaveplan/currency-provider-binance
|
|
|
|
## Spec-completeness preflight (AGENTS.md §12a)
|
|
|
|
- [x] Numbered checklist of every `### Requirement` and `#### Scenario`
|
|
drafted in `specs/currency-provider-binance/spec.md` (5
|
|
requirements, 18 scenarios — see
|
|
`./specs/currency-provider-binance/spec.md`).
|
|
|
|
## Scaffold the package
|
|
|
|
- [x] Create `packages/finance/currency-provider-binance/` directory
|
|
- [x] Author `package.json` — name, exports map (root + single subpath
|
|
`./binance/binance`), deps on `@suaveplan/currency`,
|
|
`@suaveplan/currency-providers`, `@suaveplan/error`,
|
|
`@suaveplan/types`, `tslib`; dev-deps on `@suaveplan/testing`,
|
|
vitest, vite, vite-plugin-dts, `@vitest/coverage-istanbul`
|
|
- [x] Author `tsconfig.json` + `tsconfig.lib.json` mirroring the slim
|
|
core
|
|
- [x] Author `vite.config.ts` with the same external list as the slim
|
|
core plus `@suaveplan/currency-providers`
|
|
- [x] Author `vitest.config.ts` with 100/100/100/100 istanbul thresholds
|
|
- [x] Author `tests/setup/polyfills.ts` (no polyfills needed —
|
|
universal-tier)
|
|
|
|
## Implement the provider
|
|
|
|
- [x] `src/binance/binance.ts` — `BinanceProvider` class,
|
|
`BINANCE_PROVIDER_NAME`, `BINANCE_DEFAULT_BASE_URL`,
|
|
`ensureTickerArray` shape guard, `decodeRates` suffix decoder,
|
|
`filterTargets` raising `UNKNOWN_CURRENCY`, `httpRequest`
|
|
delegation with caller signal + timeout forwarding, `PARSE_ERROR`
|
|
wrapping of `response.json()`
|
|
- [x] `src/binance/binance.md` — sibling doc, six required sections,
|
|
≥200 words
|
|
- [x] `src/binance/binance.test.ts` — happy path (default + custom
|
|
base), targets filter, custom baseUrl, sanitisation (zero,
|
|
negative, non-finite, suffix-equals-symbol), every error code
|
|
reachable, signal forwarding, timeout forwarding, default-fetch
|
|
fallback
|
|
- [x] `src/binance/index.ts` — explicit named barrel
|
|
- [x] `src/index.ts` — explicit named barrel re-exporting the three
|
|
public symbols
|
|
|
|
## Documentation
|
|
|
|
- [x] `README.md` — H1, one-paragraph description, install snippet,
|
|
quick start, features list, Modules list linking the sibling
|
|
`.md`, Status note
|
|
- [x] Confirm every `.ts` in `src/` has a sibling `.md` (the §13 step-5
|
|
grep returns zero)
|
|
|
|
## Pre-archive gates (AGENTS.md §13)
|
|
|
|
- [x] Step 0 — spec reconciliation: every `### Requirement` and
|
|
`**Verified by:**` resolves to a real file + verbatim test name
|
|
- [x] Step 1 — `bunx turbo lint typecheck test --filter=@suaveplan/currency-provider-binance`
|
|
green and `bun run check` green
|
|
- [x] Step 2 — `bunx turbo test:coverage --filter=@suaveplan/currency-provider-binance`
|
|
reports 100/100/100/100 via istanbul
|
|
- [x] Step 3 — `bunx turbo build --filter=@suaveplan/currency-provider-binance` green
|
|
- [x] Step 4 — banned-pattern grep returns zero
|
|
- [x] Step 4a — barrel-shape grep returns zero
|
|
- [x] Step 4b — test-runner-import grep returns zero
|
|
- [x] Step 5 — missing-`.md` grep returns zero
|
|
- [x] Step 6 — README present
|
|
- [x] Step 7 — bare-version grep returns zero
|
|
- [x] Step 8 — subpath-export count = 1 (matches feature module count)
|
|
- [x] Step 9 — security-scan grep returns zero
|
|
- [x] Step 10 — dependent sweep
|
|
(`bunx turbo test --filter=...@suaveplan/currency-provider-binance`)
|
|
|
|
## Root-doc refresh (AGENTS.md §13b)
|
|
|
|
- [x] Update `scripts/folder-reorg/assignment.yml` — add
|
|
`currency-provider-binance` under the `commerce:` block
|
|
- [x] Re-run `bun scripts/folder-reorg/generate-manifest.ts` to refresh
|
|
`MANIFEST.md`
|
|
- [x] Re-run `bun scripts/generate-missing.ts` to refresh `MISSING.yml`
|
|
- [x] Update `STATUS.md` `commerce` table to add the
|
|
`@suaveplan/currency-provider-binance` row with the shipped
|
|
surface summary
|
|
- [x] Update `SUMMARY.md` with a per-package paragraph
|
|
- [x] `bunx markdownlint-cli2 --fix` across touched root + change files
|
|
|
|
## Archive (AGENTS.md §14)
|
|
|
|
- [x] Fold `specs/currency-provider-binance/spec.md` into
|
|
`openspec/specs/currency-provider-binance/spec.md`
|
|
- [x] Move `openspec/changes/add-currency-provider-binance/` →
|
|
`openspec/archive/2026-05-17-add-currency-provider-binance/`
|
|
(authored directly in archive per the task instructions)
|