Comparing version 0.1.7 to 0.1.8
@@ -29,2 +29,27 @@ "use strict"; | ||
} | ||
get runtime() { | ||
const global = globalThis; | ||
if (global?.Deno !== void 0) { | ||
return "deno"; | ||
} | ||
if (global?.Bun !== void 0) { | ||
return "bun"; | ||
} | ||
if (typeof global?.WebSocketPair === "function") { | ||
return "cloudflare"; | ||
} | ||
if (global?.fastly !== void 0) { | ||
return "fastly"; | ||
} | ||
if (typeof global?.EdgeRuntime === "string") { | ||
return "vercel"; | ||
} | ||
if (global?.process?.release?.name === "node") { | ||
return "node"; | ||
} | ||
if (global?.__lagon__ !== void 0) { | ||
return "lagon"; | ||
} | ||
return "unknown"; | ||
} | ||
} | ||
@@ -31,0 +56,0 @@ // Annotate the CommonJS export names for ESM import in node: |
import type { ExecutionContext, Environment } from '../types'; | ||
type Runtime = 'node' | 'deno' | 'bun' | 'cloudflare' | 'fastly' | 'vercel' | 'lagon' | 'unknown'; | ||
export declare class RuntimeContext { | ||
@@ -6,2 +7,4 @@ readonly env?: Environment; | ||
constructor(env?: Environment, exeContext?: ExecutionContext); | ||
get runtime(): Runtime; | ||
} | ||
export {}; |
@@ -7,2 +7,27 @@ // src/context/runtime.ts | ||
} | ||
get runtime() { | ||
const global = globalThis; | ||
if (global?.Deno !== void 0) { | ||
return "deno"; | ||
} | ||
if (global?.Bun !== void 0) { | ||
return "bun"; | ||
} | ||
if (typeof global?.WebSocketPair === "function") { | ||
return "cloudflare"; | ||
} | ||
if (global?.fastly !== void 0) { | ||
return "fastly"; | ||
} | ||
if (typeof global?.EdgeRuntime === "string") { | ||
return "vercel"; | ||
} | ||
if (global?.process?.release?.name === "node") { | ||
return "node"; | ||
} | ||
if (global?.__lagon__ !== void 0) { | ||
return "lagon"; | ||
} | ||
return "unknown"; | ||
} | ||
}; | ||
@@ -9,0 +34,0 @@ export { |
{ | ||
"name": "edgeql", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"author": "Minghe Huang <h.minghe@gmail.com> (https://github.com/metrue)", | ||
@@ -104,2 +104,3 @@ "license": "MIT", | ||
"@graphql-tools/schema": "^10.0.2", | ||
"@hono/node-server": "^1.8.2", | ||
"graphql": "^16.8.1" | ||
@@ -115,2 +116,3 @@ }, | ||
"@types/node": "^20.11.27", | ||
"@types/supertest": "^6.0.2", | ||
"@typescript-eslint/eslint-plugin": "^5.21.0", | ||
@@ -120,4 +122,4 @@ "@typescript-eslint/parser": "^5.21.0", | ||
"arg": "^5.0.2", | ||
"esbuild": "^0.15.12", | ||
"eslint": "^8.56.0", | ||
"esbuild": "^0.15.12", | ||
"eslint-config-prettier": "^8.5.0", | ||
@@ -131,2 +133,3 @@ "eslint-define-config": "^1.4.0", | ||
"prettier": "^3.2.4", | ||
"supertest": "^6.3.4", | ||
"tsx": "^4.7.1", | ||
@@ -133,0 +136,0 @@ "typescript": "^5.3.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66969
47
2001
3
28
+ Added@hono/node-server@^1.8.2
+ Added@hono/node-server@1.13.7(transitive)
+ Addedhono@4.6.12(transitive)