effect-start 0.25.0 → 0.26.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 (117) hide show
  1. package/package.json +18 -86
  2. package/dist/ChildProcess.js +0 -42
  3. package/dist/Commander.js +0 -410
  4. package/dist/ContentNegotiation.js +0 -465
  5. package/dist/Cookies.js +0 -371
  6. package/dist/Development.js +0 -94
  7. package/dist/Effectify.js +0 -27
  8. package/dist/Entity.js +0 -289
  9. package/dist/Fetch.js +0 -192
  10. package/dist/FilePathPattern.js +0 -97
  11. package/dist/FileRouter.js +0 -204
  12. package/dist/FileRouterCodegen.js +0 -298
  13. package/dist/FileSystem.js +0 -132
  14. package/dist/Http.js +0 -107
  15. package/dist/PathPattern.js +0 -451
  16. package/dist/PlatformError.js +0 -40
  17. package/dist/PlatformRuntime.js +0 -71
  18. package/dist/Route.js +0 -143
  19. package/dist/RouteBody.js +0 -92
  20. package/dist/RouteError.js +0 -76
  21. package/dist/RouteHook.js +0 -64
  22. package/dist/RouteHttp.js +0 -367
  23. package/dist/RouteHttpTracer.js +0 -90
  24. package/dist/RouteMount.js +0 -86
  25. package/dist/RouteSchema.js +0 -271
  26. package/dist/RouteSse.js +0 -94
  27. package/dist/RouteTree.js +0 -119
  28. package/dist/RouteTrie.js +0 -179
  29. package/dist/SchemaExtra.js +0 -99
  30. package/dist/Socket.js +0 -40
  31. package/dist/SqlIntrospect.js +0 -515
  32. package/dist/Start.js +0 -79
  33. package/dist/StartApp.js +0 -3
  34. package/dist/StreamExtra.js +0 -135
  35. package/dist/System.js +0 -38
  36. package/dist/TuplePathPattern.js +0 -74
  37. package/dist/Unique.js +0 -226
  38. package/dist/Values.js +0 -52
  39. package/dist/bun/BunBundle.js +0 -186
  40. package/dist/bun/BunChildProcessSpawner.js +0 -142
  41. package/dist/bun/BunImportTrackerPlugin.js +0 -91
  42. package/dist/bun/BunRoute.js +0 -157
  43. package/dist/bun/BunRuntime.js +0 -41
  44. package/dist/bun/BunServer.js +0 -285
  45. package/dist/bun/BunVirtualFilesPlugin.js +0 -54
  46. package/dist/bun/_BunEnhancedResolve.js +0 -127
  47. package/dist/bun/index.js +0 -5
  48. package/dist/bundler/Bundle.js +0 -92
  49. package/dist/bundler/BundleFiles.js +0 -154
  50. package/dist/bundler/BundleRoute.js +0 -62
  51. package/dist/client/Overlay.js +0 -33
  52. package/dist/client/ScrollState.js +0 -106
  53. package/dist/client/index.js +0 -97
  54. package/dist/console/Console.js +0 -42
  55. package/dist/console/ConsoleErrors.js +0 -211
  56. package/dist/console/ConsoleLogger.js +0 -56
  57. package/dist/console/ConsoleMetrics.js +0 -72
  58. package/dist/console/ConsoleProcess.js +0 -59
  59. package/dist/console/ConsoleStore.js +0 -72
  60. package/dist/console/ConsoleTracer.js +0 -107
  61. package/dist/console/Simulation.js +0 -784
  62. package/dist/console/index.js +0 -3
  63. package/dist/console/routes/tree.js +0 -30
  64. package/dist/datastar/actions/fetch.js +0 -536
  65. package/dist/datastar/actions/peek.js +0 -13
  66. package/dist/datastar/actions/setAll.js +0 -19
  67. package/dist/datastar/actions/toggleAll.js +0 -19
  68. package/dist/datastar/attributes/attr.js +0 -49
  69. package/dist/datastar/attributes/bind.js +0 -194
  70. package/dist/datastar/attributes/class.js +0 -54
  71. package/dist/datastar/attributes/computed.js +0 -25
  72. package/dist/datastar/attributes/effect.js +0 -10
  73. package/dist/datastar/attributes/indicator.js +0 -33
  74. package/dist/datastar/attributes/init.js +0 -27
  75. package/dist/datastar/attributes/jsonSignals.js +0 -33
  76. package/dist/datastar/attributes/on.js +0 -81
  77. package/dist/datastar/attributes/onIntersect.js +0 -53
  78. package/dist/datastar/attributes/onInterval.js +0 -31
  79. package/dist/datastar/attributes/onSignalPatch.js +0 -51
  80. package/dist/datastar/attributes/ref.js +0 -11
  81. package/dist/datastar/attributes/show.js +0 -32
  82. package/dist/datastar/attributes/signals.js +0 -18
  83. package/dist/datastar/attributes/style.js +0 -57
  84. package/dist/datastar/attributes/text.js +0 -29
  85. package/dist/datastar/engine.js +0 -1145
  86. package/dist/datastar/index.js +0 -25
  87. package/dist/datastar/utils.js +0 -250
  88. package/dist/datastar/watchers/patchElements.js +0 -486
  89. package/dist/datastar/watchers/patchSignals.js +0 -14
  90. package/dist/experimental/EncryptedCookies.js +0 -328
  91. package/dist/experimental/index.js +0 -1
  92. package/dist/hyper/Hyper.js +0 -28
  93. package/dist/hyper/HyperHtml.js +0 -165
  94. package/dist/hyper/HyperNode.js +0 -13
  95. package/dist/hyper/HyperRoute.js +0 -45
  96. package/dist/hyper/html.js +0 -30
  97. package/dist/hyper/index.js +0 -5
  98. package/dist/hyper/jsx-runtime.js +0 -14
  99. package/dist/index.js +0 -8
  100. package/dist/node/NodeFileSystem.js +0 -675
  101. package/dist/node/NodeUtils.js +0 -23
  102. package/dist/sql/Sql.js +0 -8
  103. package/dist/sql/bun/index.js +0 -142
  104. package/dist/sql/index.js +0 -1
  105. package/dist/sql/libsql/index.js +0 -156
  106. package/dist/sql/mssql/docker.js +0 -110
  107. package/dist/sql/mssql/index.js +0 -194
  108. package/dist/testing/TestLogger.js +0 -42
  109. package/dist/testing/index.js +0 -2
  110. package/dist/testing/utils.js +0 -61
  111. package/dist/x/cloudflare/CloudflareTunnel.js +0 -63
  112. package/dist/x/cloudflare/index.js +0 -1
  113. package/dist/x/tailscale/TailscaleTunnel.js +0 -94
  114. package/dist/x/tailscale/index.js +0 -1
  115. package/dist/x/tailwind/TailwindPlugin.js +0 -294
  116. package/dist/x/tailwind/compile.js +0 -210
  117. package/dist/x/tailwind/plugin.js +0 -17
@@ -1,465 +0,0 @@
1
- /**
2
- * RFC 7231 Content Negotiation compatible with Express/Node.js ecosystem.
3
- * Based on {@link https://github.com/jshttp/negotiator}
4
- */
5
-
6
- const simpleMediaTypeRegExp = /^\s*([^\s/;]+)\/([^;\s]+)\s*(?:;(.*))?$/
7
- const simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/
8
- const simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/
9
- const simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/
10
-
11
- function parseQuality(params) {
12
- if (!params) return 1
13
- const match = params.match(/q\s*=\s*([0-9.]+)/)
14
- if (!match) return 1
15
- const q = parseFloat(match[1])
16
- return isNaN(q) ? 1 : Math.min(Math.max(q, 0), 1)
17
- }
18
-
19
- function splitMediaTypeParams(params) {
20
- const result = {}
21
- let q = 1
22
-
23
- const parts = params.split(";")
24
- for (const part of parts) {
25
- const trimmed = part.trim()
26
- const eqIndex = trimmed.indexOf("=")
27
- if (eqIndex === -1) continue
28
-
29
- const key = trimmed.slice(0, eqIndex).trim().toLowerCase()
30
- let value = trimmed.slice(eqIndex + 1).trim()
31
-
32
- if (value.startsWith('"') && value.endsWith('"')) {
33
- value = value.slice(1, -1)
34
- }
35
-
36
- if (key === "q") {
37
- q = parseFloat(value)
38
- if (isNaN(q)) q = 1
39
- q = Math.min(Math.max(q, 0), 1)
40
- } else {
41
- result[key] = value
42
- }
43
- }
44
-
45
- return { params: result, q }
46
- }
47
-
48
- function parseAccept(accept) {
49
- const specs = []
50
- const parts = accept.split(",")
51
-
52
- for (let o = 0; o < parts.length; o++) {
53
- const part = parts[o].trim()
54
- if (!part) continue
55
-
56
- const match = simpleMediaTypeRegExp.exec(part)
57
- if (!match) continue
58
-
59
- const type = match[1].toLowerCase()
60
- const subtype = match[2].toLowerCase()
61
- const { params, q } = match[3] ? splitMediaTypeParams(match[3]) : { params: {}, q: 1 }
62
-
63
- if (q > 0) {
64
- specs.push({ type, subtype, params, q, o })
65
- }
66
- }
67
-
68
- return specs
69
- }
70
-
71
- function specifyMediaType(
72
- type,
73
- subtype,
74
- params,
75
- spec,
76
- ) {
77
- let s = 0
78
-
79
- if (spec.type === type) {
80
- s |= 4 // exact match: highest specificity
81
- } else if (type === "*") {
82
- s |= 0 // server offers wildcard (e.g. */*): matches any client type
83
- } else if (spec.type !== "*") {
84
- // client is NOT requesting wildcard: no match
85
- return null
86
- }
87
-
88
- // client requests wildcard (e.g. Accept: */*)
89
- if (spec.subtype === subtype) {
90
- s |= 2 // // exact match: highest specificity
91
- } else if (subtype === "*") {
92
- s |= 1 // server offers wildcard (e.g. text/*)
93
- } else if (spec.subtype !== "*") {
94
- return null // client is NOT requesting wildcard
95
- }
96
-
97
- // client requests wildcard (e.g. Accept: text/*): matches any server subtype
98
- const specParams = Object.keys(spec.params)
99
- if (specParams.length > 0) {
100
- if (
101
- specParams.every(
102
- (key) => spec.params[key].toLowerCase() === (params[key] || "").toLowerCase(),
103
- )
104
- ) {
105
- s |= 1
106
- } else {
107
- return null
108
- }
109
- }
110
-
111
- return { q: spec.q, s, o: spec.o }
112
- }
113
-
114
- function getMediaTypePriority(
115
- mediaType,
116
- accepted,
117
- index,
118
- ) {
119
- let best = null
120
-
121
- const match = simpleMediaTypeRegExp.exec(mediaType)
122
- if (!match) {
123
- return { value: mediaType, q: 0, s: 0, o: -1, i: index }
124
- }
125
-
126
- const type = match[1].toLowerCase()
127
- const subtype = match[2].toLowerCase()
128
- const { params } = match[3] ? splitMediaTypeParams(match[3]) : { params: {} }
129
-
130
- for (const spec of accepted) {
131
- const result = specifyMediaType(type, subtype, params, spec)
132
- if (
133
- result &&
134
- (best === null ||
135
- result.s > best.s ||
136
- (result.s === best.s && result.q > best.q) ||
137
- (result.s === best.s && result.q === best.q && result.o < best.o))
138
- ) {
139
- best = result
140
- }
141
- }
142
-
143
- return {
144
- value: mediaType,
145
- q: best?.q ?? 0,
146
- s: best?.s ?? 0,
147
- o: best?.o ?? -1,
148
- i: index,
149
- }
150
- }
151
-
152
- function parseAcceptLanguage(
153
- accept,
154
- ) {
155
- const specs = []
156
- const parts = accept.split(",")
157
-
158
- for (let o = 0; o < parts.length; o++) {
159
- const part = parts[o].trim()
160
- if (!part) continue
161
-
162
- const match = simpleLanguageRegExp.exec(part)
163
- if (!match) continue
164
-
165
- const prefix = match[1].toLowerCase()
166
- const suffix = match[2]?.toLowerCase()
167
- const q = parseQuality(match[3])
168
-
169
- if (q > 0) {
170
- specs.push({ prefix, suffix, q, o })
171
- }
172
- }
173
-
174
- return specs
175
- }
176
-
177
- function specifyLanguage(
178
- language,
179
- spec,
180
- ) {
181
- const match = simpleLanguageRegExp.exec(language)
182
- if (!match) return null
183
-
184
- const prefix = match[1].toLowerCase()
185
- const suffix = match[2]?.toLowerCase()
186
-
187
- if (spec.prefix === "*") {
188
- return { q: spec.q, s: 0, o: spec.o }
189
- }
190
-
191
- if (spec.prefix !== prefix) {
192
- return null
193
- }
194
-
195
- if (spec.suffix === undefined) {
196
- return { q: spec.q, s: suffix ? 2 : 4, o: spec.o }
197
- }
198
-
199
- if (spec.suffix === suffix) {
200
- return { q: spec.q, s: 4, o: spec.o }
201
- }
202
-
203
- return null
204
- }
205
-
206
- function getLanguagePriority(
207
- language,
208
- accepted,
209
- index,
210
- ) {
211
- let best = null
212
-
213
- for (const spec of accepted) {
214
- const result = specifyLanguage(language, spec)
215
- if (
216
- result &&
217
- (best === null ||
218
- result.s > best.s ||
219
- (result.s === best.s && result.q > best.q) ||
220
- (result.s === best.s && result.q === best.q && result.o < best.o))
221
- ) {
222
- best = result
223
- }
224
- }
225
-
226
- return {
227
- value: language,
228
- q: best?.q ?? 0,
229
- s: best?.s ?? 0,
230
- o: best?.o ?? -1,
231
- i: index,
232
- }
233
- }
234
-
235
- function parseAcceptEncoding(accept) {
236
- const specs = []
237
- const parts = accept.split(",")
238
- let hasIdentity = false
239
-
240
- for (let o = 0; o < parts.length; o++) {
241
- const part = parts[o].trim()
242
- if (!part) continue
243
-
244
- const match = simpleEncodingRegExp.exec(part)
245
- if (!match) continue
246
-
247
- const encoding = match[1].toLowerCase()
248
- const q = parseQuality(match[2])
249
-
250
- if (encoding === "identity") hasIdentity = true
251
- if (encoding === "*") hasIdentity = true
252
-
253
- if (q > 0) {
254
- specs.push({ encoding, q, o })
255
- }
256
- }
257
-
258
- if (!hasIdentity) {
259
- specs.push({ encoding: "identity", q: 0.0001, o: specs.length })
260
- }
261
-
262
- return specs
263
- }
264
-
265
- function specifyEncoding(
266
- encoding,
267
- spec,
268
- ) {
269
- const e = encoding.toLowerCase()
270
- const s = spec.encoding
271
-
272
- if (s === "*" || s === e) {
273
- return { q: spec.q, s: s === e ? 1 : 0, o: spec.o }
274
- }
275
-
276
- return null
277
- }
278
-
279
- function getEncodingPriority(
280
- encoding,
281
- accepted,
282
- index,
283
- ) {
284
- let best = null
285
-
286
- for (const spec of accepted) {
287
- const result = specifyEncoding(encoding, spec)
288
- if (
289
- result &&
290
- (best === null ||
291
- result.s > best.s ||
292
- (result.s === best.s && result.q > best.q) ||
293
- (result.s === best.s && result.q === best.q && result.o < best.o))
294
- ) {
295
- best = result
296
- }
297
- }
298
-
299
- return {
300
- value: encoding,
301
- q: best?.q ?? 0,
302
- s: best?.s ?? 0,
303
- o: best?.o ?? -1,
304
- i: index,
305
- }
306
- }
307
-
308
- function parseAcceptCharset(accept) {
309
- const specs = []
310
- const parts = accept.split(",")
311
-
312
- for (let o = 0; o < parts.length; o++) {
313
- const part = parts[o].trim()
314
- if (!part) continue
315
-
316
- const match = simpleCharsetRegExp.exec(part)
317
- if (!match) continue
318
-
319
- const charset = match[1].toLowerCase()
320
- const q = parseQuality(match[2])
321
-
322
- if (q > 0) {
323
- specs.push({ charset, q, o })
324
- }
325
- }
326
-
327
- return specs
328
- }
329
-
330
- function specifyCharset(
331
- charset,
332
- spec,
333
- ) {
334
- const c = charset.toLowerCase()
335
- const s = spec.charset
336
-
337
- if (s === "*" || s === c) {
338
- return { q: spec.q, s: s === c ? 1 : 0, o: spec.o }
339
- }
340
-
341
- return null
342
- }
343
-
344
- function getCharsetPriority(
345
- charset,
346
- accepted,
347
- index,
348
- ) {
349
- let best = null
350
-
351
- for (const spec of accepted) {
352
- const result = specifyCharset(charset, spec)
353
- if (
354
- result &&
355
- (best === null ||
356
- result.s > best.s ||
357
- (result.s === best.s && result.q > best.q) ||
358
- (result.s === best.s && result.q === best.q && result.o < best.o))
359
- ) {
360
- best = result
361
- }
362
- }
363
-
364
- return {
365
- value: charset,
366
- q: best?.q ?? 0,
367
- s: best?.s ?? 0,
368
- o: best?.o ?? -1,
369
- i: index,
370
- }
371
- }
372
-
373
- function compareSpecs(a, b) {
374
- return b.q - a.q || b.s - a.s || a.o - b.o || a.i - b.i
375
- }
376
-
377
- export function media(accept, available) {
378
- const parsed = parseAccept(accept)
379
- if (parsed.length === 0) {
380
- return []
381
- }
382
-
383
- if (!available) {
384
- return parsed.sort((a, b) => b.q - a.q || a.o - b.o).map((p) => `${p.type}/${p.subtype}`)
385
- }
386
-
387
- const priorities = available.map((t, i) => getMediaTypePriority(t, parsed, i))
388
- const sorted = priorities.filter((p) => p.q > 0).sort(compareSpecs)
389
-
390
- return sorted.map((p) => p.value)
391
- }
392
-
393
- export function language(accept, available) {
394
- const parsed = parseAcceptLanguage(accept)
395
- if (parsed.length === 0) {
396
- return []
397
- }
398
-
399
- if (!available) {
400
- return parsed
401
- .sort((a, b) => b.q - a.q || a.o - b.o)
402
- .map((p) => (p.suffix ? `${p.prefix}-${p.suffix}` : p.prefix))
403
- }
404
-
405
- const priorities = available.map((l, i) => getLanguagePriority(l, parsed, i))
406
- const sorted = priorities.filter((p) => p.q > 0).sort(compareSpecs)
407
-
408
- return sorted.map((p) => p.value)
409
- }
410
-
411
- export function encoding(accept, available) {
412
- const parsed = parseAcceptEncoding(accept)
413
- if (parsed.length === 0) {
414
- return []
415
- }
416
-
417
- if (!available) {
418
- return parsed.sort((a, b) => b.q - a.q || a.o - b.o).map((p) => p.encoding)
419
- }
420
-
421
- const priorities = available.map((e, i) => getEncodingPriority(e, parsed, i))
422
- const sorted = priorities.filter((p) => p.q > 0).sort(compareSpecs)
423
-
424
- return sorted.map((p) => p.value)
425
- }
426
-
427
- export function charset(accept, available) {
428
- const parsed = parseAcceptCharset(accept)
429
- if (parsed.length === 0) {
430
- return []
431
- }
432
-
433
- if (!available) {
434
- return parsed.sort((a, b) => b.q - a.q || a.o - b.o).map((p) => p.charset)
435
- }
436
-
437
- const priorities = available.map((c, i) => getCharsetPriority(c, parsed, i))
438
- const sorted = priorities.filter((p) => p.q > 0).sort(compareSpecs)
439
-
440
- return sorted.map((p) => p.value)
441
- }
442
-
443
- export function headerMedia(headers, available) {
444
- const accept = headers.get("accept")
445
- if (!accept) return []
446
- return media(accept, available)
447
- }
448
-
449
- export function headerLanguage(headers, available) {
450
- const accept = headers.get("accept-language")
451
- if (!accept) return []
452
- return language(accept, available)
453
- }
454
-
455
- export function headerEncoding(headers, available) {
456
- const accept = headers.get("accept-encoding")
457
- if (!accept) return []
458
- return encoding(accept, available)
459
- }
460
-
461
- export function headerCharset(headers, available) {
462
- const accept = headers.get("accept-charset")
463
- if (!accept) return []
464
- return charset(accept, available)
465
- }