@gasket/plugin-https-proxy 7.5.0 → 8.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +0 -3
- package/package.json +7 -13
- package/cjs/actions.cjs +0 -39
- package/cjs/create.cjs +0 -22
- package/cjs/index.cjs +0 -62
- package/cjs/package.json +0 -1
- package/lib/create.js +0 -10
package/lib/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
/// <reference types="create-gasket-app" />
|
|
2
1
|
/// <reference types="@gasket/plugin-metadata" />
|
|
3
2
|
|
|
4
|
-
import create from './create.js';
|
|
5
3
|
import { actions } from './actions.js';
|
|
6
4
|
import packageJson from '../package.json' with { type: 'json' };
|
|
7
5
|
const { name, version, description } = packageJson;
|
|
@@ -13,7 +11,6 @@ export default {
|
|
|
13
11
|
description,
|
|
14
12
|
actions,
|
|
15
13
|
hooks: {
|
|
16
|
-
create,
|
|
17
14
|
metadata(gasket, meta) {
|
|
18
15
|
return {
|
|
19
16
|
...meta,
|
package/package.json
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/plugin-https-proxy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-next.1",
|
|
4
4
|
"description": "Adds support for running an https proxy",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"lib",
|
|
9
|
-
"cjs",
|
|
10
9
|
"EXAMPLES.md"
|
|
11
10
|
],
|
|
12
11
|
"exports": {
|
|
13
12
|
".": {
|
|
14
13
|
"types": "./lib/index.d.ts",
|
|
15
|
-
"import": "./lib/index.js"
|
|
16
|
-
"require": "./cjs/index.cjs",
|
|
17
|
-
"default": "./cjs/index.cjs"
|
|
14
|
+
"import": "./lib/index.js"
|
|
18
15
|
},
|
|
19
16
|
"./package.json": "./package.json"
|
|
20
17
|
},
|
|
@@ -37,16 +34,13 @@
|
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
36
|
"vitest": "^3.2.0",
|
|
40
|
-
"@gasket/
|
|
41
|
-
"@gasket/
|
|
42
|
-
"@gasket/plugin-
|
|
43
|
-
"@gasket/plugin-
|
|
44
|
-
"
|
|
45
|
-
"create-gasket-app": "^7.4.15"
|
|
37
|
+
"@gasket/core": "^8.0.0-next.1",
|
|
38
|
+
"@gasket/plugin-https": "^8.0.0-next.1",
|
|
39
|
+
"@gasket/plugin-logger": "^8.0.0-next.1",
|
|
40
|
+
"@gasket/plugin-metadata": "^8.0.0-next.1",
|
|
41
|
+
"create-gasket-app": "^8.0.0-next.1"
|
|
46
42
|
},
|
|
47
43
|
"scripts": {
|
|
48
|
-
"build": "gasket-cjs ./lib",
|
|
49
|
-
"build:watch": "pnpm run build --watch",
|
|
50
44
|
"lint": "eslint .",
|
|
51
45
|
"lint:fix": "pnpm run lint --fix",
|
|
52
46
|
"posttest": "pnpm run lint && pnpm run typecheck",
|
package/cjs/actions.cjs
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2
|
-
value: true
|
|
3
|
-
});
|
|
4
|
-
function _export(target, all) {
|
|
5
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: all[name]
|
|
8
|
-
});
|
|
9
|
-
}
|
|
10
|
-
_export(exports, {
|
|
11
|
-
actions: function() {
|
|
12
|
-
return actions;
|
|
13
|
-
},
|
|
14
|
-
startProxyServer: function() {
|
|
15
|
-
return startProxyServer;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
const _httpproxy = /*#__PURE__*/ _interop_require_default(require("http-proxy"));
|
|
19
|
-
function _interop_require_default(obj) {
|
|
20
|
-
return obj && obj.__esModule ? obj : {
|
|
21
|
-
default: obj
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
async function startProxyServer(gasket) {
|
|
25
|
-
await gasket.isReady;
|
|
26
|
-
await gasket.exec('prebootHttpsProxy');
|
|
27
|
-
const { httpsProxy } = gasket.config;
|
|
28
|
-
const { logger } = gasket;
|
|
29
|
-
const opts = await gasket.execWaterfall('httpsProxy', httpsProxy);
|
|
30
|
-
const { protocol = 'http', hostname = 'localhost', port = 8080, ...proxyOpts } = opts;
|
|
31
|
-
const server = _httpproxy.default.createServer(proxyOpts).on('error', (err)=>{
|
|
32
|
-
logger.error('Request failed to proxy:', err);
|
|
33
|
-
}).listen(port);
|
|
34
|
-
logger.info(`Proxy server started: ${protocol}://${hostname}:${port}`);
|
|
35
|
-
return server;
|
|
36
|
-
}
|
|
37
|
-
const actions = {
|
|
38
|
-
startProxyServer
|
|
39
|
-
};
|
package/cjs/create.cjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2
|
-
value: true
|
|
3
|
-
});
|
|
4
|
-
Object.defineProperty(exports, /** @type {import('@gasket/core').HookHandler<'create'>} */ "default", {
|
|
5
|
-
enumerable: true,
|
|
6
|
-
get: function() {
|
|
7
|
-
return create;
|
|
8
|
-
}
|
|
9
|
-
});
|
|
10
|
-
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
|
|
11
|
-
function _interop_require_default(obj) {
|
|
12
|
-
return obj && obj.__esModule ? obj : {
|
|
13
|
-
default: obj
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
const { name, version } = _packagejson.default;
|
|
17
|
-
function create(gasket, { pkg, gasketConfig }) {
|
|
18
|
-
gasketConfig.addPlugin('pluginHttpsProxy', name);
|
|
19
|
-
pkg.add('dependencies', {
|
|
20
|
-
[name]: `^${version}`
|
|
21
|
-
});
|
|
22
|
-
}
|
package/cjs/index.cjs
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/// <reference types="create-gasket-app" />
|
|
2
|
-
/// <reference types="@gasket/plugin-metadata" />
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, /** @type {import('@gasket/core').Plugin} */ "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function() {
|
|
9
|
-
return _default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
const _create = /*#__PURE__*/ _interop_require_default(require("./create.cjs"));
|
|
13
|
-
const _actions = require("./actions.cjs");
|
|
14
|
-
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
|
|
15
|
-
function _interop_require_default(obj) {
|
|
16
|
-
return obj && obj.__esModule ? obj : {
|
|
17
|
-
default: obj
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
const { name, version, description } = _packagejson.default;
|
|
21
|
-
const _default = {
|
|
22
|
-
name,
|
|
23
|
-
version,
|
|
24
|
-
description,
|
|
25
|
-
actions: _actions.actions,
|
|
26
|
-
hooks: {
|
|
27
|
-
create: _create.default,
|
|
28
|
-
metadata (gasket, meta) {
|
|
29
|
-
return {
|
|
30
|
-
...meta,
|
|
31
|
-
actions: [
|
|
32
|
-
{
|
|
33
|
-
name: 'startProxyServer',
|
|
34
|
-
description: 'Start the proxy server',
|
|
35
|
-
link: 'README.md#startProxyServer'
|
|
36
|
-
}
|
|
37
|
-
],
|
|
38
|
-
lifecycles: [
|
|
39
|
-
{
|
|
40
|
-
name: 'prebootHttpsProxy',
|
|
41
|
-
description: 'Executed before the proxy server is started.',
|
|
42
|
-
link: 'README.md#prebootHttpsProxy'
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'httpsProxy',
|
|
46
|
-
method: 'execWaterfall',
|
|
47
|
-
description: 'Setup the httpsProxy options',
|
|
48
|
-
link: 'README.md#httpsProxy'
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
configurations: [
|
|
52
|
-
{
|
|
53
|
-
name: 'httpsProxy',
|
|
54
|
-
link: 'README.md#configuration',
|
|
55
|
-
description: 'http-proxy config object',
|
|
56
|
-
type: 'object'
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
package/cjs/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
package/lib/create.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import packageJson from '../package.json' with { type: 'json' };
|
|
2
|
-
const { name, version } = packageJson;
|
|
3
|
-
|
|
4
|
-
/** @type {import('@gasket/core').HookHandler<'create'>} */
|
|
5
|
-
export default function create(gasket, { pkg, gasketConfig }) {
|
|
6
|
-
gasketConfig.addPlugin('pluginHttpsProxy', name);
|
|
7
|
-
pkg.add('dependencies', {
|
|
8
|
-
[name]: `^${version}`
|
|
9
|
-
});
|
|
10
|
-
}
|