fix: backward-compat for ESM etherpad#101
Conversation
- Migrate log4js to ep_plugin_helpers/logger 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 QodoMigrate to ep_plugin_helpers for ESM etherpad compatibility
WalkthroughsDescription• Migrate log4js from direct node_modules path to ep_plugin_helpers/logger • Ensures ESM etherpad compatibility with stricter exports resolution • Maintains backward compatibility with current CJS etherpad release • Add ep_plugin_helpers dependency and bump version to 1.0.50 Diagramflowchart LR
A["ep_etherpad-lite/node_modules/log4js"] -->|"migrate to"| B["ep_plugin_helpers/logger"]
B -->|"createLogger"| C["logger instance"]
D["package.json"] -->|"add dependency"| B
File Changes1. index.js
|
Code Review by Qodo
1. No regression test for logger
|
| const {createLogger} = require('ep_plugin_helpers/logger'); | ||
|
|
||
| const logger = log4js.getLogger('ep_button_link'); | ||
| const logger = createLogger('ep_button_link'); |
There was a problem hiding this comment.
1. No regression test for logger 📘 Rule violation ☼ Reliability
This PR changes the logger import to fix ESM compatibility but does not add or update any automated regression test in the same change. Without test coverage, the compatibility fix could regress without being detected by CI.
Agent Prompt
## Issue description
The PR introduces a backward-compatibility bug fix but does not include a new/updated automated regression test that fails before the fix and passes after.
## Issue Context
The logger import was changed from `ep_etherpad-lite/node_modules/log4js` to `ep_plugin_helpers/logger` to be compatible with Etherpad's upcoming ESM work. Compliance requires adding regression test coverage as part of the bug fix.
## Fix Focus Areas
- static/tests/backend/specs/logger-compat.spec.js[1-120]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| "dependencies": { | ||
| "ep_plugin_helpers": "^0.6.7" | ||
| } |
There was a problem hiding this comment.
2. Outdated pnpm lockfile 🐞 Bug ☼ Reliability
package.json adds the new runtime dependency ep_plugin_helpers, but pnpm-lock.yaml is not updated to include it, so pnpm i --frozen-lockfile will fail. This will block the npm publish workflow (and any CI step that installs with a frozen lockfile).
Agent Prompt
## Issue description
`package.json` adds a new dependency (`ep_plugin_helpers`) but `pnpm-lock.yaml` does not reflect it. Because the release workflow runs `pnpm i --frozen-lockfile`, the workflow will error out due to an outdated lockfile.
## Issue Context
The repository includes a committed `pnpm-lock.yaml` and the publish workflow explicitly uses frozen-lockfile installs.
## Fix Focus Areas
- package.json[26-28]
- pnpm-lock.yaml[7-20]
## Fix
1. Run `pnpm install` (or `pnpm i`) in the repo root to regenerate/update `pnpm-lock.yaml`.
2. Verify `pnpm-lock.yaml` now contains `ep_plugin_helpers` in the importer dependencies and package resolution entries.
3. Commit the updated lockfile.
ⓘ 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: Migrate log4js from
require("ep_etherpad-lite/node_modules/log4js")toep_plugin_helpers/loggerThis change is backward-compatible with the current CJS etherpad release.