feat(cli): expose tsdown types and entry#358
Merged
Brooooooklyn merged 1 commit intomainfrom Dec 23, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR exposes tsdown types and entry points to enable programmatic usage of tsdown build functionality. The main purpose is to make tsdown's build APIs (defineConfig, build, buildSingle, and globalLogger) accessible through both the core and CLI packages.
Key changes:
- Added new "./lib" export paths in both core and CLI packages to expose tsdown functionality
- Configured build process to bundle tsdown source code and generate proper type definitions
- Updated the RewriteImportsPlugin to use proper hook ordering with
order: 'pre'
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Added new dependencies (hookable@6.0.1, pkg-types@2.3.0, exsolve@1.0.8, confbox@0.2.2, rolldown-plugin-dts@0.18.3) to support tsdown bundling and type generation |
| packages/core/package.json | Added "./lib" export pointing to bundled tsdown, added new devDependencies (hookable, pkg-types, rolldown-plugin-dts) |
| packages/core/build.ts | Extended bundleTsdown function to build both the runtime (index.mjs) and type definitions (index-types.d.ts), moved RewriteImportsPlugin earlier in plugin array, added yaml to externals list |
| packages/core/build-support/rewrite-imports.ts | Restructured resolveId hook to use object syntax with explicit 'pre' order for proper plugin ordering |
| packages/cli/src/lib.ts | New file that re-exports tsdown functionality from core/lib |
| packages/cli/src/index.ts | Added type import for defineLibConfig and augmented UserConfig with optional lib configuration |
| packages/cli/package.json | Added "./lib" export to make tsdown APIs available from the CLI package |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2 tasks
fengmk2
approved these changes
Dec 22, 2025
18 tasks
Member
Author
Merge activity
|
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.

Note
Expose
libAPI and tsdown types via new exports; update build to bundle tsdown entries with generated d.ts and refine import rewriting/external handling.exports.{ "./lib": { import: "./dist/lib.js", types: "./dist/lib.d.ts" } }inpackages/cli/package.json.UserConfigto acceptliboptions and addsrc/lib.tsre-exporting corelibAPIs.RewriteImportsPlugin: switch toresolveIdwith{ order: 'pre', handler }.build.ts):yamlandvite/patterns) and placeRewriteImportsPluginbefore transforms.run,index) and generate type declarations viarolldown-plugin-dtsforindex-types.package.json: addexports["./lib"]pointing todist/tsdown/index.mjswithtypes.rolldown-plugin-dts,hookable, andpkg-types; lockfile updates accordingly.Written by Cursor Bugbot for commit 20c2492. This will update automatically on new commits. Configure here.