73 lines
5.6 KiB
Markdown
73 lines
5.6 KiB
Markdown
# Tasks — split-font-compress
|
||
|
||
> Every checkbox MUST reflect work actually done in this change.
|
||
|
||
## 1. Spec authoring
|
||
|
||
- [x] 1.1 Read `openspec/AGENTS.md` §0, §0a, §0c, §6a, §7, §13, §14
|
||
- [x] 1.2 Audit current `packages/fonts/font-compress/src/` — every TS file enumerated; cross-module imports mapped
|
||
- [x] 1.3 Audit current consumers monorepo-wide — verified zero TS importers of `@suaveplan/font-compress`
|
||
- [x] 1.4 Draft `proposal.md` covering scope, source mapping, parity, affected dependents
|
||
- [x] 1.5 Draft `design.md` covering file layout for both packages, constant duplication, error-code split
|
||
- [x] 1.6 Draft `specs/font-decompress/spec.md` — new capability, post-split shape
|
||
- [x] 1.7 Draft `specs/font-compress/spec.md` — first canonical, post-split shape
|
||
- [x] 1.8 Every requirement carries `**Verified by:**` line at draft time
|
||
- [x] 1.9 `openspec validate split-font-compress` clean
|
||
|
||
## 2. Create @suaveplan/font-decompress
|
||
|
||
- [x] 2.1 `mkdir -p packages/fonts/font-decompress/{src/{constants,utils,unpacker/binary-font-unpacker},tests/setup}`
|
||
- [x] 2.2 Write `package.json` v0.0.0 with subpath exports and deps
|
||
- [x] 2.3 Write `tsconfig.json`, `tsconfig.lib.json`, `vite.config.ts`, `vitest.config.ts`, `tests/setup/polyfills.ts`, `README.md` (≥ 200 words, all required sections)
|
||
- [x] 2.4 Copy `src/constants/index.ts` verbatim from font-compress
|
||
- [x] 2.5 Author `src/error-codes.ts` — `FONT_DECOMPRESS_CODES = { UNPACK_FAILED, INVALID_DATA }`, `FontDecompressError extends SuaveplanError<FontDecompressErrorCode>`
|
||
- [x] 2.6 Author `src/error-codes.test.ts` — every code reachable, `cause` chain preserved
|
||
- [x] 2.7 Author `src/error-codes.md`
|
||
- [x] 2.8 Move `decodeString` from font-compress's `utils/encode-string.ts` to new `src/utils/decode-string.ts` (separate file per CLAUDE.md per-feature layout)
|
||
- [x] 2.9 Author `src/utils/decode-string.test.ts` — round-trip with known vectors
|
||
- [x] 2.10 Author `src/utils/decode-string.md`
|
||
- [x] 2.11 Move `binary-font-unpacker.ts` (+ test, + .md, + index.ts) from font-compress's `unpacker/binary-font-unpacker/` to new `src/unpacker/binary-font-unpacker/`
|
||
- [x] 2.12 Update internal imports in the moved files to point at the new package-local error registry and constants module
|
||
- [x] 2.13 Author `src/index.ts` root barrel with explicit named exports
|
||
- [x] 2.14 `bun install` to register the new workspace
|
||
- [x] 2.15 `bunx biome check --write --unsafe src/` clean
|
||
- [x] 2.16 `bunx tsc --noEmit -p tsconfig.lib.json` clean
|
||
- [x] 2.17 `bunx vitest run --coverage` with 100/100/100/100 Istanbul thresholds clean
|
||
- [x] 2.18 `bun run ../../../scripts/docs-check.ts .` 100%
|
||
|
||
## 3. Trim @suaveplan/font-compress
|
||
|
||
- [x] 3.1 Delete `src/unpacker/` directory in font-compress
|
||
- [x] 3.2 Trim `src/utils/encode-string.ts` to `encodeString` only; update test file accordingly; update sibling `.md`
|
||
- [x] 3.3 Trim `src/error-codes.ts` — remove `UNPACK_FAILED` from `FONT_COMPRESS_CODES`. Update the error-codes test and `.md`.
|
||
- [x] 3.4 Remove the `BinaryFontUnpacker` + `createBinaryFontUnpacker` exports from `src/index.ts`
|
||
- [x] 3.5 Remove the `./unpacker/binary-font-unpacker` subpath export from `package.json`
|
||
- [x] 3.6 Update `README.md` to reflect packer-only scope (≥ 200 words, all required sections)
|
||
- [x] 3.7 `bunx biome check --write --unsafe src/` clean
|
||
- [x] 3.8 `bunx tsc --noEmit -p tsconfig.lib.json` clean
|
||
- [x] 3.9 `bunx vitest run --coverage` with 100/100/100/100 Istanbul thresholds clean
|
||
- [x] 3.10 `bun run ../../../scripts/docs-check.ts .` 100%
|
||
|
||
## 4. Cross-package verification
|
||
|
||
- [x] 4.1 `bunx turbo lint typecheck test --filter=@suaveplan/font-compress` green
|
||
- [x] 4.2 `bunx turbo lint typecheck test --filter=@suaveplan/font-decompress` green
|
||
- [x] 4.3 `bunx turbo test:coverage --filter=@suaveplan/font-compress` 100/100/100/100
|
||
- [x] 4.4 `bunx turbo test:coverage --filter=@suaveplan/font-decompress` 100/100/100/100
|
||
- [x] 4.5 `bunx turbo build --filter=@suaveplan/font-compress` succeeds; dist contains the trimmed subpath set
|
||
- [x] 4.6 `bunx turbo build --filter=@suaveplan/font-decompress` succeeds; dist contains advertised subpaths
|
||
- [x] 4.7 `grep -rE "from ['\"](vitest|bun:test)['\"]" packages/fonts/font-compress/src/ packages/fonts/font-decompress/src/` → zero matches (rule §7)
|
||
- [x] 4.8 `grep -rE "^export \*" packages/fonts/font-compress/src/ packages/fonts/font-decompress/src/` → only root barrels and exempt forms (rule §6a)
|
||
- [x] 4.9 `grep -rE "from ['\"](node:|bun:|fs|path|stream|net|http)['\"]" packages/fonts/font-compress/src/ packages/fonts/font-decompress/src/` → zero matches (universal tier)
|
||
- [x] 4.10 `grep -rE "@deprecated|TODO|FIXME|ts-ignore|ts-expect-error|\\.skip|\\.only|\\bany\\b|console\\.log" packages/fonts/font-compress/src/ packages/fonts/font-decompress/src/ --include="*.ts"` → zero matches
|
||
|
||
## 5. Fold + archive
|
||
|
||
- [x] 5.1 Fold `specs/font-compress/spec.md` into `openspec/specs/font-compress/spec.md` (new canonical for an existing package — converts ADDED → Requirements, prepends Purpose)
|
||
- [x] 5.2 Fold `specs/font-decompress/spec.md` into `openspec/specs/font-decompress/spec.md` (new canonical for the new package)
|
||
- [x] 5.3 `openspec validate font-compress` and `openspec validate font-decompress` both clean
|
||
- [x] 5.4 Move `openspec/changes/split-font-compress/` → `openspec/archive/$(date +%Y-%m-%d)-split-font-compress/`
|
||
- [x] 5.5 `bun scripts/folder-reorg/generate-manifest.ts` — `MANIFEST.md` reflects both packages
|
||
- [x] 5.6 `STATUS.md` rows updated: `@suaveplan/font-compress` description trimmed to packer-only; `@suaveplan/font-decompress` flipped from `–` to `✅`
|
||
- [x] 5.7 Commit per CLAUDE.md style; no push without explicit user approval
|