Skip to content

Commit 122ceb9

Browse files
authored
Merge pull request finos#793 from 06kellyjac/remove_exports
2 parents dd5d692 + c5d200d commit 122ceb9

File tree

8 files changed

+16
-21
lines changed

8 files changed

+16
-21
lines changed

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
"git-proxy": "./index.js",
2424
"git-proxy-all": "concurrently 'npm run server' 'npm run client'"
2525
},
26-
"exports": {
27-
"./plugin": "./src/plugin.js",
28-
"./proxy/actions": "./src/proxy/actions/index.js",
29-
"./src/config/env": "./src/config/env.js"
30-
},
3126
"workspaces": [
3227
"./packages/git-proxy-cli"
3328
],

plugins/git-proxy-plugin-samples/example.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55

66
// Peer dependencies; its expected that these deps exist on Node module path if you've installed @finos/git-proxy
7-
const { PushActionPlugin } = require('@finos/git-proxy/plugin');
8-
const { Step } = require('@finos/git-proxy/proxy/actions');
7+
const { PushActionPlugin } = require('@finos/git-proxy/src/plugin');
8+
const { Step } = require('@finos/git-proxy/src/proxy/actions');
99
'use strict';
1010

1111
/**
@@ -42,4 +42,4 @@ module.exports = {
4242
// Sub-classing is fine too if you require more control over the plugin
4343
logRequest: new LogRequestPlugin(),
4444
someOtherValue: 'foo', // This key will be ignored by the plugin loader
45-
};
45+
};

plugins/git-proxy-plugin-samples/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*/
55

66
// Peer dependencies; its expected that these deps exist on Node module path if you've installed @finos/git-proxy
7-
import { PullActionPlugin } from "@finos/git-proxy/plugin";
8-
import { Step } from "@finos/git-proxy/proxy/actions";
7+
import { PullActionPlugin } from "@finos/git-proxy/src/plugin";
8+
import { Step } from "@finos/git-proxy/src/proxy/actions";
99

1010
class RunOnPullPlugin extends PullActionPlugin {
1111
constructor() {

test/fixtures/test-package/default-export.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { PushActionPlugin } = require('@osp0/finos-git-proxy/plugin');
1+
const { PushActionPlugin } = require('@finos/git-proxy/src/plugin');
22

33
// test default export
44
module.exports = new PushActionPlugin(async (req, action) => {

test/fixtures/test-package/multiple-export.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { PushActionPlugin, PullActionPlugin } = require('@osp0/finos-git-proxy/plugin');
1+
const { PushActionPlugin, PullActionPlugin } = require('@finos/git-proxy/src/plugin');
22

33

44
module.exports = {
@@ -10,4 +10,4 @@ module.exports = {
1010
console.log('PullActionPlugin: ', action);
1111
return action;
1212
}),
13-
}
13+
}

test/fixtures/test-package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"name": "test-package",
33
"version": "0.0.0",
44
"dependencies": {
5-
"@osp0/finos-git-proxy": "file:../../.."
5+
"@finos/git-proxy": "file:../../.."
66
}
77
}

test/fixtures/test-package/subclass.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { PushActionPlugin } = require('@osp0/finos-git-proxy/plugin');
1+
const { PushActionPlugin } = require('@finos/git-proxy/src/plugin');
22

33
class DummyPlugin extends PushActionPlugin {
44
constructor(exec) {

website/docs/development/plugins.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ Loaded plugin: FooPlugin
124124

125125
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:
126126

127-
- `@finos/git-proxy/plugin/PushActionPlugin`: execute as an action in the proxy chain during a `git push`
128-
- `@finos/git-proxy/plugin/PullActionPlugin`: execute as an action in the proxy chain during a `git fetch`
129-
- `@finos/git-proxy/proxy/actions/Step` and `@finos/git-proxy/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.)
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.)
130130

131131
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).
132132

@@ -135,7 +135,7 @@ Please see the [sample plugin package included in the repo](https://github.com/f
135135
If your plugin relies on custom state, it is recommended to create subclasses in the following manner:
136136

137137
```javascript
138-
import { PushActionPlugin } from "@finos/git-proxy/plugin";
138+
import { PushActionPlugin } from "@finos/git-proxy/src/plugin";
139139

140140
class FooPlugin extends PushActionPlugin {
141141
constructor() {
@@ -189,8 +189,8 @@ $ npm install --save-peer @finos/git-proxy@latest
189189

190190
`bar.js`
191191
```javascript
192-
import { PushActionPlugin } from "@finos/git-proxy/plugin";
193-
import { Step } from "@finos/git-proxy/proxy/actions";
192+
import { PushActionPlugin } from "@finos/git-proxy/src/plugin";
193+
import { Step } from "@finos/git-proxy/src/proxy/actions";
194194

195195
//Note: Only use a default export if you do not rely on any state. Otherwise, create a sub-class of [Push/Pull]ActionPlugin
196196
export default new PushActionPlugin(function(req, action) {

0 commit comments

Comments
 (0)