Skip to content

Conversation

@mkilpatrick
Copy link
Collaborator

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Walkthrough

The changes restructure the package.json export configuration for the visual-editor package, consolidating the export map from nested import/require blocks into a flattened root structure. The configuration removes CommonJS build output (changing formats from ES and CommonJS to ES-only) across both the main build and plugin build configurations. A new plugin-specific export entry is added, along with clarified sideEffects metadata referencing the built CSS file. The vite build configurations are updated to generate ES modules exclusively, removing CommonJS format generation from both the standard and plugin builds.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided, making it impossible to assess whether the description relates to the changeset. Add a description explaining why CommonJS support is being dropped and any migration guidance for affected users.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat!: drop cjs support' directly and clearly reflects the main change across all modified files: removing CommonJS support from the visual editor package configuration.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch drop-cjs

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc7e84a and c833e59.

📒 Files selected for processing (3)
  • packages/visual-editor/package.json
  • packages/visual-editor/vite.config.plugin.ts
  • packages/visual-editor/vite.config.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: call_unit_test / unit_tests (20.x)
  • GitHub Check: semgrep/ci
🔇 Additional comments (8)
packages/visual-editor/package.json (4)

10-13: Correct configuration for ESM-only with CSS side effects.

The sideEffects array properly declares the CSS file, allowing bundlers to tree-shake JavaScript while preserving essential CSS imports. Combined with "type": "module", this aligns well with the ESM-only build output.


17-23: Clean ESM-only export structure.

The export map correctly prioritizes types for TypeScript resolution, followed by import for ESM consumers. The module field at line 17 provides compatibility with legacy bundlers that don't fully support the exports field.

Since this is a breaking change, ensure the major version is bumped and migration guidance is documented for consumers still using CommonJS bundler configurations.


31-31: Good addition for TypeScript compatibility.

The top-level types field ensures compatibility with older TypeScript versions and tools that don't fully support the exports field for type resolution.


24-27: The plugin build configuration does not generate type declarations. The vite.config.plugin.ts has no dts plugin, and tsconfig.plugin.json does not enable the declaration compiler option. Since there are no .d.ts files generated for the plugin, the missing types field is intentional and correct—there are no type declarations to reference.

Likely an incorrect or invalid review comment.

packages/visual-editor/vite.config.ts (2)

85-85: tsup command correctly updated for ES-only type generation.

The removal of cjs from the format flag aligns with the library build configuration change.


23-23: ES-only build format is properly configured.

The change to ES modules only is clean and consistent with the PR objective. The formats: ["es"] array, tsup command with --format esm, and package.json exports (which contain only import and default entries) are all aligned. All external dependencies (react, react-dom, @measured/puck, uuid, @yext/pages-components, mapbox-gl, @yext/search-headless-react, @yext/search-ui-react) support ES module imports.

packages/visual-editor/vite.config.plugin.ts (2)

1-1: Import addition looks good.

The LibraryFormats import is correctly added to support the type assertion on line 13.


13-13: Plugin build format correctly updated to ES-only.

The change is consistent with the main library configuration. The fs-extra dependency (v11.2.0, marked as external) supports ES module imports via its default export, which is compatible with the ES-only build format targeting Node.js 18.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mkilpatrick mkilpatrick merged commit 5db89d9 into main Dec 23, 2025
14 checks passed
@mkilpatrick mkilpatrick deleted the drop-cjs branch December 23, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants