@kayjs/kay 1.108.0 → 1.109.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 +1790 -3751
- package/editors/zed/extension.toml +2 -2
- package/llms/action-protection.md +1 -1
- package/llms/actions-from-islands.md +4 -4
- 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 +4 -4
- package/llms/deprecated-lints.md +1 -6
- 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 +2 -1
- package/llms/island-sources.md +1 -1
- package/llms/islands-state-to-ids.md +2 -2
- package/llms/islands.md +4 -2
- package/llms/lints.md +1 -1
- package/llms/live-values.md +3 -3
- 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 +6 -6
- 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/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 +42 -82
- package/llms/upgrading.md +91 -63
- package/llms/whats-new.md +9 -0
- package/llms.txt +5 -6
- package/package.json +6 -10
- package/src/build/route-sizes.ts +2 -3
- 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/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 +3 -8
- package/src/check/shadow-types.ts +0 -86
- package/src/commands/check.ts +2 -2
- package/src/commands/env.ts +25 -3
- package/src/compiler/ast.ts +18 -16
- package/src/compiler/browser.ts +2 -14
- package/src/compiler/class-items.ts +16 -0
- package/src/compiler/codegen.ts +8 -8
- package/src/compiler/deprecated-library.ts +0 -12
- 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 +55 -0
- package/src/compiler/helper-imports.ts +2 -2
- package/src/compiler/image-attributes.ts +1 -3
- package/src/compiler/index.ts +20 -21
- package/src/compiler/island-arguments.ts +8 -95
- package/src/compiler/island-cause.ts +7 -7
- package/src/compiler/island-declaration.ts +2 -8
- package/src/compiler/island-lints.ts +12 -0
- package/src/compiler/island-marker.ts +3 -3
- package/src/compiler/island-problems.ts +25 -0
- package/src/compiler/jsx-class.ts +1 -25
- package/src/compiler/jsx.ts +2 -2
- package/src/compiler/kay-exports.ts +0 -2
- package/src/compiler/link-flags.ts +9 -38
- package/src/compiler/lints.ts +7 -14
- package/src/compiler/markup.ts +23 -26
- 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/rewrite.ts +3 -18
- package/src/compiler/script-server.ts +8 -3
- 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 +11 -11
- package/src/runtime/client.ts +2 -2
- 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/index.ts +2 -2
- package/src/runtime/island.server.ts +18 -5
- 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/navigation-state.ts +0 -12
- package/src/runtime/page-swap.ts +6 -6
- 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/values.ts +40 -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 +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/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/shadow-types.d.ts.map +1 -1
- package/types/commands/env.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.d.ts +0 -551
- 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 +7 -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 +2 -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 +10 -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/jsx-class.d.ts +1 -2
- package/types/compiler/jsx-class.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 +11 -563
- 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/script-server.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 +6 -9
- package/types/runtime/checks.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/index.d.ts +2 -2
- package/types/runtime/index.d.ts.map +1 -1
- package/types/runtime/island.server.d.ts +1 -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/navigation-state.d.ts +0 -4
- package/types/runtime/navigation-state.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/values.d.ts +2 -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/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
|
@@ -20,11 +20,9 @@ export interface TestOptions extends PagesOptions {
|
|
|
20
20
|
headers?: Record<string, string> | undefined;
|
|
21
21
|
use?: PluginInput[] | undefined;
|
|
22
22
|
locals?: ((request: Request) => Record<string, unknown> | Promise<Record<string, unknown>>) | undefined;
|
|
23
|
-
mcpKey?: string | undefined;
|
|
24
23
|
browser?: boolean | BrowserOptions | undefined;
|
|
25
24
|
islands?: boolean | undefined;
|
|
26
25
|
styles?: boolean | undefined;
|
|
27
|
-
proxyKey?: string | undefined;
|
|
28
26
|
}
|
|
29
27
|
export interface Visit extends PageReading {
|
|
30
28
|
url: string;
|
|
@@ -78,10 +76,6 @@ export interface TestSite {
|
|
|
78
76
|
expectRefused: <Target extends Action>(action: Target, input: InputOf<Target> | FormData, init?: VisitInit & {
|
|
79
77
|
from?: string;
|
|
80
78
|
}) => Promise<ActionError<FailuresOf<Target>>>;
|
|
81
|
-
/** @deprecated `site.expectRefused`, the name every test helper of refusals shares. Removed in 1.108.0; `deprecated-test-helpers` rewrites it. */
|
|
82
|
-
refusal: <Target extends Action>(action: Target, input: InputOf<Target> | FormData, init?: VisitInit & {
|
|
83
|
-
from?: string;
|
|
84
|
-
}) => Promise<ActionError<FailuresOf<Target>>>;
|
|
85
79
|
mcp: {
|
|
86
80
|
tools: (init?: VisitInit) => Promise<McpTool[]>;
|
|
87
81
|
initialize: (init?: VisitInit) => Promise<McpInitialize>;
|
|
@@ -93,8 +87,6 @@ export interface TestSite {
|
|
|
93
87
|
socket: OpenSocket & {
|
|
94
88
|
refused: RefusedSocket;
|
|
95
89
|
};
|
|
96
|
-
/** @deprecated `site.socket.refused`, beside the `site.socket` it refuses. Removed in 1.108.0; `deprecated-test-helpers` rewrites it. */
|
|
97
|
-
socketRefusal: RefusedSocket;
|
|
98
90
|
stream: <Module, const Path extends StreamPath<Module>, const M extends StreamMethod<NodeAt<Module, Path>> = never>(module: Module, path: Path, ...[options]: Optional<StreamOptions<Module, Path, M> & VisitInit>) => TestStream<StreamOf<Module, Path, M>>;
|
|
99
91
|
open: (path: string, options?: BrowserOptions) => Promise<TestPage>;
|
|
100
92
|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,CAAC,MAAM,CAAC,CAAC,CAAA;IAErC,QAAQ,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;CAC5C,CAAA"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Deprecated lints of the 1.105 libraries
|
|
2
|
-
|
|
3
|
-
## Common tasks
|
|
4
|
-
|
|
5
|
-
- Move an app off every 1.105 form at once: `kay upgrade`, or `kay check --fix --since 1.105`; see [Apply the quick fixes](lints.md#apply-the-quick-fixes).
|
|
6
|
-
|
|
7
|
-
## Reference
|
|
8
|
-
|
|
9
|
-
### Deprecated lints of the 1.105 libraries
|
|
10
|
-
|
|
11
|
-
The lints of the `deprecated` group that came in 1.105 for kayjs-ai, kayjs-ui, kayjs-cms, kayjs-mail and kayjs-auth, each reported until 1.108 with a safe fix unless its row says otherwise. Those of kay itself are in [Deprecated lints of 1.105](deprecated-lints-1-105.md).
|
|
12
|
-
|
|
13
|
-
| Lint | Default | Group | Reports |
|
|
14
|
-
| --- | --- | --- | --- |
|
|
15
|
-
| `deprecated-ui-props` | warn | deprecated | A kayjs-ui or kayjs-ai prop under its name before 1.98. `heading` on a Dialog, SidePanel or FormDialog is `title`, which takes a string or a `@title` block as a Card's does, and the string that named the dialog for screen readers is `label`. `variant` on a Stat, Chat or ChatLauncher is `layout`, `variant` naming only the frame of a control. The old names work until 2.0. The fix renames the prop or the block, and the `title` string beside a `heading` to `label`; it offers none where the new name is already written. |
|
|
16
|
-
| `deprecated-auth-rate-limits` | warn | deprecated | kayjs-auth's `rateLimit` as 26 flat keys, grouped by feature since 1.105: `signIn: { ip, account, accountAll }` (`signIn`, `signInAccount`, `signInAccountAll`), `{ ip, account }` for `resend`, `forgot`, `magicLink`, `emailChange`, `twoFactor` and `emailCode`, `invite: { sender, address }` and `oauth: { register, registerAll, document, token }`; `register`, `reprove`, `link`, `export` and `organization` stay one limit. A bare limit or a list on a feature that has a group is its `ip` (or first) part. The old keys work until 1.108. Found in the `rateLimit` object written in a call of `auth` or `authCore` imported from `@kayjs/auth`. The fix, attached to the first report, rewrites only the keys it moves, leaving the order, layout and comments of the others as written; an object that spreads, names a key twice, writes a feature both ways or holds a computed or shorthand key is reported with no fix. |
|
|
17
|
-
| `deprecated-ai-labels` | warn | deprecated | The `<key>Label` props of kayjs-ai's `Chat`, `ChatLauncher` and `ChatPanel`, `labels` since 1.105: one object keyed as the messages are (`ai.chat.send` is `labels.send`), in place of up to 45 props that each held one text. `waitingLabel` is `labels.thinking` and `failureLabel` `labels.error`. The old props work until 1.108 and win over `labels`. Found on a component bound to the library's file in a template. The fix writes the first prop as `labels={{ ... }}` holding every one; a template that has a `labels` already, or a prop with no value, is reported with no fix. |
|
|
18
|
-
| `deprecated-ai-links` | warn | deprecated | Chat's `links` and Sources' `here`, `newTab` since 1.105: which links of a reply and which cited sources open in a new tab, as the links of kayjs-ui take it, `true`, `false` or `'auto'`, which opens a link to a page of this site in place. `links="apart"` is `newTab={true}`, and `links="here"` and `here` are `newTab="auto"`. The old props work until 1.108 and `newTab` wins when both are written. Found on a `Chat` or a `Sources` bound to the library's file in a template. The fix writes `newTab`, reading `here={value}` as `newTab={value ? 'auto' : true}`; a template that has a `newTab` already, or a `links` that is not one of the two words, is reported with no fix. |
|
|
19
|
-
| `deprecated-auth-signed` | warn | deprecated | kayjs-auth's `SignedIn(role=...)` and `SignedOut`, one check written three ways before 1.105: `SignedIn` takes `require` since 1.105, which is what `auth.guard({ require })` takes (a role, a list of which any one passes, a predicate), and its `@else` block holds what a visitor sees, in place of a `SignedOut` beside it. The old forms work until 1.108. Found on a component bound to the library's file in a template. The fix renames `role` to `require`; `SignedOut` and a `role` written beside a `require` are reported with no fix, since the children of a `SignedOut` join the `SignedIn` beside it by hand. |
|
|
20
|
-
| `deprecated-auth-methods` | warn | deprecated | kayjs-auth's methods under the names they had before 1.105, when the verbs of a group differed and some methods sat on `auth` itself: every group lists with `list`, reads with `get`, writes with `create` and `update`, removes with `delete` and takes back with `revoke`. `organizations.members`, `invitations`, `myInvitations` and `invitation` are `listMembers`, `listInvitations`, `listMyInvitations` and `getInvitation`, `setMemberRoles` and `removeMember` are `updateMemberRoles` and `deleteMember`; `admin.roles` and `admin.auditLog` are `listRoles` and `listAuditLog`; `oauthServer.clients` is `listClients`; `passkeys.rename` is `passkeys.update`; `account.changeUsername`, `profile` and `saveProfile` are `updateUsername`, `getProfile` and `updateProfile`; `oauth.identities` and `providerToken` are `listIdentities` and `getProviderToken`; `magicLink.signInWithCode` is `email.signInWithCode`, the code being the email's. The methods on `auth` went into the group they belong to: `requireAdmin()` is `admin.require()`, `captchaRequired()` and `captchaChallenge()` are `captcha.required()` and `captcha.challenge()`, `provedLately()` and `reprove()` are `proof.recent()` and `proof.renew()`, `scopes()` and `hasScope()` are `tokens.scopes()` and `tokens.hasScope()`, and `oauthResource()`, `oauthOrigin()` and `oauthFixed()` are `oauthServer.resource()`, `origin()` and `fixed()`. The old names work until 1.108. Found on a call whose receiver is named `auth` (`ctx.locals.auth`, `locals.auth`), in the TypeScript files and `.kay` files of the project, a template expression excluded; the fix writes the new name. |
|
|
21
|
-
| `deprecated-ui-callbacks` | warn | deprecated | A kayjs-ui prop under the name it had before 1.105, when its callback took positional arguments: `onChange` on an Accordion, Tabs or ThemeToggle is `onValueChange`, on a ZoomPane `onPlateChange`, `onSort` on a Table `onSortChange`, and `onActive` on a BarChart, LineChart, ScatterChart, Sparkline or ContributionGraph `onActiveChange`, each name saying what changed and its callback taking one event object (`{ value, tab }`, `{ plate }`, `{ sort }`, `{ index }`). The old names work until 1.108 with their old arguments. Found on a component bound to the library's file in a template. The fix writes the new name and, for an inline arrow function with plain parameter names, destructures the event under them; any other value is renamed by an unsafe fix, which `kay upgrade` leaves to you, since the callback has to take the event. The other callbacks that took positional arguments (`onChange` of a TextInput, `onOpenChange` of a Dialog) keep their names and take the event object with no old form to find: `kay check` reports each call. |
|
|
22
|
-
| `deprecated-callback-handler` | deny | deprecated | A function written for the arguments a kayjs-ui, kayjs-ai or kayjs-cms callback took before 1.105, given to a callback that takes one event object since: `onValueChange={query.set}`, `onCheckedChange={toggle}` with `toggle(on: boolean)` or `onFiles={upload}` with `upload(files: File[])`. Found where the type check refuses the function and the component comes from a `@kayjs` library; the fix writes `event => query.set(event.value)`, passing the fields the handler took, first ones first, and is applied where its parameter is no object (a parameter typed as an object may be written for the event already, so that fix is offered). A handler that is not a plain name, such as an arrow function, is reported with no fix. The old form fails the type check, and would receive the event where it took the value, so the level is `deny` until it is rewritten. |
|
|
23
|
-
| `deprecated-call-result` | deny | deprecated | An island's call read as its data, `const list = await call(notes, '/')` then `list.items`, or `await add(input)` then `.id`, which resolved with the data before 1.105 and answers a `CallResult`, `{ ok: true, data }` or `{ ok: false, error }`, since. Found where the type check refuses a field of a `CallResult`, in a `.kay` script or a module. The fix writes `.orThrow()` after the call, which resolves with the data and throws a refusal as the call did; it is applied where the call is written on an imported name and nothing reads `ok`, `data` or `error` of the answer, and offered otherwise. The old form fails the type check, so the level is `deny`. |
|
|
24
|
-
| `deprecated-ui-items` | warn | deprecated | The prop holding the list a kayjs-ui component draws, `items` since 1.105 on every one: `tabs` on a Tabs, `avatars` on an AvatarGroup, `entries` on a CommandPalette or a Timeline, `links` on a SideNav, SiteNav or AppHeader, `steps` on Steps, `icons` on an IconPicker and `slides` on a Carousel, and the infinite source `list` of a Table, Carousel, Masonry, MediaGallery, VirtualList and LoadMore, which `items` takes as well (an array or an `infiniteList`; on a Table `items` is the infinite source and `rows` stays the array). `rows` of a Table and `options` of a choice control keep their names. The old names work until 1.108. Found on a component bound to the library's file in a template. The fix writes `items`; it offers none where `items` is already written. TabNav's `tabs` and `links` are two shapes picked by `param`, and the `links` of a SideNav group are data: both keep their names. |
|
|
25
|
-
| `deprecated-ui-input` | warn | deprecated | The `id`, `title` and `data-*` attributes of a kayjs-ui Toggle, Checkbox, Slider, ColorInput, Combobox (its `id` names the list and stays) or DateInput, which reached the input before 1.105 and are on the root element now, as on every component; the input takes `inputProps`. The old form works on the root until 1.108, so a stylesheet or a script that found the input by its `id` is what changes. Found on a component bound to the library's file in a template. The fix writes them all into one `inputProps={{ ... }}`; it offers none beside an `inputProps` already written. |
|
|
26
|
-
| `deprecated-ai-language` | warn | deprecated | `language` in the options of kayjs-ai's `transcribe()` and `describeImage()`, `locale` since 1.105: a BCP 47 tag such as `fr` or `pt-BR` as everywhere in kay, which `transcribe()` turns into the ISO 639-1 code its provider takes. The old name works until 1.108. Found on a call of either imported from `@kayjs/ai`, in the options object written in the call, in the TypeScript files and `.kay` files of the project. The fix renames the key, a bare `{ language }` becoming `locale: language`; an object that spreads another, or that has a `locale` already, is reported with no fix. |
|
|
27
|
-
| `deprecated-cms-options` | warn | deprecated | `role`, `guard: passwordGuard(...)` and a list `uploads` of `cms()`, `access` and `uploads: { types }` since 1.105: `role: 'editor'` is `access: 'editor'`, `guard: passwordGuard(password, options)` is `access: { password, ...options }` and `uploads: ['image/*']` is `uploads: { types: ['image/*'] }`; `member` is reported with no fix, being one `access` function. The old forms work until 1.108. Found on a call of `cms` imported from `@kayjs/cms`, in the options written in the call, in the TypeScript files and `.kay` files of the project. An options object with a spread or an `access` already is reported with no fix, and the `passwordGuard` import the fix leaves unused can go. |
|
|
28
|
-
| `deprecated-mail-form` | warn | deprecated | kayjs-mail's own `SubscribeForm`, kayjs-ui's since 1.105: mail ships the actions (`mail.list().form()`, `contactForm()`) and kayjs-ui the forms, so the unstyled `@kayjs/mail/subscribe-form.kay` is gone and `@kayjs/ui/subscribe-form.kay` takes its props (`label`, `submitLabel`, `sentLabel`, `noticeText`, `privacy`, `privacyLabel`, `wordingId`) and reads the list's `privacy` from its action. The old file is gone from 1.105, so the lint is a migration aid until 1.108 and its import fails to build before the fix runs. Found on an import of it in the TypeScript files and `.kay` files of the project. The fix writes the new path, safe when the project lists `@kayjs/ui` and not otherwise, as its `kmail-subscribe` classes are replaced by the themed form's own. |
|
|
29
|
-
| `deprecated-mail-send` | warn | deprecated | `send`, `enqueue` and `registeredMailer` imported from `@kayjs/mail`, which sent through the mailer of the latest site started in the process, so two sites in one process (test sites, say) mixed their mails. Since 1.105 a mail is sent through the site that answers the request: `ctx.locals.mail.send()` and `.enqueue()` in a page, an action or a guard, and the mailer `src/mail.ts` exports in a job or a script. `send` and `enqueue` work until 1.108, `registeredMailer` is gone. Found on an import from `@kayjs/mail` in the TypeScript files and `.kay` files of the project; no fix, as a call has no request to read the mailer from unless its function is given one. |
|
|
30
|
-
| `deprecated-store-names` | warn | deprecated | The store and table names of kayjs-ai, kayjs-mail and kayjs-cms, which one naming took over in 1.105: `ai({ conversations })` is `ai({ store })`, `pgConversations`, `sqliteConversations`, `createConversationTable` and `conversationTable` of `@kayjs/ai` are `pgAi`, `sqliteAi`, `createAiTables` and `aiTables`, `openLists`, `createMailListTables` and `mailListTableNames` of `@kayjs/mail` are `sqliteLists`, `createMailTables` and `mailTables`, `listStore` and `suppressionStore` of `mailer()` are `store: { lists, suppressions }`, and `pgLoader` and `sqliteLoader` of `@kayjs/cms` are `pgCms` and `sqliteCms`. The old names work until 1.108. Found in imports from the `/pg` and `/sqlite` entries and in the options written in a call of `ai` or `mailer`, in the TypeScript files and `.kay` files of the project. The fix renames the imports and their uses and the `conversations` key, and moves a lone `listStore` or `suppressionStore` under `store`; both together, a spread or a `store` already there are reported with no fix. |
|
|
31
|
-
| `deprecated-hook-names` | warn | deprecated | A server hook of the libraries that observes, written `on<Verb>` before 1.105 and `after<Verb>` since, beside `before<Verb>` that may refuse or change: kayjs-auth's `onSignUp` (`afterSignUp`), kayjs-mail's `onSend` and `onSuppress` (`afterSend`, `afterSuppress`, also `contactForm()`'s `onSend`) and a list's `onSubscribe`, `onConfirm`, `onUnsubscribe` and `onBroadcast`, kayjs-cms's `onSave` and `onUpload` (`afterSave`, `afterUpload`, also per collection) and kayjs-ai's `onStep`, `onToolCall` and `onSuccess` (`afterStep`, `afterToolCall`, `afterRequest`). `onError` and `onEvent` keep their names. The old names work until 1.108 and the new one wins when both are written. Found in the options object written in a call of `auth`, `authCore`, `mail`, `mailer`, `contactForm`, `cms`, `ai`, `ask`, `speak`, `embed`, `transcribe` or `describeImage` imported from its library, in a `.list()` call of a file importing kayjs-mail, in each collection of `cms({ collections })` and in the `hooks` object of kayjs-auth's `src/auth.ts`. The fix renames the key, a bare `{ onSave }` becoming `afterSave: onSave`; an object that spreads another or writes the new name already is reported with no fix. |
|
|
32
|
-
| `deprecated-test-helpers` | warn | deprecated | The test helpers of the libraries and of a test site under their names before 1.105. `aiTest`, `mailTest`, `cmsTest` and `authTest` of `@kayjs/ai/test`, `@kayjs/mail/test`, `@kayjs/cms/test` and `@kayjs/auth/test` are `test(site)` in each, with a `reset()`, and a site's `signInAs` signs in for every library that joined it; `site.refusal(action, ...)` is `site.expectRefused(action, ...)` and `site.socketRefusal(...)` is `site.socket.refused(...)`. The old names work until 1.108. Found in the TypeScript files and `.kay` files of the project: an import from a library's test entry, and a use of the two methods on a name bound once to `testSite()` of `kay/test` (or to an `.as()` of one), as `kay check` reads no types. The fix renames the import and keeps the local name (`test as mailTest`), and renames the method. |
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Deprecated lints of 1.105
|
|
2
|
-
|
|
3
|
-
## Common tasks
|
|
4
|
-
|
|
5
|
-
- Move an app off every 1.105 form at once: `kay upgrade`, or `kay check --fix --since 1.105`; see [Apply the quick fixes](lints.md#apply-the-quick-fixes).
|
|
6
|
-
|
|
7
|
-
## Reference
|
|
8
|
-
|
|
9
|
-
### Deprecated lints of 1.105
|
|
10
|
-
|
|
11
|
-
The lints of the `deprecated` group that came in 1.105, each reported until 1.108 with a safe fix unless its row says otherwise. The older ones are in [Deprecated lints](deprecated-lints.md).
|
|
12
|
-
|
|
13
|
-
| Lint | Default | Group | Reports |
|
|
14
|
-
| --- | --- | --- | --- |
|
|
15
|
-
| `deprecated-live-api` | warn | deprecated | `set(key, next)` and `set(user, next)` of a live value, `set(next, { key })` and `set(next, { user })` since 1.105, and `presence(room, member)`, `presence({ room, member })`. Found on a name bound once to a `live()` call from `kay` or imported under a name every declaration agrees on; the fix reorders the arguments. |
|
|
16
|
-
| `deprecated-action-readers` | warn | deprecated | An action's `failed()`, `error(field)` and `validate(form, field)`, `form.failed()`, `form.error(field)` and `form.validate(form, field)` since 1.105. Found on a name bound once to `action()` from `kay`, its `.with()`, or imported in lowercase from a `.kay` file, templates included, not on a prop; the fix writes `form.`. |
|
|
17
|
-
| `deprecated-action-type` | warn | deprecated | `Action<never, unknown>`, `Action` since 1.105, whose parameters default to any action. Found on the `Action` imported from `kay`; the fix drops the type arguments. |
|
|
18
|
-
| `deprecated-source-readers` | warn | deprecated | The readers and hooks of island sources before 1.105, since 1.105: `value()` of a `resource`, `last()` of a stream or a socket, `rows()`, `unsynced()` and `syncStatus()` of a `local()` collection, `onSuccess({ data })` of a `track()` handle and `onSync({ rows })` of a collection, and `succeeded()` of an action. Every source reads `data()`, `status()`, `pending()`, `error()` and `retry()` and tells `onData({ value })` and `onError`; a collection's sync is `sync.status()` and `sync.queued()`. `kay upgrade` renames them on a name bound once to a `kay` call in the file, its template included, and turns the event's `data` and `rows` into `value`; an action's `succeeded()?.data` becomes `data()` and a comparison with `undefined` a `status()` test. A read it cannot rewrite exactly (a handler passed by name, `succeeded()` used as a whole) is reported with no fix. |
|
|
19
|
-
| `deprecated-job-handler` | warn | deprecated | A job handler written before 1.105, when every job's became `(input, ctx)`, `ctx` holding `signal`, `job`, `log`, `locale` and a workflow's `step`: a queue's `(payload, signal, job)`, a workflow's `({ id, input, step })` (now `(input, { step, job: { id } })`, `job.id` being the run's id), and a scheduled or `background` job's `(signal)` (now `(_, { signal })`, a schedule's first argument being `{ schedule, boot }`). A queue handler in the old shape still runs until 1.108, as its second argument is the signal; a workflow, a schedule and a `background` job in it do not, and a handler passed by name, not written in the call, is reported by nothing: TypeScript flags it. The fix destructures the parameters off `ctx` under the names the body uses; one with a default, a type other than `AbortSignal` or a comment in the way is reported with no fix. |
|
|
20
|
-
| `deprecated-schedule-call` | warn | deprecated | `schedule('@hourly', job, options)`, since 1.105 `schedule({ cron: '@hourly', ...options }, job)`, and `every` for a length, `schedule({ every: '30s' }, job)`: the schedule and its options are one object, as a queue's. The old form works until 1.108. Found on a call of `schedule` from `kay/server` whose first argument is a string or number literal; the fix writes `every` or `cron`, moves the options beside it and a non-literal options value as a spread, and offers none where a comment sits between. |
|
|
21
|
-
| `deprecated-job-options` | warn | deprecated | `lostAfter` in the options of `queue()` or `workflow()`, since 1.105 `timeout`, the one name of a job's time limit, as a schedule's. The old name works until 1.108. The fix renames the key; one written beside a `timeout` is reported with no fix. |
|
|
22
|
-
| `deprecated-disk-files` | warn | deprecated | `diskFiles(dir, hooks)`, since 1.105 `diskFiles({ dir, ...hooks })`: every file store takes one options object. The string form works until 1.108. The fix writes the object, spreading hooks that are not a literal; one with a comment in the way is reported with no fix. |
|
|
23
|
-
| `deprecated-guard-option` | warn | deprecated | `guard` of `vitals()` and of the `jobs` and `images` of kay.config.ts, since 1.105 `guards`; `requireGuards`, since 1.105 `guards: { default: 'closed'` or `'open' }`. The old forms work until 1.108. The fix renames the key and writes the default; one beside a `guards` is reported with no fix. |
|
|
24
|
-
| `deprecated-config-switch` | warn | deprecated | `proxy: 2` in kay.config.ts, `proxy: { hops: 2 }` since 1.105, where `proxy: 1` is `proxy: true`: every feature key of the config is `false` for off, `true` for its defaults or an object of options, so the number of proxies was a third form of the same switch. The number works until 1.108. Found in the object kay.config.ts exports. The fix writes `true` for 1 and `{ hops: n }` for a whole number above it; a number that is no whole number from 1 is reported with no fix. |
|
|
25
|
-
| `deprecated-images-keys` | warn | deprecated | The flat keys of `images` in kay.config.ts, grouped since 1.105: `remoteMaxSize` and `remoteTimeout` are `remote: { maxSize, timeout }`, `quality`, `webp` and `avif` are `formats: { quality, webp, avif }`, `maxVariants` and `queue` are `limits: { variants, queue }`. They work until 1.108. The fix moves the keys into their group, unless the object spreads or already has it. |
|
|
26
|
-
| `deprecated-client-keys` | warn | deprecated | The keys `links`, `offline` and `search` of kay.config.ts, written in `client` since 1.105 with the rest of what the browser is given: `client: { links, offline, search }`. They work until 1.108. Found in the object kay.config.ts exports and in the `config` of `pages()` and `testSite()`. The fix moves the keys into `client` as written, unless the object spreads, holds a computed key or has a `client` already. |
|
|
27
|
-
| `deprecated-config-groups` | warn | deprecated | The keys `images`, `fonts`, `favicon`, `manifest` and `publicCache` of kay.config.ts, written in `assets` since 1.105, and `observe`, `health`, `metrics` and `jobs`, written in `ops`: `assets: { images, fonts, favicon, manifest, publicCache }`, `ops: { observe, health, metrics, jobs }`. They work until 1.108. Found in the object kay.config.ts exports, in the `config` of `pages()` and `testSite()` and in the `config` of an extension a file types `KayExtension`, which takes the same keys. The fix moves the keys into their group as written, unless the object spreads, holds a computed key or has the group already. |
|
|
28
|
-
| `deprecated-i18n-keys` | warn | deprecated | The keys `defaultLocale`, `prefixDefault` and `domains` of `i18n` in kay.config.ts, since 1.105 `default` and `mode`: `mode: 'always'` is `prefixDefault: true` and `mode: { domains }` is `domains`, so a config can no longer give both. They work until 1.108. Found in the object kay.config.ts exports and in the `config` of `pages()` and `testSite()`. The fix renames or rewrites the key where `i18n` is written in place and `default` and `mode` are not there yet; `domains` beside `prefixDefault`, a `prefixDefault` that is no literal `true` and an `i18n` that spreads are reported with no fix. |
|
|
29
|
-
| `deprecated-secret-keys` | warn | deprecated | The secrets of kay.config.ts in one shape since 1.105, each `string | { env } | { file }`: `mcp.key` is `mcp.token`, and `proxy.key`, a header name, is `{ header, secret? }`, so `proxy: { key: { header: 'x-upstream-key' } }`; the `mcpKey` and `proxyKey` options of `testSite()` are the `token` and the `secret` of its `config`. They work until 1.108. Found in the object kay.config.ts exports and in the `config` of `pages()` and `testSite()`. The fix renames `mcp.key` (a `key: false` and an `mcp` that spreads or has a `token` are reported with no fix) and wraps the header of `proxy.key`; the options of `testSite()` move into its `config`, `mcpKey` always and `proxyKey` where the app's config names the header, and are reported with no fix beside a `config` already written. |
|
|
30
|
-
| `deprecated-route-keys` | warn | deprecated | `serve.apiPrefix` and the `path` of `openapi`, `mcp`, `health`, `metrics` and `jobs` are `endpoints.api`, `.openapi`, `.mcp`, `.health`, `.metrics` and `.jobs` since 1.105; `openapi.referencePath` is `reference: { path }`. The fix writes a new `endpoints`, unless the object spreads, has an `endpoints` or a comment would be lost. |
|
|
31
|
-
| `deprecated-app-hooks` | warn | deprecated | The hooks and log of the config under their names before 1.105, when the hooks became flat keys named by the moment they run: `onStart` is `onListen` (a job's `onStart` keeps its name), `observe.onError` is `onError` beside `observe`, and `observe.log` as `'json'` or a function is `{ format: 'json' }` or `{ sink }`. The old forms work until 1.108. Found in the object kay.config.ts exports and in the options of `pages()` and `testSite()` with their `config`. The fix renames and moves the keys; an `onListen` or `onError` already written, a comment in the way or an `observe` that is no literal is reported with no fix. |
|
|
32
|
-
| `deprecated-hook-context` | warn | deprecated | `ctx` read off the event of an action's `beforeRun`, `onSuccess` and `onError`, `context` since 1.105: every hook event carries one `context`, an action's being its own context beside `ip`, `userAgent` and `userId`. The old field works until 1.108. Found in the hooks written in `actions` of kay.config.ts and in the options of an `action()` call imported from `kay`, as `{ ctx }` in the parameters or `event.ctx`. The fix writes `context: ctx` or `context`; a name given a default is reported with no fix, a hook passed by name is not found. |
|
|
33
|
-
| `deprecated-pages-options` | warn | deprecated | The config keys written beside `root` in the options of `pages()` and `testSite()`, `config` since 1.105: `pages({ root, config: { minify: false } })`, the options no longer mirroring the whole config. `root`, `dev`, `prebuilt` and a test site's `browser`, `headers`, `use`, `locals`, `outgoing`, `islands`, `styles`, `mcpKey` and `proxyKey` stay. The old form works until 1.108. Found in a call of `pages` from `kay/server` or `testSite` from `kay/test`. The fix moves the keys into `config`; options that spread, hold a computed key or have a `config` already are reported with no fix. |
|
|
34
|
-
| `deprecated-store-ms` | warn | deprecated | A ttl of `kv(namespace).set(key, value, ttl)` and `.once(key, ttl)` written as milliseconds, a `Duration` since 1.105 as every length a store takes: a `RateStore`'s window, a `KvStore`'s ttl, a `SessionStore`'s max age and a `LiveStore`'s `endAll` ttl, which a store declares with `durations: true` (one without it keeps receiving milliseconds until 1.108). Found on a call chained to `kv(...)` from `kay/server` or `kay/library`, or on a name bound to it in the same file, with a number written as a literal or as arithmetic of literals; a number held in a variable is a type error in the editor, and a store of your own is changed by hand. The fix writes the value in milliseconds, `'60000ms'`. |
|
|
35
|
-
| `deprecated-socket-frames` | warn | deprecated | `ws.send(JSON.stringify(value))` in a handler of an `api()` module's `.ws()` route, `ws.send(value)` since 1.105: every websocket frame is JSON, so a string, a number, a boolean or `null` reads back as what it was, and a text that already is JSON would reach the client as a string holding it. The old form still sends, but the client reads the JSON text as a string, where it read the object before; it is reported until 1.108. Found on the first parameter of an `open`, `message` or `close` handler written in the options of a `.ws()` chained from the `api` a file imports from `kay/server`. The fix sends the value itself. |
|
|
36
|
-
| `deprecated-ttl-names` | warn | deprecated | `maxAge` where it says how long something lives, `ttl` since 1.105, `maxAge` staying for an HTTP header or a cookie: the option of `signed.sign()`, `files.url()` and `workChallenge()` from `kay/server`, of kayjs-auth's `proofOfWork()`, the `proofOfWork` and `minTime` of an action's `protect`, and the `maxAge.link` and `maxAge.code` a kayjs-auth mail template reads (found in a file importing `@kayjs/auth`; a template reading `data.maxAge` without that import is not found). It works until 1.108. The fix renames the key, unless a `ttl` is written too. |
|
|
37
|
-
| `deprecated-env-files` | warn | deprecated | `env: { compose, example }` in kay.config.ts, `envFiles` since 1.105: the key names the compose and example files the declared variables are compared with (or `false` for no comparison), where `env` read as the variables themselves. It works until 1.108. The fix renames the key, unless an `envFiles` is written too. |
|
|
38
|
-
| `deprecated-context-import` | warn | deprecated | `defineContext` imported from `kay/library`, `kay/server` since 1.105, where `defineEnv` and the other helpers an app imports live. `kay/library` keeps it until 1.108. The fix changes the import's source, or moves the specifier to a new import when others share the line. |
|
|
39
|
-
| `deprecated-rate-enforce` | warn | deprecated | `enforce(ctx)` on what `rateLimit()` returns, `check(ctx)` since 1.105: `limiter().enforce(key)` counts under a key and refuses nothing, so one name held two jobs, and `check` is the guard's call that refuses with a 429. `count(from)` now gives the window, `{ count, resetAt, wait }`, beside `hit`. The old name works until 1.108. Found on a name bound once to a call of `rateLimit` imported from `kay/server`, in the TypeScript files and `.kay` files of the project, as `kay check` reads no types: a limit reached through a property, a parameter or another file is not found. The fix renames the method. |
|
|
40
|
-
| `deprecated-deny-call` | warn | deprecated | `deny(status, 'message', data)` of a guard, a page, an action and an endpoint, `deny(status, { message, errors, data })` since 1.105: a refusal takes one object in every place, as `refuse(status, { message, errors, data })` does, so `errors` puts a message on a field and the text is no longer an argument beside the data. An action answers `deny(status, { message, data, errors })` as `ctx.fail` did, the page again or an `ActionError`, so its text form, which stopped with plain text, becomes the form's message after the fix. The text form works until 1.108. Found on a call of `deny`, bare or read off a name, with a literal status from 400 to 599 and a text second argument, in the TypeScript files and `.kay` files of the project. The fix writes the object, unless a comment sits between the arguments or a `data` is given, which an action answers as a failure, not plain text. |
|
|
41
|
-
| `deprecated-ctx-fail` | warn | deprecated | `ctx.fail(status, data, errors)` of an action, `ctx.deny(status, { data, errors })` since 1.105: an action refuses as a guard and a page do, with one call and one shape, and `deny` throws, so a statement ends the handler as well and `unreturned-fail` has nothing left to report. A text `data` is the `message`: `ctx.fail(409, 'Taken')` is `ctx.deny(409, { message: 'Taken' })`, and `failed()?.data` no longer holds it. `ctx.fail` works until 1.108. Found on `ctx.fail` of an action handler's `ctx`, in the TypeScript files and `.kay` files of the project. The fix is made where the call is returned (`return ctx.fail(...)`, a branch of a conditional or an arrow's body), since a call that was not returned did nothing and `deny` would now stop; the others are reported with no fix. |
|
|
42
|
-
| `deprecated-refuse-call` | warn | deprecated | `refuse(message, { status, errors, data })`, `refuse(status, { message, errors, data })` since 1.105: the status leads and the rest is the one object `ctx.deny` takes. The old form works until 1.108. Found on a call of `refuse` imported from `kay` or `kay/library` whose first argument is a text, in the TypeScript files and `.kay` files of the project. The fix writes the status (the 403 or 422 the old call chose, when `errors` names fields written in the call) and the object; options that are not an object written in the call, or an `errors` that is not, are reported with no fix. |
|
|
43
|
-
| `deprecated-format-duration` | warn | deprecated | `formatDuration(ms)` with a bare number, a `Duration` since 1.105: kay's durations carry their unit everywhere, `formatDuration('125m')`, and `formatBytes` takes a `ByteSize` the same way (`formatBytes('1.5kb')`), which also still takes a number of bytes. The old form works until 1.108. Found on a call imported from `kay/i18n` whose argument is a number written as a literal or as arithmetic of literals, in the TypeScript files and `.kay` files of the project; a number held in a variable is a type error in the editor and `kay check` reads no types here. The fix writes the value in milliseconds, `'7500000ms'`. |
|
|
44
|
-
| `deprecated-image-options` | warn | deprecated | The options of an `img` written the old way, as attributes since 1.105 like every other option of the image: `no-placeholder` is `placeholder={false}`, and `img({...image(hero, { aspect: '1/1', sizes: '100vw' })})` is `img(src={hero} aspect="1/1" sizes="100vw")`, `image()` staying for an element that is no `img`. The old forms work until 1.108. The fix rewrites the attribute, and the spread when it is the only one, the `src` and the options of the call are written in the call itself and the `img` writes none of them; a call with another shape is reported with no fix. |
|
|
45
|
-
| `deprecated-import-path` | warn | deprecated | A name imported from an entry that is no longer its home, which each name has one of since 1.105: `mount` and `Mounted` come from `kay`, not `kay/mount`; `s`, `RateLimit` and `RateLimitRefusal` from `kay`, not `kay/server`; `sqliteCache` from `kay/cache`, not `kay/server`. The old paths work until 1.108. Found in the imports of the TypeScript files and `.kay` files of the project. The fix takes the name out of the import and imports it from its home, in a statement of its own after it; an import with a default or namespace specifier, or a comment in it, is reported with no fix. |
|
|
46
|
-
| `deprecated-island-events` | warn | deprecated | An island listening to an event of kay with `listen`, `kay:navigate`, `kay:navigate-start`, `kay:navigate-error`, `kay:navigate-stall`, `kay:action-start`, `kay:action-success`, `kay:action-error`, `kay:consent` or `kay:install`, since 1.105: an island uses the function hooks, `navigation.onNavigate`, `onStart`, `onError` and `onStall`, `add.onStart`, `onData` and `onError` of an action, the `consent` signal and `installPrompt.available()`, and the events stay for a plain script, which has no island to hook into. The old form works until 1.108. Found on a `listen` imported from `kay`. The fix writes the method for the swap's events when the handler takes no parameter, as the hook hands an object of its own where the event handed `detail`; any other listener is reported with the hook to write and no fix. |
|
|
47
|
-
| `deprecated-listen-target` | warn | deprecated | `listen(window, ...)`, `listen(() => window, ...)` since 1.105: the target is one form, a function returning it, which a `.ts` module can run on the server where `window` is not read, and which a signal or a `ref` follows as it changes. A target given as a value is read once. The old form works until 1.108. Found on a call of `listen` imported from `kay` whose first argument is `window`, `document` or a member of one, in the TypeScript files and `.kay` files of the project. The fix wraps the target. |
|
|
48
|
-
| `deprecated-navigate-query` | warn | deprecated | `navigate({ query })`, `navigate.query(changes)` since 1.105: one name did two jobs, going to a page with `navigate(href)` and changing the query of the current one in place. The old form works until 1.108. Found on a call of `navigate` imported from `kay`, in the TypeScript files and `.kay` files of the project, whose first argument is an object literal with `query`. The fix writes `navigate.query` with the changes; an object with another key, or a comment in it, is reported with no fix. |
|
|
49
|
-
| `deprecated-navigation-hooks` | warn | deprecated | `onNavigate(fn)` and `onBeforeNavigate(fn)`, `navigation.onNavigate(fn)` and `navigation.onBeforeNavigate(fn)` since 1.105: the hooks of a source are its methods, as `resource` has `onData` and a stream `onOpen`, so `navigation` holds the status and the hooks together. The old functions work until 1.108. Found on a call of either imported from `kay`, in the TypeScript files and `.kay` files of the project. The fix writes the method and moves the import; a name read other than as a call, a `navigation` of the file's own or an aliased import is reported with no fix. |
|
|
50
|
-
| `deprecated-page-cache` | warn | deprecated | `ttl` or `cacheControl` in `page`, `cache` since 1.105: `cache: '1h'` keeps a prerendered page that long and has a shared cache keep it as long, `cache: { browser, shared, swr }` sets each part of the header, `'private'` and `false` send `private` and the default. The old form works until 1.108. The fix renames a lone `ttl`, or a lone `cacheControl: false`; the two together, or a header written out, are left for you to write as `cache`. |
|
|
51
|
-
| `deprecated-page-island` | warn | deprecated | A page without a `--- server` fence that is an island, since 1.105: an `on*`, `bind:` or `ref` in it, a browser value of `kay` such as `signal`, or a live or persisted import. A page renders once on the server and is never an island, so what needs the browser belongs in a component the page renders. It still works as an island until 1.108, which refuses it. Found in the pages of the project, at the thing that makes the page an island; a layout or a page with a `--- server` fence is not reported. It has no fix: moving the code into a component is not an edit that is safe to apply. |
|
|
52
|
-
| `deprecated-page-seo` | warn | deprecated | `noindex`, `sitemap`, `lastmod`, `search` or `feed` at the top level of `page`, the `seo` group since 1.105: `seo: { title, description, image, canonical, noindex, sitemap, lastmod, search, feed }` holds what search engines, social cards and the sitemap read of a page, as `head(title=... description=...)` and `seo` in kay.config.ts do. The old form works until 1.108. The fix moves the settings into a new `seo`; a page that has one already keeps them for you to move. |
|
|
53
|
-
| `deprecated-persisted-call` | warn | deprecated | `persisted(name, value)` keeping a cookie without saying so, `persisted.cookie(name, value)` since 1.105: every call names its storage, `persisted.cookie()`, `persisted.local()`, `persisted.session()`, and `queryParam()` for the URL, so a bare call is not read as any of them. The old call works until 1.108, and `storage` in its options, which `deprecated-persisted-storage` rewrote until 1.104, is gone. Found on a call of `persisted` imported from `kay`, in the TypeScript files and `.kay` files of the project. The fix writes `.cookie`; a call with a `storage` option is reported with no fix. |
|
|
54
|
-
| `deprecated-persisted-query` | warn | deprecated | `persisted.query(name, value, options)`, `queryParam(name, { default: value, ...options })` since 1.105: a query param has one signal, which takes the value a param left out reads as `default` and the `values` and `history` options `persisted.query()` took. The old call works until 1.108. Found on a call of `persisted.query` imported from `kay`, in the TypeScript files and `.kay` files of the project. The fix writes the call and moves the import, dropping `persisted` when nothing else reads it; a call with a spread argument, a comment inside it or an import it cannot rewrite is reported with no fix. |
|
|
55
|
-
| `deprecated-island-fence` | warn | deprecated | The `--- island`, `--- client` and `--- static` fence lines and `export const island = { ... }` in a `--- module` fence, since 1.105: `island({ render, hydrate, persist, interactive })` first in the script says the same, so an island declares its settings as it declares its props. The old forms work until 1.108. The fix writes the call and drops the fence word or the export. |
|
|
56
|
-
| `deprecated-island-attributes` | warn | deprecated | `hydrate="client"` on a component call is `render="client"`, and `server="defer"` is `server defer`, since 1.105: `hydrate` is only when an island hydrates. The old forms work until 1.108. The fix rewrites the attribute. |
|
|
57
|
-
|
|
58
|
-
The rows of the 1.105 lints of kayjs-ai, kayjs-ui, kayjs-cms, kayjs-mail and kayjs-auth are in [Deprecated lints of the 1.105 libraries](deprecated-lints-1-105-libraries.md).
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import type { CheckDiagnostic, CheckOptions } from '.'
|
|
2
|
-
import type { Node } from '../compiler/estree'
|
|
3
|
-
import { lintLevel } from '../compiler/lints'
|
|
4
|
-
import { parseKay } from '../compiler/parser'
|
|
5
|
-
import { boundAt, proseSpans, templateScopes } from '../compiler/template-scopes'
|
|
6
|
-
import { walk } from './ast'
|
|
7
|
-
import { bindings, boundOnce } from './bindings'
|
|
8
|
-
import { scan } from './renamed-exports'
|
|
9
|
-
|
|
10
|
-
// What an action read before 1.105 on its own, which a form shows and now reads from `form`.
|
|
11
|
-
const READERS = ['failed', 'error', 'validate'] as const
|
|
12
|
-
|
|
13
|
-
const LOWERCASE = /^[a-z]/
|
|
14
|
-
const NEEDLE = /\.(?:failed|error|validate)\b/
|
|
15
|
-
|
|
16
|
-
function escaped(name: string): string {
|
|
17
|
-
return name.replaceAll('$', '\\$')
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function message(reader: string): string {
|
|
21
|
-
return `an action's \`${reader}()\` is \`form.${reader}()\` since 1.105, the readers a form shows being grouped apart from the call state; the old name works until 1.108`
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// The names a file binds once to an action: a call of `action` from `kay`, a `.with(...)` of one, or a lowercase name imported from a `.kay` file, where a page declares its actions, as `kay check` reads no types.
|
|
25
|
-
function actionNames(ast: Parameters<typeof bindings>[0]): Set<string> {
|
|
26
|
-
const names = bindings(ast)
|
|
27
|
-
const receivers = boundOnce(ast, names, 'action')
|
|
28
|
-
|
|
29
|
-
for (const node of ast.body) {
|
|
30
|
-
if (node.type !== 'ImportDeclaration' || typeof node.source.value !== 'string' || !node.source.value.endsWith('.kay'))
|
|
31
|
-
continue
|
|
32
|
-
|
|
33
|
-
for (const specifier of node.specifiers) {
|
|
34
|
-
if (specifier.type === 'ImportSpecifier' && LOWERCASE.test(specifier.local.name) && names.get(specifier.local.name) === 1)
|
|
35
|
-
receivers.add(specifier.local.name)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
walk(ast, (node) => {
|
|
40
|
-
if (node.type === 'VariableDeclarator' && node.id.type === 'Identifier' && node.init?.type === 'CallExpression' && names.get(node.id.name) === 1) {
|
|
41
|
-
const { callee } = node.init
|
|
42
|
-
|
|
43
|
-
if (callee.type === 'MemberExpression' && !callee.computed && callee.property.type === 'Identifier' && callee.property.name === 'with' && callee.object.type === 'Identifier' && receivers.has(callee.object.name))
|
|
44
|
-
receivers.add(node.id.name)
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
return receivers
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Whether a call of `reader` has the arguments the action's own has: none for `failed`, a field or none for `error`, a form and a field for `validate`.
|
|
52
|
-
function shaped(reader: string, args: Node[]): boolean {
|
|
53
|
-
return reader === 'validate' ? args.length >= 1 && args.length <= 2 : args.length <= (reader === 'failed' ? 0 : 1)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// What an action reads since 1.105: `form.failed()`, `form.error(field)` and `form.validate(form, field)`, in place of `failed()`, `error(field)` and `validate(form, field)`, which the call state (`pending()`, `status()`, `data()`) no longer shares an object with.
|
|
57
|
-
// An action is known only by a name the file binds once to a call of `action` from `kay` or imports, lowercase, from a `.kay` file, as `kay check` reads no types; a template reads the names its fences bind. An action reached through a property or a prop is not found.
|
|
58
|
-
export async function actionReaders(root: string, options: CheckOptions): Promise<CheckDiagnostic[]> {
|
|
59
|
-
if (lintLevel('deprecated-action-readers', options.lints) === 'allow')
|
|
60
|
-
return []
|
|
61
|
-
|
|
62
|
-
return scan(root, options, 'deprecated-action-readers', NEEDLE, ({ file, parsed, source, report }) => {
|
|
63
|
-
const receivers = new Set<string>()
|
|
64
|
-
|
|
65
|
-
for (const { ast } of parsed) {
|
|
66
|
-
for (const name of actionNames(ast))
|
|
67
|
-
receivers.add(name)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (receivers.size === 0)
|
|
71
|
-
return
|
|
72
|
-
|
|
73
|
-
for (const { ast, base } of parsed) {
|
|
74
|
-
walk(ast, (node) => {
|
|
75
|
-
if (node.type !== 'CallExpression')
|
|
76
|
-
return
|
|
77
|
-
|
|
78
|
-
const { callee } = node
|
|
79
|
-
|
|
80
|
-
if (callee.type !== 'MemberExpression' || callee.computed || callee.object.type !== 'Identifier' || callee.property.type !== 'Identifier' || !receivers.has(callee.object.name))
|
|
81
|
-
return
|
|
82
|
-
|
|
83
|
-
const reader = callee.property.name
|
|
84
|
-
|
|
85
|
-
if (!READERS.includes(reader as typeof READERS[number]) || !shaped(reader, node.arguments))
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
const at = base + callee.property.start
|
|
89
|
-
|
|
90
|
-
report(at, base + callee.property.end, message(reader), `write \`form.${reader}()\``, [{ start: at, end: at, text: 'form.' }])
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// The template, outside the fences: the same reads written as text.
|
|
95
|
-
const fences = parsed.map(({ base, text }) => [base, base + text.length] as const)
|
|
96
|
-
const template = file.endsWith('.kay') ? parseKay(source) : undefined
|
|
97
|
-
const scopes = template ? templateScopes(template) : []
|
|
98
|
-
const prose = template ? proseSpans(template) : []
|
|
99
|
-
const outside = (index: number, name: string) => !fences.some(([from, to]) => index >= from && index < to) && !prose.some(span => index >= span.start && index < span.end) && !boundAt(scopes, name, index)
|
|
100
|
-
|
|
101
|
-
if (!template)
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
for (const name of receivers) {
|
|
105
|
-
for (const match of source.matchAll(new RegExp(`(?<![\\w$.])${escaped(name)}\\.(${READERS.join('|')})\\(`, 'g'))) {
|
|
106
|
-
if (!outside(match.index, name))
|
|
107
|
-
continue
|
|
108
|
-
|
|
109
|
-
const at = match.index + name.length + 1
|
|
110
|
-
|
|
111
|
-
report(at, at + match[1]!.length, message(match[1]!), `write \`form.${match[1]!}()\``, [{ start: at, end: at, text: 'form.' }])
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
})
|
|
115
|
-
}
|
package/src/check/action-type.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { CheckDiagnostic, CheckOptions } from '.'
|
|
2
|
-
import { lintLevel } from '../compiler/lints'
|
|
3
|
-
import { importedName, walk } from './ast'
|
|
4
|
-
import { scan } from './renamed-exports'
|
|
5
|
-
|
|
6
|
-
const OLD_ARGUMENTS = /<\s*never\s*,\s*unknown\s*>/
|
|
7
|
-
|
|
8
|
-
// `Action<never, unknown>`, the type of an action of any input and output as before 1.105, is `Action` since: both parameters default to it, so the type a prop is given to take any action is the one every action has.
|
|
9
|
-
// Found on the `Action` a file imports from `kay`, under whatever local name, in the TypeScript files and the fences of `.kay` files.
|
|
10
|
-
export async function actionType(root: string, options: CheckOptions): Promise<CheckDiagnostic[]> {
|
|
11
|
-
if (lintLevel('deprecated-action-type', options.lints) === 'allow')
|
|
12
|
-
return []
|
|
13
|
-
|
|
14
|
-
return scan(root, options, 'deprecated-action-type', OLD_ARGUMENTS, ({ parsed, report }) => {
|
|
15
|
-
for (const { ast, base } of parsed) {
|
|
16
|
-
const locals = new Set<string>()
|
|
17
|
-
|
|
18
|
-
for (const statement of ast.body) {
|
|
19
|
-
if (statement.type !== 'ImportDeclaration' || statement.source.value !== 'kay')
|
|
20
|
-
continue
|
|
21
|
-
|
|
22
|
-
for (const specifier of statement.specifiers) {
|
|
23
|
-
if (specifier.type === 'ImportSpecifier' && importedName(specifier) === 'Action')
|
|
24
|
-
locals.add(specifier.local.name)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (locals.size === 0)
|
|
29
|
-
continue
|
|
30
|
-
|
|
31
|
-
walk(ast, (node) => {
|
|
32
|
-
if (node.type !== 'TSTypeReference' || node.typeName.type !== 'Identifier' || !locals.has(node.typeName.name) || node.typeArguments === null || node.typeArguments === undefined)
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
const [input, output, ...rest] = node.typeArguments.params
|
|
36
|
-
|
|
37
|
-
if (rest.length > 0 || input?.type !== 'TSNeverKeyword' || output?.type !== 'TSUnknownKeyword')
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
report(base + node.typeName.start, base + node.end, '`Action<never, unknown>` is `Action` since 1.105, which takes any action as a prop without the two parameters; the old form works until 1.108', 'write `Action`', [{ start: base + node.typeArguments.start, end: base + node.typeArguments.end, text: '' }])
|
|
41
|
-
})
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
}
|
package/src/check/ai-language.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { CheckDiagnostic, CheckOptions } from '.'
|
|
2
|
-
import type { Node, NodeOfType } from '../compiler/estree'
|
|
3
|
-
import { lintLevel } from '../compiler/lints'
|
|
4
|
-
import { keyName } from '../compiler/object-literal'
|
|
5
|
-
import { renamePackages } from '../package-names'
|
|
6
|
-
import { importsOf, walk } from './ast'
|
|
7
|
-
import { scan } from './renamed-exports'
|
|
8
|
-
|
|
9
|
-
const NEEDLE = /\b(?:transcribe|describeImage)\b/
|
|
10
|
-
const FROM_AI = (source: string) => renamePackages(source) === '@kayjs/ai'
|
|
11
|
-
const CALLS = ['transcribe', 'describeImage']
|
|
12
|
-
const HELP = 'write `locale`, which takes a BCP 47 tag such as `fr` or `pt-BR`'
|
|
13
|
-
|
|
14
|
-
type Property = Extract<NodeOfType<'ObjectExpression'>['properties'][number], { type: 'Property' }>
|
|
15
|
-
|
|
16
|
-
// `language` in the options of `transcribe()` and `describeImage()`, `locale` since 1.105: every call of kayjs-ai that names a language takes a BCP 47 tag under that name, and `transcribe` turns it into the ISO 639-1 code its provider takes.
|
|
17
|
-
// Found on a call of either imported from `@kayjs/ai`, or read off `import * as`, in the options object written in the call; the fix renames the key, a bare `{ language }` becoming `locale: language`, and offers none where `locale` is written too.
|
|
18
|
-
export async function aiLanguage(root: string, options: CheckOptions): Promise<CheckDiagnostic[]> {
|
|
19
|
-
if (lintLevel('deprecated-ai-language', options.lints) === 'allow')
|
|
20
|
-
return []
|
|
21
|
-
|
|
22
|
-
return scan(root, options, 'deprecated-ai-language', NEEDLE, ({ parsed, report }) => {
|
|
23
|
-
for (const { ast, base } of parsed) {
|
|
24
|
-
const found = CALLS.map(name => ({ name, ...importsOf(ast, FROM_AI, name) }))
|
|
25
|
-
|
|
26
|
-
if (found.every(({ locals, namespaces }) => locals.size === 0 && namespaces.size === 0))
|
|
27
|
-
continue
|
|
28
|
-
|
|
29
|
-
const isCall = (callee: Node): boolean => found.some(({ name, locals, namespaces }) => callee.type === 'Identifier'
|
|
30
|
-
? locals.has(callee.name)
|
|
31
|
-
: callee.type === 'MemberExpression' && !callee.computed && callee.object.type === 'Identifier' && namespaces.has(callee.object.name) && callee.property.type === 'Identifier' && callee.property.name === name)
|
|
32
|
-
|
|
33
|
-
walk(ast, (node) => {
|
|
34
|
-
if (node.type !== 'CallExpression' || !isCall(node.callee))
|
|
35
|
-
return
|
|
36
|
-
|
|
37
|
-
const argument = node.arguments[1]
|
|
38
|
-
|
|
39
|
-
if (argument?.type !== 'ObjectExpression')
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
const properties = argument.properties.filter((property): property is Property => property.type === 'Property')
|
|
43
|
-
const language = properties.find(property => !property.computed && keyName(property) === 'language')
|
|
44
|
-
|
|
45
|
-
if (!language)
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
const fixable = !argument.properties.some(property => property.type === 'SpreadElement') && !properties.some(property => keyName(property) === 'locale') && !language.method
|
|
49
|
-
const text = language.shorthand ? 'locale: language' : 'locale'
|
|
50
|
-
const edit = language.shorthand ? { start: base + language.start, end: base + language.end, text } : { start: base + language.key.start, end: base + language.key.end, text }
|
|
51
|
-
|
|
52
|
-
report(base + language.start, base + language.end, '`language` of `transcribe()` and `describeImage()` is `locale` since 1.105, a BCP 47 tag', HELP, fixable ? [edit] : null)
|
|
53
|
-
})
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
}
|
package/src/check/app-hooks.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { CheckDiagnostic, CheckOptions } from '.'
|
|
2
|
-
import type { NodeOfType } from '../compiler/estree'
|
|
3
|
-
import type { Property } from './regroup'
|
|
4
|
-
import type { Edit } from './renamed-exports'
|
|
5
|
-
import { lintLevel } from '../compiler/lints'
|
|
6
|
-
import { configObjects, propertiesOf, propertyOf } from './config-objects'
|
|
7
|
-
import { scan } from './renamed-exports'
|
|
8
|
-
|
|
9
|
-
type ObjectExpression = NodeOfType<'ObjectExpression'>
|
|
10
|
-
|
|
11
|
-
const NEEDLE = /\b(?:onStart|observe)\b/
|
|
12
|
-
const PUNCTUATION = /^[\s,]*$/
|
|
13
|
-
|
|
14
|
-
// Where the property `onError` of `observe` goes: beside it, or in its place when it was the only key.
|
|
15
|
-
function movedOnError(root: ObjectExpression, observe: Property, object: ObjectExpression, onError: Property, text: string, base: number): Edit[] | undefined {
|
|
16
|
-
if (propertyOf(root, 'onError') !== undefined || object.properties.some(property => property.type !== 'Property'))
|
|
17
|
-
return undefined
|
|
18
|
-
|
|
19
|
-
const written = text.slice(onError.start, onError.end)
|
|
20
|
-
|
|
21
|
-
if (object.properties.length === 1)
|
|
22
|
-
return [{ start: base + observe.start, end: base + observe.end, text: written }]
|
|
23
|
-
|
|
24
|
-
const at = object.properties.indexOf(onError)
|
|
25
|
-
const after = object.properties[at + 1]
|
|
26
|
-
const [from, to] = after === undefined ? [object.properties[at - 1]!.end, onError.end] : [onError.start, after.start]
|
|
27
|
-
// A comment between the keys would be lost with the property.
|
|
28
|
-
const between = after === undefined ? text.slice(from, onError.start) : text.slice(onError.end, to)
|
|
29
|
-
|
|
30
|
-
if (!PUNCTUATION.test(between))
|
|
31
|
-
return undefined
|
|
32
|
-
|
|
33
|
-
return [{ start: base + observe.start, end: base + observe.start, text: `${written}, ` }, { start: base + from, end: base + to, text: '' }]
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// `log` of `observe` as a group: `'json'` is `{ format: 'json' }` and a function written in place `{ sink }`.
|
|
37
|
-
function groupedLog(log: Property, text: string, base: number): { edits: Edit[], now: string } | undefined {
|
|
38
|
-
const { value } = log
|
|
39
|
-
|
|
40
|
-
if (value.type === 'Literal' && value.value === 'json')
|
|
41
|
-
return { edits: [{ start: base + value.start, end: base + value.end, text: '{ format: \'json\' }' }], now: '{ format: \'json\' }' }
|
|
42
|
-
|
|
43
|
-
if (value.type === 'ArrowFunctionExpression' || value.type === 'FunctionExpression')
|
|
44
|
-
return { edits: [{ start: base + value.start, end: base + value.end, text: `{ sink: ${text.slice(value.start, value.end)} }` }], now: '{ sink }' }
|
|
45
|
-
|
|
46
|
-
return undefined
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// The hooks and the log of kay.config.ts, and of the options of `pages()` and `testSite()`, written before 1.105: `onStart` is `onListen`, `observe.onError` is `onError` beside `observe`, and `observe.log` as `'json'` or a function is `{ format: 'json' }` or `{ sink }`.
|
|
50
|
-
export async function appHooks(root: string, options: CheckOptions): Promise<CheckDiagnostic[]> {
|
|
51
|
-
if (lintLevel('deprecated-app-hooks', options.lints) === 'allow')
|
|
52
|
-
return []
|
|
53
|
-
|
|
54
|
-
return scan(root, options, 'deprecated-app-hooks', NEEDLE, ({ file, parsed, report }) => {
|
|
55
|
-
for (const { ast, base, text } of parsed) {
|
|
56
|
-
for (const { object } of configObjects(file, ast)) {
|
|
57
|
-
const [start] = propertiesOf(object, 'onStart')
|
|
58
|
-
|
|
59
|
-
if (start !== undefined && !start.method && start.kind === 'init') {
|
|
60
|
-
const taken = propertyOf(object, 'onListen') !== undefined
|
|
61
|
-
const edits: Edit[] = taken ? [] : [start.shorthand ? { start: base + start.start, end: base + start.end, text: 'onListen: onStart' } : { start: base + start.key.start, end: base + start.key.end, text: 'onListen' }]
|
|
62
|
-
|
|
63
|
-
report(base + start.start, base + start.end, '`onStart` of the config is deprecated since 1.105: the hook that runs when the server listens is `onListen`, `onStart` naming where a job begins', 'write `onListen`', edits)
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const ops = propertyOf(object, 'ops')
|
|
67
|
-
const inOps = ops?.value.type === 'ObjectExpression' ? propertyOf(ops.value, 'observe') : undefined
|
|
68
|
-
|
|
69
|
-
// The `onError` of an `observe` inside `ops` is reported with no fix: it moves to the top of the config, beside `ops`, which the fix of `observe` does not reach.
|
|
70
|
-
for (const [observe, nested] of [[propertyOf(object, 'observe'), false], [inOps, true]] as const) {
|
|
71
|
-
const group = observe?.value.type === 'ObjectExpression' ? observe.value : undefined
|
|
72
|
-
|
|
73
|
-
if (observe === undefined || group === undefined)
|
|
74
|
-
continue
|
|
75
|
-
|
|
76
|
-
const [onError] = propertiesOf(group, 'onError')
|
|
77
|
-
const [log] = propertiesOf(group, 'log')
|
|
78
|
-
|
|
79
|
-
if (onError !== undefined)
|
|
80
|
-
report(base + onError.start, base + onError.end, '`observe.onError` is deprecated since 1.105: the hooks are flat keys of the config, named by the moment they run', nested ? 'write `onError` beside `ops`' : 'write `onError` beside `observe`', nested ? null : movedOnError(object, observe, group, onError, text, base) ?? null)
|
|
81
|
-
|
|
82
|
-
const grouped = log === undefined || log.shorthand ? undefined : groupedLog(log, text, base)
|
|
83
|
-
|
|
84
|
-
if (log !== undefined && grouped !== undefined)
|
|
85
|
-
report(base + log.value.start, base + log.value.end, '`observe.log` as `\'json\'` or a function is deprecated since 1.105: it is `{ format, requests, sink }`', `write \`${grouped.now}\``, grouped.edits)
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { CheckDiagnostic, CheckOptions } from '.'
|
|
2
|
-
import type { Node, NodeOfType } from '../compiler/estree'
|
|
3
|
-
import { lintLevel } from '../compiler/lints'
|
|
4
|
-
import { walk } from './ast'
|
|
5
|
-
import { scan } from './renamed-exports'
|
|
6
|
-
|
|
7
|
-
type Member = NodeOfType<'MemberExpression'>
|
|
8
|
-
|
|
9
|
-
const NEEDLE = /[aA]uth\b/
|
|
10
|
-
const AUTH_NAME = /^auth$/
|
|
11
|
-
|
|
12
|
-
// The methods of a group renamed in 1.105 to the verbs every group shares (`list`, `get`, `create`, `update`, `delete`, `revoke`), by group.
|
|
13
|
-
const GROUPED: Record<string, Record<string, string>> = {
|
|
14
|
-
organizations: { members: 'listMembers', setMemberRoles: 'updateMemberRoles', removeMember: 'deleteMember', invitations: 'listInvitations', myInvitations: 'listMyInvitations', invitation: 'getInvitation' },
|
|
15
|
-
admin: { roles: 'listRoles', auditLog: 'listAuditLog' },
|
|
16
|
-
oauthServer: { clients: 'listClients' },
|
|
17
|
-
passkeys: { rename: 'update' },
|
|
18
|
-
account: { changeUsername: 'updateUsername', profile: 'getProfile', saveProfile: 'updateProfile' },
|
|
19
|
-
oauth: { identities: 'listIdentities', providerToken: 'getProviderToken' },
|
|
20
|
-
magicLink: { signInWithCode: 'email.signInWithCode' },
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// The methods that sat on `auth` itself and went into a group.
|
|
24
|
-
const FLAT: Record<string, string> = {
|
|
25
|
-
requireAdmin: 'admin.require',
|
|
26
|
-
captchaRequired: 'captcha.required',
|
|
27
|
-
captchaChallenge: 'captcha.challenge',
|
|
28
|
-
provedLately: 'proof.recent',
|
|
29
|
-
reprove: 'proof.renew',
|
|
30
|
-
hasScope: 'tokens.hasScope',
|
|
31
|
-
scopes: 'tokens.scopes',
|
|
32
|
-
oauthResource: 'oauthServer.resource',
|
|
33
|
-
oauthOrigin: 'oauthServer.origin',
|
|
34
|
-
oauthFixed: 'oauthServer.fixed',
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// The last name of a receiver, `auth` for `ctx.locals.auth`.
|
|
38
|
-
function receiverName(node: Node): string | undefined {
|
|
39
|
-
if (node.type === 'Identifier')
|
|
40
|
-
return node.name
|
|
41
|
-
|
|
42
|
-
return node.type === 'MemberExpression' && !node.computed && node.property.type === 'Identifier' ? node.property.name : undefined
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function isPlain(node: Node): node is Member & { property: NodeOfType<'Identifier'> } {
|
|
46
|
-
return node.type === 'MemberExpression' && !node.computed && node.property.type === 'Identifier'
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// kayjs-auth's methods that moved in 1.105: the verbs of a group (`organizations.members()` is `organizations.listMembers()`, `account.saveProfile()` is `account.updateProfile()`), `magicLink.signInWithCode` into `email`, and the ones on `auth` itself into the group they belong to (`auth.requireAdmin()` is `auth.admin.require()`, `auth.provedLately()` is `auth.proof.recent()`).
|
|
50
|
-
// Found on a call whose receiver is named `auth` (`ctx.locals.auth`, `locals.auth`), in the TypeScript files and `.kay` files of the project, as `kay check` reads no types; a template expression is not read. The old names work until 1.108.
|
|
51
|
-
export async function authMethods(root: string, options: CheckOptions): Promise<CheckDiagnostic[]> {
|
|
52
|
-
if (lintLevel('deprecated-auth-methods', options.lints) === 'allow')
|
|
53
|
-
return []
|
|
54
|
-
|
|
55
|
-
return scan(root, options, 'deprecated-auth-methods', NEEDLE, ({ parsed, report }) => {
|
|
56
|
-
for (const { ast, base } of parsed) {
|
|
57
|
-
walk(ast, (node) => {
|
|
58
|
-
if (node.type !== 'CallExpression' || !isPlain(node.callee))
|
|
59
|
-
return
|
|
60
|
-
|
|
61
|
-
const callee = node.callee
|
|
62
|
-
const name = callee.property.name
|
|
63
|
-
const object = callee.object
|
|
64
|
-
let from = callee.property.start
|
|
65
|
-
let to: string | undefined
|
|
66
|
-
|
|
67
|
-
if (isPlain(object) && Object.hasOwn(GROUPED, object.property.name) && Object.hasOwn(GROUPED[object.property.name]!, name) && AUTH_NAME.test(receiverName(object.object) ?? '')) {
|
|
68
|
-
to = GROUPED[object.property.name]![name]!
|
|
69
|
-
|
|
70
|
-
// Into another group, the call is written again from the group's name.
|
|
71
|
-
if (to.includes('.'))
|
|
72
|
-
from = object.property.start
|
|
73
|
-
}
|
|
74
|
-
else if (Object.hasOwn(FLAT, name) && AUTH_NAME.test(receiverName(object) ?? '')) {
|
|
75
|
-
to = FLAT[name]
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (to === undefined)
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
report(base + callee.property.start, base + callee.property.end, `\`${name}\` of kayjs-auth is \`${to}\` since 1.105`, `write \`${to}\``, [{ start: base + from, end: base + callee.property.end, text: to }])
|
|
82
|
-
})
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
}
|