npm run verify is green: 23 tests pass, check:tsc, check:oxlint, check:oxfmt and check:cspell clean with the protocol-backed helper.
82 lines
5.2 KiB
Plaintext
82 lines
5.2 KiB
Plaintext
Tasks
|
|
|
|
Backlog and tracking for tiny-pattern-ts. Managed in vscode-todotasks format.
|
|
|
|
---
|
|
|
|
Setup:
|
|
☐ Split off template into separate package => pi --session 01a07dde-7050-7054-bb36-1606d7eb2bc3 @low
|
|
✔ straighten oxc rules @done
|
|
✔ oxc forbids ternary => remove oxc rule @done
|
|
✔ oxc wants comments to start comments with a capital letter => remove oxc rule @done
|
|
✔ there already exists a /* */ block comment in primitive.ts, => change to multi-line comment @done
|
|
|
|
✔ Remove example code files and its documentation and its exports from index.ts @high @done
|
|
✔ remove src/match.ts and its documentation @high @done
|
|
✔ remove src/pattern.ts and its documentation @high @done
|
|
✔ remove src/index.test.ts and its documentation @high @done
|
|
✔ exports from `src/index.ts` should only be the public API surface @done
|
|
|
|
|
|
v1.0:
|
|
☐ API surface is stable and fully typed
|
|
☐ Finalize public exports in `src/index.ts`
|
|
☐ Document all exported types and functions
|
|
☐ Add JSDoc for public APIs
|
|
☐ Test coverage meets threshold
|
|
☐ Achieve 100% branch coverage on `src/primitive.ts`
|
|
☐ Achieve 100% branch coverage on `src/index.ts`
|
|
|
|
Testing:
|
|
✔ Cover autocomplete with real completion test cases in the suite @medium @done
|
|
→ `src/util/__tests__/lsp-completion.ts` (`#test-utils/…`) is the helper; the suite asserts its labels (see development/testing.md § Autocomplete)
|
|
→ wire it into `node --test` so a test asserts the offered labels
|
|
→ note: `Parameters<typeof factory>[0]` resolves only the *last* overload; use `@ts-expect-error` call sites for factory negatives, not `not.toExtend<Parameters<…>>`
|
|
✔ Drive the LSP completion helper through the LSP protocol library instead of a hand-rolled JSON-RPC client @medium @done
|
|
✔ Add `vscode-languageserver-protocol` and record the tooling decision @done
|
|
✔ Rewrite `src/util/__tests__/lsp-completion.ts` onto `createMessageConnection` and typed requests @done
|
|
✔ Update `development/testing.md § Autocomplete` for the new client @done
|
|
✔ Run `npm run verify` and check the task off @done
|
|
|
|
Matcher:
|
|
✔ Clean up: adopt the 3-overload matcher (`src/prototype-ac2.ts`) and delete the prototypes @high @done
|
|
→ `getMatcher` / `getMatcherW`, each with overloads `ExhaustiveLoose` → `Fallback` → `Handlers` (order is load-bearing)
|
|
→ fold into `src/primitive.ts` / the public API; drop `src/prototype*.ts`
|
|
☐ `_` should receive only the unhandled `T` keys, not all of `T` @medium
|
|
→ today `_: (shape: T) => R`; desired `_: (shape: Exclude<T, handledKeys>) => R`
|
|
☐ An exhaustive pattern that also carries `_` must be a compile error @medium
|
|
→ `{ a, b, _ }` for `T = "a" | "b"` is accepted today; the redundant `_` should be rejected
|
|
|
|
Bugs:
|
|
|
|
Enhancements:
|
|
☐ Allow boolean literals in primitive union patterns (e.g. `true: () => "yes"`) @medium
|
|
☐ Are there other primitive types that should be supported in union patterns? (e.g. `bigint`, `symbol`) @medium
|
|
|
|
Documentation:
|
|
☐ Bring README.md back to its previous form — synopsis and examples restored, in the correct place
|
|
→ previous section order: title, tagline, Synopsis, Description, Requirements, Examples, API, License, Contributing
|
|
→ previous Examples order: literal/exhaustive, typeof, structural/discriminated unions, when, any
|
|
☐ Create `examples/` directory with runnable snippets
|
|
☐ Add comparison section vs. other TS pattern-matching libs in Readme.md
|
|
☐ Write migration guide for users coming from discriminated unions
|
|
☐ Create backlog tasks for implementation
|
|
✔ Document the matcher design paths in `development/` — union vs overload merge, inferred universe (`NoInfer`), conditional `RequireKeys`, cases-first — and why each was abandoned @done
|
|
☐ Validate code fences in Markdown (start with README.md) — compile the TypeScript examples against `src/` so the docs cannot drift from the API
|
|
|
|
Workflow:
|
|
✔ Resolve the finish/push tension: `create:finish` leaves `main` ahead of its upstream while `create:branch` refuses until `main` matches upstream — decide whether `finish` should push or `branch` should compare only `BEHIND` (see development/workflow.md) @done
|
|
|
|
Maintenance:
|
|
☐ Serve CI coverage over a tiny self-hosted webserver (replace the zip artifact) @low
|
|
☐ Explore serving coverage for non-tag pushes (e.g. `main/coverage`, PR previews) @low
|
|
→ design: no deploy step in CI; the webserver just exposes the shared directory (decided over Gitea Pages / Codecov — neither confirmed available/ wanted)
|
|
☐ serve docs over self hosted server @low
|
|
☐ Add a minimal dir-listing webserver to the gitea docker setup for serving docs (reuse existing reverse proxy)
|
|
☐ CI writes docs to a shared volume keyed by project + tag (e.g. `/docs/tiny-pattern-ts/<tag>/`)
|
|
☐ Browse to `…/docs/<repo>/<tag>/index.html` in the browser
|
|
☐ serve landing page over self hosted server @low
|
|
☐ Add a minimal dir-listing webserver to the gitea docker setup for serving landing page (reuse existing reverse proxy)
|
|
☐ CI writes landing page to a shared volume keyed by project + tag (e.g. `/landing/tiny-pattern-ts/<tag>/`)
|
|
☐ Browse to `…/tiny-pattern-ts/index.html` in the browser
|