@zintrust/core 1.6.1 → 1.6.2
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 +1 -1
- package/src/boot/registry/runtime.d.ts.map +1 -1
- package/src/boot/registry/runtime.js +8 -1
- package/src/cli/cloudflare/CloudflareWranglerDevEnv.d.ts.map +1 -1
- package/src/cli/cloudflare/CloudflareWranglerDevEnv.js +30 -3
- package/src/cli/commands/StartCommand.d.ts.map +1 -1
- package/src/cli/commands/StartCommand.js +5 -3
- package/src/index.js +3 -3
- package/src/orm/adapters/SQLiteAdapter.d.ts.map +1 -1
- package/src/orm/adapters/SQLiteAdapter.js +10 -1
package/package.json
CHANGED
|
@@ -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;
|
|
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;AA0Q9C,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"}
|
|
@@ -49,12 +49,19 @@ const loadBundledSystemTraceModule = async () => {
|
|
|
49
49
|
return undefined;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
+
const resolveLocalSystemTraceProjectRoot = () => {
|
|
53
|
+
const configuredProjectRoot = readEnvString('ZINTRUST_PROJECT_ROOT').trim();
|
|
54
|
+
if (configuredProjectRoot !== '') {
|
|
55
|
+
return configuredProjectRoot;
|
|
56
|
+
}
|
|
57
|
+
return typeof process !== 'undefined' && typeof process.cwd === 'function' ? process.cwd() : '';
|
|
58
|
+
};
|
|
52
59
|
const loadLocalSystemTraceModule = async () => {
|
|
53
60
|
const globalTracePluginState = globalThis;
|
|
54
61
|
if (globalTracePluginState.__zintrust_system_trace_runtime__ !== undefined) {
|
|
55
62
|
return globalTracePluginState.__zintrust_system_trace_runtime__;
|
|
56
63
|
}
|
|
57
|
-
const projectRoot =
|
|
64
|
+
const projectRoot = resolveLocalSystemTraceProjectRoot();
|
|
58
65
|
if (projectRoot !== '') {
|
|
59
66
|
const moduleCandidates = [
|
|
60
67
|
path.join(projectRoot, 'src', 'runtime', 'plugins', 'trace-runtime.ts'),
|
|
@@ -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;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AC,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 readExistingWranglerDevVars = async (args) => {
|
|
74
|
+
const fileName = getWranglerDevVarsFileName(args.envName);
|
|
75
|
+
const targetPath = path.join(args.cwd, fileName);
|
|
76
|
+
const backupPath = getWranglerDevVarsBackupPath(targetPath);
|
|
77
|
+
let sourcePath;
|
|
78
|
+
if (existsSync(targetPath)) {
|
|
79
|
+
sourcePath = fileName;
|
|
80
|
+
}
|
|
81
|
+
else if (existsSync(backupPath)) {
|
|
82
|
+
sourcePath = path.basename(backupPath);
|
|
83
|
+
}
|
|
84
|
+
if (sourcePath === undefined)
|
|
85
|
+
return {};
|
|
86
|
+
return EnvFile.read({
|
|
87
|
+
cwd: args.cwd,
|
|
88
|
+
path: sourcePath,
|
|
89
|
+
});
|
|
90
|
+
};
|
|
73
91
|
const isTruthyEnvValue = (value) => {
|
|
74
92
|
if (!isNonEmptyString(value))
|
|
75
93
|
return false;
|
|
@@ -111,6 +129,7 @@ const resolveSelectedKeys = (args) => {
|
|
|
111
129
|
};
|
|
112
130
|
const collectWranglerDevVarValues = async (args, selectedKeys) => {
|
|
113
131
|
const runtimeEnv = resolveRuntimeEnvMap(args.runtimeEnv ?? process.env);
|
|
132
|
+
const existingDevVarValues = await readExistingWranglerDevVars(args);
|
|
114
133
|
const envPath = isNonEmptyString(args.envPath) ? args.envPath.trim() : '.env';
|
|
115
134
|
const envFileValues = await EnvFile.read({
|
|
116
135
|
cwd: args.projectRoot,
|
|
@@ -118,14 +137,22 @@ const collectWranglerDevVarValues = async (args, selectedKeys) => {
|
|
|
118
137
|
});
|
|
119
138
|
const allowedKeys = selectedKeys.length === 0
|
|
120
139
|
? undefined
|
|
121
|
-
: new Set([
|
|
140
|
+
: new Set([
|
|
141
|
+
...WRANGLER_RUNTIME_ENV_KEYS,
|
|
142
|
+
...selectedKeys,
|
|
143
|
+
...Object.keys(existingDevVarValues),
|
|
144
|
+
]);
|
|
122
145
|
const candidateKeys = allowedKeys === undefined
|
|
123
|
-
? uniq([
|
|
146
|
+
? uniq([
|
|
147
|
+
...Object.keys(runtimeEnv),
|
|
148
|
+
...Object.keys(envFileValues),
|
|
149
|
+
...Object.keys(existingDevVarValues),
|
|
150
|
+
]).filter(isWranglerVarName)
|
|
124
151
|
: [...allowedKeys].filter(isWranglerVarName);
|
|
125
152
|
const values = {};
|
|
126
153
|
const missingKeys = [];
|
|
127
154
|
for (const key of candidateKeys) {
|
|
128
|
-
const value = envFileValues[key] ?? runtimeEnv[key];
|
|
155
|
+
const value = existingDevVarValues[key] ?? envFileValues[key] ?? runtimeEnv[key];
|
|
129
156
|
if (typeof value !== 'string') {
|
|
130
157
|
if (selectedKeys.includes(key))
|
|
131
158
|
missingKeys.push(key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StartCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/StartCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"StartCommand.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/StartCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAygCvF,eAAO,MAAM,YAAY;cACb,YAAY;;mCA78BU,MAAM,KAAG,OAAO;4CAaP,MAAM,KAAG,MAAM;4CA4Bf,MAAM,KAAG,OAAO;sCAetB,MAAM,WAAW,MAAM,KAAG,OAAO;oCAmBnC,MAAM,KAAG,OAAO;;EA66BjD,CAAC"}
|
|
@@ -320,10 +320,12 @@ const readPackageJsonFromDir = (dir) => {
|
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
322
|
const resolveStartContext = (cwd) => {
|
|
323
|
-
const
|
|
324
|
-
const
|
|
323
|
+
const configuredProjectRoot = (process.env['ZINTRUST_PROJECT_ROOT'] ?? '').trim();
|
|
324
|
+
const effectiveCwd = configuredProjectRoot === '' ? cwd : configuredProjectRoot;
|
|
325
|
+
const projectRoot = findNearestPackageJsonDir(effectiveCwd) ?? effectiveCwd;
|
|
326
|
+
const packageDir = findNearestPackageJsonDir(effectiveCwd);
|
|
325
327
|
return {
|
|
326
|
-
cwd,
|
|
328
|
+
cwd: effectiveCwd,
|
|
327
329
|
projectRoot,
|
|
328
330
|
...(packageDir === undefined ? {} : { packageJson: readPackageJsonFromDir(packageDir) }),
|
|
329
331
|
};
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @zintrust/core v1.6.
|
|
2
|
+
* @zintrust/core v1.6.2
|
|
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-30T16:12:18.041Z
|
|
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-30T16:12:18.008Z'; // 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":"SQLiteAdapter.d.ts","sourceRoot":"","sources":["../../../../src/orm/adapters/SQLiteAdapter.ts"],"names":[],"mappings":"AACA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"SQLiteAdapter.d.ts","sourceRoot":"","sources":["../../../../src/orm/adapters/SQLiteAdapter.ts"],"names":[],"mappings":"AACA;;;GAGG;AAWH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAe,MAAM,sBAAsB,CAAC;AAuO1F,iBAAS,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,gBAAgB,CA0FrE;AAED,eAAO,MAAM,aAAa;;EAExB,CAAC"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Production Implementation
|
|
5
5
|
*/
|
|
6
6
|
import { databaseConfig } from '../../config/database.js';
|
|
7
|
+
import { Env } from '../../config/env.js';
|
|
7
8
|
import { FeatureFlags } from '../../config/features.js';
|
|
8
9
|
import { Logger } from '../../config/logger.js';
|
|
9
10
|
import { ErrorFactory } from '../../exceptions/ZintrustError.js';
|
|
@@ -60,7 +61,15 @@ async function importSqliteDatabaseConstructor() {
|
|
|
60
61
|
}
|
|
61
62
|
function normalizeFilename(database) {
|
|
62
63
|
const value = (database ?? '').trim();
|
|
63
|
-
|
|
64
|
+
if (value.length === 0)
|
|
65
|
+
return ':memory:';
|
|
66
|
+
if (value === ':memory:' || value.startsWith('/') || /^[A-Za-z]:[\\/]/.test(value)) {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
const configuredProjectRoot = Env.ZINTRUST_PROJECT_ROOT.trim();
|
|
70
|
+
if (configuredProjectRoot !== '')
|
|
71
|
+
return path.join(configuredProjectRoot, value);
|
|
72
|
+
return value;
|
|
64
73
|
}
|
|
65
74
|
function isSelectQuery(sql) {
|
|
66
75
|
const normalized = sql.trimStart().toLowerCase();
|