Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installing etherpad plugins from GitHub repos is broken #6245

Open
JannikStreek opened this issue Mar 19, 2024 · 0 comments · May be fixed by #6295
Open

installing etherpad plugins from GitHub repos is broken #6245

JannikStreek opened this issue Mar 19, 2024 · 0 comments · May be fixed by #6295
Labels
Stale No recent activity

Comments

@JannikStreek
Copy link
Contributor

Context

So far I have installed many of our etherpad plugins from GitHub repos, e.g. JannikStreek/ep_123 (sometimes also leveraging branch names, some plugins being forks). Since the adjustment of using the live plugin manager for installing also build time given plugins, the process is bugged.

Problem

There are currently two problems, which make the installation process of such plugins quite confusing:

  1. Plugins are correctly placed in root node_modules folder after installation. However, when the server starts and migratePluginsFromNodeModules is called, the plugins are NOT taken from the node_modules folder, but are installed from the npm registry with the same name. However, as I haven't published my plugins, it's using just any npm package with the same name. As many of my plugins are forks, it basically uses the parental project instead of my plugin (which is published). Thats quite confusing and took me some time to debug.

  2. Adding plugins at a later point in time via pnpm install ep_123 does add the plugin again to the node_modules folder. But restarting the server does not copy those plugins to the correct location, as this is dependent on the file var/installed_plugins.json. If this file is already existing (created during first server start) the second run completely ignores later installed plugins. Again quite confusing.

Suggested solution

At least for 1) as a quick fix, I made a small change to installer.ts method migratePluginsFromNodeModules to exclude GitHub links:

if (!_info.resolved || _info.resolved.includes('github')) {
          // Install from node_modules directory
          await linkInstaller.installFromPath(`${findEtherpadRoot()}/node_modules/${pkg}`);
        } else {
          await linkInstaller.installPlugin(pkg);
        }

Maybe it should be the other way around, only use installPluginwhen a npm url is given?

For 2) I would suggest to maybe recreate this file on startup? Not sure as I do not know the exact architectural decisions behind this.

@github-actions github-actions bot added the Stale No recent activity label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale No recent activity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant