Repository navigation
chore: adopt ts-canon for the lint/format toolchain - #26
Merged
Merged
Conversation
Replace the per-repo toolchain copies with the ts-canon shared package
(pinned to commit ef074c9 until it is published):
- package.json: 14 per-step scripts collapse to ts-canon lint/format;
9 tool devDependencies swap for ts-canon (typescript, vitest,
@vitest/coverage-v8, @types/node stay)
- delete scripts/{oxlint,pandoc-md,peer-deps}.mts and .ast-grep/rules/
(all ported into ts-canon)
- biome.json: 144-line config becomes extends of
ts-canon/presets/biome.preset.json (content was identical)
- tsconfig.json: extends ts-canon/presets/tsconfig.base.json
- sgconfig.yml: point bare ast-grep/editor integrations at the shipped
rules
- README/AGENTS: document the ts-canon workflow
vitest.config.ts stays inline (byte-identical to the preset): node
refuses to type-strip ts-canon/presets/vitest.ts from node_modules
(ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING).
Verified: cold pnpm install --frozen-lockfile, pnpm build, pnpm lint
(all 9 steps), pnpm test (100% coverage), pnpm format idempotent,
ts-canon doctor.
ts-canon#3 (merged) resolves the upstream blockers this PR called out:
- presets/vitest now ships compiled (vitest.mjs + vitest.d.mts) under a
dedicated ./presets/vitest export, so it loads from real installs:
vitest.config.ts drops its inline copy and imports vitestPreset, same
shape as ts-canon's own config
- migrate preserves non-registry specs, so the github: pin survives a
re-run ("would keep ts-canon github:... (non-registry spec)")
- doctor falls back to the packageManager field: pnpm now reported ok
under pnpm exec
Pin moves ef074c9 -> 2f1fa25 (ts-canon main after #3). Still a git pin:
ts-canon is not published to npm yet.
Verified: pnpm install, pnpm build, pnpm lint (all 9 steps), pnpm test
(3 tests, 100% coverage), ts-canon doctor, migrate --dry-run, pnpm
format idempotent.
Owner
Author
|
Now that SynthLuvr/ts-canon#3 is merged, rebased this PR onto it (e4c9eed):
|
ts-canon 0.1.0 is on npmjs, so the github: pin (a stopgap from the original migration) becomes a normal registry range: - package.json: ^0.1.0 (same content as 2f1fa25 — 0.1.0 is the tag it published from; tarball verified to ship presets, rules, src, bin) - pnpm-workspace.yaml: minimumReleaseAgeExclude ts-canon@0.1.0 — pnpm 11's supply-chain gate rejects packages younger than 24h, and 0.1.0 was just published; without this entry pnpm install --frozen-lockfile fails (ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION). Drop the entry once the release is 24h old, or keep it pinned to this exact version. - AGENTS.md: "bump the pinned commit" -> "bump its version" Verified with the registry install: pnpm install --frozen-lockfile, pnpm build, pnpm lint (all steps), pnpm test (3 tests, 100% coverage), ts-canon doctor, migrate --dry-run (now "would set ts-canon to ^0"), pnpm format idempotent.
Owner
Author
|
ts-canon is on npm now (0.1.0, published 2026-08-27), so this PR switches off the stopgap git pin (b68842a):
Re-verified from the registry install: |
SynthLuvr
commented
Aug 27, 2026
ts-canon 0.1.0 was published 2026-08-27T16:39:44Z and is now >24h old, so pnpm 11's supply-chain age gate no longer rejects it. Verified with cold pnpm install --frozen-lockfile plus build/lint/test, all green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wave-1 migration to ts-canon (per its design doc). The lint/format toolchain this template duplicated becomes one devDependency:
ts-canon@^0.1.0from npm (published 2026-08-27; the earliergithub:commit pin was only a stopgap while it was unpublished).pnpm lint→ts-canon lint: biome, oxlint+tsgolint, 3 ast-grep rules, pandoc, peer-deps,pnpm audit --prod, jscpd — same steps, same order as beforepnpm format→ts-canon format: arrows → braces → biome format → biome check → pandoc — same order as beforescripts/{oxlint,pandoc-md,peer-deps}.mtsand.ast-grep/rules/deleted (ported into ts-canon; verified equivalent)biome.jsoncollapses toextends ts-canon/presets/biome.preset.json(config was verified identical modulo$schema)tsconfig.jsonextendsts-canon/presets/tsconfig.base.jsonsgconfig.ymlcopied from the preset so bareast-grep scan/editor integrations still find the rulesvitest.config.tsimportsts-canon/presets/vitest— the preset ships compiled (vitest.mjs+vitest.d.mts, dedicated exports entry; fix: make migrate, the vitest preset, and doctor work from real installs ts-canon#3), so it loads from real installstypescript,vitest,@vitest/coverage-v8,@types/nodestay consumer-side;.oxlintrc.jsonunchangedpnpm-workspace.yaml: addsminimumReleaseAgeExclude: ts-canon@0.1.0— pnpm's supply-chain age gate (24h) rejects the just-published release, and without the exclusionpnpm install --frozen-lockfilefails withERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION. The entry is inert where no age policy is active, and becomes droppable once the release is >24h oldVerification
rm -rf node_modules && pnpm install --frozen-lockfile(what CI does) — against the npm registrypnpm build— tsc resolves the preset extends through the installpnpm lint— all 9 steps pass, biome checked 7 files via the preset extendspnpm test— 3 tests, 100% coverage; config loadsts-canon/presets/vitestfromnode_modules(noERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING)pnpm formatidempotentpnpm lint --fastskips audit/jscpd; path args workts-canon migrate --dry-run— "would set ts-canon to ^0" (registry spec; git installs are preserved per fix: make migrate, the vitest preset, and doctor work from real installs ts-canon#3)ts-canon doctor— node 26.7.0, pandoc 3.10.2, all bundled tools, consumer typescript 7.0.2; pnpm detected underpnpm execviapackageManagerts-canon follow-ups
None. All four items from the original draft are resolved: npm publishing (0.1.0 is live),
migratepreserving non-registry specs +--versionflag, the compiled vitest preset, anddoctor'spackageManagerfallback — the latter three in SynthLuvr/ts-canon#3.