Skip to content

Rewrite conformance/ in TypeScript with pnpm, vitest, turbo and eslint - #8

Merged
Mearman merged 3 commits into
mainfrom
chore/conformance-ts-vitest-pnpm
Sep 10, 2026
Merged

Rewrite conformance/ in TypeScript with pnpm, vitest, turbo and eslint#8
Mearman merged 3 commits into
mainfrom
chore/conformance-ts-vitest-pnpm

Conversation

@Mearman

@Mearman Mearman commented Sep 10, 2026

Copy link
Copy Markdown
Member

Rewrites conformance/ from plain .mjs + npm to TypeScript + pnpm:

  • codec.ts/generate.ts replace codec.mjs/generate.mjs; verify.mjs becomes a vitest suite (verify.test.ts) instead of a hand-rolled assertion loop.
  • codec.ts builds (tsdown) into dual ESM/CJS + .d.mts/.d.cts, and generate.ts/verify.test.ts import it by package name (self-reference) rather than a relative path, so the actual built artifact is what runs here. @arethetypeswrong/cli (via tsdown's own attw option) verifies that dual-package surface resolves correctly under Node's module resolution.
  • turbo.json declares build/generate/test/typecheck/lint as a task graph (generate/test/typecheck/lint all depend on build), with every task name underscore-prefixed so the public package.json scripts can call turbo run _<name> without recursing into themselves.
  • Linting via @exadev/eslint-config + Prettier.
  • npm's package-lock.json replaced by pnpm-lock.yaml.

Every regenerated vector file is byte-identical to what the old .mjs generator produced -- confirmed directly, this is a tooling rewrite, not a vector content change.

typescript is pinned to 6.0.3 (not left on latest 7.x): typescript-eslint doesn't support TS 7 yet, confirmed directly against the latest release.

…ing pnpm and vitest

codec.ts/generate.ts replace codec.mjs/generate.mjs; verify.mjs becomes a
vitest suite (verify.test.ts) with one test per vector instead of a hand-
rolled assertion loop. Node's native TypeScript execution (26+) runs every
.ts file directly, so no tsx/ts-node is needed; tsconfig.json's
moduleResolution: "nodenext" and allowImportingTsExtensions match that
reality rather than a bundler's more lenient resolution.

codec.ts builds (tsdown) into dual ESM/CJS output with .d.mts/.d.cts
declarations, and generate.ts/verify.test.ts import it by package name
(self-reference) rather than a relative path, so the same artifact a real
consumer would get is what actually runs here. @arethetypeswrong/cli
(wired into the build script) verifies that dual-package surface resolves
correctly under Node's own module resolution, catching a class of bug a
bare tsc build can't see.

npm's package-lock.json is replaced by pnpm's pnpm-lock.yaml throughout.
turbo.json declares build/generate/test/typecheck/lint as a task graph:
generate, test, typecheck, and lint all depend on build, so codec.ts
rebuilds once per invocation regardless of how many downstream tasks
need it, and turbo skips work entirely when nothing relevant changed.
Task names are underscore-prefixed (_build, _generate, ...) so each
public package.json script (build, generate, ...) can call
`turbo run _<name>` without turbo resolving that name back to the
public script that invoked it.

tsconfig.json is now scoped to codec.ts alone -- the one file tsdown
actually builds -- since including every top-level .ts file broke
tsdown's declaration generation on eslint.config.ts's own inferred
type. tsconfig.node.json (extending it) covers generate.ts,
verify.test.ts, and the two *.config.ts files instead; typecheck runs
both.

typescript is pinned to 6.0.3 rather than left on the latest 7.x:
typescript-eslint does not yet support TypeScript 7, and this is the
newest release still inside its own supported peer range.
pnpm/action-setup reads the packageManager field from package.json at
the repo root by default, but wire-mesh has no root package.json --
only conformance/package.json declares one. The action failed outright
with "No pnpm version is specified" until pointed at the right file.
@Mearman
Mearman marked this pull request as ready for review September 10, 2026 06:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-10T06:09:59.910664Z 73fa342 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Mearman
Mearman merged commit 93dd2a4 into main Sep 10, 2026
3 checks passed
@Mearman
Mearman deleted the chore/conformance-ts-vitest-pnpm branch September 10, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant