-
-
Notifications
You must be signed in to change notification settings - Fork 15
feat!: use rolldown based bundler #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for commandkit ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this 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 replaces the existing tsup‐based (esbuild) bundler with tsdown (rolldown) and updates related plugin APIs and configuration.
- Swap out
tsup.config.tsfor atsdown.config.tswith equivalent settings. - Refactor the
CompilerPluginRuntimeand plugin interfaces to a unifiedtransform(code, id)API. - Rename and wire through
esbuildPlugins→rolldownPluginsin configs, CLI commands, and package.json.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/commandkit/tsup.config.ts | Removed obsolete tsup configuration. |
| packages/commandkit/tsdown.config.ts | Added new tsdown configuration with macro transform plugin. |
| packages/commandkit/src/plugins/plugin-runtime/builtin/MacroPlugin.ts | Updated to use code/id and skip JSON inputs. |
| packages/commandkit/src/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.ts | Same code/id refactor and JSON skip. |
| packages/commandkit/src/plugins/plugin-runtime/CompilerPluginRuntime.ts | Rewritten lifecycle: init/destroy, unified transform, removed esbuild hooks. |
| packages/commandkit/src/plugins/CompilerPlugin.ts | Simplified interface to transform(code, id) and removed unused hooks. |
| packages/commandkit/src/config/types.ts | Renamed esbuildPlugins to rolldownPlugins. |
| packages/commandkit/src/config/default.ts | Swapped in @rollup/plugin-json under rolldownPlugins. |
| packages/commandkit/src/config/config.ts | Merged rolldownPlugins instead of esbuildPlugins. |
| packages/commandkit/src/cli/production.ts | Changed from esbuildPlugins to rolldownPlugins. |
| packages/commandkit/src/cli/development.ts | Same swap of plugin array key. |
| packages/commandkit/src/cli/build.ts | Uses tsdown.build, wires rolldownPlugins, adds init/destroy, removes require polyfill. |
| packages/commandkit/src/CommandKit.ts | Moved plugin/handler initialization, stored options in a field. |
| packages/commandkit/package.json | Swapped tsup → tsdown in scripts and dependencies; added JSON plugin. |
Comments suppressed due to low confidence (1)
packages/commandkit/src/cli/build.ts:134
- [nitpick] The require() polyfill was removed from the injected entry file; if user code still relies on
require, it could break. Verify that all dependencies use ESM imports or reintroduce a lightweight polyfill.
-${isDev ? `... requireScript ...` : wrapInAsyncIIFE([envScript(isDev)])}
| OnResolveArgs, | ||
| OnResolveResult, | ||
| } from './plugin-runtime/types'; | ||
| import { OnResolveArgs } from './plugin-runtime/types'; |
Copilot
AI
May 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import OnResolveArgs is no longer used in this file; consider removing it to clean up unused code.
| import { OnResolveArgs } from './plugin-runtime/types'; |
| }, | ||
| ], | ||
| }; | ||
| console.log(err); |
Copilot
AI
May 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Use console.error instead of console.log when logging errors, so they are correctly classified in stderr.
| console.log(err); | |
| console.error(err); |
|
|
||
| export class CommandKit extends EventEmitter { | ||
| #started = false; | ||
| private options: CommandKitOptions; |
Copilot
AI
May 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The options field is assigned in the constructor but never referenced elsewhere; consider removing it or using it to drive configuration.
| private options: CommandKitOptions; | |
| // Removed unused options field |
| params: PluginTransformParameters, | ||
| ): Promise<MaybeFalsey<TransformedResult>> { | ||
| if (!this.options.enabled) return null; | ||
| if (/\.json$/.test(params.id)) return null; |
Copilot
AI
May 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This JSON skip regex is duplicated in CommonDirectiveTransformer; consider extracting it into a shared constant to reduce duplication.
Replaces tsup (esbuild) with tsdown (rolldown)