build(query-parser): add tsdown COMPASS-10271#631
build(query-parser): add tsdown COMPASS-10271#631rtritto wants to merge 1 commit intomongodb-js:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR migrates packages/query-parser from a tsc + gen-esm-wrapper build to tsdown, updating the package entrypoints to publish both ESM and CJS outputs directly.
Changes:
- Added a
tsdownbuild configuration for query-parser (ESM + CJS + DTS). - Updated
packages/query-parser/package.jsonscripts and entrypoints (main/module/exports) to point todist/index.jsanddist/index.mjs. - Updated
package-lock.jsonto includetsdown(and its dependency tree) and removegen-esm-wrapper.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/query-parser/tsdown.config.js | Introduces tsdown build config producing ESM/CJS + declarations. |
| packages/query-parser/package.json | Switches compile script to tsdown and updates published entrypoints/exports. |
| package-lock.json | Locks new tsdown/rolldown-related dependencies and removes gen-esm-wrapper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "bootstrap": "npm run compile", | ||
| "prepublishOnly": "npm run compile", | ||
| "compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs", | ||
| "compile": "tsdown", | ||
| "typecheck": "tsc --noEmit", |
There was a problem hiding this comment.
compile now runs tsdown, which (per package-lock) requires Node >=20.19.0. Because the repo has engine-strict=true and the root package.json still advertises node: >=14.17.5, npm install / lerna run compile will fail for contributors/CI using Node <20.19. Consider aligning the repo/workflow Node version constraints (or selecting a build tool/version that supports the currently declared Node range).
|
Description
Replace
gen-esm-wrapperwithtsdownBetter alternative to #611
Related:
toJSStringis not a function nitedani/standaloner#8Checklist