@kayjs/kay 1.106.0 → 1.108.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 (254) hide show
  1. package/README.md +2 -2
  2. package/dist/eslint.js +477 -204
  3. package/editors/zed/extension.toml +2 -2
  4. package/llms/action-protection.md +1 -1
  5. package/llms/actions-from-islands.md +1 -1
  6. package/llms/actions-refused-fields.md +22 -0
  7. package/llms/actions.md +2 -22
  8. package/llms/browser-only.md +1 -1
  9. package/llms/compiler-api.md +1 -1
  10. package/llms/component-libraries.md +1 -1
  11. package/llms/components.md +1 -1
  12. package/llms/deprecated-lints.md +2 -4
  13. package/llms/island-and-form-lints.md +1 -0
  14. package/llms/islands.md +11 -2
  15. package/llms/project-new-and-add.md +1 -1
  16. package/llms/project.md +2 -2
  17. package/llms/schemas.md +6 -4
  18. package/llms/upgrading.md +25 -1
  19. package/llms/whats-new-archive.md +36 -1
  20. package/llms/whats-new.md +18 -35
  21. package/llms.txt +1 -1
  22. package/package.json +15 -6
  23. package/src/build/client.ts +23 -26
  24. package/src/build/entry-files.ts +19 -0
  25. package/src/build/icon-slots.ts +140 -0
  26. package/src/build/lazy-components.ts +130 -0
  27. package/src/build/lazy-manifest.ts +56 -0
  28. package/src/build/lazy-stubs.ts +31 -0
  29. package/src/build/libraries.ts +24 -2
  30. package/src/build/plugin.ts +13 -1
  31. package/src/build/runtime-chunk.ts +3 -3
  32. package/src/build/source-files.ts +8 -3
  33. package/src/build/transform.ts +17 -7
  34. package/src/build/variants.ts +97 -5
  35. package/src/check/action-options.ts +56 -0
  36. package/src/check/project.ts +4 -4
  37. package/src/check/renamed-packages.ts +3 -63
  38. package/src/check/schema-json.ts +226 -0
  39. package/src/check/shadow-types.ts +15 -27
  40. package/src/compiler/codegen.ts +7 -17
  41. package/src/compiler/dead-code.ts +22 -0
  42. package/src/compiler/deprecated-lints-1-105.ts +41 -0
  43. package/src/compiler/deprecated-lints-1-106.ts +1 -1
  44. package/src/compiler/deprecated-lints-1-107.ts +14 -0
  45. package/src/compiler/deprecated-lints.ts +8 -65
  46. package/src/compiler/dom-property.ts +23 -0
  47. package/src/compiler/dom.ts +15 -15
  48. package/src/compiler/import-edits.ts +15 -0
  49. package/src/compiler/index.ts +8 -3
  50. package/src/compiler/island-declaration.ts +15 -0
  51. package/src/compiler/kay-exports.ts +1 -0
  52. package/src/compiler/lazy-imports.ts +357 -0
  53. package/src/compiler/parser.ts +2 -2
  54. package/src/compiler/route-lints.ts +2 -0
  55. package/src/compiler/schema-lints.ts +13 -0
  56. package/src/compiler/script-server.ts +6 -3
  57. package/src/content/validate.ts +1 -1
  58. package/src/new.ts +6 -2
  59. package/src/package-names.ts +1 -1
  60. package/src/runtime/action-call.ts +39 -327
  61. package/src/runtime/action-run.ts +357 -0
  62. package/src/runtime/action.ts +47 -4
  63. package/src/runtime/client.ts +10 -0
  64. package/src/runtime/dom-lazy.ts +276 -0
  65. package/src/runtime/field-errors.ts +58 -0
  66. package/src/runtime/field-refusal.ts +179 -0
  67. package/src/runtime/form.ts +3 -2
  68. package/src/runtime/html.ts +6 -1
  69. package/src/runtime/index.ts +2 -0
  70. package/src/runtime/island.server.ts +36 -2
  71. package/src/runtime/schema-record.ts +2 -1
  72. package/src/runtime/schema.client.ts +104 -14
  73. package/src/runtime/schema.ts +9 -2
  74. package/src/runtime/standard-schema.ts +32 -0
  75. package/src/runtime/validate-run.client.ts +179 -0
  76. package/src/runtime/validate.client.ts +11 -0
  77. package/src/runtime/validate.ts +4 -137
  78. package/src/server/actions.ts +48 -43
  79. package/src/server/answer.ts +102 -0
  80. package/src/server/api-input.ts +166 -0
  81. package/src/server/api.ts +12 -44
  82. package/src/server/app-stages.ts +15 -8
  83. package/src/server/app.ts +5 -2
  84. package/src/server/client.ts +2 -0
  85. package/src/server/dev.ts +7 -9
  86. package/src/server/file-limit.ts +7 -1
  87. package/src/server/forms.ts +1 -1
  88. package/src/server/host-allowlist.ts +7 -7
  89. package/src/server/index.ts +2 -0
  90. package/src/server/kay-routes.ts +221 -0
  91. package/src/server/kay-server.ts +228 -0
  92. package/src/server/kept-exports.ts +1 -0
  93. package/src/server/library.ts +0 -2
  94. package/src/server/mcp.ts +1 -1
  95. package/src/server/openapi.ts +12 -3
  96. package/src/server/phases.ts +249 -0
  97. package/src/server/protection.ts +6 -6
  98. package/src/server/proxy-key.ts +8 -8
  99. package/src/server/query.ts +4 -25
  100. package/src/server/receive.ts +43 -0
  101. package/src/server/render-document.ts +13 -3
  102. package/src/server/request-context.ts +137 -0
  103. package/src/server/schema-check.ts +1 -1
  104. package/src/server/socket.ts +19 -47
  105. package/src/server/stream.ts +1 -1
  106. package/src/server/validate.ts +346 -0
  107. package/src/test/mount.ts +6 -2
  108. package/types/build/client.d.ts +3 -2
  109. package/types/build/client.d.ts.map +1 -1
  110. package/types/build/entry-files.d.ts +4 -0
  111. package/types/build/entry-files.d.ts.map +1 -0
  112. package/types/build/icon-slots.d.ts +7 -0
  113. package/types/build/icon-slots.d.ts.map +1 -0
  114. package/types/build/lazy-components.d.ts +6 -0
  115. package/types/build/lazy-components.d.ts.map +1 -0
  116. package/types/build/lazy-manifest.d.ts +19 -0
  117. package/types/build/lazy-manifest.d.ts.map +1 -0
  118. package/types/build/lazy-stubs.d.ts +5 -0
  119. package/types/build/lazy-stubs.d.ts.map +1 -0
  120. package/types/build/libraries.d.ts +2 -0
  121. package/types/build/libraries.d.ts.map +1 -1
  122. package/types/build/plugin.d.ts +2 -0
  123. package/types/build/plugin.d.ts.map +1 -1
  124. package/types/build/source-files.d.ts.map +1 -1
  125. package/types/build/transform.d.ts +3 -1
  126. package/types/build/transform.d.ts.map +1 -1
  127. package/types/build/variants.d.ts.map +1 -1
  128. package/types/check/action-options.d.ts +3 -0
  129. package/types/check/action-options.d.ts.map +1 -0
  130. package/types/check/renamed-packages.d.ts +0 -3
  131. package/types/check/renamed-packages.d.ts.map +1 -1
  132. package/types/check/schema-json.d.ts +3 -0
  133. package/types/check/schema-json.d.ts.map +1 -0
  134. package/types/check/shadow-types.d.ts.map +1 -1
  135. package/types/compiler/codegen.d.ts +2 -0
  136. package/types/compiler/codegen.d.ts.map +1 -1
  137. package/types/compiler/dead-code.d.ts +9 -0
  138. package/types/compiler/dead-code.d.ts.map +1 -0
  139. package/types/compiler/deprecated-lints-1-105.d.ts +39 -0
  140. package/types/compiler/deprecated-lints-1-105.d.ts.map +1 -0
  141. package/types/compiler/deprecated-lints-1-106.d.ts +1 -1
  142. package/types/compiler/deprecated-lints-1-106.d.ts.map +1 -1
  143. package/types/compiler/deprecated-lints-1-107.d.ts +12 -0
  144. package/types/compiler/deprecated-lints-1-107.d.ts.map +1 -0
  145. package/types/compiler/deprecated-lints.d.ts +36 -53
  146. package/types/compiler/deprecated-lints.d.ts.map +1 -1
  147. package/types/compiler/dom-property.d.ts +9 -0
  148. package/types/compiler/dom-property.d.ts.map +1 -0
  149. package/types/compiler/dom.d.ts +1 -0
  150. package/types/compiler/dom.d.ts.map +1 -1
  151. package/types/compiler/import-edits.d.ts +1 -0
  152. package/types/compiler/import-edits.d.ts.map +1 -1
  153. package/types/compiler/index.d.ts +2 -0
  154. package/types/compiler/index.d.ts.map +1 -1
  155. package/types/compiler/island-declaration.d.ts +5 -0
  156. package/types/compiler/island-declaration.d.ts.map +1 -1
  157. package/types/compiler/kay-exports.d.ts.map +1 -1
  158. package/types/compiler/lazy-imports.d.ts +33 -0
  159. package/types/compiler/lazy-imports.d.ts.map +1 -0
  160. package/types/compiler/lints.d.ts +44 -53
  161. package/types/compiler/lints.d.ts.map +1 -1
  162. package/types/compiler/route-lints.d.ts +8 -0
  163. package/types/compiler/route-lints.d.ts.map +1 -1
  164. package/types/compiler/schema-lints.d.ts +11 -0
  165. package/types/compiler/schema-lints.d.ts.map +1 -0
  166. package/types/compiler/script-server.d.ts.map +1 -1
  167. package/types/new.d.ts +1 -0
  168. package/types/new.d.ts.map +1 -1
  169. package/types/runtime/action-call.d.ts.map +1 -1
  170. package/types/runtime/action-run.d.ts +23 -0
  171. package/types/runtime/action-run.d.ts.map +1 -0
  172. package/types/runtime/action.d.ts +26 -1
  173. package/types/runtime/action.d.ts.map +1 -1
  174. package/types/runtime/client.d.ts.map +1 -1
  175. package/types/runtime/dom-lazy.d.ts +6 -0
  176. package/types/runtime/dom-lazy.d.ts.map +1 -0
  177. package/types/runtime/field-errors.d.ts +4 -0
  178. package/types/runtime/field-errors.d.ts.map +1 -0
  179. package/types/runtime/field-refusal.d.ts +37 -0
  180. package/types/runtime/field-refusal.d.ts.map +1 -0
  181. package/types/runtime/form.d.ts +1 -1
  182. package/types/runtime/form.d.ts.map +1 -1
  183. package/types/runtime/html.d.ts.map +1 -1
  184. package/types/runtime/index.d.ts +2 -0
  185. package/types/runtime/index.d.ts.map +1 -1
  186. package/types/runtime/island.server.d.ts +2 -0
  187. package/types/runtime/island.server.d.ts.map +1 -1
  188. package/types/runtime/schema-record.d.ts.map +1 -1
  189. package/types/runtime/schema.client.d.ts.map +1 -1
  190. package/types/runtime/schema.d.ts +6 -1
  191. package/types/runtime/schema.d.ts.map +1 -1
  192. package/types/runtime/standard-schema.d.ts +37 -0
  193. package/types/runtime/standard-schema.d.ts.map +1 -0
  194. package/types/runtime/validate-run.client.d.ts +4 -0
  195. package/types/runtime/validate-run.client.d.ts.map +1 -0
  196. package/types/runtime/validate.client.d.ts +4 -0
  197. package/types/runtime/validate.client.d.ts.map +1 -0
  198. package/types/runtime/validate.d.ts +1 -21
  199. package/types/runtime/validate.d.ts.map +1 -1
  200. package/types/server/actions.d.ts.map +1 -1
  201. package/types/server/answer.d.ts +6 -0
  202. package/types/server/answer.d.ts.map +1 -0
  203. package/types/server/api-input.d.ts +19 -0
  204. package/types/server/api-input.d.ts.map +1 -0
  205. package/types/server/api.d.ts.map +1 -1
  206. package/types/server/app-stages.d.ts +4 -1
  207. package/types/server/app-stages.d.ts.map +1 -1
  208. package/types/server/app.d.ts +2 -0
  209. package/types/server/app.d.ts.map +1 -1
  210. package/types/server/client.d.ts +1 -0
  211. package/types/server/client.d.ts.map +1 -1
  212. package/types/server/dev.d.ts +1 -1
  213. package/types/server/dev.d.ts.map +1 -1
  214. package/types/server/file-limit.d.ts.map +1 -1
  215. package/types/server/host-allowlist.d.ts +3 -3
  216. package/types/server/host-allowlist.d.ts.map +1 -1
  217. package/types/server/index.d.ts +2 -0
  218. package/types/server/index.d.ts.map +1 -1
  219. package/types/server/kay-routes.d.ts +47 -0
  220. package/types/server/kay-routes.d.ts.map +1 -0
  221. package/types/server/kay-server.d.ts +25 -0
  222. package/types/server/kay-server.d.ts.map +1 -0
  223. package/types/server/kept-exports.d.ts.map +1 -1
  224. package/types/server/library.d.ts +0 -1
  225. package/types/server/library.d.ts.map +1 -1
  226. package/types/server/openapi.d.ts.map +1 -1
  227. package/types/server/phases.d.ts +36 -0
  228. package/types/server/phases.d.ts.map +1 -0
  229. package/types/server/protection.d.ts +3 -2
  230. package/types/server/protection.d.ts.map +1 -1
  231. package/types/server/proxy-key.d.ts +3 -3
  232. package/types/server/proxy-key.d.ts.map +1 -1
  233. package/types/server/query.d.ts.map +1 -1
  234. package/types/server/receive.d.ts +9 -0
  235. package/types/server/receive.d.ts.map +1 -0
  236. package/types/server/render-document.d.ts.map +1 -1
  237. package/types/server/request-context.d.ts +29 -0
  238. package/types/server/request-context.d.ts.map +1 -0
  239. package/types/server/schema-check.d.ts +1 -0
  240. package/types/server/schema-check.d.ts.map +1 -1
  241. package/types/server/socket.d.ts +3 -5
  242. package/types/server/socket.d.ts.map +1 -1
  243. package/types/server/validate.d.ts +26 -0
  244. package/types/server/validate.d.ts.map +1 -0
  245. package/types/test/mount.d.ts.map +1 -1
  246. package/src/check/schema-type.ts +0 -9
  247. package/src/compiler/deprecated-script-fence.ts +0 -26
  248. package/src/server/field-errors.ts +0 -136
  249. package/types/check/schema-type.d.ts +0 -3
  250. package/types/check/schema-type.d.ts.map +0 -1
  251. package/types/compiler/deprecated-script-fence.d.ts +0 -3
  252. package/types/compiler/deprecated-script-fence.d.ts.map +0 -1
  253. package/types/server/field-errors.d.ts +0 -6
  254. package/types/server/field-errors.d.ts.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import type { Elysia } from 'elysia'
2
- import { getSchemaValidator, ValidationError } from 'elysia'
2
+ import type { Issue } from './validate'
3
3
  import { ElysiaWS } from 'elysia/ws'
4
4
  import { underKayDev } from '../build/assets'
5
5
  import { KayError } from '../compiler/errors'
6
6
  import { kayLog } from '../runtime/log'
7
- import { refusedFields } from './field-errors'
8
7
  import { bindReply } from './rooms'
8
+ import { isRefusal, messagesOf, validate } from './validate'
9
9
  import { kayWord } from './words'
10
10
  import { admissionOf, frameGuard } from './ws-limits'
11
11
 
@@ -27,7 +27,7 @@ export interface SocketRoute {
27
27
  }
28
28
 
29
29
  type Peer = ElysiaWS
30
- type Checked = { value: unknown } | { refused: ValidationError, schema: unknown } | Promise<{ value: unknown } | { refused: ValidationError, schema: unknown }>
30
+ type Checked = { value: unknown } | { refused: Issue[] } | Promise<{ value: unknown } | { refused: Issue[] }>
31
31
 
32
32
  interface Replying {
33
33
  validator?: { provider?: string, Check?: (value: unknown) => boolean, schema?: { '~standard': { validate: (value: unknown) => unknown } } }
@@ -154,7 +154,7 @@ export async function adopt(ws: ElysiaWS, route: SocketRoute): Promise<ElysiaWS>
154
154
  const checked = route.check === undefined ? undefined : await route.check(decoded.value)
155
155
 
156
156
  if (checked && 'refused' in checked) {
157
- socket.send(refusal('kay.socket.invalid', refusedFields(checked.schema, checked.refused)))
157
+ socket.send(refusal('kay.socket.invalid', messagesOf(checked.refused)))
158
158
 
159
159
  return undefined
160
160
  }
@@ -249,62 +249,34 @@ interface BodyCheck {
249
249
  check: NonNullable<SocketRoute['check']>
250
250
  }
251
251
 
252
- // The `body` of a websocket route as an HTTP route's: a message arrives cleaned and decoded, `at: '1'` as `1` for an integer, and one the schema refuses is answered with the fields it names.
253
- // Elysia's validation is left out of the route and done here, with the validator Elysia would have built.
252
+ // The `body` of a websocket route as an HTTP route's: a message is a JSON value, read as the schema types it, and one the schema refuses is answered with the fields it names.
253
+ // Elysia's validation is left out of the route and done here, by `validate`.
254
254
  export function socketBody(app: Elysia, body: unknown, name: () => string): BodyCheck | undefined {
255
255
  if (body === undefined)
256
256
  return undefined
257
257
 
258
- const { definitions } = app as unknown as { definitions: { typebox: never, type: never } }
259
- const validator = getSchemaValidator(body as never, { modules: definitions.typebox, models: definitions.type, normalize: app.config.normalize })
258
+ const { definitions } = app as unknown as { definitions: { type: Record<string, unknown> } }
259
+ const schema = typeof body === 'string' ? definitions.type[body] : body
260
260
 
261
- if (validator === undefined)
261
+ if (typeof schema !== 'object' || schema === null)
262
262
  return undefined
263
263
 
264
264
  let loggedAt = 0
265
265
 
266
- // Under `kay dev` only, and at most once a second per route: the sender is told which fields, the developer which route, in quotes as what a client sent may hold control codes.
267
- const refuse = (refused: ValidationError): { refused: ValidationError, schema: unknown } => {
268
- if (underKayDev() && performance.now() - loggedAt >= 1000) {
269
- loggedAt = performance.now()
270
- kayLog('warn', `the websocket route ${JSON.stringify(name())} refused a message of its body: ${JSON.stringify(refused.all[0]?.summary ?? 'it does not match')}`)
271
- }
272
-
273
- return { refused, schema: body }
274
- }
275
-
276
- if (validator.provider === 'standard') {
277
- return {
278
- check: async (value) => {
279
- const result = await (validator as unknown as { schema: { '~standard': { validate: (value: unknown) => Promise<{ issues?: never[], value?: unknown }> | { issues?: never[], value?: unknown } } } }).schema['~standard'].validate(value)
280
-
281
- return result.issues ? refuse(new ValidationError('message', validator, value, false, result.issues as never)) : { value: result.value }
282
- },
283
- }
284
- }
285
-
286
266
  return {
287
- check: (value) => {
288
- let cleaned: unknown
289
-
290
- // A structure the cleaner cannot walk is refused as a failed check is, never passed on unstripped.
291
- try {
292
- cleaned = validator.Clean?.(value) ?? value
293
- }
294
- catch {
295
- return refuse(new ValidationError('message', validator, value))
296
- }
267
+ check: async (value) => {
268
+ const result = await validate(schema, value, { source: 'json' })
297
269
 
298
- if (validator.Check(cleaned) === false)
299
- return refuse(new ValidationError('message', validator, cleaned))
270
+ if (!isRefusal(result))
271
+ return { value: result.value }
300
272
 
301
- try {
302
- return { value: validator.hasTransform ? validator.Decode(cleaned) : cleaned }
303
- }
304
- catch {
305
- // A transform that refuses the value is a refused message too.
306
- return refuse(new ValidationError('message', validator, cleaned))
273
+ // Under `kay dev` only, and at most once a second per route: the sender is told which fields, the developer which route, in quotes as what a client sent may hold control codes.
274
+ if (underKayDev() && performance.now() - loggedAt >= 1000) {
275
+ loggedAt = performance.now()
276
+ kayLog('warn', `the websocket route ${JSON.stringify(name())} refused a message of its body: ${JSON.stringify(result.errors[0]?.message ?? 'it does not match')}`)
307
277
  }
278
+
279
+ return { refused: result.errors }
308
280
  },
309
281
  }
310
282
  }
@@ -18,7 +18,7 @@ import { SWAP_SCRIPT } from './swap'
18
18
  import { workScript } from './work'
19
19
 
20
20
  const encoder = new TextEncoder()
21
- const EMPTY: Rendered = { html: '', islands: { used: new Set(), eager: new Set(), immediate: new Set(), waiting: new Set(), lazy: 0, count: 0, messages: new Set() }, deferred: [] }
21
+ const EMPTY: Rendered = { html: '', islands: { used: new Set(), eager: new Set(), immediate: new Set(), waiting: new Set(), lazy: 0, count: 0, messages: new Set(), lazies: new Set() }, deferred: [] }
22
22
 
23
23
  export interface Rendered {
24
24
  html: string
@@ -0,0 +1,346 @@
1
+ import type { TSchema } from 'elysia'
2
+ import type { LocaleState } from '../runtime/locale-state'
3
+ import type { InvalidWord } from './words'
4
+ import { fileType } from 'elysia'
5
+ import { KayError } from '../compiler/errors'
6
+ import { errorText, fieldMessage, ruleOf } from '../runtime/field-errors'
7
+ import { formInput, NUMERIC_FORMATS } from '../runtime/form'
8
+ import { runInLocale } from '../runtime/locale-state'
9
+ import { isStandardSchema, jsonSchemaOf } from '../runtime/standard-schema'
10
+ import { compiledCheck, dottedPath, summaryOf, withoutBlockUnions } from './schema-check'
11
+ import { invalidWord, kayWord, schemaRefusal } from './words'
12
+
13
+ // Where a value comes from, which says how it is read before it is checked: text from a form, a query string, a path or the environment is read as the numbers, booleans and lists it spells, and a JSON body is never coerced.
14
+ export type Source = 'form' | 'query' | 'params' | 'env' | 'json'
15
+
16
+ // One place a value is refused: `path` is dotted (`tags.0`, empty for the value itself), `key` the `kay.invalid.*` message the text is worded under, `params` the limit it names, `message` the text in the request's locale.
17
+ export interface Issue {
18
+ path: string
19
+ key: InvalidWord
20
+ params: Record<string, string | number>
21
+ message: string
22
+ }
23
+
24
+ export interface Refusal {
25
+ errors: Issue[]
26
+ status: 422
27
+ }
28
+
29
+ export type Validated<Value = unknown> = { value: Value } | Refusal
30
+
31
+ export interface ValidateOptions {
32
+ source: Source
33
+ // The locale state the messages are worded in, the running request's by default.
34
+ locale?: LocaleState | undefined
35
+ // `false` keeps the spaces around the text a form or a query sent, which an action drops: an API route reads what it is posted as it came.
36
+ trim?: boolean | undefined
37
+ }
38
+
39
+ export function isRefusal(result: Validated): result is Refusal {
40
+ return 'errors' in result
41
+ }
42
+
43
+ // A refusal's messages by the first path segment of each issue, the form-wide one under '', the first per field: what an action's `form.error(field)` and an API route's `errors` read.
44
+ export function messagesOf(errors: readonly Issue[]): Record<string, string> {
45
+ const messages: Record<string, string> = Object.create(null) as Record<string, string>
46
+
47
+ for (const { path, message } of errors) {
48
+ const dot = path.indexOf('.')
49
+
50
+ messages[dot < 0 ? path : path.slice(0, dot)] ??= message
51
+ }
52
+
53
+ return messages
54
+ }
55
+
56
+ type Node = Record<string, unknown>
57
+
58
+ const isNode = (value: unknown): value is Node => typeof value === 'object' && value !== null && !Array.isArray(value)
59
+ const isPlain = (value: unknown): value is Record<string, unknown> => isNode(value) && (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null)
60
+
61
+ // The text forms of a number or a boolean that Elysia's builders add beside the real type, which only a text source reads.
62
+ const isTextForm = (member: Node): boolean => member.type === 'string' && (NUMERIC_FORMATS.has(member.format) || member.format === 'boolean')
63
+
64
+ const strictViews = new WeakMap<object, TSchema>()
65
+
66
+ // The schema a JSON value is checked against: the builders' text forms (`'12'` for a number, `'true'` for a boolean) and a date's number are dropped, so a JSON body is never coerced.
67
+ function strictView(schema: TSchema): TSchema {
68
+ let view = strictViews.get(schema)
69
+
70
+ if (view === undefined)
71
+ strictViews.set(schema, view = strict(schema) as TSchema)
72
+
73
+ return view
74
+ }
75
+
76
+ function strict(node: unknown): unknown {
77
+ if (Array.isArray(node))
78
+ return node.map(strict)
79
+
80
+ if (!isNode(node))
81
+ return node
82
+
83
+ const members = node.anyOf
84
+
85
+ if (Array.isArray(members)) {
86
+ const dates = members.some(member => isNode(member) && member.type === 'Date')
87
+ const plain = members.filter(member => !(isNode(member) && (isTextForm(member) || (dates && member.type === 'number'))))
88
+
89
+ if (plain.length < members.length) {
90
+ const outer = { ...node }
91
+
92
+ delete outer.anyOf
93
+
94
+ return plain.length === 1 && isNode(plain[0]) ? { ...outer, ...strict(plain[0]) as Node } : { ...outer, anyOf: strict(plain) }
95
+ }
96
+ }
97
+
98
+ const copy: Node = { ...node }
99
+
100
+ for (const key of ['properties', 'patternProperties'] as const) {
101
+ if (isNode(node[key]))
102
+ copy[key] = Object.fromEntries(Object.entries(node[key]).map(([name, field]) => [name, strict(field)]))
103
+ }
104
+
105
+ for (const key of ['items', 'additionalProperties', 'not'] as const) {
106
+ if (isNode(node[key]))
107
+ copy[key] = strict(node[key])
108
+ }
109
+
110
+ for (const key of ['anyOf', 'oneOf', 'allOf', 'prefixItems'] as const) {
111
+ if (Array.isArray(node[key]))
112
+ copy[key] = strict(node[key])
113
+ }
114
+
115
+ return copy
116
+ }
117
+
118
+ const isFileField = (field: Node): boolean => field.format === 'binary' || (isNode(field.items) && field.items.format === 'binary')
119
+
120
+ // A missing field takes its schema's `default`, a nested object's too; a default is a whole value, filled as it is.
121
+ function withDefaults(schema: unknown, value: unknown): unknown {
122
+ if (!isNode(schema) || !isPlain(value) || !isNode(schema.properties))
123
+ return value
124
+
125
+ const fields: Record<string, unknown> = { ...value }
126
+
127
+ for (const [name, field] of Object.entries(schema.properties)) {
128
+ if (!isNode(field))
129
+ continue
130
+
131
+ // Elysia's `File` and `Files` carry their own name as a `default`, which no post is filled with.
132
+ if (fields[name] === undefined && field.default !== undefined && !isFileField(field))
133
+ fields[name] = structuredClone(field.default)
134
+ else if (fields[name] !== undefined)
135
+ fields[name] = withDefaults(field, fields[name])
136
+ }
137
+
138
+ return fields
139
+ }
140
+
141
+ // The keys an object that opted into `extra: 'strip'` is sent with that its shape lacks, dropped; `dropUnknown` does it for the top level unless the object takes any key, as `additionalProperties: true` or a schema for them says.
142
+ function stripped(schema: unknown, value: unknown, dropUnknown = false): unknown {
143
+ if (!isNode(schema))
144
+ return value
145
+
146
+ if (Array.isArray(value))
147
+ return isNode(schema.items) ? value.map(item => stripped(schema.items, item)) : value
148
+
149
+ if (!isPlain(value) || !isNode(schema.properties))
150
+ return value
151
+
152
+ const shape = schema.properties
153
+ const open = schema.additionalProperties === true || isNode(schema.additionalProperties)
154
+ const keep = schema['x-kay-extra'] !== 'strip' && (!dropUnknown || open)
155
+
156
+ return Object.fromEntries(Object.entries(value).filter(([name]) => keep || name in shape).map(([name, field]) => [name, name in shape ? stripped(shape[name], field) : field]))
157
+ }
158
+
159
+ // What a form posts for a list, a boolean or a number is text, and a blank list is the empty one: a top-level field read as its schema expects, the defaults of what was left out filled in.
160
+ function readText(schema: unknown, value: unknown, form: boolean, trim: boolean): unknown {
161
+ const input = isPlain(value) ? { ...value } : {}
162
+ const { properties, required = [] } = (isNode(schema) ? schema : {}) as { properties?: Record<string, Node>, required?: string[] }
163
+
164
+ for (const [name, field] of Object.entries(properties ?? {})) {
165
+ // A blank list is the empty one, as `persisted.query` writes it, never one blank item; a blank optional field with a default is left out, so the default fills in.
166
+ if (form && input[name] === '' && field.type === 'array')
167
+ input[name] = []
168
+ else if (form && input[name] === '' && field.default !== undefined && !required.includes(name))
169
+ delete input[name]
170
+ }
171
+
172
+ // The defaults go in before the text is read, so a list left out reads as its default and not as the empty list a form's missing list is.
173
+ return formInput(schema as TSchema, withDefaults(schema, input), form, form && trim)
174
+ }
175
+
176
+ function prepare(schema: unknown, value: unknown, source: Source, trim: boolean): unknown {
177
+ const read = source === 'json' ? withDefaults(schema, value) : readText(schema, value, source !== 'env' && source !== 'params', trim)
178
+
179
+ // A browser posts controls the app does not own, a named submit button or a widget: a form's unknown fields are dropped, where JSON and a query are strict.
180
+ return stripped(schema, read, source === 'form')
181
+ }
182
+
183
+ // Every place the value fails a schema, once each, the first reason for it.
184
+ // A value that passed, without the keys an object of the old builders, which names no `additionalProperties`, was sent beside its shape: they are dropped as Elysia dropped them, so a handler never reads a key its schema does not name. A union's value is cleaned by the member it matches.
185
+ function cleaned(schema: unknown, value: unknown): unknown {
186
+ if (!isNode(schema))
187
+ return value
188
+
189
+ if (Array.isArray(schema.anyOf)) {
190
+ const match = schema.anyOf.find(member => isNode(member) && matches(member, value))
191
+
192
+ return match === undefined ? value : cleaned(match, value)
193
+ }
194
+
195
+ if (Array.isArray(value))
196
+ return isNode(schema.items) ? value.map(item => cleaned(schema.items, item)) : value
197
+
198
+ if (!isPlain(value) || !isNode(schema.properties))
199
+ return value
200
+
201
+ const shape = schema.properties
202
+ // `false` refused the extra keys already; `true` or a schema keeps them.
203
+ const open = schema.additionalProperties !== undefined
204
+
205
+ return Object.fromEntries(Object.entries(value).filter(([name]) => open || Object.hasOwn(shape, name)).map(([name, field]) => [name, Object.hasOwn(shape, name) ? cleaned(shape[name], field) : field]))
206
+ }
207
+
208
+ function matches(member: Node, value: unknown): boolean {
209
+ try {
210
+ return compiledCheck(member as TSchema).Check(value)
211
+ }
212
+ catch {
213
+ // A member referring to a model by name compiles only with it: the value is then cleaned by none.
214
+ return false
215
+ }
216
+ }
217
+
218
+ function checked(schema: TSchema, source: Source, value: unknown, trim = true): Validated {
219
+ const view = source === 'json' ? strictView(schema) : schema
220
+ const check = compiledCheck(view)
221
+ const read = prepare(view, value, source, trim)
222
+
223
+ if (check.Check(read)) {
224
+ try {
225
+ return { value: check.Decode(cleaned(view, read)) }
226
+ }
227
+ catch (error) {
228
+ return refused([{ path: '', key: 'kay.invalid.type', params: {}, message: invalidWord('kay.invalid.type', error instanceof Error ? error.message : undefined) }])
229
+ }
230
+ }
231
+
232
+ const seen = new Set<string>()
233
+ const errors: Issue[] = []
234
+
235
+ for (const issue of withoutBlockUnions(check.Errors(read))) {
236
+ const path = dottedPath(issue.path)
237
+
238
+ if (seen.has(path))
239
+ continue
240
+
241
+ seen.add(path)
242
+
243
+ const { kind, params = {} } = schemaRefusal(issue)
244
+ const key = `kay.invalid.${kind}` as InvalidWord
245
+ const own = (issue.schema as { error?: unknown } | undefined)?.error
246
+ const rule = ruleOf(kind)
247
+ const custom = fieldMessage(schema, issue.path, rule) ?? errorText(own, rule)
248
+
249
+ errors.push({ path, key, params, message: custom ?? invalidWord(key, summaryOf(issue), params) })
250
+ }
251
+
252
+ return refused(errors)
253
+ }
254
+
255
+ // A file the schema gives a media type is checked by its bytes, as the browser's claim of its type is no proof: the fields of the top level, a list of files too.
256
+ async function wrongFiles(schema: TSchema, value: unknown): Promise<Issue[]> {
257
+ const { properties } = schema as { properties?: Record<string, Node & { items?: Node }> }
258
+
259
+ if (!isPlain(value) || properties === undefined)
260
+ return []
261
+
262
+ const wrong: Issue[] = []
263
+
264
+ for (const [name, field] of Object.entries(properties)) {
265
+ const extension = field.extension ?? field.items?.extension
266
+
267
+ if (extension === undefined || value[name] === undefined || (field.format !== 'binary' && field.items?.format !== 'binary'))
268
+ continue
269
+
270
+ try {
271
+ await fileType(value[name] as Blob, extension as string, `body.${name}`)
272
+ }
273
+ catch {
274
+ wrong.push({ path: name, key: 'kay.invalid.format', params: { format: 'file' }, message: fieldMessage(schema, `/${name}`, 'format') ?? kayWord('kay.action.invalidFile') })
275
+ }
276
+ }
277
+
278
+ return wrong
279
+ }
280
+
281
+ function refused(errors: Issue[]): Refusal {
282
+ return { errors, status: 422 }
283
+ }
284
+
285
+ // The dotted path of an issue of a Standard Schema validator: its path is a list of keys or of `{ key }`.
286
+ function standardPath(path: unknown): string {
287
+ return Array.isArray(path) ? path.map(step => String(isNode(step) ? step.key : step)).join('.') : ''
288
+ }
289
+
290
+ interface StandardResult {
291
+ value?: unknown
292
+ issues?: readonly { message?: string, path?: unknown }[]
293
+ }
294
+
295
+ // Any Standard Schema validator: its text sources are read by its JSON Schema when it has one, then it validates the value itself.
296
+ async function standard(schema: object, source: Source, value: unknown, trim: boolean): Promise<Validated> {
297
+ const rules = source === 'json' ? undefined : jsonSchemaOf(schema)
298
+ const read = rules === undefined ? value : prepare(rules, value, source, trim)
299
+ const result = await (schema as { '~standard': { validate: (value: unknown) => StandardResult | Promise<StandardResult> } })['~standard'].validate(read)
300
+
301
+ if (result.issues === undefined)
302
+ return { value: result.value }
303
+
304
+ const seen = new Set<string>()
305
+ const errors: Issue[] = []
306
+
307
+ for (const issue of result.issues) {
308
+ const path = standardPath(issue.path)
309
+
310
+ if (seen.has(path))
311
+ continue
312
+
313
+ seen.add(path)
314
+ errors.push({ path, key: 'kay.invalid.type', params: {}, message: issue.message ?? invalidWord('kay.invalid.type', undefined) })
315
+ }
316
+
317
+ return refused(errors)
318
+ }
319
+
320
+ // The value a schema reads from `source`, or where and why it is refused: the one path every input of kay goes through, an action's, an API route's, a socket's message, the environment and the browser's check of a form. A Standard Schema validator may be async, which a caller that cannot await reads with `validateNow`.
321
+ // kept: free, the locale and source come from its caller.
322
+ export async function validate<Value = unknown>(schema: object, value: unknown, { source, locale, trim = true }: ValidateOptions): Promise<Validated<Value>> {
323
+ const run = async (): Promise<Validated> => {
324
+ if (isStandardSchema(schema))
325
+ return standard(schema, source, value, trim)
326
+
327
+ const result = checked(schema as TSchema, source, value, trim)
328
+
329
+ if (isRefusal(result))
330
+ return result
331
+
332
+ const wrong = await wrongFiles(schema as TSchema, result.value)
333
+
334
+ return wrong.length > 0 ? refused(wrong) : result
335
+ }
336
+
337
+ return await (locale === undefined ? run() : runInLocale(locale, run)) as Validated<Value>
338
+ }
339
+
340
+ // `validate` for a caller that cannot await, such as the boot reading the environment; a Standard Schema validator answering with a promise is refused.
341
+ export function validateNow<Value = unknown>(schema: object, value: unknown, { source, locale, trim = true }: ValidateOptions): Validated<Value> {
342
+ if (isStandardSchema(schema))
343
+ throw new KayError('config-invalid', 'kay: validateNow reads a TypeBox schema, as a Standard Schema validator may answer with a promise: use validate')
344
+
345
+ return (locale === undefined ? checked(schema as TSchema, source, value, trim) : runInLocale(locale, () => checked(schema as TSchema, source, value, trim))) as Validated<Value>
346
+ }
package/src/test/mount.ts CHANGED
@@ -43,9 +43,13 @@ const SAFE_HTML_MODULE = /(?:^|[/\\])safe-html(?:\.ts)?$/
43
43
  // One bundle per component and version of its file, for the test process, evaluated again on every mount.
44
44
  const bundles = new Map<string, Promise<string>>()
45
45
 
46
- // Lets queued effects and timers due now land, as after a click, before the DOM is read.
46
+ // Lets queued effects and timers due now land, as after a click, before the DOM is read, and the components that load when they first draw arrive.
47
47
  export async function settle(): Promise<void> {
48
48
  await sleep(0)
49
+
50
+ // A second turn only after a component loaded, so a transition's first frame stays readable after a plain settle.
51
+ if (await (globalThis as { $kayLazyIdle?: () => Promise<boolean> }).$kayLazyIdle?.() === true)
52
+ await sleep(0)
49
53
  }
50
54
 
51
55
  // Keeps a value in localStorage as `persisted.local(key, initial)` does, or in sessionStorage as `persisted.session(key, initial)` does with `'session'`, encoded as island props are rather than as JSON, for a component mounted after to read.
@@ -182,7 +186,7 @@ async function bundle(root: string, file: string): Promise<string> {
182
186
 
183
187
  const loaded = await loadConfig(root)
184
188
  const trees = apiTrees(root, loaded)
185
- const config = { entrypoints: [join(work, 'entry.ts')], target: 'browser', metafile: true, define: { KAY_FRENCH: writesFrench(loaded) ? 'true' : 'undefined', KAY_I18N: loaded.i18n === undefined ? 'undefined' : 'true' }, plugins: [apiStubs(trees), kay({ root, settings: loaded.librarySettings, api: trees }), sharedMarks, sharedModules(trees.map(({ dir }) => dir))], throw: false } satisfies Bun.BuildConfig
189
+ const config = { entrypoints: [join(work, 'entry.ts')], target: 'browser', metafile: true, define: { KAY_FRENCH: writesFrench(loaded) ? 'true' : 'undefined', KAY_I18N: loaded.i18n === undefined ? 'undefined' : 'true' }, plugins: [apiStubs(trees), kay({ root, settings: loaded.librarySettings, api: trees, lazy: false }), sharedMarks, sharedModules(trees.map(({ dir }) => dir))], throw: false } satisfies Bun.BuildConfig
186
190
  const build = await Bun.build({ ...config, outdir: join(work, 'out') })
187
191
 
188
192
  if (!build.success) {
@@ -63,11 +63,12 @@ export declare function clientSession(root: string, options: ClientOptions, sett
63
63
  export declare function keepMaps(root: string, maps: string[]): Promise<void>;
64
64
  export declare function readClientSources(root: string, options?: ClientOptions, graph?: ImportGraph): Promise<ClientSources>;
65
65
  export declare function islandClassTableOf(root: string, sources: Pick<ClientSources, 'islands' | 'libraries' | 'shorthand'>, references: string[], graph?: ImportGraph): Promise<ClassTable | undefined>;
66
- declare function bundleIslands(root: string, islands: Map<string, string>, files: string[], actionForms: boolean, actionProps: boolean, options: ClientOptions, classTable?: ClassTable, islandTable?: ClassTable): Promise<{
66
+ interface Bundled {
67
67
  manifest: Omit<ClientManifest, 'styles'>;
68
68
  inputs: ChunkInputs;
69
69
  maps: string[];
70
- }>;
70
+ }
71
+ declare function bundleIslands(root: string, islands: Map<string, string>, files: string[], actionForms: boolean, actionProps: boolean, options: ClientOptions, classTable?: ClassTable, islandTable?: ClassTable, iconSlots?: ReadonlySet<string>): Promise<Bundled>;
71
72
  declare function bundleStyles(root: string, { pages, files, libraries, classes, shorthand, islands }: Pick<ClientSources, 'pages' | 'files' | 'libraries' | 'classes' | 'shorthand' | 'islands'>, options: ClientOptions): Promise<{
72
73
  styles: Record<string, string>;
73
74
  inputs: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/build/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE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O,EAAE,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC,CAwE3W;AAKD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,IAAI,CAOzG;AAOD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CA+CxJ"}
@@ -0,0 +1,4 @@
1
+ export declare const KAY_OUTPUT: RegExp;
2
+ export declare function entryFile(root: string, entryPoint: string, files: Set<string>): string | undefined;
3
+ export declare function lazyEntryKey(root: string, islandFiles: Set<string>): (entryPoint: string) => string | undefined;
4
+ //# sourceMappingURL=entry-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-files.d.ts","sourceRoot":"","sources":["../../src/build/entry-files.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,QAA4B,CAAA;AAInD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAIlG;AAGD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAE/G"}
@@ -0,0 +1,7 @@
1
+ import type { ImportGraph, KayLibrary } from './libraries';
2
+ export declare const REGISTRY_FILE: RegExp;
3
+ export declare function isUiRegistry(file: string): boolean;
4
+ export declare function iconSlotsOf(root: string, entries: Iterable<string>, libraries: KayLibrary[], graph?: ImportGraph): Promise<ReadonlySet<string> | undefined>;
5
+ export declare function registryWith(source: string, slots: ReadonlySet<string>): string;
6
+ export declare function slotsKey(slots: ReadonlySet<string> | undefined): string;
7
+ //# sourceMappingURL=icon-slots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-slots.d.ts","sourceRoot":"","sources":["../../src/build/icon-slots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAyB1D,eAAO,MAAM,aAAa,QAAsG,CAAA;AAGhI,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOlD;AAoBD,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CA8DjK;AAMD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAW/E;AAGD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,CAEvE"}
@@ -0,0 +1,6 @@
1
+ import type { ImportedComponents } from '../compiler/lazy-imports';
2
+ export declare function lazyKey(root: string, path: string): string;
3
+ export declare function keepEager(keys: Iterable<string>): boolean;
4
+ export declare function eagerKeys(): string[];
5
+ export declare function importedComponents(file: string, source: string, root: string): ImportedComponents;
6
+ //# sourceMappingURL=lazy-components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy-components.d.ts","sourceRoot":"","sources":["../../src/build/lazy-components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AA4ErF,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAI1D;AAMD,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,OAAO,CAOzD;AAGD,wBAAgB,SAAS,IAAI,MAAM,EAAE,CAEpC;AAaD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAkBjG"}
@@ -0,0 +1,19 @@
1
+ type Outputs = Record<string, {
2
+ imports: {
3
+ kind: string;
4
+ path: string;
5
+ }[];
6
+ }>;
7
+ export declare function noteLazy(manifest: {
8
+ lazies?: Record<string, string[]> | undefined;
9
+ }, key: string, file: string, chunks: string[]): void;
10
+ export declare function staticClosure(outputs: Outputs, output: string, seen?: Set<string>): Set<string>;
11
+ type Entries = Record<string, {
12
+ entryPoint?: string | undefined;
13
+ inputs?: Record<string, {
14
+ bytesInOutput?: number | undefined;
15
+ }> | undefined;
16
+ }>;
17
+ export declare function stubKeys(outputs: Entries, keyOf: (entryPoint: string) => string | undefined): string[];
18
+ export {};
19
+ //# sourceMappingURL=lazy-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy-manifest.d.ts","sourceRoot":"","sources":["../../src/build/lazy-manifest.ts"],"names":[],"mappings":"AAAA,KAAK,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAAA;AAG5E,wBAAgB,QAAQ,CAAC,QAAQ,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAA;CAAE,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAOvI;AAGD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,cAAoB,GAAG,GAAG,CAAC,MAAM,CAAC,CAWrG;AAED,KAAK,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,CAAC,GAAG,SAAS,CAAA;CAAE,CAAC,CAAA;AAM/I,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAuBtG"}
@@ -0,0 +1,5 @@
1
+ export declare function foldStubs(build: Bun.BuildOutput, nav: {
2
+ build: Bun.BuildOutput;
3
+ } | undefined, last: boolean, keyOf: (entryPoint: string) => string | undefined): Promise<void>;
4
+ export declare function inRounds<T>(run: (last: boolean) => Promise<T>): Promise<T>;
5
+ //# sourceMappingURL=lazy-stubs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lazy-stubs.d.ts","sourceRoot":"","sources":["../../src/build/lazy-stubs.ts"],"names":[],"mappings":"AAUA,wBAAsB,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,EAAE;IAAE,KAAK,EAAE,GAAG,CAAC,WAAW,CAAA;CAAE,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAOpL;AAGD,wBAAsB,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAUhF"}
@@ -29,6 +29,8 @@ export interface KayCopy {
29
29
  to: string;
30
30
  }
31
31
  export declare function packageRoot(dir: string): string;
32
+ export declare function linkedOutside(root: string, path: string): boolean;
33
+ export declare function extensionPackages(root: string, libraries: KayLibrary[], extensionDirs: string[]): Promise<KayLibrary[]>;
32
34
  export declare function libraryOf(libraries: KayLibrary[], file: string): KayLibrary | undefined;
33
35
  export declare function throughNodeModules(library: KayLibrary, file: string): string;
34
36
  export declare function exportsFile(library: KayLibrary, file: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"libraries.d.ts","sourceRoot":"","sources":["../../src/build/libraries.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IAEZ,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,EAAE,CAAA;IAEf,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAE/B,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,SAAS,CAAA;IAEvC,SAAS,CAAC,EAAE,IAAI,CAAA;CACjB;AAGD,MAAM,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE9C,UAAU,OAAO;IACf,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;IACrB,KAAK,E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AM,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAe7F;AAID,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAmCxH;AAID,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,EAAE,UAAU,UAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,UAAU,GAAG,SAAS,CAAA;CAAE,EAAE,CAqBlM;AA0CD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAyBpD;AAmCD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAIhD;AAGD,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAEhF;AAeD,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAa7C"}
@@ -15,6 +15,7 @@ export interface KayPluginOptions {
15
15
  anchored?: ReadonlySet<string> | undefined;
16
16
  inspect?: boolean | undefined;
17
17
  classTable?: ClassTable | undefined;
18
+ lazy?: boolean | undefined;
18
19
  api?: RouteMount[] | undefined;
19
20
  external?: string[] | undefined;
20
21
  localeLinks?: boolean | undefined;
@@ -24,6 +25,7 @@ export interface KayPluginOptions {
24
25
  componentFiles?: boolean | undefined;
25
26
  rewrite?: ((file: string, source: string) => string) | undefined;
26
27
  variants?: VariantIndex | undefined;
28
+ iconSlots?: ReadonlySet<string> | undefined;
27
29
  }
28
30
  export declare function kay(options?: KayPluginOptions): BunPlugin;
29
31
  export declare function kayPlugin(options: KayPluginOptions, workers: string[]): BunPlugin;