@zintrust/core 1.2.0 → 1.5.0
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/cli/scaffolding/GovernanceScaffolder.d.ts.map +1 -1
- package/src/cli/scaffolding/GovernanceScaffolder.js +3 -32
- package/src/cli/scaffolding/ProjectScaffolder.d.ts.map +1 -1
- package/src/cli/scaffolding/ProjectScaffolder.js +2 -38
- package/src/cli/scaffolding/ScaffoldingVersionUtils.d.ts +1 -0
- package/src/cli/scaffolding/ScaffoldingVersionUtils.d.ts.map +1 -1
- package/src/cli/scaffolding/ScaffoldingVersionUtils.js +1 -0
- package/src/index.js +3 -3
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GovernanceScaffolder.d.ts","sourceRoot":"","sources":["../../../../src/cli/scaffolding/GovernanceScaffolder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"GovernanceScaffolder.d.ts","sourceRoot":"","sources":["../../../../src/cli/scaffolding/GovernanceScaffolder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC/C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAkSH,eAAO,MAAM,oBAAoB;0BAEhB,MAAM,YACV,yBAAyB,GACjC,OAAO,CAAC,wBAAwB,CAAC;EA+DpC,CAAC;AAEH,eAAe,oBAAoB,CAAC"}
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
* - Architecture tests (Vitest)
|
|
7
7
|
*/
|
|
8
8
|
import { FileGenerator } from '../scaffolding/FileGenerator.js';
|
|
9
|
-
import {
|
|
10
|
-
import { VersionChecker } from '../services/VersionChecker.js';
|
|
9
|
+
import { PINNED_GOVERNANCE_SCAFFOLDER_VERSION } from '../scaffolding/ScaffoldingVersionUtils.js';
|
|
11
10
|
import { SpawnUtil } from '../utils/spawn.js';
|
|
12
11
|
import { resolvePackageManager } from '../../common/index.js';
|
|
13
12
|
import { Logger } from '../../config/logger.js';
|
|
@@ -51,41 +50,13 @@ const ensureDevDependency = (devDependencies, name, version) => {
|
|
|
51
50
|
devDependencies[name] = version;
|
|
52
51
|
}
|
|
53
52
|
};
|
|
54
|
-
const getBundledGovernanceVersion = () => {
|
|
55
|
-
try {
|
|
56
|
-
const pkgUrl = new URL('../../../packages/governance/package.json', import.meta.url);
|
|
57
|
-
const raw = FileGenerator.readFile(pkgUrl.toString());
|
|
58
|
-
const parsed = JSON.parse(raw);
|
|
59
|
-
return typeof parsed.version === 'string' && parsed.version.trim() !== ''
|
|
60
|
-
? toCompatibleGovernanceVersion(parsed.version)
|
|
61
|
-
: undefined;
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
return undefined;
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
53
|
const inferGovernanceVersion = (pkg) => {
|
|
68
54
|
const devDeps = getStringRecord(pkg.devDependencies);
|
|
69
55
|
const existingGovernance = devDeps?.['@zintrust/governance'];
|
|
70
56
|
if (typeof existingGovernance === 'string' && existingGovernance.trim() !== '') {
|
|
71
57
|
return existingGovernance;
|
|
72
58
|
}
|
|
73
|
-
|
|
74
|
-
const core = deps?.['@zintrust/core'];
|
|
75
|
-
const bundledGovernanceVersion = getBundledGovernanceVersion();
|
|
76
|
-
if (typeof core === 'string' && core.trim() !== '') {
|
|
77
|
-
if (bundledGovernanceVersion !== undefined) {
|
|
78
|
-
return bundledGovernanceVersion;
|
|
79
|
-
}
|
|
80
|
-
if (extractMajorMinorVersion(core) !== undefined) {
|
|
81
|
-
return toCompatibleGovernanceVersion(core);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const currentVersion = VersionChecker.getCurrentVersion().trim();
|
|
85
|
-
if (currentVersion !== '' && currentVersion !== '0.0.0') {
|
|
86
|
-
return bundledGovernanceVersion ?? toCompatibleGovernanceVersion(currentVersion);
|
|
87
|
-
}
|
|
88
|
-
return bundledGovernanceVersion ?? '^0.4.0';
|
|
59
|
+
return PINNED_GOVERNANCE_SCAFFOLDER_VERSION;
|
|
89
60
|
};
|
|
90
61
|
const writeEslintConfig = (projectRoot) => {
|
|
91
62
|
const eslintConfigPath = path.join(projectRoot, 'eslint.config.mjs');
|
|
@@ -159,7 +130,7 @@ const extractImportSpecifiers = (source: string, filePath: string): ImportHit[]
|
|
|
159
130
|
const visit = (node: ts.Node) => {
|
|
160
131
|
if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
|
|
161
132
|
const moduleSpecifier = node.moduleSpecifier;
|
|
162
|
-
|
|
133
|
+
// extractMajorMinorVersion,
|
|
163
134
|
addHit(moduleSpecifier.text, moduleSpecifier.getStart(sourceFile));
|
|
164
135
|
}
|
|
165
136
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectScaffolder.d.ts","sourceRoot":"","sources":["../../../../src/cli/scaffolding/ProjectScaffolder.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"ProjectScaffolder.d.ts","sourceRoot":"","sources":["../../../../src/cli/scaffolding/ProjectScaffolder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,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D,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAEhD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAsBrE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG;IAChE,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAsBA;AAwJD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,GAAE,MAAsB,GAAG,kBAAkB,CAsB/F;AAED,wBAAsB,eAAe,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAEhC;AAED;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;EAM5B,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { EnvFileBackfill } from '../env/EnvFileBackfill.js';
|
|
6
6
|
import { EnvData } from '../scaffolding/env.js';
|
|
7
|
-
import {
|
|
7
|
+
import { PINNED_GOVERNANCE_SCAFFOLDER_VERSION } from '../scaffolding/ScaffoldingVersionUtils.js';
|
|
8
8
|
import { Logger } from '../../config/logger.js';
|
|
9
9
|
import { ErrorFactory } from '../../exceptions/ZintrustError.js';
|
|
10
10
|
import { isNonEmptyString } from '../../helper/index.js';
|
|
@@ -13,15 +13,6 @@ import fs from '../../node-singletons/fs.js';
|
|
|
13
13
|
import * as path from '../../node-singletons/path.js';
|
|
14
14
|
import { fileURLToPath } from '../../node-singletons/url.js';
|
|
15
15
|
import { execFileSync } from 'node:child_process';
|
|
16
|
-
const readBundledGovernancePackage = () => {
|
|
17
|
-
try {
|
|
18
|
-
const packageUrl = new URL('../../../packages/governance/package.json', import.meta.url);
|
|
19
|
-
return JSON.parse(fs.readFileSync(packageUrl, 'utf-8'));
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
16
|
const SAFE_PATH = '/usr/local/bin:/usr/bin:/bin';
|
|
26
17
|
const NPM_VIEW_TIMEOUT_MS = 1500;
|
|
27
18
|
const publishedVersionCache = new Map();
|
|
@@ -78,22 +69,6 @@ const loadPublishedNpmVersion = (packageName) => {
|
|
|
78
69
|
return undefined;
|
|
79
70
|
}
|
|
80
71
|
};
|
|
81
|
-
const loadBundledPublishedCoreVersion = () => {
|
|
82
|
-
const bundledGovernancePackage = readBundledGovernancePackage();
|
|
83
|
-
const peerDependencies = bundledGovernancePackage?.peerDependencies;
|
|
84
|
-
if (typeof peerDependencies !== 'object' || peerDependencies === null) {
|
|
85
|
-
return undefined;
|
|
86
|
-
}
|
|
87
|
-
const corePeerRange = peerDependencies['@zintrust/core'];
|
|
88
|
-
if (typeof corePeerRange !== 'string' || corePeerRange.trim() === '') {
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
const publishedLineVersion = extractMajorMinorVersion(corePeerRange);
|
|
92
|
-
if (publishedLineVersion === undefined) {
|
|
93
|
-
return '0.9.2';
|
|
94
|
-
}
|
|
95
|
-
return `${publishedLineVersion.major}.${publishedLineVersion.minor}.2`;
|
|
96
|
-
};
|
|
97
72
|
const toCompatibleCoreDependencyRange = (version) => `^${version}`;
|
|
98
73
|
const loadScaffoldCoreVersion = () => {
|
|
99
74
|
const publishedVersion = loadPublishedNpmVersion('@zintrust/core');
|
|
@@ -102,17 +77,6 @@ const loadScaffoldCoreVersion = () => {
|
|
|
102
77
|
}
|
|
103
78
|
return '*';
|
|
104
79
|
};
|
|
105
|
-
const loadGovernanceVersion = () => {
|
|
106
|
-
const publishedVersion = loadPublishedNpmVersion('@zintrust/governance');
|
|
107
|
-
if (typeof publishedVersion === 'string') {
|
|
108
|
-
return publishedVersion;
|
|
109
|
-
}
|
|
110
|
-
const bundledPublishedCoreVersion = loadBundledPublishedCoreVersion();
|
|
111
|
-
if (typeof bundledPublishedCoreVersion === 'string') {
|
|
112
|
-
return bundledPublishedCoreVersion;
|
|
113
|
-
}
|
|
114
|
-
return '0.9.2';
|
|
115
|
-
};
|
|
116
80
|
const createDirectories = (projectPath, directories) => {
|
|
117
81
|
let count = 0;
|
|
118
82
|
if (!fs.existsSync(projectPath)) {
|
|
@@ -569,7 +533,7 @@ const prepareContext = (state, options) => {
|
|
|
569
533
|
.slice(0, 14);
|
|
570
534
|
state.variables = {
|
|
571
535
|
coreVersion: loadScaffoldCoreVersion(),
|
|
572
|
-
governanceVersion:
|
|
536
|
+
governanceVersion: PINNED_GOVERNANCE_SCAFFOLDER_VERSION,
|
|
573
537
|
projectName: options.name,
|
|
574
538
|
projectSlug: options.name,
|
|
575
539
|
author: options.author ?? 'Your Name',
|
|
@@ -2,5 +2,6 @@ export declare const extractMajorMinorVersion: (value: string) => {
|
|
|
2
2
|
major: string;
|
|
3
3
|
minor: string;
|
|
4
4
|
} | undefined;
|
|
5
|
+
export declare const PINNED_GOVERNANCE_SCAFFOLDER_VERSION = "^1.2.0";
|
|
5
6
|
export declare const toCompatibleGovernanceVersion: (value: string, fallback?: string) => string;
|
|
6
7
|
//# sourceMappingURL=ScaffoldingVersionUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScaffoldingVersionUtils.d.ts","sourceRoot":"","sources":["../../../../src/cli/scaffolding/ScaffoldingVersionUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,KACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SA6BrC,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,OAAO,MAAM,EAAE,iBAAmB,KAAG,MAKlF,CAAC"}
|
|
1
|
+
{"version":3,"file":"ScaffoldingVersionUtils.d.ts","sourceRoot":"","sources":["../../../../src/cli/scaffolding/ScaffoldingVersionUtils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,GACnC,OAAO,MAAM,KACZ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SA6BrC,CAAC;AAEF,eAAO,MAAM,oCAAoC,WAAW,CAAC;AAE7D,eAAO,MAAM,6BAA6B,GAAI,OAAO,MAAM,EAAE,iBAAmB,KAAG,MAKlF,CAAC"}
|
|
@@ -26,6 +26,7 @@ export const extractMajorMinorVersion = (value) => {
|
|
|
26
26
|
return undefined;
|
|
27
27
|
return { major, minor };
|
|
28
28
|
};
|
|
29
|
+
export const PINNED_GOVERNANCE_SCAFFOLDER_VERSION = '^1.2.0';
|
|
29
30
|
export const toCompatibleGovernanceVersion = (value, fallback = '^1.0.0') => {
|
|
30
31
|
const parsed = extractMajorMinorVersion(value);
|
|
31
32
|
if (parsed === undefined)
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @zintrust/core v1.
|
|
2
|
+
* @zintrust/core v1.5.0
|
|
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-24T13:03:41.812Z
|
|
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-24T13:03:41.779Z'; // 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';
|