@kayjs/kay 1.108.0 → 1.110.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (595) hide show
  1. package/dist/eslint.js +2093 -3774
  2. package/editors/zed/extension.toml +2 -2
  3. package/llms/action-protection.md +1 -1
  4. package/llms/actions-from-islands.md +5 -5
  5. package/llms/actions-refused-fields.md +4 -4
  6. package/llms/api-from-islands.md +6 -6
  7. package/llms/browser-only.md +2 -2
  8. package/llms/cdn-caching.md +1 -1
  9. package/llms/checks.md +1 -1
  10. package/llms/code-lints.md +1 -2
  11. package/llms/component-library-conventions.md +1 -1
  12. package/llms/components.md +5 -5
  13. package/llms/deprecated-lints.md +2 -7
  14. package/llms/effects.md +1 -1
  15. package/llms/errors.md +2 -2
  16. package/llms/events.md +1 -1
  17. package/llms/guards.md +1 -1
  18. package/llms/head.md +1 -1
  19. package/llms/hooks.md +2 -2
  20. package/llms/images.md +1 -1
  21. package/llms/island-and-form-lints.md +4 -2
  22. package/llms/island-sources.md +1 -1
  23. package/llms/islands-state-to-ids.md +2 -2
  24. package/llms/islands.md +8 -4
  25. package/llms/lints.md +1 -1
  26. package/llms/live-values.md +4 -4
  27. package/llms/local-collections.md +1 -1
  28. package/llms/locales.md +1 -1
  29. package/llms/mcp.md +2 -2
  30. package/llms/metrics.md +1 -1
  31. package/llms/navigation-from-code.md +7 -7
  32. package/llms/navigation.md +4 -2
  33. package/llms/prerendering.md +1 -0
  34. package/llms/production.md +2 -2
  35. package/llms/project-new-and-add.md +1 -1
  36. package/llms/project.md +4 -4
  37. package/llms/proxy-and-security.md +1 -1
  38. package/llms/queues.md +1 -1
  39. package/llms/rate-limits.md +4 -4
  40. package/llms/rendering.md +1 -1
  41. package/llms/server-islands.md +2 -2
  42. package/llms/server.md +1 -1
  43. package/llms/stores.md +1 -1
  44. package/llms/styles-and-assets.md +1 -1
  45. package/llms/templates-elements-slots-snippets.md +2 -2
  46. package/llms/testing-mount.md +49 -0
  47. package/llms/testing.md +4 -45
  48. package/llms/upgrading-1-105-config.md +13 -13
  49. package/llms/upgrading-archive.md +64 -74
  50. package/llms/upgrading.md +92 -70
  51. package/llms/whats-new.md +24 -0
  52. package/llms.txt +5 -6
  53. package/package.json +6 -10
  54. package/src/build/route-sizes.ts +2 -3
  55. package/src/build/variants.ts +132 -18
  56. package/src/check/browser-global-reads.ts +2 -2
  57. package/src/check/config-objects.ts +1 -1
  58. package/src/check/diagnose.ts +0 -22
  59. package/src/check/env-types.ts +1 -1
  60. package/src/check/export-homes.ts +1 -1
  61. package/src/check/guards.ts +3 -3
  62. package/src/check/index.ts +2 -7
  63. package/src/check/moved-keys.ts +1 -1
  64. package/src/check/project.ts +6 -7
  65. package/src/check/schema-builders.ts +125 -26
  66. package/src/check/shadow-types.ts +0 -86
  67. package/src/commands/check.ts +2 -2
  68. package/src/commands/env.ts +25 -3
  69. package/src/commands/upgrade.ts +2 -1
  70. package/src/compiler/allow-comments.ts +38 -2
  71. package/src/compiler/ast.ts +21 -19
  72. package/src/compiler/browser.ts +2 -14
  73. package/src/compiler/class-items.ts +16 -0
  74. package/src/compiler/codegen.ts +10 -10
  75. package/src/compiler/deprecated-library.ts +0 -12
  76. package/src/compiler/deprecated-lints-1-106.ts +2 -2
  77. package/src/compiler/deprecated-lints.ts +3 -495
  78. package/src/compiler/deprecated-ui-props.ts +5 -5
  79. package/src/compiler/errors.ts +2 -2
  80. package/src/compiler/fence-checks.ts +2 -121
  81. package/src/compiler/hand-parts.ts +83 -0
  82. package/src/compiler/helper-imports.ts +2 -2
  83. package/src/compiler/image-attributes.ts +1 -3
  84. package/src/compiler/index.ts +23 -23
  85. package/src/compiler/island-arguments.ts +17 -95
  86. package/src/compiler/island-cause.ts +7 -7
  87. package/src/compiler/island-declaration.ts +2 -8
  88. package/src/compiler/island-lints.ts +19 -0
  89. package/src/compiler/island-marker.ts +3 -3
  90. package/src/compiler/island-problems.ts +25 -0
  91. package/src/compiler/items.ts +12 -0
  92. package/src/compiler/jsx-class.ts +1 -25
  93. package/src/compiler/jsx.ts +7 -6
  94. package/src/compiler/kay-exports.ts +0 -2
  95. package/src/compiler/link-flags.ts +9 -38
  96. package/src/compiler/lints.ts +10 -18
  97. package/src/compiler/markup.ts +33 -41
  98. package/src/compiler/module-signals.ts +2 -2
  99. package/src/compiler/names.ts +1 -1
  100. package/src/compiler/page-settings.ts +11 -0
  101. package/src/compiler/parser.ts +6 -8
  102. package/src/compiler/plan.ts +1 -3
  103. package/src/compiler/removed-lints.ts +90 -0
  104. package/src/compiler/rewrite.ts +3 -18
  105. package/src/compiler/script-server.ts +8 -3
  106. package/src/compiler/signal-from-prop.ts +141 -0
  107. package/src/compiler/template-reads.ts +16 -0
  108. package/src/compiler/validate.ts +3 -8
  109. package/src/config-loader.ts +14 -4
  110. package/src/config-resolve.ts +18 -142
  111. package/src/config-shape.ts +44 -34
  112. package/src/config.ts +10 -114
  113. package/src/dev/preload.ts +4 -1
  114. package/src/lsp/server.ts +4 -0
  115. package/src/migrate/markup.ts +4 -1
  116. package/src/runtime/action-call.ts +0 -8
  117. package/src/runtime/action-encode.ts +26 -0
  118. package/src/runtime/action-error.ts +3 -11
  119. package/src/runtime/action-protection.ts +2 -2
  120. package/src/runtime/action-run.ts +2 -27
  121. package/src/runtime/action-shared.ts +14 -37
  122. package/src/runtime/action-stream.ts +0 -1
  123. package/src/runtime/action.ts +1 -1
  124. package/src/runtime/call-result.ts +2 -10
  125. package/src/runtime/checks.ts +25 -13
  126. package/src/runtime/client.ts +7 -11
  127. package/src/runtime/core.ts +5 -23
  128. package/src/runtime/dom.ts +1 -1
  129. package/src/runtime/html.ts +1 -1
  130. package/src/runtime/i18n.client.ts +1 -4
  131. package/src/runtime/i18n.server.ts +1 -4
  132. package/src/runtime/i18n.ts +3 -3
  133. package/src/runtime/image.ts +2 -19
  134. package/src/runtime/index.ts +3 -3
  135. package/src/runtime/island.server.ts +56 -13
  136. package/src/runtime/live-resource.server.ts +0 -1
  137. package/src/runtime/live-value.server.ts +2 -2
  138. package/src/runtime/live-value.shared.ts +7 -20
  139. package/src/runtime/live.ts +1 -12
  140. package/src/runtime/local-types.ts +1 -11
  141. package/src/runtime/local.ts +4 -14
  142. package/src/runtime/navigate-api.ts +2 -5
  143. package/src/runtime/navigate.ts +9 -0
  144. package/src/runtime/navigation-state.ts +0 -12
  145. package/src/runtime/navigation.ts +5 -1
  146. package/src/runtime/page-swap.ts +8 -8
  147. package/src/runtime/persist.ts +11 -3
  148. package/src/runtime/persisted.ts +4 -30
  149. package/src/runtime/presence.ts +6 -7
  150. package/src/runtime/query-param.ts +20 -12
  151. package/src/runtime/reactive.ts +3 -1
  152. package/src/runtime/refuse.ts +3 -17
  153. package/src/runtime/store-base.ts +4 -6
  154. package/src/runtime/swap-fetch.ts +1 -1
  155. package/src/runtime/swap-flight.ts +10 -10
  156. package/src/runtime/swap-kept.ts +69 -29
  157. package/src/runtime/swap-morph.ts +49 -9
  158. package/src/runtime/text-hash.ts +17 -0
  159. package/src/runtime/uid.server.ts +6 -4
  160. package/src/runtime/values.ts +52 -23
  161. package/src/runtime/with-query.ts +9 -0
  162. package/src/server/action-hooks.ts +8 -8
  163. package/src/server/actions.ts +13 -14
  164. package/src/server/api-modules.ts +2 -3
  165. package/src/server/app-stages.ts +15 -33
  166. package/src/server/app.ts +10 -5
  167. package/src/server/auth-mails.ts +0 -2
  168. package/src/server/env-state.ts +40 -10
  169. package/src/server/flash.ts +1 -1
  170. package/src/server/guard-requirement.ts +4 -4
  171. package/src/server/image.ts +2 -2
  172. package/src/server/index.ts +0 -2
  173. package/src/server/job-context.ts +3 -3
  174. package/src/server/jobs-page.ts +1 -1
  175. package/src/server/jobs.ts +5 -9
  176. package/src/server/kept-exports.ts +0 -2
  177. package/src/server/kv.ts +11 -14
  178. package/src/server/library.ts +1 -3
  179. package/src/server/live.ts +2 -2
  180. package/src/server/mcp.ts +3 -9
  181. package/src/server/metrics.ts +2 -4
  182. package/src/server/page-settings.ts +10 -19
  183. package/src/server/prerender.ts +19 -2
  184. package/src/server/protection.ts +15 -18
  185. package/src/server/queue.ts +3 -6
  186. package/src/server/rate-limit.ts +0 -3
  187. package/src/server/render-document.ts +9 -7
  188. package/src/server/render.ts +1 -1
  189. package/src/server/routes.ts +7 -3
  190. package/src/server/scope.ts +3 -2
  191. package/src/server/session.ts +5 -6
  192. package/src/server/setup.ts +1 -1
  193. package/src/server/signals.ts +17 -7
  194. package/src/server/signed.ts +1 -3
  195. package/src/server/source.ts +20 -4
  196. package/src/server/speculation.ts +1 -1
  197. package/src/server/storage.ts +3 -8
  198. package/src/server/validate.ts +1 -1
  199. package/src/server/vitals.ts +1 -3
  200. package/src/server/work-scope.ts +2 -4
  201. package/src/server/work.ts +1 -1
  202. package/src/server/workflow.ts +1 -1
  203. package/src/test/index.ts +2 -1
  204. package/src/test/site-actions.ts +16 -6
  205. package/src/test/site-keys.ts +10 -15
  206. package/src/test/site-socket.ts +1 -2
  207. package/src/test/site-types.ts +0 -8
  208. package/types/build/route-sizes.d.ts.map +1 -1
  209. package/types/build/variants.d.ts +9 -1
  210. package/types/build/variants.d.ts.map +1 -1
  211. package/types/check/diagnose.d.ts.map +1 -1
  212. package/types/check/index.d.ts +1 -2
  213. package/types/check/index.d.ts.map +1 -1
  214. package/types/check/project.d.ts.map +1 -1
  215. package/types/check/schema-builders.d.ts.map +1 -1
  216. package/types/check/shadow-types.d.ts.map +1 -1
  217. package/types/commands/env.d.ts.map +1 -1
  218. package/types/commands/upgrade.d.ts.map +1 -1
  219. package/types/compiler/allow-comments.d.ts +2 -0
  220. package/types/compiler/allow-comments.d.ts.map +1 -1
  221. package/types/compiler/ast.d.ts +1 -2
  222. package/types/compiler/ast.d.ts.map +1 -1
  223. package/types/compiler/browser.d.ts.map +1 -1
  224. package/types/compiler/class-items.d.ts +7 -0
  225. package/types/compiler/class-items.d.ts.map +1 -0
  226. package/types/compiler/deprecated-library.d.ts.map +1 -1
  227. package/types/compiler/deprecated-lints-1-106.d.ts +2 -2
  228. package/types/compiler/deprecated-lints-1-106.d.ts.map +1 -1
  229. package/types/compiler/deprecated-lints.d.ts +2 -553
  230. package/types/compiler/deprecated-lints.d.ts.map +1 -1
  231. package/types/compiler/deprecated-ui-props.d.ts +1 -8
  232. package/types/compiler/deprecated-ui-props.d.ts.map +1 -1
  233. package/types/compiler/errors.d.ts +2 -2
  234. package/types/compiler/errors.d.ts.map +1 -1
  235. package/types/compiler/fence-checks.d.ts +0 -1
  236. package/types/compiler/fence-checks.d.ts.map +1 -1
  237. package/types/compiler/hand-parts.d.ts +10 -0
  238. package/types/compiler/hand-parts.d.ts.map +1 -0
  239. package/types/compiler/image-attributes.d.ts +0 -1
  240. package/types/compiler/image-attributes.d.ts.map +1 -1
  241. package/types/compiler/index.d.ts.map +1 -1
  242. package/types/compiler/island-arguments.d.ts +7 -11
  243. package/types/compiler/island-arguments.d.ts.map +1 -1
  244. package/types/compiler/island-cause.d.ts +1 -1
  245. package/types/compiler/island-cause.d.ts.map +1 -1
  246. package/types/compiler/island-declaration.d.ts +1 -3
  247. package/types/compiler/island-declaration.d.ts.map +1 -1
  248. package/types/compiler/island-lints.d.ts +17 -0
  249. package/types/compiler/island-lints.d.ts.map +1 -0
  250. package/types/compiler/island-problems.d.ts +7 -0
  251. package/types/compiler/island-problems.d.ts.map +1 -0
  252. package/types/compiler/items.d.ts +1 -0
  253. package/types/compiler/items.d.ts.map +1 -1
  254. package/types/compiler/jsx-class.d.ts +1 -2
  255. package/types/compiler/jsx-class.d.ts.map +1 -1
  256. package/types/compiler/jsx.d.ts.map +1 -1
  257. package/types/compiler/kay-exports.d.ts.map +1 -1
  258. package/types/compiler/link-flags.d.ts +0 -6
  259. package/types/compiler/link-flags.d.ts.map +1 -1
  260. package/types/compiler/lints.d.ts +21 -566
  261. package/types/compiler/lints.d.ts.map +1 -1
  262. package/types/compiler/markup.d.ts +1 -1
  263. package/types/compiler/markup.d.ts.map +1 -1
  264. package/types/compiler/module-signals.d.ts.map +1 -1
  265. package/types/compiler/names.d.ts.map +1 -1
  266. package/types/compiler/page-settings.d.ts +4 -0
  267. package/types/compiler/page-settings.d.ts.map +1 -1
  268. package/types/compiler/parser.d.ts.map +1 -1
  269. package/types/compiler/plan.d.ts.map +1 -1
  270. package/types/compiler/removed-lints.d.ts +3 -0
  271. package/types/compiler/removed-lints.d.ts.map +1 -0
  272. package/types/compiler/script-server.d.ts.map +1 -1
  273. package/types/compiler/signal-from-prop.d.ts +4 -0
  274. package/types/compiler/signal-from-prop.d.ts.map +1 -0
  275. package/types/compiler/template-reads.d.ts +1 -0
  276. package/types/compiler/template-reads.d.ts.map +1 -1
  277. package/types/compiler/validate.d.ts.map +1 -1
  278. package/types/config-loader.d.ts.map +1 -1
  279. package/types/config-resolve.d.ts.map +1 -1
  280. package/types/config-shape.d.ts +1 -1
  281. package/types/config-shape.d.ts.map +1 -1
  282. package/types/config.d.ts +5 -105
  283. package/types/config.d.ts.map +1 -1
  284. package/types/dev/preload.d.ts.map +1 -1
  285. package/types/lsp/server.d.ts.map +1 -1
  286. package/types/migrate/markup.d.ts.map +1 -1
  287. package/types/runtime/action-call.d.ts.map +1 -1
  288. package/types/runtime/action-encode.d.ts +1 -0
  289. package/types/runtime/action-encode.d.ts.map +1 -1
  290. package/types/runtime/action-error.d.ts +1 -2
  291. package/types/runtime/action-error.d.ts.map +1 -1
  292. package/types/runtime/action-run.d.ts.map +1 -1
  293. package/types/runtime/action-shared.d.ts +1 -27
  294. package/types/runtime/action-shared.d.ts.map +1 -1
  295. package/types/runtime/action-stream.d.ts.map +1 -1
  296. package/types/runtime/action.d.ts +1 -1
  297. package/types/runtime/action.d.ts.map +1 -1
  298. package/types/runtime/call-result.d.ts +0 -10
  299. package/types/runtime/call-result.d.ts.map +1 -1
  300. package/types/runtime/checks.d.ts +14 -11
  301. package/types/runtime/checks.d.ts.map +1 -1
  302. package/types/runtime/client.d.ts.map +1 -1
  303. package/types/runtime/core.d.ts +2 -20
  304. package/types/runtime/core.d.ts.map +1 -1
  305. package/types/runtime/dom.d.ts +1 -1
  306. package/types/runtime/dom.d.ts.map +1 -1
  307. package/types/runtime/html.d.ts +1 -1
  308. package/types/runtime/html.d.ts.map +1 -1
  309. package/types/runtime/i18n.client.d.ts +0 -1
  310. package/types/runtime/i18n.client.d.ts.map +1 -1
  311. package/types/runtime/i18n.d.ts +1 -1
  312. package/types/runtime/i18n.d.ts.map +1 -1
  313. package/types/runtime/i18n.server.d.ts +0 -1
  314. package/types/runtime/i18n.server.d.ts.map +1 -1
  315. package/types/runtime/image.d.ts.map +1 -1
  316. package/types/runtime/index.d.ts +3 -3
  317. package/types/runtime/index.d.ts.map +1 -1
  318. package/types/runtime/island.server.d.ts +2 -0
  319. package/types/runtime/island.server.d.ts.map +1 -1
  320. package/types/runtime/live-resource.server.d.ts.map +1 -1
  321. package/types/runtime/live-value.shared.d.ts +7 -15
  322. package/types/runtime/live-value.shared.d.ts.map +1 -1
  323. package/types/runtime/live.d.ts +0 -11
  324. package/types/runtime/live.d.ts.map +1 -1
  325. package/types/runtime/local-types.d.ts +0 -14
  326. package/types/runtime/local-types.d.ts.map +1 -1
  327. package/types/runtime/navigate-api.d.ts +0 -4
  328. package/types/runtime/navigate-api.d.ts.map +1 -1
  329. package/types/runtime/navigate.d.ts.map +1 -1
  330. package/types/runtime/navigation-state.d.ts +0 -4
  331. package/types/runtime/navigation-state.d.ts.map +1 -1
  332. package/types/runtime/navigation.d.ts +2 -0
  333. package/types/runtime/navigation.d.ts.map +1 -1
  334. package/types/runtime/page-swap.d.ts.map +1 -1
  335. package/types/runtime/persist.d.ts +1 -0
  336. package/types/runtime/persist.d.ts.map +1 -1
  337. package/types/runtime/persisted.d.ts +0 -15
  338. package/types/runtime/persisted.d.ts.map +1 -1
  339. package/types/runtime/presence.d.ts +0 -2
  340. package/types/runtime/presence.d.ts.map +1 -1
  341. package/types/runtime/query-param.d.ts.map +1 -1
  342. package/types/runtime/reactive.d.ts +2 -1
  343. package/types/runtime/reactive.d.ts.map +1 -1
  344. package/types/runtime/refuse.d.ts +0 -7
  345. package/types/runtime/refuse.d.ts.map +1 -1
  346. package/types/runtime/store-base.d.ts +1 -2
  347. package/types/runtime/store-base.d.ts.map +1 -1
  348. package/types/runtime/swap-flight.d.ts +1 -1
  349. package/types/runtime/swap-flight.d.ts.map +1 -1
  350. package/types/runtime/swap-kept.d.ts.map +1 -1
  351. package/types/runtime/swap-morph.d.ts.map +1 -1
  352. package/types/runtime/text-hash.d.ts +2 -0
  353. package/types/runtime/text-hash.d.ts.map +1 -0
  354. package/types/runtime/uid.server.d.ts.map +1 -1
  355. package/types/runtime/values.d.ts +6 -1
  356. package/types/runtime/values.d.ts.map +1 -1
  357. package/types/runtime/with-query.d.ts +2 -0
  358. package/types/runtime/with-query.d.ts.map +1 -1
  359. package/types/server/action-hooks.d.ts +4 -4
  360. package/types/server/action-hooks.d.ts.map +1 -1
  361. package/types/server/actions.d.ts.map +1 -1
  362. package/types/server/api-modules.d.ts +0 -1
  363. package/types/server/api-modules.d.ts.map +1 -1
  364. package/types/server/app-stages.d.ts +5 -13
  365. package/types/server/app-stages.d.ts.map +1 -1
  366. package/types/server/app.d.ts +3 -8
  367. package/types/server/app.d.ts.map +1 -1
  368. package/types/server/auth-mails.d.ts +0 -5
  369. package/types/server/auth-mails.d.ts.map +1 -1
  370. package/types/server/env-state.d.ts +1 -0
  371. package/types/server/env-state.d.ts.map +1 -1
  372. package/types/server/guard-requirement.d.ts +0 -1
  373. package/types/server/guard-requirement.d.ts.map +1 -1
  374. package/types/server/image.d.ts +0 -1
  375. package/types/server/image.d.ts.map +1 -1
  376. package/types/server/index.d.ts +0 -2
  377. package/types/server/index.d.ts.map +1 -1
  378. package/types/server/job-context.d.ts +1 -1
  379. package/types/server/job-context.d.ts.map +1 -1
  380. package/types/server/jobs.d.ts +0 -4
  381. package/types/server/jobs.d.ts.map +1 -1
  382. package/types/server/kept-exports.d.ts.map +1 -1
  383. package/types/server/kv.d.ts +4 -4
  384. package/types/server/kv.d.ts.map +1 -1
  385. package/types/server/library.d.ts +1 -3
  386. package/types/server/library.d.ts.map +1 -1
  387. package/types/server/mcp.d.ts +0 -1
  388. package/types/server/mcp.d.ts.map +1 -1
  389. package/types/server/metrics.d.ts +0 -5
  390. package/types/server/metrics.d.ts.map +1 -1
  391. package/types/server/page-settings.d.ts +3 -3
  392. package/types/server/page-settings.d.ts.map +1 -1
  393. package/types/server/prerender.d.ts.map +1 -1
  394. package/types/server/protection.d.ts +6 -6
  395. package/types/server/protection.d.ts.map +1 -1
  396. package/types/server/queue.d.ts +1 -3
  397. package/types/server/queue.d.ts.map +1 -1
  398. package/types/server/rate-limit.d.ts +0 -2
  399. package/types/server/rate-limit.d.ts.map +1 -1
  400. package/types/server/render-document.d.ts +1 -1
  401. package/types/server/render-document.d.ts.map +1 -1
  402. package/types/server/routes.d.ts +1 -1
  403. package/types/server/routes.d.ts.map +1 -1
  404. package/types/server/scope.d.ts.map +1 -1
  405. package/types/server/session.d.ts +1 -1
  406. package/types/server/session.d.ts.map +1 -1
  407. package/types/server/signals.d.ts.map +1 -1
  408. package/types/server/signed.d.ts +0 -2
  409. package/types/server/signed.d.ts.map +1 -1
  410. package/types/server/source.d.ts +1 -1
  411. package/types/server/source.d.ts.map +1 -1
  412. package/types/server/storage.d.ts +0 -4
  413. package/types/server/storage.d.ts.map +1 -1
  414. package/types/server/vitals.d.ts +0 -1
  415. package/types/server/vitals.d.ts.map +1 -1
  416. package/types/server/work-scope.d.ts +0 -2
  417. package/types/server/work-scope.d.ts.map +1 -1
  418. package/types/server/workflow.d.ts +1 -1
  419. package/types/server/workflow.d.ts.map +1 -1
  420. package/types/test/index.d.ts.map +1 -1
  421. package/types/test/site-actions.d.ts +1 -1
  422. package/types/test/site-actions.d.ts.map +1 -1
  423. package/types/test/site-keys.d.ts +1 -1
  424. package/types/test/site-keys.d.ts.map +1 -1
  425. package/types/test/site-socket.d.ts +1 -1
  426. package/types/test/site-socket.d.ts.map +1 -1
  427. package/types/test/site-types.d.ts +0 -8
  428. package/types/test/site-types.d.ts.map +1 -1
  429. package/llms/deprecated-lints-1-105-libraries.md +0 -32
  430. package/llms/deprecated-lints-1-105.md +0 -58
  431. package/src/check/action-readers.ts +0 -115
  432. package/src/check/action-type.ts +0 -44
  433. package/src/check/ai-language.ts +0 -56
  434. package/src/check/app-hooks.ts +0 -90
  435. package/src/check/auth-methods.ts +0 -85
  436. package/src/check/auth-rate-limits.ts +0 -99
  437. package/src/check/call-result.ts +0 -242
  438. package/src/check/client-keys.ts +0 -10
  439. package/src/check/cms-options.ts +0 -81
  440. package/src/check/config-groups.ts +0 -22
  441. package/src/check/config-switches.ts +0 -38
  442. package/src/check/context-import.ts +0 -51
  443. package/src/check/env-files.ts +0 -31
  444. package/src/check/format-duration.ts +0 -75
  445. package/src/check/guard-options.ts +0 -58
  446. package/src/check/handler-events.ts +0 -149
  447. package/src/check/hook-context.ts +0 -94
  448. package/src/check/hook-names.ts +0 -104
  449. package/src/check/i18n-keys.ts +0 -50
  450. package/src/check/images-keys.ts +0 -54
  451. package/src/check/job-shapes.ts +0 -273
  452. package/src/check/link-flag-tests.ts +0 -130
  453. package/src/check/live-api.ts +0 -137
  454. package/src/check/mail-api.ts +0 -67
  455. package/src/check/one-state-api.ts +0 -357
  456. package/src/check/pages-options.ts +0 -35
  457. package/src/check/rate-enforce.ts +0 -53
  458. package/src/check/refusal-calls.ts +0 -185
  459. package/src/check/retired-lints.ts +0 -49
  460. package/src/check/route-keys.ts +0 -166
  461. package/src/check/secret-keys.ts +0 -83
  462. package/src/check/socket-frames.ts +0 -102
  463. package/src/check/source-readers.ts +0 -257
  464. package/src/check/store-ms.ts +0 -72
  465. package/src/check/store-names.ts +0 -88
  466. package/src/check/test-helpers.ts +0 -98
  467. package/src/check/ttl-names.ts +0 -142
  468. package/src/compiler/deprecated-ai-labels.ts +0 -97
  469. package/src/compiler/deprecated-ai-links.ts +0 -63
  470. package/src/compiler/deprecated-allow.ts +0 -50
  471. package/src/compiler/deprecated-auth-lints.ts +0 -14
  472. package/src/compiler/deprecated-auth-signed.ts +0 -29
  473. package/src/compiler/deprecated-children.ts +0 -66
  474. package/src/compiler/deprecated-image.ts +0 -116
  475. package/src/compiler/deprecated-island.ts +0 -155
  476. package/src/compiler/deprecated-lints-1-105.ts +0 -41
  477. package/src/compiler/deprecated-page.ts +0 -125
  478. package/src/compiler/deprecated-parts.ts +0 -22
  479. package/src/compiler/deprecated-typed-lints.ts +0 -23
  480. package/src/compiler/deprecated-ui-callbacks.ts +0 -66
  481. package/src/compiler/deprecated-ui-input.ts +0 -97
  482. package/src/compiler/deprecated-ui-items.ts +0 -47
  483. package/src/compiler/old-parts.ts +0 -84
  484. package/src/runtime/mount.compat.ts +0 -8
  485. package/src/server/moved-exports.ts +0 -17
  486. package/types/check/action-readers.d.ts +0 -3
  487. package/types/check/action-readers.d.ts.map +0 -1
  488. package/types/check/action-type.d.ts +0 -3
  489. package/types/check/action-type.d.ts.map +0 -1
  490. package/types/check/ai-language.d.ts +0 -3
  491. package/types/check/ai-language.d.ts.map +0 -1
  492. package/types/check/app-hooks.d.ts +0 -3
  493. package/types/check/app-hooks.d.ts.map +0 -1
  494. package/types/check/auth-methods.d.ts +0 -3
  495. package/types/check/auth-methods.d.ts.map +0 -1
  496. package/types/check/auth-rate-limits.d.ts +0 -3
  497. package/types/check/auth-rate-limits.d.ts.map +0 -1
  498. package/types/check/call-result.d.ts +0 -7
  499. package/types/check/call-result.d.ts.map +0 -1
  500. package/types/check/client-keys.d.ts +0 -3
  501. package/types/check/client-keys.d.ts.map +0 -1
  502. package/types/check/cms-options.d.ts +0 -3
  503. package/types/check/cms-options.d.ts.map +0 -1
  504. package/types/check/config-groups.d.ts +0 -3
  505. package/types/check/config-groups.d.ts.map +0 -1
  506. package/types/check/config-switches.d.ts +0 -3
  507. package/types/check/config-switches.d.ts.map +0 -1
  508. package/types/check/context-import.d.ts +0 -3
  509. package/types/check/context-import.d.ts.map +0 -1
  510. package/types/check/env-files.d.ts +0 -3
  511. package/types/check/env-files.d.ts.map +0 -1
  512. package/types/check/format-duration.d.ts +0 -5
  513. package/types/check/format-duration.d.ts.map +0 -1
  514. package/types/check/guard-options.d.ts +0 -3
  515. package/types/check/guard-options.d.ts.map +0 -1
  516. package/types/check/handler-events.d.ts +0 -9
  517. package/types/check/handler-events.d.ts.map +0 -1
  518. package/types/check/hook-context.d.ts +0 -3
  519. package/types/check/hook-context.d.ts.map +0 -1
  520. package/types/check/hook-names.d.ts +0 -3
  521. package/types/check/hook-names.d.ts.map +0 -1
  522. package/types/check/i18n-keys.d.ts +0 -3
  523. package/types/check/i18n-keys.d.ts.map +0 -1
  524. package/types/check/images-keys.d.ts +0 -3
  525. package/types/check/images-keys.d.ts.map +0 -1
  526. package/types/check/job-shapes.d.ts +0 -6
  527. package/types/check/job-shapes.d.ts.map +0 -1
  528. package/types/check/link-flag-tests.d.ts +0 -4
  529. package/types/check/link-flag-tests.d.ts.map +0 -1
  530. package/types/check/live-api.d.ts +0 -3
  531. package/types/check/live-api.d.ts.map +0 -1
  532. package/types/check/mail-api.d.ts +0 -3
  533. package/types/check/mail-api.d.ts.map +0 -1
  534. package/types/check/one-state-api.d.ts +0 -9
  535. package/types/check/one-state-api.d.ts.map +0 -1
  536. package/types/check/pages-options.d.ts +0 -3
  537. package/types/check/pages-options.d.ts.map +0 -1
  538. package/types/check/rate-enforce.d.ts +0 -3
  539. package/types/check/rate-enforce.d.ts.map +0 -1
  540. package/types/check/refusal-calls.d.ts +0 -3
  541. package/types/check/refusal-calls.d.ts.map +0 -1
  542. package/types/check/retired-lints.d.ts +0 -3
  543. package/types/check/retired-lints.d.ts.map +0 -1
  544. package/types/check/route-keys.d.ts +0 -3
  545. package/types/check/route-keys.d.ts.map +0 -1
  546. package/types/check/secret-keys.d.ts +0 -3
  547. package/types/check/secret-keys.d.ts.map +0 -1
  548. package/types/check/socket-frames.d.ts +0 -3
  549. package/types/check/socket-frames.d.ts.map +0 -1
  550. package/types/check/source-readers.d.ts +0 -3
  551. package/types/check/source-readers.d.ts.map +0 -1
  552. package/types/check/store-ms.d.ts +0 -3
  553. package/types/check/store-ms.d.ts.map +0 -1
  554. package/types/check/store-names.d.ts +0 -3
  555. package/types/check/store-names.d.ts.map +0 -1
  556. package/types/check/test-helpers.d.ts +0 -3
  557. package/types/check/test-helpers.d.ts.map +0 -1
  558. package/types/check/ttl-names.d.ts +0 -3
  559. package/types/check/ttl-names.d.ts.map +0 -1
  560. package/types/compiler/deprecated-ai-labels.d.ts +0 -5
  561. package/types/compiler/deprecated-ai-labels.d.ts.map +0 -1
  562. package/types/compiler/deprecated-ai-links.d.ts +0 -5
  563. package/types/compiler/deprecated-ai-links.d.ts.map +0 -1
  564. package/types/compiler/deprecated-allow.d.ts +0 -5
  565. package/types/compiler/deprecated-allow.d.ts.map +0 -1
  566. package/types/compiler/deprecated-auth-lints.d.ts +0 -12
  567. package/types/compiler/deprecated-auth-lints.d.ts.map +0 -1
  568. package/types/compiler/deprecated-auth-signed.d.ts +0 -5
  569. package/types/compiler/deprecated-auth-signed.d.ts.map +0 -1
  570. package/types/compiler/deprecated-children.d.ts +0 -4
  571. package/types/compiler/deprecated-children.d.ts.map +0 -1
  572. package/types/compiler/deprecated-image.d.ts +0 -5
  573. package/types/compiler/deprecated-image.d.ts.map +0 -1
  574. package/types/compiler/deprecated-island.d.ts +0 -9
  575. package/types/compiler/deprecated-island.d.ts.map +0 -1
  576. package/types/compiler/deprecated-lints-1-105.d.ts +0 -39
  577. package/types/compiler/deprecated-lints-1-105.d.ts.map +0 -1
  578. package/types/compiler/deprecated-page.d.ts +0 -4
  579. package/types/compiler/deprecated-page.d.ts.map +0 -1
  580. package/types/compiler/deprecated-parts.d.ts +0 -3
  581. package/types/compiler/deprecated-parts.d.ts.map +0 -1
  582. package/types/compiler/deprecated-typed-lints.d.ts +0 -21
  583. package/types/compiler/deprecated-typed-lints.d.ts.map +0 -1
  584. package/types/compiler/deprecated-ui-callbacks.d.ts +0 -5
  585. package/types/compiler/deprecated-ui-callbacks.d.ts.map +0 -1
  586. package/types/compiler/deprecated-ui-input.d.ts +0 -5
  587. package/types/compiler/deprecated-ui-input.d.ts.map +0 -1
  588. package/types/compiler/deprecated-ui-items.d.ts +0 -5
  589. package/types/compiler/deprecated-ui-items.d.ts.map +0 -1
  590. package/types/compiler/old-parts.d.ts +0 -9
  591. package/types/compiler/old-parts.d.ts.map +0 -1
  592. package/types/runtime/mount.compat.d.ts +0 -7
  593. package/types/runtime/mount.compat.d.ts.map +0 -1
  594. package/types/server/moved-exports.d.ts +0 -12
  595. package/types/server/moved-exports.d.ts.map +0 -1
@@ -164,16 +164,10 @@ export function declaredIsland(source: string, script: Span): IslandDeclaration
164
164
  }
165
165
  }
166
166
 
167
- // The role the fence line (`--- client`, `--- island`, `--- static`) or else the `island()` call gives the component, which `client` and `pin` of the parsed file carry whichever wrote it.
168
- export function rolesOf(source: string, script: Span | undefined, fence: Span & { word: string } | undefined): { island: IslandDeclaration | undefined, client: Span | undefined, pin: (Span & { kind: 'island' | 'static' }) | undefined } {
167
+ // The role the `island()` call gives the component, which `client` and `pin` of the parsed file carry.
168
+ export function rolesOf(source: string, script: Span | undefined): { island: IslandDeclaration | undefined, client: Span | undefined, pin: (Span & { kind: 'island' | 'static' }) | undefined } {
169
169
  const island = script === undefined ? undefined : declaredIsland(source, script)
170
170
 
171
- if (fence?.word === 'client')
172
- return { island, client: fence, pin: undefined }
173
-
174
- if (fence?.word === 'island' || fence?.word === 'static')
175
- return { island, client: undefined, pin: { kind: fence.word, start: fence.start, end: fence.end } }
176
-
177
171
  if (island === undefined)
178
172
  return { island, client: undefined, pin: undefined }
179
173
 
@@ -0,0 +1,19 @@
1
+ import type { Lint } from './lints'
2
+
3
+ // The lints of the `islands` group that sit apart from the rest, with the other lints in `LINTS`.
4
+ export const ISLAND_LINTS = {
5
+ 'page-island': {
6
+ level: 'deny',
7
+ group: 'islands',
8
+ summary: 'A page without a `--- server` fence that needs the browser: 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. 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.',
9
+ wrong: '---\nimport { signal } from \'kay\'\n\nconst count = signal(0)\n---\nbutton(onClick={() => count.set(count() + 1)}) {count()}',
10
+ right: '---\nimport Counter from \'../components/counter.kay\'\n---\nCounter',
11
+ },
12
+ 'signal-from-prop': {
13
+ level: 'warn',
14
+ group: 'islands',
15
+ summary: 'A `signal` seeded from a destructured prop at the top of an island\'s script, `signal(light)` or `signal(todo.title)`, that the island never writes: an island stays when the page gives it new props, as after an action or a refresh, so the signal keeps the first value. `linked(() => light)` follows the prop; `kay check --fix` writes it. A signal the island writes, as a counter starting from a prop, is its own state and is left alone, as is a prop named `initial...` or `default...` or a comment `// kay-allow signal-from-prop`.',
16
+ wrong: '---\nimport { signal } from \'kay\'\n\nconst { light } = props<{ light: string }>()\nconst picked = signal(light)\n---\np {picked()}',
17
+ right: '---\nimport { linked } from \'kay\'\n\nconst { light } = props<{ light: string }>()\nconst picked = linked(() => light)\n---\np {picked()}',
18
+ },
19
+ } as const satisfies Record<string, Lint>
@@ -1,5 +1,5 @@
1
1
  import type { Diagnostic, Fix, KayFile } from './ast'
2
- import { eolOf, wordEdit } from './deprecated-island'
2
+ import { eolOf } from './island-problems'
3
3
 
4
4
  const STATIC_RENDER = /render\s*:\s*(['"])static\1\s*,?\s*/
5
5
  const EMPTY_SETTINGS = /\(\s*\{\s*\}\s*\)/
@@ -11,8 +11,8 @@ export function islandFence(file: KayFile): Fix | undefined {
11
11
  if (file.server !== undefined || file.client !== undefined || file.pin?.kind === 'island')
12
12
  return undefined
13
13
 
14
- if (file.pin !== undefined)
15
- return { title, edits: file.island === undefined ? [wordEdit(file.scriptLine ?? { start: file.pin.start - 4, end: file.pin.end }, file.pin.end, file.source.slice(0, file.scriptLine?.start ?? 0)), { start: file.script?.start ?? 0, end: file.script?.start ?? 0, text: `island()${eolOf(file.source)}` }] : [{ start: file.island.span.start, end: file.island.span.end, text: file.source.slice(file.island.span.start, file.island.span.end).replace(STATIC_RENDER, '').replace(EMPTY_SETTINGS, '()') }] }
14
+ if (file.pin !== undefined && file.island !== undefined)
15
+ return { title, edits: [{ start: file.island.span.start, end: file.island.span.end, text: file.source.slice(file.island.span.start, file.island.span.end).replace(STATIC_RENDER, '').replace(EMPTY_SETTINGS, '()') }] }
16
16
 
17
17
  if (file.scriptLine === undefined || file.script === undefined)
18
18
  return { title, edits: [{ start: 0, end: 0, text: ['---', 'island()', '---', ''].join(eolOf(file.source)) }] }
@@ -0,0 +1,25 @@
1
+ import type { Diagnostic, KayFile } from './ast'
2
+ import { declaredIsland } from './island-declaration'
3
+
4
+ const MEDIA_HYDRATE = /^media\(\s*\S.*\)$/s
5
+
6
+ // What is wrong with a static `hydrate` value on a use: `client` is `render="client"` since 1.105, and `media(...)` needs a query.
7
+ export function hydrateProblem(text: string): [message: string, details: { help: string }] | undefined {
8
+ if (text === 'client')
9
+ return ['`hydrate="client"` is `render="client"`', { help: 'write `render="client"` to render the component in the browser only' }]
10
+
11
+ if (text.startsWith('media(') && !MEDIA_HYDRATE.test(text))
12
+ return ['`hydrate="media(...)"` needs a media query', { help: 'write the query in the brackets: `hydrate="media(max-width: 40rem)"`' }]
13
+
14
+ return undefined
15
+ }
16
+
17
+ // The line ending a file writes, which what a fix inserts follows.
18
+ export const eolOf = (source: string): string => source.includes('\r\n') ? '\r\n' : '\n'
19
+
20
+ // An `island()` call in a `--- module` fence, which declares nothing there: the call belongs to the component's script.
21
+ export function islandProblems(file: KayFile): Diagnostic[] {
22
+ const declared = file.module === undefined ? undefined : declaredIsland(file.source, file.module)
23
+
24
+ return declared === undefined ? [] : [{ ...declared.span, code: 'fence-invalid', message: '`island()` goes in the component\'s script, not its `--- module` fence', help: 'move it to the top of the script fence' }]
25
+ }
@@ -248,3 +248,15 @@ export function fixedSource(element: ElementNode): string {
248
248
  export function ambientHelpers(facts: { ambientForm: boolean, snippet: boolean, forms: ReadonlyMap<unknown, unknown> }, mode: string): ('formHere' | 'formError' | 'issueScope')[] {
249
249
  return [...facts.ambientForm ? ['formHere' as const, 'formError' as const] : [], ...mode === 'dom' && facts.snippet && facts.forms.size > 0 ? ['issueScope' as const] : []]
250
250
  }
251
+
252
+ const BOUND = /^bind:/
253
+
254
+ // The props a use writes, as the object type `KayFunctionProp` takes after the component; none for a use with a spread, which may carry any.
255
+ export function usedProps(element: ElementNode, text: (span: Span) => string): string {
256
+ if (element.attributes.some(attribute => attribute.kind === 'spread'))
257
+ return ''
258
+
259
+ const names = [...element.attributes.flatMap(attribute => attribute.kind === 'spread' ? [] : [attribute.name]), ...element.children.flatMap(child => child.kind === 'slot' ? [child.name] : [])]
260
+
261
+ return `, { ${names.map(name => `${JSON.stringify(text(name).replace(BOUND, ''))}: 0`).join(', ')} }`
262
+ }
@@ -1,8 +1,7 @@
1
- import type { Attribute, ElementNode, NamedAttribute } from './ast'
1
+ import type { ElementNode, NamedAttribute } from './ast'
2
2
  import type { CodeBuilder } from './mapping'
3
3
  import type { ClassMerge } from './plan'
4
4
  import { helperName } from './markup'
5
- import { oldPartsClass } from './old-parts'
6
5
  import { shorthandClass } from './plan'
7
6
 
8
7
  // What wraps a merged class list: an array on an element, the class of `componentClass` on a component, or its spread when the merge can be empty.
@@ -83,26 +82,3 @@ export function addMergedClass(b: CodeBuilder, element: ElementNode, { attribute
83
82
 
84
83
  b.add(close)
85
84
  }
86
-
87
- // The `class` of a component call that is its `parts` before 1.105, written as the `parts` prop, left out when a `parts` is written beside it, which the type check reads alone. Whether the attribute is that `class`.
88
- export function addOldParts(b: CodeBuilder, element: ElementNode, src: string, attribute: Attribute): boolean {
89
- const old = oldPartsClass(element, src)
90
-
91
- if (old === undefined)
92
- return false
93
-
94
- const hand = element.attributes.find((one): one is Extract<NamedAttribute, { kind: 'expression' }> => one.kind === 'expression' && src.slice(one.name.start, one.name.end) === 'parts')
95
-
96
- if (attribute === old) {
97
- b.add(' ').wrap(old.name, () => b.add('parts')).add('={')
98
-
99
- if (hand === undefined)
100
- b.addSource(old.expression)
101
- else
102
- b.add('{ ...(').addSource(hand.expression).add('), ...(').addSource(old.expression).add(') }')
103
-
104
- b.add('}')
105
- }
106
-
107
- return attribute === old || attribute === hand
108
- }
@@ -4,8 +4,8 @@ import type { ElementShape } from './plan'
4
4
  import type { Sites } from './rewrite-types'
5
5
  import { bindsOwnProp, failedBlockOf, handedParts, isSlot, partAttribute, serverIslandOf } from './ast'
6
6
  import { isFunctionAt, sentParts } from './expression'
7
- import { addConstValue, addKeyParameters, addRowItem, contentOf, rowKeying, slotValue } from './items'
8
- import { addMergedClass, addOldParts, addShorthandClass, quoteAttribute } from './jsx-class'
7
+ import { addConstValue, addKeyParameters, addRowItem, contentOf, rowKeying, slotValue, usedProps } from './items'
8
+ import { addMergedClass, addShorthandClass, quoteAttribute } from './jsx-class'
9
9
  import { addFieldName, addInheritedName, addWrittenField } from './jsx-field'
10
10
  import { DYNAMIC_TAG } from './mapping'
11
11
  import { addBindWrite, bindRead, helperName, RAW_ELEMENTS } from './markup'
@@ -679,7 +679,7 @@ export class JsxTemplate {
679
679
  const part = partAttribute(element, this.src)
680
680
 
681
681
  for (const attribute of element.attributes) {
682
- if (addOldParts(b, element, this.src, attribute) || ((merge.shorthand || merge.last) && attribute === merge.attribute))
682
+ if ((merge.shorthand || merge.last) && attribute === merge.attribute)
683
683
  continue
684
684
 
685
685
  // Not a prop of the element or the component: it names a part, whose class the component's own `class` type takes.
@@ -879,7 +879,7 @@ export class JsxTemplate {
879
879
  let at = start
880
880
 
881
881
  if (sent.functions) {
882
- this.emitFunctionPropCheck(element, attribute.name)
882
+ this.emitFunctionPropCheck(element, attribute.name, false)
883
883
  b.add(' ')
884
884
  }
885
885
 
@@ -904,8 +904,9 @@ export class JsxTemplate {
904
904
  }
905
905
 
906
906
  // Reports a function passed to an island, `0` standing for the prop.
907
- private emitFunctionPropCheck(element: ElementNode, name: Span) {
908
- this.b.add('{...KayFunctionProp(').addSource(element.tag).add(')(').wrap(name, () => this.b.add('0')).add(')}')
907
+ // The props the use writes go along, as an object type, so an island that lists its interactive props takes a function from a use turning none of them on; a spread may carry any, so it sends none, and a function inside a literal value sends none either, as it is never sent.
908
+ private emitFunctionPropCheck(element: ElementNode, name: Span, whole = true) {
909
+ this.b.add('{...KayFunctionProp(').addSource(element.tag).add(whole ? usedProps(element, span => this.text(span)) : '').add(')(').wrap(name, () => this.b.add('0')).add(')}')
909
910
  }
910
911
 
911
912
  // `bind:value={name}` reads the signal and writes it back from the matching input event.
@@ -51,10 +51,8 @@ export const KAY_ROLES: Readonly<Record<string, KayRole>> = {
51
51
  mount: 'browser',
52
52
  navigate: 'browser',
53
53
  navigation: 'browser',
54
- onBeforeNavigate: 'browser',
55
54
  onCleanup: 'browser',
56
55
  onMount: 'browser',
57
- onNavigate: 'browser',
58
56
  online: 'browser',
59
57
  optimistic: 'browser',
60
58
  pageVisible: 'browser',
@@ -3,13 +3,6 @@ import type { Lint } from './lints'
3
3
  import { editDistance } from './aria'
4
4
  import { elementsIn } from './ast'
5
5
 
6
- export interface Renamed {
7
- name: string
8
- value: string
9
- // What a `false` value of the old name becomes, for a flag that was off by that word.
10
- off?: string
11
- }
12
-
13
6
  // The lint of this file, with the other lints in `LINTS`.
14
7
  export const LINK_LINTS = {
15
8
  'unknown-link-flag': {
@@ -24,13 +17,8 @@ export const LINK_LINTS = {
24
17
  // The attributes a link, or an element around links, takes to say how the swap follows it, named as the options of `navigate()` are: `scroll`, `transition`, `prefetch`, and `reload` for a full load.
25
18
  const FLAGS = new Set(['data-scroll', 'data-transition', 'data-prefetch', 'data-reload'])
26
19
 
27
- // The names before 1.105 and what each became: `data-keep-scroll` is `data-scroll="keep"`, `data-no-transition` is `data-transition="false"`, `data-no-prefetch` is `data-prefetch="false"`.
28
- export const OLD_LINK_FLAGS: Record<string, Renamed> = {
29
- 'data-keep-scroll': { name: 'data-scroll', value: 'keep', off: 'top' },
30
- 'data-no-transition': { name: 'data-transition', value: 'false' },
31
- 'data-no-prefetch': { name: 'data-prefetch', value: 'false' },
32
- }
33
- const NEARBY = [...FLAGS, ...Object.keys(OLD_LINK_FLAGS)]
20
+ // The names before 1.105, which nothing reads any more: a link using one would follow as a plain link, a sign-out link prefetched included.
21
+ const REMOVED: Record<string, string> = { 'data-keep-scroll': 'data-scroll="keep"', 'data-no-transition': 'data-transition="false"', 'data-no-prefetch': 'data-prefetch="false"' }
34
22
 
35
23
  // The name an attribute is written with, none for a spread or a `{name}` shorthand.
36
24
  function nameOf(attribute: Attribute): Span | undefined {
@@ -41,7 +29,7 @@ function nameOf(attribute: Attribute): Span | undefined {
41
29
  function nearest(name: string): string | undefined {
42
30
  const word = name.slice(5)
43
31
 
44
- return NEARBY.find((flag) => {
32
+ return [...FLAGS].find((flag) => {
45
33
  const meant = flag.slice(5)
46
34
 
47
35
  return !word.startsWith(meant) && (editDistance(word, meant) <= 1 || swapped(word, meant))
@@ -55,7 +43,7 @@ function swapped(a: string, b: string): boolean {
55
43
  return a.length === b.length && at >= 0 && a[at] === b[at + 1] && a[at + 1] === b[at] && a.slice(at + 2) === b.slice(at + 2)
56
44
  }
57
45
 
58
- // The navigation flags of links, on an element or on a component call that forwards them to its link: the names before 1.105 are `deprecated-link-flags` with a fix, and a `data-` name that is only a misspelling of one of the family is `unknown-link-flag`, as it would do nothing and no type knows a `data-` attribute.
46
+ // The navigation flags of links, on an element or on a component call that forwards them to its link: a `data-` name that is only a misspelling of one of the family is `unknown-link-flag`, as it would do nothing and no type knows a `data-` attribute.
59
47
  export function linkFlags(file: KayFile): Diagnostic[] {
60
48
  const found: Diagnostic[] = []
61
49
 
@@ -67,10 +55,10 @@ export function linkFlags(file: KayFile): Diagnostic[] {
67
55
  continue
68
56
 
69
57
  const name = file.source.slice(at.start, at.end)
70
- const old = OLD_LINK_FLAGS[name]
58
+ const removed = REMOVED[name]
71
59
 
72
- if (old !== undefined) {
73
- found.push(oldFlag(file.source, attribute, at, name, old))
60
+ if (removed !== undefined) {
61
+ found.push({ ...at, code: 'unknown-link-flag', message: `\`${name}\` is no navigation flag of a link any more`, note: 'nothing reads it since 1.109, so the link follows as a plain one', help: `write \`${removed}\``, checkOnly: true })
74
62
 
75
63
  continue
76
64
  }
@@ -80,28 +68,11 @@ export function linkFlags(file: KayFile): Diagnostic[] {
80
68
  if (meant === undefined)
81
69
  continue
82
70
 
83
- const renamed = OLD_LINK_FLAGS[meant]
84
- const to = renamed === undefined ? meant : `${renamed.name}="${renamed.value}"`
85
- // An old name written with a value keeps that value after the name, so writing `name="value"` there would leave two: that case gets the help alone.
86
- const fixes = renamed !== undefined && attribute.kind !== 'boolean' ? [] : [{ title: `Write \`${to}\``, safe: false, edits: [{ ...at, text: to }] }]
71
+ const fixes = [{ title: `Write \`${meant}\``, safe: false, edits: [{ ...at, text: meant }] }]
87
72
 
88
- found.push({ ...at, code: 'unknown-link-flag', message: `\`${name}\` is no navigation flag of a link`, note: 'a link is followed with `data-scroll`, `data-transition`, `data-prefetch` and `data-reload`, and this name does nothing', help: `did you mean \`${to}\`?`, fixes, checkOnly: true })
73
+ found.push({ ...at, code: 'unknown-link-flag', message: `\`${name}\` is no navigation flag of a link`, note: 'a link is followed with `data-scroll`, `data-transition`, `data-prefetch` and `data-reload`, and this name does nothing', help: `did you mean \`${meant}\`?`, fixes, checkOnly: true })
89
74
  }
90
75
  }
91
76
 
92
77
  return found
93
78
  }
94
-
95
- function oldFlag(source: string, attribute: Attribute, at: Span, name: string, old: Renamed): Diagnostic {
96
- const base = { ...at, code: 'deprecated-link-flags', checkOnly: true, message: `\`${name}\` is \`${old.name}="${old.value}"\`, deprecated since 1.105`, help: `write \`${old.name}="${old.value}"\`, named as the option of \`navigate()\`` }
97
-
98
- if (attribute.kind === 'expression') {
99
- // The keep flag's value is read as before, but the new name types its words, so the rename is not safe; the other two were set by being present, which no value of the new name says.
100
- return old.off === undefined ? base : { ...base, fixes: [{ title: `Write \`${old.name}\``, safe: false, edits: [{ ...at, text: old.name }] }] }
101
- }
102
-
103
- const written = old.off !== undefined && attribute.kind === 'static' && attribute.text === 'false' ? old.off : old.value
104
- const end = attribute.kind === 'static' ? attribute.value.end + ('"\''.includes(source[attribute.value.end] ?? '') ? 1 : 0) : at.end
105
-
106
- return { ...base, fixes: [{ title: `Write \`${old.name}="${written}"\``, safe: true, edits: [{ start: at.start, end, text: `${old.name}="${written}"` }] }] }
107
- }
@@ -1,13 +1,13 @@
1
1
  import type { AllowRules } from './allow-comments'
2
2
  import type { Diagnostic, ElementNode, ForNode, KayFile, TextChunk } from './ast'
3
- import type { RetiredLint } from './deprecated-allow'
3
+ import type { RemovedLintName } from './removed-lints'
4
4
  import type { Scope } from './template-scopes'
5
5
  import { accessibilityLints, MARKUP_LINTS } from './a11y'
6
- import { allowComments, honoured, refusedComments } from './allow-comments'
6
+ import { allowComments, honoured, refusedComments, unknownNames } from './allow-comments'
7
7
  import { keyedByPosition, walkNodes } from './ast'
8
- import { RETIRED_LINTS } from './deprecated-allow'
9
8
  import { DEPRECATED_LINTS } from './deprecated-lints'
10
9
  import { I18N_LINTS } from './i18n-lints'
10
+ import { ISLAND_LINTS } from './island-lints'
11
11
  import { positionAt } from './mapping'
12
12
  import { VOID_ELEMENTS } from './markup'
13
13
  import { nestingLints } from './nesting'
@@ -312,13 +312,6 @@ export const LINTS = {
312
312
  wrong: '--- server\nimport { ask } from \'@kayjs/ai\'\nimport { action, s } from \'kay\'\n\nexport const reply = action(s.object({ messages: s.list(s.string()) }), async ({ messages }) => ask(messages))\n---\np x',
313
313
  right: '--- server\nimport { ask } from \'@kayjs/ai\'\nimport { action, s } from \'kay\'\n\nexport const reply = action(s.object({ messages: s.list(s.string()) }), ({ messages }) => ask(messages))\n---\np x',
314
314
  },
315
- 'unreturned-fail': {
316
- level: 'deny',
317
- group: 'code',
318
- summary: 'A `ctx.fail(...)` statement in an action\'s handler (or `fail(...)` destructured from the context) that is not returned: `fail` returns the failure the action answers with, where `deny`, `notFound` and `redirect` throw, so the statement does nothing and the handler carries on. An arrow function with an expression body already returns, and a nested function is left alone. The fix prepends `return`. Found in `.kay` fences and `.ts` modules alike.',
319
- wrong: '--- server\nexport const rename = action(s.object({ name: s.string() }), ({ name }, ctx) => {\n if (name === \'admin\')\n ctx.fail(409, \'That name is taken\')\n\n return name\n})\n---\np x',
320
- right: '--- server\nexport const rename = action(s.object({ name: s.string() }), ({ name }, ctx) => {\n if (name === \'admin\')\n return ctx.fail(409, \'That name is taken\')\n\n return name\n})\n---\np x',
321
- },
322
315
  'missing-captcha': {
323
316
  level: 'warn',
324
317
  group: 'forms',
@@ -372,7 +365,7 @@ export const LINTS = {
372
365
  'once-read-prop': {
373
366
  level: 'deny',
374
367
  group: 'code',
375
- summary: 'A destructured prop read into a top-level `let`, a destructured `const`, one that awaits or a declaration nested in a block, that a function or the template reads later, in a component that runs in the browser: the declaration runs once, when the component is created, so the value keeps the prop\'s first value after the parent changes it. A top-level `const` naming one value (`const last = items.length - 1`) is computed by a memo and follows the prop, so it is no case. A prop read as the test of an `if` or a ternary, as an argument of a call or `new`, as a write target or in a class, one inside `signal(...)`, `persisted(...)` or `posted...(...)`, `id ?? uid()`, a callback prop (`onChange`) and a prop named `initial*` or `default*` are choices made once and left alone; for another, compute the value where it is used or in a `memo`, or allow it with `// kay-allow once-read-prop: why the first value is meant`.',
368
+ summary: 'A destructured prop read into a top-level `let`, a destructured `const`, one that awaits or a declaration nested in a block, that a function or the template reads later, in a component that runs in the browser: the declaration runs once, when the component is created, so the value keeps the prop\'s first value after the parent changes it. A top-level `const` naming one value (`const last = items.length - 1`) is computed by a memo and follows the prop, so it is no case. A prop read as the test of an `if` or a ternary, as an argument of a call or `new`, as a write target or in a class, one inside `signal(...)`, `persisted.cookie(...)` or `posted...(...)`, `id ?? uid()`, a callback prop (`onChange`) and a prop named `initial*` or `default*` are choices made once and left alone; for another, compute the value where it is used or in a `memo`, or allow it with `// kay-allow once-read-prop: why the first value is meant`.',
376
369
  wrong: '---\nimport { signal } from \'kay\'\n\nconst { items } = props<{ items: string[] }>()\nlet last = items.length - 1\nconst open = signal(false)\n---\nbutton(onClick={() => open = !open()}) {last}',
377
370
  right: '---\nimport { memo, signal } from \'kay\'\n\nconst { items } = props<{ items: string[] }>()\nconst last = memo(() => items.length - 1)\nconst open = signal(false)\n---\nbutton(onClick={() => open = !open()}) {last()}',
378
371
  },
@@ -432,10 +425,11 @@ export const LINTS = {
432
425
  'island-marker': {
433
426
  level: 'deny',
434
427
  group: 'islands',
435
- summary: 'An `island()` declaration (or a `--- island` fence line) on a page, a layout or a special page: they render on the server and are never islands. Move what needs the browser to a component of its own.',
428
+ summary: 'An `island()` declaration on a page, a layout or a special page: they render on the server and are never islands. Move what needs the browser to a component of its own.',
436
429
  wrong: '--- server\nconst title = \'Home\'\n--- script\nisland()\n---\nh1 {title}',
437
430
  right: '--- server\nconst title = \'Home\'\n---\nh1 {title}',
438
431
  },
432
+ ...ISLAND_LINTS,
439
433
  'island-prop': {
440
434
  level: 'deny',
441
435
  group: 'islands',
@@ -618,7 +612,7 @@ export const LINTS = {
618
612
  group: 'seo',
619
613
  site: true,
620
614
  summary: 'A prerendered page that no other page links to and the sitemap does not list, which a crawler cannot find. Reported by `kay build` on a site with `site` set when every page of the app is prerendered, as a page of the app rendered per request may link to anything (the pages a library mounts link within the library and do not count); the home page, a locale\'s root, `noindex` pages and pages behind a guard are left out.',
621
- wrong: '--- server\nexport const page = { prerender: true, sitemap: false }\n---\nh1 Spring sale',
615
+ wrong: '--- server\nexport const page = { prerender: true, seo: { sitemap: false } }\n---\nh1 Spring sale',
622
616
  right: '--- server\nexport const page = { prerender: true }\n---\nh1 Spring sale',
623
617
  },
624
618
  'broken-canonical': {
@@ -693,8 +687,8 @@ export const LINTS = {
693
687
  export type LintName = keyof typeof LINTS
694
688
 
695
689
  // `satisfied` is set by kay from the extensions' `satisfies`, never written in `kay.config.ts`: the lints an extension answers for a place it fills in by itself.
696
- // `comments` is no lint's level: it sets what a `// kay-allow` comment must hold to count.
697
- export type LintLevels = Partial<Record<LintName | LintGroup | RetiredLint, LintLevel>> & { satisfied?: LintName[] | undefined, comments?: AllowRules | undefined }
690
+ // `comments` is no lint's level: it sets what a `// kay-allow` comment must hold to count. A removed lint is still accepted, warned about by `kay check`.
691
+ export type LintLevels = Partial<Record<LintName | LintGroup | RemovedLintName, LintLevel>> & { satisfied?: LintName[] | undefined, comments?: AllowRules | undefined }
698
692
 
699
693
  export const LEVELS: ReadonlySet<string> = new Set<LintLevel>(['allow', 'warn', 'deny'])
700
694
 
@@ -724,8 +718,6 @@ export const UPGRADE_FROM = 'KAY_UPGRADE_FROM'
724
718
 
725
719
  export { DEPRECATION_MINORS } from './deprecated-lints'
726
720
 
727
- export { minorAfter, minorOf } from './minor'
728
-
729
721
  export function isLintGroup(name: string | undefined): name is LintGroup {
730
722
  return name !== undefined && Object.hasOwn(LINT_GROUPS, name)
731
723
  }
@@ -783,7 +775,7 @@ export function applyLints(diagnostics: Diagnostic[], source: string, levels: Li
783
775
  }
784
776
 
785
777
  function unknownLints(source: string): Diagnostic[] {
786
- return allowComments(source).flatMap(comment => comment.names.filter(({ name }) => !isLint(name) && !RETIRED_LINTS.has(name)).map(({ name, start }): Diagnostic => ({ start, end: start + name.length, code: 'unknown-lint', message: `Unknown lint \`${name}\``, help: `the lints are ${Object.keys(LINTS).map(lint => `\`${lint}\``).join(', ')}`, checkOnly: true })))
778
+ return allowComments(source).flatMap(comment => unknownNames(comment, source, isLint, `the lints are ${Object.keys(LINTS).map(lint => `\`${lint}\``).join(', ')}`))
787
779
  }
788
780
 
789
781
  // The template's own lints: what it can say from the markup alone.
@@ -1,5 +1,6 @@
1
1
  import type { ClassTable } from '../runtime/class-table'
2
2
  import type { Attribute, ElementNode, ErrorMessages, FormField, NamedAttribute, Node, SlotNode, SnippetNode, Span, TemplateFacts, TextNode } from './ast'
3
+ import type { ClassItem } from './class-items'
3
4
  import type { FormInfo } from './form-info'
4
5
  import type { ImageOptionAttributes } from './image-attributes'
5
6
  import type { CodeBuilder } from './mapping'
@@ -9,13 +10,14 @@ import { PART_END, PART_START } from '../runtime/markers'
9
10
  import { URL_ATTRIBUTES } from '../runtime/url-attributes'
10
11
  import { actionOf, bindsOwnProp, componentAction, describedByOf, FIELD_ATTRIBUTE, formFieldOf, handedParts, modifiersOf, partAttribute, partNames, partsOf, sectionOf, uiHasVariants, uiPartClasses } from './ast'
11
12
  import { addBoundWrites, calledByBinds, changeOf } from './bound-props'
13
+ import { joinTexts } from './class-items'
12
14
  import { addHandler } from './event-modifiers'
13
15
  import { decodeEntities, isFunctionAt } from './expression'
14
- import { IMAGE_OPTIONS, imageDefaults as imageDefaultsOf, imageOptions, NO_PLACEHOLDER, placeholderOff, writeImageArguments } from './image-attributes'
16
+ import { closeHandParts, handedItem, handsEntry, openClassList, writesTogether, writtenParts } from './hand-parts'
17
+ import { IMAGE_OPTIONS, imageDefaults as imageDefaultsOf, imageOptions, placeholderOff, writeImageArguments } from './image-attributes'
15
18
  import { contentOf } from './items'
16
19
  import { controlId, fieldAttribute, inheritedAttributes, inheritedField } from './markup-fields'
17
20
  import { PROPS } from './names'
18
- import { oldPartsEntry } from './old-parts'
19
21
  import { addGroupChecked, bindingOf, classMergeOf, formDefaultsOf, groupValue, shapeOf, shorthandClass, staticAttributeText, valueBoundBy, writesAttribute } from './plan'
20
22
  import { bindEvent } from './validate'
21
23
 
@@ -252,7 +254,7 @@ export abstract class TemplateWriter {
252
254
  continue
253
255
 
254
256
  // Read below with the image's source, and never written.
255
- if (name === 'img' && (attributeName === NO_PLACEHOLDER || IMAGE_OPTIONS.has(attributeName)))
257
+ if (name === 'img' && IMAGE_OPTIONS.has(attributeName))
256
258
  continue
257
259
 
258
260
  // Read by `currentLink` on the server, and never written, a repeat of it included.
@@ -360,7 +362,7 @@ export abstract class TemplateWriter {
360
362
  // `except` is a slot that is no prop, as a server island's `@failed`.
361
363
  protected componentProps(element: ElementNode, getters: boolean, except?: SlotNode): void {
362
364
  const { b } = this
363
- const spreads = element.attributes.some(attribute => attribute.kind === 'spread')
365
+ const spreads = element.attributes.some(attribute => attribute.kind === 'spread') || writesTogether(element, this.src, this.facts.parts)
364
366
 
365
367
  if (spreads)
366
368
  b.add(`${helperName('merge')}(`)
@@ -512,15 +514,15 @@ export abstract class TemplateWriter {
512
514
  continue
513
515
  }
514
516
 
515
- // The `class` of before 1.105 is the component's `parts`.
516
- if (oldPartsEntry(element, this.src, attribute, b, entry))
517
+ // The `parts` and spreads of a call handing parts on are written with its own.
518
+ if (handsEntry(element, this.src, attribute, element.component && parts.length > 0))
517
519
  continue
518
520
 
519
521
  const name = this.source(attribute.name)
520
522
 
521
- if (element.name === 'img' && (name === NO_PLACEHOLDER || IMAGE_OPTIONS.has(name))) {
523
+ if (element.name === 'img' && IMAGE_OPTIONS.has(name)) {
522
524
  // Takes the color a spread brings off the image, which the attributes after it cannot unset.
523
- if (name === NO_PLACEHOLDER || placeholderOff(attribute, span => this.source(span)))
525
+ if (placeholderOff(attribute, span => this.source(span)))
524
526
  entry('style', () => b.add('undefined'), false)
525
527
 
526
528
  continue
@@ -553,8 +555,21 @@ export abstract class TemplateWriter {
553
555
  if (element.name === 'img' && ownStyle !== undefined && element.attributes.lastIndexOf(ownStyle) < lastSpread)
554
556
  namedEntry(ownStyle, 'style')
555
557
 
556
- if (mergedClass)
557
- entry('class', () => this.mergedClass(element, classAttribute, spreads), true)
558
+ // A call that hands a part on always holds parts in its list, which carry the classes as their root: its `class` is the one a spread would bring, left off.
559
+ const hands = element.component && handedParts(element, this.src, this.facts.parts).length > 0
560
+ const together = writesTogether(element, this.src, this.facts.parts)
561
+
562
+ if (together) {
563
+ closeObject()
564
+ b.add(objects++ > 0 ? ', ' : '')
565
+ this.mergedClass(element, classAttribute, spreads, writtenParts(element, this.src), true)
566
+ }
567
+
568
+ if (!together && (hands ? spreads : mergedClass))
569
+ entry('class', () => hands ? b.add('undefined') : this.mergedClass(element, classAttribute, spreads), !hands)
570
+
571
+ if (!together && element.component && parts.length > 0)
572
+ entry('parts', () => this.mergedClass(element, classAttribute, spreads, writtenParts(element, this.src)), true)
558
573
 
559
574
  if (!keepOpen)
560
575
  close()
@@ -688,8 +703,8 @@ export abstract class TemplateWriter {
688
703
  this.b.add(`, { ${defaults.map(([name, value]) => `${JSON.stringify(name)}: ${JSON.stringify(value)}`).join(', ')} }`)
689
704
  }
690
705
 
691
- // `class` as written: the shorthand alone or merged with a static attribute is a string; with an expression or spreads, an array of every source, which a component gets merged into one string, as its `class?: string` prop takes it.
692
- protected mergedClass(element: ElementNode, classAttribute: NamedAttribute | undefined, spreads: boolean): void {
706
+ // `class` as written: the shorthand alone or merged with a static attribute is a string; with an expression or spreads, an array of every source, which a component gets merged into one string, as its `class?: string` prop takes it. With `handing`, the `parts` a component call that hands parts on gets in its place, laid over the `parts` it writes.
707
+ protected mergedClass(element: ElementNode, classAttribute: NamedAttribute | undefined, spreads: boolean, handing?: readonly Attribute[], together = false): void {
693
708
  const { b } = this
694
709
  const shorthand = element.classes.length > 0 ? this.shorthand(element) : undefined
695
710
  const parts = partsOf(element, this.src, this.facts.parts)
@@ -703,7 +718,7 @@ export abstract class TemplateWriter {
703
718
  }
704
719
 
705
720
  // A literal is kept as text, so the ones side by side resolve together.
706
- const items: ({ text: string } | { emit: () => void })[] = []
721
+ const items: ClassItem[] = []
707
722
 
708
723
  if (shorthand !== undefined)
709
724
  items.push({ text: shorthand })
@@ -718,38 +733,15 @@ export abstract class TemplateWriter {
718
733
  }
719
734
 
720
735
  // The parts handed on come before the call's own, so the entry the caller gives the called component's root is the last word.
721
- for (const part of handed) {
722
- items.push({
723
- emit: () => {
724
- b.add(`${helperName('partHanded')}(${JSON.stringify(part)}, [`)
725
-
726
- for (const emit of this.recipeItem(part)) {
727
- emit()
728
- b.add(', ')
729
- }
730
-
731
- b.add(`${helperName('partClass')}(${PROPS}, ${JSON.stringify(part)})])`)
732
- },
733
- })
734
- }
736
+ for (const part of handed)
737
+ items.push(handedItem(b, part, this.recipeItem(part)))
735
738
 
736
739
  for (const part of parts)
737
740
  items.push(...this.recipeItem(part).map(emit => ({ emit })), { emit: () => b.add(`${helperName('partClass')}(${PROPS}, ${JSON.stringify(part)})`) })
738
741
 
739
- const written = this.classTable === undefined
740
- ? items
741
- : items.reduce<typeof items>((merged, item) => {
742
- const last = merged.at(-1)
743
-
744
- if ('text' in item && last !== undefined && 'text' in last)
745
- merged[merged.length - 1] = { text: this.joinLiterals([last.text, item.text]) }
746
- else
747
- merged.push(item)
748
-
749
- return merged
750
- }, [])
742
+ const written = this.classTable === undefined ? items : joinTexts(items, texts => this.joinLiterals(texts))
751
743
 
752
- b.add(element.component ? `${helperName(parts.length > 0 || handed.length > 0 ? 'partsClass' : 'componentClass')}([` : '[')
744
+ openClassList(b, element.component, handing, together)
753
745
  for (const [index, item] of written.entries()) {
754
746
  if (index > 0)
755
747
  b.add(', ')
@@ -759,7 +751,7 @@ export abstract class TemplateWriter {
759
751
  else
760
752
  item.emit()
761
753
  }
762
- b.add(element.component ? '])' : ']')
754
+ closeHandParts(b, element.component, handing, together)
763
755
  }
764
756
 
765
757
  // What a component receives as `children` or a slot: a lone line of text as its string or values, as JSX passes it, anything else rendered.
@@ -12,7 +12,7 @@ const NAMES_KAY = /["']kay["']/
12
12
  const EXPORT = /\bexport\b/
13
13
 
14
14
  // The entries `persisted` carries, one per storage.
15
- export const PERSISTED_ENTRIES = new Set(['cookie', 'local', 'session', 'query'])
15
+ export const PERSISTED_ENTRIES = new Set(['cookie', 'local', 'session'])
16
16
 
17
17
  // The names a module exports as `export const name = signal(...)`, or `persisted`, `linked`, `queryParam`, `memo`, `debounced`, `throttled` or `live`, called as imported from `kay`: what a component importing them writes by assigning, and reads by calling.
18
18
  export function moduleSignals(source: string, jsx = false): Record<string, SignalKind> {
@@ -56,7 +56,7 @@ function allTypes(specifiers: Node[]): boolean {
56
56
  return specifiers.length > 0 && specifiers.every(specifier => (specifier.type === 'ImportSpecifier' && specifier.importKind === 'type') || (specifier.type === 'ExportSpecifier' && specifier.exportKind === 'type'))
57
57
  }
58
58
 
59
- // The local name a call's callee makes a signal by: `signal` of `signal(...)`, and `persisted` of `persisted.local(...)`, `.session`, `.cookie` and `.query`, which make one as `persisted(...)` does.
59
+ // The local name a call's callee makes a signal by: `signal` of `signal(...)`, and `persisted` of `persisted.local(...)`, `.session`, and `.cookie`, which make one.
60
60
  function madeBy(callee: Node, persisted: Set<string>): string | undefined {
61
61
  if (callee.type === 'Identifier')
62
62
  return callee.name
@@ -36,7 +36,7 @@ export function defaultName(index: number): string {
36
36
  }
37
37
 
38
38
  // What the editor leaves out of completions: the names above a completion can reach, and what the generated code imports or declares.
39
- export const GENERATED_NAME = new RegExp(`^(?:${[PROPS, VALUES, CURRENT, 'kayEvent', 'kayMatched', 'kayAwaited', 'kayEach'].join('|')}|${DEFAULT_PREFIX}\\d+|Kay(?:Default|LoopFor|StaticFor|Show|Omit|ComponentClass|PartClass|PartsClass|PartOf|HandedPart|Dynamic|TemplateHelpers|Island|IslandBrand|HydrateWhen|Href|Html|ComputedHtml|Field|FormValues|FormError|Prop|PlainProp|FunctionProp|PromotedProp|PromotedFunctionProp|HandsPart|Children|Row|List|Truthy|Unmatched|Keyed|Radio|Writable|WriteTo|UpdateTo|WriteBack|UpdateBack|Bound|Bindable|Handed|PageContext|PrerenderedContext|PageSettings|QueryOf|PageData|JSX|FormAction|RegisterActions|ActionStub|ReviveActions|UseHead|Await|Awaited|Try))$`)
39
+ export const GENERATED_NAME = new RegExp(`^(?:${[PROPS, VALUES, CURRENT, 'kayEvent', 'kayMatched', 'kayAwaited', 'kayEach'].join('|')}|${DEFAULT_PREFIX}\\d+|Kay(?:Default|LoopFor|StaticFor|Show|Omit|ComponentClass|PartClass|PartsClass|PartProps|HandParts|PartOf|HandedPart|Dynamic|TemplateHelpers|Island|IslandBrand|IslandAsked|IslandExport|HydrateWhen|Href|Html|ComputedHtml|Field|FormValues|FormError|Prop|PlainProp|FunctionProp|PromotedProp|PromotedFunctionProp|HandsPart|Children|Row|List|Truthy|Unmatched|Keyed|Radio|Writable|WriteTo|UpdateTo|WriteBack|UpdateBack|Bound|Bindable|Handed|PageContext|PrerenderedContext|PageSettings|QueryOf|PageData|JSX|FormAction|RegisterActions|ActionStub|ReviveActions|UseHead|Await|Awaited|Try))$`)
40
40
 
41
41
  // The app's `src/await-failed.kay`, and the message keys it words.
42
42
  export interface AwaitAlert {
@@ -5,6 +5,17 @@ export const PAGE = 'page'
5
5
  // The settings that moved from `page` into its `seo` group in 1.105.
6
6
  export const SEO_SETTINGS: readonly string[] = ['noindex', 'sitemap', 'lastmod', 'search', 'feed']
7
7
 
8
+ // The report for a key `page` held before 1.105 and no longer reads, which fails the build naming where it is written now.
9
+ export function movedSettingReport(key: string): { message: string, help: string } | undefined {
10
+ if (SEO_SETTINGS.includes(key))
11
+ return { message: `\`${key}\` is a setting of \`seo\`, not of \`page\`, since 1.105`, help: `write \`page = { seo: { ${key}: ... } }\`` }
12
+
13
+ if (key === 'ttl' || key === 'cacheControl')
14
+ return { message: `\`${key}\` is \`cache\` since 1.105, which sets the lifetime and the \`cache-control\` of the page in one place`, help: 'write `cache: \'1h\'`, `cache: { browser, shared, swr }`, `cache: \'private\'` or `cache: false`' }
15
+
16
+ return undefined
17
+ }
18
+
8
19
  // The report for a `guards` or `layouts` setting the server cannot read, shared by the compiler and `kay check` so both say it alike.
9
20
  export function unreadSettingReport(key: string): { message: string, help: string } {
10
21
  return {