Skip to content

Commit b046d70

Browse files
committed
fix: drop .js extensions on ep_etherpad-lite/* requires
0.6.6 added explicit .js extensions to ep_etherpad-lite/static/js/Changeset and friends, planning to support strict ESM resolution. That broke backward-compat with the current CJS etherpad: Node's CJS resolver treats 'foo.js' as a literal filename, and the actual source on disk is foo.ts (loaded via tsx). 'foo' without extension lets Node's default extension list + tsx's .ts substitution both work. Verified locally: 104/104 tests pass. CJS etherpad CI was failing on 'Cannot find module ep_etherpad-lite/static/js/Changeset.js' from ep_plugin_helpers/attributes-server.js.
1 parent 26b9e69 commit b046d70

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

attributes-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const createLineAttributeExport = (config) => {
99
const stylesForExport = () => exportStyles || '';
1010

1111
const getLineHTMLForExport = async (hookName, context) => {
12-
const Changeset = require('ep_etherpad-lite/static/js/Changeset.js');
12+
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
1313
let header = null;
1414
if (context.attribLine) {
1515
const opIter = Changeset.opIterator(context.attribLine);

message-relay.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const createMessageRelay = (config) => {
1010
const message = data;
1111
if (action && message.action !== action) return;
1212

13-
const padMessageHandler = require('ep_etherpad-lite/node/handler/PadMessageHandler.js');
13+
const padMessageHandler = require('ep_etherpad-lite/node/handler/PadMessageHandler');
1414
const payload = await buildPayload(message);
1515

1616
const msg = {

pad-select-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const PLUGIN_NAME_RE = /^ep_[a-z0-9_]+$/;
1616
let padOptionsPluginPassthrough = false;
1717
try {
1818
// eslint-disable-next-line global-require
19-
const caps = require('ep_etherpad-lite/node/utils/PluginCapabilities.js');
19+
const caps = require('ep_etherpad-lite/node/utils/PluginCapabilities');
2020
padOptionsPluginPassthrough = caps && caps.padOptionsPluginPassthrough === true;
2121
} catch (_e) { /* older core — leave as false */ }
2222

pad-toggle-server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ try {
2222
// and throws on older cores. Server-only: this file is never bundled for
2323
// the browser, so esbuild's static analysis does not run here.
2424
// eslint-disable-next-line global-require
25-
const caps = require('ep_etherpad-lite/node/utils/PluginCapabilities.js');
25+
const caps = require('ep_etherpad-lite/node/utils/PluginCapabilities');
2626
padOptionsPluginPassthrough = caps && caps.padOptionsPluginPassthrough === true;
2727
} catch (_e) { /* older core — leave as false */ }
2828

settings-toggle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const eejs = require('ep_etherpad-lite/node/eejs');
4-
const settings = require('ep_etherpad-lite/node/utils/Settings.js');
4+
const settings = require('ep_etherpad-lite/node/utils/Settings');
55

66
const createSettingsToggle = (config) => {
77
const {

0 commit comments

Comments
 (0)