Closed g5becks closed 4 years ago
Which is the package that cause problems? Or this happened for all packages when using your library?
Maybe you can send ne the logs by calling your app wih DEBUG=* environment variable.
It only has issues when being run from my cli program. I import it in another test program and it works fine.
I figured out what the issue is though. PluginManager is saying the dependencies for plugins are already available on the host. The way I am using live-plugin-manager is by reading a config file that lists plugins to install. A plugin will be a lib from my monorepo, which in turn depends on the same dependencies as my cli does. So it's always going to say the plugin is already available.
It looks like staticDependencies will solve this issue if I am not mistaken.
I will give that a try and report back.
If the dependency is already available on the host I think you should not do nothing. I mean they are not installed but they are available automatically. staticDependencies
are dependencies that you want to "hack" so that the host can pass something special to the plugin.
If you don't do nothing it works at runtime? Or you have some missing dependency error?
Also consider to use hostRequire=undefined
as an option to disable any transitive dependency from host to plugin.
The thing is, I don't know where the cli will be installed. It could be local to a project that is running it, and the project that needs the dependency in another project. I may be mistaken, but I don't think the node module resolver would be able to find it that way.
I never knew about hostRequire=undefined option. If you have a sec. Can you link me to some docs on that?
Thanks a lot for your help btw.
No doc for now, sorry ... but here the relevant code:
great. I'll check it out.
Thanks again for the assistance.
Hi, thanks for the great lib.
I am having a problem that I cant seem to find an answer to. I am using this library in a cli program that I am building. So I wrapped the PluginManager class and made a library in my monorepo. Here is the npm package.
The strange thing is that I can use the library in one script, and it will download the plugin's npm package and all of it's dependencies to pluginsPath, and I when I use the same library from my cli program it only downloads the plugin and none of the dependencies.
This is some pretty weird behavior that I have spent the past 2 days debugging with no luck at all. I was hoping that maybe you could shed some light on why this issue may be occurring.
Thanks.