@zintrust/core 0.4.1 → 0.4.3
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/bin/zintrust-main.d.ts.map +1 -1
- package/bin/zintrust-main.js +17 -0
- package/package.json +15 -6
- package/src/cli/CLI.d.ts.map +1 -1
- package/src/cli/CLI.js +2 -10
- package/src/cli/OptionalCliCommandRegistry.d.ts +12 -0
- package/src/cli/OptionalCliCommandRegistry.d.ts.map +1 -0
- package/src/cli/OptionalCliCommandRegistry.js +25 -0
- package/src/cli/OptionalCliExtensions.d.ts +41 -0
- package/src/cli/OptionalCliExtensions.d.ts.map +1 -0
- package/src/cli/OptionalCliExtensions.js +244 -0
- package/src/cli/commands/StartCommand.d.ts.map +1 -1
- package/src/cli/commands/StartCommand.js +24 -0
- package/src/cli/index.d.ts +1 -0
- package/src/cli/index.d.ts.map +1 -1
- package/src/cli/index.js +1 -0
- package/src/cli/scaffolding/GovernanceScaffolder.js +4 -4
- package/src/cli.d.ts +4 -1
- package/src/cli.d.ts.map +1 -1
- package/src/cli.js +3 -1
- package/src/index.js +3 -3
- package/src/node.d.ts +5 -0
- package/src/node.d.ts.map +1 -1
- package/src/node.js +5 -0
- package/src/templates/adapters/SQLiteAdapter.ts.tpl +1 -3
- package/src/templates/project/basic/database/seeders/DatabaseSeeder.ts.tpl +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zintrust-main.d.ts","sourceRoot":"","sources":["../../bin/zintrust-main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuGH,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"zintrust-main.d.ts","sourceRoot":"","sources":["../../bin/zintrust-main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuGH,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAsEzC;AAED,OAAO,EAAE,CAAC"}
|
package/bin/zintrust-main.js
CHANGED
|
@@ -99,6 +99,23 @@ export async function run() {
|
|
|
99
99
|
}
|
|
100
100
|
const { EnvFileLoader } = await import('../src/cli/utils/EnvFileLoader.js');
|
|
101
101
|
EnvFileLoader.ensureLoaded();
|
|
102
|
+
// Auto-load install-only CLI extension packages that self-register commands.
|
|
103
|
+
let optionalCliExtensions;
|
|
104
|
+
let optionalCliStatuses = [];
|
|
105
|
+
try {
|
|
106
|
+
({ OptionalCliExtensions: optionalCliExtensions } =
|
|
107
|
+
await import('../src/cli/OptionalCliExtensions.js'));
|
|
108
|
+
optionalCliStatuses = await optionalCliExtensions.loadForArgs(args0);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// best-effort; missing optional extensions must not block the CLI
|
|
112
|
+
}
|
|
113
|
+
const missingOptionalExtension = optionalCliExtensions?.findMissingExtensionForArgs(args0, optionalCliStatuses);
|
|
114
|
+
if (missingOptionalExtension !== undefined) {
|
|
115
|
+
const { ErrorFactory } = await import('../src/exceptions/ZintrustError.js');
|
|
116
|
+
throw ErrorFactory.createCliError(optionalCliExtensions?.getMissingExtensionMessage(missingOptionalExtension) ??
|
|
117
|
+
`Missing optional CLI package: ${missingOptionalExtension.packageName}`);
|
|
118
|
+
}
|
|
102
119
|
// Ensure project-installed adapters/drivers are registered for CLI commands.
|
|
103
120
|
// (This is driven by src/zintrust.plugins.ts generated by `zin plugin install`.)
|
|
104
121
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zintrust/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Production-grade TypeScript backend framework for JavaScript",
|
|
5
5
|
"homepage": "https://zintrust.com",
|
|
6
6
|
"repository": {
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@cloudflare/containers": "^0.1.1",
|
|
49
|
-
"@zintrust/workers": "^0.
|
|
49
|
+
"@zintrust/workers": "^0.4.0",
|
|
50
50
|
"bcryptjs": "^3.0.3",
|
|
51
|
-
"bullmq": "^5.
|
|
51
|
+
"bullmq": "^5.71.0",
|
|
52
52
|
"chalk": "^5.6.2",
|
|
53
53
|
"commander": "^14.0.3",
|
|
54
|
-
"inquirer": "^13.3.
|
|
54
|
+
"inquirer": "^13.3.2",
|
|
55
55
|
"jsonwebtoken": "^9.0.3",
|
|
56
|
-
"mysql2": "^3.
|
|
56
|
+
"mysql2": "^3.20.0",
|
|
57
57
|
"pg": "^8.20.0"
|
|
58
58
|
},
|
|
59
59
|
"overrides": {
|
|
@@ -64,7 +64,16 @@
|
|
|
64
64
|
"glob": "^11.1.0",
|
|
65
65
|
"minimatch": "^10.2.2",
|
|
66
66
|
"rollup": "^4.59.0",
|
|
67
|
-
"
|
|
67
|
+
"flatted": "^3.4.2",
|
|
68
|
+
"@actions/github": {
|
|
69
|
+
"undici": "^6.24.0"
|
|
70
|
+
},
|
|
71
|
+
"@actions/http-client": {
|
|
72
|
+
"undici": "^6.24.0"
|
|
73
|
+
},
|
|
74
|
+
"miniflare": {
|
|
75
|
+
"undici": "^7.24.4"
|
|
76
|
+
}
|
|
68
77
|
},
|
|
69
78
|
"bin": {
|
|
70
79
|
"zintrust": "bin/zintrust.js",
|
package/src/cli/CLI.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CLI.d.ts","sourceRoot":"","sources":["../../../src/cli/CLI.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"CLI.d.ts","sourceRoot":"","sources":["../../../src/cli/CLI.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,MAAM,WAAW,IAAI;IACnB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,UAAU,IAAI,OAAO,CAAC;CACvB;AAsPD;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG;cACJ,IAAI;EAed,CAAC"}
|
package/src/cli/CLI.js
CHANGED
|
@@ -58,15 +58,14 @@ import { SqlServerProxyCommand } from './commands/SqlServerProxyCommand.js';
|
|
|
58
58
|
import { StartCommand } from './commands/StartCommand.js';
|
|
59
59
|
import { TemplatesCommand } from './commands/TemplatesCommand.js';
|
|
60
60
|
import { UpgradeCommand } from './commands/UpgradeCommand.js';
|
|
61
|
-
import { WorkerCommands } from './commands/WorkerCommands.js';
|
|
62
61
|
import { ErrorHandler } from './ErrorHandler.js';
|
|
62
|
+
import { OptionalCliCommandRegistry } from './OptionalCliCommandRegistry.js';
|
|
63
63
|
import { VersionChecker } from './services/VersionChecker.js';
|
|
64
64
|
import { esmDirname } from '../common/index.js';
|
|
65
65
|
import { Logger } from '../config/logger.js';
|
|
66
66
|
import { ErrorFactory } from '../exceptions/ZintrustError.js';
|
|
67
67
|
import { readFileSync } from '../node-singletons/fs.js';
|
|
68
68
|
import { join } from '../node-singletons/path.js';
|
|
69
|
-
import { D1Migrator } from '../../packages/d1-migrator/src/index.js';
|
|
70
69
|
import { Command } from 'commander';
|
|
71
70
|
const __dirname = esmDirname(import.meta.url);
|
|
72
71
|
const isCommandProvider = (command) => {
|
|
@@ -106,7 +105,6 @@ const buildCommandRegistry = () => {
|
|
|
106
105
|
DbSeedCommand.create(),
|
|
107
106
|
D1LearnCommand.create(),
|
|
108
107
|
D1MigrateCommand.create(),
|
|
109
|
-
D1Migrator.MigrateToD1Command,
|
|
110
108
|
DebugCommand.create(),
|
|
111
109
|
SecretsCommand.create(),
|
|
112
110
|
ConfigCommand.create(),
|
|
@@ -136,13 +134,7 @@ const buildCommandRegistry = () => {
|
|
|
136
134
|
SqlServerProxyCommand.create(),
|
|
137
135
|
RedisProxyCommand.create(),
|
|
138
136
|
SmtpProxyCommand.create(),
|
|
139
|
-
|
|
140
|
-
WorkerCommands.createWorkerStatusCommand(),
|
|
141
|
-
WorkerCommands.createWorkerStartCommand(),
|
|
142
|
-
WorkerCommands.createWorkerStartAllCommand(),
|
|
143
|
-
WorkerCommands.createWorkerStopCommand(),
|
|
144
|
-
WorkerCommands.createWorkerRestartCommand(),
|
|
145
|
-
WorkerCommands.createWorkerSummaryCommand(),
|
|
137
|
+
...OptionalCliCommandRegistry.list(),
|
|
146
138
|
];
|
|
147
139
|
};
|
|
148
140
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
export type CliCommandProvider = {
|
|
3
|
+
getCommand: () => Command;
|
|
4
|
+
name?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const OptionalCliCommandRegistry: Readonly<{
|
|
7
|
+
register(id: string, provider: CliCommandProvider): void;
|
|
8
|
+
get(id: string): CliCommandProvider | undefined;
|
|
9
|
+
has(id: string): boolean;
|
|
10
|
+
list(): CliCommandProvider[];
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=OptionalCliCommandRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionalCliCommandRegistry.d.ts","sourceRoot":"","sources":["../../../src/cli/OptionalCliCommandRegistry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAiBF,eAAO,MAAM,0BAA0B;iBACxB,MAAM,YAAY,kBAAkB,GAAG,IAAI;YAMhD,MAAM,GAAG,kBAAkB,GAAG,SAAS;YAIvC,MAAM,GAAG,OAAO;YAIhB,kBAAkB,EAAE;EAG5B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isObject } from '../helper/index.js';
|
|
2
|
+
const globalWithRegistry = globalThis;
|
|
3
|
+
const registry = globalWithRegistry.__zintrust_cli_command_registry__ ??
|
|
4
|
+
(globalWithRegistry.__zintrust_cli_command_registry__ = new Map());
|
|
5
|
+
const isCliCommandProvider = (value) => {
|
|
6
|
+
return isObject(value) && typeof value['getCommand'] === 'function';
|
|
7
|
+
};
|
|
8
|
+
const normalizeId = (id) => id.trim();
|
|
9
|
+
export const OptionalCliCommandRegistry = Object.freeze({
|
|
10
|
+
register(id, provider) {
|
|
11
|
+
const normalizedId = normalizeId(id);
|
|
12
|
+
if (normalizedId === '' || !isCliCommandProvider(provider))
|
|
13
|
+
return;
|
|
14
|
+
registry.set(normalizedId, provider);
|
|
15
|
+
},
|
|
16
|
+
get(id) {
|
|
17
|
+
return registry.get(normalizeId(id));
|
|
18
|
+
},
|
|
19
|
+
has(id) {
|
|
20
|
+
return registry.has(normalizeId(id));
|
|
21
|
+
},
|
|
22
|
+
list() {
|
|
23
|
+
return Array.from(registry.values());
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type OptionalCliExtension = {
|
|
2
|
+
packageName: string;
|
|
3
|
+
specifier: string;
|
|
4
|
+
commands: string[];
|
|
5
|
+
installCommand: string;
|
|
6
|
+
localCandidates: string[];
|
|
7
|
+
};
|
|
8
|
+
type OptionalCliExtensionLoadSource = 'project' | 'package' | 'local-fallback' | 'missing';
|
|
9
|
+
export type OptionalCliExtensionStatus = Readonly<{
|
|
10
|
+
packageName: string;
|
|
11
|
+
commands: string[];
|
|
12
|
+
installCommand: string;
|
|
13
|
+
loaded: boolean;
|
|
14
|
+
source: OptionalCliExtensionLoadSource;
|
|
15
|
+
}>;
|
|
16
|
+
type OptionalCliExtensionLoadOptions = Readonly<{
|
|
17
|
+
logFailures?: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const OptionalCliExtensions: Readonly<{
|
|
20
|
+
tryImportInstalledExtensions(): Promise<OptionalCliExtensionStatus[]>;
|
|
21
|
+
loadForArgs(args: string[]): Promise<OptionalCliExtensionStatus[]>;
|
|
22
|
+
findMissingExtensionForArgs(args: string[], statuses: ReadonlyArray<OptionalCliExtensionStatus>): OptionalCliExtensionStatus | undefined;
|
|
23
|
+
getMissingExtensionMessage(status: OptionalCliExtensionStatus): string;
|
|
24
|
+
findRequestedExtension: (args: string[]) => OptionalCliExtension | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const OptionalCliExtensionsInternal: Readonly<{
|
|
27
|
+
getProjectCwd: () => string;
|
|
28
|
+
resolveProjectRoot: () => string;
|
|
29
|
+
resolveProjectInstalledUrl: (entry: OptionalCliExtension, options?: OptionalCliExtensionLoadOptions) => string | null;
|
|
30
|
+
shouldLogFailures: (options?: OptionalCliExtensionLoadOptions) => boolean;
|
|
31
|
+
debugFailure: (message: string, meta: Record<string, unknown>, options?: OptionalCliExtensionLoadOptions) => void;
|
|
32
|
+
tryImportProjectInstalledPackage: (entry: OptionalCliExtension, options?: OptionalCliExtensionLoadOptions) => Promise<boolean>;
|
|
33
|
+
tryImportLocalCandidate: (entry: OptionalCliExtension, options?: OptionalCliExtensionLoadOptions) => Promise<boolean>;
|
|
34
|
+
tryImportPackageSpecifier: (entry: OptionalCliExtension, options?: OptionalCliExtensionLoadOptions) => Promise<boolean>;
|
|
35
|
+
tryImportExtension: (entry: OptionalCliExtension, options?: OptionalCliExtensionLoadOptions) => Promise<OptionalCliExtensionStatus>;
|
|
36
|
+
getRequestedCommand: (args: string[]) => string | undefined;
|
|
37
|
+
findRequestedExtension: (args: string[]) => OptionalCliExtension | undefined;
|
|
38
|
+
isRootHelpRequest: (args: string[]) => boolean;
|
|
39
|
+
}>;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=OptionalCliExtensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OptionalCliExtensions.d.ts","sourceRoot":"","sources":["../../../src/cli/OptionalCliExtensions.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,oBAAoB,GAAG;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,KAAK,8BAA8B,GAAG,SAAS,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAAC;AAE3F,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,8BAA8B,CAAC;CACxC,CAAC,CAAC;AAEH,KAAK,+BAA+B,GAAG,QAAQ,CAAC;IAC9C,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC,CAAC;AAoPH,eAAO,MAAM,qBAAqB;oCACM,OAAO,CAAC,0BAA0B,EAAE,CAAC;sBAQnD,MAAM,EAAE,GAAG,OAAO,CAAC,0BAA0B,EAAE,CAAC;sCAmBhE,MAAM,EAAE,YACJ,aAAa,CAAC,0BAA0B,CAAC,GAClD,0BAA0B,GAAG,SAAS;uCASN,0BAA0B,GAAG,MAAM;mCArDlC,MAAM,EAAE,KAAG,oBAAoB,GAAG,SAAS;EA8D/E,CAAC;AAEH,eAAO,MAAM,6BAA6B;yBAjShB,MAAM;8BAQD,MAAM;wCAsD5B,oBAAoB,YACjB,+BAA+B,KACxC,MAAM,GAAG,IAAI;kCAlDqB,+BAA+B,KAAG,OAAO;4BAMnE,MAAM,QACT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YACnB,+BAA+B,KACxC,IAAI;8CA+DE,oBAAoB,YACjB,+BAA+B,KACxC,OAAO,CAAC,OAAO,CAAC;qCA0BV,oBAAoB,YACjB,+BAA+B,KACxC,OAAO,CAAC,OAAO,CAAC;uCAgCV,oBAAoB,YACjB,+BAA+B,KACxC,OAAO,CAAC,OAAO,CAAC;gCAuBV,oBAAoB,YACjB,+BAA+B,KACxC,OAAO,CAAC,0BAA0B,CAAC;gCAwCH,MAAM,EAAE,KAAG,MAAM,GAAG,SAAS;mCAU1B,MAAM,EAAE,KAAG,oBAAoB,GAAG,SAAS;8BAOhD,MAAM,EAAE,KAAG,OAAO;EAsEjD,CAAC"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { readEnvString } from '../common/ExternalServiceUtils.js';
|
|
2
|
+
import { esmDirname } from '../common/index.js';
|
|
3
|
+
import { Logger } from '../config/logger.js';
|
|
4
|
+
import { existsSync } from '../node-singletons/fs.js';
|
|
5
|
+
import { createRequire } from '../node-singletons/module.js';
|
|
6
|
+
import * as path from '../node-singletons/path.js';
|
|
7
|
+
import { pathToFileURL } from '../node-singletons/url.js';
|
|
8
|
+
const __dirname = esmDirname(import.meta.url);
|
|
9
|
+
const packageRoot = path.resolve(__dirname, '../..');
|
|
10
|
+
const getProjectCwd = () => {
|
|
11
|
+
if (typeof process !== 'undefined' && typeof process.cwd === 'function') {
|
|
12
|
+
return process.cwd();
|
|
13
|
+
}
|
|
14
|
+
return packageRoot;
|
|
15
|
+
};
|
|
16
|
+
const resolveProjectRoot = () => {
|
|
17
|
+
const configured = readEnvString('ZINTRUST_PROJECT_ROOT').trim();
|
|
18
|
+
if (configured !== '')
|
|
19
|
+
return configured;
|
|
20
|
+
return getProjectCwd();
|
|
21
|
+
};
|
|
22
|
+
const shouldLogFailures = (options) => {
|
|
23
|
+
if (options?.logFailures === true)
|
|
24
|
+
return true;
|
|
25
|
+
return readEnvString('ZINTRUST_DEBUG_OPTIONAL_CLI_EXTENSIONS').trim() === '1';
|
|
26
|
+
};
|
|
27
|
+
const debugFailure = (message, meta, options) => {
|
|
28
|
+
if (!shouldLogFailures(options))
|
|
29
|
+
return;
|
|
30
|
+
Logger.debug(message, meta);
|
|
31
|
+
};
|
|
32
|
+
const OPTIONAL_CLI_EXTENSIONS = Object.freeze([
|
|
33
|
+
{
|
|
34
|
+
packageName: '@zintrust/d1-migrator',
|
|
35
|
+
specifier: '@zintrust/d1-migrator/register',
|
|
36
|
+
commands: ['migrate-to-d1', 'd1:transfer'],
|
|
37
|
+
installCommand: 'npm install @zintrust/d1-migrator',
|
|
38
|
+
localCandidates: [
|
|
39
|
+
path.join(packageRoot, 'packages', 'd1-migrator', 'src', 'register.ts'),
|
|
40
|
+
path.join(packageRoot, 'packages', 'd1-migrator', 'src', 'register.js'),
|
|
41
|
+
path.join(packageRoot, 'dist', 'packages', 'd1-migrator', 'src', 'register.js'),
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
packageName: '@zintrust/workers',
|
|
46
|
+
specifier: '@zintrust/workers/register',
|
|
47
|
+
commands: [
|
|
48
|
+
'worker:list',
|
|
49
|
+
'worker:status',
|
|
50
|
+
'worker:start',
|
|
51
|
+
'worker:start-all',
|
|
52
|
+
'worker:stop',
|
|
53
|
+
'worker:restart',
|
|
54
|
+
'worker:summary',
|
|
55
|
+
],
|
|
56
|
+
installCommand: 'npm install @zintrust/workers',
|
|
57
|
+
localCandidates: [
|
|
58
|
+
path.join(packageRoot, 'packages', 'workers', 'src', 'register.ts'),
|
|
59
|
+
path.join(packageRoot, 'packages', 'workers', 'src', 'register.js'),
|
|
60
|
+
path.join(packageRoot, 'dist', 'packages', 'workers', 'src', 'register.js'),
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
]);
|
|
64
|
+
const resolveProjectInstalledUrl = (entry, options) => {
|
|
65
|
+
try {
|
|
66
|
+
const projectRoot = resolveProjectRoot();
|
|
67
|
+
const requireFromProject = createRequire(path.join(projectRoot, 'package.json'));
|
|
68
|
+
const resolved = requireFromProject.resolve(entry.specifier);
|
|
69
|
+
return pathToFileURL(resolved).href;
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
debugFailure('[cli] Optional CLI extension not resolved from project root', {
|
|
73
|
+
packageName: entry.packageName,
|
|
74
|
+
specifier: entry.specifier,
|
|
75
|
+
projectRoot: resolveProjectRoot(),
|
|
76
|
+
error: error instanceof Error ? error.message : String(error),
|
|
77
|
+
}, options);
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const tryImportProjectInstalledPackage = async (entry, options) => {
|
|
82
|
+
const resolvedUrl = resolveProjectInstalledUrl(entry, options);
|
|
83
|
+
if (resolvedUrl === null)
|
|
84
|
+
return false;
|
|
85
|
+
try {
|
|
86
|
+
await import(resolvedUrl);
|
|
87
|
+
Logger.debug('[cli] Loaded optional CLI extension from project install', {
|
|
88
|
+
packageName: entry.packageName,
|
|
89
|
+
resolvedUrl,
|
|
90
|
+
});
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
debugFailure('[cli] Optional CLI extension project import failed', {
|
|
95
|
+
packageName: entry.packageName,
|
|
96
|
+
resolvedUrl,
|
|
97
|
+
error: error instanceof Error ? error.message : String(error),
|
|
98
|
+
}, options);
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const tryImportLocalCandidate = async (entry, options) => {
|
|
103
|
+
const existingCandidates = entry.localCandidates.filter((candidate) => existsSync(candidate));
|
|
104
|
+
if (existingCandidates.length === 0)
|
|
105
|
+
return false;
|
|
106
|
+
const results = await Promise.all(existingCandidates.map(async (candidate) => {
|
|
107
|
+
try {
|
|
108
|
+
await import(pathToFileURL(candidate).href);
|
|
109
|
+
Logger.debug('[cli] Loaded optional CLI extension from local fallback', {
|
|
110
|
+
packageName: entry.packageName,
|
|
111
|
+
candidate,
|
|
112
|
+
});
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
debugFailure('[cli] Optional CLI extension local fallback failed', {
|
|
117
|
+
packageName: entry.packageName,
|
|
118
|
+
candidate,
|
|
119
|
+
error: error instanceof Error ? error.message : String(error),
|
|
120
|
+
}, options);
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
return results.some(Boolean);
|
|
125
|
+
};
|
|
126
|
+
const tryImportPackageSpecifier = async (entry, options) => {
|
|
127
|
+
try {
|
|
128
|
+
await import(entry.specifier);
|
|
129
|
+
Logger.debug('[cli] Loaded optional CLI extension package', {
|
|
130
|
+
packageName: entry.packageName,
|
|
131
|
+
specifier: entry.specifier,
|
|
132
|
+
});
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
debugFailure('[cli] Optional CLI extension package not loaded', {
|
|
137
|
+
packageName: entry.packageName,
|
|
138
|
+
specifier: entry.specifier,
|
|
139
|
+
error: error instanceof Error ? error.message : String(error),
|
|
140
|
+
}, options);
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
const tryImportExtension = async (entry, options) => {
|
|
145
|
+
if (await tryImportProjectInstalledPackage(entry, options)) {
|
|
146
|
+
return {
|
|
147
|
+
packageName: entry.packageName,
|
|
148
|
+
commands: [...entry.commands],
|
|
149
|
+
installCommand: entry.installCommand,
|
|
150
|
+
loaded: true,
|
|
151
|
+
source: 'project',
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (await tryImportPackageSpecifier(entry, options)) {
|
|
155
|
+
return {
|
|
156
|
+
packageName: entry.packageName,
|
|
157
|
+
commands: [...entry.commands],
|
|
158
|
+
installCommand: entry.installCommand,
|
|
159
|
+
loaded: true,
|
|
160
|
+
source: 'package',
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
if (await tryImportLocalCandidate(entry, options)) {
|
|
164
|
+
return {
|
|
165
|
+
packageName: entry.packageName,
|
|
166
|
+
commands: [...entry.commands],
|
|
167
|
+
installCommand: entry.installCommand,
|
|
168
|
+
loaded: true,
|
|
169
|
+
source: 'local-fallback',
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
packageName: entry.packageName,
|
|
174
|
+
commands: [...entry.commands],
|
|
175
|
+
installCommand: entry.installCommand,
|
|
176
|
+
loaded: false,
|
|
177
|
+
source: 'missing',
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
const getRequestedCommand = (args) => {
|
|
181
|
+
if (args.length === 0)
|
|
182
|
+
return undefined;
|
|
183
|
+
if (args[0] === 'help') {
|
|
184
|
+
return typeof args[1] === 'string' && args[1].trim() !== '' ? args[1].trim() : undefined;
|
|
185
|
+
}
|
|
186
|
+
return typeof args[0] === 'string' && args[0].trim() !== '' ? args[0].trim() : undefined;
|
|
187
|
+
};
|
|
188
|
+
const findRequestedExtension = (args) => {
|
|
189
|
+
const requestedCommand = getRequestedCommand(args);
|
|
190
|
+
if (requestedCommand === undefined)
|
|
191
|
+
return undefined;
|
|
192
|
+
return OPTIONAL_CLI_EXTENSIONS.find((entry) => entry.commands.includes(requestedCommand));
|
|
193
|
+
};
|
|
194
|
+
const isRootHelpRequest = (args) => {
|
|
195
|
+
if (args.length === 0)
|
|
196
|
+
return true;
|
|
197
|
+
const first = typeof args[0] === 'string' ? args[0].trim() : '';
|
|
198
|
+
if (first === '' || first === '-h' || first === '--help')
|
|
199
|
+
return true;
|
|
200
|
+
return first === 'help' && getRequestedCommand(args) === undefined;
|
|
201
|
+
};
|
|
202
|
+
export const OptionalCliExtensions = Object.freeze({
|
|
203
|
+
async tryImportInstalledExtensions() {
|
|
204
|
+
return Promise.all(OPTIONAL_CLI_EXTENSIONS.map(async (entry) => tryImportExtension(entry, { logFailures: false })));
|
|
205
|
+
},
|
|
206
|
+
async loadForArgs(args) {
|
|
207
|
+
const requestedExtension = findRequestedExtension(args);
|
|
208
|
+
if (requestedExtension !== undefined) {
|
|
209
|
+
return [await tryImportExtension(requestedExtension, { logFailures: false })];
|
|
210
|
+
}
|
|
211
|
+
if (isRootHelpRequest(args)) {
|
|
212
|
+
return Promise.all(OPTIONAL_CLI_EXTENSIONS.map(async (entry) => tryImportExtension(entry, { logFailures: false })));
|
|
213
|
+
}
|
|
214
|
+
return [];
|
|
215
|
+
},
|
|
216
|
+
findMissingExtensionForArgs(args, statuses) {
|
|
217
|
+
const requestedCommand = getRequestedCommand(args);
|
|
218
|
+
if (requestedCommand === undefined)
|
|
219
|
+
return undefined;
|
|
220
|
+
return statuses.find((status) => status.loaded !== true && status.commands.includes(requestedCommand));
|
|
221
|
+
},
|
|
222
|
+
getMissingExtensionMessage(status) {
|
|
223
|
+
const primaryCommand = status.commands[0] ?? status.packageName;
|
|
224
|
+
return [
|
|
225
|
+
`Command "${primaryCommand}" requires optional package "${status.packageName}".`,
|
|
226
|
+
`Install it and try again: ${status.installCommand}`,
|
|
227
|
+
].join(' ');
|
|
228
|
+
},
|
|
229
|
+
findRequestedExtension,
|
|
230
|
+
});
|
|
231
|
+
export const OptionalCliExtensionsInternal = Object.freeze({
|
|
232
|
+
getProjectCwd,
|
|
233
|
+
resolveProjectRoot,
|
|
234
|
+
resolveProjectInstalledUrl,
|
|
235
|
+
shouldLogFailures,
|
|
236
|
+
debugFailure,
|
|
237
|
+
tryImportProjectInstalledPackage,
|
|
238
|
+
tryImportLocalCandidate,
|
|
239
|
+
tryImportPackageSpecifier,
|
|
240
|
+
tryImportExtension,
|
|
241
|
+
getRequestedCommand,
|
|
242
|
+
findRequestedExtension,
|
|
243
|
+
isRootHelpRequest,
|
|
244
|
+
});
|
|
@@ -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;AAspBvF,eAAO,MAAM,YAAY;cACb,YAAY;EA6BtB,CAAC"}
|
|
@@ -79,6 +79,28 @@ const resolveRuntime = (options) => {
|
|
|
79
79
|
const raw = typeof options.runtime === 'string' ? options.runtime.trim() : '';
|
|
80
80
|
return raw === '' ? undefined : raw;
|
|
81
81
|
};
|
|
82
|
+
const resolveConfiguredRuntime = (options) => {
|
|
83
|
+
const cliRuntime = resolveRuntime(options);
|
|
84
|
+
if (cliRuntime !== undefined && cliRuntime !== 'auto')
|
|
85
|
+
return cliRuntime;
|
|
86
|
+
const envRuntime = readEnvString('RUNTIME').trim();
|
|
87
|
+
if (envRuntime === '' || envRuntime === 'auto')
|
|
88
|
+
return undefined;
|
|
89
|
+
return envRuntime;
|
|
90
|
+
};
|
|
91
|
+
const isCloudflareRuntimeRequest = (runtime) => {
|
|
92
|
+
if (typeof runtime !== 'string')
|
|
93
|
+
return false;
|
|
94
|
+
const normalized = runtime.trim().toLowerCase();
|
|
95
|
+
return normalized === 'cloudflare' || normalized === 'cloudflare-workers';
|
|
96
|
+
};
|
|
97
|
+
const assertCompatibleStartVariant = (variant, configuredRuntime) => {
|
|
98
|
+
if (variant !== 'node')
|
|
99
|
+
return;
|
|
100
|
+
if (!isCloudflareRuntimeRequest(configuredRuntime))
|
|
101
|
+
return;
|
|
102
|
+
throw ErrorFactory.createCliError('Error: Cloudflare runtime requires Wrangler dev mode. Run "zin start --wg" (or "zin s --wg") instead of plain "zin start".');
|
|
103
|
+
};
|
|
82
104
|
const resolveStartVariant = (options) => {
|
|
83
105
|
const wantWrangler = options.wrangler === true || options.wg === true;
|
|
84
106
|
const wantDeno = options.deno === true;
|
|
@@ -423,6 +445,7 @@ const executeStart = async (options, cmd) => {
|
|
|
423
445
|
const mode = resolveMode(options);
|
|
424
446
|
const port = resolvePort(options);
|
|
425
447
|
const runtime = resolveRuntime(options);
|
|
448
|
+
const configuredRuntime = resolveConfiguredRuntime(options);
|
|
426
449
|
const variant = resolveStartVariant(options);
|
|
427
450
|
const envName = typeof options.env === 'string' ? options.env.trim() : '';
|
|
428
451
|
let effectiveRuntime = runtime;
|
|
@@ -434,6 +457,7 @@ const executeStart = async (options, cmd) => {
|
|
|
434
457
|
await executeSplitStart(cmd, cwd, options);
|
|
435
458
|
return;
|
|
436
459
|
}
|
|
460
|
+
assertCompatibleStartVariant(variant, configuredRuntime);
|
|
437
461
|
const cacheEnabled = resolveCacheEnabledPreference(options);
|
|
438
462
|
EnvFileLoader.applyCliOverrides({
|
|
439
463
|
nodeEnv: mode,
|
package/src/cli/index.d.ts
CHANGED
|
@@ -16,4 +16,5 @@ export { PostgresProxyCommand } from './commands/PostgresProxyCommand';
|
|
|
16
16
|
export { ProxyCommand } from './commands/ProxyCommand';
|
|
17
17
|
export { RedisProxyCommand } from './commands/RedisProxyCommand';
|
|
18
18
|
export { SecretsCommand } from './commands/SecretsCommand';
|
|
19
|
+
export { WorkerCommands } from './commands/WorkerCommands';
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
package/src/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC"}
|
package/src/cli/index.js
CHANGED
|
@@ -17,3 +17,4 @@ export { PostgresProxyCommand } from './commands/PostgresProxyCommand.js';
|
|
|
17
17
|
export { ProxyCommand } from './commands/ProxyCommand.js';
|
|
18
18
|
export { RedisProxyCommand } from './commands/RedisProxyCommand.js';
|
|
19
19
|
export { SecretsCommand } from './commands/SecretsCommand.js';
|
|
20
|
+
export { WorkerCommands } from './commands/WorkerCommands.js';
|
|
@@ -67,8 +67,7 @@ export default zintrustAppEslintConfig({
|
|
|
67
67
|
const wrote = FileGenerator.writeFile(eslintConfigPath, content, { overwrite: false });
|
|
68
68
|
return wrote ? [eslintConfigPath] : [];
|
|
69
69
|
};
|
|
70
|
-
const IMPORT_BOUNDARIES_ARCH_TEST_CONTENT = `import
|
|
71
|
-
import * as path from 'node:path';
|
|
70
|
+
const IMPORT_BOUNDARIES_ARCH_TEST_CONTENT = `import { fs, path } from '@zintrust/core/node';
|
|
72
71
|
import * as ts from 'typescript';
|
|
73
72
|
import { describe, expect, it } from 'vitest';
|
|
74
73
|
|
|
@@ -84,6 +83,7 @@ type Violation = {
|
|
|
84
83
|
};
|
|
85
84
|
|
|
86
85
|
const repoRoot = process.cwd();
|
|
86
|
+
const fsPromises = fs.fsPromises;
|
|
87
87
|
|
|
88
88
|
const isTsFile = (filePath: string): boolean => {
|
|
89
89
|
if (!filePath.endsWith('.ts')) return false;
|
|
@@ -92,7 +92,7 @@ const isTsFile = (filePath: string): boolean => {
|
|
|
92
92
|
};
|
|
93
93
|
|
|
94
94
|
const walkTsFiles = async (dir: string): Promise<string[]> => {
|
|
95
|
-
const entries = await
|
|
95
|
+
const entries = await fsPromises.readdir(dir, { withFileTypes: true });
|
|
96
96
|
|
|
97
97
|
const files = entries
|
|
98
98
|
.filter((ent) => ent.isFile())
|
|
@@ -162,7 +162,7 @@ const findViolations = async (
|
|
|
162
162
|
): Promise<Violation[]> => {
|
|
163
163
|
const perFile = await Promise.all(
|
|
164
164
|
files.map(async (file): Promise<Violation[]> => {
|
|
165
|
-
const contents = await
|
|
165
|
+
const contents = await fsPromises.readFile(file, 'utf-8');
|
|
166
166
|
const imports = extractImportSpecifiers(contents, file);
|
|
167
167
|
|
|
168
168
|
return imports
|
package/src/cli.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { BaseCommand } from './cli/BaseCommand';
|
|
2
2
|
export type { CommandOptions } from './cli/BaseCommand';
|
|
3
3
|
export { CLI } from './cli/CLI';
|
|
4
|
-
export {
|
|
4
|
+
export { ErrorHandler, EXIT_CODES } from './cli/ErrorHandler';
|
|
5
|
+
export { WorkerCommands } from './cli/commands/WorkerCommands';
|
|
6
|
+
export { OptionalCliCommandRegistry } from './cli/OptionalCliCommandRegistry';
|
|
7
|
+
export type { CliCommandProvider } from './cli/OptionalCliCommandRegistry';
|
|
5
8
|
//# sourceMappingURL=cli.d.ts.map
|
package/src/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,YAAY,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/src/cli.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// CLI utilities (for build tools and scripting)
|
|
2
2
|
export { BaseCommand } from './cli/BaseCommand.js';
|
|
3
3
|
export { CLI } from './cli/CLI.js';
|
|
4
|
-
export {
|
|
4
|
+
export { ErrorHandler, EXIT_CODES } from './cli/ErrorHandler.js';
|
|
5
|
+
export { WorkerCommands } from './cli/commands/WorkerCommands.js';
|
|
6
|
+
export { OptionalCliCommandRegistry } from './cli/OptionalCliCommandRegistry.js';
|
package/src/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @zintrust/core v0.4.
|
|
2
|
+
* @zintrust/core v0.4.3
|
|
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-03-
|
|
8
|
+
* Built: 2026-03-20T12:13:34.410Z
|
|
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-03-
|
|
24
|
+
export const ZINTRUST_BUILD_DATE = '2026-03-20T12:13:34.378Z'; // 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';
|
package/src/node.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
export * as crypto from './node-singletons/crypto';
|
|
2
|
+
export * as fs from './node-singletons/fs';
|
|
3
|
+
export * as path from './node-singletons/path';
|
|
4
|
+
export { performance } from './node-singletons/perf-hooks';
|
|
1
5
|
export { default, default as process } from './node-singletons/process';
|
|
6
|
+
export * as url from './node-singletons/url';
|
|
2
7
|
export { cleanOnce, FileLogWriter } from './config/FileLogWriter';
|
|
3
8
|
export { listTemplates, loadTemplate, renderTemplate } from './tools/mail/templates';
|
|
4
9
|
export { MailFake } from './tools/mail/testing';
|
package/src/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,MAAM,MAAM,yBAAyB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,GAAG,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,WAAW,EACX,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,GACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,aAAa,IAAI,yBAAyB,EAC1C,YAAY,IAAI,wBAAwB,EACxC,cAAc,IAAI,0BAA0B,GAC7C,MAAM,kCAAkC,CAAC"}
|
package/src/node.js
CHANGED
|
@@ -4,7 +4,12 @@ const __coverageMarker = true;
|
|
|
4
4
|
if (__coverageMarker !== true) {
|
|
5
5
|
throw Logger.error('Unreachable');
|
|
6
6
|
}
|
|
7
|
+
export * as crypto from './node-singletons/crypto.js';
|
|
8
|
+
export * as fs from './node-singletons/fs.js';
|
|
9
|
+
export * as path from './node-singletons/path.js';
|
|
10
|
+
export { performance } from './node-singletons/perf-hooks.js';
|
|
7
11
|
export { default, default as process } from './node-singletons/process.js';
|
|
12
|
+
export * as url from './node-singletons/url.js';
|
|
8
13
|
export { cleanOnce, FileLogWriter } from './config/FileLogWriter.js';
|
|
9
14
|
export { listTemplates, loadTemplate, renderTemplate } from './tools/mail/templates/index.js';
|
|
10
15
|
export { MailFake } from './tools/mail/testing.js';
|
|
@@ -7,9 +7,7 @@
|
|
|
7
7
|
import { FeatureFlags } from '@zintrust/core';
|
|
8
8
|
import { Logger } from '@zintrust/core';
|
|
9
9
|
import { ErrorFactory } from '@zintrust/core';
|
|
10
|
-
import fs from 'node
|
|
11
|
-
import * as path from 'node:path';
|
|
12
|
-
import { performance } from 'node:perf_hooks';
|
|
10
|
+
import { fs, path, performance } from '@zintrust/core/node';
|
|
13
11
|
import { DatabaseConfig, IDatabaseAdapter, QueryResult } from '@zintrust/core';
|
|
14
12
|
import { QueryBuilder } from '@zintrust/core';
|
|
15
13
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SeederDiscovery } from '@zintrust/core/seeders';
|
|
2
2
|
import { SeederLoader } from '@zintrust/core/seeders';
|
|
3
3
|
import { CommonUtils } from '@zintrust/core/common';
|
|
4
|
-
import
|
|
4
|
+
import { path } from '@zintrust/core/node';
|
|
5
5
|
import type { IDatabase } from '@zintrust/core/orm';
|
|
6
6
|
|
|
7
7
|
export const DatabaseSeeder = Object.freeze({
|