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.
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'; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
[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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
[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)