@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,13 @@ import { dirname, join } from 'node:path'
5
5
  import { elementsIn } from '../compiler/ast'
6
6
  import { changeName } from '../compiler/bound-props'
7
7
  import { parseExpanded } from '../compiler/markdown-block'
8
+ import { analyzeScript } from '../compiler/script'
8
9
 
9
10
  // A component names the features an app may leave out with `uses('selectable')`, the `uses` it imports from kayjs-ui's marker module: a call that is true while the prop is there to be written, and that a browser build replaces with `true` or `false` once it has read the props the files of the project write at their call sites. See `specializedSource`.
10
11
  const USES_CALL = /\buses\(\s*'(\w+)'(\s*,\s*true)?\s*\)/y
11
12
  const KAY_IMPORT = /^import\s+(\w+)\s+from\s+(["'])([^"'\n]+\.kay)\2/gm
13
+ // Whether a file imports a `.kay` component, one that may hand its rest props on to a component with features.
14
+ const HAS_KAY_IMPORT = /^import\s+\w+\s+from\s+(["'])[^"'\n]+\.kay\1/m
12
15
  // A component the compiler imports lazily, `KayLazy(key, () => import("./it.kay"))`.
13
16
  const LAZY_IMPORT = /\bimport\(\s*(["'])([^"'\n]+\.kay)\1\s*\)/g
14
17
  const USES_IMPORT = /^import\s*\{[^}]*\buses\b[^}]*\}\s*from\s*(["'])([^"'\n]+)\1/m
@@ -20,6 +23,7 @@ const FENCE = /^---(?:\s|$)/
20
23
  const USES_IF = /^([ \t]*)((?:else )?if) (.*\buses\(.*)$/
21
24
  const IDENTIFIER_CHAR = /[\w$.]/
22
25
  const BACKSLASH = /\\/g
26
+ const COMMENT_LINE = /^[ \t]*\/\/.*$/gm
23
27
 
24
28
  // The suffix an import of a variant carries: the features, joined by dashes (a dot would end the stem of the file name the bundler gives an entry), the call sites of the project use.
25
29
  // `~` and the props the call sites write follow when the project reads them all: the props a spread may carry are not known.
@@ -176,14 +180,18 @@ function replaceCalls(text: string, answer: (feature: string, onByDefault: boole
176
180
  interface Declared {
177
181
  names: string[]
178
182
  defaults: ReadonlySet<string>
183
+ // Whether the file imports a `.kay` component, so its callers' props may reach a feature through it.
184
+ imports?: boolean
179
185
  }
180
186
 
181
187
  const NONE: Declared = { names: [], defaults: new Set() }
182
188
  const featuresOf = new Map<string, { stamp: number, declared: Promise<Declared> }>()
183
189
 
184
190
  function usesIn(source: string, file: string): Declared {
191
+ const imports = HAS_KAY_IMPORT.test(source)
192
+
185
193
  if (file !== '' && !importsMarker(source, file))
186
- return NONE
194
+ return imports ? { ...NONE, imports } : NONE
187
195
 
188
196
  const found = new Set<string>()
189
197
  const defaults = new Set<string>()
@@ -197,7 +205,7 @@ function usesIn(source: string, file: string): Declared {
197
205
  return ''
198
206
  })
199
207
 
200
- return { names: [...found], defaults }
208
+ return { names: [...found], defaults, imports }
201
209
  }
202
210
 
203
211
  // The features a text names: the `uses('x')` of a file importing the marker, none otherwise.
@@ -466,12 +474,18 @@ export function specializedSource(source: string, present: ReadonlySet<string>,
466
474
  // Stands for every prop of a component: it is called with a spread or read as a value, so any may be written.
467
475
  export const ANY = Symbol('any')
468
476
 
477
+ // Stands in a call's props for a spread of the file's own rest props: what the file's callers write reaches the component, minus the props the file takes by name.
478
+ const PASSED = '...'
479
+ // Starts what stands in the props for `name={prop}`, `prop` a prop the file takes by name with no default: `name` is written when the file's callers write `prop`.
480
+ const FORWARDED = '>'
481
+
469
482
  // What stands for a call that leaves a feature on by default (`uses('x', true)`) on: the prop left out or written with anything but a literal `false`.
470
483
  const ON_PREFIX = '+'
471
484
  const PROP_NAME = /^\w+$/
472
485
 
473
486
  // The props the call sites of each `.kay` component a file imports write, by the name the file gives it; `defaults` names, by local, the features on when the prop is left out, which a call keeps on by adding `+name`.
474
- export function propsWritten(source: string, locals: readonly string[], defaults: ReadonlyMap<string, ReadonlySet<string>> = new Map()): Map<string, Set<string> | typeof ANY> {
487
+ // A spread of `rest.name`, the file's own rest props, hands its callers' props on instead of any: `PASSED` stands in the props for it. An attribute written as a prop `rest.forwards` names is written when that prop is.
488
+ export function propsWritten(source: string, locals: readonly string[], defaults: ReadonlyMap<string, ReadonlySet<string>> = new Map(), rest?: Pick<Rest, 'name' | 'forwards'>): Map<string, Set<string> | typeof ANY> {
475
489
  const { file } = parseExpanded(source)
476
490
  const written = new Map<string, Set<string>>()
477
491
  const calls = new Map<string, number>()
@@ -488,10 +502,17 @@ export function propsWritten(source: string, locals: readonly string[], defaults
488
502
  written.set(element.name, props)
489
503
 
490
504
  const off = new Set<string>()
505
+ let passed = false
491
506
 
492
507
  for (const attribute of element.attributes) {
493
508
  if (attribute.kind === 'spread') {
494
- open.delete(element.name)
509
+ if (rest !== undefined && source.slice(attribute.expression.start, attribute.expression.end).trim() === rest.name) {
510
+ props.add(PASSED)
511
+ passed = true
512
+ }
513
+ else {
514
+ open.delete(element.name)
515
+ }
495
516
 
496
517
  continue
497
518
  }
@@ -506,14 +527,18 @@ export function propsWritten(source: string, locals: readonly string[], defaults
506
527
  continue
507
528
  }
508
529
 
509
- props.add(name)
530
+ const value = attribute.kind === 'expression' ? source.slice(attribute.expression.start, attribute.expression.end).trim() : undefined
531
+ const forwarded = value === undefined ? undefined : rest?.forwards.get(value)
532
+
533
+ props.add(forwarded === undefined ? name : `${FORWARDED}${name}=${forwarded}`)
510
534
 
511
- if (attribute.kind === 'expression' && source.slice(attribute.expression.start, attribute.expression.end).trim() === 'false')
535
+ if (value === 'false')
512
536
  off.add(name)
513
537
  }
514
538
 
515
539
  for (const feature of defaults.get(element.name) ?? []) {
516
- if (!off.has(feature))
540
+ // A spread may bring the prop back on, whatever was written before it.
541
+ if (passed || !off.has(feature))
517
542
  props.add(ON_PREFIX + feature)
518
543
  }
519
544
 
@@ -522,15 +547,42 @@ export function propsWritten(source: string, locals: readonly string[], defaults
522
547
  }
523
548
  }
524
549
 
550
+ // A comment line naming the component is no read of it.
551
+ const code = source.replace(COMMENT_LINE, '')
552
+
525
553
  for (const local of locals) {
526
554
  // The import names it once, each call once more.
527
- if ((source.match(new RegExp(`\\b${local}\\b`, 'g'))?.length ?? 0) !== 1 + (calls.get(local) ?? 0))
555
+ if ((code.match(new RegExp(`\\b${local}\\b`, 'g'))?.length ?? 0) !== 1 + (calls.get(local) ?? 0))
528
556
  open.delete(local)
529
557
  }
530
558
 
531
559
  return new Map(locals.map(local => [local, open.has(local) ? written.get(local) ?? new Set<string>() : ANY]))
532
560
  }
533
561
 
562
+ // The name of a file's rest props (none when it has none), the props it takes by name (which its spread of the rest does not hand on) and, of those with no default, the key by the name the file reads it as.
563
+ interface Rest {
564
+ name: string
565
+ taken: Set<string>
566
+ forwards: Map<string, string>
567
+ }
568
+
569
+ function restOf(source: string): Rest | undefined {
570
+ try {
571
+ const { file } = parseExpanded(source)
572
+ const { props } = analyzeScript(file.source, file.script, [], file.module)
573
+
574
+ if (props === undefined)
575
+ return undefined
576
+
577
+ const forwards = new Map(props.bindings.filter(binding => binding.fallback === undefined).map(binding => [file.source.slice(binding.local.start, binding.local.end), binding.key]))
578
+
579
+ return { name: props.rest === undefined ? '' : file.source.slice(props.rest.start, props.rest.end), taken: new Set(props.bindings.map(binding => binding.key)), forwards }
580
+ }
581
+ catch {
582
+ return undefined
583
+ }
584
+ }
585
+
534
586
  interface Candidate {
535
587
  local: string
536
588
  specifier: string
@@ -539,8 +591,8 @@ interface Candidate {
539
591
  defaults: ReadonlySet<string>
540
592
  }
541
593
 
542
- // The `.kay` components a file imports that name features.
543
- async function candidatesOf(code: string, file: string): Promise<Candidate[]> {
594
+ // The `.kay` components a file imports that name features, and with `passing` those importing a component too, whose callers may reach a feature through them.
595
+ async function candidatesOf(code: string, file: string, passing = false): Promise<Candidate[]> {
544
596
  const found: Candidate[] = []
545
597
 
546
598
  for (const [local, specifier] of [...code.matchAll(KAY_IMPORT).map(([, name, , from]) => [name!, from!] as const), ...code.matchAll(LAZY_IMPORT).map(([, , from]) => ['', from!] as const)]) {
@@ -553,9 +605,9 @@ async function candidatesOf(code: string, file: string): Promise<Candidate[]> {
553
605
  continue
554
606
  }
555
607
 
556
- const { names: features, defaults } = await declaredFeatures(path)
608
+ const { names: features, defaults, imports } = await declaredFeatures(path)
557
609
 
558
- if (features.length > 0)
610
+ if (features.length > 0 || (passing && imports === true))
559
611
  found.push({ local, specifier, path, features, defaults })
560
612
  }
561
613
 
@@ -565,6 +617,8 @@ async function candidatesOf(code: string, file: string): Promise<Candidate[]> {
565
617
  // What the `.kay` files of a project write of each component with features, all of them together: a component has one variant, so the chunks of two islands using a Table share it.
566
618
  export class VariantIndex {
567
619
  private readonly union = new Map<string, Set<string> | typeof ANY>()
620
+ // The files handing their rest props on to a component, by its path: what their own callers write reaches it.
621
+ private readonly through = new Map<string, { from: string, taken: ReadonlySet<string>, forwards: [name: string, key: string][] }[]>()
568
622
  private readonly indexed = new Map<string, Promise<void>>()
569
623
  private scan: Promise<void> | undefined
570
624
 
@@ -594,15 +648,16 @@ export class VariantIndex {
594
648
  }
595
649
 
596
650
  private async read(file: string, source: string): Promise<void> {
597
- const candidates = (await candidatesOf(source, file)).filter(candidate => candidate.local !== '')
651
+ const candidates = (await candidatesOf(source, file, true)).filter(candidate => candidate.local !== '')
598
652
 
599
653
  if (candidates.length === 0)
600
654
  return
601
655
 
602
656
  let written: ReturnType<typeof propsWritten>
657
+ const rest = restOf(source)
603
658
 
604
659
  try {
605
- written = propsWritten(source, candidates.map(candidate => candidate.local), new Map(candidates.map(candidate => [candidate.local, candidate.defaults])))
660
+ written = propsWritten(source, candidates.map(candidate => candidate.local), new Map(candidates.map(candidate => [candidate.local, candidate.defaults])), rest)
606
661
  }
607
662
  catch {
608
663
  written = new Map(candidates.map(candidate => [candidate.local, ANY]))
@@ -612,13 +667,62 @@ export class VariantIndex {
612
667
  const props = written.get(local) ?? new Set<string>()
613
668
  const before = this.union.get(path)
614
669
 
670
+ if (props !== ANY && rest !== undefined) {
671
+ const forwards = [...props].filter(name => name.startsWith(FORWARDED)).map(name => name.slice(1).split('=') as [string, string])
672
+
673
+ for (const name of [...props].filter(name => name.startsWith(FORWARDED)))
674
+ props.delete(name)
675
+
676
+ if (props.delete(PASSED) || forwards.length > 0)
677
+ this.through.set(path, [...this.through.get(path) ?? [], { from: realFile(file), taken: rest.taken, forwards }])
678
+ }
679
+
615
680
  this.union.set(path, before === ANY || props === ANY ? ANY : new Set([...before ?? [], ...props]))
616
681
  }
617
682
  }
618
683
 
684
+ // What the call sites of a component write, the ones handing their rest props on counted by what their own callers write.
685
+ private writtenOf(path: string, seen = new Set<string>()): Set<string> | typeof ANY {
686
+ const own = this.union.get(path)
687
+
688
+ if (own === ANY)
689
+ return ANY
690
+
691
+ const links = this.through.get(path)
692
+
693
+ if (links === undefined || seen.has(path))
694
+ return own ?? new Set<string>()
695
+
696
+ const all = new Set(own)
697
+
698
+ seen.add(path)
699
+
700
+ for (const { from, taken, forwards } of links) {
701
+ // A file no scanned call site writes is called from where the scan does not look (a route, a layout, a `.ts` module, a package), so what reaches it is unknown.
702
+ const outer = this.union.has(from) || this.through.has(from) ? this.writtenOf(from, seen) : ANY
703
+
704
+ if (outer === ANY)
705
+ return ANY
706
+
707
+ for (const [name, key] of forwards) {
708
+ if (outer.has(key))
709
+ all.add(name)
710
+ }
711
+
712
+ for (const name of outer) {
713
+ if (!name.startsWith(ON_PREFIX) && !taken.has(name))
714
+ all.add(name)
715
+ }
716
+ }
717
+
718
+ seen.delete(path)
719
+
720
+ return all
721
+ }
722
+
619
723
  // The query of a variant: its features, then the props written.
620
724
  private usedOf(path: string, features: string[], defaults: ReadonlySet<string>): string {
621
- const props = this.union.get(path) ?? new Set<string>()
725
+ const props = this.writtenOf(path)
622
726
 
623
727
  if (props === ANY)
624
728
  return [...features].sort().join('-')
@@ -642,12 +746,12 @@ export class VariantIndex {
642
746
  async variantImports(code: string, file: string, source: string): Promise<string> {
643
747
  const candidates = await candidatesOf(code, file)
644
748
 
645
- if (candidates.length === 0)
646
- return code
647
-
648
749
  await this.scanned()
649
750
  await this.add(file, source)
650
751
 
752
+ if (candidates.length === 0)
753
+ return code
754
+
651
755
  let result = code
652
756
 
653
757
  for (const { specifier, path, features, defaults } of candidates) {
@@ -661,6 +765,16 @@ export class VariantIndex {
661
765
  }
662
766
  }
663
767
 
768
+ // A file by the path its importers resolve it to.
769
+ function realFile(file: string): string {
770
+ try {
771
+ return Bun.resolveSync(file, dirname(file))
772
+ }
773
+ catch {
774
+ return file
775
+ }
776
+ }
777
+
664
778
  // The `.kay` files under a directory, leaving out what a project installs and builds.
665
779
  export function kayFiles(dir: string): string[] {
666
780
  const found: string[] = []
@@ -33,7 +33,7 @@ export interface LoadTimeBrowserRead {
33
33
  diagnostic: Diagnostic
34
34
  }
35
35
 
36
- // A module of the project that touches a browser-only global as it loads and that a server render imports: a page, a layout or a component they render, which is not `--- client`, and the modules they pull in. It throws on the server the first time the page is rendered, as the module is evaluated.
36
+ // A module of the project that touches a browser-only global as it loads and that a server render imports: a page, a layout or a component they render, which is not client-only, and the modules they pull in. It throws on the server the first time the page is rendered, as the module is evaluated.
37
37
  // A read inside a function is left out, as only a call decides whether it runs, and so is one a `typeof` or a `try` guards.
38
38
  // Reported at the read, naming the first component reaching the module. What the server never renders is left out: a component used only with `render="client"`, and an island the build demotes to the browser for a package it imports, asked as the build asks.
39
39
  export async function browserGlobalAtLoad(root: string, components: Map<string, string>, routes: string, cacheDir?: string): Promise<LoadTimeBrowserRead[]> {
@@ -101,7 +101,7 @@ function clientOnlyImports(source: string): Set<string> {
101
101
 
102
102
  visitNodes(file.template, (node) => {
103
103
  if (node.kind === 'element' && node.component) {
104
- const client = node.attributes.some(attribute => attribute.kind === 'static' && ['hydrate', 'render'].includes(source.slice(attribute.name.start, attribute.name.end)) && attribute.text === 'client')
104
+ const client = node.attributes.some(attribute => attribute.kind === 'static' && source.slice(attribute.name.start, attribute.name.end) === 'render' && attribute.text === 'client')
105
105
 
106
106
  uses.set(node.name, (uses.get(node.name) ?? true) && client)
107
107
  }
@@ -9,7 +9,7 @@ type ObjectExpression = NodeOfType<'ObjectExpression'>
9
9
 
10
10
  // The options of `pages()` and `testSite()` that are no config key.
11
11
  const PAGES_OPTIONS = ['root', 'dev', 'prebuilt', 'config']
12
- const TEST_OPTIONS = [...PAGES_OPTIONS, 'outgoing', 'headers', 'use', 'locals', 'mcpKey', 'browser', 'islands', 'styles', 'proxyKey']
12
+ const TEST_OPTIONS = [...PAGES_OPTIONS, 'outgoing', 'headers', 'use', 'locals', 'browser', 'islands', 'styles']
13
13
 
14
14
  const FROM_SERVER = (source: string): boolean => source === 'kay/server' || source === 'kay'
15
15
  const FROM_TEST = (source: string): boolean => source === 'kay/test'
@@ -4,7 +4,6 @@ import type { Fix, Span } from '../compiler/ast'
4
4
  import type { LintLevel, LintName } from '../compiler/lints'
5
5
  import type { I18nConfig } from '../config'
6
6
  import type { RouteMount } from '../server/routes'
7
- import type { OldFormLint } from './handler-events'
8
7
  import type { ShadowFile } from './shadow'
9
8
  import { existsSync, realpathSync } from 'node:fs'
10
9
  import { basename, dirname, relative, resolve, sep } from 'node:path'
@@ -18,9 +17,7 @@ import { WRITABLE } from '../compiler/names'
18
17
  import { parseKay } from '../compiler/parser'
19
18
  import { UNSERVED_MESSAGE } from '../runtime/checks'
20
19
  import { localePrefixes, localeSettings } from '../server/i18n'
21
- import { callResultLint } from './call-result'
22
20
  import { unknownNameHelp } from './export-homes'
23
- import { handlerEventLint } from './handler-events'
24
21
  import { loopIndexFix, positionalKeyFix } from './loop-index-fix'
25
22
  import { sourceSpan } from './shadow'
26
23
  import { lastOverload, richCallHint, templateHint } from './template-hints'
@@ -131,18 +128,6 @@ function blockWithoutParameters(diagnostic: TsgoDiagnostic, source: string, span
131
128
  return `the component calls \`@${name}\` with (${parameters}): write it with them, as \`@${name}(${[...parameters.matchAll(PARAMETER_NAME)].map(match => `${match[1] ?? ''}${match[2]}`).join(', ')})\``
132
129
  }
133
130
 
134
- // What the types say of a callback given a function written for its arguments before 1.105, or of an island's call read as data: the deprecated lint that names it, with its fix.
135
- function oldForm(message: string, source: string, span: Span | undefined): (OldFormLint & { code: LintName }) | undefined {
136
- const handler = handlerEventLint(message, source, span)
137
-
138
- if (handler !== undefined)
139
- return { code: 'deprecated-callback-handler', ...handler }
140
-
141
- const result = callResultLint(message, source, span, true)
142
-
143
- return result && { code: 'deprecated-call-result', ...result }
144
- }
145
-
146
131
  // A diagnostic in a .kay file's shadow TSX, read at the levels its source gives the lints.
147
132
  export function diagnoseShadow(shadow: ShadowFile, reported: TsgoDiagnostic, levelAt: (lint: LintName, offset: number) => LintLevel, messageKeys: readonly string[] = []): Diagnosed | undefined {
148
133
  const span = sourceSpan(shadow, reported.start, reported.end, 'loose')
@@ -164,13 +149,6 @@ export function diagnoseShadow(shadow: ShadowFile, reported: TsgoDiagnostic, lev
164
149
  return level === 'allow' ? undefined : { ...lint, severity: severityOf(level), span, ...offered }
165
150
  }
166
151
 
167
- // A type error that is an old form of before 1.105, with the fix that writes the new one.
168
- const old = oldForm(diagnostic.message, shadow.source, span)
169
- const oldLevel = old === undefined ? 'allow' : levelAt(old.code, offset)
170
-
171
- if (old !== undefined && oldLevel !== 'allow')
172
- return { ...old, severity: severityOf(oldLevel) }
173
-
174
152
  // Unread code is the `unread-name` lint; a name kay generated, which the template reads in a way it does not spell out, is no code of the user's.
175
153
  if (diagnostic.code !== undefined && UNUSED_CODES.has(diagnostic.code)) {
176
154
  const level = shadow.map.isExact(diagnostic.start) ? levelAt('unread-name', offset) : 'allow'
@@ -182,7 +182,7 @@ function environment(patterns: string[], files: string[], api: { mount: string,
182
182
  ' function KayFormError<Target extends string | Action>(target: Target, field?: FieldName<Target>): null',
183
183
  ' function KayProp<Component>(component: Component): <Value>(value: Value & IslandProp<Component, Value>) => Value',
184
184
  ' function KayPlainProp<Component>(component: Component): <Value>(value: Value & PlainIslandProp<Component, Value>) => Value',
185
- ' function KayFunctionProp<Component>(component: Component): (attribute: FunctionProp<Component>) => Record<never, never>',
185
+ ' function KayFunctionProp<Component, Names extends object = Record<string, unknown>>(component: Component, names?: Names): (attribute: FunctionProp<Component, Names>) => Record<never, never>',
186
186
  ' function KayHandsPart<Component>(component: Component): <Name extends string>(name: Name & HandsPart<Component, Name>) => Record<never, never>',
187
187
  ' function KayBound<Component>(component: Component): <Key extends string, Value>(key: Key & BoundProp<Component, Key>, value: Value, write: (value: BoundValue<Component, Key>) => unknown) => Value',
188
188
  ' function KayList<Each extends Iterable<any> | null | undefined | false>(each: Each): Each',
@@ -2,7 +2,7 @@ import { readFileSync } from 'node:fs'
2
2
  import { dirname, resolve } from 'node:path'
3
3
 
4
4
  // The entries an app imports from, in the order a name found in several is attributed: `kay` first, as its values need no import in a component.
5
- const ENTRIES = ['kay', 'kay/server', 'kay/cache', 'kay/i18n', 'kay/words', 'kay/content', 'kay/seo', 'kay/image', 'kay/icons', 'kay/markdown', 'kay/params', 'kay/edit', 'kay/island', 'kay/await', 'kay/html', 'kay/test', 'kay/dev-tool', 'kay/analytics', 'kay/pg-orm', 'kay/mount', 'kay/compiler', 'kay/bun', 'kay/library']
5
+ const ENTRIES = ['kay', 'kay/server', 'kay/cache', 'kay/i18n', 'kay/words', 'kay/content', 'kay/seo', 'kay/image', 'kay/icons', 'kay/markdown', 'kay/params', 'kay/edit', 'kay/island', 'kay/await', 'kay/html', 'kay/test', 'kay/dev-tool', 'kay/analytics', 'kay/pg-orm', 'kay/compiler', 'kay/bun', 'kay/library']
6
6
  const EXPORT_ALL = /^export\s*\*\s*from\s*['"](\.[^'"]+)['"]/gm
7
7
  const UNKNOWN_NAME = /^Cannot find name '([\w$]+)'/
8
8
  const EXTENSIONS = ['', '.ts', '/index.ts']
@@ -7,8 +7,8 @@ import { guardRequirement, requiredBy } from '../server/guard-requirement'
7
7
 
8
8
  const HELP = 'add a `_guard.ts` to its directory or one above it, or, if anyone may reach it, set `guards: false`'
9
9
 
10
- // On a site with `requireGuards`, what the server answers 403 for: each page, layout with actions, endpoint and API module of the app no guard covers that does not set `guards: false`.
11
- // A site that leaves `requireGuards` unset but guards some route of its own is held to it for its routes alone (not layouts or action modules), as its start refuses them; `requireGuards: false` keeps it open.
10
+ // On a site with `guards: { default: 'closed' }`, what the server answers 403 for: each page, layout with actions, endpoint and API module of the app no guard covers that does not set `guards: false`.
11
+ // A site that leaves `guards.default` unset but guards some route of its own is held to it for its routes alone (not layouts or action modules), as its start refuses them; `guards: { default: 'open' }` keeps it open.
12
12
  export async function unguardedRoutes(options: CheckOptions, { routes, endpoints, apiModules }: ServedProject): Promise<CheckDiagnostic[]> {
13
13
  const level = lintLevel('unguarded-route', options.lints)
14
14
 
@@ -50,7 +50,7 @@ export async function unguardedRoutes(options: CheckOptions, { routes, endpoints
50
50
  }
51
51
  }
52
52
 
53
- // Layouts and action modules are not routes: a site that leaves `requireGuards` unset is told of its routes alone.
53
+ // Layouts and action modules are not routes: a site that leaves `guards.default` unset is told of its routes alone.
54
54
  for (const [layout, guarded] of required === 'routes' ? [] : layouts) {
55
55
  const source = guarded ? '' : await Bun.file(layout).text()
56
56
  const actions = guarded ? [] : analyzeServer(source, parseKay(source).server)?.actionNames ?? []
@@ -14,7 +14,6 @@ import { lintLevels } from '../compiler/lints'
14
14
  import { offsetAt, positionAt } from '../compiler/mapping'
15
15
  import { nativeExe } from '../compiler/native-typescript'
16
16
  import { pickConfig } from '../config'
17
- import { moduleCallResult } from './call-result'
18
17
  import { diagnoseShadow, reportsTypeErrors, servedByTheApp, shownOutsideKay, unusedCodesOf } from './diagnose'
19
18
  import { unknownNameHelp } from './export-homes'
20
19
  import { generatedProblem } from './generated'
@@ -69,7 +68,6 @@ export const CHECK_CONFIG = [
69
68
  'seo',
70
69
  'assets',
71
70
  // Reports each route of the app no guard covers, which the server refuses.
72
- 'requireGuards',
73
71
  'guards',
74
72
  // Reports the actions offered as tools that bot protection alone stands before.
75
73
  'mcp',
@@ -89,8 +87,6 @@ export interface CheckOptions extends Omit<Pick<KayConfig, (typeof CHECK_CONFIG)
89
87
  launch?: boolean | undefined
90
88
  // Set by `kay build --static`: a static host reads no `SITE_URL` once built, so a missing site is reported.
91
89
  exported?: boolean | undefined
92
- // The header `proxy.key` names, which the fix of `testSite({ proxyKey })` writes beside the secret.
93
- proxyHeader?: string | undefined
94
90
  }
95
91
 
96
92
  export interface CheckDiagnostic extends Pick<Diagnostic, 'label' | 'related' | 'note' | 'help' | 'severity' | 'fixes'> {
@@ -116,9 +112,8 @@ function helped({ message, help }: CheckDiagnostic): Pick<CheckDiagnostic, 'help
116
112
  export function configCheckOptions(config: LoadedConfig): CheckOptions {
117
113
  const { ops, ...picked } = pickConfig(config, CHECK_CONFIG)
118
114
  const { observe } = ops ?? {}
119
- const proxyHeader = typeof config.proxy === 'object' ? config.proxy.key?.header : undefined
120
115
 
121
- return { ...picked, ...proxyHeader !== undefined && { proxyHeader }, ...config.store?.database !== undefined && { storeDatabase: config.store.database }, ...ops !== undefined && { ops: { health: ops.health, ...observe !== undefined && { observe: { requestIdHeader: observe.requestIdHeader, loadBudget: observe.loadBudget } } } }, ...config.publicEnv !== undefined && { publicEnv: config.publicEnv } }
116
+ return { ...picked, ...config.store?.database !== undefined && { storeDatabase: config.store.database }, ...ops !== undefined && { ops: { health: ops.health, ...observe !== undefined && { observe: { requestIdHeader: observe.requestIdHeader, loadBudget: observe.loadBudget } } } }, ...config.publicEnv !== undefined && { publicEnv: config.publicEnv } }
122
117
  }
123
118
 
124
119
  // Type-checks a project, .kay components included, and reports every error at the line and column the user wrote.
@@ -211,7 +206,7 @@ async function runCheck(root: string, given: CheckOptions, probes?: ProbeMemory)
211
206
 
212
207
  const mapped: CheckDiagnostic = shadow && diagnosed
213
208
  ? { ...diagnostic, file: shadow.file, ...positionAt(shadow.source, diagnosed.span?.start ?? 0), code: diagnosed.code ?? diagnostic.code, severity: diagnosed.severity, message: diagnosed.message, note: diagnosed.note, help: diagnosed.help ?? (shadow.route === true ? helped(diagnostic).help : undefined), ...diagnosed.fixes && { fixes: diagnosed.fixes } }
214
- : { ...diagnostic, ...helped(diagnostic), ...await moduleCallResult(diagnostic, options.lints) }
209
+ : { ...diagnostic, ...helped(diagnostic) }
215
210
  const generated = generatedProblem(root, mapped, types, content)
216
211
 
217
212
  // A guard file imported for two lines of the exports check is reported once.
@@ -31,7 +31,7 @@ export async function movedKeys(root: string, options: CheckOptions, { lint, nee
31
31
  return scan(root, options, lint, needle, ({ file, parsed, report }) => {
32
32
  for (const { ast, base, text } of parsed) {
33
33
  for (const { object, call } of configObjects(file, ast)) {
34
- // The options of a call are moved into `config` by `deprecated-pages-options` first.
34
+ // The options of a call are written in `config`.
35
35
  if (call !== undefined)
36
36
  continue
37
37
 
@@ -17,9 +17,9 @@ import { isPageFile, pageDirs } from '../build/page-dirs'
17
17
  import { mentionsServerOnly } from '../build/server-only'
18
18
  import { importedSignals } from '../build/signals'
19
19
  import { browserRole, onceReadChecks } from '../compiler'
20
- import { RETIRED_LINTS } from '../compiler/deprecated-allow'
21
20
  import { moduleChecks, turnsCaptchaOff } from '../compiler/fence-checks'
22
21
  import { isLaunchLint, isLint, isLintGroup, LEVELS, lintLevel, lintLevels } from '../compiler/lints'
22
+ import { REMOVED_LINTS } from '../compiler/removed-lints'
23
23
  import { CONFIG_FILE } from '../config'
24
24
  import { EXTENSIONS_MARKER, FEEDS_MARKER, PROBLEMS_MARKER, ROUTES_MARKER, USES_MARKER } from '../content/claims'
25
25
  import { projectPaths } from '../project'
@@ -32,7 +32,6 @@ import { dockerfileProblems } from './dockerfile'
32
32
  import { CONTENT_CHECK, contentPropsCheck } from './generated'
33
33
  import { browserModules, islandEdges } from './island-modules'
34
34
  import { componentImporters, islandOnlyComponents, renderedInIslands } from './island-only'
35
- import { linkFlagTests } from './link-flag-tests'
36
35
  import { FILES_MARKER, stampOf } from './loaded'
37
36
 
38
37
  import { configSeoLints } from './seo'
@@ -106,13 +105,13 @@ export function configProblems(root: string, options: CheckOptions, types: Shado
106
105
  // The collections may still be read, which only the feeds and their own problems wait for.
107
106
  export async function projectProblems(root: string, options: CheckOptions, collections: ContentChecks | Promise<ContentChecks>, memory?: ProbeMemory, scanned?: ServedProject): Promise<CheckDiagnostic[]> {
108
107
  return inWalkScope(async () => {
109
- const [content, messages, boot, modules, linkTests] = await Promise.all([collections, checkMessages(root, options, memory), (async () => {
108
+ const [content, messages, boot, modules] = await Promise.all([collections, checkMessages(root, options, memory), (async () => {
110
109
  const read = await collections
111
110
 
112
111
  return bootProblems(resolve(root), options, read.feeds, scanned, read.routes)
113
- })(), moduleLints(root, options), linkFlagTests(root, options.lints)])
112
+ })(), moduleLints(root, options)])
114
113
 
115
- return [...content.problems, ...messages, ...boot, ...modules, ...linkTests, ...uiProblems(root), ...contextModuleProblems(root)]
114
+ return [...content.problems, ...messages, ...boot, ...modules, ...uiProblems(root), ...contextModuleProblems(root)]
116
115
  })
117
116
  }
118
117
 
@@ -297,8 +296,8 @@ function lintConfigProblems(root: string, lints: LintLevels = {}): CheckDiagnost
297
296
  return levelEntries(lints).flatMap(([name, level]) => {
298
297
  const at = { file, ...locate(['lints', name]) }
299
298
 
300
- if (RETIRED_LINTS.has(name))
301
- return []
299
+ if ((REMOVED_LINTS as readonly string[]).includes(name))
300
+ return [{ ...at, severity: 'warning' as const, message: `\`lints\` names \`${name}\`, a lint kay has removed with the form it reported`, help: 'remove the entry: it changes nothing' }]
302
301
 
303
302
  if (!isLint(name) && !isLintGroup(name))
304
303
  return [{ ...at, message: `\`lints\` names \`${name}\`, which is no lint or group`, help: '`kay explain` lists them' }]