Skip to content

build(query-parser): add tsdown COMPASS-10271#631

Closed
rtritto wants to merge 1 commit intomongodb-js:mainfrom
rtritto:add-tsdown
Closed

build(query-parser): add tsdown COMPASS-10271#631
rtritto wants to merge 1 commit intomongodb-js:mainfrom
rtritto:add-tsdown

Conversation

@rtritto
Copy link
Copy Markdown
Contributor

@rtritto rtritto commented Mar 31, 2026

Description

Replace gen-esm-wrapper with tsdown
Better alternative to #611

Related:

Checklist

Copilot AI review requested due to automatic review settings March 31, 2026 19:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tsdown build configuration for query-parser (ESM + CJS + DTS).
  • Updated packages/query-parser/package.json scripts and entrypoints (main/module/exports) to point to dist/index.js and dist/index.mjs.
  • Updated package-lock.json to include tsdown (and its dependency tree) and remove gen-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.

Comment on lines 36 to 39
"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",
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@rtritto
Copy link
Copy Markdown
Contributor Author

rtritto commented Mar 31, 2026

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).

tsdown requires Node >=20.19.0
This project reqiures node: >=14.17.5

@rtritto rtritto closed this Mar 31, 2026
@rtritto rtritto deleted the add-tsdown branch March 31, 2026 20:04
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.

2 participants