cabloy 5.1.216 → 5.1.218
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/.cabloy-version +1 -1
- package/.github/workflows/create-cabloy.yml +137 -0
- package/.github/workflows/playwright-e2e.yml +163 -13
- package/.github/workflows/vona-test-sqlite3.yml +77 -7
- package/CHANGELOG.md +22 -0
- package/CONTRIBUTING.md +4 -2
- package/package.json +1 -1
- package/repo-docs/frontend/scripts.md +2 -0
- package/repo-docs/reference/repo-scripts.md +27 -1
- package/repo-e2e/scripts/e2e.test.ts +1 -1
- package/repo-e2e/scripts/managedTest.test.ts +115 -3
- package/repo-e2e/scripts/managedTest.ts +69 -20
- package/repo-e2e/scripts/managedTestImports.test.ts +55 -5
- package/repo-e2e/scripts/runE2e.test.ts +109 -0
- package/repo-e2e/scripts/runE2e.ts +58 -39
- package/repo-e2e/scripts/runE2eArgs.test.ts +16 -1
- package/repo-e2e/scripts/runE2eArgs.ts +5 -0
- package/repo-e2e/specs/a-commerce.spec.ts +10 -2
- package/repo-e2e/specs/home-user-account.spec.ts +4 -0
- package/repo-e2e/specs/markdown.spec.ts +14 -3
- package/scripts/generateOpenapiIsolated.test.ts +5 -1
- package/scripts/runIsolatedTest.test.ts +403 -36
- package/scripts/runIsolatedTest.ts +139 -12
- package/scripts/testBrowserGuardianWindows.test.ts +327 -0
- package/scripts/testClaimCleanup.test.ts +25 -9
- package/scripts/testClaimCleanup.ts +14 -45
- package/scripts/testClaimProcesses.test.ts +81 -2
- package/scripts/testClaimProcesses.ts +46 -10
- package/scripts/testProcessGuardianWindows.test.ts +602 -0
- package/scripts/testProcessGuardianWindows.ts +155 -0
- package/vona/packages-cli/cli/package.json +1 -1
- package/vona/packages-cli/cli-set-api/package.json +1 -1
- package/vona/packages-cli/cli-set-api/src/lib/bean/cli.bin.build.ts +4 -1
- package/vona/packages-cli/cli-set-api/test/binBuildEntries.test.ts +159 -0
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/packages-vona/vona-core/package.json +1 -1
- package/vona/packages-vona/vona-core/src/lib/core/testClaim.test.ts +298 -17
- package/vona/packages-vona/vona-core/src/lib/core/testClaim.ts +205 -97
- package/vona/packages-vona/vona-core/src/lib/core/testClaimFilesystem.test.ts +247 -0
- package/vona/packages-vona/vona-core/src/lib/core/testClaimFilesystem.ts +224 -0
- package/vona/packages-vona/vona-core/src/lib/core/testClaimFilesystemWindows.cs +229 -0
- package/vona/packages-vona/vona-core/src/lib/core/testClaimFilesystemWindows.ps1 +20 -0
- package/vona/packages-vona/vona-core/src/lib/core/testClaimFilesystemWindows.ts +200 -0
- package/vona/packages-vona/vona-core/src/lib/core/testProcessWindowsNative.cs +336 -0
- package/vona/packages-vona/vona-core/src/lib/core/testProcessWindowsNative.ps1 +20 -0
- package/vona/packages-vona/vona-core/src/lib/core/testProcessWindowsNative.ts +531 -0
- package/vona/packages-vona/vona-core/src/lib/framework/bootstrap.test.ts +61 -0
- package/vona/packages-vona/vona-core/src/lib/framework/index.ts +1 -0
- package/vona/packages-vona/vona-core/src/lib/framework/processWorker.test.ts +59 -0
- package/vona/packages-vona/vona-core/src/lib/framework/processWorker.ts +8 -5
- package/vona/packages-vona/vona-core/src/lib/framework/useApp.test.ts +84 -0
- package/vona/packages-vona/vona-core/src/lib/framework/useApp.ts +2 -2
- package/vona/packages-vona/vona-core/src/lib/utils/util.ts +1 -1
- package/vona/packages-vona/vona-mock/package.json +1 -1
- package/vona/pnpm-lock.yaml +42 -181
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-core/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-executor/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-executor/src/bean/bean.executor.ts +2 -1
- package/vona/src/suite-vendor/a-vona/modules/a-logger/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-logger/src/bean/middlewareSystem.httpLog.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-logger/src/lib/redactIsolatedReadyHeader.test.ts +16 -0
- package/vona/src/suite-vendor/a-vona/modules/a-logger/src/lib/redactIsolatedReadyHeader.ts +6 -3
- package/vona/src/suite-vendor/a-vona/modules/a-logger/test/middlewareSystem.httpLog.test.ts +80 -0
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/src/bean/middlewareSystem.health.ts +73 -2
- package/vona/src/suite-vendor/a-vona/modules/a-metrics/test/middlewareSystem.health.test.ts +309 -0
- package/vona/src/suite-vendor/a-vona/modules/a-orm/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-orm/src/service/transactionAsyncLocalStorage_.ts +3 -3
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-static/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-static/src/bean/middlewareSystem.static.ts +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-static/test/middlewareSystem.static.test.ts +101 -0
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/package.original.json +1 -1
- package/zova/packages-cli/cli/package.json +2 -2
- package/zova/packages-cli/cli-set-front/package.json +4 -4
- package/zova/packages-utils/zova-jsx/package.json +2 -2
- package/zova/packages-utils/zova-vite/package.json +2 -2
- package/zova/packages-utils/zova-vite/src/configUtils.ts +1 -1
- package/zova/packages-utils/zova-vite/test/configUtils.test.ts +55 -0
- package/zova/packages-zova/zova/package.json +3 -3
- package/zova/packages-zova/zova-core/package.json +2 -2
- package/zova/pnpm-lock.yaml +324 -63
- package/zova/src/suite/a-commerce/modules/commerce-trade/src/model/cart.ts +8 -4
- package/zova/src/suite/a-commerce/modules/commerce-trade/test/lib/cartModel.test.ts +71 -0
- package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
- package/zova/src/suite-vendor/a-zova/package.json +2 -2
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
|
|
3
|
+
import type { GuardianResult, OwnedProcess } from './runIsolatedTest.ts';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
hasTestClaimTransport,
|
|
7
|
+
registerTestClaimWindowsJobVerifier,
|
|
8
|
+
sendTestClaimEvent,
|
|
9
|
+
TEST_CLAIM_WINDOWS_GUARDIAN_ENV,
|
|
10
|
+
} from '../vona/packages-vona/vona-core/src/lib/core/testClaim.ts';
|
|
11
|
+
import {
|
|
12
|
+
createWindowsNativeJob,
|
|
13
|
+
inspectWindowsProcess,
|
|
14
|
+
} from '../vona/packages-vona/vona-core/src/lib/core/testProcessWindowsNative.ts';
|
|
15
|
+
|
|
16
|
+
/** Windows test containment. The external PS7 helper alone owns the native Job. */
|
|
17
|
+
export async function startWindowsOwnedProcess(
|
|
18
|
+
command: string,
|
|
19
|
+
args: string[],
|
|
20
|
+
cwd: string,
|
|
21
|
+
env: NodeJS.ProcessEnv,
|
|
22
|
+
nativeOutput?: Parameters<typeof createWindowsNativeJob>[1],
|
|
23
|
+
): Promise<OwnedProcess> {
|
|
24
|
+
if (process.platform !== 'win32')
|
|
25
|
+
throw new Error('Windows owned processes require native Windows and PowerShell 7 (pwsh)');
|
|
26
|
+
const registration = {
|
|
27
|
+
id: randomUUID(),
|
|
28
|
+
role: 'guardian',
|
|
29
|
+
stage: 'pending' as const,
|
|
30
|
+
containment: 'windows-job' as const,
|
|
31
|
+
jobId: randomUUID(),
|
|
32
|
+
};
|
|
33
|
+
// Write-ahead ACK must precede even spawning the native owner. Registration failures
|
|
34
|
+
// deliberately leave pending records; absence of a helper is not drainage evidence.
|
|
35
|
+
await sendTestClaimEvent(env, { type: 'process', process: registration });
|
|
36
|
+
const childEnv = { ...env };
|
|
37
|
+
for (const key of Object.keys(childEnv)) {
|
|
38
|
+
if (key.toUpperCase() === TEST_CLAIM_WINDOWS_GUARDIAN_ENV) delete childEnv[key];
|
|
39
|
+
}
|
|
40
|
+
childEnv[TEST_CLAIM_WINDOWS_GUARDIAN_ENV] = registration.id;
|
|
41
|
+
const native = await createWindowsNativeJob(
|
|
42
|
+
{
|
|
43
|
+
jobId: registration.jobId,
|
|
44
|
+
command,
|
|
45
|
+
args,
|
|
46
|
+
cwd,
|
|
47
|
+
env: childEnv,
|
|
48
|
+
},
|
|
49
|
+
nativeOutput,
|
|
50
|
+
);
|
|
51
|
+
let removeVerifier: (() => void) | undefined;
|
|
52
|
+
let stopping = false;
|
|
53
|
+
const interrupt = () => {
|
|
54
|
+
stopping = true;
|
|
55
|
+
native.stop();
|
|
56
|
+
};
|
|
57
|
+
process.on('SIGINT', interrupt);
|
|
58
|
+
process.on('SIGTERM', interrupt);
|
|
59
|
+
const deadline = setTimeout(interrupt, 30_000);
|
|
60
|
+
try {
|
|
61
|
+
const identity = await native.ready;
|
|
62
|
+
const inspected = await inspectWindowsProcess(identity.pid);
|
|
63
|
+
if (
|
|
64
|
+
!inspected ||
|
|
65
|
+
inspected.startTime !== identity.startTime ||
|
|
66
|
+
inspected.host !== identity.host
|
|
67
|
+
) {
|
|
68
|
+
throw new Error('Windows native helper identity changed before durable registration');
|
|
69
|
+
}
|
|
70
|
+
const registered = {
|
|
71
|
+
...registration,
|
|
72
|
+
stage: 'registered' as const,
|
|
73
|
+
pid: identity.pid,
|
|
74
|
+
startTime: identity.startTime,
|
|
75
|
+
host: identity.host,
|
|
76
|
+
};
|
|
77
|
+
await sendTestClaimEvent(env, { type: 'process', process: registered });
|
|
78
|
+
if (hasTestClaimTransport(env)) {
|
|
79
|
+
removeVerifier = await registerTestClaimWindowsJobVerifier(env, registered, async target => {
|
|
80
|
+
if (stopping || target.host !== identity.host) return false;
|
|
81
|
+
return await native.contains(target);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (stopping) throw new Error('Windows isolated process startup interrupted');
|
|
85
|
+
// Only a successful durable registered ACK can authorize native CreateProcessW.
|
|
86
|
+
native.authorize();
|
|
87
|
+
await native.started;
|
|
88
|
+
if (stopping) throw new Error('Windows isolated process startup interrupted');
|
|
89
|
+
const completed = native
|
|
90
|
+
.wait()
|
|
91
|
+
.then(async (result): Promise<GuardianResult> => {
|
|
92
|
+
// wait() already verified BOTH native active0/root-exit proof and successful
|
|
93
|
+
// helper process exit. Helper crashes never reach this claim transition.
|
|
94
|
+
await sendTestClaimEvent(env, {
|
|
95
|
+
type: 'process',
|
|
96
|
+
process: {
|
|
97
|
+
...registration,
|
|
98
|
+
stage: 'drained',
|
|
99
|
+
pid: identity.pid,
|
|
100
|
+
startTime: identity.startTime,
|
|
101
|
+
host: identity.host,
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
return { ...result, failed: result.failed || stopping };
|
|
105
|
+
})
|
|
106
|
+
.finally(() => removeVerifier?.());
|
|
107
|
+
void completed.catch(() => {});
|
|
108
|
+
return {
|
|
109
|
+
wait: () => completed,
|
|
110
|
+
stop: async () => {
|
|
111
|
+
stopping = true;
|
|
112
|
+
native.stop();
|
|
113
|
+
const timeout = new Promise<never>((_, reject) => {
|
|
114
|
+
const timer = setTimeout(
|
|
115
|
+
() => reject(new Error('Windows isolated Job did not prove shutdown in time')),
|
|
116
|
+
25_000,
|
|
117
|
+
);
|
|
118
|
+
timer.unref();
|
|
119
|
+
void completed.finally(() => clearTimeout(timer)).catch(() => {});
|
|
120
|
+
});
|
|
121
|
+
const result = await Promise.race([completed, timeout]);
|
|
122
|
+
return { ...result, failed: true };
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
} catch (error) {
|
|
126
|
+
removeVerifier?.();
|
|
127
|
+
native.stop();
|
|
128
|
+
try {
|
|
129
|
+
await Promise.race([
|
|
130
|
+
native.wait(),
|
|
131
|
+
new Promise<never>((_, reject) => {
|
|
132
|
+
const timer = setTimeout(
|
|
133
|
+
() => reject(new Error('Windows isolated helper did not finish after startup failure')),
|
|
134
|
+
25_000,
|
|
135
|
+
);
|
|
136
|
+
timer.unref();
|
|
137
|
+
void native
|
|
138
|
+
.wait()
|
|
139
|
+
.finally(() => clearTimeout(timer))
|
|
140
|
+
.catch(() => {});
|
|
141
|
+
}),
|
|
142
|
+
]);
|
|
143
|
+
} catch (shutdownError) {
|
|
144
|
+
throw new AggregateError(
|
|
145
|
+
[error, shutdownError],
|
|
146
|
+
'Windows isolated process startup failed; claim retained',
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
throw error;
|
|
150
|
+
} finally {
|
|
151
|
+
clearTimeout(deadline);
|
|
152
|
+
process.off('SIGINT', interrupt);
|
|
153
|
+
process.off('SIGTERM', interrupt);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -298,7 +298,10 @@ export class CliBinBuild extends BeanCliBase {
|
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
300
|
const inputOptions: RollupOptions = {
|
|
301
|
-
input:
|
|
301
|
+
input: {
|
|
302
|
+
bootstrap: path.join(projectPath, '.vona/bootstrap.ts'),
|
|
303
|
+
app: path.join(projectPath, '.vona/app.ts'),
|
|
304
|
+
},
|
|
302
305
|
plugins,
|
|
303
306
|
external: Object.keys(externals),
|
|
304
307
|
onLog: (level: LogLevel, log: RollupLog, defaultHandler: LogOrStringHandler) => {
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import compileTemplate from 'lodash/template.js';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { tmpdir } from 'node:os';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { test } from 'node:test';
|
|
8
|
+
|
|
9
|
+
const buildUrl = new URL('../src/lib/bean/cli.bin.build.ts', import.meta.url).href;
|
|
10
|
+
const rollupUrl = import.meta.resolve('rollup');
|
|
11
|
+
|
|
12
|
+
// Exercise the real _rollup and Rollup writer, isolating CLI setup and heavyweight plugins.
|
|
13
|
+
// Template collaborators are virtual modules: no application, environment files, or listeners.
|
|
14
|
+
const source = `
|
|
15
|
+
import assert from 'node:assert/strict';
|
|
16
|
+
import { realpathSync } from 'node:fs';
|
|
17
|
+
import { registerHooks } from 'node:module';
|
|
18
|
+
import { join } from 'node:path';
|
|
19
|
+
import { pathToFileURL } from 'node:url';
|
|
20
|
+
import { rollup as realRollup } from ${JSON.stringify(rollupUrl)};
|
|
21
|
+
const buildUrl = ${JSON.stringify(buildUrl)};
|
|
22
|
+
const projectPath = realpathSync(process.argv[1]);
|
|
23
|
+
const outDir = join(projectPath, 'dist/normal');
|
|
24
|
+
const modules = {
|
|
25
|
+
'./env.ts': 'export default { fixture: "env" };',
|
|
26
|
+
'./modules-meta.ts': 'export default { fixture: "modulesMeta" };',
|
|
27
|
+
'./config.ts': 'export default { fixture: "config" };',
|
|
28
|
+
'../src/backend/config/locales.ts': 'export default { en: { fixture: "locale" } };',
|
|
29
|
+
'../src/backend/config/monkey.ts': 'export class AppMonkey {}',
|
|
30
|
+
};
|
|
31
|
+
globalThis.fixturePlugin = {
|
|
32
|
+
name: 'fixture-collaborators',
|
|
33
|
+
resolveId(id) {
|
|
34
|
+
if (Object.hasOwn(modules, id)) return '\\0fixture:' + id;
|
|
35
|
+
},
|
|
36
|
+
load(id) {
|
|
37
|
+
if (id.startsWith('\\0fixture:')) return modules[id.slice('\\0fixture:'.length)];
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
let builds = 0;
|
|
41
|
+
globalThis.rollupMock = async options => {
|
|
42
|
+
builds++;
|
|
43
|
+
assert.deepEqual(options.input, {
|
|
44
|
+
bootstrap: join(projectPath, '.vona/bootstrap.ts'),
|
|
45
|
+
app: join(projectPath, '.vona/app.ts'),
|
|
46
|
+
});
|
|
47
|
+
return realRollup(options);
|
|
48
|
+
};
|
|
49
|
+
const mocks = {
|
|
50
|
+
'@cabloy/cli': 'export class BeanCliBase {}',
|
|
51
|
+
'rollup': 'export const rollup = globalThis.rollupMock;',
|
|
52
|
+
'@rollup/plugin-node-resolve': 'export default () => globalThis.fixturePlugin;',
|
|
53
|
+
'../utils.ts':
|
|
54
|
+
'export function generateConfigDefine() { return {}; }' +
|
|
55
|
+
'export function getAbsolutePathOfModule(id) { return id; }' +
|
|
56
|
+
'export function getOutDir() { throw new Error("Unexpected output lookup"); }' +
|
|
57
|
+
'export function getOutReleasesDir() { throw new Error("Unexpected release lookup"); }',
|
|
58
|
+
'./toolsBin/generateVonaMeta.ts':
|
|
59
|
+
'export function generateVonaMeta() { throw new Error("Unexpected app generation"); }',
|
|
60
|
+
};
|
|
61
|
+
const calls = globalThis.calls = [];
|
|
62
|
+
const createdApp = globalThis.createdApp = { fixture: 'createdApp' };
|
|
63
|
+
const bootstrapResult = globalThis.bootstrapResult = Promise.resolve({ fixture: 'bootstrap' });
|
|
64
|
+
registerHooks({
|
|
65
|
+
resolve(specifier, context, nextResolve) {
|
|
66
|
+
let mock;
|
|
67
|
+
if (context.parentURL === buildUrl) {
|
|
68
|
+
mock = mocks[specifier];
|
|
69
|
+
if (!mock && specifier.startsWith('@rollup/plugin-')) {
|
|
70
|
+
mock = 'export default () => ({ name: "fixture-noop" });';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (specifier === 'vona' && context.parentURL?.startsWith(pathToFileURL(outDir + '/').href)) {
|
|
74
|
+
mock =
|
|
75
|
+
'export async function createApp(options) {' +
|
|
76
|
+
' globalThis.calls.push(["createApp", options]); return globalThis.createdApp;' +
|
|
77
|
+
'}' +
|
|
78
|
+
'export function bootstrap(options) {' +
|
|
79
|
+
' globalThis.calls.push(["bootstrap", options]); return globalThis.bootstrapResult;' +
|
|
80
|
+
'}';
|
|
81
|
+
}
|
|
82
|
+
if (mock) return { url: 'data:text/javascript,' + encodeURIComponent(mock), shortCircuit: true };
|
|
83
|
+
return nextResolve(specifier, context);
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
const { CliBinBuild } = await import(buildUrl);
|
|
87
|
+
const cli = Object.create(CliBinBuild.prototype);
|
|
88
|
+
await cli._rollup(projectPath, {}, {
|
|
89
|
+
modules: {
|
|
90
|
+
fixture: {
|
|
91
|
+
package: {
|
|
92
|
+
dependencies: { vona: '0.0.0-fixture' },
|
|
93
|
+
vonaModule: { bundle: { externals: ['vona'] } },
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
}, outDir);
|
|
98
|
+
assert.equal(builds, 1, 'must run the real _rollup input configuration');
|
|
99
|
+
assert.deepEqual(calls, [], 'building must not execute either entry');
|
|
100
|
+
|
|
101
|
+
const app = await import(pathToFileURL(join(outDir, 'app.js')).href);
|
|
102
|
+
assert.equal(typeof app.createSingleApp, 'function');
|
|
103
|
+
assert.deepEqual(calls, [], 'importing app.js must neither create nor bootstrap an app');
|
|
104
|
+
assert.equal(await app.createSingleApp(), createdApp);
|
|
105
|
+
assert.equal(calls.length, 1);
|
|
106
|
+
assert.equal(calls[0][0], 'createApp');
|
|
107
|
+
const options = calls[0][1];
|
|
108
|
+
assert.deepEqual(Object.keys(options).sort(), ['AppMonkey', 'config', 'env', 'locales', 'modulesMeta']);
|
|
109
|
+
assert.deepEqual(options.env, { fixture: 'env' });
|
|
110
|
+
assert.equal(options.AppMonkey.name, 'AppMonkey');
|
|
111
|
+
assert.deepEqual((await options.modulesMeta()).default, { fixture: 'modulesMeta' });
|
|
112
|
+
assert.deepEqual((await options.config()).default, { fixture: 'config' });
|
|
113
|
+
assert.deepEqual((await options.locales()).default, { en: { fixture: 'locale' } });
|
|
114
|
+
|
|
115
|
+
const bootstrap = await import(pathToFileURL(join(outDir, 'bootstrap.js')).href);
|
|
116
|
+
assert.equal(calls.length, 2, 'importing bootstrap.js must eagerly bootstrap once');
|
|
117
|
+
assert.equal(calls[1][0], 'bootstrap');
|
|
118
|
+
assert.equal(bootstrap.appBootstrap, bootstrapResult);
|
|
119
|
+
const bootstrapOptions = calls[1][1];
|
|
120
|
+
assert.deepEqual(Object.keys(bootstrapOptions).sort(), Object.keys(options).sort());
|
|
121
|
+
assert.equal(bootstrapOptions.env, options.env);
|
|
122
|
+
assert.equal(bootstrapOptions.AppMonkey, options.AppMonkey);
|
|
123
|
+
for (const key of ['modulesMeta', 'config', 'locales']) {
|
|
124
|
+
assert.equal(await bootstrapOptions[key](), await options[key](), key + ' must load the same module');
|
|
125
|
+
}
|
|
126
|
+
`;
|
|
127
|
+
|
|
128
|
+
test('production build emits a lazy app factory alongside the eager bootstrap entry', () => {
|
|
129
|
+
const projectPath = mkdtempSync(join(tmpdir(), 'vona-bin-build-entries-'));
|
|
130
|
+
try {
|
|
131
|
+
mkdirSync(join(projectPath, '.vona'));
|
|
132
|
+
writeFileSync(join(projectPath, 'package.json'), JSON.stringify({ type: 'module' }));
|
|
133
|
+
for (const entry of ['app', 'bootstrap']) {
|
|
134
|
+
const template = readFileSync(
|
|
135
|
+
new URL(`../templates/app/${entry}.ejs`, import.meta.url),
|
|
136
|
+
'utf8',
|
|
137
|
+
);
|
|
138
|
+
writeFileSync(
|
|
139
|
+
join(projectPath, '.vona', `${entry}.ts`),
|
|
140
|
+
compileTemplate(template)({ appMonkey: true }),
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
const result = spawnSync(
|
|
144
|
+
process.execPath,
|
|
145
|
+
['--input-type=module', '--eval', source, projectPath],
|
|
146
|
+
{
|
|
147
|
+
cwd: projectPath,
|
|
148
|
+
encoding: 'utf8',
|
|
149
|
+
timeout: 15_000,
|
|
150
|
+
env: { ...process.env, BUILD_MINIFY: 'false', BUILD_SOURCEMAP: 'false' },
|
|
151
|
+
},
|
|
152
|
+
);
|
|
153
|
+
assert.ifError(result.error);
|
|
154
|
+
assert.equal(result.signal, null, result.stderr);
|
|
155
|
+
assert.equal(result.status, 0, result.stderr);
|
|
156
|
+
} finally {
|
|
157
|
+
rmSync(projectPath, { recursive: true, force: true });
|
|
158
|
+
}
|
|
159
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.110",
|
|
4
4
|
"gitHead": "a79189b882c17af5911573896a781bbb0046d37d",
|
|
5
5
|
"description": "Vona is an intuitive, elegant and powerful Node.js framework for rapidly developing enterprise applications of any size",
|
|
6
6
|
"keywords": [
|