@zintrust/core 0.4.52 → 0.4.53

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zintrust/core",
3
- "version": "0.4.52",
3
+ "version": "0.4.53",
4
4
  "description": "Production-grade TypeScript backend framework for JavaScript",
5
5
  "homepage": "https://zintrust.com",
6
6
  "repository": {
package/src/boot.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/boot.ts"],"names":[],"mappings":"AA4CA,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"boot.d.ts","sourceRoot":"","sources":["../../src/boot.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,CAAC"}
package/src/boot.js CHANGED
@@ -1,12 +1,7 @@
1
+ import { isNodeRuntime } from './runtime/detectRuntime.js';
1
2
  import { resolveNodeProjectRoot } from './runtime/resolveNodeProjectRoot.js';
2
- const isNodeProcessRuntime = () => {
3
- return (typeof process !== 'undefined' &&
4
- typeof process === 'object' &&
5
- process !== null &&
6
- typeof process.versions === 'object');
7
- };
8
3
  const ensureNodeBootstrapEnv = async () => {
9
- if (!isNodeProcessRuntime())
4
+ if (!isNodeRuntime())
10
5
  return;
11
6
  const projectRoot = await resolveNodeProjectRoot();
12
7
  if ((process.env?.['ZINTRUST_PROJECT_ROOT'] ?? '').trim() === '') {
package/src/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @zintrust/core v0.4.52
2
+ * @zintrust/core v0.4.53
3
3
  *
4
4
  * ZinTrust Framework - Production-Grade TypeScript Backend
5
5
  * Built for performance, type safety, and exceptional developer experience
6
6
  *
7
7
  * Build Information:
8
- * Built: 2026-04-04T14:55:22.232Z
8
+ * Built: 2026-04-04T15:12:36.401Z
9
9
  * Node: >=20.0.0
10
10
  * License: MIT
11
11
  *
@@ -21,7 +21,7 @@
21
21
  * Available at runtime for debugging and health checks
22
22
  */
23
23
  export const ZINTRUST_VERSION = '0.1.41';
24
- export const ZINTRUST_BUILD_DATE = '2026-04-04T14:55:22.199Z'; // Replaced during build
24
+ export const ZINTRUST_BUILD_DATE = '2026-04-04T15:12:36.368Z'; // Replaced during build
25
25
  export { Application } from './boot/Application.js';
26
26
  export { AwsSigV4 } from './common/index.js';
27
27
  export { SignedRequest } from './security/SignedRequest.js';
@@ -1 +1 @@
1
- {"version":3,"file":"detectRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtime/detectRuntime.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,YAAY,GAAG,aAAa,CAAC;AAE9E,eAAO,MAAM,aAAa,QAAO,OAWhC,CAAC;AAUF,eAAO,MAAM,cAAc,QAAO,WA6BjC,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAwBhB,CAAC"}
1
+ {"version":3,"file":"detectRuntime.d.ts","sourceRoot":"","sources":["../../../src/runtime/detectRuntime.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,YAAY,GAAG,aAAa,CAAC;AA4B9E,eAAO,MAAM,aAAa,QAAO,OAUhC,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,WA4BjC,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAkBhB,CAAC"}
@@ -1,29 +1,39 @@
1
- import { appConfig } from '../config/index.js';
2
1
  import { ZintrustLang } from '../lang/lang.js';
2
+ const getGlobalThis = () => {
3
+ if (typeof globalThis === ZintrustLang.UNDEFINED) {
4
+ return undefined;
5
+ }
6
+ return globalThis;
7
+ };
8
+ const isCloudflareRuntime = () => {
9
+ const globalRef = getGlobalThis();
10
+ // @ts-ignore - navigator is available in workers
11
+ if (typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers') {
12
+ return true;
13
+ }
14
+ return (typeof globalRef !== ZintrustLang.UNDEFINED &&
15
+ globalRef !== null &&
16
+ ((globalRef.caches !== undefined &&
17
+ typeof globalRef.caches !== ZintrustLang.UNDEFINED) ||
18
+ typeof globalRef.WebSocketPair === 'function' ||
19
+ typeof globalRef.CF !== ZintrustLang.UNDEFINED));
20
+ };
3
21
  export const isNodeRuntime = () => {
4
22
  // Avoid importing any `node:*` modules so this file remains Worker-safe.
5
23
  // In Workers/Deno, `process` is typically undefined.
6
- const detectRuntime = appConfig.detectRuntime() !== 'cloudflare';
7
- return (detectRuntime &&
24
+ return (!isCloudflareRuntime() &&
8
25
  typeof process !== ZintrustLang.UNDEFINED &&
9
26
  typeof process === ZintrustLang.OBJECT &&
10
27
  process !== null &&
11
28
  typeof process.versions === ZintrustLang.OBJECT);
12
29
  };
13
- const getGlobalThis = () => {
14
- if (typeof globalThis === ZintrustLang.UNDEFINED) {
15
- return undefined;
16
- }
17
- return globalThis;
18
- };
19
30
  export const getRuntimeMode = () => {
20
31
  // 1. Explicit override via env var (if available)
21
32
  if (typeof process !== 'undefined' && process.env?.['RUNTIME_MODE'] !== undefined) {
22
33
  return process.env['RUNTIME_MODE'];
23
34
  }
24
35
  // 2. Detect Cloudflare Workers
25
- // @ts-ignore - navigator is available in workers
26
- if (typeof navigator !== 'undefined' && navigator.userAgent === 'Cloudflare-Workers') {
36
+ if (isCloudflareRuntime()) {
27
37
  return 'cloudflare-workers';
28
38
  }
29
39
  // 3. Detect Container (Docker/Kubernetes)
@@ -44,12 +54,7 @@ export const getRuntimeMode = () => {
44
54
  export const detectRuntime = () => {
45
55
  const globalRef = getGlobalThis();
46
56
  const isNode = isNodeRuntime();
47
- const isCloudflare = typeof globalRef !== ZintrustLang.UNDEFINED &&
48
- globalRef !== null &&
49
- ((globalRef.caches !== undefined &&
50
- typeof globalRef.caches !== ZintrustLang.UNDEFINED) ||
51
- typeof globalRef.WebSocketPair === 'function' ||
52
- typeof globalRef.CF !== ZintrustLang.UNDEFINED);
57
+ const isCloudflare = isCloudflareRuntime();
53
58
  const isDeno = typeof globalRef !== ZintrustLang.UNDEFINED &&
54
59
  globalRef !== null &&
55
60
  typeof globalRef.Deno !== ZintrustLang.UNDEFINED;