Closed chacha912 closed 6 days ago
The codebase has transitioned from CommonJS to ES modules across multiple files, addressing deprecation warnings related to Vite's CJS build. The buf.gen.yaml
configuration was updated for js_import_style
, the package.json
file now specifies "type": "module"
, and export default
syntax replaced module.exports
in JavaScript configurations. Dependencies and import paths were also updated where necessary.
File Path | Change Summary |
---|---|
buf.gen.yaml |
Updated js_import_style from legacy_commonjs to module . |
package.json |
Added "type": "module" and a new dependency. |
postcss.config.js |
Switched from module.exports to export default . |
src/api/converter.ts |
Updated the import path for BadRequest . |
src/api/.../admin_connect.d.ts |
Updated protoc-gen-connect-es version and js_import_style . |
src/api/.../admin_connect.js |
Changed import statements to ES modules and updated declarations. |
src/api/.../admin_pb.d.ts |
Updated tool version and js_import_style parameter. |
src/api/.../admin_pb.js |
Transitioned to ES module syntax. |
src/api/.../resources_pb.d.ts |
Updated tool version and js_import_style parameter. |
src/api/.../resources_pb.js |
Transitioned to ES module syntax. |
(Not applicable – changes are straightforward and pertain to module syntax conversion rather than control flow modifications)
Objective (Issue #154) | Addressed | Explanation |
---|---|---|
Switch from CJS build to ESM to eliminate deprecation warnings | ✅ |
In the code where changes gleam,
From CommonJS to ES module dream,
Vite's warnings now no more,
We've aligned with modern lore.
Modules fresh, our paths anew,
With better code, we start anew. 🚀
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
What this PR does / why we need it?
This PR resolves the warning message that occurs when running
npm run dev
ornpm run build
in Vite. The warning message states that the CJS build of Vite's Node API is deprecated and provides instructions on how to address the issue by switching to ESM.Any background context you want to provide?
What are the relevant tickets?
Fixes #154
Checklist
Summary by CodeRabbit
New Features
Chores
"type": "module"
field inpackage.json
to specify module type.