Skip to content

fix: adapt preact files to the new extensions#247

Merged
kentcdodds merged 1 commit intokentcdodds:mainfrom
silviuaavram:fix/preact-package-json-paths
Feb 6, 2026
Merged

fix: adapt preact files to the new extensions#247
kentcdodds merged 1 commit intokentcdodds:mainfrom
silviuaavram:fix/preact-package-json-paths

Conversation

@silviuaavram
Copy link
Contributor

@silviuaavram silviuaavram commented Feb 6, 2026

What:

With the breaking change of v16, the cjs and esm file extensions changed from .js to .cjs and .mjs. The preact script also needs to be updated.

Why:

Downshift uses kcd-scripts, and we keep supporting preact.

How:

Change the strings.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

Summary by CodeRabbit

  • Chores
    • Updated rollup build configuration file extensions for Preact entry resolution to ensure correct artifacts are selected during the build process.

Copilot AI review requested due to automatic review settings February 6, 2026 15:13
@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

A build configuration change in rollup.js updates preact entry file resolution patterns, switching from *.cjs.js and *.esm.js extensions to *.cjs.cjs and *.esm.mjs to correctly target artifacts for the preact rollup entry.

Changes

Cohort / File(s) Summary
Preact Entry Resolution
src/scripts/build/rollup.js
Updated file extension patterns for preact CJS and ESM entry resolution from .cjs.js/.esm.js to .cjs.cjs/.esm.mjs.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 The build scripts dance with glee,
File extensions changed—now they align with thee,
.cjs.cjs and .esm.mjs so fine,
Preact entries now resolve just right,
A hop-skip fix that shines so bright! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: adapt preact files to the new extensions' directly and clearly describes the main change: updating preact file extensions from .js to .cjs and .mjs in the rollup configuration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

Copilot AI left a 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 updates the preact build script to align with a breaking change in v16 where the output file extensions for CommonJS and ES modules were changed. The build system now generates .cjs and .mjs extensions instead of .js for these module formats, resulting in filenames like *.cjs.cjs and *.esm.mjs.

Changes:

  • Updated glob patterns in the preact build script to match the new file extensions (.cjs.cjs for CommonJS and .esm.mjs for ES modules)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kentcdodds kentcdodds merged commit 8dfab4c into kentcdodds:main Feb 6, 2026
13 of 14 checks passed
@kentcdodds
Copy link
Owner

Thanks @silviuaavram !

@silviuaavram
Copy link
Contributor Author

@kentcdodds I feel this is actually a fix to the v16 breaking change. Do you have any project that uses preact?

@kentcdodds
Copy link
Owner

You're right, probably didn't need to make it a breaking change. But meh. 😅

I'm fixing the release script right now. A new release should be published soon.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🎉 This PR is included in version 17.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants