Skip to content

Commit 7827b7c

Browse files
committed
fixup: export proxy-options separately
1 parent 77730ab commit 7827b7c

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

packages/devtools-proxy-support/package.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,22 @@
2424
"license": "Apache-2.0",
2525
"main": "dist/index.js",
2626
"exports": {
27-
"require": "./dist/index.js",
28-
"import": "./dist/.esm-wrapper.mjs"
27+
".": {
28+
"require": "./dist/index.js",
29+
"import": "./dist/.esm-wrapper.mjs",
30+
"types": "./dist/index.d.ts"
31+
},
32+
"./proxy-options": {
33+
"require": "./dist/proxy-options-public.js",
34+
"import": "./dist/.esm-wrapper-po.mjs",
35+
"types": "./dist/proxy-options-public.d.ts"
36+
}
2937
},
3038
"types": "./dist/index.d.ts",
3139
"scripts": {
3240
"bootstrap": "npm run compile",
3341
"prepublishOnly": "npm run compile",
34-
"compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs",
42+
"compile": "tsc -p tsconfig.json && gen-esm-wrapper . ./dist/.esm-wrapper.mjs && gen-esm-wrapper ./dist/proxy-options-public ./dist/.esm-wrapper-po.mjs",
3543
"typecheck": "tsc --noEmit",
3644
"eslint": "eslint",
3745
"prettier": "prettier",

packages/devtools-proxy-support/src/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
export {
2-
DevtoolsProxyOptions,
3-
DevtoolsProxyOptionsSecrets,
4-
translateToElectronProxyConfig,
5-
extractProxySecrets,
6-
mergeProxySecrets,
7-
} from './proxy-options';
1+
export * from './proxy-options-public';
82
export { Tunnel, TunnelOptions, createSocks5Tunnel } from './socks5';
93
export { createAgent, useOrCreateAgent, AgentWithInitialize } from './agent';
104
export {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Seperate exports that can be loaded in a browser-only
2+
// environment (e.g. compass-web).
3+
export {
4+
DevtoolsProxyOptions,
5+
DevtoolsProxyOptionsSecrets,
6+
translateToElectronProxyConfig,
7+
extractProxySecrets,
8+
mergeProxySecrets,
9+
} from './proxy-options';

packages/devtools-proxy-support/src/proxy-options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Only use browser-compatible imports or type imports here
12
import type { ConnectionOptions } from 'tls';
23
import type { TunnelOptions } from './socks5';
34
import type { ClientRequest } from 'http';

0 commit comments

Comments
 (0)