fix: rename lib/rework.js to .cjs for ESM compat#846
Merged
bradygaster merged 1 commit intodevfrom Apr 5, 2026
Merged
Conversation
lib/rework.js uses module.exports (CJS) but Node treats .js as ESM because root package.json has "type": "module". Rename to .cjs and update require() paths in index.cjs and test/rework-rate.test.cjs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🟡 Impact Analysis — PR #846Risk tier: 🟡 MEDIUM 📊 Summary
🎯 Risk Factors
📦 Modules Affectedroot (2 files)
tests (1 file)
This report is generated automatically for every PR. See #733 for details. |
Contributor
🛫 PR Readiness Check
|
| Status | Check | Details |
|---|---|---|
| ✅ | Single commit | 1 commit — clean history |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | No source files changed — changeset not required |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ✅ | Copilot threads resolved | No Copilot review threads |
| ❌ | CI passing | 16 check(s) still running |
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
Contributor
There was a problem hiding this comment.
Pull request overview
Renames the CommonJS rework helper module from lib/rework.js to lib/rework.cjs to avoid Node interpreting it as ESM under the repo’s root "type": "module", and updates all call sites accordingly.
Changes:
- Added
lib/rework.cjs(CommonJS) containing the rework calculation helpers. - Updated
index.cjstorequire('./lib/rework.cjs'). - Updated
test/rework-rate.test.cjsto import the helpers fromlib/rework.cjs.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/rework-rate.test.cjs | Updates test import path to the renamed CommonJS module. |
| lib/rework.cjs | Provides the CommonJS rework calculation helpers under a .cjs extension for ESM compatibility. |
| index.cjs | Updates the CLI entry to require the .cjs module explicitly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
lib/rework.js uses module.exports (CJS) but Node treats .js as ESM due to type:module in root package.json. Same class of bug as #845. Renamed to .cjs and updated require() paths.