Repository navigation
chore: switch to pnpm and fix CJS export types - #96
Merged
Merged
Conversation
- Switch from yarn to pnpm 12: import yarn.lock into pnpm-lock.yaml, move resolutions to pnpm-workspace.yaml overrides, allow esbuild/prisma build scripts, make examples/pg a workspace package, and use pnpm in CI and docs. - Give each export's require condition its own dist/cjs .d.ts and drop the copy:files step (npm publishes from the package root). - Declare engines.node ^20.19.0 || >=22.12.0, the versions where CJS consumers can require() the ESM-only p-limit/p-queue.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #96 +/- ##
==========================================
+ Coverage 95.88% 96.04% +0.16%
==========================================
Files 32 33 +1
Lines 2163 2253 +90
Branches 416 455 +39
==========================================
+ Hits 2074 2164 +90
Misses 72 72
Partials 17 17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
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.
Summary
Switch from yarn to pnpm 12.16.1
pnpm-lock.yamlis generated fromyarn.lockwithpnpm import, so resolved versions carry over. Bothyarn.lockfiles are removed.pnpm-workspace.yaml: pnpm 12 doesn't read the package.jsonpnpmfield, so settings live here.resolutionsbecome version-rangeoverrides, since pnpm has noa/**/bglobs. The locked versions match the old pins: picomatch 2.3.2, cross-spawn 6.0.6, minimatch 3.1.5, brace-expansion 1.1.21, diff 4.0.4, esbuild 0.25.12.allowBuildslets esbuild, prisma and@prisma/enginesrun their install scripts. pnpm blocks them by default.examples/pgbecomes a workspace package, so the repo has one lockfile.pnpm/action-setup@v4,setup-nodewithcache: pnpm, andpnpm install --frozen-lockfile. The README and test comments say pnpm.Fix CJS consumers
requirecondition now points at its owndist/cjs/*.d.ts, instead of one sharedtypesthat gave CJS consumers the ESM declarations.copy:files/copyfiles. It copied a"type": "module"package.json intodist/, which npm doesn't need because it publishes from the package root.engines.nodegoes from>=20.3to^20.19.0 || >=22.12.0, the versions where CJS consumers canrequire()the ESM-onlyp-limit/p-queue.Test plan
pnpm build:require('txob'),require('txob/pg')and ESMimportall loadpnpm typecheck;pnpm test --run(64 passed, store tests skipped locally because no databases are running)changeset publishworks with npm trusted publishing (OIDC) now that it publishes through pnpm