tradle / lambda-plugins

Loader for additional npm packages based on configuration in lamdba function.
MIT License
0 stars 0 forks source link

Support child lookups #1

Closed martinheidegger closed 2 years ago

martinheidegger commented 2 years ago

Currently the plugin system loads only the index/main code. To support multiple plugins in one dependency, it needs to also allow to load a sub-dependency (via. name) here, with a proposed API of:

plugin.data(opts?: { force?: boolean, child?: string }): Promise<any> 

This should best support the entire plugin options to prevent unexpected behavior.

urbien commented 2 years ago

could you clarify why we need to package multiple plugins in one dependency? the way I see it is each plugin is a tarball with all of its own dependencies. It can be loaded separately from other plugins using npm install from the tarball.

martinheidegger commented 2 years ago

There is no inherent need to package multiple plugins in one dependency. The advantage that it has is that the configuration becomes simpler and likely faster because of that:

Pseudo mycloud configuration setup:

plugins: 
  - mycompany-private-plugin-a
  - mycompany-private-plugin-b
  - mycompany-private-plugin-c
  - mycompany-private-plugin-d

vs one single package installed

plugins:
   - mycompany-private-plugins

I think the idea in this PR is sound, but for now I intend not to work on it (its not part of my POC efforts anymore)

urbien commented 2 years ago

closing as this feature is not needed at this point