elit 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +436 -237
  2. package/dist/build.d.mts +10 -1
  3. package/dist/build.d.ts +10 -1
  4. package/dist/build.js +670 -1
  5. package/dist/build.mjs +641 -1
  6. package/dist/chokidar.d.mts +134 -0
  7. package/dist/chokidar.d.ts +134 -0
  8. package/dist/chokidar.js +240 -0
  9. package/dist/chokidar.mjs +221 -0
  10. package/dist/cli.js +2792 -495
  11. package/dist/dom.d.mts +10 -3
  12. package/dist/dom.d.ts +10 -3
  13. package/dist/dom.js +676 -1
  14. package/dist/dom.mjs +647 -1
  15. package/dist/el.d.mts +16 -36
  16. package/dist/el.d.ts +16 -36
  17. package/dist/el.js +789 -1
  18. package/dist/el.mjs +583 -1
  19. package/dist/fs.d.mts +255 -0
  20. package/dist/fs.d.ts +255 -0
  21. package/dist/fs.js +513 -0
  22. package/dist/fs.mjs +469 -0
  23. package/dist/hmr.js +112 -1
  24. package/dist/hmr.mjs +91 -1
  25. package/dist/http.d.mts +163 -0
  26. package/dist/http.d.ts +163 -0
  27. package/dist/http.js +632 -0
  28. package/dist/http.mjs +605 -0
  29. package/dist/https.d.mts +108 -0
  30. package/dist/https.d.ts +108 -0
  31. package/dist/https.js +907 -0
  32. package/dist/https.mjs +901 -0
  33. package/dist/index.d.mts +613 -33
  34. package/dist/index.d.ts +613 -33
  35. package/dist/index.js +2589 -1
  36. package/dist/index.mjs +2312 -1
  37. package/dist/mime-types.d.mts +48 -0
  38. package/dist/mime-types.d.ts +48 -0
  39. package/dist/mime-types.js +197 -0
  40. package/dist/mime-types.mjs +166 -0
  41. package/dist/path.d.mts +163 -0
  42. package/dist/path.d.ts +163 -0
  43. package/dist/path.js +350 -0
  44. package/dist/path.mjs +310 -0
  45. package/dist/router.d.mts +3 -1
  46. package/dist/router.d.ts +3 -1
  47. package/dist/router.js +830 -1
  48. package/dist/router.mjs +801 -1
  49. package/dist/runtime.d.mts +97 -0
  50. package/dist/runtime.d.ts +97 -0
  51. package/dist/runtime.js +43 -0
  52. package/dist/runtime.mjs +15 -0
  53. package/dist/server.d.mts +5 -1
  54. package/dist/server.d.ts +5 -1
  55. package/dist/server.js +3267 -1
  56. package/dist/server.mjs +3241 -1
  57. package/dist/state.d.mts +3 -1
  58. package/dist/state.d.ts +3 -1
  59. package/dist/state.js +1036 -1
  60. package/dist/state.mjs +992 -1
  61. package/dist/style.d.mts +47 -1
  62. package/dist/style.d.ts +47 -1
  63. package/dist/style.js +551 -1
  64. package/dist/style.mjs +483 -1
  65. package/dist/{types-DOAdFFJB.d.ts → types-C0nGi6MX.d.mts} +29 -13
  66. package/dist/{types-DOAdFFJB.d.mts → types-Du6kfwTm.d.ts} +29 -13
  67. package/dist/types.d.mts +452 -3
  68. package/dist/types.d.ts +452 -3
  69. package/dist/types.js +18 -1
  70. package/dist/ws.d.mts +195 -0
  71. package/dist/ws.d.ts +195 -0
  72. package/dist/ws.js +380 -0
  73. package/dist/ws.mjs +358 -0
  74. package/dist/wss.d.mts +108 -0
  75. package/dist/wss.d.ts +108 -0
  76. package/dist/wss.js +1306 -0
  77. package/dist/wss.mjs +1300 -0
  78. package/package.json +53 -6
  79. package/dist/client.d.mts +0 -9
  80. package/dist/client.d.ts +0 -9
  81. package/dist/client.js +0 -1
  82. package/dist/client.mjs +0 -1
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Runtime detection and global type declarations
3
+ * Shared across all modules for consistency
4
+ */
5
+ /**
6
+ * Runtime detection (cached at module load)
7
+ */
8
+ declare const runtime: "node" | "bun" | "deno";
9
+ declare const isNode: boolean;
10
+ declare const isBun: boolean;
11
+ declare const isDeno: boolean;
12
+ declare global {
13
+ const Bun: {
14
+ build(options: {
15
+ entrypoints: string[];
16
+ outdir?: string;
17
+ target?: string;
18
+ format?: string;
19
+ minify?: boolean;
20
+ sourcemap?: string;
21
+ external?: string[];
22
+ naming?: string;
23
+ plugins?: any[];
24
+ define?: Record<string, string>;
25
+ }): Promise<{
26
+ success: boolean;
27
+ outputs: Array<{
28
+ path: string;
29
+ size: number;
30
+ }>;
31
+ logs: any[];
32
+ }>;
33
+ Transpiler: new (options?: {
34
+ loader?: string;
35
+ target?: string;
36
+ minify?: boolean;
37
+ }) => {
38
+ transform(code: string, loader?: string): Promise<string>;
39
+ transformSync(code: string, loader?: string): string;
40
+ };
41
+ file(path: string): {
42
+ size: number;
43
+ arrayBuffer(): ArrayBuffer | Promise<ArrayBuffer>;
44
+ exists(): Promise<boolean>;
45
+ };
46
+ write(path: string, data: string | Buffer | Uint8Array): Promise<void>;
47
+ } | undefined;
48
+ const Deno: {
49
+ emit(rootSpecifier: string | URL, options?: {
50
+ bundle?: 'module' | 'classic';
51
+ check?: boolean;
52
+ compilerOptions?: any;
53
+ importMap?: string;
54
+ importMapPath?: string;
55
+ sources?: Record<string, string>;
56
+ }): Promise<{
57
+ files: Record<string, string>;
58
+ diagnostics: any[];
59
+ }>;
60
+ writeTextFile(path: string, data: string): Promise<void>;
61
+ readFile(path: string): Promise<Uint8Array>;
62
+ readFileSync(path: string): Uint8Array;
63
+ writeFile(path: string, data: Uint8Array): Promise<void>;
64
+ writeFileSync(path: string, data: Uint8Array): void;
65
+ stat(path: string): Promise<any>;
66
+ statSync(path: string): any;
67
+ mkdir(path: string, options?: {
68
+ recursive?: boolean;
69
+ }): Promise<void>;
70
+ mkdirSync(path: string, options?: {
71
+ recursive?: boolean;
72
+ }): void;
73
+ readDir(path: string): AsyncIterable<any>;
74
+ readDirSync(path: string): Iterable<any>;
75
+ remove(path: string, options?: {
76
+ recursive?: boolean;
77
+ }): Promise<void>;
78
+ removeSync(path: string, options?: {
79
+ recursive?: boolean;
80
+ }): void;
81
+ rename(oldPath: string, newPath: string): Promise<void>;
82
+ renameSync(oldPath: string, newPath: string): void;
83
+ copyFile(src: string, dest: string): Promise<void>;
84
+ copyFileSync(src: string, dest: string): void;
85
+ realPath(path: string): Promise<string>;
86
+ realPathSync(path: string): string;
87
+ watchFs(paths: string | string[]): AsyncIterable<{
88
+ kind: string;
89
+ paths: string[];
90
+ }>;
91
+ build: {
92
+ os: string;
93
+ };
94
+ } | undefined;
95
+ }
96
+
97
+ export { isBun, isDeno, isNode, runtime };
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Runtime detection and global type declarations
3
+ * Shared across all modules for consistency
4
+ */
5
+ /**
6
+ * Runtime detection (cached at module load)
7
+ */
8
+ declare const runtime: "node" | "bun" | "deno";
9
+ declare const isNode: boolean;
10
+ declare const isBun: boolean;
11
+ declare const isDeno: boolean;
12
+ declare global {
13
+ const Bun: {
14
+ build(options: {
15
+ entrypoints: string[];
16
+ outdir?: string;
17
+ target?: string;
18
+ format?: string;
19
+ minify?: boolean;
20
+ sourcemap?: string;
21
+ external?: string[];
22
+ naming?: string;
23
+ plugins?: any[];
24
+ define?: Record<string, string>;
25
+ }): Promise<{
26
+ success: boolean;
27
+ outputs: Array<{
28
+ path: string;
29
+ size: number;
30
+ }>;
31
+ logs: any[];
32
+ }>;
33
+ Transpiler: new (options?: {
34
+ loader?: string;
35
+ target?: string;
36
+ minify?: boolean;
37
+ }) => {
38
+ transform(code: string, loader?: string): Promise<string>;
39
+ transformSync(code: string, loader?: string): string;
40
+ };
41
+ file(path: string): {
42
+ size: number;
43
+ arrayBuffer(): ArrayBuffer | Promise<ArrayBuffer>;
44
+ exists(): Promise<boolean>;
45
+ };
46
+ write(path: string, data: string | Buffer | Uint8Array): Promise<void>;
47
+ } | undefined;
48
+ const Deno: {
49
+ emit(rootSpecifier: string | URL, options?: {
50
+ bundle?: 'module' | 'classic';
51
+ check?: boolean;
52
+ compilerOptions?: any;
53
+ importMap?: string;
54
+ importMapPath?: string;
55
+ sources?: Record<string, string>;
56
+ }): Promise<{
57
+ files: Record<string, string>;
58
+ diagnostics: any[];
59
+ }>;
60
+ writeTextFile(path: string, data: string): Promise<void>;
61
+ readFile(path: string): Promise<Uint8Array>;
62
+ readFileSync(path: string): Uint8Array;
63
+ writeFile(path: string, data: Uint8Array): Promise<void>;
64
+ writeFileSync(path: string, data: Uint8Array): void;
65
+ stat(path: string): Promise<any>;
66
+ statSync(path: string): any;
67
+ mkdir(path: string, options?: {
68
+ recursive?: boolean;
69
+ }): Promise<void>;
70
+ mkdirSync(path: string, options?: {
71
+ recursive?: boolean;
72
+ }): void;
73
+ readDir(path: string): AsyncIterable<any>;
74
+ readDirSync(path: string): Iterable<any>;
75
+ remove(path: string, options?: {
76
+ recursive?: boolean;
77
+ }): Promise<void>;
78
+ removeSync(path: string, options?: {
79
+ recursive?: boolean;
80
+ }): void;
81
+ rename(oldPath: string, newPath: string): Promise<void>;
82
+ renameSync(oldPath: string, newPath: string): void;
83
+ copyFile(src: string, dest: string): Promise<void>;
84
+ copyFileSync(src: string, dest: string): void;
85
+ realPath(path: string): Promise<string>;
86
+ realPathSync(path: string): string;
87
+ watchFs(paths: string | string[]): AsyncIterable<{
88
+ kind: string;
89
+ paths: string[];
90
+ }>;
91
+ build: {
92
+ os: string;
93
+ };
94
+ } | undefined;
95
+ }
96
+
97
+ export { isBun, isDeno, isNode, runtime };
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/runtime.ts
21
+ var runtime_exports = {};
22
+ __export(runtime_exports, {
23
+ isBun: () => isBun,
24
+ isDeno: () => isDeno,
25
+ isNode: () => isNode,
26
+ runtime: () => runtime
27
+ });
28
+ module.exports = __toCommonJS(runtime_exports);
29
+ var runtime = (() => {
30
+ if (typeof Deno !== "undefined") return "deno";
31
+ if (typeof Bun !== "undefined") return "bun";
32
+ return "node";
33
+ })();
34
+ var isNode = runtime === "node";
35
+ var isBun = runtime === "bun";
36
+ var isDeno = runtime === "deno";
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ isBun,
40
+ isDeno,
41
+ isNode,
42
+ runtime
43
+ });
@@ -0,0 +1,15 @@
1
+ // src/runtime.ts
2
+ var runtime = (() => {
3
+ if (typeof Deno !== "undefined") return "deno";
4
+ if (typeof Bun !== "undefined") return "bun";
5
+ return "node";
6
+ })();
7
+ var isNode = runtime === "node";
8
+ var isBun = runtime === "bun";
9
+ var isDeno = runtime === "deno";
10
+ export {
11
+ isBun,
12
+ isDeno,
13
+ isNode,
14
+ runtime
15
+ };
package/dist/server.d.mts CHANGED
@@ -1,3 +1,7 @@
1
+ import './http.mjs';
2
+ import './ws.mjs';
3
+ export { l as HttpMethod, M as Middleware, m as ServerRouteContext, n as ServerRouteHandler, o as ServerRouter, K as SharedState, I as SharedStateOptions, G as StateChangeHandler, L as StateManager, x as bodyLimit, y as cacheControl, z as compress, r as cors, N as createDevServer, F as createProxyHandler, v as errorHandler, q as html, p as json, u as logger, w as rateLimit, A as security, s as status, t as text } from './types-C0nGi6MX.mjs';
4
+ import 'node:events';
5
+ import 'events';
1
6
  import 'http';
2
7
  import 'ws';
3
- export { H as HttpMethod, M as Middleware, a as ServerRouteContext, b as ServerRouteHandler, S as ServerRouter, n as SharedState, o as SharedStateOptions, p as StateChangeHandler, m as StateManager, f as bodyLimit, g as cacheControl, i as compress, d as cors, c as createDevServer, L as createProxyHandler, e as errorHandler, h as html, j as json, l as logger, r as rateLimit, k as security, s as status, t as text } from './types-DOAdFFJB.mjs';
package/dist/server.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ import './http.js';
2
+ import './ws.js';
3
+ export { l as HttpMethod, M as Middleware, m as ServerRouteContext, n as ServerRouteHandler, o as ServerRouter, K as SharedState, I as SharedStateOptions, G as StateChangeHandler, L as StateManager, x as bodyLimit, y as cacheControl, z as compress, r as cors, N as createDevServer, F as createProxyHandler, v as errorHandler, q as html, p as json, u as logger, w as rateLimit, A as security, s as status, t as text } from './types-Du6kfwTm.js';
4
+ import 'node:events';
5
+ import 'events';
1
6
  import 'http';
2
7
  import 'ws';
3
- export { H as HttpMethod, M as Middleware, a as ServerRouteContext, b as ServerRouteHandler, S as ServerRouter, n as SharedState, o as SharedStateOptions, p as StateChangeHandler, m as StateManager, f as bodyLimit, g as cacheControl, i as compress, d as cors, c as createDevServer, L as createProxyHandler, e as errorHandler, h as html, j as json, l as logger, r as rateLimit, k as security, s as status, t as text } from './types-DOAdFFJB.js';