elit 3.6.6 → 3.6.8

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 (155) hide show
  1. package/Cargo.lock +1 -1
  2. package/Cargo.toml +1 -1
  3. package/README.md +20 -1
  4. package/dist/build.cjs +421 -331
  5. package/dist/build.d.ts +1 -19
  6. package/dist/build.js +420 -330
  7. package/dist/build.mjs +420 -330
  8. package/dist/chokidar.cjs +219 -182
  9. package/dist/chokidar.d.ts +25 -10
  10. package/dist/chokidar.js +217 -182
  11. package/dist/chokidar.mjs +218 -183
  12. package/dist/cli.cjs +25197 -22128
  13. package/dist/cli.d.ts +19 -37
  14. package/dist/cli.mjs +26668 -23614
  15. package/dist/config.cjs +357 -350
  16. package/dist/config.d.ts +17 -245
  17. package/dist/config.js +520 -515
  18. package/dist/config.mjs +346 -341
  19. package/dist/contracts-D7KIS-TK.d.ts +36 -0
  20. package/dist/contracts-_0p1-15U.d.ts +54 -0
  21. package/dist/coverage.cjs +448 -485
  22. package/dist/coverage.d.ts +13 -62
  23. package/dist/coverage.js +447 -484
  24. package/dist/coverage.mjs +447 -484
  25. package/dist/database.cjs +819 -828
  26. package/dist/database.d.ts +8 -24
  27. package/dist/database.js +818 -829
  28. package/dist/database.mjs +818 -829
  29. package/dist/desktop-auto-render.cjs +1700 -1523
  30. package/dist/desktop-auto-render.d.ts +4 -12
  31. package/dist/desktop-auto-render.js +1695 -1518
  32. package/dist/desktop-auto-render.mjs +1696 -1519
  33. package/dist/desktop.cjs +3 -1
  34. package/dist/desktop.d.ts +4 -1
  35. package/dist/desktop.js +1 -1
  36. package/dist/desktop.mjs +1 -1
  37. package/dist/dev-build.cjs +830 -0
  38. package/dist/dev-build.d.ts +53 -0
  39. package/dist/dev-build.js +3318 -0
  40. package/dist/dev-build.mjs +797 -0
  41. package/dist/dom.cjs +717 -591
  42. package/dist/dom.d.ts +2 -17
  43. package/dist/dom.js +714 -588
  44. package/dist/dom.mjs +716 -590
  45. package/dist/el.cjs +62 -52
  46. package/dist/el.d.ts +5 -12
  47. package/dist/el.js +60 -52
  48. package/dist/el.mjs +60 -52
  49. package/dist/fs.cjs +72 -63
  50. package/dist/fs.d.ts +22 -19
  51. package/dist/fs.js +71 -62
  52. package/dist/fs.mjs +71 -62
  53. package/dist/hmr.cjs +40 -14
  54. package/dist/hmr.d.ts +11 -23
  55. package/dist/hmr.js +38 -14
  56. package/dist/hmr.mjs +38 -14
  57. package/dist/http.cjs +411 -140
  58. package/dist/http.d.ts +40 -112
  59. package/dist/http.js +409 -140
  60. package/dist/http.mjs +409 -140
  61. package/dist/https.cjs +716 -272
  62. package/dist/https.d.ts +46 -41
  63. package/dist/https.js +712 -270
  64. package/dist/https.mjs +714 -272
  65. package/dist/index.cjs +7502 -7691
  66. package/dist/index.d.ts +6 -3
  67. package/dist/index.js +7486 -7677
  68. package/dist/index.mjs +7497 -7687
  69. package/dist/mime-types.cjs +10 -4
  70. package/dist/mime-types.d.ts +8 -11
  71. package/dist/mime-types.js +9 -3
  72. package/dist/mime-types.mjs +9 -3
  73. package/dist/native.cjs +8616 -8870
  74. package/dist/native.d.ts +7 -10
  75. package/dist/native.js +8682 -8936
  76. package/dist/native.mjs +8615 -8869
  77. package/dist/path.cjs +83 -77
  78. package/dist/path.d.ts +29 -29
  79. package/dist/path.js +82 -76
  80. package/dist/path.mjs +82 -76
  81. package/dist/pm-node-shared-listener-bootstrap.cjs +75 -0
  82. package/dist/pm.cjs +5267 -0
  83. package/dist/pm.d.ts +331 -0
  84. package/dist/pm.js +7575 -0
  85. package/dist/pm.mjs +5148 -0
  86. package/dist/preview-build.cjs +712 -0
  87. package/dist/preview-build.d.ts +59 -0
  88. package/dist/preview-build.js +3194 -0
  89. package/dist/preview-build.mjs +676 -0
  90. package/dist/render-context.cjs +13 -2
  91. package/dist/render-context.d.ts +9 -34
  92. package/dist/render-context.js +11 -2
  93. package/dist/render-context.mjs +11 -2
  94. package/dist/router.cjs +787 -646
  95. package/dist/router.d.ts +8 -14
  96. package/dist/router.js +786 -645
  97. package/dist/router.mjs +786 -645
  98. package/dist/runtime.cjs +1 -1
  99. package/dist/runtime.js +1 -1
  100. package/dist/runtime.mjs +1 -1
  101. package/dist/server.cjs +3702 -2883
  102. package/dist/server.d.ts +47 -5
  103. package/dist/server.js +4007 -3165
  104. package/dist/server.mjs +3665 -2848
  105. package/dist/smtp-server.cjs +16 -3
  106. package/dist/smtp-server.d.ts +12 -26
  107. package/dist/smtp-server.js +55 -17
  108. package/dist/smtp-server.mjs +16 -3
  109. package/dist/state.cjs +768 -659
  110. package/dist/state.d.ts +11 -71
  111. package/dist/state.js +760 -651
  112. package/dist/state.mjs +767 -658
  113. package/dist/style.cjs +1011 -968
  114. package/dist/style.d.ts +13 -127
  115. package/dist/style.js +1009 -970
  116. package/dist/style.mjs +1011 -971
  117. package/dist/test-reporter.cjs +332 -316
  118. package/dist/test-reporter.d.ts +28 -33
  119. package/dist/test-reporter.js +328 -312
  120. package/dist/test-reporter.mjs +328 -312
  121. package/dist/test-runtime.cjs +927 -968
  122. package/dist/test-runtime.d.ts +24 -99
  123. package/dist/test-runtime.js +922 -965
  124. package/dist/test-runtime.mjs +922 -965
  125. package/dist/test.cjs +4428 -4273
  126. package/dist/test.d.ts +2 -8
  127. package/dist/test.js +4307 -4154
  128. package/dist/test.mjs +4419 -4267
  129. package/dist/types-BONVzPtp.d.ts +59 -0
  130. package/dist/types-BR4wMiVx.d.ts +32 -0
  131. package/dist/types-BayMVo_k.d.ts +278 -0
  132. package/dist/types-C4gKykuG.d.ts +23 -0
  133. package/dist/types-C70T-42Z.d.ts +64 -0
  134. package/dist/types-Ckj8md_j.d.ts +84 -0
  135. package/dist/types-CpjQTAkX.d.ts +24 -0
  136. package/dist/types-D0LjrYjS.d.ts +14 -0
  137. package/dist/types-DPOgoGs-.d.ts +81 -0
  138. package/dist/types-fiLday0L.d.ts +199 -0
  139. package/dist/types.d.ts +54 -237
  140. package/dist/universal.cjs +1 -1
  141. package/dist/universal.d.ts +1 -7
  142. package/dist/universal.js +1 -1
  143. package/dist/universal.mjs +1 -1
  144. package/dist/websocket-BLBEAnhp.d.ts +119 -0
  145. package/dist/ws.cjs +129 -108
  146. package/dist/ws.d.ts +21 -131
  147. package/dist/ws.js +128 -109
  148. package/dist/ws.mjs +128 -109
  149. package/dist/wss.cjs +938 -512
  150. package/dist/wss.d.ts +31 -28
  151. package/dist/wss.js +932 -508
  152. package/dist/wss.mjs +936 -512
  153. package/package.json +18 -6
  154. package/vendor/epaint-0.31.1/src/image.rs +418 -0
  155. package/dist/server-uMQvZAll.d.ts +0 -458
package/dist/config.d.ts CHANGED
@@ -1,267 +1,39 @@
1
- import { D as DevServerOptions, B as BuildOptions, P as PreviewOptions, T as TestOptions } from './server-uMQvZAll.js';
2
- import './http.js';
1
+ import { E as ElitConfig } from './types-BayMVo_k.js';
2
+ export { D as DesktopConfig, h as DesktopMode, i as DesktopNativeConfig, M as MobileAndroidConfig, j as MobileConfig, k as MobileIosConfig, l as MobileMode, m as MobileNativeAndroidConfig, n as MobileNativeConfig, o as MobileNativeIosConfig, g as PmAppConfig, f as PmConfig, p as PmHealthCheckConfig, d as PmMemoryAction, b as PmProxyConfig, a as PmProxyStrategy, c as PmRestartPolicy, P as PmRuntimeName, q as WapkConfig, e as WapkGoogleDriveConfig, r as WapkLiveSyncConfig, s as WapkLockConfig, W as WapkRunConfig, t as defineConfig } from './types-BayMVo_k.js';
3
+ import './types-fiLday0L.js';
4
+ import './types-DPOgoGs-.js';
3
5
  import 'node:events';
4
- import './ws.js';
6
+ import './websocket-BLBEAnhp.js';
5
7
  import 'events';
6
8
  import 'http';
7
9
  import 'ws';
8
- import './smtp-server.js';
10
+ import './types-BR4wMiVx.js';
11
+ import './types-C4gKykuG.js';
9
12
  import 'net';
10
13
  import 'smtp-server';
14
+ import './contracts-D7KIS-TK.js';
15
+ import './contracts-_0p1-15U.js';
16
+
17
+ declare const ELIT_CONFIG_FILES: readonly ["elit.config.ts", "elit.config.mts", "elit.config.js", "elit.config.mjs", "elit.config.cjs", "elit.config.json"];
11
18
 
12
19
  /**
13
- * Config loader for elit.config.{ts,mts,js,mjs,cjs,json}
20
+ * Load environment variables from .env files
14
21
  */
22
+ declare function loadEnv(mode?: string, cwd?: string): Record<string, string>;
15
23
 
16
- interface ElitConfig {
17
- /** Development server configuration */
18
- dev?: DevServerOptions;
19
- /** Build configuration - supports single build or multiple builds */
20
- build?: BuildOptions | BuildOptions[];
21
- /** Preview server configuration */
22
- preview?: PreviewOptions;
23
- /** Test configuration */
24
- test?: TestOptions;
25
- /** Desktop command configuration */
26
- desktop?: DesktopConfig;
27
- /** Mobile command configuration */
28
- mobile?: MobileConfig;
29
- /** Process manager configuration */
30
- pm?: PmConfig;
31
- /** WAPK packaging configuration */
32
- wapk?: WapkConfig;
33
- }
34
- type MobileMode = 'native' | 'hybrid';
35
- type DesktopMode = 'native' | 'hybrid';
36
- type PmRuntimeName = 'node' | 'bun' | 'deno';
37
- type PmRestartPolicy = 'always' | 'on-failure' | 'never';
38
- interface PmHealthCheckConfig {
39
- /** HTTP endpoint polled while the process is online */
40
- url?: string;
41
- /** Delay before the first health check in milliseconds */
42
- gracePeriod?: number;
43
- /** Interval between health checks in milliseconds */
44
- interval?: number;
45
- /** Per-request timeout in milliseconds */
46
- timeout?: number;
47
- /** Consecutive failed checks before the process is restarted */
48
- maxFailures?: number;
49
- }
50
- interface PmAppConfig {
51
- /** Unique process name used by elit pm list/stop/restart */
52
- name: string;
53
- /** Shell command to execute, for example: npm start */
54
- script?: string;
55
- /** JavaScript or TypeScript entry file executed by the selected runtime */
56
- file?: string;
57
- /** Packaged .wapk file or remote archive source executed through elit wapk run */
58
- wapk?: string;
59
- /** Runtime used for file or wapk targets */
60
- runtime?: PmRuntimeName;
61
- /** Working directory for the managed process */
62
- cwd?: string;
63
- /** Extra environment variables injected into the process */
64
- env?: Record<string, string | number | boolean>;
65
- /** Disable automatic restart when the process exits */
66
- autorestart?: boolean;
67
- /** Delay between restart attempts in milliseconds */
68
- restartDelay?: number;
69
- /** Maximum restart attempts before marking the process as errored */
70
- maxRestarts?: number;
71
- /** Password forwarded to elit wapk run for locked archives */
72
- password?: string;
73
- /** Extra WAPK run settings, including direct Google Drive access and live-sync options */
74
- wapkRun?: WapkRunConfig;
75
- /** Restart strategy used after the child process exits */
76
- restartPolicy?: PmRestartPolicy;
77
- /** Minimum healthy uptime before restart attempt counters reset */
78
- minUptime?: number;
79
- /** Restart the process when watched files change */
80
- watch?: boolean;
81
- /** Files or directories watched when watch mode is enabled */
82
- watchPaths?: string[];
83
- /** Glob-like patterns ignored by watch mode */
84
- watchIgnore?: string[];
85
- /** Debounce delay before restarting after a file change */
86
- watchDebounce?: number;
87
- /** Optional HTTP health checks for long-running services */
88
- healthCheck?: PmHealthCheckConfig;
89
- }
90
- interface PmConfig {
91
- /** Directory used to store pm metadata and log files (default: ./.elit/pm) */
92
- dataDir?: string;
93
- /** File used by pm save/resurrect (default: <dataDir>/dump.json) */
94
- dumpFile?: string;
95
- /** Managed applications available to elit pm start */
96
- apps?: PmAppConfig[];
97
- }
98
- interface MobileConfig {
99
- /** Project directory for native mobile artifacts */
100
- cwd?: string;
101
- /** Native app bundle identifier */
102
- appId?: string;
103
- /** Native app display name */
104
- appName?: string;
105
- /** Built web assets directory synced into native projects */
106
- webDir?: string;
107
- /** Mobile runtime mode: native uses generated UI, hybrid keeps the WebView shell active */
108
- mode?: MobileMode;
109
- /** Mobile app icon image path (recommended: .png or .webp) */
110
- icon?: string;
111
- /** Android permissions written to AndroidManifest uses-permission tags */
112
- permissions?: string[];
113
- /** Platform-specific Android CLI defaults */
114
- android?: MobileAndroidConfig;
115
- /** Platform-specific iOS CLI defaults */
116
- ios?: MobileIosConfig;
117
- /** Optional native UI generation targets using the same Elit syntax */
118
- native?: MobileNativeConfig;
119
- }
120
- interface MobileAndroidConfig {
121
- /** Default Android device/emulator id used when --target is omitted */
122
- target?: string;
123
- }
124
- interface MobileIosConfig {
125
- /** Default iOS simulator name, UDID, booted alias, or full xcodebuild destination */
126
- target?: string;
127
- }
128
- interface MobileNativeConfig {
129
- /** Elit entry file that exports a VNode tree or zero-argument factory */
130
- entry?: string;
131
- /** Explicit export name to read from the native entry module */
132
- exportName?: string;
133
- /** Android-specific native generation options */
134
- android?: MobileNativeAndroidConfig;
135
- /** iOS-specific native generation options */
136
- ios?: MobileNativeIosConfig;
137
- }
138
- interface MobileNativeAndroidConfig {
139
- /** Disable Android native code generation while keeping iOS enabled */
140
- enabled?: boolean;
141
- /** Kotlin package name for generated native screen files */
142
- packageName?: string;
143
- /** Output file path for generated Compose screen, relative to mobile.cwd */
144
- output?: string;
145
- }
146
- interface MobileNativeIosConfig {
147
- /** Disable iOS native code generation while keeping Android enabled */
148
- enabled?: boolean;
149
- /** Output file path for generated SwiftUI file, relative to mobile.cwd */
150
- output?: string;
151
- }
152
- interface DesktopConfig {
153
- /** Desktop runtime mode: native prefers desktop.native.entry and hybrid prefers desktop.entry */
154
- mode?: DesktopMode;
155
- /** Desktop entry file used when the CLI command omits <entry> in hybrid mode */
156
- entry?: string;
157
- /** Optional prebuilt hybrid desktop runtime binary path, relative to the current project when not absolute */
158
- binaryPath?: string;
159
- /** Optional Cargo target directory override for desktop runtime builds */
160
- cargoTargetDir?: string;
161
- /** Optional native desktop entry defaults */
162
- native?: DesktopNativeConfig;
163
- /** Optional prebuilt native desktop runtime binary path, relative to the current project when not absolute */
164
- nativeBinaryPath?: string;
165
- /** Native desktop runtime: quickjs, bun, node, deno */
166
- runtime?: 'quickjs' | 'bun' | 'node' | 'deno';
167
- /** Desktop entry compiler: auto, none, esbuild, tsx, tsup */
168
- compiler?: 'auto' | 'none' | 'esbuild' | 'tsx' | 'tsup';
169
- /** Build or run with release desktop runtime */
170
- release?: boolean;
171
- /** Desktop build output directory */
172
- outDir?: string;
173
- /** Desktop build target platform */
174
- platform?: 'windows' | 'win' | 'windows-arm' | 'win-arm' | 'linux' | 'linux-musl' | 'linux-arm' | 'macos' | 'mac' | 'darwin' | 'macos-arm' | 'mac-arm';
175
- /** Desktop WAPK mode defaults */
176
- wapk?: {
177
- /** Packaged runtime to execute inside desktop mode */
178
- runtime?: 'node' | 'bun' | 'deno';
179
- /** Polling interval for WAPK live sync */
180
- syncInterval?: number;
181
- /** Use event-driven file watcher for WAPK live sync */
182
- useWatcher?: boolean;
183
- /** Use release desktop runtime binary */
184
- release?: boolean;
185
- };
186
- }
187
- interface DesktopNativeConfig {
188
- /** Elit entry file used when desktop.mode is native or --mode native is passed */
189
- entry?: string;
190
- /** Explicit export name to read from the desktop native entry module */
191
- exportName?: string;
192
- }
193
- interface WapkLockConfig {
194
- /** Plain-text password used to encrypt the archive */
195
- password?: string;
196
- }
197
- interface WapkLiveSyncConfig {
198
- /** Polling interval for live sync writes back into the archive */
199
- syncInterval?: number;
200
- /** Use event-driven file watching for local workdir changes */
201
- useWatcher?: boolean;
202
- /** Pull archive changes back into the temp workdir */
203
- watchArchive?: boolean;
204
- /** Polling interval for reading external archive changes */
205
- archiveSyncInterval?: number;
206
- }
207
- interface WapkGoogleDriveConfig {
208
- /** Google Drive file id for the remote .wapk archive */
209
- fileId?: string;
210
- /** OAuth access token used for Google Drive API calls */
211
- accessToken?: string;
212
- /** Environment variable name that contains the OAuth access token */
213
- accessTokenEnv?: string;
214
- /** Include supportsAllDrives=true when accessing shared drive files */
215
- supportsAllDrives?: boolean;
216
- }
217
- interface WapkRunConfig extends WapkLiveSyncConfig {
218
- /** Default archive file used by elit wapk run when no file argument is provided */
219
- file?: string;
220
- /** Remote Google Drive archive used by elit wapk run */
221
- googleDrive?: WapkGoogleDriveConfig;
222
- /** Create an online Elit Run shared session instead of starting the local runtime */
223
- online?: boolean;
224
- /** Elit Run base URL used when online hosting targets a non-default origin */
225
- onlineUrl?: string;
226
- /** Default runtime override used by elit wapk run */
227
- runtime?: 'node' | 'bun' | 'deno';
228
- /** Default password used to unlock a locked archive at runtime */
229
- password?: string;
230
- }
231
- interface WapkConfig {
232
- name?: string;
233
- version?: string;
234
- runtime?: string;
235
- engine?: string;
236
- entry?: string;
237
- scripts?: Record<string, string>;
238
- /** Stable logical app identifier embedded into the WAPK header */
239
- appId?: string;
240
- /** Stable publisher or owner identifier embedded into the WAPK header */
241
- publisherId?: string;
242
- port?: number;
243
- env?: Record<string, string | number | boolean>;
244
- desktop?: Record<string, unknown>;
245
- lock?: WapkLockConfig;
246
- run?: WapkRunConfig;
247
- }
248
24
  /**
249
- * Helper function for type-safe config definition
25
+ * Config loader for elit.config.{ts,mts,js,mjs,cjs,json}
250
26
  */
251
- declare function defineConfig(config: ElitConfig): ElitConfig;
252
- declare const ELIT_CONFIG_FILES: readonly ["elit.config.ts", "elit.config.mts", "elit.config.js", "elit.config.mjs", "elit.config.cjs", "elit.config.json"];
27
+
253
28
  declare function resolveConfigPath(cwd?: string): string | null;
254
- /**
255
- * Load environment variables from .env files
256
- */
257
- declare function loadEnv(mode?: string, cwd?: string): Record<string, string>;
258
29
  /**
259
30
  * Load elit config from current directory
260
31
  */
261
32
  declare function loadConfig(cwd?: string): Promise<ElitConfig | null>;
33
+
262
34
  /**
263
35
  * Merge CLI args with config file
264
36
  */
265
37
  declare function mergeConfig<T extends Record<string, any>>(config: T | undefined, cliArgs: Partial<T>): T;
266
38
 
267
- export { type DesktopConfig, type DesktopMode, type DesktopNativeConfig, ELIT_CONFIG_FILES, type ElitConfig, type MobileAndroidConfig, type MobileConfig, type MobileIosConfig, type MobileMode, type MobileNativeAndroidConfig, type MobileNativeConfig, type MobileNativeIosConfig, type PmAppConfig, type PmConfig, type PmHealthCheckConfig, type PmRestartPolicy, type PmRuntimeName, type WapkConfig, type WapkGoogleDriveConfig, type WapkLiveSyncConfig, type WapkLockConfig, type WapkRunConfig, defineConfig, loadConfig, loadEnv, mergeConfig, resolveConfigPath };
39
+ export { ELIT_CONFIG_FILES, ElitConfig, loadConfig, loadEnv, mergeConfig, resolveConfigPath };