fix: backward-compat for ESM etherpad#157
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 ESM etherpad compatibility with strict exports • Maintains backward compatibility with current CJS release • Bump version to 0.7.8 Diagramflowchart LR
A["require with trailing slash"] -- "remove trailing slash" --> B["require without trailing slash"]
B -- "compatible with" --> C["ESM etherpad"]
B -- "compatible with" --> D["CJS etherpad"]
File Changes1. eejs.js
|
Code Review by Qodo
1. eejs require change untested
|
| '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. eejs require change untested 📘 Rule violation ☼ Reliability
This PR fixes an ESM compatibility bug by changing the require() path, but it does not add or update any automated regression test. Without a test, the ESM/CJS resolution issue can silently regress in future changes.
Agent Prompt
## Issue description
A bug fix was made (changing the `require('ep_etherpad-lite/node/eejs/')` import to remove the trailing slash), but no regression test was added/updated to ensure this compatibility behavior does not regress.
## Issue Context
Compliance requires that every bug fix includes an automated test that would fail before the fix and pass after it. The repository also lacks any test runner configuration in `package.json`.
## Fix Focus Areas
- eejs.js[1-9]
- package.json[35-38]
ⓘ 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.