-
Notifications
You must be signed in to change notification settings - Fork 43
refactor: Bundle autocertifier-client
#3330
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
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 introduces a Rollup-based bundling workflow for the autocertifier-client package to generate dual CommonJS and ES module outputs alongside bundled TypeScript type definitions.
Key changes:
- New Rollup configuration to bundle JavaScript into CJS and ESM formats
- TypeScript configuration updates to use module preservation and bundler resolution
- Package.json updates to specify dual entry points and restrict distributed files to bundle outputs only
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
packages/autocertifier-client/tsconfig.json |
Adds module: "preserve" and moduleResolution: "bundler" for bundler-oriented compilation |
packages/autocertifier-client/rollup.config.mts |
Introduces Rollup configuration for bundling JS (CJS/ESM) and TypeScript declarations |
packages/autocertifier-client/package.json |
Updates entry points, build scripts, file exports, and adds Rollup-related dependencies |
package-lock.json |
Adds dependencies for Rollup, plugins, tsx, rimraf, and their transitive dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a2331fb to
158417b
Compare
Let's buy some time and let's not go towards strict ESM for now. Later sure!
This pull request introduces a new bundling workflow for the
autocertifier-clientpackage, adding Rollup-based builds for both JavaScript and TypeScript types. It also updates the package configuration to support both CommonJS and ES module outputs, improves build script management, and refines the package's file exports for better distribution.Build system integration
rollup.config.mtsfile to bundle both CommonJS (exports.cjs) and ES module (exports.mjs) outputs, as well as generate TypeScript type definitions using Rollup and relevant plugins.tsconfig.jsonto usemodule: preserveandmoduleResolution: bundlerfor compatibility with the new bundling setup.Package configuration improvements
package.jsonto specify bothmain(CommonJS) andmodule(ESM) entry points, and refined thefilesfield to export only the necessary bundle outputs.postbuild,reset-self) and improved the build pipeline to include cleaning up build artifacts and running Rollup after TypeScript compilation.Dependency updates
tsx, andrimrafas development dependencies to support the new build process.