Closed yacchin1205 closed 6 months ago
Thank you @yacchin1205 ! This is a great improvement! :rocket: Give me some time to review it, but I will try to do that in a couple of days.
Thank you again @yacchin1205 ! 👏
Thanks for your review and merge, too! 😄
I will publish a new release soon (just waiting for another PR rebase).
To resolve Issue #3, I propose to improve the structure of the plugin_packages directory and implement a manager to manage it. (I use live-plugin-manager for etherpad-lite and it would be great to improve it! https://github.com/ether/etherpad-lite/issues/6330 )
Directory structure
Currently, the file placement would look like the following.
Therefore, I understand that if plugin-b and plugin-c each depend on a different version of plugin-a, one of the versions will be overwritten.
So, I considered creating a node_modules in the dependent source directory, like https://stackoverflow.com/questions/42147243/how-does-npm-handle-version-conflicts, and placing the dependencies packages in it.
To prevent multiple copies of the same package, symlink is used. The example of plugin-b and plugin-c is shown below.
For compatibility with current behavior, a symlink also will be created under plugin_packages for plugin-a, which is a dependency of plugin-b or plugin-c. Which version is linked depends on whether plugin-b or plugin-c is installed later.
Changes to code
The following changes were made to achieve the directory placement.