@infoxchange/make-it-so 2.12.0 → 2.13.0-internal-testing-add-import-time-setup-proxy-globally.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/README.md CHANGED
@@ -302,6 +302,31 @@ const vpcDetails = new IxVpcDetails(scope, "VpcDetails");
302
302
 
303
303
  </details>
304
304
 
305
+ ### Configuring Clients To Use the HTTP Proxy
306
+
307
+ It's not always foolproof due to the lack of standardisation around how http proxy support can be configured at a global
308
+ level but importing the following should hopefully means that any http requests are sent via the proxy:
309
+
310
+ ```typescript
311
+ import "@infoxchange/make-it-so/proxy/setup-globally";
312
+ ```
313
+
314
+ Or if you don't want/need proxy details to be configured before other imports you can use:
315
+
316
+ ```typescript
317
+ import { setupProxyGlobally } from "@infoxchange/make-it-so/proxy";
318
+
319
+ setupProxyGlobally();
320
+ ```
321
+
322
+ You can also get local fetch instance that's configured to use the proxy:
323
+
324
+ ```typescript
325
+ import { getProxiedFetch } from "@infoxchange/make-it-so/proxy";
326
+
327
+ const httpProxiedFetch = getProxiedFetch();
328
+ ```
329
+
305
330
  ## Example App Using Make It So
306
331
 
307
332
  To deploy a Next.js based site you would include a `sst.config.ts` file at the root of repo with contents like this:
@@ -1,2 +1,2 @@
1
- export * from "./fetch.js";
1
+ export * from "./request-client-setup.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/proxy/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/proxy/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- export * from "./fetch.js";
1
+ export * from "./request-client-setup.js";
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=request-client-global-setup-on-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-client-global-setup-on-import.d.ts","sourceRoot":"","sources":["../../../src/lib/proxy/request-client-global-setup-on-import.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import { setupProxyGlobally } from "./request-client-setup.js";
2
+ setupProxyGlobally();
@@ -1,4 +1,4 @@
1
1
  import { fetch as undiciFetch } from "undici";
2
2
  export declare function setupProxyGlobally(): void;
3
3
  export declare function getProxiedFetch(): typeof undiciFetch;
4
- //# sourceMappingURL=fetch.d.ts.map
4
+ //# sourceMappingURL=request-client-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-client-setup.d.ts","sourceRoot":"","sources":["../../../src/lib/proxy/request-client-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,WAAW,EACrB,MAAM,QAAQ,CAAC;AAGhB,wBAAgB,kBAAkB,SAmBjC;AAED,wBAAgB,eAAe,uBAW9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infoxchange/make-it-so",
3
- "version": "2.12.0",
3
+ "version": "2.13.0-internal-testing-add-import-time-setup-proxy-globally.1",
4
4
  "description": "Makes deploying services to IX infra easy",
5
5
  "repository": "github:infoxchange/make-it-so",
6
6
  "type": "module",
@@ -18,7 +18,8 @@
18
18
  "./cdk-constructs": "./dist/cdk-constructs/index.js",
19
19
  "./deployConfig": "./dist/deployConfig.js",
20
20
  "./auth": "./dist/lib/auth/index.js",
21
- "./proxy": "./dist/lib/proxy/index.js"
21
+ "./proxy": "./dist/lib/proxy/index.js",
22
+ "./proxy/setup-globally": "./dist/lib/proxy/request-client-global-setup-on-import.js"
22
23
  },
23
24
  "lint-staged": {
24
25
  "**/*": [
@@ -1 +1 @@
1
- export * from "./fetch.js";
1
+ export * from "./request-client-setup.js";
@@ -0,0 +1,3 @@
1
+ import { setupProxyGlobally } from "./request-client-setup.js";
2
+
3
+ setupProxyGlobally();
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/lib/proxy/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,WAAW,EACrB,MAAM,QAAQ,CAAC;AAGhB,wBAAgB,kBAAkB,SAmBjC;AAED,wBAAgB,eAAe,uBAW9B"}