@modern-js/plugin-proxy 2.40.0 → 2.42.0
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/dist/cjs/utils/whistleProxy.js +3 -2
- package/dist/esm/utils/whistleProxy.js +3 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/utils/createProxyRule.d.ts +1 -1
- package/dist/types/utils/execSync.d.ts +3 -3
- package/dist/types/utils/macCAManager.d.ts +1 -1
- package/dist/types/utils/macProxyManager.d.ts +1 -1
- package/dist/types/utils/whistleProxy.d.ts +11 -11
- package/package.json +6 -6
|
@@ -37,7 +37,8 @@ var import_utils = require("@modern-js/utils");
|
|
|
37
37
|
var import_execSync = __toESM(require("./execSync"));
|
|
38
38
|
var import_macCAManager = require("./macCAManager");
|
|
39
39
|
const { disableGlobalProxy, enableGlobalProxy } = require("./macProxyManager");
|
|
40
|
-
|
|
40
|
+
var WhistleProxy;
|
|
41
|
+
WhistleProxy = class WhistleProxy2 {
|
|
41
42
|
async installRootCA() {
|
|
42
43
|
try {
|
|
43
44
|
if (!(0, import_macCAManager.isRootCAExists)()) {
|
|
@@ -73,4 +74,4 @@ class WhistleProxy {
|
|
|
73
74
|
this.bin = import_path.default.resolve(import_path.default.dirname(require.resolve("whistle")), "bin/whistle.js");
|
|
74
75
|
this.certDir = import_path.default.dirname(import_macCAManager.defaultRootCA);
|
|
75
76
|
}
|
|
76
|
-
}
|
|
77
|
+
};
|
|
@@ -4,7 +4,8 @@ import { logger } from "@modern-js/utils";
|
|
|
4
4
|
import execSync from "./execSync";
|
|
5
5
|
import { isRootCAExists, generateRootCA, defaultRootCA, trustRootCA } from "./macCAManager";
|
|
6
6
|
const { disableGlobalProxy, enableGlobalProxy } = require("./macProxyManager");
|
|
7
|
-
|
|
7
|
+
var WhistleProxy;
|
|
8
|
+
WhistleProxy = class WhistleProxy2 {
|
|
8
9
|
async installRootCA() {
|
|
9
10
|
try {
|
|
10
11
|
if (!isRootCAExists()) {
|
|
@@ -40,7 +41,7 @@ class WhistleProxy {
|
|
|
40
41
|
this.bin = path.resolve(path.dirname(require.resolve("whistle")), "bin/whistle.js");
|
|
41
42
|
this.certDir = path.dirname(defaultRootCA);
|
|
42
43
|
}
|
|
43
|
-
}
|
|
44
|
+
};
|
|
44
45
|
export {
|
|
45
46
|
WhistleProxy as default
|
|
46
47
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createProxyRule: (appDirectory: string, proxyOptions: any) => string;
|
|
1
|
+
export declare const createProxyRule: (appDirectory: string, proxyOptions: any) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const defaultRootCA: string;
|
|
2
2
|
export declare const trustRootCA: () => void;
|
|
3
3
|
export declare const isRootCAExists: () => boolean;
|
|
4
|
-
export declare const generateRootCA: (port: number) => Promise<unknown>;
|
|
4
|
+
export declare const generateRootCA: (port: number) => Promise<unknown>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const enableGlobalProxy: (ip: string, port: string) => void;
|
|
2
|
-
export declare const disableGlobalProxy: () => void;
|
|
2
|
+
export declare const disableGlobalProxy: () => void;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
interface ProxyConfig {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
rule: string;
|
|
3
|
+
port: number;
|
|
4
4
|
}
|
|
5
5
|
export default class WhistleProxy {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
private readonly rule;
|
|
7
|
+
private readonly port;
|
|
8
|
+
private readonly bin;
|
|
9
|
+
private readonly certDir;
|
|
10
|
+
constructor(config: ProxyConfig);
|
|
11
|
+
installRootCA(): Promise<void>;
|
|
12
|
+
start(): Promise<void>;
|
|
13
|
+
close(): void;
|
|
14
14
|
}
|
|
15
|
-
export {};
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "2.
|
|
18
|
+
"version": "2.42.0",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/types/index.d.ts",
|
|
21
21
|
"main": "./dist/cjs/index.js",
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"whistle": "^2.7.18",
|
|
38
|
-
"@swc/helpers": "0.5.
|
|
39
|
-
"@modern-js/utils": "2.
|
|
38
|
+
"@swc/helpers": "0.5.3",
|
|
39
|
+
"@modern-js/utils": "2.42.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/jest": "^29",
|
|
43
43
|
"@types/node": "^14",
|
|
44
44
|
"typescript": "^5",
|
|
45
45
|
"jest": "^29",
|
|
46
|
-
"@modern-js/core": "2.
|
|
47
|
-
"@scripts/build": "2.
|
|
48
|
-
"@scripts/jest-config": "2.
|
|
46
|
+
"@modern-js/core": "2.42.0",
|
|
47
|
+
"@scripts/build": "2.42.0",
|
|
48
|
+
"@scripts/jest-config": "2.42.0"
|
|
49
49
|
},
|
|
50
50
|
"sideEffects": false,
|
|
51
51
|
"publishConfig": {
|