fix: backward-compat for ESM etherpad#92
Conversation
- Drop trailing slash on ep_etherpad-lite/node/eejs/ require Backward-compatible with current CJS etherpad release; also compatible with the upcoming ESM etherpad branch which has stricter exports map resolution.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Review Summary by QodoRemove trailing slash for ESM etherpad compatibility
WalkthroughsDescription• Remove trailing slash from eejs require path • Ensures compatibility with upcoming ESM etherpad • Maintains backward compatibility with current CJS • Bump version to 11.0.25 Diagramflowchart LR
A["require with trailing slash"] -- "remove slash" --> B["require without slash"]
B -- "compatible with" --> C["ESM etherpad"]
B -- "compatible with" --> D["CJS etherpad"]
File Changes1. eejs.js
|
Code Review by Qodo
1. No regression test for eejs require
|
| 'use strict'; | ||
|
|
||
| const eejs = require('ep_etherpad-lite/node/eejs/'); | ||
| const eejs = require('ep_etherpad-lite/node/eejs'); |
There was a problem hiding this comment.
1. No regression test for eejs require 📘 Rule violation ☼ Reliability
This PR changes module resolution behavior by updating the require('ep_etherpad-lite/node/eejs')
path, but it does not add or update any automated regression test to ensure the ESM exports-map
compatibility issue stays fixed. Without a test, the trailing-slash behavior could be reintroduced
unnoticed.
Agent Prompt
## Issue description
A bug fix was made (changing the `eejs` require path for ESM exports-map compatibility) but no regression test was added/updated in the same PR to prevent the issue from returning.
## Issue Context
The PR changes `require('ep_etherpad-lite/node/eejs/')` to `require('ep_etherpad-lite/node/eejs')`. Add an automated test that would have failed before this change (detecting the trailing-slash import) and passes now.
## Fix Focus Areas
- eejs.js[3-3]
- package.json[22-25]
- test/esm-compat.test.js[1-120]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This PR makes the plugin backward-compatible with the upcoming ESM etherpad branch (ether/etherpad#7605).
Change: Remove trailing slash from
require("ep_etherpad-lite/node/eejs/")→require("ep_etherpad-lite/node/eejs")The trailing-slash form breaks under Node's strict ESM exports map resolution. This change is backward-compatible with the current CJS etherpad release.