@kayjs/kay 1.106.0 → 1.107.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.
- package/README.md +2 -2
- package/dist/eslint.js +428 -176
- package/editors/zed/extension.toml +2 -2
- package/llms/action-protection.md +1 -1
- package/llms/actions-refused-fields.md +22 -0
- package/llms/actions.md +2 -22
- package/llms/browser-only.md +1 -1
- package/llms/compiler-api.md +1 -1
- package/llms/components.md +1 -1
- package/llms/deprecated-lints.md +2 -3
- package/llms/island-and-form-lints.md +1 -0
- package/llms/islands.md +10 -1
- package/llms/project-new-and-add.md +1 -1
- package/llms/project.md +2 -2
- package/llms/schemas.md +6 -4
- package/llms/upgrading.md +19 -1
- package/llms/whats-new.md +14 -1
- package/package.json +15 -6
- package/src/build/client.ts +20 -24
- package/src/build/entry-files.ts +19 -0
- package/src/build/lazy-components.ts +130 -0
- package/src/build/lazy-manifest.ts +56 -0
- package/src/build/lazy-stubs.ts +31 -0
- package/src/build/plugin.ts +3 -1
- package/src/build/runtime-chunk.ts +1 -1
- package/src/build/transform.ts +17 -7
- package/src/build/variants.ts +7 -4
- package/src/check/action-options.ts +56 -0
- package/src/check/schema-json.ts +226 -0
- package/src/check/shadow-types.ts +11 -9
- package/src/compiler/codegen.ts +7 -17
- package/src/compiler/deprecated-lints-1-105.ts +41 -0
- package/src/compiler/deprecated-lints-1-106.ts +1 -1
- package/src/compiler/deprecated-lints-1-107.ts +14 -0
- package/src/compiler/deprecated-lints.ts +7 -55
- package/src/compiler/import-edits.ts +15 -0
- package/src/compiler/index.ts +8 -3
- package/src/compiler/island-declaration.ts +15 -0
- package/src/compiler/kay-exports.ts +1 -0
- package/src/compiler/lazy-imports.ts +357 -0
- package/src/compiler/parser.ts +2 -2
- package/src/compiler/route-lints.ts +2 -0
- package/src/compiler/schema-lints.ts +13 -0
- package/src/compiler/script-server.ts +6 -3
- package/src/content/validate.ts +1 -1
- package/src/new.ts +6 -2
- package/src/runtime/action.ts +47 -4
- package/src/runtime/client.ts +10 -0
- package/src/runtime/dom-lazy.ts +276 -0
- package/src/runtime/field-errors.ts +58 -0
- package/src/runtime/field-refusal.ts +179 -0
- package/src/runtime/form.ts +3 -2
- package/src/runtime/html.ts +6 -1
- package/src/runtime/index.ts +2 -0
- package/src/runtime/island.server.ts +36 -2
- package/src/runtime/schema-record.ts +2 -1
- package/src/runtime/schema.client.ts +104 -14
- package/src/runtime/schema.ts +9 -2
- package/src/runtime/standard-schema.ts +32 -0
- package/src/runtime/validate-run.client.ts +179 -0
- package/src/runtime/validate.client.ts +11 -0
- package/src/runtime/validate.ts +4 -137
- package/src/server/actions.ts +48 -43
- package/src/server/answer.ts +102 -0
- package/src/server/api-input.ts +166 -0
- package/src/server/api.ts +12 -44
- package/src/server/app-stages.ts +15 -8
- package/src/server/app.ts +5 -2
- package/src/server/client.ts +2 -0
- package/src/server/dev.ts +7 -9
- package/src/server/file-limit.ts +7 -1
- package/src/server/forms.ts +1 -1
- package/src/server/host-allowlist.ts +7 -7
- package/src/server/index.ts +2 -0
- package/src/server/kay-routes.ts +221 -0
- package/src/server/kay-server.ts +228 -0
- package/src/server/kept-exports.ts +1 -0
- package/src/server/library.ts +0 -2
- package/src/server/mcp.ts +1 -1
- package/src/server/openapi.ts +12 -3
- package/src/server/phases.ts +249 -0
- package/src/server/protection.ts +6 -6
- package/src/server/proxy-key.ts +8 -8
- package/src/server/query.ts +4 -25
- package/src/server/receive.ts +43 -0
- package/src/server/render-document.ts +13 -3
- package/src/server/request-context.ts +137 -0
- package/src/server/schema-check.ts +1 -1
- package/src/server/socket.ts +19 -47
- package/src/server/stream.ts +1 -1
- package/src/server/validate.ts +346 -0
- package/src/test/mount.ts +6 -2
- package/types/build/client.d.ts +3 -2
- package/types/build/client.d.ts.map +1 -1
- package/types/build/entry-files.d.ts +4 -0
- package/types/build/entry-files.d.ts.map +1 -0
- package/types/build/lazy-components.d.ts +6 -0
- package/types/build/lazy-components.d.ts.map +1 -0
- package/types/build/lazy-manifest.d.ts +19 -0
- package/types/build/lazy-manifest.d.ts.map +1 -0
- package/types/build/lazy-stubs.d.ts +5 -0
- package/types/build/lazy-stubs.d.ts.map +1 -0
- package/types/build/plugin.d.ts +1 -0
- package/types/build/plugin.d.ts.map +1 -1
- package/types/build/transform.d.ts +3 -1
- package/types/build/transform.d.ts.map +1 -1
- package/types/build/variants.d.ts.map +1 -1
- package/types/check/action-options.d.ts +3 -0
- package/types/check/action-options.d.ts.map +1 -0
- package/types/check/schema-json.d.ts +3 -0
- package/types/check/schema-json.d.ts.map +1 -0
- package/types/check/shadow-types.d.ts.map +1 -1
- package/types/compiler/codegen.d.ts +2 -0
- package/types/compiler/codegen.d.ts.map +1 -1
- package/types/compiler/deprecated-lints-1-105.d.ts +39 -0
- package/types/compiler/deprecated-lints-1-105.d.ts.map +1 -0
- package/types/compiler/deprecated-lints-1-106.d.ts +1 -1
- package/types/compiler/deprecated-lints-1-106.d.ts.map +1 -1
- package/types/compiler/deprecated-lints-1-107.d.ts +12 -0
- package/types/compiler/deprecated-lints-1-107.d.ts.map +1 -0
- package/types/compiler/deprecated-lints.d.ts +36 -44
- package/types/compiler/deprecated-lints.d.ts.map +1 -1
- package/types/compiler/import-edits.d.ts +1 -0
- package/types/compiler/import-edits.d.ts.map +1 -1
- package/types/compiler/index.d.ts +2 -0
- package/types/compiler/index.d.ts.map +1 -1
- package/types/compiler/island-declaration.d.ts +5 -0
- package/types/compiler/island-declaration.d.ts.map +1 -1
- package/types/compiler/kay-exports.d.ts.map +1 -1
- package/types/compiler/lazy-imports.d.ts +33 -0
- package/types/compiler/lazy-imports.d.ts.map +1 -0
- package/types/compiler/lints.d.ts +44 -44
- package/types/compiler/route-lints.d.ts +8 -0
- package/types/compiler/route-lints.d.ts.map +1 -1
- package/types/compiler/schema-lints.d.ts +11 -0
- package/types/compiler/schema-lints.d.ts.map +1 -0
- package/types/compiler/script-server.d.ts.map +1 -1
- package/types/new.d.ts +1 -0
- package/types/new.d.ts.map +1 -1
- package/types/runtime/action.d.ts +26 -1
- package/types/runtime/action.d.ts.map +1 -1
- package/types/runtime/client.d.ts.map +1 -1
- package/types/runtime/dom-lazy.d.ts +6 -0
- package/types/runtime/dom-lazy.d.ts.map +1 -0
- package/types/runtime/field-errors.d.ts +4 -0
- package/types/runtime/field-errors.d.ts.map +1 -0
- package/types/runtime/field-refusal.d.ts +37 -0
- package/types/runtime/field-refusal.d.ts.map +1 -0
- package/types/runtime/form.d.ts +1 -1
- package/types/runtime/form.d.ts.map +1 -1
- package/types/runtime/html.d.ts.map +1 -1
- package/types/runtime/index.d.ts +2 -0
- package/types/runtime/index.d.ts.map +1 -1
- package/types/runtime/island.server.d.ts +2 -0
- package/types/runtime/island.server.d.ts.map +1 -1
- package/types/runtime/schema-record.d.ts.map +1 -1
- package/types/runtime/schema.client.d.ts.map +1 -1
- package/types/runtime/schema.d.ts +6 -1
- package/types/runtime/schema.d.ts.map +1 -1
- package/types/runtime/standard-schema.d.ts +37 -0
- package/types/runtime/standard-schema.d.ts.map +1 -0
- package/types/runtime/validate-run.client.d.ts +4 -0
- package/types/runtime/validate-run.client.d.ts.map +1 -0
- package/types/runtime/validate.client.d.ts +4 -0
- package/types/runtime/validate.client.d.ts.map +1 -0
- package/types/runtime/validate.d.ts +1 -21
- package/types/runtime/validate.d.ts.map +1 -1
- package/types/server/actions.d.ts.map +1 -1
- package/types/server/answer.d.ts +6 -0
- package/types/server/answer.d.ts.map +1 -0
- package/types/server/api-input.d.ts +19 -0
- package/types/server/api-input.d.ts.map +1 -0
- package/types/server/api.d.ts.map +1 -1
- package/types/server/app-stages.d.ts +4 -1
- package/types/server/app-stages.d.ts.map +1 -1
- package/types/server/app.d.ts +2 -0
- package/types/server/app.d.ts.map +1 -1
- package/types/server/client.d.ts +1 -0
- package/types/server/client.d.ts.map +1 -1
- package/types/server/dev.d.ts +1 -1
- package/types/server/dev.d.ts.map +1 -1
- package/types/server/file-limit.d.ts.map +1 -1
- package/types/server/host-allowlist.d.ts +3 -3
- package/types/server/host-allowlist.d.ts.map +1 -1
- package/types/server/index.d.ts +2 -0
- package/types/server/index.d.ts.map +1 -1
- package/types/server/kay-routes.d.ts +47 -0
- package/types/server/kay-routes.d.ts.map +1 -0
- package/types/server/kay-server.d.ts +25 -0
- package/types/server/kay-server.d.ts.map +1 -0
- package/types/server/kept-exports.d.ts.map +1 -1
- package/types/server/library.d.ts +0 -1
- package/types/server/library.d.ts.map +1 -1
- package/types/server/openapi.d.ts.map +1 -1
- package/types/server/phases.d.ts +36 -0
- package/types/server/phases.d.ts.map +1 -0
- package/types/server/protection.d.ts +3 -2
- package/types/server/protection.d.ts.map +1 -1
- package/types/server/proxy-key.d.ts +3 -3
- package/types/server/proxy-key.d.ts.map +1 -1
- package/types/server/query.d.ts.map +1 -1
- package/types/server/receive.d.ts +9 -0
- package/types/server/receive.d.ts.map +1 -0
- package/types/server/render-document.d.ts.map +1 -1
- package/types/server/request-context.d.ts +29 -0
- package/types/server/request-context.d.ts.map +1 -0
- package/types/server/schema-check.d.ts +1 -0
- package/types/server/schema-check.d.ts.map +1 -1
- package/types/server/socket.d.ts +3 -5
- package/types/server/socket.d.ts.map +1 -1
- package/types/server/validate.d.ts +26 -0
- package/types/server/validate.d.ts.map +1 -0
- package/types/test/mount.d.ts.map +1 -1
- package/src/check/schema-type.ts +0 -9
- package/src/compiler/deprecated-script-fence.ts +0 -26
- package/src/server/field-errors.ts +0 -136
- package/types/check/schema-type.d.ts +0 -3
- package/types/check/schema-type.d.ts.map +0 -1
- package/types/compiler/deprecated-script-fence.d.ts +0 -3
- package/types/compiler/deprecated-script-fence.d.ts.map +0 -1
- package/types/server/field-errors.d.ts +0 -6
- package/types/server/field-errors.d.ts.map +0 -1
package/src/server/socket.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Elysia } from 'elysia'
|
|
2
|
-
import {
|
|
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:
|
|
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',
|
|
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
|
|
253
|
-
// Elysia's validation is left out of the route and done here,
|
|
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: {
|
|
259
|
-
const
|
|
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 (
|
|
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
|
-
|
|
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 (
|
|
299
|
-
return
|
|
270
|
+
if (!isRefusal(result))
|
|
271
|
+
return { value: result.value }
|
|
300
272
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
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
|
}
|
package/src/server/stream.ts
CHANGED
|
@@ -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) {
|
package/types/build/client.d.ts
CHANGED
|
@@ -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
|
-
|
|
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): 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,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGnE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;
|
|
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,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW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,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,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"}
|
package/types/build/plugin.d.ts
CHANGED
|
@@ -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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources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,EAAE,MAAM,GAAG,SAAS,CAAA;IAE3B,QAAQ,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;IAE1C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAE7B,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IAEnC,IAAI,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAE1B,GAAG,CAAC,EAAE,UAAU,EAAE,GAAG,SAAS,CAAA;IAC9B,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAE/B,WAAW,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAEjC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAE5B,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAE/B,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IAEhD,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IAEpC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IAEhE,QAAQ,CAAC,EAAE,YAAY,GAAG,SAAS,CAAA;CACpC;AA4ED,wBAAgB,GAAG,CAAC,OAAO,GAAE,gBAAqB,GAAG,SAAS,CAE7D;AAGD,wBAAgB,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAqNjF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Diagnostic } from '../compiler';
|
|
2
2
|
import type { ErrorName } from '../compiler/errors';
|
|
3
3
|
import type { IslandCause } from '../compiler/island-cause';
|
|
4
|
+
import type { ImportedComponents } from '../compiler/lazy-imports';
|
|
4
5
|
import type { LintLevels } from '../compiler/lints';
|
|
5
6
|
import type { ImportedSignals } from '../compiler/module-signals';
|
|
6
7
|
import type { ClassTable } from '../runtime/class-table';
|
|
@@ -18,6 +19,7 @@ export interface TransformOptions {
|
|
|
18
19
|
variant?: string | undefined;
|
|
19
20
|
writtenProps?: ReadonlySet<string> | undefined;
|
|
20
21
|
classMerge?: boolean | undefined;
|
|
22
|
+
lazy?: boolean | undefined;
|
|
21
23
|
}
|
|
22
24
|
export interface Analysis {
|
|
23
25
|
island?: string | undefined;
|
|
@@ -36,7 +38,7 @@ export declare class KayCompileError extends Error {
|
|
|
36
38
|
readonly code: ErrorName;
|
|
37
39
|
constructor(diagnostics: FileDiagnostic[]);
|
|
38
40
|
}
|
|
39
|
-
export declare function transformKay(source: string, filename: string, options: TransformOptions, signals?: ImportedSignals): string;
|
|
41
|
+
export declare function transformKay(source: string, filename: string, options: TransformOptions, signals?: ImportedSignals, components?: ImportedComponents): string;
|
|
40
42
|
export declare function transformKayCached(original: string, filename: string, given: TransformOptions): Promise<string>;
|
|
41
43
|
export declare function embeddedMapCached(source: string, filename: string, code: string, cacheDir: string | undefined): Promise<string | undefined>;
|
|
42
44
|
export declare function analyzeKayCached(source: string, filename: string, root: string, cacheDir: string, check?: boolean, lints?: LintLevels, component?: boolean, page?: boolean): Promise<Analysis>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/build/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,S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