feat(workspace): enable tsdown dev exports for editor DX#3019
feat(workspace): enable tsdown dev exports for editor DX#3019
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
There was a problem hiding this comment.
Pull request overview
This PR aims to improve editor “go-to-definition” across the monorepo by making workspace package exports resolve to TypeScript source during local development while keeping published artifacts pointing to dist.
Changes:
- Enable
tsdowndevExportsin the shared build config (packages/tsdown.base.ts). - Update package-level
exports["."]to point at./src/index.tsfor local development. - Add
publishConfig.exportsentries so published packages still export./dist/*.mjsoutputs.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/tsdown.base.ts | Enables devExports generation in the shared tsdown config. |
| packages/angular/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/axios/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/core/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/fetch/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/hono/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/mcp/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/mock/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/orval/package.json | Switches workspace exports (including ./bin/orval) to src and adds publish-time exports to dist. |
| packages/query/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/solid-start/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/swr/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
| packages/zod/package.json | Switches workspace exports to src and adds publish-time exports to dist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@packages/axios/package.json`:
- Around line 8-11: The exports map for the "." entry currently only defines
"development" and "default" conditions; update the package.json exports so they
follow the same publish-ready export pattern used elsewhere: add the standard
conditional keys ("import", "require", "types"/"types" entry or a "types" field
pointing to your d.ts) and ensure "development" points to the src entry while
"default" (and "import"/"require") point to the built files, and make sure
publishConfig (if used elsewhere) matches these exports; repeat the same fix for
the other exports block referenced at lines 37-41 so both export entries use the
consistent, publishable conditional export structure.
In `@packages/fetch/package.json`:
- Around line 8-11: The exports field currently exposes source files (the
"development": "./src/index.ts" mapping) which should not be published; update
the "." export so it does not point to source: either remove the "development"
conditional or change it to point to the compiled output (e.g.
"./dist/index.mjs"), ensure the "default" remains "./dist/index.mjs", and add a
"types": "./dist/index.d.ts" mapping if type declarations are published; apply
the same change to the other export blocks referenced (the entries around lines
38-42) so all exports consistently reference dist artifacts rather than src.
In `@packages/mock/package.json`:
- Around line 8-11: The exports entry for "." currently uses a nonstandard
"development" conditional and a "default" target; update the package.json to use
standard conditional exports (e.g., "import" for the ESM build and "require" for
the CJS build, with a "default" fallback if needed) and make sure the package's
publishConfig/main/module fields point to the matching built files so published
consumers resolve correctly; change the "." mapping keys from "development" to
"import" (or appropriate condition) and "default" to the correct fallback path,
and apply the same fix to the other identical export block referenced in the
diff.
In `@packages/orval/package.json`:
- Around line 15-22: The exports entries for "." and "./bin/orval" are
inconsistent with the package's publish/build outputs; update the package.json
so the "." and "./bin/orval" export fields point to the actual built artifacts
(use the built .js/.mjs/.cjs files produced in dist), add condition-specific
keys if needed (e.g., "import"/"require"), and include a "types" path if
TypeScript declarations are emitted; ensure publishConfig (and any other export
entries like the ones at lines 117-122) reference the same dist files so
development and default targets match the real build outputs.
In `@packages/zod/package.json`:
- Around line 8-11: The package.json exports entry for "." currently uses
nonstandard keys ("development" and "default")—align it with the project
convention used elsewhere by replacing those with the proper export conditions
(e.g., "import", "require", "types" or "node" entries) and ensure the
package.json includes the same publishConfig used in other packages (e.g.,
publishConfig.access) so it publishes with correct visibility; update the "."
exports object and the publishConfig accordingly and mirror the same fixes for
the duplicate block referenced at the other location (lines 37-41).
Summary
devExportsfor improved editor DX — go-to-definition now resolves to.tssource files across packages instead of.d.mtsdeclarationsChanges
exports: truetoexports: { devExports: true }inpackages/tsdown.base.tspublishConfig.exportsin all 13 package.json files pointing to built output for publishingexportsnow point to source.tsfiles for local developmentmoduleResolution: "bundler"handles extensionless importsSummary by CodeRabbit