elit 3.6.4 → 3.6.6
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/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/README.md +14 -1
- package/dist/build.d.ts +4 -1
- package/dist/cli.cjs +746 -166
- package/dist/cli.mjs +746 -166
- package/dist/config.d.ts +8 -1
- package/dist/coverage.d.ts +4 -1
- package/dist/desktop-auto-render.cjs +5 -4
- package/dist/desktop-auto-render.d.ts +4 -1
- package/dist/desktop-auto-render.js +5 -4
- package/dist/desktop-auto-render.mjs +5 -4
- package/dist/dom.cjs +5 -4
- package/dist/dom.d.ts +2 -0
- package/dist/dom.js +5 -4
- package/dist/dom.mjs +5 -4
- package/dist/el.d.ts +2 -0
- package/dist/index.cjs +5 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -4
- package/dist/index.mjs +5 -4
- package/dist/native.cjs +5 -4
- package/dist/native.d.ts +2 -0
- package/dist/native.js +5 -4
- package/dist/native.mjs +5 -4
- package/dist/render-context.d.ts +4 -1
- package/dist/router.cjs +5 -4
- package/dist/router.d.ts +2 -0
- package/dist/router.js +5 -4
- package/dist/router.mjs +5 -4
- package/dist/{server-CcBFc2F5.d.ts → server-uMQvZAll.d.ts} +9 -0
- package/dist/server.cjs +146 -4
- package/dist/server.d.ts +4 -1
- package/dist/server.js +4494 -285
- package/dist/server.mjs +146 -4
- package/dist/smtp-server.cjs +115 -0
- package/dist/smtp-server.d.ts +41 -0
- package/dist/smtp-server.js +4186 -0
- package/dist/smtp-server.mjs +87 -0
- package/dist/state.cjs +5 -4
- package/dist/state.d.ts +2 -0
- package/dist/state.js +5 -4
- package/dist/state.mjs +5 -4
- package/dist/test-runtime.cjs +184 -141
- package/dist/test-runtime.js +193 -150
- package/dist/test-runtime.mjs +184 -141
- package/dist/test.cjs +143 -134
- package/dist/test.js +152 -143
- package/dist/test.mjs +143 -134
- package/dist/types.d.ts +34 -2
- package/dist/universal.d.ts +2 -0
- package/package.json +9 -1
package/dist/test.mjs
CHANGED
|
@@ -3269,9 +3269,124 @@ var testPattern = void 0;
|
|
|
3269
3269
|
var currentTestFile = void 0;
|
|
3270
3270
|
var currentSourceMapConsumer = void 0;
|
|
3271
3271
|
var wrapperLineOffset = 0;
|
|
3272
|
+
var TEST_MODULE_EXTENSIONS = [".ts", ".tsx", ".mts", ".cts", ".js", ".jsx", ".mjs", ".cjs", ".json"];
|
|
3273
|
+
function resolveTestLoader(filePath) {
|
|
3274
|
+
return /\.(?:ts|tsx|mts|cts)$/i.test(filePath) ? "ts" : "js";
|
|
3275
|
+
}
|
|
3276
|
+
function createTestTransformOptions(filePath, format, sourcemap) {
|
|
3277
|
+
return {
|
|
3278
|
+
loader: resolveTestLoader(filePath),
|
|
3279
|
+
format,
|
|
3280
|
+
sourcemap,
|
|
3281
|
+
sourcefile: filePath,
|
|
3282
|
+
target: "es2020",
|
|
3283
|
+
tsconfigRaw: {
|
|
3284
|
+
compilerOptions: {
|
|
3285
|
+
jsx: "react",
|
|
3286
|
+
jsxFactory: "h",
|
|
3287
|
+
jsxFragmentFactory: "Fragment"
|
|
3288
|
+
}
|
|
3289
|
+
}
|
|
3290
|
+
};
|
|
3291
|
+
}
|
|
3292
|
+
function resolveExistingTestModulePath(basePath) {
|
|
3293
|
+
const nodePath = __require("path");
|
|
3294
|
+
if (existsSync(basePath) && statSync(basePath).isFile()) {
|
|
3295
|
+
return basePath;
|
|
3296
|
+
}
|
|
3297
|
+
for (const extension of TEST_MODULE_EXTENSIONS) {
|
|
3298
|
+
const candidatePath = `${basePath}${extension}`;
|
|
3299
|
+
if (existsSync(candidatePath) && statSync(candidatePath).isFile()) {
|
|
3300
|
+
return candidatePath;
|
|
3301
|
+
}
|
|
3302
|
+
}
|
|
3303
|
+
if (existsSync(basePath) && statSync(basePath).isDirectory()) {
|
|
3304
|
+
const packageJsonPath = nodePath.join(basePath, "package.json");
|
|
3305
|
+
if (existsSync(packageJsonPath) && statSync(packageJsonPath).isFile()) {
|
|
3306
|
+
try {
|
|
3307
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
3308
|
+
for (const candidateEntry of [packageJson.main, packageJson.module]) {
|
|
3309
|
+
if (typeof candidateEntry !== "string" || candidateEntry.trim().length === 0) {
|
|
3310
|
+
continue;
|
|
3311
|
+
}
|
|
3312
|
+
try {
|
|
3313
|
+
return resolveExistingTestModulePath(nodePath.resolve(basePath, candidateEntry));
|
|
3314
|
+
} catch {
|
|
3315
|
+
continue;
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
} catch {
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
for (const extension of TEST_MODULE_EXTENSIONS) {
|
|
3322
|
+
const candidatePath = nodePath.join(basePath, `index${extension}`);
|
|
3323
|
+
if (existsSync(candidatePath) && statSync(candidatePath).isFile()) {
|
|
3324
|
+
return candidatePath;
|
|
3325
|
+
}
|
|
3326
|
+
}
|
|
3327
|
+
}
|
|
3328
|
+
return basePath;
|
|
3329
|
+
}
|
|
3330
|
+
function resolveTestModulePath(fromFilePath, specifier) {
|
|
3331
|
+
if (!specifier.startsWith(".") && !specifier.startsWith("/")) {
|
|
3332
|
+
return specifier;
|
|
3333
|
+
}
|
|
3334
|
+
const nodePath = __require("path");
|
|
3335
|
+
const basePath = specifier.startsWith(".") ? nodePath.resolve(dirname(fromFilePath), specifier) : specifier;
|
|
3336
|
+
return resolveExistingTestModulePath(basePath);
|
|
3337
|
+
}
|
|
3338
|
+
function shouldTranspileTestModule(filePath) {
|
|
3339
|
+
return /\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs)$/i.test(filePath);
|
|
3340
|
+
}
|
|
3341
|
+
function createTestModuleRequire(fromFilePath, moduleCache) {
|
|
3342
|
+
return (specifier) => {
|
|
3343
|
+
if (specifier.startsWith("elit/") || specifier === "elit") {
|
|
3344
|
+
return __require(specifier);
|
|
3345
|
+
}
|
|
3346
|
+
const resolvedPath = resolveTestModulePath(fromFilePath, specifier);
|
|
3347
|
+
if (resolvedPath === specifier) {
|
|
3348
|
+
return __require(specifier);
|
|
3349
|
+
}
|
|
3350
|
+
if (!existsSync(resolvedPath) || !statSync(resolvedPath).isFile()) {
|
|
3351
|
+
return __require(resolvedPath);
|
|
3352
|
+
}
|
|
3353
|
+
if (!shouldTranspileTestModule(resolvedPath)) {
|
|
3354
|
+
return __require(resolvedPath);
|
|
3355
|
+
}
|
|
3356
|
+
return loadTranspiledTestModule(resolvedPath, moduleCache);
|
|
3357
|
+
};
|
|
3358
|
+
}
|
|
3359
|
+
function loadTranspiledTestModule(modulePath, moduleCache) {
|
|
3360
|
+
const cached = moduleCache.get(modulePath);
|
|
3361
|
+
if (cached) {
|
|
3362
|
+
return cached.exports;
|
|
3363
|
+
}
|
|
3364
|
+
const source = readFileSync(modulePath, "utf-8");
|
|
3365
|
+
let transpiled;
|
|
3366
|
+
try {
|
|
3367
|
+
transpiled = transformSync(source, createTestTransformOptions(modulePath, "cjs", false));
|
|
3368
|
+
} catch (error) {
|
|
3369
|
+
throw new Error(`Failed to transpile test dependency ${modulePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
3370
|
+
}
|
|
3371
|
+
const moduleRecord = { exports: {} };
|
|
3372
|
+
const moduleObj = { exports: moduleRecord.exports };
|
|
3373
|
+
moduleCache.set(modulePath, moduleRecord);
|
|
3374
|
+
try {
|
|
3375
|
+
const fn = new Function("module", "exports", "require", "__filename", "__dirname", transpiled.code);
|
|
3376
|
+
const requireFn = createTestModuleRequire(modulePath, moduleCache);
|
|
3377
|
+
fn(moduleObj, moduleObj.exports, requireFn, modulePath, dirname(modulePath));
|
|
3378
|
+
} catch (error) {
|
|
3379
|
+
throw new Error(`Failed to execute test dependency ${modulePath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
3380
|
+
}
|
|
3381
|
+
moduleRecord.exports = moduleObj.exports;
|
|
3382
|
+
if (!modulePath.includes(".test.") && !modulePath.includes(".spec.")) {
|
|
3383
|
+
coveredFiles.add(modulePath);
|
|
3384
|
+
}
|
|
3385
|
+
return moduleRecord.exports;
|
|
3386
|
+
}
|
|
3272
3387
|
function createTestFunction(defaultTimeout = 5e3) {
|
|
3273
3388
|
const testFn = function(name, fn, timeout) {
|
|
3274
|
-
const
|
|
3389
|
+
const test = {
|
|
3275
3390
|
name,
|
|
3276
3391
|
fn,
|
|
3277
3392
|
skip: currentSuite.skip,
|
|
@@ -3280,10 +3395,10 @@ function createTestFunction(defaultTimeout = 5e3) {
|
|
|
3280
3395
|
timeout: timeout ?? defaultTimeout,
|
|
3281
3396
|
suite: currentSuite
|
|
3282
3397
|
};
|
|
3283
|
-
currentSuite.tests.push(
|
|
3398
|
+
currentSuite.tests.push(test);
|
|
3284
3399
|
};
|
|
3285
3400
|
testFn.skip = (name, fn, timeout) => {
|
|
3286
|
-
const
|
|
3401
|
+
const test = {
|
|
3287
3402
|
name,
|
|
3288
3403
|
fn,
|
|
3289
3404
|
skip: true,
|
|
@@ -3292,11 +3407,11 @@ function createTestFunction(defaultTimeout = 5e3) {
|
|
|
3292
3407
|
timeout: timeout ?? defaultTimeout,
|
|
3293
3408
|
suite: currentSuite
|
|
3294
3409
|
};
|
|
3295
|
-
currentSuite.tests.push(
|
|
3410
|
+
currentSuite.tests.push(test);
|
|
3296
3411
|
};
|
|
3297
3412
|
testFn.only = (name, fn, timeout) => {
|
|
3298
3413
|
hasOnly = true;
|
|
3299
|
-
const
|
|
3414
|
+
const test = {
|
|
3300
3415
|
name,
|
|
3301
3416
|
fn,
|
|
3302
3417
|
skip: false,
|
|
@@ -3305,10 +3420,10 @@ function createTestFunction(defaultTimeout = 5e3) {
|
|
|
3305
3420
|
timeout: timeout ?? defaultTimeout,
|
|
3306
3421
|
suite: currentSuite
|
|
3307
3422
|
};
|
|
3308
|
-
currentSuite.tests.push(
|
|
3423
|
+
currentSuite.tests.push(test);
|
|
3309
3424
|
};
|
|
3310
3425
|
testFn.todo = (name, fn, timeout) => {
|
|
3311
|
-
const
|
|
3426
|
+
const test = {
|
|
3312
3427
|
name,
|
|
3313
3428
|
fn,
|
|
3314
3429
|
skip: false,
|
|
@@ -3317,7 +3432,7 @@ function createTestFunction(defaultTimeout = 5e3) {
|
|
|
3317
3432
|
timeout: timeout ?? defaultTimeout,
|
|
3318
3433
|
suite: currentSuite
|
|
3319
3434
|
};
|
|
3320
|
-
currentSuite.tests.push(
|
|
3435
|
+
currentSuite.tests.push(test);
|
|
3321
3436
|
};
|
|
3322
3437
|
return testFn;
|
|
3323
3438
|
}
|
|
@@ -3883,29 +3998,7 @@ async function runTests(options) {
|
|
|
3883
3998
|
try {
|
|
3884
3999
|
const source = await readFile(file, "utf-8");
|
|
3885
4000
|
const testFileDir = dirname(file);
|
|
3886
|
-
const
|
|
3887
|
-
const imports = {};
|
|
3888
|
-
let importIndex = 0;
|
|
3889
|
-
let codeWithoutImports = source.replace(importRegex, (_, named, path) => {
|
|
3890
|
-
const varName = `__import_${importIndex++}`;
|
|
3891
|
-
const trimmedNamed = named.trim();
|
|
3892
|
-
imports[varName] = { path, named: trimmedNamed };
|
|
3893
|
-
return `// ${trimmedNamed} import injected later
|
|
3894
|
-
`;
|
|
3895
|
-
});
|
|
3896
|
-
const result = transformSync(codeWithoutImports, {
|
|
3897
|
-
loader: file.endsWith(".ts") || file.endsWith(".tsx") ? "ts" : "js",
|
|
3898
|
-
format: "iife",
|
|
3899
|
-
sourcemap: "inline",
|
|
3900
|
-
target: "es2020",
|
|
3901
|
-
tsconfigRaw: {
|
|
3902
|
-
compilerOptions: {
|
|
3903
|
-
jsx: "react",
|
|
3904
|
-
jsxFactory: "h",
|
|
3905
|
-
jsxFragmentFactory: "Fragment"
|
|
3906
|
-
}
|
|
3907
|
-
}
|
|
3908
|
-
});
|
|
4001
|
+
const result = transformSync(source, createTestTransformOptions(file, "cjs", "inline"));
|
|
3909
4002
|
let code = result.code;
|
|
3910
4003
|
const sourceMapMatch = code.match(/\/\/# sourceMappingURL=data:application\/json;base64,(.+)/);
|
|
3911
4004
|
if (sourceMapMatch) {
|
|
@@ -3916,99 +4009,15 @@ async function runTests(options) {
|
|
|
3916
4009
|
} else {
|
|
3917
4010
|
currentSourceMapConsumer = void 0;
|
|
3918
4011
|
}
|
|
3919
|
-
|
|
3920
|
-
const importParamNames = [];
|
|
3921
|
-
const importAssignments = [];
|
|
3922
|
-
if (Object.keys(imports).length > 0) {
|
|
3923
|
-
for (const [, { path, named }] of Object.entries(imports)) {
|
|
3924
|
-
let resolvedPath = path;
|
|
3925
|
-
if (path.startsWith(".")) {
|
|
3926
|
-
const nodePath = __require("path");
|
|
3927
|
-
resolvedPath = nodePath.resolve(testFileDir, path);
|
|
3928
|
-
}
|
|
3929
|
-
if (!resolvedPath.endsWith(".ts") && !resolvedPath.endsWith(".js") && !resolvedPath.endsWith(".mjs") && !resolvedPath.endsWith(".cjs")) {
|
|
3930
|
-
resolvedPath += ".ts";
|
|
3931
|
-
}
|
|
3932
|
-
if (resolvedPath.endsWith(".ts")) {
|
|
3933
|
-
try {
|
|
3934
|
-
const importSource = await readFile(resolvedPath, "utf-8");
|
|
3935
|
-
const transpiled = transformSync(importSource, {
|
|
3936
|
-
loader: "ts",
|
|
3937
|
-
format: "cjs",
|
|
3938
|
-
target: "es2020",
|
|
3939
|
-
tsconfigRaw: {
|
|
3940
|
-
compilerOptions: {
|
|
3941
|
-
jsx: "react",
|
|
3942
|
-
jsxFactory: "h",
|
|
3943
|
-
jsxFragmentFactory: "Fragment"
|
|
3944
|
-
}
|
|
3945
|
-
}
|
|
3946
|
-
});
|
|
3947
|
-
const moduleExports = {};
|
|
3948
|
-
const moduleObj = { exports: moduleExports };
|
|
3949
|
-
const fn2 = new Function("module", "exports", "require", "__filename", "__dirname", transpiled.code);
|
|
3950
|
-
const requireFn = (id) => {
|
|
3951
|
-
if (id.startsWith("elit/") || id === "elit") {
|
|
3952
|
-
return __require(id);
|
|
3953
|
-
}
|
|
3954
|
-
if (id.startsWith(".")) {
|
|
3955
|
-
const nodePath = __require("path");
|
|
3956
|
-
const absPath = nodePath.resolve(dirname(resolvedPath), id);
|
|
3957
|
-
return __require(absPath);
|
|
3958
|
-
}
|
|
3959
|
-
return __require(id);
|
|
3960
|
-
};
|
|
3961
|
-
fn2(moduleObj, moduleExports, requireFn, resolvedPath, dirname(resolvedPath));
|
|
3962
|
-
if (!resolvedPath.includes(".test.") && !resolvedPath.includes(".spec.")) {
|
|
3963
|
-
coveredFiles.add(resolvedPath);
|
|
3964
|
-
}
|
|
3965
|
-
let exportedValue = moduleObj.exports[named];
|
|
3966
|
-
if (exportedValue === void 0 && moduleObj.exports.default) {
|
|
3967
|
-
exportedValue = moduleObj.exports.default[named];
|
|
3968
|
-
}
|
|
3969
|
-
if (exportedValue === void 0 && typeof moduleObj.exports === "object") {
|
|
3970
|
-
exportedValue = moduleObj.exports[named];
|
|
3971
|
-
}
|
|
3972
|
-
const paramKey = `__import_${Math.random().toString(36).substring(2, 11)}`;
|
|
3973
|
-
importedValues[paramKey] = exportedValue;
|
|
3974
|
-
importParamNames.push(paramKey);
|
|
3975
|
-
importAssignments.push(`const ${named} = ${paramKey};`);
|
|
3976
|
-
} catch (err) {
|
|
3977
|
-
const paramKey = `__import_${Math.random().toString(36).substring(2, 11)}`;
|
|
3978
|
-
importedValues[paramKey] = null;
|
|
3979
|
-
importParamNames.push(paramKey);
|
|
3980
|
-
importAssignments.push(`const ${named} = ${paramKey}; /* Error importing ${resolvedPath}: ${err} */`);
|
|
3981
|
-
}
|
|
3982
|
-
} else {
|
|
3983
|
-
const requiredModule = __require(resolvedPath);
|
|
3984
|
-
const exportedValue = requiredModule[named];
|
|
3985
|
-
const paramKey = `__import_${Math.random().toString(36).substring(2, 11)}`;
|
|
3986
|
-
importedValues[paramKey] = exportedValue;
|
|
3987
|
-
importParamNames.push(paramKey);
|
|
3988
|
-
importAssignments.push(`const ${named} = ${paramKey};`);
|
|
3989
|
-
}
|
|
3990
|
-
}
|
|
3991
|
-
}
|
|
3992
|
-
let preamble = "";
|
|
3993
|
-
if (Object.keys(imports).length > 0) {
|
|
3994
|
-
const iifeStartMatch = code.match(/^(\s*(?:var\s+\w+\s*=\s*)?\(\(\)\s*=>\s*\{\n)/);
|
|
3995
|
-
if (iifeStartMatch) {
|
|
3996
|
-
const iifePrefix = iifeStartMatch[1];
|
|
3997
|
-
const assignments = `${importAssignments.join("\n")}
|
|
3998
|
-
`;
|
|
3999
|
-
preamble = iifePrefix;
|
|
4000
|
-
code = iifePrefix + assignments + code.slice(iifeStartMatch[1].length);
|
|
4001
|
-
} else {
|
|
4002
|
-
preamble = importAssignments.join("\n") + "\n";
|
|
4003
|
-
code = preamble + code;
|
|
4004
|
-
}
|
|
4005
|
-
}
|
|
4006
|
-
wrapperLineOffset = preamble.split("\n").length;
|
|
4012
|
+
wrapperLineOffset = 0;
|
|
4007
4013
|
setupGlobals();
|
|
4008
|
-
const
|
|
4009
|
-
const
|
|
4010
|
-
const
|
|
4011
|
-
|
|
4014
|
+
const moduleCache = /* @__PURE__ */ new Map();
|
|
4015
|
+
const moduleRecord = { exports: {} };
|
|
4016
|
+
const moduleObj = { exports: moduleRecord.exports };
|
|
4017
|
+
moduleCache.set(file, moduleRecord);
|
|
4018
|
+
const fn = new Function("module", "exports", "require", "__filename", "__dirname", code);
|
|
4019
|
+
const requireFn = createTestModuleRequire(file, moduleCache);
|
|
4020
|
+
await fn(moduleObj, moduleObj.exports, requireFn, file, testFileDir);
|
|
4012
4021
|
await executeSuite(currentSuite, timeout, bail);
|
|
4013
4022
|
if (currentSourceMapConsumer) {
|
|
4014
4023
|
currentSourceMapConsumer.destroy();
|
|
@@ -4073,22 +4082,22 @@ async function executeSuite(suite, timeout, bail, parentMatched = false) {
|
|
|
4073
4082
|
for (const hook of beforeAllHooks) {
|
|
4074
4083
|
await hook();
|
|
4075
4084
|
}
|
|
4076
|
-
for (const
|
|
4077
|
-
if (hasOnly && !
|
|
4085
|
+
for (const test of suite.tests) {
|
|
4086
|
+
if (hasOnly && !test.only && !suite.only) {
|
|
4078
4087
|
continue;
|
|
4079
4088
|
}
|
|
4080
4089
|
let testMatches = true;
|
|
4081
4090
|
if (testPattern) {
|
|
4082
4091
|
const escapedPattern = escapeRegex(testPattern);
|
|
4083
4092
|
const regex = new RegExp(escapedPattern, "i");
|
|
4084
|
-
testMatches = regex.test(
|
|
4093
|
+
testMatches = regex.test(test.name);
|
|
4085
4094
|
}
|
|
4086
4095
|
if (!testMatches) {
|
|
4087
4096
|
continue;
|
|
4088
4097
|
}
|
|
4089
|
-
if (
|
|
4098
|
+
if (test.skip || suite.skip) {
|
|
4090
4099
|
testResults.push({
|
|
4091
|
-
name:
|
|
4100
|
+
name: test.name,
|
|
4092
4101
|
status: "skip",
|
|
4093
4102
|
duration: 0,
|
|
4094
4103
|
suite: suite.name,
|
|
@@ -4096,9 +4105,9 @@ async function executeSuite(suite, timeout, bail, parentMatched = false) {
|
|
|
4096
4105
|
});
|
|
4097
4106
|
continue;
|
|
4098
4107
|
}
|
|
4099
|
-
if (
|
|
4108
|
+
if (test.todo) {
|
|
4100
4109
|
testResults.push({
|
|
4101
|
-
name:
|
|
4110
|
+
name: test.name,
|
|
4102
4111
|
status: "todo",
|
|
4103
4112
|
duration: 0,
|
|
4104
4113
|
suite: suite.name,
|
|
@@ -4112,13 +4121,13 @@ async function executeSuite(suite, timeout, bail, parentMatched = false) {
|
|
|
4112
4121
|
const startTime = Date.now();
|
|
4113
4122
|
try {
|
|
4114
4123
|
await Promise.race([
|
|
4115
|
-
|
|
4124
|
+
test.fn(),
|
|
4116
4125
|
new Promise(
|
|
4117
|
-
(_, reject) => setTimeout(() => reject(new Error(`Test timed out after ${
|
|
4126
|
+
(_, reject) => setTimeout(() => reject(new Error(`Test timed out after ${test.timeout}ms`)), test.timeout)
|
|
4118
4127
|
)
|
|
4119
4128
|
]);
|
|
4120
4129
|
testResults.push({
|
|
4121
|
-
name:
|
|
4130
|
+
name: test.name,
|
|
4122
4131
|
status: "pass",
|
|
4123
4132
|
duration: Date.now() - startTime,
|
|
4124
4133
|
suite: suite.name,
|
|
@@ -4132,7 +4141,7 @@ async function executeSuite(suite, timeout, bail, parentMatched = false) {
|
|
|
4132
4141
|
codeSnippet = error.codeSnippet;
|
|
4133
4142
|
}
|
|
4134
4143
|
testResults.push({
|
|
4135
|
-
name:
|
|
4144
|
+
name: test.name,
|
|
4136
4145
|
status: "fail",
|
|
4137
4146
|
duration: Date.now() - startTime,
|
|
4138
4147
|
error,
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
import { EventEmitter as EventEmitter$1 } from 'events';
|
|
3
|
-
import { Server } from 'http';
|
|
3
|
+
import { Server as Server$1 } from 'http';
|
|
4
4
|
import { WebSocketServer } from 'ws';
|
|
5
|
+
import { Server, AddressInfo } from 'net';
|
|
6
|
+
import { SMTPServerOptions, SMTPServer } from 'smtp-server';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* HTTP module with unified API across runtimes
|
|
@@ -238,6 +240,28 @@ declare class StateManager$1 {
|
|
|
238
240
|
clear(): void;
|
|
239
241
|
}
|
|
240
242
|
|
|
243
|
+
/**
|
|
244
|
+
* SMTP server helpers built on top of the smtp-server package.
|
|
245
|
+
*/
|
|
246
|
+
|
|
247
|
+
interface ElitSMTPServerConfig extends SMTPServerOptions {
|
|
248
|
+
port?: number;
|
|
249
|
+
host?: string;
|
|
250
|
+
label?: string;
|
|
251
|
+
}
|
|
252
|
+
interface ResolvedElitSMTPServerConfig extends SMTPServerOptions {
|
|
253
|
+
port: number;
|
|
254
|
+
host: string;
|
|
255
|
+
label?: string;
|
|
256
|
+
}
|
|
257
|
+
interface ElitSMTPServerHandle {
|
|
258
|
+
server: SMTPServer;
|
|
259
|
+
config: ResolvedElitSMTPServerConfig;
|
|
260
|
+
listen(callback?: () => void): Server;
|
|
261
|
+
address(): AddressInfo | string | null;
|
|
262
|
+
close(): Promise<void>;
|
|
263
|
+
}
|
|
264
|
+
|
|
241
265
|
/**
|
|
242
266
|
* Elit - Types and Interfaces
|
|
243
267
|
*/
|
|
@@ -342,6 +366,8 @@ interface ClientConfig {
|
|
|
342
366
|
api?: Router;
|
|
343
367
|
/** WebSocket endpoints specific to this client */
|
|
344
368
|
ws?: WebSocketEndpointConfig[];
|
|
369
|
+
/** SMTP listeners specific to this client */
|
|
370
|
+
smtp?: ElitSMTPServerConfig | ElitSMTPServerConfig[];
|
|
345
371
|
/** Server mode: 'dev' uses source files, 'preview' uses built files (default: 'dev') */
|
|
346
372
|
mode?: 'dev' | 'preview';
|
|
347
373
|
}
|
|
@@ -400,6 +426,8 @@ interface DevServerOptions {
|
|
|
400
426
|
api?: Router;
|
|
401
427
|
/** WebSocket endpoints */
|
|
402
428
|
ws?: WebSocketEndpointConfig[];
|
|
429
|
+
/** SMTP listeners started alongside the HTTP server */
|
|
430
|
+
smtp?: ElitSMTPServerConfig | ElitSMTPServerConfig[];
|
|
403
431
|
/** SSR render function - returns HTML VNode or string */
|
|
404
432
|
ssr?: () => Child | string;
|
|
405
433
|
/** Proxy configuration for API requests */
|
|
@@ -417,9 +445,11 @@ interface DevServerOptions {
|
|
|
417
445
|
}
|
|
418
446
|
interface DevServer {
|
|
419
447
|
/** HTTP server instance */
|
|
420
|
-
server: Server;
|
|
448
|
+
server: Server$1;
|
|
421
449
|
/** WebSocket server for HMR */
|
|
422
450
|
wss: WebSocketServer;
|
|
451
|
+
/** Managed SMTP listeners started from dev or preview config */
|
|
452
|
+
smtpServers: ElitSMTPServerHandle[];
|
|
423
453
|
/** Server URL */
|
|
424
454
|
url: string;
|
|
425
455
|
/** Shared state manager */
|
|
@@ -517,6 +547,8 @@ interface PreviewOptions {
|
|
|
517
547
|
api?: Router;
|
|
518
548
|
/** WebSocket endpoints */
|
|
519
549
|
ws?: WebSocketEndpointConfig[];
|
|
550
|
+
/** SMTP listeners started alongside the preview server */
|
|
551
|
+
smtp?: ElitSMTPServerConfig | ElitSMTPServerConfig[];
|
|
520
552
|
/** SSR render function - returns HTML VNode or string */
|
|
521
553
|
ssr?: () => Child | string;
|
|
522
554
|
/** Proxy configuration for API requests */
|
package/dist/universal.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "elit",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.6",
|
|
4
4
|
"description": "Optimized lightweight library for creating DOM elements with reactive state",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -95,6 +95,12 @@
|
|
|
95
95
|
"import": "./dist/https.mjs",
|
|
96
96
|
"require": "./dist/https.cjs"
|
|
97
97
|
},
|
|
98
|
+
"./smtp-server": {
|
|
99
|
+
"types": "./dist/smtp-server.d.ts",
|
|
100
|
+
"browser": "./dist/smtp-server.js",
|
|
101
|
+
"import": "./dist/smtp-server.mjs",
|
|
102
|
+
"require": "./dist/smtp-server.cjs"
|
|
103
|
+
},
|
|
98
104
|
"./ws": {
|
|
99
105
|
"types": "./dist/ws.d.ts",
|
|
100
106
|
"browser": "./dist/ws.js",
|
|
@@ -257,12 +263,14 @@
|
|
|
257
263
|
"esbuild": "^0.27.3",
|
|
258
264
|
"esbuild-obfuscator-plugin": "^0.0.5",
|
|
259
265
|
"open": "^11.0.0",
|
|
266
|
+
"smtp-server": "^3.18.4",
|
|
260
267
|
"source-map": "^0.7.6"
|
|
261
268
|
},
|
|
262
269
|
"devDependencies": {
|
|
263
270
|
"@types/bun": "^1.3.6",
|
|
264
271
|
"@types/mime-types": "^2.1.4",
|
|
265
272
|
"@types/node": "^25.0.10",
|
|
273
|
+
"@types/smtp-server": "^3.5.13",
|
|
266
274
|
"@types/ws": "^8.5.13",
|
|
267
275
|
"copyfiles": "^2.4.1",
|
|
268
276
|
"elysia": "^1.4.19",
|