Skip to content

Commit 2592635

Browse files
committed
fix: backward-compat for ESM etherpad
- Drop trailing slash on ep_etherpad-lite/node/eejs/ require (index.js) - Migrate log4js to ep_plugin_helpers/logger (commentManager.js) Backward-compatible with current CJS etherpad release; also compatible with the upcoming ESM etherpad branch which has stricter exports map resolution.
1 parent b28bb64 commit 2592635

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

commentManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
const _ = require('underscore');
44
const db = require('ep_etherpad-lite/node/db/DB');
5-
const log4js = require('ep_etherpad-lite/node_modules/log4js');
5+
const {createLogger} = require('ep_plugin_helpers/logger');
66
const randomString = require('ep_etherpad-lite/static/js/pad_utils').randomString;
77
const shared = require('./static/js/shared');
88

9-
const logger = log4js.getLogger('ep_comments_page');
9+
const logger = createLogger('ep_comments_page');
1010

1111
exports.getComments = async (padId) => {
1212
// Not sure if we will encouter race conditions here.. Be careful.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const {template} = require('ep_plugin_helpers');
44

55
const AttributePool = require('ep_etherpad-lite/static/js/AttributePool').default || require('ep_etherpad-lite/static/js/AttributePool');
66
const Changeset = require('ep_etherpad-lite/static/js/Changeset').default || require('ep_etherpad-lite/static/js/Changeset');
7-
const eejs = require('ep_etherpad-lite/node/eejs/');
7+
const eejs = require('ep_etherpad-lite/node/eejs');
88
const settings = require('ep_etherpad-lite/node/utils/Settings');
99
const {Formidable} = require('formidable');
1010
const commentManager = require('./commentManager');

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"description": "Adds comments on sidebar and link it to the text. For no-skin use ep_page_view.",
33
"name": "ep_comments_page",
4-
"version": "11.1.14",
4+
"version": "11.1.15",
55
"author": {
66
"name": "Nicolas Lescop",
77
"email": "limplementeur@gmail.com"
@@ -23,7 +23,7 @@
2323
],
2424
"dependencies": {
2525
"cheerio": "^1.2.0",
26-
"ep_plugin_helpers": "^0.6.0",
26+
"ep_plugin_helpers": "^0.6.7",
2727
"formidable": "^3.5.4",
2828
"underscore": "^1.13.8"
2929
},

0 commit comments

Comments
 (0)