@zintrust/core 1.6.0 → 1.6.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/package.json +5 -5
- package/src/boot/registry/runtime.d.ts.map +1 -1
- package/src/boot/registry/runtime.js +9 -0
- package/src/cli/cloudflare/CloudflareWranglerDevEnv.d.ts.map +1 -1
- package/src/cli/cloudflare/CloudflareWranglerDevEnv.js +21 -0
- package/src/cli/scaffolding/env.d.ts.map +1 -1
- package/src/cli/scaffolding/env.js +2 -0
- package/src/index.js +3 -3
- package/src/templates/project/basic/config/database.ts.tpl +1 -1
- package/src/zintrust.plugins.d.ts +6 -3
- package/src/zintrust.plugins.d.ts.map +1 -1
- package/src/zintrust.plugins.js +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zintrust/core",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Production-grade TypeScript backend framework for JavaScript",
|
|
5
5
|
"homepage": "https://zintrust.com",
|
|
6
6
|
"repository": {
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
"./package.json": "./package.json"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@cloudflare/containers": "^0.3.
|
|
60
|
+
"@cloudflare/containers": "^0.3.3",
|
|
61
61
|
"bcryptjs": "^3.0.3",
|
|
62
|
-
"bullmq": "^5.76.
|
|
62
|
+
"bullmq": "^5.76.4",
|
|
63
63
|
"chalk": "^5.6.2",
|
|
64
64
|
"commander": "^14.0.3",
|
|
65
|
-
"inquirer": "^13.4.
|
|
65
|
+
"inquirer": "^13.4.2",
|
|
66
66
|
"jsonwebtoken": "^9.0.3",
|
|
67
|
-
"mysql2": "^3.22.
|
|
67
|
+
"mysql2": "^3.22.3",
|
|
68
68
|
"pg": "^8.20.0",
|
|
69
69
|
"tsx": "^4.21.0"
|
|
70
70
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/boot/registry/runtime.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAUvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAkQ9C,eAAO,MAAM,8BAA8B,GAAI,iBAAiB,gBAAgB,KAAG,IA6BlF,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../src/boot/registry/runtime.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAUvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAkQ9C,eAAO,MAAM,8BAA8B,GAAI,iBAAiB,gBAAgB,KAAG,IA6BlF,CAAC;AAyVF,KAAK,eAAe,GAAG;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE,gBAAgB,CAAC;IAClC,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AA4HF,eAAO,MAAM,eAAe,GAC1B,QAAQ,eAAe,KACtB;IAAE,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAK5D,CAAC"}
|
|
@@ -411,6 +411,12 @@ const isTraceDashboardAutoMountEnabled = () => {
|
|
|
411
411
|
const raw = readEnvString('TRACE_AUTO_MOUNT').trim().toLowerCase();
|
|
412
412
|
return raw === '1' || raw === 'true';
|
|
413
413
|
};
|
|
414
|
+
const isTraceProxySenderEnabled = () => {
|
|
415
|
+
const proxyEnabled = readEnvString('TRACE_PROXY').trim().toLowerCase();
|
|
416
|
+
if (proxyEnabled !== '1' && proxyEnabled !== 'true')
|
|
417
|
+
return false;
|
|
418
|
+
return readEnvString('TRACE_PROXY_URL').trim() !== '';
|
|
419
|
+
};
|
|
414
420
|
const resolveTraceDashboardBasePath = () => {
|
|
415
421
|
const raw = readEnvString('TRACE_BASE_PATH').trim();
|
|
416
422
|
if (raw === '')
|
|
@@ -447,6 +453,9 @@ const initializeSystemTrace = async (router) => {
|
|
|
447
453
|
return;
|
|
448
454
|
}
|
|
449
455
|
if (!isTraceDashboardAutoMountEnabled()) {
|
|
456
|
+
if (isTraceProxySenderEnabled()) {
|
|
457
|
+
return;
|
|
458
|
+
}
|
|
450
459
|
Logger.info('System Trace runtime activated. Set TRACE_AUTO_MOUNT=true or register dashboard routes manually if needed.');
|
|
451
460
|
return;
|
|
452
461
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CloudflareWranglerDevEnv.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloudflare/CloudflareWranglerDevEnv.ts"],"names":[],"mappings":"AAUA,KAAK,kBAAkB,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;
|
|
1
|
+
{"version":3,"file":"CloudflareWranglerDevEnv.d.ts","sourceRoot":"","sources":["../../../../src/cli/cloudflare/CloudflareWranglerDevEnv.ts"],"names":[],"mappings":"AAUA,KAAK,kBAAkB,GAAG;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AA+KF,eAAO,MAAM,0BAA0B,GACrC,MAAM,kBAAkB,KACvB,OAAO,CAAC,mCAAmC,CAmB7C,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAU,CAAC,EACjD,MAAM,kBAAkB,EACxB,IAAI,MAAM,OAAO,CAAC,CAAC,CAAC,KACnB,OAAO,CAAC,CAAC,CAkCX,CAAC;;uCA3DM,kBAAkB,KACvB,OAAO,CAAC,mCAAmC,CAAC;kCAqBG,CAAC,QAC3C,kBAAkB,MACpB,MAAM,OAAO,CAAC,CAAC,CAAC,KACnB,OAAO,CAAC,CAAC,CAAC;;AAoCb,wBAGG"}
|
|
@@ -70,6 +70,24 @@ const resolveRuntimeEnvMap = (runtimeEnv) => {
|
|
|
70
70
|
return typeof entry[1] === 'string';
|
|
71
71
|
}));
|
|
72
72
|
};
|
|
73
|
+
const isTruthyEnvValue = (value) => {
|
|
74
|
+
if (!isNonEmptyString(value))
|
|
75
|
+
return false;
|
|
76
|
+
const normalized = value.trim().toLowerCase();
|
|
77
|
+
return normalized === '1' || normalized === 'true' || normalized === 'yes' || normalized === 'on';
|
|
78
|
+
};
|
|
79
|
+
const shouldUseEnvFileDirectly = async (args) => {
|
|
80
|
+
const runtimeEnv = resolveRuntimeEnvMap(args.runtimeEnv ?? process.env);
|
|
81
|
+
if (isTruthyEnvValue(runtimeEnv['USE_ENV'])) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
const envPath = isNonEmptyString(args.envPath) ? args.envPath.trim() : '.env';
|
|
85
|
+
const envFileValues = await EnvFile.read({
|
|
86
|
+
cwd: args.projectRoot,
|
|
87
|
+
path: envPath,
|
|
88
|
+
});
|
|
89
|
+
return isTruthyEnvValue(envFileValues['USE_ENV']);
|
|
90
|
+
};
|
|
73
91
|
const resolveSelectedKeys = (args) => {
|
|
74
92
|
const zintrustConfigPath = path.join(args.projectRoot, '.zintrust.json');
|
|
75
93
|
if (!existsSync(zintrustConfigPath)) {
|
|
@@ -136,6 +154,9 @@ export const materializeWranglerDevVars = async (args) => {
|
|
|
136
154
|
};
|
|
137
155
|
};
|
|
138
156
|
export const withWranglerDevVarsSnapshot = async (args, fn) => {
|
|
157
|
+
if (await shouldUseEnvFileDirectly(args)) {
|
|
158
|
+
return fn();
|
|
159
|
+
}
|
|
139
160
|
const targetPath = path.join(args.cwd, getWranglerDevVarsFileName(args.envName));
|
|
140
161
|
const backupPath = getWranglerDevVarsBackupPath(targetPath);
|
|
141
162
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../src/cli/scaffolding/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../../src/cli/scaffolding/env.ts"],"names":[],"mappings":"AAqiBA,eAAO,MAAM,OAAO,GAClB,MAAM,MAAM,EACZ,MAAM,MAAM,EACZ,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,oBAAoB,MAAM,EAC1B,SAAS,MAAM,EAAE,EACjB,cAAc,MAAM,KACnB,MAAM,EAWR,CAAC"}
|
|
@@ -26,6 +26,8 @@ const HeaderAndApp = (name, port, baseUrl, appKey) => [
|
|
|
26
26
|
'',
|
|
27
27
|
'# Cloudflare Workers (TCP sockets) — set true if using TCP adapters on Workers.',
|
|
28
28
|
'ENABLE_CLOUDFLARE_SOCKETS=false',
|
|
29
|
+
'# When true, Wrangler reads .env directly and ZinTrust will not materialize .dev.vars files.',
|
|
30
|
+
'USE_ENV=false',
|
|
29
31
|
'',
|
|
30
32
|
'# CLI / tooling',
|
|
31
33
|
'ZINTRUST_RUN_FROM_SOURCE=0',
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @zintrust/core v1.6.
|
|
2
|
+
* @zintrust/core v1.6.1
|
|
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-
|
|
8
|
+
* Built: 2026-04-30T12:31:49.571Z
|
|
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-
|
|
24
|
+
export const ZINTRUST_BUILD_DATE = '2026-04-30T12:31:49.535Z'; // 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';
|
|
@@ -17,7 +17,7 @@ const parseReadHosts = (raw: string): string[] | undefined => {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export default {
|
|
20
|
-
default: Env.get('DB_CONNECTION', '
|
|
20
|
+
default: Env.get('DB_CONNECTION', Env.getBool('CLOUDFLARE_WORKER', false) ? 'd1' : 'sqlite'),
|
|
21
21
|
connections: {
|
|
22
22
|
sqlite: {
|
|
23
23
|
driver: 'sqlite' as const,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* ZinTrust plugin auto-imports
|
|
3
|
+
*
|
|
4
|
+
* In real projects, this file is managed by `zin plugin install` and contains
|
|
5
|
+
* side-effect imports (e.g. `@zintrust/db-sqlite/register`) that register
|
|
6
|
+
* optional adapters/drivers into core registries.
|
|
7
|
+
*
|
|
5
8
|
*/
|
|
6
9
|
export type {};
|
|
7
10
|
export declare const __zintrustGeneratedPluginStub = "zintrust.plugins.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zintrust.plugins.d.ts","sourceRoot":"","sources":["../../src/zintrust.plugins.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"zintrust.plugins.d.ts","sourceRoot":"","sources":["../../src/zintrust.plugins.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,YAAY,EAAE,CAAC;AAgBf,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;;AACnE,wBAAkB"}
|
package/src/zintrust.plugins.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* ZinTrust plugin auto-imports
|
|
3
|
+
*
|
|
4
|
+
* In real projects, this file is managed by `zin plugin install` and contains
|
|
5
|
+
* side-effect imports (e.g. `@zintrust/db-sqlite/register`) that register
|
|
6
|
+
* optional adapters/drivers into core registries.
|
|
7
|
+
*
|
|
5
8
|
*/
|
|
6
9
|
import * as TraceRuntime from './runtime/plugins/trace-runtime.js';
|
|
7
10
|
globalThis.__zintrust_system_trace_plugin_requested__ = true;
|