T-W1D1-adopt-node-template-quality-patterns
Status: closed/superseded · Impact: medium · Complexity: medium
The graph-scheduler scaffold (T-PDDK-gs-scaffold-package-and-tooling) copies
intersect’s tooling, which has no lint/format gate, no coverage floor, and no
publish-hygiene, dead-code, or dependency checks. Adopt the quality patterns
from the reference repo github.com/sksizer/node-template so the package ships
behind an enforced quality gate and is safe to publish standalone.
Greenfield — the graph-scheduler package does not exist yet; the scaffold task
stands it up with intersect-style tooling (bun test + moon), and the sibling
packages/ts/intersect carries only moon.yml, package.json, and
tsconfig.json — no linter, formatter, coverage floor, or publish checks. The
repo has no GitHub Actions CI today; gating runs through moon tasks and
lefthook. The reference patterns live in the external repo
github.com/sksizer/node-template.
Proposed
Section titled “Proposed”The package ships the node-template quality gate, adapted to this repo’s bun + moon substrate:
| Concern | node-template pattern | Realized here |
|---|---|---|
| Lint + format | Biome (unified) | biome.json, run via a package script + moon task |
| Tests + coverage | Vitest + coverage floor | bun test with an enforced coverage floor (runner reconciled — see Approach 2) |
| TS config | tsconfig.json + tsconfig.build.json | same two-config split |
| Publish hygiene | publint + are-the-types-wrong | same, as a package script gate |
| Dead code | knip (report-only) | knip.json, report-only |
| Metrics | scc (report-only) | report-only script |
| Dependency hygiene | Dependabot + audit | .github/dependabot.yml entry for the package |
| CI gate | tsc + lint + format + test | GitHub Actions workflow gating the package (new to this repo) |
Approach
Section titled “Approach”- Read node-template’s config at
github.com/sksizer/node-template— Biome, Vitest,tsconfig.build.json, knip, the CI workflow, and Dependabot. - Reconcile the test runner. Adopt Biome and the publish/dead-code/metrics
tools directly. The test runner and coverage floor reconcile against the
repo’s bun-test convention: keep
bun testand add a coverage floor, rather than introducing Vitest alongside it. Record the choice in the PR. - Add package-local config:
biome.json,tsconfig.build.json,knip.json; wire the quality scripts into the packagepackage.jsonand a moon task. - Add the CI gate — a GitHub Actions workflow running tsc + lint + format +
test + publint/attw for the package. This introduces
.github/to the repo; flag it for review. - Add a
.github/dependabot.ymlentry covering the package’s manifest.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
packages/ts/graph-scheduler/biome.json | new | Biome lint + format config |
packages/ts/graph-scheduler/tsconfig.build.json | new | Production build TS config |
packages/ts/graph-scheduler/knip.json | new | Dead-code (report-only) config |
packages/ts/graph-scheduler/package.json | modify | Quality scripts: check/lint/format, coverage floor, publint, attw |
packages/ts/graph-scheduler/moon.yml | modify | Quality-gate task wiring |
.github/workflows/graph-scheduler.yml | new | CI gate: tsc + lint + format + test + publish-hygiene |
.github/dependabot.yml | new | Dependency updates for the package |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
bun runexposes lint, format, and dead-code (knip) checks for the package via Biome and knip config files. - AC-2: The test script enforces a coverage floor — a run below the floor exits non-zero.
- AC-3: A publish-hygiene script runs
publintandare-the-types-wrongagainst the built package and exits non-zero on failure. - AC-4: A GitHub Actions workflow runs tsc, lint, format, test, and publish-hygiene for the package on push.
- AC-5:
.github/dependabot.ymllists the package’s manifest ecosystem.
Out of scope
Section titled “Out of scope”- Applying the same stack to
packages/ts/intersector other packages — this task lands it on graph-scheduler; generalizing to a packages/ts library standard is a follow-up. - Introducing Vitest (the runner reconciliation keeps bun test — Approach 2).
- Actually publishing to npm — hygiene checks only, no release.
Dependencies
Section titled “Dependencies”- T-PDDK-gs-scaffold-package-and-tooling — the package
package.json,moon.yml, andtsconfig.jsonthis task extends are created by the scaffold.
Discovery context
Section titled “Discovery context”Requested directly: adopt the quality patterns defined in
github.com/sksizer/node-template for the graph-scheduler package.
Depends on
Section titled “Depends on”T-PDDK-gs-scaffold-package-and-tooling