Every `ts`-tagged fence in README.md / CONTRIBUTING.md now becomes an executed `node:test` case in a gitignored generated file, so a documented example cannot drift from the API. The generator hoists and merges the leading imports, rewrites the library specifier to the `#test-tiny-pattern-ts` alias, and rejects a fence with no describing paragraph or one that re-imports a prelude module. CI regenerates via `pretest:ci`; `create:doc-tests` runs the generator, formats, then typechecks the output against a scoped tsconfig that relaxes `noUnusedLocals`. c8's default excludes already omit the generated `*.test.ts`, so `test:ci` is unchanged.
50 lines
3.0 KiB
Plaintext
50 lines
3.0 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
|
|
|
|
v1.0:
|
|
✔ API surface is stable and fully typed @done
|
|
✔ Finalize public exports in `src/index.ts` @done
|
|
✔ Document all exported types and functions @done
|
|
✔ Add JSDoc for public APIs @done
|
|
✔ Test coverage meets threshold @done
|
|
✔ Achieve 100% branch coverage on `src/primitive-union.ts` @done
|
|
✔ Achieve 100% branch coverage on `src/index.ts` @done
|
|
|
|
Matcher:
|
|
✔ when using a union type as a property, the current behavior of tagged union matcher is @done
|
|
to pass never to handler parameters
|
|
→ new matcher function needed or can be fixed in tagged union matcher
|
|
✔ optional discriminant (`{ type?: "x" }`) is the same hole: the boolean/nullish change now admits the `undefined` tag, so the factory accepts the key, but `Extract<T, Record<K, V>>` still passes `never` to both the `x` and `undefined` handlers @done
|
|
|
|
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
|
|
☐ Why do we do this? => exhaustiveness encoded type safe
|
|
☐ Why this form? little syntax, data last, very small, autocomplete, strict typing in the handler; for more features use ts-pattern
|
|
☐ Write migration guide for users coming from discriminated unions
|
|
☐ Create backlog tasks for implementation
|
|
✔ Validate code fences in Markdown (start with README.md) — compile the TypeScript examples against `src/` so the docs cannot drift from the API @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
|
|
☐ Add testing with TypeScript 5.0 baseline in CI
|