From 6fdbf06d320fa2b0b323927192610822714779b1 Mon Sep 17 00:00:00 2001 From: bradygaster Date: Sun, 5 Apr 2026 01:47:47 -0700 Subject: [PATCH] fix: rename lib/rework.js to .cjs for ESM compat 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> --- index.cjs | 2 +- lib/{rework.js => rework.cjs} | 0 test/rework-rate.test.cjs | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename lib/{rework.js => rework.cjs} (100%) diff --git a/index.cjs b/index.cjs index 3b0a6193c..48e528641 100644 --- a/index.cjs +++ b/index.cjs @@ -3,7 +3,7 @@ const fs = require('fs'); const path = require('path'); -const { calculatePrRework, calculateReworkSummary } = require('./lib/rework'); +const { calculatePrRework, calculateReworkSummary } = require('./lib/rework.cjs'); const GREEN = '\x1b[32m'; const RED = '\x1b[31m'; diff --git a/lib/rework.js b/lib/rework.cjs similarity index 100% rename from lib/rework.js rename to lib/rework.cjs diff --git a/test/rework-rate.test.cjs b/test/rework-rate.test.cjs index 4f1dad837..711745dd9 100644 --- a/test/rework-rate.test.cjs +++ b/test/rework-rate.test.cjs @@ -6,7 +6,7 @@ const { execFileSync } = require('child_process'); const CLI = path.join(__dirname, '..', 'index.cjs'); // Import rework calculation functions from the pure module (no CLI side effects) -const { calculatePrRework, calculateReworkSummary } = require(path.join(__dirname, '..', 'lib', 'rework.js')); +const { calculatePrRework, calculateReworkSummary } = require(path.join(__dirname, '..', 'lib', 'rework.cjs')); describe('calculatePrRework', () => { it('should return zero rework for PR with no reviews', () => {