Skip to content

Conversation

@bluwy
Copy link
Contributor

@bluwy bluwy commented Nov 18, 2025

fix #1406
fix #1510

Use import() instead of require() so it supports ESM too. Dynamic imports are supported since node 13.2 which I believe is already covered.

I also manually tested the return value of import() compared to require(), and added a nested .default check to maintain backwards compatibility. When we support ESM, we can decide whether we want to support export const getReleaseLine = ... for example so it doesn't have to be wrapped in a default-exported object. In this PR, I allowed it which required the nested .default check.

While this change is also indirectly fixed in next #1482, I figured it doesn't hurt to fix in main first.

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2025

🦋 Changeset detected

Latest commit: 7226ebc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@changesets/apply-release-plan Minor
@changesets/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.00%. Comparing base (097afd9) to head (7226ebc).

Files with missing lines Patch % Lines
packages/apply-release-plan/src/index.ts 66.66% 1 Missing ⚠️
packages/cli/src/commit/getCommitFunctions.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1774      +/-   ##
==========================================
- Coverage   81.05%   81.00%   -0.06%     
==========================================
  Files          54       54              
  Lines        2265     2269       +4     
  Branches      684      681       -3     
==========================================
+ Hits         1836     1838       +2     
- Misses        424      426       +2     
  Partials        5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

[bug] @changesets/cli running cjs file, even though the package is a module Changeset using its CJS files in a ESM repo

2 participants