@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
@@ -31,6 +31,39 @@ const OLD_SIZE = /^\d+(?:\.\d+)?[kmg]$/i
31
31
  const KAY = /^kay(?:\/|$)/
32
32
  const NEEDLE = /\.(?:String|Secret|Number|Numeric|Integer|Boolean|BooleanString|Date|File|Files|Literal|Union|Array|Object|UnionEnum|UnionKeys|Public|Optional)\(|\.(?:file|files)\(/
33
33
 
34
+ interface Mapped {
35
+ record: Node
36
+ literal: Node
37
+ }
38
+
39
+ // `Object.keys(R).map(key => s.Literal(key))`, a cast on the key allowed: the record whose keys are the literals.
40
+ function mappedKeys(node: Node, receivers: Set<string>): Mapped | undefined {
41
+ if (node.type !== 'CallExpression' || node.callee.type !== 'MemberExpression' || node.callee.computed || node.callee.property.type !== 'Identifier' || node.callee.property.name !== 'map' || node.arguments.length !== 1)
42
+ return undefined
43
+
44
+ const keys = node.callee.object
45
+ const [callback] = node.arguments
46
+
47
+ if (keys.type !== 'CallExpression' || keys.arguments.length !== 1 || keys.callee.type !== 'MemberExpression' || keys.callee.computed || keys.callee.object.type !== 'Identifier' || keys.callee.object.name !== 'Object' || keys.callee.property.type !== 'Identifier' || keys.callee.property.name !== 'keys')
48
+ return undefined
49
+
50
+ const [param] = callback?.type === 'ArrowFunctionExpression' ? callback.params : []
51
+
52
+ if (callback?.type !== 'ArrowFunctionExpression' || callback.params.length !== 1 || param?.type !== 'Identifier')
53
+ return undefined
54
+
55
+ const literal = builderCall(callback.body, receivers)
56
+ let inner = literal?.node.arguments[0]
57
+
58
+ while (inner && (inner.type === 'TSAsExpression' || inner.type === 'TSNonNullExpression'))
59
+ inner = inner.expression
60
+
61
+ if (literal?.name !== 'Literal' || literal.node.arguments.length !== 1 || inner?.type !== 'Identifier' || inner.name !== param.name)
62
+ return undefined
63
+
64
+ return { record: keys.arguments[0]!, literal: callback.body }
65
+ }
66
+
34
67
  interface Call {
35
68
  node: Node & { type: 'CallExpression' }
36
69
  name: string
@@ -79,10 +112,44 @@ function renames(call: Call, base: number): Edit[] {
79
112
  return edits
80
113
  }
81
114
 
82
- // Where `optional: true` goes in a builder's call: into its options object, or after its last argument. Undefined for options that are not an object literal, which the fix leaves to the app.
83
- function optionalEdit(call: Call, base: number): Edit | undefined {
115
+ // The options the lowercase builder needs to read as the PascalCase one did: a list takes `max` where it had none (the lowercase one stops at 1,000 items, except a list of files), and an object `extra: 'strip'` (the lowercase one refuses a key its shape lacks). Undefined when the options are not an object literal of known keys, which the fix cannot add to.
116
+ function keptOptions(call: Call): string[] | undefined {
117
+ const index = BUILDERS[call.name]!.options
118
+ const options = call.node.arguments[index]
119
+ const keys = new Set<string>()
120
+
121
+ if (options !== undefined && options.type !== 'ObjectExpression')
122
+ return call.name === 'Array' || call.name === 'Object' ? undefined : []
123
+
124
+ for (const entry of options?.properties ?? []) {
125
+ const name = keyName(entry)
126
+
127
+ if (name === undefined)
128
+ return call.name === 'Array' || call.name === 'Object' ? undefined : []
129
+
130
+ keys.add(name)
131
+ }
132
+
133
+ if (call.name === 'Object')
134
+ return keys.has('extra') ? [] : ['extra: \'strip\'']
135
+
136
+ if (call.name !== 'Array')
137
+ return []
138
+
139
+ const [item] = call.node.arguments
140
+
141
+ return keys.has('max') || keys.has('maxItems') || (item && FILES.has(builderCallName(item))) ? [] : ['max: Number.MAX_SAFE_INTEGER']
142
+ }
143
+
144
+ function builderCallName(node: Node): string {
145
+ return node.type === 'CallExpression' && node.callee.type === 'MemberExpression' && node.callee.property.type === 'Identifier' ? node.callee.property.name : ''
146
+ }
147
+
148
+ // Where options go in a builder's call: into its options object, or after its last argument. Undefined for options that are not an object literal, which the fix leaves to the app.
149
+ function addOptions(call: Call, base: number, added: string[]): Edit | undefined {
84
150
  const index = BUILDERS[call.name]!.options
85
151
  const options = call.node.arguments[index]
152
+ const text = added.join(', ')
86
153
 
87
154
  if (options === undefined) {
88
155
  if (call.node.arguments.length < index)
@@ -90,7 +157,7 @@ function optionalEdit(call: Call, base: number): Edit | undefined {
90
157
 
91
158
  const close = base + call.node.end - 1
92
159
 
93
- return { start: close, end: close, text: call.node.arguments.length === 0 ? '{ optional: true }' : ', { optional: true }' }
160
+ return { start: close, end: close, text: call.node.arguments.length === 0 ? `{ ${text} }` : `, { ${text} }` }
94
161
  }
95
162
 
96
163
  if (options.type !== 'ObjectExpression')
@@ -98,7 +165,7 @@ function optionalEdit(call: Call, base: number): Edit | undefined {
98
165
 
99
166
  const open = base + options.start
100
167
 
101
- return { start: open, end: open + 1, text: options.properties.length === 0 ? '{ optional: true ' : '{ optional: true,' }
168
+ return { start: open, end: open + 1, text: options.properties.length === 0 ? `{ ${text} ` : `{ ${text},` }
102
169
  }
103
170
 
104
171
  type Program = Parameters<typeof importsOf>[0]
@@ -146,8 +213,26 @@ function dropUnreadImport(ast: Program, receivers: Set<string>, dropped: number,
146
213
  }
147
214
  }
148
215
 
216
+ // `defineEnv(s.Object({ ... }))`: an env reads only the names its schema declares, so the record changes nothing. True when it reported one.
217
+ function envRecord(node: Node, records: Set<string>, receivers: Set<string>, base: number, taken: Set<Node>, report: Report): boolean {
218
+ if (node.type !== 'CallExpression' || node.callee.type !== 'Identifier' || !records.has(node.callee.name))
219
+ return false
220
+
221
+ const [schema] = node.arguments
222
+ const inner = schema === undefined ? undefined : builderCall(schema, receivers)
223
+ const shape = inner?.node.arguments[0]
224
+
225
+ if (!schema || inner?.name !== 'Object' || inner.node.arguments.length !== 1 || shape?.type !== 'ObjectExpression')
226
+ return false
227
+
228
+ taken.add(schema)
229
+ report(base + schema.start, base + schema.end, 'a plain record of fields is the schema of a defineEnv since 1.106, `s.Object` being the PascalCase builder it replaces; the old form works until 2.0', 'write the record of fields', [{ start: base + schema.start, end: base + shape.start, text: '' }, { start: base + shape.end, end: base + schema.end, text: '' }])
230
+
231
+ return true
232
+ }
233
+
149
234
  // The PascalCase builders of `s`, which kay 1.106 replaces with its own lowercase ones, and the `'2m'` sizes of a file field, which are `'2mb'` as every size is.
150
- // Found on the `s` a file imports from `kay`, in the TypeScript files and the fences of `.kay` files. `s.Optional(x)` of one of these builders is `optional: true` in its options; an `s.Object({ ... })` that is the schema of an `action` or a `defineEnv` is the record alone.
235
+ // Found on the `s` a file imports from `kay`, in the TypeScript files and the fences of `.kay` files. `s.Optional(x)` of one of these builders is `optional: true` in its options; an `s.Array` takes `max: Number.MAX_SAFE_INTEGER` and an `s.Object` `extra: 'strip'`, which keeps what they did.
151
236
  export async function schemaBuilders(root: string, options: CheckOptions): Promise<CheckDiagnostic[]> {
152
237
  if (lintLevel('deprecated-schema-builders', options.lints) === 'allow')
153
238
  return []
@@ -155,33 +240,22 @@ export async function schemaBuilders(root: string, options: CheckOptions): Promi
155
240
  return scan(root, options, 'deprecated-schema-builders', NEEDLE, ({ parsed, report }) => {
156
241
  for (const { ast, base, text } of parsed) {
157
242
  const receivers = importsOf(ast, source => KAY.test(source), 's').locals
158
- const records = new Set([...importsOf(ast, source => KAY.test(source), 'action').locals, ...importsOf(ast, source => KAY.test(source), 'defineEnv').locals])
243
+ const records = importsOf(ast, source => KAY.test(source), 'defineEnv').locals
159
244
 
160
245
  if (receivers.size === 0)
161
246
  continue
162
247
 
163
- // What an `s.Optional(...)` or a record has taken over, so the call inside is not reported on its own.
248
+ // What an `s.Optional(...)` has taken over, so the call inside is not reported on its own.
164
249
  const taken = new Set<Node>()
165
- // The uses of `s` a fix takes away: an `s.Optional(` and the `s.Object(` of a record.
250
+ // The uses of `s` a fix takes away: an `s.Object(` of an env record.
166
251
  let dropped = 0
167
252
 
168
253
  walk(ast, (node) => {
169
254
  const call = builderCall(node, receivers)
170
255
 
171
256
  if (call === undefined) {
172
- // `action(s.Object({ ... }), ...)`
173
- if (node.type === 'CallExpression' && node.callee.type === 'Identifier' && records.has(node.callee.name)) {
174
- const [schema] = node.arguments
175
- const inner = schema === undefined ? undefined : builderCall(schema, receivers)
176
-
177
- if (schema && inner?.name === 'Object' && inner.node.arguments.length === 1 && inner.node.arguments[0]!.type === 'ObjectExpression') {
178
- const shape = inner.node.arguments[0]
179
-
180
- taken.add(schema)
181
- dropped++
182
- report(base + schema.start, base + schema.end, 'a plain record of fields is the object schema of an action or a defineEnv since 1.106, `s.Object` being the PascalCase builder it replaces; the old form works until 2.0', 'write the record of fields', [{ start: base + schema.start, end: base + shape.start, text: '' }, { start: base + shape.end, end: base + schema.end, text: '' }])
183
- }
184
- }
257
+ if (envRecord(node, records, receivers, base, taken, report))
258
+ dropped++
185
259
 
186
260
  return
187
261
  }
@@ -190,7 +264,8 @@ export async function schemaBuilders(root: string, options: CheckOptions): Promi
190
264
  const [inner, ...others] = call.node.arguments
191
265
  const wrapped = inner === undefined ? undefined : builderCall(inner, receivers)
192
266
  const known = wrapped && wrapped.name !== 'Public' && BUILDERS[wrapped.name] && !taken.has(inner!)
193
- const edit = known ? optionalEdit(wrapped, base) : undefined
267
+ const kept = known ? keptOptions(wrapped) : undefined
268
+ const edit = known && kept ? addOptions(wrapped, base, ['optional: true', ...kept]) : undefined
194
269
 
195
270
  // Anything but a builder of `s`, such as the `imageField()` of kay/content, has no `optional` option to write yet.
196
271
  if (!known)
@@ -203,7 +278,6 @@ export async function schemaBuilders(root: string, options: CheckOptions): Promi
203
278
  }
204
279
 
205
280
  taken.add(inner!)
206
- dropped++
207
281
  report(base + node.start, base + node.end, '`s.Optional(field)` is `optional: true` in the options of the field since 1.106, the same option on every builder; the old form works until 2.0', 'write `optional: true` in the field\'s options', [
208
282
  { start: base + node.start, end: base + inner!.start, text: '' },
209
283
  ...renames(wrapped, base),
@@ -216,13 +290,38 @@ export async function schemaBuilders(root: string, options: CheckOptions): Promi
216
290
 
217
291
  const builder = BUILDERS[call.name]
218
292
 
293
+ // A mapped array is no tuple, so `s.union(...)` of one is a type error: `s.enum(record)` when it is the keys of a record, else the app writes it.
294
+ if (call.name === 'Union' && !taken.has(node) && call.node.arguments[0]?.type !== 'ArrayExpression') {
295
+ const mapped = call.node.arguments.length === 1 ? mappedKeys(call.node.arguments[0]!, receivers) : undefined
296
+ const message = '`s.Union` is `s.union` since 1.106, and `s.union` takes its schemas written out as a list, so an array built at run time is a type error'
297
+ const receiver = (call.node.callee as { object: { name: string } }).object.name
298
+
299
+ if (mapped) {
300
+ taken.add(mapped.literal)
301
+ report(base + node.start, base + node.end, `${message}; \`s.enum(record)\` takes the keys of a record`, 'write `s.enum` with the record', [
302
+ { start: base + node.start, end: base + mapped.record.start, text: `${receiver}.enum(` },
303
+ { start: base + mapped.record.end, end: base + node.end, text: ')' },
304
+ ])
305
+ }
306
+ else {
307
+ report(base + node.start, base + node.end, `${message}; write the schemas out as a list, or \`s.enum\` for the keys of a record`, 'write the schemas as a list, or `s.enum`', null)
308
+ }
309
+
310
+ return
311
+ }
312
+
219
313
  if (builder && !taken.has(node)) {
220
- const object = call.name === 'Object' ? 'unknown keys are refused by `s.object` where kay reads the schema itself, where `s.Object` let them by; write `extra: \'strip\'` to keep the old way' : ''
314
+ const kept = keptOptions(call)
315
+ const edit = kept && kept.length > 0 ? addOptions(call, base, kept) : undefined
316
+ const object = call.name === 'Object' ? 'unknown keys are refused by `s.object` where kay reads the schema itself, where `s.Object` let them by, so the fix writes `extra: \'strip\'` to keep the old way' : ''
221
317
  const message = call.name === 'UnionKeys' || call.name === 'UnionEnum'
222
318
  ? '`s.enum()` takes the values, or a record whose keys are the values, since 1.106, in place of `s.UnionEnum` and `s.UnionKeys`; the old forms work until 2.0'
223
- : `\`s.${call.name}\` is \`s.${builder.name}\` since 1.106, kay's own lowercase builders with short options (\`min\`, \`max\`, \`optional\`) replacing the PascalCase ones of TypeBox${object ? `; ${object}` : ''}; the old form works until 2.0`
319
+ : `\`s.${call.name}\` is \`s.${builder.name}\` since 1.106, kay's own lowercase builders with short options (\`min\`, \`max\`, \`optional\`) replacing the PascalCase ones of TypeBox${object ? `; ${object}` : ''}; the old form works until 2.0${call.name === 'Array' ? '; `s.list` is at most 1,000 items where `s.Array` had no limit, so the fix writes `max: Number.MAX_SAFE_INTEGER`' : ''}`
320
+
321
+ // Without the option that keeps the old behaviour the rename would change it, so the fix is left to the app.
322
+ const keeps = kept !== undefined && (kept.length === 0 || edit !== undefined)
224
323
 
225
- report(base + node.start, base + node.end, message, `write \`s.${builder.name}\``, renames(call, base))
324
+ report(base + node.start, base + node.end, message, `write \`s.${builder.name}\``, keeps ? [...renames(call, base), ...edit ? [edit] : []] : null)
226
325
  }
227
326
  })
228
327
 
@@ -34,68 +34,27 @@ import { extensionEditor, patternShapes, routeMounts, scanEndpoints, scanRoutes,
34
34
  import { readRuntimeRedirects } from '../server/runtime-redirects'
35
35
 
36
36
  import { actionOptions } from './action-options'
37
- import { actionReaders } from './action-readers'
38
- import { actionType } from './action-type'
39
- import { aiLanguage } from './ai-language'
40
- import { appHooks } from './app-hooks'
41
- import { authMethods } from './auth-methods'
42
- import { authRateLimits } from './auth-rate-limits'
43
- import { clientKeys } from './client-keys'
44
- import { cmsOptions } from './cms-options'
45
- import { configGroups } from './config-groups'
46
- import { configSwitches } from './config-switches'
47
- import { contextImport } from './context-import'
48
37
 
49
38
  import { ownFile } from './diagnose'
50
39
  import { endpointExports } from './endpoint-exports'
51
-
52
- import { envFiles } from './env-files'
53
40
  import { ASSET_TYPES, environmentTypes, kayPaths, packageTypes } from './env-types'
54
-
55
- import { formatDurationNumbers } from './format-duration'
56
41
  import { CONTENT_CHECK, EXPORTS_CHECK, exportsCheck, SETTINGS_CHECK, settingsCheck } from './generated'
57
-
58
- import { guardOptions } from './guard-options'
59
42
  import { unguardedRoutes, unguardedTools } from './guards'
60
- import { hookContext } from './hook-context'
61
- import { hookNames } from './hook-names'
62
- import { i18nKeys } from './i18n-keys'
63
-
64
- import { imagesKeys } from './images-keys'
65
43
  import { islandOnlyComponents } from './island-only'
66
-
67
- import { diskFilesCalls, jobHandlers, jobOptions, scheduleCalls } from './job-shapes'
68
-
69
44
  import { largePublicImages } from './large-images'
70
- import { liveApi } from './live-api'
71
-
72
- import { mailApi } from './mail-api'
73
45
  import { mcpRoutes } from './mcp-routes'
74
- import { islandEvents, listenTarget, movedImports, navigateQuery, navigationHooks, persistedCall, persistedQuery } from './one-state-api'
75
46
  import { unreadOpenSettings } from './open-settings'
76
- import { pagesOptions } from './pages-options'
77
47
  import { publicEnvOutsideSrc } from './public-env-outside-src'
78
- import { rateEnforce } from './rate-enforce'
79
- import { refusalCalls } from './refusal-calls'
80
48
  import { removedUiTokens } from './removed-ui-tokens'
81
- import { retiredLintLevels } from './retired-lints'
82
- import { routeKeys } from './route-keys'
83
49
  import { routeShadow, routeShadowPath } from './route-shadow'
84
50
  import { schemaBuilders } from './schema-builders'
85
51
  import { schemaJson } from './schema-json'
86
- import { secretKeys } from './secret-keys'
87
52
  import { compileShadow, guardTypes, layoutQueries, matcherSource, outerSlots, pageRoute, serializeShadowSettings, SHADOW_SETTINGS, shadowOptionsFor, shadowPath } from './shadow'
88
- import { socketFrames } from './socket-frames'
89
53
  import { untypedSockets } from './socket-routes'
90
- import { sourceReaders } from './source-readers'
91
54
  import { unusedStatusPages } from './status-pages'
92
- import { storeMs } from './store-ms'
93
- import { storeNames } from './store-names'
94
- import { testHelpers } from './test-helpers'
95
55
  import { textSizeColour } from './text-size-colour'
96
56
  import { unknownToolLabels } from './tool-labels'
97
57
  import { typingOptions } from './tsgo'
98
- import { ttlNames } from './ttl-names'
99
58
 
100
59
  import { uiTypes } from './ui-types'
101
60
  import { unmountedJobs } from './unmounted-jobs'
@@ -194,55 +153,10 @@ const PROJECT_CHECKS: ((input: ProjectCheckInput) => CheckDiagnostic[] | Promise
194
153
  async ({ root, options }) => unknownToolLabels(root, options),
195
154
  async ({ root, options }) => publicEnvOutsideSrc(root, options),
196
155
  ({ root, options }) => unmountedJobs(root, options),
197
- async ({ root, options }) => sourceReaders(root, options),
198
- async ({ root, options }) => actionReaders(root, options),
199
- async ({ root, options }) => liveApi(root, options),
200
- async ({ root, options }) => actionType(root, options),
201
- async ({ root, options }) => socketFrames(root, options),
202
156
  async ({ root, options, served }) => unusedStatusPages(root, options, served),
203
-
204
- async ({ root, options }) => persistedCall(root, options),
205
- async ({ root, options }) => persistedQuery(root, options),
206
- async ({ root, options }) => navigateQuery(root, options),
207
- async ({ root, options }) => navigationHooks(root, options),
208
- async ({ root, options }) => islandEvents(root, options),
209
- async ({ root, options }) => listenTarget(root, options),
210
- async ({ root, options }) => movedImports(root, options),
211
-
212
157
  async ({ root, options }) => schemaBuilders(root, options),
213
158
  async ({ root, options }) => schemaJson(root, options),
214
159
  async ({ root, options }) => actionOptions(root, options),
215
- async ({ root, options }) => aiLanguage(root, options),
216
- async ({ root, options }) => hookNames(root, options),
217
- async ({ root, options }) => mailApi(root, options),
218
- async ({ root, options }) => testHelpers(root, options),
219
- async ({ root, options }) => cmsOptions(root, options),
220
- async ({ root, options }) => jobHandlers(root, options),
221
- async ({ root, options }) => scheduleCalls(root, options),
222
- async ({ root, options }) => jobOptions(root, options),
223
- async ({ root, options }) => diskFilesCalls(root, options),
224
- async ({ root, options }) => storeNames(root, options),
225
- async ({ root, options }) => formatDurationNumbers(root, options),
226
- async ({ root, options }) => guardOptions(root, options),
227
- async ({ root, options }) => configSwitches(root, options),
228
- async ({ root, options }) => imagesKeys(root, options),
229
- async ({ root, options }) => clientKeys(root, options),
230
- async ({ root, options }) => retiredLintLevels(root, options),
231
- async ({ root, options }) => configGroups(root, options),
232
- async ({ root, options }) => i18nKeys(root, options),
233
- async ({ root, options }) => secretKeys(root, options),
234
- async ({ root, options }) => routeKeys(root, options),
235
- async ({ root, options }) => appHooks(root, options),
236
- async ({ root, options }) => hookContext(root, options),
237
- async ({ root, options }) => pagesOptions(root, options),
238
- async ({ root, options }) => ttlNames(root, options),
239
- async ({ root, options }) => storeMs(root, options),
240
- async ({ root, options }) => rateEnforce(root, options),
241
- async ({ root, options }) => refusalCalls(root, options),
242
- async ({ root, options }) => authRateLimits(root, options),
243
- async ({ root, options }) => authMethods(root, options),
244
- async ({ root, options }) => envFiles(root, options),
245
- async ({ root, options }) => contextImport(root, options),
246
160
  ]
247
161
 
248
162
  async function writeShadows(projectRoot: string, options: CheckOptions): Promise<ShadowTypes> {
@@ -403,10 +403,10 @@ async function declareRawReads(root: string, problems: CheckDiagnostic[], format
403
403
  return problems.filter(problem => !declared.names.has(UNDECLARED_READ.exec(problem.message)?.[1] ?? ''))
404
404
  }
405
405
 
406
- // What `envFiles` in kay.config.ts has compared: the declared variables against the compose and example files it names, else against the project's production compose files and `.env.example`; `env: false` compares nothing.
406
+ // What `envFiles` in kay.config.ts has compared: the declared variables against the compose and example files it names, else against the project's production compose files and `.env.example`; `envFiles: false` compares nothing.
407
407
  async function envProblems(root: string, config: KayConfig, scope: string[]): Promise<CheckDiagnostic[]> {
408
408
  const { compareEnv, defaultEnvFiles } = await import('./env-compare')
409
- const setting = config.envFiles ?? config.env
409
+ const setting = config.envFiles
410
410
  const files = setting === false ? undefined : bagOf(setting) ?? await defaultEnvFiles(root)
411
411
 
412
412
  if (files === undefined)
@@ -2,8 +2,10 @@ import type { EnvVariable } from '../server/env'
2
2
  import type { EnvSchemaRecord } from '../server/env-state'
3
3
  import type { Command } from './command'
4
4
  import type { EnvFiles } from './env-compare'
5
+ import { existsSync } from 'node:fs'
5
6
  import { readFile, writeFile } from 'node:fs/promises'
6
- import { join, relative, resolve } from 'node:path'
7
+ import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path'
8
+ import { CONFIG_FILE } from '../config'
7
9
  import { loadConfigWithin } from '../config-loader'
8
10
  import { bagOf } from '../config-switch'
9
11
  import { projectPaths } from '../project'
@@ -110,11 +112,26 @@ export const env: Command = {
110
112
  // The files kay.config.ts names, else the project's own; none when `envFiles` is `false`.
111
113
  async function configuredEnvFiles(root: string): Promise<EnvFiles | undefined> {
112
114
  const config = await loadConfigWithin(root)
113
- const env = config.envFiles ?? config.env
115
+ const env = config.envFiles
114
116
 
115
117
  return env === false ? undefined : bagOf(env) ?? await defaultEnvFiles(root)
116
118
  }
117
119
 
120
+ // Whether `file` is under `root` and not under a project of its own nested inside it.
121
+ function ownedBy(root: string, file: string): boolean {
122
+ const path = relative(root, file)
123
+
124
+ if (path === '..' || path.startsWith(`..${sep}`) || isAbsolute(path))
125
+ return false
126
+
127
+ for (let dir = dirname(file); dir !== root && dir.length > root.length; dir = dirname(dir)) {
128
+ if (existsSync(join(dir, CONFIG_FILE)))
129
+ return false
130
+ }
131
+
132
+ return true
133
+ }
134
+
118
135
  // The path of an extension's module relative to the root, none when it does not resolve, which the build reports.
119
136
  function resolvedUnder(root: string, path: string): string[] {
120
137
  try {
@@ -126,8 +143,10 @@ function resolvedUnder(root: string, path: string): string[] {
126
143
  }
127
144
 
128
145
  export async function listEnv(root: string): Promise<{ variables: Listed[], unread: { file: string, error: string }[] }> {
146
+ const recorded = listingEnv()
147
+ // A call with no file to place it is this project's only when made while it loads.
148
+ const mark = recorded.length
129
149
  const config = await loadConfigWithin(root)
130
- const declared = listingEnv()
131
150
  const shown = (file: string) => relative(root, file)
132
151
  const unread: { file: string, error: string }[] = []
133
152
  // The server entry listens as it is imported, so its own schema is left out.
@@ -154,6 +173,9 @@ export async function listEnv(root: string): Promise<{ variables: Listed[], unre
154
173
  }
155
174
  }
156
175
 
176
+ // The calls of this project only, each module's last: a module the config imported and one read again by an earlier listing of this process are counted once.
177
+ const declared = [...new Map(recorded.filter(({ file }, index) => file === undefined ? index >= mark : ownedBy(root, file)).map(call => [`${call.file}:${Object.keys(call.schema.properties).join()}`, call])).values()]
178
+
157
179
  // A library built at import time declares its own variables for the app, which says more than the extension's list, so the list adds only the rest.
158
180
  const declaredNames = new Set(declared.flatMap(({ schema }) => Object.keys(schema.properties)))
159
181
  const variables: Listed[] = [
@@ -6,7 +6,8 @@ import { dirname, join } from 'node:path'
6
6
  import process from 'node:process'
7
7
  import { engines } from '../../package.json'
8
8
  import { renameProjectFiles } from '../check/renamed-packages'
9
- import { DEPRECATION_MINORS, minorAfter, minorOf, UPGRADE_FROM } from '../compiler/lints'
9
+ import { DEPRECATION_MINORS, UPGRADE_FROM } from '../compiler/lints'
10
+ import { minorAfter, minorOf } from '../compiler/minor'
10
11
  import { isKayPackage, RENAMED_IN, renamePackages } from '../package-names'
11
12
  import { done, formatOption, printDocument, printFailure, projectRoot } from './command'
12
13
  import { majorWarning } from './upgrade-majors'
@@ -1,5 +1,6 @@
1
1
  import type { Diagnostic } from './ast'
2
2
  import { positionAt } from './mapping'
3
+ import { REMOVED_LINTS } from './removed-lints'
3
4
 
4
5
  // What `lints.comments` in kay.config.ts asks of a `// kay-allow` comment: a comment that fails one of these allows nothing and is reported.
5
6
  export interface AllowRules {
@@ -14,6 +15,7 @@ export interface AllowRules {
14
15
  // A lint's name starts with a letter, so the `--` of a reason is never read as one: `// kay-allow a, b -- why`.
15
16
  const ALLOW_COMMENT = /\/\/[ \t]*(kay-allow(?:-file)?)[ \t]+(\w[\w-]*(?:[ \t]*,[ \t]*\w[\w-]*)*)([^\n]*)/g
16
17
  const LINT_NAME = /[\w-]+/g
18
+ const BLANK_END = /[ \t]*$/
17
19
  const REASON = /^[ \t]*--[ \t]*\S/
18
20
 
19
21
  export interface AllowComment {
@@ -22,8 +24,9 @@ export interface AllowComment {
22
24
  file: boolean
23
25
  // The line it allows: its own when it ends a line of code, the next when it is alone on its line; unused for a file comment.
24
26
  line: number
25
- // The offset of the comment's `//`.
27
+ // The offset of the comment's `//`, and of the end of what it holds.
26
28
  start: number
29
+ end: number
27
30
  // Whether a reason follows the names.
28
31
  reasoned: boolean
29
32
  }
@@ -35,7 +38,40 @@ export function allowComments(source: string): AllowComment[] {
35
38
  const names = Array.from(comment[2]!.matchAll(LINT_NAME), name => ({ name: name[0], start: listStart + name.index }))
36
39
 
37
40
  // A comment alone on its line allows the next one; one ending a line of code allows that line.
38
- return { names, file: comment[1] === 'kay-allow-file', line: source.slice(comment.index - column + 1, comment.index).trim() === '' ? line + 1 : line, start: comment.index, reasoned: REASON.test(comment[3]!) }
41
+ return { names, file: comment[1] === 'kay-allow-file', line: source.slice(comment.index - column + 1, comment.index).trim() === '' ? line + 1 : line, start: comment.index, end: comment.index + comment[0].length, reasoned: REASON.test(comment[3]!) }
42
+ })
43
+ }
44
+
45
+ // The names a comment holds that `known` does not know: a lint kay removed is a warning with a fix that drops the name, or the comment (its line when it stands alone) when it was the only one left, and any other name is the error `unknown-lint`.
46
+ export function unknownNames(comment: AllowComment, source: string, known: (name: string) => boolean, help: string): Diagnostic[] {
47
+ const unknown = comment.names.filter(({ name }) => !known(name))
48
+ const removed = new Set<string>(REMOVED_LINTS)
49
+ const lastKept = comment.names.findLastIndex(({ name }) => !removed.has(name))
50
+ const lineStart = source.lastIndexOf('\n', comment.start - 1) + 1
51
+ const whole = source.slice(lineStart, comment.start).trim() === ''
52
+ const after = comment.end + (source.startsWith('\r\n', comment.end) ? 2 : Number(source[comment.end] === '\n'))
53
+ const before = comment.start - (BLANK_END.exec(source.slice(lineStart, comment.start))?.[0].length ?? 0)
54
+ const last = comment.names.at(-1)!
55
+
56
+ return unknown.map(({ name, start }): Diagnostic => {
57
+ const end = start + name.length
58
+
59
+ if (!removed.has(name))
60
+ return { start, end, code: 'unknown-lint', message: `Unknown lint \`${name}\``, help, checkOnly: true }
61
+
62
+ const position = comment.names.findIndex(other => other.start === start)
63
+ const diagnostic: Diagnostic = { start, end, code: 'unknown-lint', severity: 'warning', message: `\`${name}\` is a lint kay has removed`, help: 'remove it from the comment: it allows nothing', checkOnly: true }
64
+
65
+ // The removed names after the last live one go in one edit, on the first of them, so no two edits overlap; the comment itself goes when no name is live.
66
+ if (position > lastKept && position !== lastKept + 1)
67
+ return diagnostic
68
+
69
+ const kept = comment.names[lastKept]
70
+ const dropped = whole ? { start: lineStart, end: after } : { start: before, end: comment.end }
71
+ const tail = kept ? { start: kept.start + kept.name.length, end: last.start + last.name.length } : dropped
72
+ const edit = position > lastKept ? tail : { start, end: comment.names[position + 1]!.start }
73
+
74
+ return { ...diagnostic, fixes: [{ title: kept || position < lastKept ? `remove \`${name}\`` : 'remove the comment', safe: true, edits: [{ ...edit, text: '' }] }] }
39
75
  })
40
76
  }
41
77
 
@@ -3,7 +3,6 @@ import type { FieldContent, FormInfo } from './form-info'
3
3
  import type { IslandDeclaration } from './island-declaration'
4
4
  import { actionOf, componentAction } from './form-action'
5
5
  import { formTargets, initialHelpers } from './form-info'
6
- import { oldPartsClass } from './old-parts'
7
6
  import { childBlocks, visitNodes, walkNodes } from './template-walk'
8
7
 
9
8
  export { actionOf, componentAction } from './form-action'
@@ -230,10 +229,9 @@ export function sectionOf(element: ElementNode, source: string): Extract<Attribu
230
229
  return attribute?.kind === 'boolean' || attribute?.kind === 'expression' ? attribute : undefined
231
230
  }
232
231
 
233
- // `Card(server)` renders per request inside a prerendered page, `Card(server defer)` once the browser fetches it on approach (`server="defer"` before 1.105).
232
+ // `Card(server)` renders per request inside a prerendered page, `Card(server defer)` once the browser fetches it on approach.
234
233
  export const SERVER_ISLAND_ATTRIBUTE = 'server'
235
234
  export const SERVER_ISLAND_DEFER = 'defer'
236
- export const SERVER_ISLAND_MODES = new Set(['defer'])
237
235
  // Beside `defer`, the text of a link to the page with the island in place, for a browser without JavaScript.
238
236
  export const SERVER_ISLAND_NOSCRIPT = 'noscript'
239
237
  // The block under a deferred server island call, or at the root of the component, shown once the island failed for good.
@@ -243,7 +241,7 @@ export const SERVER_IN_ISLAND = '`server` has no effect inside an island'
243
241
 
244
242
  export interface ServerIslandMark {
245
243
  attribute: NamedAttribute
246
- // Undefined for a value no mode answers to.
244
+ // Undefined for a value, which no mode answers to.
247
245
  mode: 'inline' | 'defer' | undefined
248
246
  noscript: NamedAttribute | undefined
249
247
  // The bare `defer` written beside `server`, the word of `server defer`, which is no prop either.
@@ -263,8 +261,7 @@ export function serverIslandOf(element: ElementNode, source: string): ServerIsla
263
261
 
264
262
  // `defer` is the mark only as a bare word beside `server`: alone, or with a value, it is a prop of the component, which may have one of its own.
265
263
  const defer = [named(SERVER_ISLAND_DEFER)].find(candidate => candidate?.kind === 'boolean')
266
- const written = attribute.kind === 'static' && SERVER_ISLAND_MODES.has(attribute.text) ? attribute.text as 'defer' : undefined
267
- const mode = attribute.kind === 'boolean' ? ['inline', 'defer'][Number(defer !== undefined)] as 'inline' | 'defer' : written
264
+ const mode = attribute.kind === 'boolean' ? ['inline', 'defer'][Number(defer !== undefined)] as 'inline' | 'defer' : undefined
268
265
 
269
266
  return { attribute, mode, noscript: named(SERVER_ISLAND_NOSCRIPT), defer }
270
267
  }
@@ -372,7 +369,7 @@ export interface ErrorMessages {
372
369
  describing: Map<string, string>
373
370
  }
374
371
 
375
- const ERROR_READ = /^([\w$.]+?)(?:\.form)?\.error\((?:(['"])([^'"]*)\2)?\)$/
372
+ const ERROR_READ = /^([\w$.]+?)\.form\.error\((?:(['"])([^'"]*)\2)?\)$/
376
373
  const WHITESPACE = /\s+/g
377
374
  const ID_UNSAFE = /[^\w-]+/g
378
375
 
@@ -384,7 +381,7 @@ function errorId(action: string, field: string): string {
384
381
  return `${action.replaceAll('.', '-')}-${field ? `${field.replace(ID_UNSAFE, '-')}-` : ''}error`
385
382
  }
386
383
 
387
- // An `error` line names the message its field is described by; failing one, as before it, the element `if add.form.error('title') then message` and `p {add.form.error('title')}`, and `add.error('title')` until 1.108: the element shown holds the message, outside a `for`, which would repeat its id, for an action a form of the file posts to.
384
+ // An `error` line names the message its field is described by; failing one, as before it, the element `if add.form.error('title') then message` and `p {add.form.error('title')}`: the element shown holds the message, outside a `for`, which would repeat its id, for an action a form of the file posts to.
388
385
  export function errorMessages(nodes: Node[], source: string): ErrorMessages {
389
386
  const found: ErrorMessages = { ids: new Map(), lines: new Map(), describing: new Map() }
390
387
  const posted = new Set<string>()
@@ -492,7 +489,7 @@ export function isChildrenSlot(node: Node): boolean {
492
489
  return isSlot(node) && (node as ElementNode).outlet === undefined
493
490
  }
494
491
 
495
- export type TemplateHelper = 'For' | 'componentClass' | 'partClass' | 'partHanded' | 'partsClass'
492
+ export type TemplateHelper = 'For' | 'componentClass' | 'handParts' | 'partClass' | 'partHanded' | 'partProps'
496
493
 
497
494
  // Whether an entry of `src/ui.ts` has variants, which read the component's props: without them its parts are static classes, written into the template as they are.
498
495
  export function uiHasVariants(entry: UiEntry): boolean {
@@ -566,9 +563,9 @@ export interface KayFile {
566
563
  style?: Span | undefined
567
564
  // Inside the angle brackets of `--- <T extends Row>`: the component function's type parameters.
568
565
  typeParameters?: Span | undefined
569
- // The `client` of `--- client`: the component renders in the browser only.
566
+ // The `island({ render: 'client' })` call: the component renders in the browser only.
570
567
  client?: Span | undefined
571
- // The `island` or `static` of `--- island` and `--- static`: the author pins the component's role, and the compiler holds it to the pin.
568
+ // The `island()` or `island({ render: 'static' })` call: the author pins the component's role, and the compiler holds it to the pin.
572
569
  pin?: (Span & { kind: 'island' | 'static' }) | undefined
573
570
  // The `island({ ... })` the script opens with, which sets `client` or `pin` as the fence lines do.
574
571
  island?: IslandDeclaration | undefined
@@ -703,8 +700,10 @@ function addRecipe(facts: TemplateFacts, file: KayFile, recipe: string): void {
703
700
  if (facts.parts.root !== 'none')
704
701
  facts.helpers.add('partClass')
705
702
 
706
- if (facts.parts.implicit?.component)
707
- facts.helpers.add('partsClass')
703
+ if (facts.parts.implicit?.component) {
704
+ facts.helpers.add('partProps')
705
+ facts.helpers.add('handParts')
706
+ }
708
707
  }
709
708
  }
710
709
 
@@ -747,8 +746,10 @@ function factsOf(file: KayFile): TemplateFacts {
747
746
 
748
747
  facts.helpers.add('partClass')
749
748
 
750
- if (node.component)
751
- facts.helpers.add('partsClass')
749
+ if (node.component) {
750
+ facts.helpers.add('partProps')
751
+ facts.helpers.add('handParts')
752
+ }
752
753
 
753
754
  if (index > 0)
754
755
  facts.helpers.add('partHanded')
@@ -783,8 +784,10 @@ function factsOf(file: KayFile): TemplateFacts {
783
784
  if (facts.parts) {
784
785
  markRoot(facts.parts, file.template)
785
786
 
786
- if (facts.parts.implicit?.component)
787
- facts.helpers.add('partsClass')
787
+ if (facts.parts.implicit?.component) {
788
+ facts.helpers.add('partProps')
789
+ facts.helpers.add('handParts')
790
+ }
788
791
  }
789
792
 
790
793
  return facts
@@ -795,8 +798,7 @@ function mergesComponentClass(element: ElementNode, source: string): boolean {
795
798
  if (!element.component)
796
799
  return false
797
800
 
798
- const old = oldPartsClass(element, source)
799
- const attribute = element.attributes.find((attribute): attribute is NamedAttribute => attribute.kind !== 'spread' && attribute !== old && source.slice(attribute.name.start, attribute.name.end) === 'class')
801
+ const attribute = element.attributes.find((attribute): attribute is NamedAttribute => attribute.kind !== 'spread' && source.slice(attribute.name.start, attribute.name.end) === 'class')
800
802
 
801
803
  if (element.attributes.some(attribute => attribute.kind === 'spread'))
802
804
  return element.classes.length > 0 || attribute !== undefined