Skip to content

fix: backward-compat for ESM etherpad#99

Merged
SamTV12345 merged 1 commit into
mainfrom
fix/esm-compat
May 25, 2026
Merged

fix: backward-compat for ESM etherpad#99
SamTV12345 merged 1 commit into
mainfrom
fix/esm-compat

Conversation

@SamTV12345
Copy link
Copy Markdown
Member

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.

- 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-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Remove trailing slash from eejs require path

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• 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
Diagram
flowchart 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"]

Loading

File Changes

1. copy_paste_select_all.js 🐞 Bug fix +1/-1

Remove trailing slash from eejs require

• Remove trailing slash from require('ep_etherpad-lite/node/eejs/') path
• Change to require('ep_etherpad-lite/node/eejs') for ESM compatibility
• Maintains backward compatibility with current CJS etherpad

copy_paste_select_all.js


2. package.json ⚙️ Configuration changes +1/-1

Bump version to 0.0.62

• Increment version from 0.0.61 to 0.0.62

package.json


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects Bot commented May 25, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1)

Grey Divider


Action required

1. No regression test for eejs 📘 Rule violation ☼ Reliability
Description
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.
Code

copy_paste_select_all.js[3]

Evidence
PR Compliance ID 1 requires that every bug fix include a regression test in the same change set. The
diff shows a functional bug fix to the eejs import path but no accompanying test changes are
present in the PR diff.

AGENTS.md: Bug Fixes Must Include a Regression Test
copy_paste_select_all.js[3-3]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## 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



Remediation recommended

2. Double version bump 🐞 Bug ☼ Reliability
Description
This PR manually bumps package.json to 0.0.62, but the release workflow also auto-increments the
patch version from package.json and commits/tags it, so the published release will jump an extra
patch (e.g., 0.0.62 → 0.0.63). This can skip versions and increase merge-conflict risk when multiple
PRs touch the version field.
Code

package.json[3]

Evidence
The PR changes the version in package.json, and the release workflow clearly performs its own
patch bump by reading and rewriting package.json, then committing/tagging; together, these
guarantee an extra increment after merge.

package.json[1-6]
.github/workflows/npmpublish.yml[54-86]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The repo’s release pipeline already bumps `package.json` (patch) and creates a tag/commit on merges to `main`/`master`. Keeping a manual version bump in the PR will cause a *double bump* and skipped version numbers.

### Issue Context
The workflow `.github/workflows/npmpublish.yml` reads `./package.json`, increments the patch component, commits, and tags.

### Fix Focus Areas
- package.json[1-6]

**Suggested change**: Revert `"version": "0.0.62"` back to the pre-PR value and let the release workflow perform the patch bump after merge (or, if you intentionally want manual bumps, update the workflow to detect and skip bumping when the version was already changed).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment thread copy_paste_select_all.js
'use strict';

const eejs = require('ep_etherpad-lite/node/eejs/');
const eejs = require('ep_etherpad-lite/node/eejs');
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

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

@SamTV12345 SamTV12345 merged commit 5f45b30 into main May 25, 2026
3 checks passed
@SamTV12345 SamTV12345 deleted the fix/esm-compat branch May 25, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant