fix: backward-compat for ESM etherpad#99
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 from eejs require path
WalkthroughsDescription• Remove trailing slash from eejs require path • Ensures compatibility with ESM etherpad exports • Maintains backward compatibility with current CJS • Bump version to 0.0.62 Diagramflowchart LR
A["ep_etherpad-lite/node/eejs/"] -- "remove trailing slash" --> B["ep_etherpad-lite/node/eejs"]
B -- "compatible with" --> C["ESM etherpad"]
B -- "compatible with" --> D["CJS etherpad"]
File Changes1. copy_paste_select_all.js
|
Code Review by Qodo
1. No regression test for eejs
|
| '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 📘 Rule violation ☼ Reliability
This PR changes the module resolution path for eejs to fix ESM compatibility, but it does not add or update any automated test to prevent the bug from reappearing. Merging without a regression test increases the risk of future refactors reintroducing the ESM breakage unnoticed.
Agent Prompt
## Issue description
A bug fix was made to the `eejs` `require()` path for ESM compatibility, but no regression test was added/updated in this PR.
## Issue Context
The change removes the trailing slash from `require('ep_etherpad-lite/node/eejs/')` to avoid strict ESM exports-map resolution failures. To meet compliance, add an automated test that would fail with the trailing-slash form and pass with the fixed import.
## Fix Focus Areas
- copy_paste_select_all.js[3-3]
- static/tests/frontend-new/specs/smoke.spec.ts[1-13]
ⓘ 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.