satset-react 0.4.7 → 0.4.9

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 (169) hide show
  1. package/dist/adapter/index.d.ts +4 -0
  2. package/dist/adapter/index.d.ts.map +1 -0
  3. package/dist/adapter/index.js +8 -0
  4. package/dist/adapter/index.js.map +1 -0
  5. package/dist/adapter/node.d.ts +3 -0
  6. package/dist/adapter/node.d.ts.map +1 -0
  7. package/dist/adapter/node.js +244 -0
  8. package/dist/adapter/node.js.map +1 -0
  9. package/dist/adapter/types.d.ts +24 -0
  10. package/dist/adapter/types.d.ts.map +1 -0
  11. package/dist/adapter/types.js +3 -0
  12. package/dist/adapter/types.js.map +1 -0
  13. package/dist/adapter/vercel.d.ts +10 -0
  14. package/dist/adapter/vercel.d.ts.map +1 -0
  15. package/dist/adapter/vercel.js +330 -0
  16. package/dist/adapter/vercel.js.map +1 -0
  17. package/dist/assets/favicon.d.ts +2 -0
  18. package/dist/assets/favicon.d.ts.map +1 -0
  19. package/dist/assets/favicon.js +67 -0
  20. package/dist/assets/favicon.js.map +1 -0
  21. package/dist/assets/index.d.ts +7 -0
  22. package/dist/assets/index.d.ts.map +1 -0
  23. package/dist/assets/index.js +31 -0
  24. package/dist/assets/index.js.map +1 -0
  25. package/dist/assets/metadata.d.ts +35 -0
  26. package/dist/assets/metadata.d.ts.map +1 -0
  27. package/dist/assets/metadata.js +75 -0
  28. package/dist/assets/metadata.js.map +1 -0
  29. package/dist/assets/robots.d.ts +23 -0
  30. package/dist/assets/robots.d.ts.map +1 -0
  31. package/dist/assets/robots.js +95 -0
  32. package/dist/assets/robots.js.map +1 -0
  33. package/dist/assets/sitemap.d.ts +19 -0
  34. package/dist/assets/sitemap.d.ts.map +1 -0
  35. package/dist/assets/sitemap.js +78 -0
  36. package/dist/assets/sitemap.js.map +1 -0
  37. package/dist/cli/commands.d.ts +5 -0
  38. package/dist/cli/commands.d.ts.map +1 -0
  39. package/dist/cli/commands.js +165 -0
  40. package/dist/cli/commands.js.map +1 -0
  41. package/dist/cli/index.d.ts +3 -0
  42. package/dist/cli/index.d.ts.map +1 -0
  43. package/dist/cli/index.js +40 -0
  44. package/dist/cli/index.js.map +1 -0
  45. package/dist/components/ErrorBoundary.d.ts +22 -0
  46. package/dist/components/ErrorBoundary.d.ts.map +1 -0
  47. package/dist/components/ErrorBoundary.js +61 -0
  48. package/dist/components/ErrorBoundary.js.map +1 -0
  49. package/dist/components/Image.d.ts +15 -0
  50. package/dist/components/Image.d.ts.map +1 -0
  51. package/dist/components/Image.js +67 -0
  52. package/dist/components/Image.js.map +1 -0
  53. package/dist/components/Link.d.ts +14 -0
  54. package/dist/components/Link.d.ts.map +1 -0
  55. package/dist/components/Link.js +66 -0
  56. package/dist/components/Link.js.map +1 -0
  57. package/dist/components/Script.d.ts +10 -0
  58. package/dist/components/Script.d.ts.map +1 -0
  59. package/dist/components/Script.js +60 -0
  60. package/dist/components/Script.js.map +1 -0
  61. package/dist/components/index.d.ts +6 -0
  62. package/dist/components/index.d.ts.map +1 -0
  63. package/dist/components/index.js +30 -0
  64. package/dist/components/index.js.map +1 -0
  65. package/dist/components/theme.d.ts +23 -0
  66. package/dist/components/theme.d.ts.map +1 -0
  67. package/dist/components/theme.js +118 -0
  68. package/dist/components/theme.js.map +1 -0
  69. package/dist/config.d.ts +23 -0
  70. package/dist/config.d.ts.map +1 -0
  71. package/dist/config.js +9 -0
  72. package/dist/config.js.map +1 -0
  73. package/dist/core/dynamic.d.ts +10 -0
  74. package/dist/core/dynamic.d.ts.map +1 -0
  75. package/dist/core/dynamic.js +51 -0
  76. package/dist/core/dynamic.js.map +1 -0
  77. package/dist/core/hydrate.d.ts +8 -0
  78. package/dist/core/hydrate.d.ts.map +1 -0
  79. package/dist/core/hydrate.js +81 -0
  80. package/dist/core/hydrate.js.map +1 -0
  81. package/dist/core/index.d.ts +10 -0
  82. package/dist/core/index.d.ts.map +1 -0
  83. package/dist/core/index.js +22 -0
  84. package/dist/core/index.js.map +1 -0
  85. package/dist/core/response.d.ts +26 -0
  86. package/dist/core/response.d.ts.map +1 -0
  87. package/dist/core/response.js +48 -0
  88. package/dist/core/response.js.map +1 -0
  89. package/dist/core/ssr.d.ts +29 -0
  90. package/dist/core/ssr.d.ts.map +1 -0
  91. package/dist/core/ssr.js +91 -0
  92. package/dist/core/ssr.js.map +1 -0
  93. package/dist/core/translation.d.ts +19 -0
  94. package/dist/core/translation.d.ts.map +1 -0
  95. package/dist/core/translation.js +84 -0
  96. package/dist/core/translation.js.map +1 -0
  97. package/dist/core/types.d.ts +47 -0
  98. package/dist/core/types.d.ts.map +1 -0
  99. package/dist/core/types.js +3 -0
  100. package/dist/core/types.js.map +1 -0
  101. package/dist/index.d.ts +7 -0
  102. package/dist/index.d.ts.map +1 -0
  103. package/dist/index.js +25 -0
  104. package/dist/index.js.map +1 -0
  105. package/dist/navigation/notFound.d.ts +3 -0
  106. package/dist/navigation/notFound.d.ts.map +1 -0
  107. package/dist/navigation/notFound.js +15 -0
  108. package/dist/navigation/notFound.js.map +1 -0
  109. package/dist/router/file-system.d.ts +19 -0
  110. package/dist/router/file-system.d.ts.map +1 -0
  111. package/dist/router/file-system.js +364 -0
  112. package/dist/router/file-system.js.map +1 -0
  113. package/dist/router/index.d.ts +3 -0
  114. package/dist/router/index.d.ts.map +1 -0
  115. package/dist/router/index.js +10 -0
  116. package/dist/router/index.js.map +1 -0
  117. package/dist/router/router.d.ts +17 -0
  118. package/dist/router/router.d.ts.map +1 -0
  119. package/dist/router/router.js +158 -0
  120. package/dist/router/router.js.map +1 -0
  121. package/dist/router/types.d.ts +11 -0
  122. package/dist/router/types.d.ts.map +1 -0
  123. package/dist/router/types.js +3 -0
  124. package/dist/router/types.js.map +1 -0
  125. package/dist/server/build.d.ts +5 -0
  126. package/dist/server/build.d.ts.map +1 -0
  127. package/dist/server/build.js +780 -0
  128. package/dist/server/build.js.map +1 -0
  129. package/dist/server/bundler.d.ts +28 -0
  130. package/dist/server/bundler.d.ts.map +1 -0
  131. package/dist/server/bundler.js +401 -0
  132. package/dist/server/bundler.js.map +1 -0
  133. package/dist/server/dev.d.ts +11 -0
  134. package/dist/server/dev.d.ts.map +1 -0
  135. package/dist/server/dev.js +1835 -0
  136. package/dist/server/dev.js.map +1 -0
  137. package/dist/server/env.d.ts +10 -0
  138. package/dist/server/env.d.ts.map +1 -0
  139. package/dist/server/env.js +102 -0
  140. package/dist/server/env.js.map +1 -0
  141. package/dist/server/error-overlay.d.ts +12 -0
  142. package/dist/server/error-overlay.d.ts.map +1 -0
  143. package/dist/server/error-overlay.js +396 -0
  144. package/dist/server/error-overlay.js.map +1 -0
  145. package/dist/server/hmr.d.ts +8 -0
  146. package/dist/server/hmr.d.ts.map +1 -0
  147. package/dist/server/hmr.js +166 -0
  148. package/dist/server/hmr.js.map +1 -0
  149. package/dist/server/index.d.ts +10 -0
  150. package/dist/server/index.d.ts.map +1 -0
  151. package/dist/server/index.js +25 -0
  152. package/dist/server/index.js.map +1 -0
  153. package/dist/server/response.d.ts +30 -0
  154. package/dist/server/response.d.ts.map +1 -0
  155. package/dist/server/response.js +238 -0
  156. package/dist/server/response.js.map +1 -0
  157. package/dist/server/storage.d.ts +13 -0
  158. package/dist/server/storage.d.ts.map +1 -0
  159. package/dist/server/storage.js +26 -0
  160. package/dist/server/storage.js.map +1 -0
  161. package/dist/server/tui.d.ts +23 -0
  162. package/dist/server/tui.d.ts.map +1 -0
  163. package/dist/server/tui.js +182 -0
  164. package/dist/server/tui.js.map +1 -0
  165. package/dist/server/types.d.ts +14 -0
  166. package/dist/server/types.d.ts.map +1 -0
  167. package/dist/server/types.js +3 -0
  168. package/dist/server/types.js.map +1 -0
  169. package/package.json +3 -2
@@ -0,0 +1,396 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateErrorOverlayHTML = generateErrorOverlayHTML;
4
+ exports.extractCodeSnippet = extractCodeSnippet;
5
+ function generateErrorOverlayHTML(error) {
6
+ const { message, file, line, code = [], stack, title: pageTitle } = error;
7
+ // Extract code snippet with error line highlighted
8
+ const title = pageTitle || 'Runtime Error';
9
+ const codeSnippet = code.length > 0
10
+ ? code.map((lineCode, idx) => {
11
+ const lineNum = (line || 0) - Math.floor(code.length / 2) + idx;
12
+ const isErrorLine = lineNum === line;
13
+ return `<div class="${isErrorLine ? 'line-err' : ''}" style="opacity: ${isErrorLine ? '1' : '0.5'}">
14
+ ${lineNum} | ${escapeHtml(lineCode)}
15
+ </div>`;
16
+ }).join('')
17
+ : '<div style="opacity: 0.5">No code preview available</div>';
18
+ return `
19
+ <!DOCTYPE html>
20
+ <html lang="id">
21
+ <head>
22
+ <meta charset="UTF-8">
23
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
24
+ <title>${title}</title>
25
+ <style>
26
+ :root {
27
+ --bg-blur: rgba(0, 0, 0, 0.85);
28
+ --card-bg: #111111;
29
+ --accent-red: #ff3333;
30
+ --accent-blue: #0070f3;
31
+ --accent-red-dim: rgba(255, 51, 51, 0.1);
32
+ --text-primary: #ffffff;
33
+ --text-secondary: #a0a0a0;
34
+ --code-bg: #050505;
35
+ --font-mono: 'JetBrains Mono', 'Fira Code', 'Menlo', monospace;
36
+ }
37
+
38
+ body {
39
+ margin: 0;
40
+ padding: 0;
41
+ background: #0a0a0a;
42
+ font-family: 'Inter', -apple-system, sans-serif;
43
+ color: var(--text-primary);
44
+ height: 100vh;
45
+ overflow: hidden;
46
+ }
47
+
48
+ .dev-badge {
49
+ position: fixed;
50
+ bottom: 24px;
51
+ left: 24px;
52
+ width: 52px;
53
+ height: 52px;
54
+ background: #222;
55
+ border-radius: 14px;
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ cursor: pointer;
60
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
61
+ z-index: 10000;
62
+ transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
63
+ border: 1px solid rgba(255, 255, 255, 0.1);
64
+ }
65
+
66
+ .dev-badge:hover {
67
+ transform: scale(1.1);
68
+ background: #333;
69
+ border-color: var(--accent-blue);
70
+ }
71
+
72
+ .dev-badge svg {
73
+ width: 24px;
74
+ height: 24px;
75
+ fill: var(--text-secondary);
76
+ transition: fill 0.3s;
77
+ }
78
+
79
+ .dev-badge:hover svg {
80
+ fill: var(--text-primary);
81
+ }
82
+
83
+ .overlay-wrapper {
84
+ position: fixed;
85
+ inset: 0;
86
+ background: var(--bg-blur);
87
+ backdrop-filter: blur(24px);
88
+ -webkit-backdrop-filter: blur(24px);
89
+ display: flex;
90
+ align-items: center;
91
+ justify-content: center;
92
+ padding: 20px;
93
+ z-index: 9999;
94
+ opacity: 0;
95
+ pointer-events: none;
96
+ transition: opacity 0.3s ease;
97
+ }
98
+
99
+ .overlay-wrapper.active {
100
+ opacity: 1;
101
+ pointer-events: auto;
102
+ }
103
+
104
+ .card {
105
+ width: 100%;
106
+ max-width: 900px;
107
+ background: var(--card-bg);
108
+ border-radius: 24px;
109
+ border: 1px solid rgba(255, 255, 255, 0.08);
110
+ box-shadow: 0 60px 120px rgba(0,0,0,0.9);
111
+ animation: slideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
112
+ }
113
+
114
+ @keyframes slideUp {
115
+ from { transform: translateY(30px); opacity: 0; }
116
+ to { transform: translateY(0); opacity: 1; }
117
+ }
118
+
119
+ .card-header {
120
+ padding: 24px 32px;
121
+ border-bottom: 1px solid rgba(255, 255, 255, 0.05);
122
+ display: flex;
123
+ justify-content: space-between;
124
+ align-items: center;
125
+ }
126
+
127
+ .header-title {
128
+ font-family: var(--font-mono);
129
+ font-size: 12px;
130
+ font-weight: 800;
131
+ letter-spacing: 1.5px;
132
+ text-transform: uppercase;
133
+ color: var(--accent-red);
134
+ }
135
+
136
+ .close-btn {
137
+ cursor: pointer;
138
+ background: rgba(255,255,255,0.05);
139
+ border: none;
140
+ color: white;
141
+ width: 32px;
142
+ height: 32px;
143
+ border-radius: 50%;
144
+ display: flex;
145
+ align-items: center;
146
+ justify-content: center;
147
+ transition: all 0.2s;
148
+ font-size: 20px;
149
+ }
150
+
151
+ .close-btn:hover { background: #333; }
152
+
153
+ .card-body {
154
+ padding: 32px;
155
+ max-height: 70vh;
156
+ overflow-y: auto;
157
+ }
158
+
159
+ .error-msg {
160
+ font-size: 18px;
161
+ font-weight: 700;
162
+ margin-bottom: 20px;
163
+ color: var(--accent-red);
164
+ line-height: 1.5;
165
+ }
166
+
167
+ .code-block {
168
+ background: var(--code-bg);
169
+ border-radius: 12px;
170
+ padding: 20px;
171
+ font-family: var(--font-mono);
172
+ font-size: 13px;
173
+ border: 1px solid rgba(255,255,255,0.05);
174
+ margin-bottom: 20px;
175
+ overflow-x: auto;
176
+ }
177
+
178
+ .line-err {
179
+ background: var(--accent-red-dim);
180
+ border-left: 3px solid var(--accent-red);
181
+ margin: 0 -20px;
182
+ padding: 4px 20px;
183
+ }
184
+
185
+ .stack-trace {
186
+ font-family: var(--font-mono);
187
+ font-size: 12px;
188
+ color: var(--text-secondary);
189
+ background: rgba(255, 255, 255, 0.02);
190
+ padding: 16px;
191
+ border-radius: 8px;
192
+ overflow-x: auto;
193
+ }
194
+
195
+ .stack-trace-title {
196
+ font-size: 11px;
197
+ text-transform: uppercase;
198
+ letter-spacing: 1px;
199
+ margin-bottom: 8px;
200
+ opacity: 0.5;
201
+ }
202
+
203
+ .card-body::-webkit-scrollbar { width: 6px; }
204
+ .card-body::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
205
+
206
+ .setting-item {
207
+ display: flex;
208
+ justify-content: space-between;
209
+ align-items: center;
210
+ padding: 16px 0;
211
+ border-bottom: 1px solid rgba(255,255,255,0.03);
212
+ }
213
+
214
+ .setting-info h4 { margin: 0; font-size: 15px; }
215
+ .setting-info p { margin: 4px 0 0; font-size: 12px; color: var(--text-secondary); }
216
+
217
+ .switch {
218
+ position: relative;
219
+ display: inline-block;
220
+ width: 44px;
221
+ height: 24px;
222
+ }
223
+
224
+ .switch input { opacity: 0; width: 0; height: 0; }
225
+
226
+ .slider {
227
+ position: absolute;
228
+ cursor: pointer;
229
+ inset: 0;
230
+ background-color: #333;
231
+ transition: .4s;
232
+ border-radius: 34px;
233
+ }
234
+
235
+ .slider:before {
236
+ position: absolute;
237
+ content: "";
238
+ height: 18px;
239
+ width: 18px;
240
+ left: 3px;
241
+ bottom: 3px;
242
+ background-color: white;
243
+ transition: .4s;
244
+ border-radius: 50%;
245
+ }
246
+
247
+ input:checked + .slider { background-color: var(--accent-blue); }
248
+ input:checked + .slider:before { transform: translateX(20px); }
249
+ </style>
250
+ </head>
251
+ <body>
252
+ <div class="dev-badge" id="openSettings" title="Overlay Settings">
253
+ <svg viewBox="0 0 24 24">
254
+ <path d="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.35 19.43,11.03L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.97 19.05,5.05L16.56,6.05C16.04,5.66 15.47,5.34 14.86,5.12L14.47,2.47C14.44,2.23 14.24,2.05 14,2.05H10C9.76,2.05 9.56,2.23 9.53,2.47L9.14,5.12C8.53,5.34 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.97 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11.03C4.53,11.35 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.95C7.96,18.34 8.53,18.66 9.14,18.88L9.53,21.53C9.56,21.77 9.76,21.95 10,21.95H14C14.24,21.95 14.44,21.77 14.47,21.53L14.86,18.88C15.47,18.66 16.04,18.34 16.56,17.95L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z" />
255
+ </svg>
256
+ </div>
257
+
258
+ <div class="overlay-wrapper active" id="overlay">
259
+ <div class="card" id="errorView">
260
+ <div class="card-header">
261
+ <div class="header-title">Runtime Error</div>
262
+ <button class="close-btn" onclick="closeOverlay()">×</button>
263
+ </div>
264
+ <div class="card-body">
265
+ <div class="error-msg">${escapeHtml(message)}</div>
266
+
267
+ ${file ? `<p style="color: var(--text-secondary); font-size: 13px; font-family: var(--font-mono); margin-bottom: 16px;">
268
+ 📁 ${escapeHtml(file)}${line ? `:${line}:${error.column || 0}` : ''}
269
+ </p>` : ''}
270
+
271
+ <div class="code-block">
272
+ ${codeSnippet}
273
+ </div>
274
+
275
+ ${stack ? `
276
+ <div class="stack-trace">
277
+ <div class="stack-trace-title">Stack Trace</div>
278
+ <pre style="margin: 0; white-space: pre-wrap;">${escapeHtml(stack)}</pre>
279
+ </div>
280
+ ` : ''}
281
+ </div>
282
+ </div>
283
+
284
+ <div class="card" id="settingsView" style="display: none;">
285
+ <div class="card-header">
286
+ <div class="header-title" style="color: var(--accent-blue);">Overlay Settings</div>
287
+ <button class="close-btn" onclick="showView('error')">×</button>
288
+ </div>
289
+ <div class="card-body">
290
+ <div class="setting-item">
291
+ <div class="setting-info">
292
+ <h4>Enable Blur</h4>
293
+ <p>Apply backdrop-filter to the background.</p>
294
+ </div>
295
+ <label class="switch">
296
+ <input type="checkbox" checked onchange="toggleBlur(this.checked)">
297
+ <span class="slider"></span>
298
+ </label>
299
+ </div>
300
+ <div class="setting-item">
301
+ <div class="setting-info">
302
+ <h4>Compact Mode</h4>
303
+ <p>Show less detailed stack traces.</p>
304
+ </div>
305
+ <label class="switch">
306
+ <input type="checkbox" onchange="toggleCompact(this.checked)">
307
+ <span class="slider"></span>
308
+ </label>
309
+ </div>
310
+ <div class="setting-item">
311
+ <div class="setting-info">
312
+ <h4>Auto-dismiss</h4>
313
+ <p>Hide overlay after fixing the code.</p>
314
+ </div>
315
+ <label class="switch">
316
+ <input type="checkbox" checked>
317
+ <span class="slider"></span>
318
+ </label>
319
+ </div>
320
+ </div>
321
+ </div>
322
+ </div>
323
+
324
+ <script>
325
+ const overlay = document.getElementById('overlay');
326
+ const errorView = document.getElementById('errorView');
327
+ const settingsView = document.getElementById('settingsView');
328
+
329
+ const closeOverlay = () => {
330
+ overlay.classList.remove('active');
331
+ // Send message to parent to clear error
332
+ if (window.parent) {
333
+ window.parent.postMessage({ type: 'satset:clear-error' }, '*');
334
+ }
335
+ };
336
+
337
+ const showView = (view) => {
338
+ if (view === 'settings') {
339
+ errorView.style.display = 'none';
340
+ settingsView.style.display = 'block';
341
+ } else {
342
+ errorView.style.display = 'block';
343
+ settingsView.style.display = 'none';
344
+ }
345
+ };
346
+
347
+ document.getElementById('openSettings').onclick = () => showView('settings');
348
+
349
+ const toggleBlur = (enabled) => {
350
+ overlay.style.backdropFilter = enabled ? 'blur(24px)' : 'none';
351
+ overlay.style.webkitBackdropFilter = enabled ? 'blur(24px)' : 'none';
352
+ };
353
+
354
+ const toggleCompact = (enabled) => {
355
+ const stackTrace = document.querySelector('.stack-trace pre');
356
+ if (stackTrace) {
357
+ stackTrace.style.maxHeight = enabled ? '100px' : 'none';
358
+ stackTrace.style.overflow = enabled ? 'hidden' : 'auto';
359
+ }
360
+ };
361
+
362
+ document.addEventListener('keydown', (e) => {
363
+ if (e.key === 'Escape') closeOverlay();
364
+ });
365
+
366
+ overlay.onclick = (e) => {
367
+ if (e.target === overlay) closeOverlay();
368
+ };
369
+ </script>
370
+ </body>
371
+ </html>
372
+ `;
373
+ }
374
+ function escapeHtml(text) {
375
+ return text
376
+ .replace(/&/g, '&amp;')
377
+ .replace(/</g, '&lt;')
378
+ .replace(/>/g, '&gt;')
379
+ .replace(/"/g, '&quot;')
380
+ .replace(/'/g, '&#039;');
381
+ }
382
+ function extractCodeSnippet(filePath, errorLine, context = 5) {
383
+ const fs = require('fs');
384
+ const path = require('path');
385
+ try {
386
+ const content = fs.readFileSync(filePath, 'utf-8');
387
+ const lines = content.split('\n');
388
+ const start = Math.max(0, errorLine - context);
389
+ const end = Math.min(lines.length, errorLine + context);
390
+ return lines.slice(start, end);
391
+ }
392
+ catch (e) {
393
+ return [];
394
+ }
395
+ }
396
+ //# sourceMappingURL=error-overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-overlay.js","sourceRoot":"","sources":["../../src/server/error-overlay.ts"],"names":[],"mappings":";;AAUA,4DAkXC;AAWD,gDAeC;AA5YD,SAAgB,wBAAwB,CAAC,KAAgB;IACvD,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAE1E,mDAAmD;IACnD,MAAM,KAAK,GAAG,SAAS,IAAI,eAAe,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC;QACjC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE;YACzB,MAAM,OAAO,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;YAChE,MAAM,WAAW,GAAG,OAAO,KAAK,IAAI,CAAC;YACrC,OAAO,eAAe,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,qBAAqB,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK;YAC7F,OAAO,MAAM,UAAU,CAAC,QAAQ,CAAC;eAC9B,CAAC;QACV,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACb,CAAC,CAAC,2DAA2D,CAAC;IAEhE,OAAO;;;;;;aAMI,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAElC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,CAAC;QAExD,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,8 @@
1
+ import http from 'http';
2
+ import { WebSocket } from 'ws';
3
+ export declare function startHMR(server: http.Server, root: string, onFileChange?: (filePath: string) => Promise<void>): {
4
+ clients: Set<WebSocket>;
5
+ notify: (data: any) => void;
6
+ close: () => void;
7
+ };
8
+ //# sourceMappingURL=hmr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hmr.d.ts","sourceRoot":"","sources":["../../src/server/hmr.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAmB,SAAS,EAAE,MAAM,IAAI,CAAC;AAGhD,wBAAgB,QAAQ,CACtB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;;mBA4JrB,GAAG;;EAoBjC"}
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.startHMR = startHMR;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const ws_1 = require("ws");
10
+ const chokidar_1 = require("chokidar");
11
+ function startHMR(server, root, onFileChange) {
12
+ const clients = new Set();
13
+ console.log('🔥 HMR server starting...');
14
+ // WebSocket server for HMR
15
+ const wss = new ws_1.WebSocketServer({ noServer: true });
16
+ wss.on('connection', (ws) => {
17
+ clients.add(ws);
18
+ ws.send(JSON.stringify({ type: 'connected' }));
19
+ ws.on('close', () => {
20
+ clients.delete(ws);
21
+ });
22
+ });
23
+ // Upgrade HTTP to WebSocket
24
+ server.on('upgrade', (request, socket, head) => {
25
+ if (request.url === '/__hmr_ws') {
26
+ wss.handleUpgrade(request, socket, head, (ws) => {
27
+ wss.emit('connection', ws, request);
28
+ });
29
+ }
30
+ });
31
+ // Watch src directory for changes
32
+ const srcPath = path_1.default.join(root, 'src');
33
+ if (fs_1.default.existsSync(srcPath)) {
34
+ const watcher = (0, chokidar_1.watch)(srcPath, {
35
+ ignored: /(^|[\/\\])\../, // ignore dotfiles
36
+ persistent: true,
37
+ ignoreInitial: true,
38
+ });
39
+ watcher.on('change', async (filePath) => {
40
+ const relativePath = path_1.default.relative(root, filePath);
41
+ console.log(`🔄 File changed: ${relativePath}`);
42
+ // Trigger rebuild
43
+ if (onFileChange) {
44
+ await onFileChange(filePath);
45
+ }
46
+ // Notify all clients
47
+ notifyClients({
48
+ type: 'update',
49
+ file: relativePath,
50
+ timestamp: Date.now(),
51
+ });
52
+ });
53
+ watcher.on('add', async (filePath) => {
54
+ const relativePath = path_1.default.relative(root, filePath);
55
+ console.log(`➕ File added: ${relativePath}`);
56
+ if (onFileChange) {
57
+ await onFileChange(filePath);
58
+ }
59
+ notifyClients({
60
+ type: 'add',
61
+ file: relativePath,
62
+ timestamp: Date.now(),
63
+ });
64
+ });
65
+ watcher.on('unlink', (filePath) => {
66
+ const relativePath = path_1.default.relative(root, filePath);
67
+ console.log(`➖ File removed: ${relativePath}`);
68
+ notifyClients({
69
+ type: 'remove',
70
+ file: relativePath,
71
+ timestamp: Date.now(),
72
+ });
73
+ });
74
+ console.log('👀 Watching for file changes...');
75
+ }
76
+ // Handle legacy SSE endpoint (fallback)
77
+ const originalEmit = server.emit.bind(server);
78
+ server.emit = function (event, ...args) {
79
+ // args may be [req, res] for 'request' or [req, socket, head] for 'upgrade'
80
+ const req = args[0];
81
+ const res = args[1];
82
+ if (event === 'request' && req && req.url === '/__hmr') {
83
+ handleLegacyHMR(req, res);
84
+ return true;
85
+ }
86
+ return originalEmit(event, ...args);
87
+ };
88
+ function handleLegacyHMR(req, res) {
89
+ res.writeHead(200, {
90
+ 'Content-Type': 'text/javascript',
91
+ 'Cache-Control': 'no-cache',
92
+ });
93
+ // Inject WebSocket client
94
+ const hmrClient = `
95
+ (function() {
96
+ const ws = new WebSocket('ws://' + location.host + '/__hmr_ws');
97
+
98
+ ws.onopen = () => {
99
+ console.log('🔥 HMR Connected');
100
+ };
101
+
102
+ ws.onmessage = (event) => {
103
+ const data = JSON.parse(event.data);
104
+
105
+ if (data.type === 'update') {
106
+ console.log('🔄 Reloading:', data.file);
107
+
108
+ // Check if CSS file
109
+ if (data.file.endsWith('.css')) {
110
+ reloadCSS();
111
+ } else {
112
+ // Full page reload for JS/JSX/TSX changes
113
+ location.reload();
114
+ }
115
+ }
116
+
117
+ if (data.type === 'add' || data.type === 'remove') {
118
+ console.log('🔄 File structure changed, reloading...');
119
+ location.reload();
120
+ }
121
+ };
122
+
123
+ ws.onerror = (error) => {
124
+ console.error('❌ HMR Error:', error);
125
+ };
126
+
127
+ ws.onclose = () => {
128
+ console.log('🔌 HMR Disconnected, retrying...');
129
+ setTimeout(() => location.reload(), 1000);
130
+ };
131
+
132
+ function reloadCSS() {
133
+ const links = document.querySelectorAll('link[rel="stylesheet"]');
134
+ links.forEach(link => {
135
+ const href = link.getAttribute('href');
136
+ if (href) {
137
+ link.setAttribute('href', href.split('?')[0] + '?t=' + Date.now());
138
+ }
139
+ });
140
+ }
141
+ })();
142
+ `;
143
+ res.end(hmrClient);
144
+ }
145
+ function notifyClients(data) {
146
+ const message = JSON.stringify(data);
147
+ clients.forEach(client => {
148
+ if (client.readyState === ws_1.WebSocket.OPEN) {
149
+ try {
150
+ client.send(message);
151
+ }
152
+ catch (e) {
153
+ clients.delete(client);
154
+ }
155
+ }
156
+ });
157
+ }
158
+ return {
159
+ clients,
160
+ notify: notifyClients,
161
+ close: () => {
162
+ wss.close();
163
+ },
164
+ };
165
+ }
166
+ //# sourceMappingURL=hmr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hmr.js","sourceRoot":"","sources":["../../src/server/hmr.ts"],"names":[],"mappings":";;;;;AAMA,4BAmLC;AAxLD,4CAAoB;AACpB,gDAAwB;AACxB,2BAAgD;AAChD,uCAAiC;AAEjC,SAAgB,QAAQ,CACtB,MAAmB,EACnB,IAAY,EACZ,YAAkD;IAElD,MAAM,OAAO,GAAG,IAAI,GAAG,EAAa,CAAC;IAErC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAEzC,2BAA2B;IAC3B,MAAM,GAAG,GAAG,IAAI,oBAAe,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAEpD,GAAG,CAAC,EAAE,CAAC,YAAY,EAAE,CAAC,EAAE,EAAE,EAAE;QAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;QAE/C,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAClB,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,4BAA4B;IAC5B,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAA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GAAG,IAAI,CAAC,CAAC;IACtC,CAAQ,CAAC;IAET,SAAS,eAAe,CAAC,GAAyB,EAAE,GAAwB;QAC1E,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE;YACjB,cAAc,EAAE,iBAAiB;YACjC,eAAe,EAAE,UAAU;SAC5B,CAAC,CAAC;QAEH,0BAA0B;QAC1B,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgDjB,CAAC;QAEF,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACrB,CAAC;IAED,SAAS,aAAa,CAAC,IAAS;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YACvB,IAAI,MAAM,CAAC,UAAU,KAAK,cAAS,CAAC,IAAI,EAAE,CAAC;gBACzC,IAAI,CAAC;oBACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACvB,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACzB,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,OAAO;QACP,MAAM,EAAE,aAAa;QACrB,KAAK,EAAE,GAAG,EAAE;YACV,GAAG,CAAC,KAAK,EAAE,CAAC;QACd,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { startDevServer } from './dev';
2
+ export { build } from './build';
3
+ export { startHMR } from './hmr';
4
+ export { cookies } from './response';
5
+ export { redirect, notFound } from '../navigation/notFound';
6
+ export { getLocale, getDictionaries, getParams, getPathname } from './storage';
7
+ export { renderToString, renderToStaticMarkup, renderToStream, escapeHtml } from '../core/ssr';
8
+ export type { RenderOptions, SSRResult } from '../core/ssr';
9
+ export type { ServerConfig, BuildOptions } from './types';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC/F,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeHtml = exports.renderToStream = exports.renderToStaticMarkup = exports.renderToString = exports.getPathname = exports.getParams = exports.getDictionaries = exports.getLocale = exports.notFound = exports.redirect = exports.cookies = exports.startHMR = exports.build = exports.startDevServer = void 0;
4
+ var dev_1 = require("./dev");
5
+ Object.defineProperty(exports, "startDevServer", { enumerable: true, get: function () { return dev_1.startDevServer; } });
6
+ var build_1 = require("./build");
7
+ Object.defineProperty(exports, "build", { enumerable: true, get: function () { return build_1.build; } });
8
+ var hmr_1 = require("./hmr");
9
+ Object.defineProperty(exports, "startHMR", { enumerable: true, get: function () { return hmr_1.startHMR; } });
10
+ var response_1 = require("./response");
11
+ Object.defineProperty(exports, "cookies", { enumerable: true, get: function () { return response_1.cookies; } });
12
+ var notFound_1 = require("../navigation/notFound");
13
+ Object.defineProperty(exports, "redirect", { enumerable: true, get: function () { return notFound_1.redirect; } });
14
+ Object.defineProperty(exports, "notFound", { enumerable: true, get: function () { return notFound_1.notFound; } });
15
+ var storage_1 = require("./storage");
16
+ Object.defineProperty(exports, "getLocale", { enumerable: true, get: function () { return storage_1.getLocale; } });
17
+ Object.defineProperty(exports, "getDictionaries", { enumerable: true, get: function () { return storage_1.getDictionaries; } });
18
+ Object.defineProperty(exports, "getParams", { enumerable: true, get: function () { return storage_1.getParams; } });
19
+ Object.defineProperty(exports, "getPathname", { enumerable: true, get: function () { return storage_1.getPathname; } });
20
+ var ssr_1 = require("../core/ssr");
21
+ Object.defineProperty(exports, "renderToString", { enumerable: true, get: function () { return ssr_1.renderToString; } });
22
+ Object.defineProperty(exports, "renderToStaticMarkup", { enumerable: true, get: function () { return ssr_1.renderToStaticMarkup; } });
23
+ Object.defineProperty(exports, "renderToStream", { enumerable: true, get: function () { return ssr_1.renderToStream; } });
24
+ Object.defineProperty(exports, "escapeHtml", { enumerable: true, get: function () { return ssr_1.escapeHtml; } });
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":";;;AAAA,6BAAuC;AAA9B,qGAAA,cAAc,OAAA;AACvB,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AACd,6BAAiC;AAAxB,+FAAA,QAAQ,OAAA;AACjB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,mDAA4D;AAAnD,oGAAA,QAAQ,OAAA;AAAE,oGAAA,QAAQ,OAAA;AAC3B,qCAA+E;AAAtE,oGAAA,SAAS,OAAA;AAAE,0GAAA,eAAe,OAAA;AAAE,oGAAA,SAAS,OAAA;AAAE,sGAAA,WAAW,OAAA;AAC3D,mCAA+F;AAAtF,qGAAA,cAAc,OAAA;AAAE,2GAAA,oBAAoB,OAAA;AAAE,qGAAA,cAAc,OAAA;AAAE,iGAAA,UAAU,OAAA"}
@@ -0,0 +1,30 @@
1
+ import http from 'http';
2
+ import { SatsetResponse, SatsetResponseInit } from '../core/response';
3
+ export { SatsetResponse, type SatsetResponseInit };
4
+ export declare function setCurrentRequestCookies(cookies: Record<string, string> | null): void;
5
+ export declare function readRequestBody(req: http.IncomingMessage): Promise<Buffer>;
6
+ export declare function buildSatsetRequest(req: http.IncomingMessage, baseUrl?: string): Promise<{
7
+ readonly url: string;
8
+ readonly method: string;
9
+ readonly headers: Record<string, string>;
10
+ readonly json: () => Promise<any>;
11
+ readonly text: () => Promise<string>;
12
+ readonly nodeRequest: http.IncomingMessage;
13
+ }>;
14
+ export declare function cookies(): {
15
+ get(name: string): {
16
+ name: string;
17
+ value: string;
18
+ } | undefined;
19
+ getAll(): {
20
+ name: string;
21
+ value: string;
22
+ }[];
23
+ has(name: string): boolean;
24
+ set(name: string, value: string, opts?: {
25
+ path?: string;
26
+ maxAge?: number;
27
+ }): void;
28
+ };
29
+ export declare function sendSatsetResponse(nodeRes: http.ServerResponse, satRes: SatsetResponse): Promise<void>;
30
+ //# sourceMappingURL=response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/server/response.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,CAAC;AAInD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,QAE9E;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAwChF;AAED,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,SAAqB;;;;;;;GAsC/F;AAED,wBAAgB,OAAO;cAGT,MAAM;;;;;;;;cAQN,MAAM;cAGN,MAAM,SAAS,MAAM,SAAQ;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;EAoB5E;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,iBAsG5F"}