ghc-proxy 0.3.0 → 0.3.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/dist/main.mjs CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env bun
2
2
  import process from "node:process";
3
3
  import { defineCommand, runMain } from "citty";
4
4
  import consola from "consola";
@@ -14,6 +14,7 @@ import clipboard from "clipboardy";
14
14
  import { getProxyForUrl } from "proxy-from-env";
15
15
  import { Agent, ProxyAgent, setGlobalDispatcher } from "undici";
16
16
  import { cors } from "@elysiajs/cors";
17
+ import { node } from "@elysiajs/node";
17
18
  import { Elysia, sse } from "elysia";
18
19
  import { colorize } from "consola/utils";
19
20
 
@@ -780,7 +781,7 @@ const checkUsage = defineCommand({
780
781
 
781
782
  //#endregion
782
783
  //#region src/lib/version.ts
783
- const VERSION = "0.3.0";
784
+ const VERSION = "0.3.1";
784
785
 
785
786
  //#endregion
786
787
  //#region src/debug.ts
@@ -4860,8 +4861,12 @@ function createUsageRoute() {
4860
4861
 
4861
4862
  //#endregion
4862
4863
  //#region src/server.ts
4864
+ const isBun = typeof globalThis.Bun !== "undefined";
4863
4865
  function createServer(options) {
4864
- return new Elysia({ serve: options?.idleTimeout !== void 0 ? { idleTimeout: options.idleTimeout } : void 0 }).use(cors()).error({ HTTP: HTTPError }).derive(() => {
4866
+ return new Elysia({
4867
+ adapter: isBun ? void 0 : node(),
4868
+ serve: options?.idleTimeout !== void 0 ? { idleTimeout: options.idleTimeout } : void 0
4869
+ }).use(cors()).error({ HTTP: HTTPError }).derive(() => {
4865
4870
  return {
4866
4871
  requestStart: Date.now(),
4867
4872
  requestMeta: { modelMapping: void 0 }