@kayjs/kay 1.108.0 → 1.110.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/dist/eslint.js +2093 -3774
- package/editors/zed/extension.toml +2 -2
- package/llms/action-protection.md +1 -1
- package/llms/actions-from-islands.md +5 -5
- package/llms/actions-refused-fields.md +4 -4
- package/llms/api-from-islands.md +6 -6
- package/llms/browser-only.md +2 -2
- package/llms/cdn-caching.md +1 -1
- package/llms/checks.md +1 -1
- package/llms/code-lints.md +1 -2
- package/llms/component-library-conventions.md +1 -1
- package/llms/components.md +5 -5
- package/llms/deprecated-lints.md +2 -7
- package/llms/effects.md +1 -1
- package/llms/errors.md +2 -2
- package/llms/events.md +1 -1
- package/llms/guards.md +1 -1
- package/llms/head.md +1 -1
- package/llms/hooks.md +2 -2
- package/llms/images.md +1 -1
- package/llms/island-and-form-lints.md +4 -2
- package/llms/island-sources.md +1 -1
- package/llms/islands-state-to-ids.md +2 -2
- package/llms/islands.md +8 -4
- package/llms/lints.md +1 -1
- package/llms/live-values.md +4 -4
- package/llms/local-collections.md +1 -1
- package/llms/locales.md +1 -1
- package/llms/mcp.md +2 -2
- package/llms/metrics.md +1 -1
- package/llms/navigation-from-code.md +7 -7
- package/llms/navigation.md +4 -2
- package/llms/prerendering.md +1 -0
- package/llms/production.md +2 -2
- package/llms/project-new-and-add.md +1 -1
- package/llms/project.md +4 -4
- package/llms/proxy-and-security.md +1 -1
- package/llms/queues.md +1 -1
- package/llms/rate-limits.md +4 -4
- package/llms/rendering.md +1 -1
- package/llms/server-islands.md +2 -2
- package/llms/server.md +1 -1
- package/llms/stores.md +1 -1
- package/llms/styles-and-assets.md +1 -1
- package/llms/templates-elements-slots-snippets.md +2 -2
- package/llms/testing-mount.md +49 -0
- package/llms/testing.md +4 -45
- package/llms/upgrading-1-105-config.md +13 -13
- package/llms/upgrading-archive.md +64 -74
- package/llms/upgrading.md +92 -70
- package/llms/whats-new.md +24 -0
- package/llms.txt +5 -6
- package/package.json +6 -10
- package/src/build/route-sizes.ts +2 -3
- package/src/build/variants.ts +132 -18
- package/src/check/browser-global-reads.ts +2 -2
- package/src/check/config-objects.ts +1 -1
- package/src/check/diagnose.ts +0 -22
- package/src/check/env-types.ts +1 -1
- package/src/check/export-homes.ts +1 -1
- package/src/check/guards.ts +3 -3
- package/src/check/index.ts +2 -7
- package/src/check/moved-keys.ts +1 -1
- package/src/check/project.ts +6 -7
- package/src/check/schema-builders.ts +125 -26
- package/src/check/shadow-types.ts +0 -86
- package/src/commands/check.ts +2 -2
- package/src/commands/env.ts +25 -3
- package/src/commands/upgrade.ts +2 -1
- package/src/compiler/allow-comments.ts +38 -2
- package/src/compiler/ast.ts +21 -19
- package/src/compiler/browser.ts +2 -14
- package/src/compiler/class-items.ts +16 -0
- package/src/compiler/codegen.ts +10 -10
- package/src/compiler/deprecated-library.ts +0 -12
- package/src/compiler/deprecated-lints-1-106.ts +2 -2
- package/src/compiler/deprecated-lints.ts +3 -495
- package/src/compiler/deprecated-ui-props.ts +5 -5
- package/src/compiler/errors.ts +2 -2
- package/src/compiler/fence-checks.ts +2 -121
- package/src/compiler/hand-parts.ts +83 -0
- package/src/compiler/helper-imports.ts +2 -2
- package/src/compiler/image-attributes.ts +1 -3
- package/src/compiler/index.ts +23 -23
- package/src/compiler/island-arguments.ts +17 -95
- package/src/compiler/island-cause.ts +7 -7
- package/src/compiler/island-declaration.ts +2 -8
- package/src/compiler/island-lints.ts +19 -0
- package/src/compiler/island-marker.ts +3 -3
- package/src/compiler/island-problems.ts +25 -0
- package/src/compiler/items.ts +12 -0
- package/src/compiler/jsx-class.ts +1 -25
- package/src/compiler/jsx.ts +7 -6
- package/src/compiler/kay-exports.ts +0 -2
- package/src/compiler/link-flags.ts +9 -38
- package/src/compiler/lints.ts +10 -18
- package/src/compiler/markup.ts +33 -41
- package/src/compiler/module-signals.ts +2 -2
- package/src/compiler/names.ts +1 -1
- package/src/compiler/page-settings.ts +11 -0
- package/src/compiler/parser.ts +6 -8
- package/src/compiler/plan.ts +1 -3
- package/src/compiler/removed-lints.ts +90 -0
- package/src/compiler/rewrite.ts +3 -18
- package/src/compiler/script-server.ts +8 -3
- package/src/compiler/signal-from-prop.ts +141 -0
- package/src/compiler/template-reads.ts +16 -0
- package/src/compiler/validate.ts +3 -8
- package/src/config-loader.ts +14 -4
- package/src/config-resolve.ts +18 -142
- package/src/config-shape.ts +44 -34
- package/src/config.ts +10 -114
- package/src/dev/preload.ts +4 -1
- package/src/lsp/server.ts +4 -0
- package/src/migrate/markup.ts +4 -1
- package/src/runtime/action-call.ts +0 -8
- package/src/runtime/action-encode.ts +26 -0
- package/src/runtime/action-error.ts +3 -11
- package/src/runtime/action-protection.ts +2 -2
- package/src/runtime/action-run.ts +2 -27
- package/src/runtime/action-shared.ts +14 -37
- package/src/runtime/action-stream.ts +0 -1
- package/src/runtime/action.ts +1 -1
- package/src/runtime/call-result.ts +2 -10
- package/src/runtime/checks.ts +25 -13
- package/src/runtime/client.ts +7 -11
- package/src/runtime/core.ts +5 -23
- package/src/runtime/dom.ts +1 -1
- package/src/runtime/html.ts +1 -1
- package/src/runtime/i18n.client.ts +1 -4
- package/src/runtime/i18n.server.ts +1 -4
- package/src/runtime/i18n.ts +3 -3
- package/src/runtime/image.ts +2 -19
- package/src/runtime/index.ts +3 -3
- package/src/runtime/island.server.ts +56 -13
- package/src/runtime/live-resource.server.ts +0 -1
- package/src/runtime/live-value.server.ts +2 -2
- package/src/runtime/live-value.shared.ts +7 -20
- package/src/runtime/live.ts +1 -12
- package/src/runtime/local-types.ts +1 -11
- package/src/runtime/local.ts +4 -14
- package/src/runtime/navigate-api.ts +2 -5
- package/src/runtime/navigate.ts +9 -0
- package/src/runtime/navigation-state.ts +0 -12
- package/src/runtime/navigation.ts +5 -1
- package/src/runtime/page-swap.ts +8 -8
- package/src/runtime/persist.ts +11 -3
- package/src/runtime/persisted.ts +4 -30
- package/src/runtime/presence.ts +6 -7
- package/src/runtime/query-param.ts +20 -12
- package/src/runtime/reactive.ts +3 -1
- package/src/runtime/refuse.ts +3 -17
- package/src/runtime/store-base.ts +4 -6
- package/src/runtime/swap-fetch.ts +1 -1
- package/src/runtime/swap-flight.ts +10 -10
- package/src/runtime/swap-kept.ts +69 -29
- package/src/runtime/swap-morph.ts +49 -9
- package/src/runtime/text-hash.ts +17 -0
- package/src/runtime/uid.server.ts +6 -4
- package/src/runtime/values.ts +52 -23
- package/src/runtime/with-query.ts +9 -0
- package/src/server/action-hooks.ts +8 -8
- package/src/server/actions.ts +13 -14
- package/src/server/api-modules.ts +2 -3
- package/src/server/app-stages.ts +15 -33
- package/src/server/app.ts +10 -5
- package/src/server/auth-mails.ts +0 -2
- package/src/server/env-state.ts +40 -10
- package/src/server/flash.ts +1 -1
- package/src/server/guard-requirement.ts +4 -4
- package/src/server/image.ts +2 -2
- package/src/server/index.ts +0 -2
- package/src/server/job-context.ts +3 -3
- package/src/server/jobs-page.ts +1 -1
- package/src/server/jobs.ts +5 -9
- package/src/server/kept-exports.ts +0 -2
- package/src/server/kv.ts +11 -14
- package/src/server/library.ts +1 -3
- package/src/server/live.ts +2 -2
- package/src/server/mcp.ts +3 -9
- package/src/server/metrics.ts +2 -4
- package/src/server/page-settings.ts +10 -19
- package/src/server/prerender.ts +19 -2
- package/src/server/protection.ts +15 -18
- package/src/server/queue.ts +3 -6
- package/src/server/rate-limit.ts +0 -3
- package/src/server/render-document.ts +9 -7
- package/src/server/render.ts +1 -1
- package/src/server/routes.ts +7 -3
- package/src/server/scope.ts +3 -2
- package/src/server/session.ts +5 -6
- package/src/server/setup.ts +1 -1
- package/src/server/signals.ts +17 -7
- package/src/server/signed.ts +1 -3
- package/src/server/source.ts +20 -4
- package/src/server/speculation.ts +1 -1
- package/src/server/storage.ts +3 -8
- package/src/server/validate.ts +1 -1
- package/src/server/vitals.ts +1 -3
- package/src/server/work-scope.ts +2 -4
- package/src/server/work.ts +1 -1
- package/src/server/workflow.ts +1 -1
- package/src/test/index.ts +2 -1
- package/src/test/site-actions.ts +16 -6
- package/src/test/site-keys.ts +10 -15
- package/src/test/site-socket.ts +1 -2
- package/src/test/site-types.ts +0 -8
- package/types/build/route-sizes.d.ts.map +1 -1
- package/types/build/variants.d.ts +9 -1
- package/types/build/variants.d.ts.map +1 -1
- package/types/check/diagnose.d.ts.map +1 -1
- package/types/check/index.d.ts +1 -2
- package/types/check/index.d.ts.map +1 -1
- package/types/check/project.d.ts.map +1 -1
- package/types/check/schema-builders.d.ts.map +1 -1
- package/types/check/shadow-types.d.ts.map +1 -1
- package/types/commands/env.d.ts.map +1 -1
- package/types/commands/upgrade.d.ts.map +1 -1
- package/types/compiler/allow-comments.d.ts +2 -0
- package/types/compiler/allow-comments.d.ts.map +1 -1
- package/types/compiler/ast.d.ts +1 -2
- package/types/compiler/ast.d.ts.map +1 -1
- package/types/compiler/browser.d.ts.map +1 -1
- package/types/compiler/class-items.d.ts +7 -0
- package/types/compiler/class-items.d.ts.map +1 -0
- package/types/compiler/deprecated-library.d.ts.map +1 -1
- package/types/compiler/deprecated-lints-1-106.d.ts +2 -2
- package/types/compiler/deprecated-lints-1-106.d.ts.map +1 -1
- package/types/compiler/deprecated-lints.d.ts +2 -553
- package/types/compiler/deprecated-lints.d.ts.map +1 -1
- package/types/compiler/deprecated-ui-props.d.ts +1 -8
- package/types/compiler/deprecated-ui-props.d.ts.map +1 -1
- package/types/compiler/errors.d.ts +2 -2
- package/types/compiler/errors.d.ts.map +1 -1
- package/types/compiler/fence-checks.d.ts +0 -1
- package/types/compiler/fence-checks.d.ts.map +1 -1
- package/types/compiler/hand-parts.d.ts +10 -0
- package/types/compiler/hand-parts.d.ts.map +1 -0
- package/types/compiler/image-attributes.d.ts +0 -1
- package/types/compiler/image-attributes.d.ts.map +1 -1
- package/types/compiler/index.d.ts.map +1 -1
- package/types/compiler/island-arguments.d.ts +7 -11
- package/types/compiler/island-arguments.d.ts.map +1 -1
- package/types/compiler/island-cause.d.ts +1 -1
- package/types/compiler/island-cause.d.ts.map +1 -1
- package/types/compiler/island-declaration.d.ts +1 -3
- package/types/compiler/island-declaration.d.ts.map +1 -1
- package/types/compiler/island-lints.d.ts +17 -0
- package/types/compiler/island-lints.d.ts.map +1 -0
- package/types/compiler/island-problems.d.ts +7 -0
- package/types/compiler/island-problems.d.ts.map +1 -0
- package/types/compiler/items.d.ts +1 -0
- package/types/compiler/items.d.ts.map +1 -1
- package/types/compiler/jsx-class.d.ts +1 -2
- package/types/compiler/jsx-class.d.ts.map +1 -1
- package/types/compiler/jsx.d.ts.map +1 -1
- package/types/compiler/kay-exports.d.ts.map +1 -1
- package/types/compiler/link-flags.d.ts +0 -6
- package/types/compiler/link-flags.d.ts.map +1 -1
- package/types/compiler/lints.d.ts +21 -566
- package/types/compiler/lints.d.ts.map +1 -1
- package/types/compiler/markup.d.ts +1 -1
- package/types/compiler/markup.d.ts.map +1 -1
- package/types/compiler/module-signals.d.ts.map +1 -1
- package/types/compiler/names.d.ts.map +1 -1
- package/types/compiler/page-settings.d.ts +4 -0
- package/types/compiler/page-settings.d.ts.map +1 -1
- package/types/compiler/parser.d.ts.map +1 -1
- package/types/compiler/plan.d.ts.map +1 -1
- package/types/compiler/removed-lints.d.ts +3 -0
- package/types/compiler/removed-lints.d.ts.map +1 -0
- package/types/compiler/script-server.d.ts.map +1 -1
- package/types/compiler/signal-from-prop.d.ts +4 -0
- package/types/compiler/signal-from-prop.d.ts.map +1 -0
- package/types/compiler/template-reads.d.ts +1 -0
- package/types/compiler/template-reads.d.ts.map +1 -1
- package/types/compiler/validate.d.ts.map +1 -1
- package/types/config-loader.d.ts.map +1 -1
- package/types/config-resolve.d.ts.map +1 -1
- package/types/config-shape.d.ts +1 -1
- package/types/config-shape.d.ts.map +1 -1
- package/types/config.d.ts +5 -105
- package/types/config.d.ts.map +1 -1
- package/types/dev/preload.d.ts.map +1 -1
- package/types/lsp/server.d.ts.map +1 -1
- package/types/migrate/markup.d.ts.map +1 -1
- package/types/runtime/action-call.d.ts.map +1 -1
- package/types/runtime/action-encode.d.ts +1 -0
- package/types/runtime/action-encode.d.ts.map +1 -1
- package/types/runtime/action-error.d.ts +1 -2
- package/types/runtime/action-error.d.ts.map +1 -1
- package/types/runtime/action-run.d.ts.map +1 -1
- package/types/runtime/action-shared.d.ts +1 -27
- package/types/runtime/action-shared.d.ts.map +1 -1
- package/types/runtime/action-stream.d.ts.map +1 -1
- package/types/runtime/action.d.ts +1 -1
- package/types/runtime/action.d.ts.map +1 -1
- package/types/runtime/call-result.d.ts +0 -10
- package/types/runtime/call-result.d.ts.map +1 -1
- package/types/runtime/checks.d.ts +14 -11
- package/types/runtime/checks.d.ts.map +1 -1
- package/types/runtime/client.d.ts.map +1 -1
- package/types/runtime/core.d.ts +2 -20
- package/types/runtime/core.d.ts.map +1 -1
- package/types/runtime/dom.d.ts +1 -1
- package/types/runtime/dom.d.ts.map +1 -1
- package/types/runtime/html.d.ts +1 -1
- package/types/runtime/html.d.ts.map +1 -1
- package/types/runtime/i18n.client.d.ts +0 -1
- package/types/runtime/i18n.client.d.ts.map +1 -1
- package/types/runtime/i18n.d.ts +1 -1
- package/types/runtime/i18n.d.ts.map +1 -1
- package/types/runtime/i18n.server.d.ts +0 -1
- package/types/runtime/i18n.server.d.ts.map +1 -1
- package/types/runtime/image.d.ts.map +1 -1
- package/types/runtime/index.d.ts +3 -3
- 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/live-resource.server.d.ts.map +1 -1
- package/types/runtime/live-value.shared.d.ts +7 -15
- package/types/runtime/live-value.shared.d.ts.map +1 -1
- package/types/runtime/live.d.ts +0 -11
- package/types/runtime/live.d.ts.map +1 -1
- package/types/runtime/local-types.d.ts +0 -14
- package/types/runtime/local-types.d.ts.map +1 -1
- package/types/runtime/navigate-api.d.ts +0 -4
- package/types/runtime/navigate-api.d.ts.map +1 -1
- package/types/runtime/navigate.d.ts.map +1 -1
- package/types/runtime/navigation-state.d.ts +0 -4
- package/types/runtime/navigation-state.d.ts.map +1 -1
- package/types/runtime/navigation.d.ts +2 -0
- package/types/runtime/navigation.d.ts.map +1 -1
- package/types/runtime/page-swap.d.ts.map +1 -1
- package/types/runtime/persist.d.ts +1 -0
- package/types/runtime/persist.d.ts.map +1 -1
- package/types/runtime/persisted.d.ts +0 -15
- package/types/runtime/persisted.d.ts.map +1 -1
- package/types/runtime/presence.d.ts +0 -2
- package/types/runtime/presence.d.ts.map +1 -1
- package/types/runtime/query-param.d.ts.map +1 -1
- package/types/runtime/reactive.d.ts +2 -1
- package/types/runtime/reactive.d.ts.map +1 -1
- package/types/runtime/refuse.d.ts +0 -7
- package/types/runtime/refuse.d.ts.map +1 -1
- package/types/runtime/store-base.d.ts +1 -2
- package/types/runtime/store-base.d.ts.map +1 -1
- package/types/runtime/swap-flight.d.ts +1 -1
- package/types/runtime/swap-flight.d.ts.map +1 -1
- package/types/runtime/swap-kept.d.ts.map +1 -1
- package/types/runtime/swap-morph.d.ts.map +1 -1
- package/types/runtime/text-hash.d.ts +2 -0
- package/types/runtime/text-hash.d.ts.map +1 -0
- package/types/runtime/uid.server.d.ts.map +1 -1
- package/types/runtime/values.d.ts +6 -1
- package/types/runtime/values.d.ts.map +1 -1
- package/types/runtime/with-query.d.ts +2 -0
- package/types/runtime/with-query.d.ts.map +1 -1
- package/types/server/action-hooks.d.ts +4 -4
- package/types/server/action-hooks.d.ts.map +1 -1
- package/types/server/actions.d.ts.map +1 -1
- package/types/server/api-modules.d.ts +0 -1
- package/types/server/api-modules.d.ts.map +1 -1
- package/types/server/app-stages.d.ts +5 -13
- package/types/server/app-stages.d.ts.map +1 -1
- package/types/server/app.d.ts +3 -8
- package/types/server/app.d.ts.map +1 -1
- package/types/server/auth-mails.d.ts +0 -5
- package/types/server/auth-mails.d.ts.map +1 -1
- package/types/server/env-state.d.ts +1 -0
- package/types/server/env-state.d.ts.map +1 -1
- package/types/server/guard-requirement.d.ts +0 -1
- package/types/server/guard-requirement.d.ts.map +1 -1
- package/types/server/image.d.ts +0 -1
- package/types/server/image.d.ts.map +1 -1
- package/types/server/index.d.ts +0 -2
- package/types/server/index.d.ts.map +1 -1
- package/types/server/job-context.d.ts +1 -1
- package/types/server/job-context.d.ts.map +1 -1
- package/types/server/jobs.d.ts +0 -4
- package/types/server/jobs.d.ts.map +1 -1
- package/types/server/kept-exports.d.ts.map +1 -1
- package/types/server/kv.d.ts +4 -4
- package/types/server/kv.d.ts.map +1 -1
- package/types/server/library.d.ts +1 -3
- package/types/server/library.d.ts.map +1 -1
- package/types/server/mcp.d.ts +0 -1
- package/types/server/mcp.d.ts.map +1 -1
- package/types/server/metrics.d.ts +0 -5
- package/types/server/metrics.d.ts.map +1 -1
- package/types/server/page-settings.d.ts +3 -3
- package/types/server/page-settings.d.ts.map +1 -1
- package/types/server/prerender.d.ts.map +1 -1
- package/types/server/protection.d.ts +6 -6
- package/types/server/protection.d.ts.map +1 -1
- package/types/server/queue.d.ts +1 -3
- package/types/server/queue.d.ts.map +1 -1
- package/types/server/rate-limit.d.ts +0 -2
- package/types/server/rate-limit.d.ts.map +1 -1
- package/types/server/render-document.d.ts +1 -1
- package/types/server/render-document.d.ts.map +1 -1
- package/types/server/routes.d.ts +1 -1
- package/types/server/routes.d.ts.map +1 -1
- package/types/server/scope.d.ts.map +1 -1
- package/types/server/session.d.ts +1 -1
- package/types/server/session.d.ts.map +1 -1
- package/types/server/signals.d.ts.map +1 -1
- package/types/server/signed.d.ts +0 -2
- package/types/server/signed.d.ts.map +1 -1
- package/types/server/source.d.ts +1 -1
- package/types/server/source.d.ts.map +1 -1
- package/types/server/storage.d.ts +0 -4
- package/types/server/storage.d.ts.map +1 -1
- package/types/server/vitals.d.ts +0 -1
- package/types/server/vitals.d.ts.map +1 -1
- package/types/server/work-scope.d.ts +0 -2
- package/types/server/work-scope.d.ts.map +1 -1
- package/types/server/workflow.d.ts +1 -1
- package/types/server/workflow.d.ts.map +1 -1
- package/types/test/index.d.ts.map +1 -1
- package/types/test/site-actions.d.ts +1 -1
- package/types/test/site-actions.d.ts.map +1 -1
- package/types/test/site-keys.d.ts +1 -1
- package/types/test/site-keys.d.ts.map +1 -1
- package/types/test/site-socket.d.ts +1 -1
- package/types/test/site-socket.d.ts.map +1 -1
- package/types/test/site-types.d.ts +0 -8
- package/types/test/site-types.d.ts.map +1 -1
- package/llms/deprecated-lints-1-105-libraries.md +0 -32
- package/llms/deprecated-lints-1-105.md +0 -58
- package/src/check/action-readers.ts +0 -115
- package/src/check/action-type.ts +0 -44
- package/src/check/ai-language.ts +0 -56
- package/src/check/app-hooks.ts +0 -90
- package/src/check/auth-methods.ts +0 -85
- package/src/check/auth-rate-limits.ts +0 -99
- package/src/check/call-result.ts +0 -242
- package/src/check/client-keys.ts +0 -10
- package/src/check/cms-options.ts +0 -81
- package/src/check/config-groups.ts +0 -22
- package/src/check/config-switches.ts +0 -38
- package/src/check/context-import.ts +0 -51
- package/src/check/env-files.ts +0 -31
- package/src/check/format-duration.ts +0 -75
- package/src/check/guard-options.ts +0 -58
- package/src/check/handler-events.ts +0 -149
- package/src/check/hook-context.ts +0 -94
- package/src/check/hook-names.ts +0 -104
- package/src/check/i18n-keys.ts +0 -50
- package/src/check/images-keys.ts +0 -54
- package/src/check/job-shapes.ts +0 -273
- package/src/check/link-flag-tests.ts +0 -130
- package/src/check/live-api.ts +0 -137
- package/src/check/mail-api.ts +0 -67
- package/src/check/one-state-api.ts +0 -357
- package/src/check/pages-options.ts +0 -35
- package/src/check/rate-enforce.ts +0 -53
- package/src/check/refusal-calls.ts +0 -185
- package/src/check/retired-lints.ts +0 -49
- package/src/check/route-keys.ts +0 -166
- package/src/check/secret-keys.ts +0 -83
- package/src/check/socket-frames.ts +0 -102
- package/src/check/source-readers.ts +0 -257
- package/src/check/store-ms.ts +0 -72
- package/src/check/store-names.ts +0 -88
- package/src/check/test-helpers.ts +0 -98
- package/src/check/ttl-names.ts +0 -142
- package/src/compiler/deprecated-ai-labels.ts +0 -97
- package/src/compiler/deprecated-ai-links.ts +0 -63
- package/src/compiler/deprecated-allow.ts +0 -50
- package/src/compiler/deprecated-auth-lints.ts +0 -14
- package/src/compiler/deprecated-auth-signed.ts +0 -29
- package/src/compiler/deprecated-children.ts +0 -66
- package/src/compiler/deprecated-image.ts +0 -116
- package/src/compiler/deprecated-island.ts +0 -155
- package/src/compiler/deprecated-lints-1-105.ts +0 -41
- package/src/compiler/deprecated-page.ts +0 -125
- package/src/compiler/deprecated-parts.ts +0 -22
- package/src/compiler/deprecated-typed-lints.ts +0 -23
- package/src/compiler/deprecated-ui-callbacks.ts +0 -66
- package/src/compiler/deprecated-ui-input.ts +0 -97
- package/src/compiler/deprecated-ui-items.ts +0 -47
- package/src/compiler/old-parts.ts +0 -84
- package/src/runtime/mount.compat.ts +0 -8
- package/src/server/moved-exports.ts +0 -17
- package/types/check/action-readers.d.ts +0 -3
- package/types/check/action-readers.d.ts.map +0 -1
- package/types/check/action-type.d.ts +0 -3
- package/types/check/action-type.d.ts.map +0 -1
- package/types/check/ai-language.d.ts +0 -3
- package/types/check/ai-language.d.ts.map +0 -1
- package/types/check/app-hooks.d.ts +0 -3
- package/types/check/app-hooks.d.ts.map +0 -1
- package/types/check/auth-methods.d.ts +0 -3
- package/types/check/auth-methods.d.ts.map +0 -1
- package/types/check/auth-rate-limits.d.ts +0 -3
- package/types/check/auth-rate-limits.d.ts.map +0 -1
- package/types/check/call-result.d.ts +0 -7
- package/types/check/call-result.d.ts.map +0 -1
- package/types/check/client-keys.d.ts +0 -3
- package/types/check/client-keys.d.ts.map +0 -1
- package/types/check/cms-options.d.ts +0 -3
- package/types/check/cms-options.d.ts.map +0 -1
- package/types/check/config-groups.d.ts +0 -3
- package/types/check/config-groups.d.ts.map +0 -1
- package/types/check/config-switches.d.ts +0 -3
- package/types/check/config-switches.d.ts.map +0 -1
- package/types/check/context-import.d.ts +0 -3
- package/types/check/context-import.d.ts.map +0 -1
- package/types/check/env-files.d.ts +0 -3
- package/types/check/env-files.d.ts.map +0 -1
- package/types/check/format-duration.d.ts +0 -5
- package/types/check/format-duration.d.ts.map +0 -1
- package/types/check/guard-options.d.ts +0 -3
- package/types/check/guard-options.d.ts.map +0 -1
- package/types/check/handler-events.d.ts +0 -9
- package/types/check/handler-events.d.ts.map +0 -1
- package/types/check/hook-context.d.ts +0 -3
- package/types/check/hook-context.d.ts.map +0 -1
- package/types/check/hook-names.d.ts +0 -3
- package/types/check/hook-names.d.ts.map +0 -1
- package/types/check/i18n-keys.d.ts +0 -3
- package/types/check/i18n-keys.d.ts.map +0 -1
- package/types/check/images-keys.d.ts +0 -3
- package/types/check/images-keys.d.ts.map +0 -1
- package/types/check/job-shapes.d.ts +0 -6
- package/types/check/job-shapes.d.ts.map +0 -1
- package/types/check/link-flag-tests.d.ts +0 -4
- package/types/check/link-flag-tests.d.ts.map +0 -1
- package/types/check/live-api.d.ts +0 -3
- package/types/check/live-api.d.ts.map +0 -1
- package/types/check/mail-api.d.ts +0 -3
- package/types/check/mail-api.d.ts.map +0 -1
- package/types/check/one-state-api.d.ts +0 -9
- package/types/check/one-state-api.d.ts.map +0 -1
- package/types/check/pages-options.d.ts +0 -3
- package/types/check/pages-options.d.ts.map +0 -1
- package/types/check/rate-enforce.d.ts +0 -3
- package/types/check/rate-enforce.d.ts.map +0 -1
- package/types/check/refusal-calls.d.ts +0 -3
- package/types/check/refusal-calls.d.ts.map +0 -1
- package/types/check/retired-lints.d.ts +0 -3
- package/types/check/retired-lints.d.ts.map +0 -1
- package/types/check/route-keys.d.ts +0 -3
- package/types/check/route-keys.d.ts.map +0 -1
- package/types/check/secret-keys.d.ts +0 -3
- package/types/check/secret-keys.d.ts.map +0 -1
- package/types/check/socket-frames.d.ts +0 -3
- package/types/check/socket-frames.d.ts.map +0 -1
- package/types/check/source-readers.d.ts +0 -3
- package/types/check/source-readers.d.ts.map +0 -1
- package/types/check/store-ms.d.ts +0 -3
- package/types/check/store-ms.d.ts.map +0 -1
- package/types/check/store-names.d.ts +0 -3
- package/types/check/store-names.d.ts.map +0 -1
- package/types/check/test-helpers.d.ts +0 -3
- package/types/check/test-helpers.d.ts.map +0 -1
- package/types/check/ttl-names.d.ts +0 -3
- package/types/check/ttl-names.d.ts.map +0 -1
- package/types/compiler/deprecated-ai-labels.d.ts +0 -5
- package/types/compiler/deprecated-ai-labels.d.ts.map +0 -1
- package/types/compiler/deprecated-ai-links.d.ts +0 -5
- package/types/compiler/deprecated-ai-links.d.ts.map +0 -1
- package/types/compiler/deprecated-allow.d.ts +0 -5
- package/types/compiler/deprecated-allow.d.ts.map +0 -1
- package/types/compiler/deprecated-auth-lints.d.ts +0 -12
- package/types/compiler/deprecated-auth-lints.d.ts.map +0 -1
- package/types/compiler/deprecated-auth-signed.d.ts +0 -5
- package/types/compiler/deprecated-auth-signed.d.ts.map +0 -1
- package/types/compiler/deprecated-children.d.ts +0 -4
- package/types/compiler/deprecated-children.d.ts.map +0 -1
- package/types/compiler/deprecated-image.d.ts +0 -5
- package/types/compiler/deprecated-image.d.ts.map +0 -1
- package/types/compiler/deprecated-island.d.ts +0 -9
- package/types/compiler/deprecated-island.d.ts.map +0 -1
- package/types/compiler/deprecated-lints-1-105.d.ts +0 -39
- package/types/compiler/deprecated-lints-1-105.d.ts.map +0 -1
- package/types/compiler/deprecated-page.d.ts +0 -4
- package/types/compiler/deprecated-page.d.ts.map +0 -1
- package/types/compiler/deprecated-parts.d.ts +0 -3
- package/types/compiler/deprecated-parts.d.ts.map +0 -1
- package/types/compiler/deprecated-typed-lints.d.ts +0 -21
- package/types/compiler/deprecated-typed-lints.d.ts.map +0 -1
- package/types/compiler/deprecated-ui-callbacks.d.ts +0 -5
- package/types/compiler/deprecated-ui-callbacks.d.ts.map +0 -1
- package/types/compiler/deprecated-ui-input.d.ts +0 -5
- package/types/compiler/deprecated-ui-input.d.ts.map +0 -1
- package/types/compiler/deprecated-ui-items.d.ts +0 -5
- package/types/compiler/deprecated-ui-items.d.ts.map +0 -1
- package/types/compiler/old-parts.d.ts +0 -9
- package/types/compiler/old-parts.d.ts.map +0 -1
- package/types/runtime/mount.compat.d.ts +0 -7
- package/types/runtime/mount.compat.d.ts.map +0 -1
- package/types/server/moved-exports.d.ts +0 -12
- package/types/server/moved-exports.d.ts.map +0 -1
package/src/compiler/browser.ts
CHANGED
|
@@ -2,13 +2,11 @@ import type { Diagnostic, Fix, KayFile, Span } from './ast'
|
|
|
2
2
|
import type { Node, NodeOfType, Program } from './estree'
|
|
3
3
|
import type { Path } from './scope'
|
|
4
4
|
import { visitNodes } from './ast'
|
|
5
|
-
import { wordEdit } from './deprecated-island'
|
|
6
5
|
import { isPlainProperty, parseProgram } from './estree'
|
|
7
6
|
import { TS_EXPRESSIONS, viaGlobalThis } from './estree-shapes'
|
|
8
7
|
import { browserGlobals } from './host'
|
|
9
8
|
import { importEdits } from './import-edits'
|
|
10
9
|
import { parameterNames } from './items'
|
|
11
|
-
import { importedFromKay } from './rewrite-reads'
|
|
12
10
|
import { analyzeScript } from './script'
|
|
13
11
|
import { walkScope } from './walk'
|
|
14
12
|
|
|
@@ -130,7 +128,7 @@ export function browserReads(file: KayFile, island: boolean, serverNames: string
|
|
|
130
128
|
const through = path.node.name === 'globalThis' ? viaGlobalThis(path) : undefined
|
|
131
129
|
const { name } = through ?? path.node
|
|
132
130
|
|
|
133
|
-
if (!names.has(name) || !path.isReferencedIdentifier() || (through === undefined && path.scope.hasBinding(name, true)) || inType(path)
|
|
131
|
+
if (!names.has(name) || !path.isReferencedIdentifier() || (through === undefined && path.scope.hasBinding(name, true)) || inType(path))
|
|
134
132
|
return
|
|
135
133
|
|
|
136
134
|
const holder = path.parentPath!.node
|
|
@@ -253,15 +251,6 @@ function inChain(path: Path): boolean {
|
|
|
253
251
|
return false
|
|
254
252
|
}
|
|
255
253
|
|
|
256
|
-
// A read in the target of `listen(window, 'keydown', ...)`, which the compiler hands `listen` as a function the browser calls.
|
|
257
|
-
function listenTarget(path: Path): boolean {
|
|
258
|
-
return path.find((parent) => {
|
|
259
|
-
const call = parent.parentPath?.node
|
|
260
|
-
|
|
261
|
-
return call?.type === 'CallExpression' && call.arguments[0] === parent.node && importedFromKay(parent.scope, call.callee) === 'listen'
|
|
262
|
-
}) !== null
|
|
263
|
-
}
|
|
264
|
-
|
|
265
254
|
// `memo(() => ...)` and `rows.map(row => ...)` run the function they take before they return.
|
|
266
255
|
function rendersCallback(call: NodeOfType<'CallExpression'>, fn: Node): boolean {
|
|
267
256
|
if (call.arguments[0] !== fn)
|
|
@@ -464,6 +453,5 @@ function clientFix(file: KayFile): Fix[] {
|
|
|
464
453
|
|
|
465
454
|
const call = { start: file.script.start, end: file.script.start, text: 'island({ render: \'client\' })\n' }
|
|
466
455
|
|
|
467
|
-
|
|
468
|
-
return [{ title, edits: file.pin === undefined || file.scriptLine === undefined ? [call] : [wordEdit(file.scriptLine, file.pin.end, file.source.slice(0, file.scriptLine.start)), call] }]
|
|
456
|
+
return [{ title, edits: [call] }]
|
|
469
457
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// A source of a merged class: a literal kept as text, so the ones side by side resolve together, or code that writes the value.
|
|
2
|
+
export type ClassItem = { text: string } | { emit: () => void }
|
|
3
|
+
|
|
4
|
+
// The items with each run of literals side by side joined into one.
|
|
5
|
+
export function joinTexts(items: ClassItem[], join: (texts: string[]) => string): ClassItem[] {
|
|
6
|
+
return items.reduce<ClassItem[]>((merged, item) => {
|
|
7
|
+
const last = merged.at(-1)
|
|
8
|
+
|
|
9
|
+
if ('text' in item && last !== undefined && 'text' in last)
|
|
10
|
+
merged[merged.length - 1] = { text: join([last.text, item.text]) }
|
|
11
|
+
else
|
|
12
|
+
merged.push(item)
|
|
13
|
+
|
|
14
|
+
return merged
|
|
15
|
+
}, [])
|
|
16
|
+
}
|
package/src/compiler/codegen.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { emitHeadTag, emitHeadText } from './head-tags'
|
|
|
18
18
|
import { awaitAlertTail, htmlHelperImport, HtmlTemplate } from './html'
|
|
19
19
|
import { withoutComma } from './import-edits'
|
|
20
20
|
import { sourceLocator } from './inspect'
|
|
21
|
-
import {
|
|
21
|
+
import { islandExport, islandMessages, withAlertKeys } from './island-arguments'
|
|
22
22
|
import { ambientHelpers, constDeclaration } from './items'
|
|
23
23
|
import { JsxTemplate } from './jsx'
|
|
24
24
|
import { lazyDomImport, lazyEdits, lazyNoteImport } from './lazy-imports'
|
|
@@ -51,7 +51,7 @@ export interface GenerateOptions {
|
|
|
51
51
|
island?: string | undefined
|
|
52
52
|
// Under `kay dev`, why the component is an island or may become one, written on its slot as `data-why`.
|
|
53
53
|
cause?: string | undefined
|
|
54
|
-
// The island renders in the browser only:
|
|
54
|
+
// The island renders in the browser only: `island({ render: 'client' })`, or a package it imports cannot load on the server.
|
|
55
55
|
client?: boolean | undefined
|
|
56
56
|
// The live values the island imports, which its server render notes to prove the page may follow them even when the render reads none, as a handler does not run there.
|
|
57
57
|
lives?: string[] | undefined
|
|
@@ -487,7 +487,7 @@ class ModuleShell {
|
|
|
487
487
|
})
|
|
488
488
|
const object = `{ ${entries.join('; ')} }`
|
|
489
489
|
|
|
490
|
-
const type = `{ class?: ${parts.root === 'none' ? `{ kayError: 'A template with several top elements takes its classes as parts={{ head: "p-6" }}: mark one with part="root" to take a string' }` : `string | readonly unknown[] | Record<string, boolean | null | undefined
|
|
490
|
+
const type = `{ class?: ${parts.root === 'none' ? `{ kayError: 'A template with several top elements takes its classes as parts={{ head: "p-6" }}: mark one with part="root" to take a string' }` : `string | readonly unknown[] | Record<string, boolean | null | undefined>`} | undefined; parts?: ${object} | undefined }`
|
|
491
491
|
const recipe = this.facts.recipe
|
|
492
492
|
|
|
493
493
|
// The variants of the recipe, typed off it, so the component declares them once.
|
|
@@ -617,18 +617,18 @@ class ModuleShell {
|
|
|
617
617
|
if (this.kind === 'twin')
|
|
618
618
|
b.add(`\nexport default ${this.mode === 'html' && this.options.failedCode !== undefined ? `Object.assign((props: never) => KayInsideIsland() ? KayHydrated(props) : ${name}(props), { kayFailed: KayFailed })` : `((props: never) => KayInsideIsland() ? KayHydrated(props) : ${name}(props))`} as typeof ${name}${widened ? this.widenedCall(`typeof ${name}`) : ''}\n`)
|
|
619
619
|
else if (this.kind === 'island' && widened && !this.genericComponent)
|
|
620
|
-
b.add(
|
|
620
|
+
b.add(islandExport(`KayIsland(${JSON.stringify(this.options.island)}, ${name}${this.islandTail(src)}) as unknown as ReturnType<typeof KayIsland<Parameters<typeof ${name}>[0]>>${this.widenedCall(`ReturnType<typeof KayIsland<Parameters<typeof ${name}>[0]>>`)}`, this.script.island, this.options))
|
|
621
621
|
else if (widened && this.kind !== 'island')
|
|
622
622
|
b.add(`\nexport default ${name} as typeof ${name}${this.widenedCall(`typeof ${name}`)}\n`)
|
|
623
623
|
else if (this.kind === 'island')
|
|
624
|
-
b.add(
|
|
624
|
+
b.add(islandExport(`KayIsland(${JSON.stringify(this.options.island)}, ${name}${this.genericComponent ? ' as never' : ''}${this.islandTail(src)})${this.genericIslandType()}${widened ? this.widenedCall(`typeof ${name}`) : ''}`, this.script.island, this.options))
|
|
625
625
|
}
|
|
626
626
|
|
|
627
|
-
// The arguments after the component that `island()` takes: its message keys, the live values and cause of a server render, and
|
|
627
|
+
// The arguments after the component that `island()` takes: its message keys, the live values and cause of a server render, and what its `island()` call asks, the hydrate and persist the component asks for wherever it is used.
|
|
628
628
|
private islandTail(src: string): string {
|
|
629
629
|
const html = this.options.output === 'html'
|
|
630
630
|
|
|
631
|
-
return islandMessages(withAlertKeys(src, this.options.awaitAlert), this.options.client, html ? this.options.lives : undefined, html ? this.options.cause : undefined, false, html &&
|
|
631
|
+
return islandMessages(withAlertKeys(src, this.options.awaitAlert), this.options.client, html ? this.options.lives : undefined, html ? this.options.cause : undefined, false, html && (this.script.island?.asks ?? false), this.file.wrapsButtons === true)
|
|
632
632
|
}
|
|
633
633
|
|
|
634
634
|
private get wrapped(): boolean {
|
|
@@ -1006,13 +1006,13 @@ export function isInteractive(file: KayFile, script: ScriptAnalysis): boolean {
|
|
|
1006
1006
|
return script.reactive || templateFacts(file).interactive
|
|
1007
1007
|
}
|
|
1008
1008
|
|
|
1009
|
-
// The first thing that makes a component interactive, so an island: an `on*`, `bind:` or `ref` attribute, a `kay` value of the script,
|
|
1009
|
+
// The first thing that makes a component interactive, so an island: an `on*`, `bind:` or `ref` attribute, a `kay` value of the script, or an `island()` declaration.
|
|
1010
1010
|
export function islandCause(file: KayFile, script: ScriptAnalysis): IslandCause | undefined {
|
|
1011
1011
|
if (file.client !== undefined)
|
|
1012
|
-
return { kind: 'client', name:
|
|
1012
|
+
return { kind: 'client', name: 'island()', span: file.client, line: lineOf(file.source, file.client.start) }
|
|
1013
1013
|
|
|
1014
1014
|
if (file.pin?.kind === 'island')
|
|
1015
|
-
return { kind: 'island', name:
|
|
1015
|
+
return { kind: 'island', name: 'island()', span: file.pin, line: lineOf(file.source, file.pin.start) }
|
|
1016
1016
|
|
|
1017
1017
|
let cause: IslandCause | undefined
|
|
1018
1018
|
|
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
import type { Details, ElementNode, Span } from './ast'
|
|
2
2
|
import type { LintName } from './lints'
|
|
3
|
-
import { deprecatedAiLabels } from './deprecated-ai-labels'
|
|
4
|
-
import { deprecatedAiLinks } from './deprecated-ai-links'
|
|
5
|
-
import { deprecatedAuthSigned } from './deprecated-auth-signed'
|
|
6
|
-
import { deprecatedUiCallbacks } from './deprecated-ui-callbacks'
|
|
7
|
-
import { deprecatedUiInput } from './deprecated-ui-input'
|
|
8
|
-
import { deprecatedUiItems } from './deprecated-ui-items'
|
|
9
3
|
import { deprecatedUiProps } from './deprecated-ui-props'
|
|
10
4
|
|
|
11
5
|
// The deprecated forms of a kayjs-ui or kayjs-ai component found on an element bound to the library's `file`, each reported under its own lint.
|
|
12
6
|
export function deprecatedLibrary(element: ElementNode, file: string, text: (span: Span) => string, lint: (span: Span, code: LintName, message: string, details: Details) => void): void {
|
|
13
7
|
deprecatedUiProps(element, file, text, (span, message, details) => lint(span, 'deprecated-ui-props', message, details))
|
|
14
|
-
deprecatedUiCallbacks(element, file, text, (span, message, details) => lint(span, 'deprecated-ui-callbacks', message, details))
|
|
15
|
-
deprecatedUiItems(element, file, text, (span, message, details) => lint(span, 'deprecated-ui-items', message, details))
|
|
16
|
-
deprecatedUiInput(element, file, text, (span, message, details) => lint(span, 'deprecated-ui-input', message, details))
|
|
17
|
-
deprecatedAiLabels(element, file, text, (span, message, details) => lint(span, 'deprecated-ai-labels', message, details))
|
|
18
|
-
deprecatedAiLinks(element, file, text, (span, message, details) => lint(span, 'deprecated-ai-links', message, details))
|
|
19
|
-
deprecatedAuthSigned(element, file, text, (span, message, details) => lint(span, 'deprecated-auth-signed', message, details))
|
|
20
8
|
}
|
|
@@ -7,8 +7,8 @@ export const SCHEMA_BUILDERS = {
|
|
|
7
7
|
group: 'deprecated',
|
|
8
8
|
since: '1.106',
|
|
9
9
|
site: true,
|
|
10
|
-
summary: 'The PascalCase builders of `s` before 1.106, which kay\'s own lowercase builders replace, each taking the same field options (`optional`, `default`, `error`, `label`, `description`, `example`) and short names for the rest: `s.String` is `s.string` (`min`, `max`), `s.Integer` `s.int`, `s.Number` and `s.Numeric` `s.number`, `s.Boolean` and `s.BooleanString` `s.boolean`, `s.Array` `s.list`, `s.UnionEnum` and `s.UnionKeys` `s.enum`, and `s.Date`, `s.Literal`, `s.Union`, `s.Object`, `s.File`, `s.Files`, `s.Secret` and `s.Public` their lowercase names; `s.Optional(field)` is `optional: true` in the options of the field; an `s.Object({ ... })` that is the schema of
|
|
10
|
+
summary: 'The PascalCase builders of `s` before 1.106, which kay\'s own lowercase builders replace, each taking the same field options (`optional`, `default`, `error`, `label`, `description`, `example`) and short names for the rest: `s.String` is `s.string` (`min`, `max`), `s.Integer` `s.int`, `s.Number` and `s.Numeric` `s.number`, `s.Boolean` and `s.BooleanString` `s.boolean`, `s.Array` `s.list`, `s.UnionEnum` and `s.UnionKeys` `s.enum`, and `s.Date`, `s.Literal`, `s.Union`, `s.Object`, `s.File`, `s.Files`, `s.Secret` and `s.Public` their lowercase names; `s.Optional(field)` is `optional: true` in the options of the field; an `s.Object({ ... })` that is the schema of a `defineEnv` is the record of fields alone, as an env reads only the names it declares; and a file size written `\'2m\'` is `\'2mb\'`. The old names work until 2.0. Found on the `s` a file imports from `kay`, in the TypeScript files and the fences of `.kay` files. The fix renames the builder and the options that changed, and keeps what each did: an `s.Array` takes `max: Number.MAX_SAFE_INTEGER` (the lowercase list stops at 1,000 items) and an `s.Object` `extra: \'strip\'`, a rewrite whose options are not an object literal being reported without a fix; an `s.Union` of `Object.keys(R).map(key => s.Literal(key))` is `s.enum(R)`, and any other `s.Union` of a mapped array is reported without a fix; an `s.Optional` around anything but one of these builders, such as a helper of `kay/content`, is left as it is. A lowercase `s.object` refuses a key its shape lacks where kay reads the schema itself (an action\'s input, an API route\'s body, `defineEnv`, collection frontmatter), where `s.Object` let it by, so the fix writes `{ extra: \'strip\' }`. A query, the headers and the cookies of a request carry keys no schema names, so their unknown keys are dropped whatever the schema says.',
|
|
11
11
|
wrong: '--- server\nimport { action, s } from \'kay\'\n\nexport const add = action(s.Object({ title: s.String({ maxLength: 200 }), note: s.Optional(s.String()) }), ({ title }) => title)\n---\np x',
|
|
12
|
-
right: '--- server\nimport { action, s } from \'kay\'\n\nexport const add = action({ title: s.string({ max: 200 }), note: s.string({ optional: true }) }, ({ title }) => title)\n---\np x',
|
|
12
|
+
right: '--- server\nimport { action, s } from \'kay\'\n\nexport const add = action(s.object({ title: s.string({ max: 200 }), note: s.string({ optional: true }) }, { extra: \'strip\' }), ({ title }) => title)\n---\np x',
|
|
13
13
|
},
|
|
14
14
|
} as const satisfies Record<string, Lint>
|