elit 3.6.9 → 3.7.1

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.
Files changed (50) hide show
  1. package/Cargo.lock +380 -449
  2. package/Cargo.toml +3 -3
  3. package/dist/build.cjs +1 -1
  4. package/dist/build.d.ts +1 -1
  5. package/dist/build.js +14 -10
  6. package/dist/build.mjs +1 -1
  7. package/dist/cli.cjs +1629 -6432
  8. package/dist/cli.d.ts +10 -3
  9. package/dist/cli.mjs +1633 -6436
  10. package/dist/config.cjs +7 -2
  11. package/dist/config.d.ts +4 -4
  12. package/dist/config.js +20 -11
  13. package/dist/config.mjs +7 -2
  14. package/dist/{contracts-D7KIS-TK.d.ts → contracts-Av9yuqDM.d.ts} +11 -4
  15. package/dist/dev-build.d.ts +2 -1
  16. package/dist/dev-build.js +13 -9
  17. package/dist/https.cjs +7 -2
  18. package/dist/https.js +7 -2
  19. package/dist/https.mjs +7 -2
  20. package/dist/index.cjs +340 -52
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +340 -52
  23. package/dist/index.mjs +340 -52
  24. package/dist/native.cjs +340 -52
  25. package/dist/native.js +340 -52
  26. package/dist/native.mjs +340 -52
  27. package/dist/pm.cjs +7 -2
  28. package/dist/pm.d.ts +3 -3
  29. package/dist/pm.js +20 -11
  30. package/dist/pm.mjs +7 -2
  31. package/dist/preview-build.d.ts +2 -2
  32. package/dist/preview-build.js +13 -9
  33. package/dist/server.cjs +877 -5993
  34. package/dist/server.d.ts +3 -2
  35. package/dist/server.js +12199 -4468
  36. package/dist/server.mjs +877 -5993
  37. package/dist/smtp-server.js +514 -44
  38. package/dist/test-runtime.cjs +20 -0
  39. package/dist/test-runtime.js +33 -9
  40. package/dist/test-runtime.mjs +20 -0
  41. package/dist/test.cjs +27 -2
  42. package/dist/test.js +40 -11
  43. package/dist/test.mjs +27 -2
  44. package/dist/{types-fiLday0L.d.ts → types-BjkTamLI.d.ts} +14 -0
  45. package/dist/{types-BayMVo_k.d.ts → types-DdL_S7pL.d.ts} +8 -2
  46. package/dist/types.d.ts +56 -36
  47. package/dist/wss.cjs +7 -2
  48. package/dist/wss.js +7 -2
  49. package/dist/wss.mjs +7 -2
  50. package/package.json +7 -2
@@ -524,6 +524,26 @@ var Expect = class _Expect {
524
524
  this.assertCondition(this.deepEqual(object, value), `Expected property "${path}" to equal ${this.stringify(value)}`);
525
525
  }
526
526
  }
527
+ toMatchObject(properties) {
528
+ const stack = new Error().stack;
529
+ this.expected = properties;
530
+ const checkSubset = (actual, expected, path) => {
531
+ if (actual == null || typeof actual !== "object") return false;
532
+ for (const key of Object.keys(expected)) {
533
+ const expectedValue = expected[key];
534
+ const actualValue = actual[key];
535
+ const fieldPath = `${path}${key}`;
536
+ if (expectedValue !== null && typeof expectedValue === "object" && !Array.isArray(expectedValue)) {
537
+ if (!checkSubset(actualValue, expectedValue, `${fieldPath}.`)) return false;
538
+ } else if (!this.deepEqual(actualValue, expectedValue)) {
539
+ this.assertCondition(false, `Expected property "${fieldPath}" to equal ${this.stringify(expectedValue)}`, false, void 0, stack);
540
+ return false;
541
+ }
542
+ }
543
+ return true;
544
+ };
545
+ this.assertCondition(checkSubset(this.actual, properties, ""), "Expected object to match subset", false, void 0, stack);
546
+ }
527
547
  toBeCalled() {
528
548
  this.assertCondition(this.actual._isMock && this.actual._calls.length > 0, "Expected mock function to have been called");
529
549
  }
@@ -13,7 +13,11 @@
13
13
  throw Error('Dynamic require of "' + x + '" is not supported');
14
14
  });
15
15
  var __commonJS = (cb, mod) => function __require2() {
16
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
16
+ try {
17
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ } catch (e) {
19
+ throw mod = 0, e;
20
+ }
17
21
  };
18
22
  var __copyProps = (to, from, except, desc) => {
19
23
  if (from && typeof from === "object" || typeof from === "function") {
@@ -943,8 +947,8 @@ is not a problem with esbuild. You need to fix your environment instead.
943
947
  if (isFirstPacket) {
944
948
  isFirstPacket = false;
945
949
  let binaryVersion = String.fromCharCode(...bytes);
946
- if (binaryVersion !== "0.27.7") {
947
- throw new Error(`Cannot start service: Host version "${"0.27.7"}" does not match binary version ${quote(binaryVersion)}`);
950
+ if (binaryVersion !== "0.28.1") {
951
+ throw new Error(`Cannot start service: Host version "${"0.28.1"}" does not match binary version ${quote(binaryVersion)}`);
948
952
  }
949
953
  return;
950
954
  }
@@ -2077,7 +2081,7 @@ for your current platform.`);
2077
2081
  "node_modules",
2078
2082
  ".cache",
2079
2083
  "esbuild",
2080
- `pnpapi-${pkg.replace("/", "-")}-${"0.27.7"}-${path.basename(subpath)}`
2084
+ `pnpapi-${pkg.replace("/", "-")}-${"0.28.1"}-${path.basename(subpath)}`
2081
2085
  );
2082
2086
  if (!fs2.existsSync(binTargetPath)) {
2083
2087
  fs2.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -2110,7 +2114,7 @@ for your current platform.`);
2110
2114
  }
2111
2115
  }
2112
2116
  var _a;
2113
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.27.7";
2117
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.28.1";
2114
2118
  var esbuildCommandAndArgs = () => {
2115
2119
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
2116
2120
  throw new Error(
@@ -2177,7 +2181,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
2177
2181
  }
2178
2182
  }
2179
2183
  };
2180
- var version = "0.27.7";
2184
+ var version = "0.28.1";
2181
2185
  var build = (options) => ensureServiceIsRunning().build(options);
2182
2186
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
2183
2187
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -2280,7 +2284,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
2280
2284
  var ensureServiceIsRunning = () => {
2281
2285
  if (longLivedService) return longLivedService;
2282
2286
  let [command, args] = esbuildCommandAndArgs();
2283
- let child = child_process.spawn(command, args.concat(`--service=${"0.27.7"}`, "--ping"), {
2287
+ let child = child_process.spawn(command, args.concat(`--service=${"0.28.1"}`, "--ping"), {
2284
2288
  windowsHide: true,
2285
2289
  stdio: ["pipe", "pipe", "inherit"],
2286
2290
  cwd: defaultWD
@@ -2384,7 +2388,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
2384
2388
  esbuild: node_exports
2385
2389
  });
2386
2390
  callback(service);
2387
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.27.7"}`), {
2391
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.28.1"}`), {
2388
2392
  cwd: defaultWD,
2389
2393
  windowsHide: true,
2390
2394
  input: stdin,
@@ -2404,7 +2408,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
2404
2408
  var startWorkerThreadService = (worker_threads2) => {
2405
2409
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
2406
2410
  let worker = new worker_threads2.Worker(__filename, {
2407
- workerData: { workerPort, defaultWD, esbuildVersion: "0.27.7" },
2411
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.28.1" },
2408
2412
  transferList: [workerPort],
2409
2413
  // From node's documentation: https://nodejs.org/api/worker_threads.html
2410
2414
  //
@@ -5143,6 +5147,26 @@ error: ${text}`);
5143
5147
  this.assertCondition(this.deepEqual(object, value), `Expected property "${path}" to equal ${this.stringify(value)}`);
5144
5148
  }
5145
5149
  }
5150
+ toMatchObject(properties) {
5151
+ const stack = new Error().stack;
5152
+ this.expected = properties;
5153
+ const checkSubset = (actual, expected, path) => {
5154
+ if (actual == null || typeof actual !== "object") return false;
5155
+ for (const key of Object.keys(expected)) {
5156
+ const expectedValue = expected[key];
5157
+ const actualValue = actual[key];
5158
+ const fieldPath = `${path}${key}`;
5159
+ if (expectedValue !== null && typeof expectedValue === "object" && !Array.isArray(expectedValue)) {
5160
+ if (!checkSubset(actualValue, expectedValue, `${fieldPath}.`)) return false;
5161
+ } else if (!this.deepEqual(actualValue, expectedValue)) {
5162
+ this.assertCondition(false, `Expected property "${fieldPath}" to equal ${this.stringify(expectedValue)}`, false, void 0, stack);
5163
+ return false;
5164
+ }
5165
+ }
5166
+ return true;
5167
+ };
5168
+ this.assertCondition(checkSubset(this.actual, properties, ""), "Expected object to match subset", false, void 0, stack);
5169
+ }
5146
5170
  toBeCalled() {
5147
5171
  this.assertCondition(this.actual._isMock && this.actual._calls.length > 0, "Expected mock function to have been called");
5148
5172
  }
@@ -500,6 +500,26 @@ var Expect = class _Expect {
500
500
  this.assertCondition(this.deepEqual(object, value), `Expected property "${path}" to equal ${this.stringify(value)}`);
501
501
  }
502
502
  }
503
+ toMatchObject(properties) {
504
+ const stack = new Error().stack;
505
+ this.expected = properties;
506
+ const checkSubset = (actual, expected, path) => {
507
+ if (actual == null || typeof actual !== "object") return false;
508
+ for (const key of Object.keys(expected)) {
509
+ const expectedValue = expected[key];
510
+ const actualValue = actual[key];
511
+ const fieldPath = `${path}${key}`;
512
+ if (expectedValue !== null && typeof expectedValue === "object" && !Array.isArray(expectedValue)) {
513
+ if (!checkSubset(actualValue, expectedValue, `${fieldPath}.`)) return false;
514
+ } else if (!this.deepEqual(actualValue, expectedValue)) {
515
+ this.assertCondition(false, `Expected property "${fieldPath}" to equal ${this.stringify(expectedValue)}`, false, void 0, stack);
516
+ return false;
517
+ }
518
+ }
519
+ return true;
520
+ };
521
+ this.assertCondition(checkSubset(this.actual, properties, ""), "Expected object to match subset", false, void 0, stack);
522
+ }
503
523
  toBeCalled() {
504
524
  this.assertCondition(this.actual._isMock && this.actual._calls.length > 0, "Expected mock function to have been called");
505
525
  }
package/dist/test.cjs CHANGED
@@ -5,8 +5,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __esm = (fn, res) => function __init() {
9
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8
+ var __esm = (fn, res, err) => function __init() {
9
+ if (err) throw err[0];
10
+ try {
11
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
+ } catch (e) {
13
+ throw err = [e], e;
14
+ }
10
15
  };
11
16
  var __export = (target, all) => {
12
17
  for (var name in all)
@@ -660,6 +665,26 @@ var init_expect = __esm({
660
665
  this.assertCondition(this.deepEqual(object, value), `Expected property "${path}" to equal ${this.stringify(value)}`);
661
666
  }
662
667
  }
668
+ toMatchObject(properties) {
669
+ const stack = new Error().stack;
670
+ this.expected = properties;
671
+ const checkSubset = (actual, expected, path) => {
672
+ if (actual == null || typeof actual !== "object") return false;
673
+ for (const key of Object.keys(expected)) {
674
+ const expectedValue = expected[key];
675
+ const actualValue = actual[key];
676
+ const fieldPath = `${path}${key}`;
677
+ if (expectedValue !== null && typeof expectedValue === "object" && !Array.isArray(expectedValue)) {
678
+ if (!checkSubset(actualValue, expectedValue, `${fieldPath}.`)) return false;
679
+ } else if (!this.deepEqual(actualValue, expectedValue)) {
680
+ this.assertCondition(false, `Expected property "${fieldPath}" to equal ${this.stringify(expectedValue)}`, false, void 0, stack);
681
+ return false;
682
+ }
683
+ }
684
+ return true;
685
+ };
686
+ this.assertCondition(checkSubset(this.actual, properties, ""), "Expected object to match subset", false, void 0, stack);
687
+ }
663
688
  toBeCalled() {
664
689
  this.assertCondition(this.actual._isMock && this.actual._calls.length > 0, "Expected mock function to have been called");
665
690
  }
package/dist/test.js CHANGED
@@ -12,11 +12,20 @@
12
12
  if (typeof require !== "undefined") return require.apply(this, arguments);
13
13
  throw Error('Dynamic require of "' + x + '" is not supported');
14
14
  });
15
- var __esm = (fn, res) => function __init() {
16
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
15
+ var __esm = (fn, res, err) => function __init() {
16
+ if (err) throw err[0];
17
+ try {
18
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
19
+ } catch (e) {
20
+ throw err = [e], e;
21
+ }
17
22
  };
18
23
  var __commonJS = (cb, mod) => function __require2() {
19
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
+ try {
25
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
26
+ } catch (e) {
27
+ throw mod = 0, e;
28
+ }
20
29
  };
21
30
  var __export = (target, all) => {
22
31
  for (var name in all)
@@ -669,6 +678,26 @@
669
678
  this.assertCondition(this.deepEqual(object, value), `Expected property "${path}" to equal ${this.stringify(value)}`);
670
679
  }
671
680
  }
681
+ toMatchObject(properties) {
682
+ const stack = new Error().stack;
683
+ this.expected = properties;
684
+ const checkSubset = (actual, expected, path) => {
685
+ if (actual == null || typeof actual !== "object") return false;
686
+ for (const key of Object.keys(expected)) {
687
+ const expectedValue = expected[key];
688
+ const actualValue = actual[key];
689
+ const fieldPath = `${path}${key}`;
690
+ if (expectedValue !== null && typeof expectedValue === "object" && !Array.isArray(expectedValue)) {
691
+ if (!checkSubset(actualValue, expectedValue, `${fieldPath}.`)) return false;
692
+ } else if (!this.deepEqual(actualValue, expectedValue)) {
693
+ this.assertCondition(false, `Expected property "${fieldPath}" to equal ${this.stringify(expectedValue)}`, false, void 0, stack);
694
+ return false;
695
+ }
696
+ }
697
+ return true;
698
+ };
699
+ this.assertCondition(checkSubset(this.actual, properties, ""), "Expected object to match subset", false, void 0, stack);
700
+ }
672
701
  toBeCalled() {
673
702
  this.assertCondition(this.actual._isMock && this.actual._calls.length > 0, "Expected mock function to have been called");
674
703
  }
@@ -1835,8 +1864,8 @@ is not a problem with esbuild. You need to fix your environment instead.
1835
1864
  if (isFirstPacket) {
1836
1865
  isFirstPacket = false;
1837
1866
  let binaryVersion = String.fromCharCode(...bytes);
1838
- if (binaryVersion !== "0.27.7") {
1839
- throw new Error(`Cannot start service: Host version "${"0.27.7"}" does not match binary version ${quote(binaryVersion)}`);
1867
+ if (binaryVersion !== "0.28.1") {
1868
+ throw new Error(`Cannot start service: Host version "${"0.28.1"}" does not match binary version ${quote(binaryVersion)}`);
1840
1869
  }
1841
1870
  return;
1842
1871
  }
@@ -2969,7 +2998,7 @@ for your current platform.`);
2969
2998
  "node_modules",
2970
2999
  ".cache",
2971
3000
  "esbuild",
2972
- `pnpapi-${pkg.replace("/", "-")}-${"0.27.7"}-${path.basename(subpath)}`
3001
+ `pnpapi-${pkg.replace("/", "-")}-${"0.28.1"}-${path.basename(subpath)}`
2973
3002
  );
2974
3003
  if (!fs2.existsSync(binTargetPath)) {
2975
3004
  fs2.mkdirSync(path.dirname(binTargetPath), { recursive: true });
@@ -3002,7 +3031,7 @@ for your current platform.`);
3002
3031
  }
3003
3032
  }
3004
3033
  var _a;
3005
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.27.7";
3034
+ var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.28.1";
3006
3035
  var esbuildCommandAndArgs = () => {
3007
3036
  if ((!ESBUILD_BINARY_PATH || false) && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib")) {
3008
3037
  throw new Error(
@@ -3069,7 +3098,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
3069
3098
  }
3070
3099
  }
3071
3100
  };
3072
- var version = "0.27.7";
3101
+ var version = "0.28.1";
3073
3102
  var build = (options) => ensureServiceIsRunning().build(options);
3074
3103
  var context = (buildOptions) => ensureServiceIsRunning().context(buildOptions);
3075
3104
  var transform = (input, options) => ensureServiceIsRunning().transform(input, options);
@@ -3172,7 +3201,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
3172
3201
  var ensureServiceIsRunning = () => {
3173
3202
  if (longLivedService) return longLivedService;
3174
3203
  let [command, args] = esbuildCommandAndArgs();
3175
- let child = child_process.spawn(command, args.concat(`--service=${"0.27.7"}`, "--ping"), {
3204
+ let child = child_process.spawn(command, args.concat(`--service=${"0.28.1"}`, "--ping"), {
3176
3205
  windowsHide: true,
3177
3206
  stdio: ["pipe", "pipe", "inherit"],
3178
3207
  cwd: defaultWD
@@ -3276,7 +3305,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
3276
3305
  esbuild: node_exports
3277
3306
  });
3278
3307
  callback(service);
3279
- let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.27.7"}`), {
3308
+ let stdout = child_process.execFileSync(command, args.concat(`--service=${"0.28.1"}`), {
3280
3309
  cwd: defaultWD,
3281
3310
  windowsHide: true,
3282
3311
  input: stdin,
@@ -3296,7 +3325,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
3296
3325
  var startWorkerThreadService = (worker_threads2) => {
3297
3326
  let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel();
3298
3327
  let worker = new worker_threads2.Worker(__filename, {
3299
- workerData: { workerPort, defaultWD, esbuildVersion: "0.27.7" },
3328
+ workerData: { workerPort, defaultWD, esbuildVersion: "0.28.1" },
3300
3329
  transferList: [workerPort],
3301
3330
  // From node's documentation: https://nodejs.org/api/worker_threads.html
3302
3331
  //
package/dist/test.mjs CHANGED
@@ -7,8 +7,13 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
7
7
  if (typeof require !== "undefined") return require.apply(this, arguments);
8
8
  throw Error('Dynamic require of "' + x + '" is not supported');
9
9
  });
10
- var __esm = (fn, res) => function __init() {
11
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ var __esm = (fn, res, err) => function __init() {
11
+ if (err) throw err[0];
12
+ try {
13
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
14
+ } catch (e) {
15
+ throw err = [e], e;
16
+ }
12
17
  };
13
18
  var __export = (target, all) => {
14
19
  for (var name in all)
@@ -645,6 +650,26 @@ var init_expect = __esm({
645
650
  this.assertCondition(this.deepEqual(object, value), `Expected property "${path}" to equal ${this.stringify(value)}`);
646
651
  }
647
652
  }
653
+ toMatchObject(properties) {
654
+ const stack = new Error().stack;
655
+ this.expected = properties;
656
+ const checkSubset = (actual, expected, path) => {
657
+ if (actual == null || typeof actual !== "object") return false;
658
+ for (const key of Object.keys(expected)) {
659
+ const expectedValue = expected[key];
660
+ const actualValue = actual[key];
661
+ const fieldPath = `${path}${key}`;
662
+ if (expectedValue !== null && typeof expectedValue === "object" && !Array.isArray(expectedValue)) {
663
+ if (!checkSubset(actualValue, expectedValue, `${fieldPath}.`)) return false;
664
+ } else if (!this.deepEqual(actualValue, expectedValue)) {
665
+ this.assertCondition(false, `Expected property "${fieldPath}" to equal ${this.stringify(expectedValue)}`, false, void 0, stack);
666
+ return false;
667
+ }
668
+ }
669
+ return true;
670
+ };
671
+ this.assertCondition(checkSubset(this.actual, properties, ""), "Expected object to match subset", false, void 0, stack);
672
+ }
648
673
  toBeCalled() {
649
674
  this.assertCondition(this.actual._isMock && this.actual._calls.length > 0, "Expected mock function to have been called");
650
675
  }
@@ -3,6 +3,7 @@ import { W as WebSocket } from './websocket-BLBEAnhp.js';
3
3
  import { Server } from 'http';
4
4
  import { WebSocketServer } from 'ws';
5
5
  import { C as Child } from './types-BR4wMiVx.js';
6
+ import { R as ResolveConfig } from './contracts-Av9yuqDM.js';
6
7
  import { E as ElitSMTPServerConfig, a as ElitSMTPServerHandle } from './types-C4gKykuG.js';
7
8
 
8
9
  type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | 'ALL';
@@ -113,6 +114,8 @@ interface ClientConfig {
113
114
  fallbackRoot?: string;
114
115
  basePath: string;
115
116
  index?: string;
117
+ /** When `true` (default), navigation requests for non-existent paths serve `index.html` (or SSR output) so client-side history-mode routing works on reload. Set to `false` to return strict 404s. */
118
+ historyApiFallback?: boolean;
116
119
  ssr?: () => Child | string;
117
120
  watch?: string[];
118
121
  ignore?: string[];
@@ -149,10 +152,17 @@ interface DevServerOptions {
149
152
  open?: boolean;
150
153
  watch?: string[];
151
154
  ignore?: string[];
155
+ /** Server-side HMR: restart dev server when server-source files change.
156
+ * - `true` (default): walk dependency graph from server entries discovered in elit.config.ts
157
+ * - `false`: disable server-side HMR entirely
158
+ * - `string[]`: explicit glob patterns to watch (skips dep graph discovery) */
159
+ serverWatch?: boolean | string[];
152
160
  worker?: WorkerConfig[];
153
161
  logging?: boolean;
154
162
  /** Glob patterns for files that must never be served (e.g. ".env", ".env.*", "*.key"). Default blocks .env, .env.*, .git/**, and common secret files. */
155
163
  blockFiles?: string[];
164
+ /** Import-specifier alias map applied to served source files (e.g. `{ '@': './src' }`). */
165
+ resolve?: ResolveConfig;
156
166
  api?: Router;
157
167
  ws?: WebSocketEndpointConfig[];
158
168
  smtp?: ElitSMTPServerConfig | ElitSMTPServerConfig[];
@@ -163,6 +173,8 @@ interface DevServerOptions {
163
173
  standalone?: boolean;
164
174
  outDir?: string;
165
175
  outFile?: string;
176
+ /** When `true` (default), navigation requests (`GET` with `Accept: text/html`) for non-existent paths serve `index.html` (or SSR output) so client-side history-mode routing works on reload. Set to `false` to return strict 404s. */
177
+ historyApiFallback?: boolean;
166
178
  }
167
179
  interface DevServer {
168
180
  server: Server;
@@ -185,6 +197,8 @@ interface PreviewOptions {
185
197
  logging?: boolean;
186
198
  /** Glob patterns for files that must never be served (e.g. ".env", ".env.*", "*.key"). Default blocks .env, .env.*, .git/**, and common secret files. */
187
199
  blockFiles?: string[];
200
+ /** Import-specifier alias map applied to served source files (e.g. `{ '@': './src' }`). */
201
+ resolve?: ResolveConfig;
188
202
  api?: Router;
189
203
  ws?: WebSocketEndpointConfig[];
190
204
  smtp?: ElitSMTPServerConfig | ElitSMTPServerConfig[];
@@ -1,5 +1,5 @@
1
- import { D as DevServerOptions, P as PreviewOptions } from './types-fiLday0L.js';
2
- import { B as BuildOptions } from './contracts-D7KIS-TK.js';
1
+ import { D as DevServerOptions, P as PreviewOptions } from './types-BjkTamLI.js';
2
+ import { B as BuildOptions, R as ResolveConfig } from './contracts-Av9yuqDM.js';
3
3
  import { T as TestOptions } from './contracts-_0p1-15U.js';
4
4
 
5
5
  interface ElitConfig {
@@ -19,6 +19,12 @@ interface ElitConfig {
19
19
  pm?: PmConfig;
20
20
  /** WAPK packaging configuration */
21
21
  wapk?: WapkConfig;
22
+ /**
23
+ * Shared import-specifier alias map used as a default by `build`, `dev`,
24
+ * and `preview` when they do not declare their own `resolve.alias`.
25
+ * Example: `{ alias: { '@': './src' } }`.
26
+ */
27
+ resolve?: ResolveConfig;
22
28
  }
23
29
  type MobileMode = 'native' | 'hybrid';
24
30
  type DesktopMode = 'native' | 'hybrid';
package/dist/types.d.ts CHANGED
@@ -216,6 +216,48 @@ declare class StateManager$1 {
216
216
  clear(): void;
217
217
  }
218
218
 
219
+ interface ResolveConfig {
220
+ /**
221
+ * Map import specifiers to alternative targets. Keys are matched at the
222
+ * start of an import specifier; values are filesystem paths (relative to
223
+ * the project root, or absolute). Example: `{ '@': './src' }` rewrites
224
+ * `import x from '@/components/foo'` to `./src/components/foo`.
225
+ */
226
+ alias?: Record<string, string>;
227
+ }
228
+ interface BuildOptions {
229
+ entry: string;
230
+ outDir?: string;
231
+ outFile?: string;
232
+ minify?: boolean;
233
+ sourcemap?: boolean;
234
+ target?: 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
235
+ format?: 'esm' | 'cjs' | 'iife';
236
+ globalName?: string;
237
+ platform?: 'browser' | 'node' | 'neutral';
238
+ basePath?: string;
239
+ external?: string[];
240
+ resolve?: ResolveConfig;
241
+ treeshake?: boolean;
242
+ logging?: boolean;
243
+ env?: Record<string, string>;
244
+ copy?: Array<{
245
+ from: string;
246
+ to: string;
247
+ transform?: (content: string, config: BuildOptions) => string;
248
+ }>;
249
+ onBuildEnd?: (result: BuildResult) => void | Promise<void>;
250
+ standalonePreview?: boolean;
251
+ standaloneDev?: boolean;
252
+ standaloneDevOutFile?: string;
253
+ standalonePreviewOutFile?: string;
254
+ }
255
+ interface BuildResult {
256
+ outputPath: string;
257
+ buildTime: number;
258
+ size: number;
259
+ }
260
+
219
261
  interface ElitSMTPServerConfig extends SMTPServerOptions {
220
262
  port?: number;
221
263
  host?: string;
@@ -255,6 +297,8 @@ interface ClientConfig {
255
297
  fallbackRoot?: string;
256
298
  basePath: string;
257
299
  index?: string;
300
+ /** When `true` (default), navigation requests for non-existent paths serve `index.html` (or SSR output) so client-side history-mode routing works on reload. Set to `false` to return strict 404s. */
301
+ historyApiFallback?: boolean;
258
302
  ssr?: () => Child | string;
259
303
  watch?: string[];
260
304
  ignore?: string[];
@@ -291,10 +335,17 @@ interface DevServerOptions {
291
335
  open?: boolean;
292
336
  watch?: string[];
293
337
  ignore?: string[];
338
+ /** Server-side HMR: restart dev server when server-source files change.
339
+ * - `true` (default): walk dependency graph from server entries discovered in elit.config.ts
340
+ * - `false`: disable server-side HMR entirely
341
+ * - `string[]`: explicit glob patterns to watch (skips dep graph discovery) */
342
+ serverWatch?: boolean | string[];
294
343
  worker?: WorkerConfig[];
295
344
  logging?: boolean;
296
345
  /** Glob patterns for files that must never be served (e.g. ".env", ".env.*", "*.key"). Default blocks .env, .env.*, .git/**, and common secret files. */
297
346
  blockFiles?: string[];
347
+ /** Import-specifier alias map applied to served source files (e.g. `{ '@': './src' }`). */
348
+ resolve?: ResolveConfig;
298
349
  api?: Router;
299
350
  ws?: WebSocketEndpointConfig[];
300
351
  smtp?: ElitSMTPServerConfig | ElitSMTPServerConfig[];
@@ -305,6 +356,8 @@ interface DevServerOptions {
305
356
  standalone?: boolean;
306
357
  outDir?: string;
307
358
  outFile?: string;
359
+ /** When `true` (default), navigation requests (`GET` with `Accept: text/html`) for non-existent paths serve `index.html` (or SSR output) so client-side history-mode routing works on reload. Set to `false` to return strict 404s. */
360
+ historyApiFallback?: boolean;
308
361
  }
309
362
  interface DevServer {
310
363
  server: Server$1;
@@ -333,6 +386,8 @@ interface PreviewOptions {
333
386
  logging?: boolean;
334
387
  /** Glob patterns for files that must never be served (e.g. ".env", ".env.*", "*.key"). Default blocks .env, .env.*, .git/**, and common secret files. */
335
388
  blockFiles?: string[];
389
+ /** Import-specifier alias map applied to served source files (e.g. `{ '@': './src' }`). */
390
+ resolve?: ResolveConfig;
336
391
  api?: Router;
337
392
  ws?: WebSocketEndpointConfig[];
338
393
  smtp?: ElitSMTPServerConfig | ElitSMTPServerConfig[];
@@ -344,41 +399,6 @@ interface PreviewOptions {
344
399
  outFile?: string;
345
400
  }
346
401
 
347
- interface BuildOptions {
348
- entry: string;
349
- outDir?: string;
350
- outFile?: string;
351
- minify?: boolean;
352
- sourcemap?: boolean;
353
- target?: 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'esnext';
354
- format?: 'esm' | 'cjs' | 'iife';
355
- globalName?: string;
356
- platform?: 'browser' | 'node' | 'neutral';
357
- basePath?: string;
358
- external?: string[];
359
- resolve?: {
360
- alias?: Record<string, string>;
361
- };
362
- treeshake?: boolean;
363
- logging?: boolean;
364
- env?: Record<string, string>;
365
- copy?: Array<{
366
- from: string;
367
- to: string;
368
- transform?: (content: string, config: BuildOptions) => string;
369
- }>;
370
- onBuildEnd?: (result: BuildResult) => void | Promise<void>;
371
- standalonePreview?: boolean;
372
- standaloneDev?: boolean;
373
- standaloneDevOutFile?: string;
374
- standalonePreviewOutFile?: string;
375
- }
376
- interface BuildResult {
377
- outputPath: string;
378
- buildTime: number;
379
- size: number;
380
- }
381
-
382
402
  type TestEnvironment = 'node' | 'jsdom' | 'happy-dom' | 'edge-runtime';
383
403
  type TestCoverageProvider = 'v8' | 'istanbul';
384
404
  type TestCoverageReporter = 'text' | 'json' | 'html' | 'lcov' | 'lcovonly' | 'coverage-final.json' | 'clover';
@@ -432,4 +452,4 @@ interface TestOptions {
432
452
  env?: Record<string, string>;
433
453
  }
434
454
 
435
- export { type BuildOptions, type BuildResult, Child, type ClientConfig, type DevServer, type DevServerOptions, type HMRMessage, type PreviewOptions, type ProxyConfig, type Router, type StateManager, type TestCoverageOptions, type TestCoverageProvider, type TestCoverageReporter, type TestEnvironment, type TestOptions, type WebSocketConnection, type WebSocketEndpointConfig, type WebSocketEndpointContext, type WebSocketEndpointHandler, type WebSocketRequest, type WorkerConfig };
455
+ export { type BuildOptions, type BuildResult, Child, type ClientConfig, type DevServer, type DevServerOptions, type HMRMessage, type PreviewOptions, type ProxyConfig, type ResolveConfig, type Router, type StateManager, type TestCoverageOptions, type TestCoverageProvider, type TestCoverageReporter, type TestEnvironment, type TestOptions, type WebSocketConnection, type WebSocketEndpointConfig, type WebSocketEndpointContext, type WebSocketEndpointHandler, type WebSocketRequest, type WorkerConfig };
package/dist/wss.cjs CHANGED
@@ -3,8 +3,13 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __esm = (fn, res) => function __init() {
7
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
+ var __esm = (fn, res, err) => function __init() {
7
+ if (err) throw err[0];
8
+ try {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ } catch (e) {
11
+ throw err = [e], e;
12
+ }
8
13
  };
9
14
  var __export = (target, all) => {
10
15
  for (var name in all)
package/dist/wss.js CHANGED
@@ -10,8 +10,13 @@
10
10
  if (typeof require !== "undefined") return require.apply(this, arguments);
11
11
  throw Error('Dynamic require of "' + x + '" is not supported');
12
12
  });
13
- var __esm = (fn, res) => function __init() {
14
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
13
+ var __esm = (fn, res, err) => function __init() {
14
+ if (err) throw err[0];
15
+ try {
16
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
+ } catch (e) {
18
+ throw err = [e], e;
19
+ }
15
20
  };
16
21
  var __export = (target, all) => {
17
22
  for (var name in all)
package/dist/wss.mjs CHANGED
@@ -9,8 +9,13 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
9
9
  if (typeof require !== "undefined") return require.apply(this, arguments);
10
10
  throw Error('Dynamic require of "' + x + '" is not supported');
11
11
  });
12
- var __esm = (fn, res) => function __init() {
13
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
12
+ var __esm = (fn, res, err) => function __init() {
13
+ if (err) throw err[0];
14
+ try {
15
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
+ } catch (e) {
17
+ throw err = [e], e;
18
+ }
14
19
  };
15
20
  var __export = (target, all) => {
16
21
  for (var name in all)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elit",
3
- "version": "3.6.9",
3
+ "version": "3.7.1",
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",
@@ -271,8 +271,10 @@
271
271
  },
272
272
  "homepage": "https://d-osc.github.io/elit/",
273
273
  "dependencies": {
274
- "esbuild": "^0.27.3",
274
+ "acorn": "^8.14.0",
275
+ "esbuild": "^0.28.1",
275
276
  "esbuild-obfuscator-plugin": "^0.0.5",
277
+ "magic-string": "^0.30.17",
276
278
  "open": "^11.0.0",
277
279
  "smtp-server": "^3.18.4",
278
280
  "source-map": "^0.7.6"
@@ -290,6 +292,9 @@
290
292
  "tsup": "^8.0.0",
291
293
  "typescript": "^5.3.0"
292
294
  },
295
+ "overrides": {
296
+ "esbuild": "^0.28.1"
297
+ },
293
298
  "files": [
294
299
  "dist/*.cjs",
295
300
  "dist/*.mjs",