@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
@@ -5,10 +5,8 @@ import { ifAlias } from './if-alias'
5
5
  import { rolesOf, spelledOutFirstFence } from './island-declaration'
6
6
  import { Scanner } from './scanner'
7
7
 
8
- // `--- server`, `--- client`, `--- island`, `--- static`, `--- script`, `--- module`, or `--- <T extends Row>` making the component generic, its type parameters in the third or fourth group: `--- client <T>` takes both.
8
+ // `--- server`, `--- script`, `--- module`, `--- style`, or `--- <T extends Row>` making the component generic, its type parameters in the third or fourth group: `--- script <T>` takes both.
9
9
  const FENCE = /---(?:([ \t]*)([a-z]+)(?:[ \t]+<(.*)>)?|[ \t]*<(.*)>)?[ \t]*\r?\n/diy
10
- // The names a script fence takes beside none: `client` renders in the browser only, `island` and `static` pin the role.
11
- const SCRIPT_FENCES: ReadonlySet<string> = new Set(['client', 'script', 'island', 'static'])
12
10
  const CLOSING_FENCE = /^---(?:[ \t]*$|[ \t]*[a-z<])/gm
13
11
  const BARE_LINE = /^---[ \t]*$/
14
12
  const CLOSING_LINE = /---[ \t]*(?=\r?\n|$)/y
@@ -103,7 +101,7 @@ export function parseKay(source: string): KayFile {
103
101
  // The bare `---` closing a named fence while no script fence is open yet, which a later bare `---` was meant to be the script fence of.
104
102
  let bareClosing: Span | undefined
105
103
 
106
- // Fences come first, in any order: `---` or `--- script` holds the component script, `--- client` one rendering in the browser only, `--- island` and `--- static` pin its role, `--- server` the code that runs on the server only, `--- module` the module-level code, which exports values.
104
+ // Fences come first, in any order: `---` or `--- script` holds the component script, `--- server` the code that runs on the server only, `--- module` the module-level code, which exports values.
107
105
  // A labeled fence line also closes the fence before it, so `--- server` code can run straight into `--- script`.
108
106
  while (true) {
109
107
  BLANK_LINES.lastIndex = templateStart
@@ -114,7 +112,7 @@ export function parseKay(source: string): KayFile {
114
112
  if (!fence)
115
113
  break
116
114
 
117
- const kind = fence[2] === undefined || SCRIPT_FENCES.has(fence[2]) ? 'script' : fence[2]
115
+ const kind = fence[2] === undefined ? 'script' : fence[2]
118
116
  const spaced = fence[1] !== ''
119
117
  const bodyStart = fence.index + fence[0].length
120
118
 
@@ -134,7 +132,7 @@ export function parseKay(source: string): KayFile {
134
132
  }
135
133
 
136
134
  if (!spaced || (kind !== 'script' && kind !== 'server' && kind !== 'module' && kind !== 'style')) {
137
- diagnostics.push({ start: fence.index, end: bodyStart - 1, code: 'fence-invalid', message: `Unknown fence \`${fence[0].trim()}\``, help: 'use `---` or `--- script` for the component script, `--- client` for one rendering in the browser only, `--- island` or `--- static` to pin its role, `--- server` for server code, `--- module` for module-level code that exports values, or `--- style` for CSS scoped to the component' })
135
+ diagnostics.push({ start: fence.index, end: bodyStart - 1, code: 'fence-invalid', message: `Unknown fence \`${fence[0].trim()}\``, help: 'use `---` or `--- script` for the component script, `island({ render, hydrate, persist })` first in it to declare its role, `--- server` for server code, `--- module` for module-level code that exports values, or `--- style` for CSS scoped to the component' })
138
136
  }
139
137
  else if (fences[kind]) {
140
138
  diagnostics.push({ start: fence.index, end: bodyStart - 1, code: 'fence-invalid', message: `A file has one ${kind === 'script' ? 'script' : `\`--- ${kind}\``} fence` })
@@ -162,7 +160,7 @@ export function parseKay(source: string): KayFile {
162
160
  }
163
161
  }
164
162
 
165
- const { island, client, pin } = rolesOf(source, fences.script, fenceWord)
163
+ const { island, client, pin } = rolesOf(source, fences.script)
166
164
 
167
165
  const parser = new TemplateParser(source, templateStart, diagnostics)
168
166
  const template = parser.parseTemplate()
@@ -181,7 +179,7 @@ function explainSecondFence(source: string, closing: Span, diagnostics: Diagnost
181
179
  if (!stray)
182
180
  return
183
181
 
184
- stray.help = 'a second fence takes a name once a `--- server` or `--- module` fence is there: write the one closing it as `--- script` (or `--- client`)'
182
+ stray.help = 'a second fence takes a name once a `--- server` or `--- module` fence is there: write the one closing it as `--- script`'
185
183
  stray.fixes = [{ title: 'Name the script fence', edits: [{ start: closing.start, end: closing.end, text: '--- script' }], safe: true }]
186
184
  }
187
185
 
@@ -3,7 +3,6 @@ import type { CodeBuilder } from './mapping'
3
3
  import type { PlannedAttribute } from './markup'
4
4
  import { actionOf, FIELD_ATTRIBUTE, FIELD_ELEMENTS, UNCHECKED_TYPES, UNREQUIRABLE_TYPES } from './ast'
5
5
  import { decodeEntities } from './expression'
6
- import { oldPartsClass } from './old-parts'
7
6
 
8
7
  // Whether a group (the signal of a `bind:group`, a string for radios or an array for checkboxes) holds a value, as the checked state of the box reads it.
9
8
  export const GROUP_HAS = '((kayGroup: unknown, kayValue: string) => Array.isArray(kayGroup) ? kayGroup.includes(kayValue) : kayGroup === kayValue)'
@@ -126,8 +125,7 @@ export interface ClassMerge {
126
125
  }
127
126
 
128
127
  export function classMergeOf(element: ElementNode, src: string): ClassMerge {
129
- const old = oldPartsClass(element, src)
130
- const attribute = element.attributes.find((candidate): candidate is NamedAttribute => candidate.kind !== 'spread' && candidate !== old && src.slice(candidate.name.start, candidate.name.end) === 'class')
128
+ const attribute = element.attributes.find((candidate): candidate is NamedAttribute => candidate.kind !== 'spread' && src.slice(candidate.name.start, candidate.name.end) === 'class')
131
129
  const spreads = element.attributes.some(candidate => candidate.kind === 'spread')
132
130
  const shorthand = element.classes.length > 0 ? { start: element.classes[0]!.start, end: element.classes.at(-1)!.end } : undefined
133
131
 
@@ -0,0 +1,90 @@
1
+ // The lints kay has removed, each with the form it reported gone: a `lints` entry naming one still loads, `kay check` says to remove it, and it changes nothing.
2
+ export const REMOVED_LINTS = [
3
+ 'deprecated-action-readers',
4
+ 'deprecated-action-type',
5
+ 'deprecated-ai-labels',
6
+ 'deprecated-ai-language',
7
+ 'deprecated-ai-links',
8
+ 'deprecated-ai-options',
9
+ 'deprecated-ai-props',
10
+ 'deprecated-analytics-options',
11
+ 'deprecated-app-hooks',
12
+ 'deprecated-auth-methods',
13
+ 'deprecated-auth-rate-limits',
14
+ 'deprecated-auth-signed',
15
+ 'deprecated-await-consent',
16
+ 'deprecated-call-result',
17
+ 'deprecated-callback-handler',
18
+ 'deprecated-children-prop',
19
+ 'deprecated-client-keys',
20
+ 'deprecated-cms-options',
21
+ 'deprecated-cms-test-helpers',
22
+ 'deprecated-config-groups',
23
+ 'deprecated-config-keys',
24
+ 'deprecated-config-switch',
25
+ 'deprecated-context-import',
26
+ 'deprecated-ctx-fail',
27
+ 'deprecated-deny-call',
28
+ 'deprecated-disk-files',
29
+ 'deprecated-env-files',
30
+ 'deprecated-event-names',
31
+ 'deprecated-filter-options',
32
+ 'deprecated-format-duration',
33
+ 'deprecated-guard-option',
34
+ 'deprecated-hook-context',
35
+ 'deprecated-hook-names',
36
+ 'deprecated-i18n-keys',
37
+ 'deprecated-if-alias',
38
+ 'deprecated-image-options',
39
+ 'deprecated-images-keys',
40
+ 'deprecated-import-path',
41
+ 'deprecated-infinite-list-options',
42
+ 'deprecated-island-attributes',
43
+ 'deprecated-island-events',
44
+ 'deprecated-island-fence',
45
+ 'deprecated-job-handler',
46
+ 'deprecated-job-options',
47
+ 'deprecated-link-flags',
48
+ 'deprecated-listen-target',
49
+ 'deprecated-live-api',
50
+ 'deprecated-local-state',
51
+ 'deprecated-mail-form',
52
+ 'deprecated-mail-send',
53
+ 'deprecated-navigate-query',
54
+ 'deprecated-navigation-hooks',
55
+ 'deprecated-package-names',
56
+ 'deprecated-page-cache',
57
+ 'deprecated-page-island',
58
+ 'deprecated-page-seo',
59
+ 'deprecated-pages-options',
60
+ 'deprecated-parts-class',
61
+ 'deprecated-persisted-call',
62
+ 'deprecated-persisted-query',
63
+ 'deprecated-persisted-storage',
64
+ 'deprecated-rate-enforce',
65
+ 'deprecated-redirect-permanent',
66
+ 'deprecated-refuse-call',
67
+ 'deprecated-route-keys',
68
+ 'deprecated-schedule-call',
69
+ 'deprecated-schedule-tz',
70
+ 'deprecated-schema-type',
71
+ 'deprecated-script-fence',
72
+ 'deprecated-secret-keys',
73
+ 'deprecated-socket-frames',
74
+ 'deprecated-source-readers',
75
+ 'deprecated-store-ms',
76
+ 'deprecated-store-names',
77
+ 'deprecated-test-helpers',
78
+ 'deprecated-ttl-names',
79
+ 'deprecated-ui-callbacks',
80
+ 'deprecated-ui-hotkey',
81
+ 'deprecated-ui-input',
82
+ 'deprecated-ui-item-keys',
83
+ 'deprecated-ui-items',
84
+ 'deprecated-uncaught-await',
85
+ 'deprecated-workflow-start-id',
86
+ 'uncaught-await',
87
+ 'unreturned-fail',
88
+ ] as const
89
+
90
+ export type RemovedLintName = typeof REMOVED_LINTS[number]
@@ -10,7 +10,7 @@ import { parseProgram } from './estree'
10
10
  import { derivedSpan, INITIAL_PROP } from './live-reads'
11
11
  import { PERSISTED_ENTRIES } from './module-signals'
12
12
  import { CURRENT, HANDED, LOAD, PROBE, PROPS, VALUES, WRITABLE, WRITE_HELPERS } from './names'
13
- import { assignedIdentifier, compilerCall, handedToComponent, holdsNoSignal, holdsNoSignalRoot, holdsNoSignalType, importedFromKay, isCall, isPlainRead, keyRead, lastNonSpace, LIVE_STATE, LIVE_WRITES, LOGICAL, loopKey, memberTypes, namesType, nestsEffects, nestsWrites, nextNonSpace, onlyRead, plainMemberAwait, propRead, propType, readOutside, rowReadOnly, signatureNames, sourceEnds, sourceSpan, syntaxError, tagPosition, typeQueryOf, uncalledSignal, valueReferences, valueUnused, withShorthand } from './rewrite-reads'
13
+ import { assignedIdentifier, compilerCall, handedToComponent, holdsNoSignal, holdsNoSignalRoot, holdsNoSignalType, importedFromKay, isCall, isPlainRead, keyRead, lastNonSpace, LIVE_STATE, LIVE_WRITES, LOGICAL, loopKey, memberTypes, namesType, nestsEffects, nestsWrites, nextNonSpace, onlyRead, plainMemberAwait, propRead, propType, readOutside, rowReadOnly, signatureNames, sourceSpan, syntaxError, tagPosition, typeQueryOf, uncalledSignal, valueReferences, valueUnused, withShorthand } from './rewrite-reads'
14
14
  import { Scanner } from './rewrite-scan'
15
15
  import { markTagValue } from './rewrite-tags'
16
16
  import { analyze } from './scope'
@@ -104,9 +104,6 @@ class RewriteFinder {
104
104
  else if (path.is('Identifier')) {
105
105
  this.globalRead(path)
106
106
  }
107
- else if (path.is('CallExpression')) {
108
- this.listenTarget(path)
109
- }
110
107
  else if (path.is('ArrowFunctionExpression')) {
111
108
  this.rows(path)
112
109
  }
@@ -362,7 +359,7 @@ class RewriteFinder {
362
359
  const rightEnd = right && map.isExact(node.end - 1) ? map.toSource(node.end - 1) : undefined
363
360
 
364
361
  if (kind === 'memo' || kind === 'live') {
365
- this.diagnostics.push({ ...span, message: kind === 'live' ? `\`${name}\` is a live value, which the server writes and a browser only reads` : `\`${name}\` is a memo, which cannot be written`, help: kind === 'live' ? `write it with \`${name}.set(value)\`, or \`${name}.set(key, value)\` for a keyed one, from a server fence, an action or a job` : 'write the signals it is derived from' })
362
+ this.diagnostics.push({ ...span, message: kind === 'live' ? `\`${name}\` is a live value, which the server writes and a browser only reads` : `\`${name}\` is a memo, which cannot be written`, help: kind === 'live' ? `write it with \`${name}.set(value)\`, or \`${name}.set(value, { key })\` for a keyed one, from a server fence, an action or a job` : 'write the signals it is derived from' })
366
363
 
367
364
  return
368
365
  }
@@ -589,7 +586,7 @@ class RewriteFinder {
589
586
  }
590
587
 
591
588
  private madeSignal(path: Path<VariableDeclarator>, id: Identifier, init: CallExpression) {
592
- // `persisted.local(...)` and the other entries make a signal as `persisted(...)` does.
589
+ // `persisted.local(...)` and the other entries make a signal.
593
590
  const entry = init.callee.type === 'MemberExpression' && !init.callee.computed && init.callee.property.type === 'Identifier' && PERSISTED_ENTRIES.has(init.callee.property.name) && importedFromKay(path.scope, init.callee.object) === 'persisted' ? 'persisted' : undefined
594
591
  // `relativeTime` from `kay/i18n` makes a memo too.
595
592
  const made = entry ?? importedFromKay(path.scope, init.callee) ?? (importedFromKay(path.scope, init.callee, 'kay/i18n') === 'relativeTime' ? 'memo' : undefined)
@@ -636,18 +633,6 @@ class RewriteFinder {
636
633
  this.unread.add(prop.binding.local.start)
637
634
  }
638
635
 
639
- // `listen(window, ...)` takes its target as a function, so a server render never reads `window`.
640
- private listenTarget(path: Path<CallExpression>) {
641
- const target = path.node.arguments[0]
642
- const span = !target || target.type === 'ArrowFunctionExpression' || target.type === 'FunctionExpression' || target.type === 'SpreadElement' || importedFromKay(path.scope, path.node.callee) !== 'listen' ? undefined : sourceEnds(this.input.map, target)
643
-
644
- if (!span)
645
- return
646
-
647
- this.insert(span.start, '() => (')
648
- this.insert(span.end, ')')
649
- }
650
-
651
636
  private assignment(path: Path<AssignmentExpression | UpdateExpression>) {
652
637
  const target = path.node.type === 'AssignmentExpression' ? path.node.left : path.node.argument
653
638
  const binding = target.type === 'Identifier' ? path.scope.getBinding(target.name) : undefined
@@ -8,7 +8,7 @@ import type { ImportBinding, ParsedFence } from './script-shared'
8
8
  import { eachNode } from './each-node'
9
9
  import { isPlainProperty } from './estree'
10
10
  import { bodyFact } from './load-facts'
11
- import { PAGE, PAGE_SETTINGS, SEO_SETTINGS, unreadSettingReport } from './page-settings'
11
+ import { movedSettingReport, PAGE, PAGE_SETTINGS, SEO_SETTINGS, unreadSettingReport } from './page-settings'
12
12
  import { declaredIdentifiers, keyName, LITERAL_SETTING, plainNames } from './script-shared'
13
13
  import { splitFence } from './script-split'
14
14
  import { traverse, walkScope } from './walk'
@@ -197,9 +197,14 @@ function pageSettings(ast: Program, statement: Statement, declaration: NodeOfTyp
197
197
  if ((key === 'guards' || key === 'layouts') && !LITERAL_SETTING.test(text(property)) && !(key === 'guards' && GUARD_VALUES.has(property.value.type) && !(property.value.type === 'Identifier' && property.value.name === 'undefined')))
198
198
  analysis.diagnostics.push({ ...shift(property.value), ...unreadSettingReport(key) })
199
199
 
200
+ const moved = movedSettingReport(key)
201
+
202
+ if (moved)
203
+ analysis.diagnostics.push({ ...shift(property.key), ...moved })
204
+
200
205
  settings.set(key, { key: shift(property.key), value: shift(property.value) })
201
206
 
202
- // What `seo` holds of the settings read below, beside those written at the top level before 1.105.
207
+ // What `seo` holds of the settings read below, the keys of `seo` the checks and the sitemap read.
203
208
  if (key === 'seo' && property.value.type === 'ObjectExpression')
204
209
  seo = property.value
205
210
  }
@@ -210,7 +215,7 @@ function pageSettings(ast: Program, statement: Statement, declaration: NodeOfTyp
210
215
  if (inner.type !== 'Property' || innerKey === undefined)
211
216
  continue
212
217
 
213
- // The top-level key of the setting, for those the sitemap and the checks read where `page` once held them; the others as `seo.title` and so on.
218
+ // The top-level key of the setting, for those the sitemap and the checks read; the others as `seo.title` and so on.
214
219
  const registered = SEO_SETTINGS.includes(innerKey) ? innerKey : `seo.${innerKey}`
215
220
 
216
221
  if (!settings.has(registered))
@@ -0,0 +1,141 @@
1
+ import type { Diagnostic, Fix } from './ast'
2
+ import type { Node, NodeOfType } from './estree'
3
+ import type { ParsedFence, PropsDeclaration } from './script'
4
+ import { eachNode } from './each-node'
5
+ import { INITIAL_PROP } from './live-reads'
6
+ import { patternNames } from './pattern-names'
7
+
8
+ type ImportSpecifier = NodeOfType<'ImportSpecifier'>
9
+
10
+ const KAY = 'kay'
11
+
12
+ // The name a prop is read by, through a chain of plain properties (`todo.title`), or undefined for any other expression.
13
+ function propRoot(node: Node): string | undefined {
14
+ if (node.type === 'Identifier')
15
+ return node.name
16
+
17
+ return node.type === 'MemberExpression' && !node.computed && node.property.type === 'Identifier' ? propRoot(node.object) : undefined
18
+ }
19
+
20
+ function importedAs(node: Node, name: string): node is ImportSpecifier {
21
+ return node.type === 'ImportSpecifier' && node.importKind !== 'type' && node.local.name === name && (node.imported.type === 'Identifier' ? node.imported.name : node.imported.value) === name
22
+ }
23
+
24
+ // The names an `effect` writes, `effect(() => shown = open)` or `shown.set(open)`: a signal it follows needs no `linked`.
25
+ function followedByEffects(ast: Node): Set<string> {
26
+ const names = new Set<string>()
27
+
28
+ eachNode(ast, (node) => {
29
+ if (node.type !== 'CallExpression' || node.callee.type !== 'Identifier' || node.callee.name !== 'effect')
30
+ return
31
+
32
+ eachNode(node, (inner) => {
33
+ if (inner.type === 'AssignmentExpression' && inner.left.type === 'Identifier')
34
+ names.add(inner.left.name)
35
+
36
+ if (inner.type === 'CallExpression' && inner.callee.type === 'MemberExpression' && inner.callee.property.type === 'Identifier' && inner.callee.property.name === 'set' && inner.callee.object.type === 'Identifier')
37
+ names.add(inner.callee.object.name)
38
+ })
39
+
40
+ return false
41
+ })
42
+
43
+ return names
44
+ }
45
+
46
+ // The names the script writes outside an `effect`: `name = value`, `name += 1` or `name.set(...)`, `.update(...)`.
47
+ function writtenNames(ast: Node): Set<string> {
48
+ const names = new Set<string>()
49
+
50
+ eachNode(ast, (node) => {
51
+ if (node.type === 'AssignmentExpression' && node.left.type === 'Identifier')
52
+ names.add(node.left.name)
53
+
54
+ if (node.type === 'UpdateExpression' && node.argument.type === 'Identifier')
55
+ names.add(node.argument.name)
56
+
57
+ if (node.type === 'CallExpression' && node.callee.type === 'MemberExpression' && node.callee.object.type === 'Identifier' && node.callee.property.type === 'Identifier' && (node.callee.property.name === 'set' || node.callee.property.name === 'update'))
58
+ names.add(node.callee.object.name)
59
+ })
60
+
61
+ return names
62
+ }
63
+
64
+ // A `signal(prop)` at the top of an island's script that the island never writes: the signal takes the prop's value when the component is created, so it keeps the first one when the page gives the island another, as a refresh does while the island stays. `linked(() => prop)` is the signal that follows its source. A signal the island writes (a counter starting from a prop) is its own state and is left alone.
65
+ // A prop named as a seed (`initial...`, `default...`) is meant to be read once, and a name declared again in the script is left alone.
66
+ export function signalFromProps(fence: ParsedFence, props: PropsDeclaration | undefined, writtenInTemplate: ReadonlySet<string>): Diagnostic[] {
67
+ if (!props || !fence.code.includes('signal'))
68
+ return []
69
+
70
+ const watched = new Set(props.bindings.filter(binding => !INITIAL_PROP.test(binding.key)).map(binding => fence.code.slice(binding.local.start - fence.offset, binding.local.end - fence.offset)))
71
+ const declaration = fence.ast.body.find(node => node.type === 'ImportDeclaration' && node.source.value === KAY && node.importKind !== 'type')
72
+ const specifier = declaration?.type === 'ImportDeclaration' ? declaration.specifiers.find(node => importedAs(node, 'signal')) : undefined
73
+
74
+ if (watched.size === 0 || specifier?.type !== 'ImportSpecifier')
75
+ return []
76
+
77
+ const linked = declaration?.type === 'ImportDeclaration' && declaration.specifiers.some(node => importedAs(node, 'linked'))
78
+ let others = 0
79
+ let taken = false
80
+ const seeds: { call: NodeOfType<'CallExpression'>, name: string | undefined }[] = []
81
+
82
+ eachNode(fence.ast, (node) => {
83
+ if (node.type === 'ImportDeclaration' || (node.type === 'VariableDeclaration' && fence.shift(node).start === props.statement.start))
84
+ return false
85
+
86
+ // A parameter of a function in the script is its own value, not the prop.
87
+ if (node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression') {
88
+ for (const param of node.params) {
89
+ for (const name of patternNames(param))
90
+ watched.delete(name)
91
+ }
92
+ }
93
+
94
+ if (node.type === 'VariableDeclarator') {
95
+ for (const name of patternNames(node.id)) {
96
+ watched.delete(name)
97
+ taken ||= name === 'linked'
98
+ }
99
+
100
+ const { init } = node
101
+
102
+ if (init?.type === 'CallExpression' && init.callee.type === 'Identifier' && init.callee.name === 'signal' && init.arguments.length === 1 && init.arguments[0]!.type !== 'SpreadElement')
103
+ seeds.push({ call: init, name: node.id.type === 'Identifier' ? node.id.name : undefined })
104
+ }
105
+
106
+ if (node.type === 'Identifier' && node.name === 'signal')
107
+ others++
108
+
109
+ return true
110
+ })
111
+
112
+ const diagnostics: Diagnostic[] = []
113
+ const followed = followedByEffects(fence.ast)
114
+ const written = writtenNames(fence.ast)
115
+ const found = seeds.filter(({ call, name }) => {
116
+ // A seed the island writes is its own state, which starts from the prop by intent, as a counter does.
117
+ const root = call.typeArguments || (name !== undefined && (followed.has(name) || written.has(name) || writtenInTemplate.has(name))) ? undefined : propRoot(call.arguments[0]!)
118
+
119
+ return root !== undefined && watched.has(root)
120
+ })
121
+
122
+ for (const { call } of found) {
123
+ const seed = call.arguments[0]!
124
+ const root = propRoot(seed)!
125
+ const text = fence.code.slice(seed.start, seed.end)
126
+ const imports: Fix['edits'] = linked || taken ? [] : [{ ...fence.shift(specifier), text: others > found.length ? 'linked, signal' : 'linked' }]
127
+ const fix: Fix = { title: `Write \`linked(() => ${text})\``, safe: !taken, edits: [{ ...fence.shift(call), text: `linked(() => ${text})` }, ...imports] }
128
+
129
+ diagnostics.push({
130
+ ...fence.shift(call),
131
+ code: 'signal-from-prop',
132
+ message: `\`signal(${text})\` keeps the first value of \`${root}\`, as a signal made from a prop does not follow it`,
133
+ note: 'the island stays when the page gives it new props, as after an action or a refresh, so a seed read once shows the old value',
134
+ help: `write \`linked(() => ${text})\`, which follows the prop and can still be written, or \`// kay-allow signal-from-prop\` when the first value is meant`,
135
+ checkOnly: true,
136
+ fixes: taken ? [] : [fix],
137
+ })
138
+ }
139
+
140
+ return diagnostics
141
+ }
@@ -173,6 +173,22 @@ export function templateWords(file: KayFile): string[] {
173
173
  return [...words]
174
174
  }
175
175
 
176
+ // The names the template's expressions write, `count = 1`, `count += 1`, `count++` or `count.set(...)`; it over-approximates, a word before `=` in any expression counts.
177
+ const WRITE = /([\w$]+)\s*(?:\.(?:set|update)\s*\(|(?:\*\*|<<|>>>?|&&|\|\||\?\?|[-+*/%&|^])?=(?![=>])|\+\+|--)|(?:\+\+|--)\s*([\w$]+)/g
178
+
179
+ export function templateWrites(file: KayFile): Set<string> {
180
+ const names = new Set<string>()
181
+
182
+ visitNodes(file.template, (node) => {
183
+ for (const span of nodeExpressions(node)) {
184
+ for (const [, after, before] of file.source.slice(span.start, span.end).matchAll(WRITE))
185
+ names.add((after ?? before)!)
186
+ }
187
+ })
188
+
189
+ return names
190
+ }
191
+
176
192
  // The child blocks of a node with the spans naming what each sees besides its parent's names: a loop's item and index, a snippet's or slot's parameters, a branch's alias.
177
193
  export function scopedBlocks(node: Node): [Node[], Span[]][] {
178
194
  switch (node.kind) {
@@ -9,12 +9,12 @@ import { RESIZABLE } from '../runtime/image'
9
9
  import { WIDGET_ROLES } from './aria'
10
10
  import { childBlocks, failedBlockOf, FIELD_ATTRIBUTE, FIELD_ELEMENTS, isHead, isSlot, modifiersOf, nodeExpressions, SERVER_IN_ISLAND, serverIslandOf, templateFacts, visitNodes } from './ast'
11
11
  import { componentBindProblem } from './bound-props'
12
- import { deprecatedImage } from './deprecated-image'
13
12
  import { deprecatedLibrary } from './deprecated-library'
14
13
  import { libraryComponents } from './deprecated-ui-props'
15
14
  import { modifierProblems } from './event-modifiers'
16
15
  import { valuesCall } from './form-info'
17
16
  import { shorthandProblems } from './head-shorthand'
17
+ import { hydrateProblem } from './island-problems'
18
18
  import { kayCtxImport } from './script-shared'
19
19
  import { attributeProblem, fieldProblem } from './validate-fields'
20
20
  import { AttributeFixes, PART_NAME, PART_NAME_LIST } from './validate-fixes'
@@ -59,8 +59,6 @@ const RAW_TEXT = new Set(['style', 'script'])
59
59
  const CONTENT_ATTRIBUTES = new Set(['innerHTML', 'textContent', 'innerText', 'children'])
60
60
  // One string literal, the way CSS with braces is written in a template's text.
61
61
  const STRING_LITERAL = /^\s*(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\$]|\\.|\$(?!\{))*`)\s*$/
62
- // A `media(...)` hydrate with a query between its brackets.
63
- const MEDIA_HYDRATE = /^media\(\s*\S.*\)$/s
64
62
  // What only a static parent passes an island.
65
63
  const ISLAND_OPTIONS = new Set(['hydrate', 'persist'])
66
64
  // Elements a keyboard reaches and a screen reader announces as controls; a click handler on any other one needs a control's `role`.
@@ -467,9 +465,6 @@ class Validator {
467
465
  deprecatedLibrary(element, library, span => this.text(span), (span, code, message, details) => this.lint(span, code, message, details))
468
466
  }
469
467
 
470
- if (this.options.check && !element.component && element.name === 'img')
471
- deprecatedImage(element, span => this.text(span), (span, message, details) => this.lint(span, 'deprecated-image-options', message, details))
472
-
473
468
  if (this.options.check && !element.component)
474
469
  this.accessibility(element)
475
470
 
@@ -560,8 +555,8 @@ class Validator {
560
555
  if (element.component && (this.options.island !== undefined || this.options.insideIsland) && (ISLAND_OPTIONS.has(name) || (name === 'render' && attribute.kind === 'static' && attribute.text === 'client')))
561
556
  this.error('attribute-ineffective', attribute.name, `\`${name}\` has no effect inside an island`, { note: 'an island hydrates and lives on as a whole' })
562
557
 
563
- if (element.component && name === 'hydrate' && attribute.kind === 'static' && attribute.text.startsWith('media(') && !MEDIA_HYDRATE.test(attribute.text))
564
- this.error('attribute-invalid', attribute.name, '`hydrate="media(...)"` needs a media query', { help: 'write the query in the brackets: `hydrate="media(max-width: 40rem)"`' })
558
+ if (element.component && name === 'hydrate' && attribute.kind === 'static' && hydrateProblem(attribute.text))
559
+ this.error('attribute-invalid', attribute.name, ...hydrateProblem(attribute.text)!)
565
560
 
566
561
  if (attribute === serverIsland?.attribute)
567
562
  this.serverIsland(serverIsland, failedBlockOf(element, this.src))
@@ -8,7 +8,7 @@ import { setUiLayers } from './build/ui-layers'
8
8
  import { KayError } from './compiler/errors'
9
9
  import { APP_CONTEXT, CONFIG_FILE } from './config'
10
10
  import { resolveConfig } from './config-resolve'
11
- import { CONFIG_GROUPS, invalidConfigValues, isBag, mergeBags, REMOVED_KEYS, unknownConfigKeys } from './config-shape'
11
+ import { CONFIG_GROUPS, CONFIG_KEYS, invalidConfigValues, isBag, mergeBags, REMOVED_KEYS, unknownConfigKeys } from './config-shape'
12
12
  import { NATIVE_PLUGINS } from './native-plugins'
13
13
  import { OLD_PACKAGE_NAME, RENAMED_PACKAGES } from './package-names'
14
14
  import { publicEnvFiles } from './server/env-state'
@@ -171,8 +171,7 @@ function refuseInvalidValues(config: object, where: string): void {
171
171
  // The keys `kay check` and `kay env` read in their own way, refused when they are not the shape they take.
172
172
  function checkedConfig(config: ConfigInput & InternalConfig, where = CONFIG_FILE): void {
173
173
  const { checks, publicEnv } = config
174
- const env = config.envFiles ?? config.env
175
- const key = config.envFiles === undefined ? 'env' : 'envFiles'
174
+ const env = config.envFiles
176
175
 
177
176
  if (publicEnv !== undefined)
178
177
  throw new KayError('config-invalid', `kay: \`publicEnv\` in ${where} is gone: mark the fields an island reads \`s.Public\` in \`defineEnv\` instead`)
@@ -206,7 +205,7 @@ function checkedConfig(config: ConfigInput & InternalConfig, where = CONFIG_FILE
206
205
  const files = Array.isArray(compose) ? compose : [compose]
207
206
 
208
207
  if (typeof env !== 'object' || env === null || Array.isArray(env) || files.some(file => file !== undefined && typeof file !== 'string') || (example !== undefined && typeof example !== 'string'))
209
- throw new KayError('config-invalid', `kay: \`${key}\` in ${where} is \`{ compose, example }\`, each a file name (\`compose\` may be a list of them), \`true\` or \`false\``)
208
+ throw new KayError('config-invalid', `kay: \`envFiles\` in ${where} is \`{ compose, example }\`, each a file name (\`compose\` may be a list of them), \`true\` or \`false\``)
210
209
  }
211
210
 
212
211
  // The config with the catalogs of the libraries the app installs listed before its own extensions, so those and the app's messages win key by key; one an extension of the same name already brings is left alone.
@@ -340,9 +339,20 @@ export async function withConfig<Options extends ConfigInput>(root: string, opti
340
339
  // The options are resolved as the file is, so a code call may pass a list's function or an old key as `kay.config.ts` may.
341
340
  const given = await resolveConfig(options) as KayConfig & Omit<Options, keyof ConfigInput>
342
341
 
342
+ refuseOldOptions(given)
343
+
343
344
  return withUiLayers(root, await withTailwind(root, withPublicFields(root, withAppContext(root, mergeConfig(withLibraryMessages(root, await importConfig(root)), given)))))
344
345
  }
345
346
 
347
+ // The config keys of the options given in code are checked as `kay.config.ts` is, so an old nested key such as `mcp.key` is refused rather than dropped.
348
+ function refuseOldOptions(given: object): void {
349
+ const configPart = Object.fromEntries(Object.entries(given).filter(([key]) => CONFIG_KEYS.has(key)))
350
+ const unknown = unknownConfigKeys(configPart)
351
+
352
+ if (unknown.length > 0)
353
+ throw new KayError('config-invalid', `kay: the options have ${unknown.length === 1 ? 'an option' : 'options'} kay does not know: ${unknown.join('; ')}`)
354
+ }
355
+
346
356
  // `config` is as `kay.config.ts` writes it, so the extensions the options name lie under it rather than the file's.
347
357
  export function mergeConfig<Options extends KayConfig>(config: KayConfig, options: Options): KayConfig & Options {
348
358
  // Options carry keys of their own (`root`, `dev`, `prebuilt`), so only the names kay removed are refused here, as `kay.config.ts` refuses every unknown key.