You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitProxy supports extensibility in the form of plugins. These plugins are specified via [configuration](https://git-proxy.finos.org/docs/category/configuration) as NPM packages or JavaScript code on disk. For each plugin configured, GitProxy will attempt to load each package or file as a standard [Node module](https://nodejs.org/api/modules.html). Plugin authors will create instances of the extension classes exposed by GitProxy and use these objects to implement custom functionality.
3
+
4
+
For detailed documentation, please refer to the [GitProxy development resources on the project's site](https://git-proxy.finos.org/docs/development/plugins)
5
+
6
+
## Included plugins
7
+
These plugins are maintained by the core GitProxy team. As a future roadmap item, organizations can choose to omit
8
+
certain features of GitProxy by simply removing the dependency from a deployed version of the application.
9
+
10
+
-`git-proxy-plugin-samples`: "hello world" examples of the GitProxy plugin system
11
+
12
+
## Contributing
13
+
14
+
Please refer to the [CONTRIBUTING.md](https://git-proxy.finos.org/docs/development/contributing) file for information on how to contribute to the GitProxy project.
Copy file name to clipboardExpand all lines: website/docs/development/plugins.mdx
+50-38Lines changed: 50 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,17 +32,18 @@ The below instructions are using the [`@finos/git-proxy-plugin-samples`](https:/
32
32
1. Install both `@finos/git-proxy` and the `@finos/git-proxy-plugin-samples` package to the local `node_modules/` directory using the following command:
2. Create or edit an existing `proxy.config.json` file to configure the plugin(s) to load. You must include the full import path that would typically be used in a `import {}` (ESM) or `require()` (CJS) statement:
@@ -85,7 +86,7 @@ $ cat package.json
85
86
"name": "foo-plugin",
86
87
...
87
88
"dependencies": {
88
-
"@finos/git-proxy": "^1.3.5"
89
+
"@finos/git-proxy": "^1.7.0"
89
90
}
90
91
}
91
92
# Alternatively, add git-proxy that is cloned locally as a file-based dependency
@@ -122,29 +123,42 @@ Loaded plugin: FooPlugin
122
123
123
124
## Developing new plugins
124
125
125
-
To develop a new plugin, you must add `@finos/git-proxy` as a [peer dependency](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#peerdependencies). The main app (also known as the "host application") exports the following extension points:
126
+
To develop a new plugin, you must add `@finos/git-proxy` as a [peer dependency](https://docs.npmjs.com/cli/v10/configuring-npm/package-json#peerdependencies). The plugin & proxy classes can then be imported from `@finos/git-proxy` via the following extension points:
126
127
127
-
-`@finos/git-proxy/src/plugin/PushActionPlugin`: execute as an action in the proxy chain during a `git push`
128
-
-`@finos/git-proxy/src/plugin/PullActionPlugin`: execute as an action in the proxy chain during a `git fetch`
129
-
-`@finos/git-proxy/src/proxy/actions/Step` and `@finos/git-proxy/src/proxy/actions/Action`: internal classes which act as carriers for `git` state during proxying. Plugins should modify the passed in `action` for affecting any global state of the git operation and add its own custom `Step` object to capture the plugin's own internal state (logs, errored/blocked status, etc.)
- These are internal classes which act as carriers for `git` state during proxying. Plugins should modify the passed in `Action` for affecting any global state of the git operation and add its own custom `Step` object to capture the plugin's own internal state (logs, errored/blocked status, etc).
130
144
131
-
GitProxy will load your plugin only if it extends one of the two plugin classes above. It is also important that your package has [`exports`](https://nodejs.org/api/packages.html#exports) defined for the plugin loader to properly load your module(s).
145
+
GitProxy will load your plugin only if it extends one of the two plugin classes above.
132
146
133
147
Please see the [sample plugin package included in the repo](https://github.com/finos/git-proxy/tree/main/plugins/git-proxy-plugin-samples) for details on how to structure your plugin package.
134
148
135
149
If your plugin relies on custom state, it is recommended to create subclasses in the following manner:
0 commit comments