-
Notifications
You must be signed in to change notification settings - Fork 121
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
feat: use native node loading for plugins + docs #638
Conversation
- update PluginLoader to use load-plugin's native Node module resolution. this library already handles loading of files vs modules in node_modules/ so let's use that directly - add configuration-based plugin loading and deprecate environment variables - new documentation page for plugin development. loading, writing, etc.
✅ Deploy Preview for endearing-brigadeiros-63f9d0 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #638 +/- ##
==========================================
- Coverage 57.39% 56.15% -1.24%
==========================================
Files 46 45 -1
Lines 1582 1583 +1
==========================================
- Hits 908 889 -19
- Misses 674 694 +20 ☔ View full report in Codecov by Sentry. |
@coopernetes - I'd say in both the In the docs site, we can go through more details for each step, the granular details etc. Thoughts? |
Just had a fairly in-depth review of the pull request. Does the push plugins defined just add the plugins directly to the end of the array of the chain in order that they are configured in |
Great work @coopernetes, somehow you managed to wrap all of this with very few changes! Re. the docs, I'd suggest to add the plugins/README.md as part of the website, then link the URL into the main README.md , to avoid defining the same docs in 2 different places. I also agree with @JamieSlome re. I'll try to allocate some time this week to give this a go. |
@coopernetes - I couldn't get it to work; I did some debugging, and it seems to me that the following block in
even though the line This is what I did to reproduce the issue:
Could it be something related with Promises? |
Custom plugins are added after the parseAction but before any builtin actions that are part of the default chain. See https://github.com/coopernetes/git-proxy/blob/chore/plugin-docs/src/proxy/chain.js#L56-L59
We can have a generic set of "plugins" via configuration and attempt to do some funky casting....Note that this will become much cleaner with 2.0 + TypeScript (#425) since we can enforce stronger API contracts through TS. It's just not useful today with the JS code base. The thought was to be explicit about the plugin types so that when we load 3rd party modules, we will presume that plugin authors wrote the specific object (class) based on its functionality. In reality, a push and pull are virtually identical so we can update this in the new configuration & docs. |
@maoo I had this working when running from source. I'm not sure how the global install affects the plugin loading but I suspect it has to do with the "path" of git-proxy itself when it's sitting in your user's global npm cache in relation to the plugins. The I'll do some debugging on my side with a similar setup. |
Closing this to re-open on a separate fork. Our org is iterating on this a bit and testing internally first before it's suitable to merge. |
fixes #539
TODO: