tmu 06bc6bc43e 📝 Document GitHub Flow branching model and agent task workflow
Adopt single-developer GitHub Flow: branches off main with a
feature/fix/chore prefix, merged back via 'git merge --no-ff' (local
PR). Releases are not triggered by pushes; only the maintainer runs
'npm run release', which tags and pushes; CI publishes to npm on the
tag. Gitea is the lab; GitHub is reserved for later promotion.

Replace the 'not yet settled' backlog note in AGENTS.md with concrete
agent instructions: a task with subtasks gets a branch, a leaf task is
worked on the current branch, and a fixed handover template (Implemented
/ Judgement calls / Known problems) frames the pre-merge review. Drop
the stale 'MR' reference in 'Never do' (no MR workflow). Update the
feedback-tier table and publishing workflow to gate CI on push to main,
not PRs. Check off the branching-model backlog group and open a task
for the release CI workflow (blocked on a missing Gitea runner).
2026-09-08 14:07:33 +02:00
2026-09-06 00:13:12 +02:00
2026-02-02 13:38:42 +01:00
2025-04-29 13:43:07 +02:00
2026-09-06 00:45:15 +02:00

tiny-pattern-ts

Pattern matching for TypeScript/ESM environments (F#-style, not regex).

Development

  • Build: npm run build
  • Test: npm run test, npm run test:ci
  • Watch: npm run watch
  • Checks: npm run check, npm run fix
  • Verify: npm run verify — the definition of done
  • Maintenance: npm run maintain — advisory only
  • Individual fixes: npm run fix:oxfmt, npm run fix:oxlint

What each tier runs, when it fires and what it costs: CONTRIBUTING.md § Feedback tiers. How the prefix: in a script name is chosen: § Script prefix convention.

Tooling

  • TypeScript 7 — type checker and build (tsc).
  • node --test + --experimental-strip-types — test runner (Node 22.6+, flag dropped on Node 24).
  • c8 — code coverage for test:ci.
  • oxlint — Rust-based linter, with type-aware rules powered by oxlint-tsgolint (typescript-go).
  • oxfmt — Rust-based formatter (Prettier-compatible). Formats JS/TS, JSON/JSONC, YAML, Markdown, MDX, and more; built-in package.json key sorting replaces sort-package-json.
  • cspell — spell checking.
  • knip — finds unused dependencies, exports, and files.
  • check-outdated — reports dependencies behind the registry; it exits non-zero whenever any dependency is outdated.
  • publint — validates package.json for ESM publishing correctness.
  • @arethetypeswrong/cli (attw) — validates .d.ts declarations against multiple module-resolution scenarios.
  • lefthook — git hooks.

Each tool's configuration trade-off is recorded in Tooling decisions; when it runs is in CONTRIBUTING.md § Feedback tiers.

Tooling decisions

The choice and configuration of each tool above is the result of deliberate trade-offs, not defaults. The non-obvious ones:

  • tsconfig.json extends @tsconfig/strictest + @tsconfig/node26; tsconfig.build.json extends it to add the emit-only options (declaration, sourceMap, outDir, target: es2024, rewriteRelativeImportExtensions: true) and to exclude test files. This separation lets the editor and CI type-check from one config while the build emits from the other.
  • Source imports use .ts extensions so node --strip-types resolves them at test time. rewriteRelativeImportExtensions: true in tsconfig.build.json rewrites them to .js in the emitted dist/* output, so consumers see conventional ESM imports.
  • Type-aware oxlint is enabled declaratively via options.typeAware: true in .oxlintrc.json (powered by oxlint-tsgolint). The script commands stay clean — no CLI flag — and type-aware mode is a property of the config, not the invocation.
  • Source-level oxlint-disable directives are used for known type-aware false positives (see src/pattern.ts, src/match.ts, src/index.test.ts). The disable lives next to the code it silences, not in .oxlintrc.json, so the trade-off is visible to anyone reading the source.
  • knip --include dependencies,exports,files intentionally omits the types category, which produces systematic false positives for libraries whose exported types are part of the public API. The targeted scope keeps the signal high without config-file boilerplate.
  • attw --profile esm-only is semantically correct: this package is intentionally ESM-only (no CommonJS shim), so CJS resolution scenarios are out of scope by design, not a bug.
  • check:tsc runs first in the npm run check chain so a type error short-circuits the rest (faster feedback than letting oxlint/oxfmt run and then failing on tsc at the end).
  • The pre-commit hook sets the LEFTHOOK_FILES env var to the staged-files list, and the affected scripts use ${LEFTHOOK_FILES:-<default>} to default to the whole project when invoked manually. This keeps package.json#scripts as the single source of truth for the underlying commands — lefthook.yml only describes what to run on which files.
  • tslib and type-fest are deliberately not used. tslib is a runtime helper for old ES3/ES5 targets (the project targets ES2024); type-fest was never imported. knip caught both.

Requirements

  • Node.js >= 26 (engines field; pinned via .node-version).

VSCode integration

  • Recommended extensions: see .vscode/extensions.json (oxc, cspell).
  • TypeScript 7 is used via the typescriptteam.native-preview extension.
  • oxc extension provides oxlint squiggles and oxfmt format-on-save.

Contributing

For maintainer and contributor docs — the script prefix convention, the feedback-tier system, the rules the tools don't enforce, and the publishing workflow — see CONTRIBUTING.md. AI coding agents: your entry point is AGENTS.md, which points back to CONTRIBUTING.md.

  • Commit signing (GPG).
  • Type-only tests use expect-type's expectTypeOf(...) inside node --test cases.
S
Description
No description provided
Readme MIT
1.5 MiB
0 Stars 1 Watchers 0 Forks
0.9.0
Latest
2026-09-29 23:57:54 +02:00
Languages
TypeScript 88.4%
Shell 9.9%
Dockerfile 1.7%