steel-frame 7.0.0-rc.2 → 7.0.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 (677) hide show
  1. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  2. package/.idea/steel-frame.iml +1 -0
  3. package/.prettierignore +1 -0
  4. package/.prettierrc +8 -1
  5. package/README.md +35 -16
  6. package/StartUp.md +526 -0
  7. package/build/babel-plugin/abort.d.ts +5 -0
  8. package/build/babel-plugin/abort.js +120 -0
  9. package/build/babel-plugin/call.d.ts +21 -0
  10. package/build/babel-plugin/call.js +138 -0
  11. package/build/babel-plugin/communication.d.ts +11 -0
  12. package/build/babel-plugin/css-transformer.d.ts +3 -0
  13. package/build/babel-plugin/css-transformer.js +257 -0
  14. package/build/babel-plugin/expression.d.ts +30 -0
  15. package/build/babel-plugin/expression.js +566 -0
  16. package/build/babel-plugin/field-reference.d.ts +11 -0
  17. package/build/babel-plugin/field-reference.js +95 -0
  18. package/build/babel-plugin/index.d.ts +27 -0
  19. package/build/babel-plugin/index.js +36 -0
  20. package/build/babel-plugin/internal.d.ts +110 -0
  21. package/build/babel-plugin/internal.js +139 -0
  22. package/build/babel-plugin/jsx-detect.d.ts +2 -0
  23. package/build/babel-plugin/jsx-detect.js +9 -0
  24. package/build/babel-plugin/jsx.d.ts +12 -0
  25. package/build/babel-plugin/jsx.js +823 -0
  26. package/build/babel-plugin/lib.d.ts +40 -0
  27. package/build/babel-plugin/lib.js +241 -0
  28. package/build/babel-plugin/mesh.d.ts +27 -0
  29. package/build/babel-plugin/mesh.js +1502 -0
  30. package/build/babel-plugin/operators.d.ts +25 -0
  31. package/build/babel-plugin/operators.js +52 -0
  32. package/build/babel-plugin/order-check.d.ts +5 -0
  33. package/build/babel-plugin/order-check.js +172 -0
  34. package/build/babel-plugin/process-types.d.ts +20 -0
  35. package/build/babel-plugin/process-types.js +111 -0
  36. package/build/babel-plugin/router.d.ts +5 -0
  37. package/build/babel-plugin/router.js +51 -0
  38. package/build/babel-plugin/transformer.d.ts +21 -0
  39. package/build/babel-plugin/transformer.js +456 -0
  40. package/build/babel-plugin/utils.d.ts +2 -0
  41. package/build/babel-plugin/utils.js +14 -0
  42. package/build/cli/app-index/create-index.d.ts +1 -0
  43. package/build/cli/app-index/create-index.js +21 -0
  44. package/build/cli/app-index/create-ssg-index.d.ts +2 -0
  45. package/build/cli/app-index/create-ssg-index.js +16 -0
  46. package/build/cli/app-index/find-routes.d.ts +10 -0
  47. package/build/cli/app-index/find-routes.js +48 -0
  48. package/build/cli/lib/compile-lib.d.ts +3 -0
  49. package/build/cli/lib/compile-lib.js +141 -0
  50. package/build/cli/lib/fs.d.ts +2 -0
  51. package/build/cli/lib/fs.js +17 -0
  52. package/build/cli/lib/process-args.d.ts +11 -0
  53. package/build/cli/lib/process-args.js +92 -0
  54. package/build/cli/lib/resolve.d.ts +2 -0
  55. package/build/cli/lib/resolve.js +20 -0
  56. package/build/cli/lib/watch-folder.d.ts +1 -0
  57. package/build/cli/lib/watch-folder.js +20 -0
  58. package/build/cli/lib/working-dirs.d.ts +5 -0
  59. package/build/cli/lib/working-dirs.js +8 -0
  60. package/build/cli/node-hooks/index.doc.vasille.d.ts +2 -0
  61. package/build/cli/node-hooks/index.doc.vasille.js +5 -0
  62. package/build/cli/node-hooks/index.md.vasille.d.ts +2 -0
  63. package/build/cli/node-hooks/index.md.vasille.js +5 -0
  64. package/build/cli/node-hooks/index.vasille.d.ts +3 -0
  65. package/build/cli/node-hooks/index.vasille.js +24 -0
  66. package/build/cli/node-hooks/jsx.vasille.d.ts +2 -0
  67. package/build/cli/node-hooks/jsx.vasille.js +67 -0
  68. package/build/cli/proxy/dev-proxy.d.ts +4 -0
  69. package/build/cli/proxy/dev-proxy.js +25 -0
  70. package/build/cli/run.d.ts +2 -0
  71. package/build/cli/run.js +205 -0
  72. package/build/cli/sf.d.ts +2 -0
  73. package/build/cli/sf.js +2 -0
  74. package/build/cli/vite-plugins/compress.d.ts +10 -0
  75. package/build/cli/vite-plugins/compress.js +15 -0
  76. package/build/cli/vite-plugins/index.vasille.d.ts +6 -0
  77. package/build/cli/vite-plugins/index.vasille.js +39 -0
  78. package/build/cli/vite-plugins/jsx.d.ts +2 -0
  79. package/build/cli/vite-plugins/jsx.js +28 -0
  80. package/build/cli/vite-plugins/vasille-web.d.ts +5 -0
  81. package/build/cli/vite-plugins/vasille-web.js +17 -0
  82. package/build/export/index.d.ts +391 -0
  83. package/build/export/index.js +2 -0
  84. package/coverage/lcov-report/abort.ts.html +580 -0
  85. package/coverage/lcov-report/base.css +224 -0
  86. package/coverage/lcov-report/block-navigation.js +87 -0
  87. package/coverage/lcov-report/call.ts.html +829 -0
  88. package/coverage/lcov-report/css-transformer.ts.html +1180 -0
  89. package/coverage/lcov-report/expression.ts.html +2347 -0
  90. package/coverage/lcov-report/favicon.png +0 -0
  91. package/coverage/lcov-report/field-reference.ts.html +550 -0
  92. package/coverage/lcov-report/index.html +356 -0
  93. package/coverage/lcov-report/index.ts.html +286 -0
  94. package/coverage/lcov-report/internal.ts.html +946 -0
  95. package/coverage/lcov-report/jsx-detect.ts.html +127 -0
  96. package/coverage/lcov-report/jsx.ts.html +3550 -0
  97. package/coverage/lcov-report/lib.ts.html +1381 -0
  98. package/coverage/lcov-report/mesh.ts.html +5860 -0
  99. package/coverage/lcov-report/operators.ts.html +322 -0
  100. package/coverage/lcov-report/order-check.ts.html +805 -0
  101. package/coverage/lcov-report/prettify.css +1 -0
  102. package/coverage/lcov-report/prettify.js +2 -0
  103. package/coverage/lcov-report/process-types.ts.html +475 -0
  104. package/coverage/lcov-report/router.ts.html +292 -0
  105. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  106. package/coverage/lcov-report/sorter.js +210 -0
  107. package/coverage/lcov-report/transformer.ts.html +1951 -0
  108. package/coverage/lcov-report/utils.ts.html +139 -0
  109. package/coverage/lcov.info +5285 -0
  110. package/jest.config.js +23 -0
  111. package/package.json +75 -57
  112. package/src/babel-plugin/abort.ts +165 -0
  113. package/src/babel-plugin/call.ts +248 -0
  114. package/src/babel-plugin/communication.ts +13 -0
  115. package/src/babel-plugin/css-transformer.ts +365 -0
  116. package/src/babel-plugin/expression.ts +754 -0
  117. package/src/babel-plugin/field-reference.ts +155 -0
  118. package/src/babel-plugin/index.ts +67 -0
  119. package/src/babel-plugin/internal.ts +287 -0
  120. package/src/babel-plugin/jsx-detect.ts +14 -0
  121. package/src/babel-plugin/jsx.ts +1155 -0
  122. package/src/babel-plugin/lib.ts +432 -0
  123. package/src/babel-plugin/mesh.ts +1925 -0
  124. package/src/babel-plugin/operators.ts +79 -0
  125. package/src/babel-plugin/order-check.ts +240 -0
  126. package/src/babel-plugin/process-types.ts +130 -0
  127. package/src/babel-plugin/router.ts +69 -0
  128. package/src/babel-plugin/transformer.ts +622 -0
  129. package/src/babel-plugin/utils.ts +18 -0
  130. package/src/cli/app-index/create-index.ts +28 -0
  131. package/src/cli/app-index/create-ssg-index.ts +23 -0
  132. package/src/cli/app-index/find-routes.ts +63 -0
  133. package/src/cli/lib/compile-lib.ts +169 -0
  134. package/src/cli/lib/fs.ts +17 -0
  135. package/src/cli/lib/process-args.ts +99 -0
  136. package/src/cli/lib/resolve.ts +22 -0
  137. package/src/cli/lib/watch-folder.ts +22 -0
  138. package/src/cli/lib/working-dirs.ts +10 -0
  139. package/src/cli/node-hooks/index.doc.vasille.js +6 -0
  140. package/src/cli/node-hooks/index.md.vasille.js +6 -0
  141. package/src/cli/node-hooks/index.vasille.js +30 -0
  142. package/src/cli/node-hooks/jsx.vasille.js +80 -0
  143. package/src/cli/proxy/dev-proxy.ts +30 -0
  144. package/src/cli/run.ts +230 -0
  145. package/src/cli/sf.ts +2 -0
  146. package/src/cli/vite-plugins/compress.ts +16 -0
  147. package/src/cli/vite-plugins/index.vasille.ts +54 -0
  148. package/src/cli/vite-plugins/jsx.ts +33 -0
  149. package/src/cli/vite-plugins/vasille-web.ts +18 -0
  150. package/{fake-types/index.d.ts → src/export/index.ts} +199 -59
  151. package/test/bridge/array-item-set.js +3 -0
  152. package/test/bridge/array-item-set.ts +4 -0
  153. package/test/bridge/bind.js +8 -0
  154. package/test/bridge/bind.ts +9 -0
  155. package/test/bridge/bridge.test.ts +74 -0
  156. package/test/bridge/err-before-mount-arg.ts +6 -0
  157. package/test/bridge/err-bind-in-object.ts +10 -0
  158. package/test/bridge/err-field-renaming-2.ts +5 -0
  159. package/test/bridge/err-field-renaming.ts +7 -0
  160. package/test/bridge/err-non-reactive-module-var.ts +1 -0
  161. package/test/bridge/err-prop-not-reactive.ts +3 -0
  162. package/test/bridge/err-raw-no-args.ts +4 -0
  163. package/test/bridge/err-router-in-store-1.ts +7 -0
  164. package/test/bridge/err-router-in-store-2.ts +9 -0
  165. package/test/bridge/err-router-in-store-3.ts +12 -0
  166. package/test/bridge/err-router.ts +5 -0
  167. package/test/bridge/global-import.js +13 -0
  168. package/test/bridge/global-import.ts +16 -0
  169. package/test/bridge/module-level-reactivity.js +11 -0
  170. package/test/bridge/module-level-reactivity.ts +18 -0
  171. package/test/bridge/object-property-match.js +5 -0
  172. package/test/bridge/object-property-match.ts +6 -0
  173. package/test/bridge/router.js +13 -0
  174. package/test/bridge/router.ts +17 -0
  175. package/test/build/build.test.ts +22 -0
  176. package/test/build/ssg-no-extra-tags.js +4 -0
  177. package/test/build/ssg-no-extra-tags.tsx +9 -0
  178. package/test/build/ssg.js +14 -0
  179. package/test/build/ssg.tsx +9 -0
  180. package/test/call/call.test.ts +26 -0
  181. package/test/call/constant.js +7 -0
  182. package/test/call/constant.ts +7 -0
  183. package/test/call/css.js +7 -0
  184. package/test/call/css.ts +11 -0
  185. package/test/call/err-awaited-not-arr.ts +5 -0
  186. package/test/call/require-context.js +9 -0
  187. package/test/call/require-context.ts +13 -0
  188. package/test/call/string-literal.js +7 -0
  189. package/test/call/string-literal.ts +6 -0
  190. package/test/compose/component.js +19 -0
  191. package/test/compose/component.ts +22 -0
  192. package/test/compose/compose.js +18 -0
  193. package/test/compose/compose.test.ts +38 -0
  194. package/test/compose/compose.ts +21 -0
  195. package/test/compose/modal.js +9 -0
  196. package/test/compose/modal.ts +13 -0
  197. package/test/compose/model.js +22 -0
  198. package/test/compose/model.ts +21 -0
  199. package/test/compose/prompt.js +20 -0
  200. package/test/compose/prompt.ts +25 -0
  201. package/test/compose/screen.js +15 -0
  202. package/test/compose/screen.ts +13 -0
  203. package/test/compose/store.js +8 -0
  204. package/test/compose/store.ts +9 -0
  205. package/test/compose/view.js +34 -0
  206. package/test/compose/view.ts +39 -0
  207. package/test/css/autoremove-key.js +11 -0
  208. package/test/css/autoremove-key.tsx +12 -0
  209. package/test/css/computed-key.js +9 -0
  210. package/test/css/computed-key.ts +12 -0
  211. package/test/css/css.test.ts +82 -0
  212. package/test/css/err-arg-not-object.ts +4 -0
  213. package/test/css/err-arg-wrong-key.ts +6 -0
  214. package/test/css/err-arg-wrong-object.ts +6 -0
  215. package/test/css/err-arg-wrong-value.ts +10 -0
  216. package/test/css/err-array-spread-element.ts +11 -0
  217. package/test/css/err-incompatible-key.ts +13 -0
  218. package/test/css/err-media-not-object.ts +12 -0
  219. package/test/css/err-nested-media-queries.ts +13 -0
  220. package/test/css/err-nested-pseudos.ts +13 -0
  221. package/test/css/err-no-args.ts +4 -0
  222. package/test/css/err-object-method.ts +11 -0
  223. package/test/css/err-object-spread-element.ts +12 -0
  224. package/test/css/err-pseudo-not-object.ts +12 -0
  225. package/test/css/err-theme-not-string.ts +11 -0
  226. package/test/css/err-wrong-array-value.ts +12 -0
  227. package/test/css/err-wrong-value.ts +12 -0
  228. package/test/css/style.js +13 -0
  229. package/test/css/style.ts +61 -0
  230. package/test/dev/array-model.js +5 -0
  231. package/test/dev/array-model.ts +5 -0
  232. package/test/dev/awaited-2.js +7 -0
  233. package/test/dev/awaited-2.ts +7 -0
  234. package/test/dev/awaited.js +7 -0
  235. package/test/dev/awaited.ts +7 -0
  236. package/test/dev/bind-2.js +6 -0
  237. package/test/dev/bind-2.ts +6 -0
  238. package/test/dev/bind.js +6 -0
  239. package/test/dev/bind.ts +6 -0
  240. package/test/dev/calculate.js +8 -0
  241. package/test/dev/calculate.ts +8 -0
  242. package/test/dev/child.js +16 -0
  243. package/test/dev/child.tsx +11 -0
  244. package/test/dev/component.js +5 -0
  245. package/test/dev/component.ts +5 -0
  246. package/test/dev/custom-model.js +6 -0
  247. package/test/dev/custom-model.ts +7 -0
  248. package/test/dev/dev.test.ts +106 -0
  249. package/test/dev/ensure.js +9 -0
  250. package/test/dev/ensure.ts +7 -0
  251. package/test/dev/function-wrap.js +59 -0
  252. package/test/dev/function-wrap.ts +43 -0
  253. package/test/dev/map-model.js +5 -0
  254. package/test/dev/map-model.ts +5 -0
  255. package/test/dev/match.js +11 -0
  256. package/test/dev/module-level-reactivity.js +6 -0
  257. package/test/dev/module-level-reactivity.ts +7 -0
  258. package/test/dev/object.js +8 -0
  259. package/test/dev/object.ts +8 -0
  260. package/test/dev/page.js +5 -0
  261. package/test/dev/page.ts +5 -0
  262. package/test/dev/prompt.js +13 -0
  263. package/test/dev/prompt.tsx +7 -0
  264. package/test/dev/ref-no-args.js +5 -0
  265. package/test/dev/ref-no-args.ts +5 -0
  266. package/test/dev/ref.js +5 -0
  267. package/test/dev/ref.ts +5 -0
  268. package/test/dev/safe.js +36 -0
  269. package/test/dev/safe.tsx +19 -0
  270. package/test/dev/set-model.js +5 -0
  271. package/test/dev/set-model.ts +5 -0
  272. package/test/dev/set-value.js +8 -0
  273. package/test/dev/set-value.ts +9 -0
  274. package/test/dev/tag.js +7 -0
  275. package/test/dev/tag.tsx +5 -0
  276. package/test/dev/text-2.js +6 -0
  277. package/test/dev/text-2.tsx +7 -0
  278. package/test/dev/text.js +5 -0
  279. package/test/dev/text.tsx +5 -0
  280. package/test/dev/value-assignment.js +30 -0
  281. package/test/dev/value-assignment.ts +24 -0
  282. package/test/expression/check-expression.js +58 -0
  283. package/test/expression/check-expression.ts +58 -0
  284. package/test/expression/check-node.js +12 -0
  285. package/test/expression/check-node.ts +10 -0
  286. package/test/expression/check-statement.js +45 -0
  287. package/test/expression/check-statement.ts +55 -0
  288. package/test/expression/deep-reactive-object.js +15 -0
  289. package/test/expression/deep-reactive-object.ts +16 -0
  290. package/test/expression/dependency.js +7 -0
  291. package/test/expression/dependency.ts +9 -0
  292. package/test/expression/err-function-name.ts +11 -0
  293. package/test/expression/err-jsx-element.tsx +9 -0
  294. package/test/expression/err-jsx-fragment.tsx +9 -0
  295. package/test/expression/err-local-observable.ts +12 -0
  296. package/test/expression/err-nested-observable-in-object.ts +6 -0
  297. package/test/expression/err-nested-observable.ts +11 -0
  298. package/test/expression/err-nested-reactivity-2.ts +7 -0
  299. package/test/expression/err-nested-reactivity.ts +11 -0
  300. package/test/expression/err-restricted-hint.ts +9 -0
  301. package/test/expression/expression.test.ts +74 -0
  302. package/test/expression/mesh-lvalue.js +21 -0
  303. package/test/expression/mesh-lvalue.ts +22 -0
  304. package/test/expression/reactive-field-set.js +23 -0
  305. package/test/expression/reactive-field-set.ts +28 -0
  306. package/test/expression/stringify.js +15 -0
  307. package/test/expression/stringify.ts +17 -0
  308. package/test/extras/SlotTest.js +75 -0
  309. package/test/extras/SlotTest.tsx +65 -0
  310. package/test/extras/calculate.js +25 -0
  311. package/test/extras/calculate.tsx +22 -0
  312. package/test/extras/err.tsx +23 -0
  313. package/test/extras/extras.test.ts +68 -0
  314. package/test/extras/function-assigment-pattern.js +15 -0
  315. package/test/extras/function-assigment-pattern.ts +11 -0
  316. package/test/extras/set-model.js +29 -0
  317. package/test/extras/set-model.tsx +26 -0
  318. package/test/import/err-override-by-fn-expr.ts +10 -0
  319. package/test/import/global.js +7 -0
  320. package/test/import/global.ts +6 -0
  321. package/test/import/import.test.ts +34 -0
  322. package/test/import/override-by-function.js +9 -0
  323. package/test/import/override-by-function.ts +10 -0
  324. package/test/import/override-by-let.js +6 -0
  325. package/test/import/override-by-let.ts +8 -0
  326. package/test/import/override-global.js +9 -0
  327. package/test/import/override-global.ts +10 -0
  328. package/test/import/selective.js +7 -0
  329. package/test/import/selective.ts +6 -0
  330. package/test/jsx/attr.js +13 -0
  331. package/test/jsx/attr.tsx +8 -0
  332. package/test/jsx/bind.js +41 -0
  333. package/test/jsx/bind.tsx +15 -0
  334. package/test/jsx/callback.js +9 -0
  335. package/test/jsx/callback.tsx +11 -0
  336. package/test/jsx/children.js +11 -0
  337. package/test/jsx/children.tsx +11 -0
  338. package/test/jsx/class.js +50 -0
  339. package/test/jsx/class.tsx +21 -0
  340. package/test/jsx/conditional-binary.js +16 -0
  341. package/test/jsx/conditional-binary.tsx +10 -0
  342. package/test/jsx/conditional-mixed.js +40 -0
  343. package/test/jsx/conditional-mixed.tsx +19 -0
  344. package/test/jsx/conditional-ternary.js +18 -0
  345. package/test/jsx/conditional-ternary.tsx +10 -0
  346. package/test/jsx/conditions.js +80 -0
  347. package/test/jsx/conditions.tsx +40 -0
  348. package/test/jsx/default-prop.js +8 -0
  349. package/test/jsx/default-prop.tsx +7 -0
  350. package/test/jsx/err-conditions-else-if.tsx +5 -0
  351. package/test/jsx/err-conditions-else.tsx +5 -0
  352. package/test/jsx/err-conditions-spread.tsx +5 -0
  353. package/test/jsx/err-expected-event-handler.tsx +6 -0
  354. package/test/jsx/err-method-style-object.tsx +6 -0
  355. package/test/jsx/err-namespace-props.tsx +10 -0
  356. package/test/jsx/err-namespaced-name.tsx +6 -0
  357. package/test/jsx/err-spread-child.tsx +5 -0
  358. package/test/jsx/err-tag-spread-attr.tsx +5 -0
  359. package/test/jsx/err-wrong-namespace.tsx +6 -0
  360. package/test/jsx/events.js +16 -0
  361. package/test/jsx/events.tsx +17 -0
  362. package/test/jsx/fragment.js +9 -0
  363. package/test/jsx/fragment.tsx +15 -0
  364. package/test/jsx/jsx.test.ts +120 -0
  365. package/test/jsx/loop.js +19 -0
  366. package/test/jsx/loop.tsx +21 -0
  367. package/test/jsx/nested-slots.js +39 -0
  368. package/test/jsx/nested-slots.tsx +36 -0
  369. package/test/jsx/nested.js +42 -0
  370. package/test/jsx/nested.tsx +35 -0
  371. package/test/jsx/style.js +36 -0
  372. package/test/jsx/style.tsx +20 -0
  373. package/test/jsx-detect/has-jsx.js +30 -0
  374. package/test/jsx-detect/has-jsx.tsx +26 -0
  375. package/test/jsx-detect/jsx-detect.test.ts +14 -0
  376. package/test/jsx-detect/release-mode.js +14 -0
  377. package/test/jsx-detect/release-mode.tsx +18 -0
  378. package/test/lib/FileStructure.js +7 -0
  379. package/test/lib/FileStructure.ts +21 -0
  380. package/test/lib/err-arg-not-func.ts +6 -0
  381. package/test/lib/err-file-structure-class.ts +11 -0
  382. package/test/lib/err-file-structure-helper-before-export.ts +5 -0
  383. package/test/lib/err-file-structure-import-after.ts +5 -0
  384. package/test/lib/err-file-structure-stylesheet-not-last.ts +7 -0
  385. package/test/lib/err-incorrect-args-number.ts +6 -0
  386. package/test/lib/err-incorrect-props-number.ts +8 -0
  387. package/test/lib/err-malformed-component.ts +7 -0
  388. package/test/lib/lib.test.ts +42 -0
  389. package/test/mesh/class.js +48 -0
  390. package/test/mesh/class.ts +55 -0
  391. package/test/mesh/compose.js +51 -0
  392. package/test/mesh/compose.tsx +35 -0
  393. package/test/mesh/default-class.js +8 -0
  394. package/test/mesh/default-class.ts +10 -0
  395. package/test/mesh/default-expr.js +2 -0
  396. package/test/mesh/default-expr.ts +3 -0
  397. package/test/mesh/default-fn.js +4 -0
  398. package/test/mesh/default-fn.ts +5 -0
  399. package/test/mesh/double-mesh-bug.js +17 -0
  400. package/test/mesh/double-mesh-bug.tsx +17 -0
  401. package/test/mesh/err-array-model-const.ts +5 -0
  402. package/test/mesh/err-calculate-call.ts +6 -0
  403. package/test/mesh/err-class-name-expression.ts +1 -0
  404. package/test/mesh/err-class-name.ts +1 -0
  405. package/test/mesh/err-compose-arg-number.tsx +13 -0
  406. package/test/mesh/err-compose-nested-destruction.ts +13 -0
  407. package/test/mesh/err-computed-property-in-destruction.ts +7 -0
  408. package/test/mesh/err-function-name.ts +3 -0
  409. package/test/mesh/err-invalid-compose-call.ts +4 -0
  410. package/test/mesh/err-jsx-element.tsx +5 -0
  411. package/test/mesh/err-jsx-fragment.tsx +5 -0
  412. package/test/mesh/err-map-model-const.ts +5 -0
  413. package/test/mesh/err-param-name-destruction.ts +1 -0
  414. package/test/mesh/err-param-name-rest.ts +1 -0
  415. package/test/mesh/err-param-name-with-default-value.ts +1 -0
  416. package/test/mesh/err-param-name.ts +1 -0
  417. package/test/mesh/err-prompt.ts +5 -0
  418. package/test/mesh/err-run-on-destroy.ts +9 -0
  419. package/test/mesh/err-set-model-const.ts +5 -0
  420. package/test/mesh/err-store-jsx.tsx +7 -0
  421. package/test/mesh/err-store-not-reactive-value-2.ts +11 -0
  422. package/test/mesh/err-store-not-reactive-value.ts +11 -0
  423. package/test/mesh/err-store-reactive-value.ts +7 -0
  424. package/test/mesh/err-store-share-dependency.ts +6 -0
  425. package/test/mesh/err-style-hint.ts +4 -0
  426. package/test/mesh/mesh-expression.js +56 -0
  427. package/test/mesh/mesh-expression.ts +57 -0
  428. package/test/mesh/mesh-statement.js +46 -0
  429. package/test/mesh/mesh-statement.ts +61 -0
  430. package/test/mesh/mesh.test.ts +170 -0
  431. package/test/mesh/object-computed-property.js +11 -0
  432. package/test/mesh/object-computed-property.ts +10 -0
  433. package/test/mesh/object-read-property.js +12 -0
  434. package/test/mesh/object-read-property.ts +15 -0
  435. package/test/mesh/object-reference.js +11 -0
  436. package/test/mesh/object-reference.ts +13 -0
  437. package/test/mesh/reactive-field-copy.js +14 -0
  438. package/test/mesh/reactive-field-copy.ts +24 -0
  439. package/test/mesh/reactive-field-set.js +15 -0
  440. package/test/mesh/reactive-field-set.ts +19 -0
  441. package/test/mesh/reactive-object.js +39 -0
  442. package/test/mesh/reactive-object.tsx +38 -0
  443. package/test/mesh/run-on-destroy.js +6 -0
  444. package/test/mesh/run-on-destroy.ts +7 -0
  445. package/test/mesh/store.js +79 -0
  446. package/test/mesh/store.tsx +83 -0
  447. package/test/naming/err-component-not-uppercase.ts +3 -0
  448. package/test/naming/err-components-folder.ts +3 -0
  449. package/test/naming/err-export.ts +3 -0
  450. package/test/naming/err-modal-missing-suffix.ts +3 -0
  451. package/test/naming/err-modal-not-uppercase.ts +3 -0
  452. package/test/naming/err-modals-folder.ts +3 -0
  453. package/test/naming/err-model-missing-suffix.ts +3 -0
  454. package/test/naming/err-model-not-lowercase.ts +3 -0
  455. package/test/naming/err-models-folder.ts +3 -0
  456. package/test/naming/err-page.ts +3 -0
  457. package/test/naming/err-prompt-missing-prefix.ts +3 -0
  458. package/test/naming/err-prompts-folder.ts +3 -0
  459. package/test/naming/err-screen-missing-suffix.ts +3 -0
  460. package/test/naming/err-screens-folder.ts +3 -0
  461. package/test/naming/err-store-missing-suffix.ts +3 -0
  462. package/test/naming/err-store-not-lowercase.ts +3 -0
  463. package/test/naming/err-stores-folder.ts +3 -0
  464. package/test/naming/err-view-missing-suffix.ts +3 -0
  465. package/test/naming/err-view-not-uppercase.ts +3 -0
  466. package/test/naming/err-views-folder.ts +3 -0
  467. package/test/naming/naming.test.ts +130 -0
  468. package/test/pages/(dynamical).js +6 -0
  469. package/test/pages/(dynamical).tsx +5 -0
  470. package/test/pages/err-static.ts +3 -0
  471. package/test/pages/page/(number).js +6 -0
  472. package/test/pages/page/(number).tsx +5 -0
  473. package/test/pages/page/list.js +4 -0
  474. package/test/pages/page/list.tsx +5 -0
  475. package/test/pages/pages.test.ts +26 -0
  476. package/test/pages/static.js +4 -0
  477. package/test/pages/static.tsx +5 -0
  478. package/test/reference/awaited.js +6 -0
  479. package/test/reference/awaited.ts +8 -0
  480. package/test/reference/const.js +4 -0
  481. package/test/reference/const.ts +5 -0
  482. package/test/reference/expr-const-optional.js +8 -0
  483. package/test/reference/expr-const-optional.ts +10 -0
  484. package/test/reference/expr-const.js +7 -0
  485. package/test/reference/expr-const.ts +9 -0
  486. package/test/reference/expr-let.js +10 -0
  487. package/test/reference/expr-let.ts +13 -0
  488. package/test/reference/expr-meta.js +15 -0
  489. package/test/reference/expr-meta.ts +17 -0
  490. package/test/reference/let-update.js +9 -0
  491. package/test/reference/let-update.ts +11 -0
  492. package/test/reference/let.js +5 -0
  493. package/test/reference/let.ts +6 -0
  494. package/test/reference/local-reactive.js +11 -0
  495. package/test/reference/local-reactive.ts +6 -0
  496. package/test/reference/models.js +24 -0
  497. package/test/reference/models.ts +27 -0
  498. package/test/reference/reference.test.ts +50 -0
  499. package/test/reference/watch.js +9 -0
  500. package/test/reference/watch.ts +11 -0
  501. package/test/run-test.ts +65 -0
  502. package/test/shadow/Error.tsx +3 -0
  503. package/test/shadow/InterfaceTest.js +4 -0
  504. package/test/shadow/InterfaceTest.ts +7 -0
  505. package/test/shadow/LocalComponent.js +38 -0
  506. package/test/shadow/LocalComponent.tsx +27 -0
  507. package/test/shadow/MissingGlyph.tsx +5 -0
  508. package/test/shadow/MissingType.tsx +4 -0
  509. package/test/shadow/NoType.tsx +3 -0
  510. package/test/shadow/ParameterTest.js +4 -0
  511. package/test/shadow/ParameterTest.ts +7 -0
  512. package/test/shadow/PropsTest.js +11 -0
  513. package/test/shadow/PropsTest.ts +13 -0
  514. package/test/shadow/SlotTest.js +44 -0
  515. package/test/shadow/SlotTest.tsx +22 -0
  516. package/test/shadow/TypeTest.js +4 -0
  517. package/test/shadow/TypeTest.ts +7 -0
  518. package/test/shadow/UnionTest.js +11 -0
  519. package/test/shadow/UnionTest.ts +14 -0
  520. package/test/shadow/shadow.test.ts +59 -0
  521. package/test/transformer/no-import.js +3 -0
  522. package/test/transformer/no-import.ts +3 -0
  523. package/test/transformer/transformer.test.ts +18 -0
  524. package/test/transformer/web-global.js +4 -0
  525. package/test/transformer/web-global.ts +5 -0
  526. package/test/transformer/web-partial.js +7 -0
  527. package/test/transformer/web-partial.ts +11 -0
  528. package/test/tsconfig.json +21 -0
  529. package/test/tsconfig.tsbuildinfo +1 -0
  530. package/test/v5/array-index.js +11 -0
  531. package/test/v5/array-index.ts +12 -0
  532. package/test/v5/assign-operator.js +11 -0
  533. package/test/v5/assign-operator.ts +18 -0
  534. package/test/v5/context.js +16 -0
  535. package/test/v5/context.ts +14 -0
  536. package/test/v5/di.js +10 -0
  537. package/test/v5/di.tsx +5 -0
  538. package/test/v5/err-di-discover.ts +6 -0
  539. package/test/v5/err-receive-in-wrapper.ts +5 -0
  540. package/test/v5/spaces-in-jsx.js +22 -0
  541. package/test/v5/spaces-in-jsx.tsx +14 -0
  542. package/test/v5/v5.test.ts +49 -0
  543. package/test/v6/err-foreach-no-slot.tsx +6 -0
  544. package/test/v6/err-iterate-params-number.tsx +5 -0
  545. package/test/v6/err-model-view-no-slot.tsx +6 -0
  546. package/test/v6/err-reactive-destruction.tsx +6 -0
  547. package/test/v6/err-too-much-params.tsx +6 -0
  548. package/test/v6/if-test.js +20 -0
  549. package/test/v6/if-test.tsx +14 -0
  550. package/test/v6/iterate-destructure.js +22 -0
  551. package/test/v6/iterate-destructure.tsx +20 -0
  552. package/test/v6/iterate-map.js +9 -0
  553. package/test/v6/iterate-map.tsx +12 -0
  554. package/test/v6/iterate.js +15 -0
  555. package/test/v6/iterate.tsx +19 -0
  556. package/test/v6/model-view.js +40 -0
  557. package/test/v6/model-view.tsx +46 -0
  558. package/test/v6/v6.test.ts +51 -0
  559. package/test/v7/DependencyReexport.js +2 -0
  560. package/test/v7/DependencyReexport.tsx +2 -0
  561. package/test/v7/DependencyStart.js +6 -0
  562. package/test/v7/DependencyStart.tsx +7 -0
  563. package/test/v7/Hmr.js +16 -0
  564. package/test/v7/Hmr.ts +8 -0
  565. package/test/v7/abort-signal.js +15 -0
  566. package/test/v7/abort-signal.tsx +15 -0
  567. package/test/v7/array-model-map.js +16 -0
  568. package/test/v7/array-model-map.tsx +11 -0
  569. package/test/v7/async-composing.js +8 -0
  570. package/test/v7/async-composing.tsx +11 -0
  571. package/test/v7/auto-safe.js +40 -0
  572. package/test/v7/auto-safe.tsx +24 -0
  573. package/test/v7/await-with-dependency.js +14 -0
  574. package/test/v7/await-with-dependency.ts +13 -0
  575. package/test/v7/bypass-write-restriction.js +8 -0
  576. package/test/v7/bypass-write-restriction.ts +10 -0
  577. package/test/v7/callback.js +27 -0
  578. package/test/v7/callback.tsx +30 -0
  579. package/test/v7/debounce-dev.js +8 -0
  580. package/test/v7/debounce-dev.ts +6 -0
  581. package/test/v7/debounce.js +5 -0
  582. package/test/v7/debounce.ts +6 -0
  583. package/test/v7/declared-function.js +11 -0
  584. package/test/v7/declared-function.ts +11 -0
  585. package/test/v7/discard-awaited.js +59 -0
  586. package/test/v7/discard-awaited.ts +60 -0
  587. package/test/v7/discard-less-awaited.js +45 -0
  588. package/test/v7/discard-less-awaited.ts +58 -0
  589. package/test/v7/err-array-model-map.tsx +11 -0
  590. package/test/v7/err-autounwrap.tsx +7 -0
  591. package/test/v7/err-bypass-to-readonly.ts +10 -0
  592. package/test/v7/err-computed-property.ts +6 -0
  593. package/test/v7/err-debounce-wrong-args.ts +5 -0
  594. package/test/v7/err-declared-function-calculate.ts +9 -0
  595. package/test/v7/err-declared-function-call.ts +12 -0
  596. package/test/v7/err-declared-function-effect.ts +14 -0
  597. package/test/v7/err-declared-function.ts +9 -0
  598. package/test/v7/err-dependency-reexport-check.tsx +6 -0
  599. package/test/v7/err-destruction-extracts-reactive.ts +7 -0
  600. package/test/v7/err-destruction-missing-renaming.ts +6 -0
  601. package/test/v7/err-destruction-of-slot-props.tsx +7 -0
  602. package/test/v7/err-expr-has-double-breakpoint.ts +7 -0
  603. package/test/v7/err-field-ref-double-breakpoint.ts +7 -0
  604. package/test/v7/err-field-ref-has-double-breakpoint.ts +7 -0
  605. package/test/v7/err-field-ref-no-arg.ts +5 -0
  606. package/test/v7/err-field-ref-no-breakpoint.ts +6 -0
  607. package/test/v7/err-field-ref-v7-naming.tsx +13 -0
  608. package/test/v7/err-field-ref-with-private-name.ts +11 -0
  609. package/test/v7/err-function-expr-in-live-declaration.ts +8 -0
  610. package/test/v7/err-function-expr-in-state-declaration.ts +8 -0
  611. package/test/v7/err-function-expr-in-var-declaration.ts +8 -0
  612. package/test/v7/err-local-dependency-flow.tsx +16 -0
  613. package/test/v7/err-no-deps-in-effect.ts +7 -0
  614. package/test/v7/err-page-with-global-dependency.tsx +8 -0
  615. package/test/v7/err-reactivity-break-2.ts +9 -0
  616. package/test/v7/err-reactivity-break.ts +10 -0
  617. package/test/v7/err-rest-in-internal-slot.tsx +7 -0
  618. package/test/v7/err-rest-in-reactive-destruction.ts +6 -0
  619. package/test/v7/err-rest-in-ref.ts +6 -0
  620. package/test/v7/err-restricted-member-access.ts +8 -0
  621. package/test/v7/err-restricted-ref-in-object-2.ts +6 -0
  622. package/test/v7/err-restricted-ref-in-object.ts +7 -0
  623. package/test/v7/err-router-go-to.ts +8 -0
  624. package/test/v7/err-router-load.ts +8 -0
  625. package/test/v7/err-safe-init-no-args.ts +6 -0
  626. package/test/v7/err-static-live-value.ts +5 -0
  627. package/test/v7/err-wrong-path-in-jsx.tsx +18 -0
  628. package/test/v7/field-ref-v7-naming.js +35 -0
  629. package/test/v7/field-ref-v7-naming.tsx +27 -0
  630. package/test/v7/field-ref.js +31 -0
  631. package/test/v7/field-ref.tsx +26 -0
  632. package/test/v7/let-with-function-expression.js +6 -0
  633. package/test/v7/let-with-function-expression.ts +7 -0
  634. package/test/v7/object-destruction.js +10 -0
  635. package/test/v7/object-destruction.tsx +8 -0
  636. package/test/v7/provide-global-dependency.js +4 -0
  637. package/test/v7/provide-global-dependency.tsx +5 -0
  638. package/test/v7/router-path-in-jsx.js +18 -0
  639. package/test/v7/router-path-in-jsx.tsx +18 -0
  640. package/test/v7/router.js +22 -0
  641. package/test/v7/router.ts +25 -0
  642. package/test/v7/safe.js +32 -0
  643. package/test/v7/safe.tsx +26 -0
  644. package/test/v7/string-event.js +9 -0
  645. package/test/v7/string-event.tsx +6 -0
  646. package/test/v7/v7.test.ts +326 -0
  647. package/test/v7-new-naming/err-assign-to-readonly.ts +7 -0
  648. package/test/v7-new-naming/err-constructor-reactivity-missmatch.ts +14 -0
  649. package/test/v7-new-naming/err-let-debounced.ts +6 -0
  650. package/test/v7-new-naming/err-reactive-field-in-obj.ts +12 -0
  651. package/test/v7-new-naming/err-reactive-writable-in-obj.ts +7 -0
  652. package/test/v7-new-naming/err-readonly-explicit-ref.ts +5 -0
  653. package/test/v7-new-naming/err-readonly-field.ts +6 -0
  654. package/test/v7-new-naming/err-readonly-ref.ts +5 -0
  655. package/test/v7-new-naming/err-readonly-to-writable-prop.ts +12 -0
  656. package/test/v7-new-naming/err-readonly-to-writable-prop.tsx +10 -0
  657. package/test/v7-new-naming/err-writable-debounced.ts +6 -0
  658. package/test/v7-new-naming/err-writable-explicit-expr.ts +6 -0
  659. package/test/v7-new-naming/err-writable-expr.ts +6 -0
  660. package/test/v7-new-naming/naming.js +26 -0
  661. package/test/v7-new-naming/naming.tsx +27 -0
  662. package/test/v7-new-naming/v7-new-naming.test.ts +70 -0
  663. package/tsconfig.json +16 -15
  664. package/tsconfig.tsbuildinfo +1 -0
  665. package/lib/index.js +0 -53
  666. package/lib/inspector.js +0 -226
  667. package/lib/tsconfig.tsbuildinfo +0 -1
  668. package/src/communication.ts +0 -10
  669. package/src/index.ts +0 -99
  670. package/src/inspector.ts +0 -278
  671. package/types/communication.d.ts +0 -9
  672. package/types/index.d.ts +0 -46
  673. package/types/inspector.d.ts +0 -18
  674. /package/{lib → build/babel-plugin}/communication.js +0 -0
  675. /package/{types → build/export}/jsx-runtime.d.ts +0 -0
  676. /package/{lib → build/export}/jsx-runtime.js +0 -0
  677. /package/src/{jsx-runtime.ts → export/jsx-runtime.ts} +0 -0
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
4
+ </state>
5
+ </component>
@@ -2,6 +2,7 @@
2
2
  <module type="WEB_MODULE" version="4">
3
3
  <component name="NewModuleRootManager">
4
4
  <content url="file://$MODULE_DIR$">
5
+ <sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
5
6
  <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
7
  <excludeFolder url="file://$MODULE_DIR$/temp" />
7
8
  <excludeFolder url="file://$MODULE_DIR$/tmp" />
@@ -0,0 +1 @@
1
+ test/**/*.js
package/.prettierrc CHANGED
@@ -9,6 +9,13 @@
9
9
  "bracketSpacing": true,
10
10
  "bracketSameLine": true,
11
11
  "arrowParens": "avoid",
12
- "parser": "typescript",
12
+ "overrides": [
13
+ {
14
+ "files": ["*.mts", "*.cts", "*.ts"],
15
+ "options": {
16
+ "parser": "typescript"
17
+ }
18
+ }
19
+ ],
13
20
  "singleAttributePerLine": false
14
21
  }
package/README.md CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  ![Vasille.js logo](https://raw.githubusercontent.com/vasille-js/vasille-js/refs/heads/v5/doc/img/logo.png)
4
4
 
5
- `SteelFrameKit` is a front-end development kit, which is developed to provide fault tolerant web applications.
5
+ AI can produce code. Organizations still have to produce software.
6
+ Agentic development is changing how software gets made,
7
+ but it hasn't changed what it cost to be wrong, `Steel Frame` do it.
6
8
 
7
9
  [![npm](https://img.shields.io/npm/v/steel-frame?style=round-square)](https://www.npmjs.com/package/steel-frame)
8
10
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/vasille-js/steel-frame)
@@ -13,12 +15,12 @@
13
15
  - [Steel Frame](#steel-frame)
14
16
  - [Table of content](#table-of-content)
15
17
  - [Installation](#installation)
16
- - [How to use SteelFramekit](#how-to-use-steelframekit)
18
+ - [How to use Steel Frame](#how-to-use-steel-frame)
17
19
  - [Full documentation:](#full-documentation)
18
20
  - [Examples](#examples)
19
- - [How SAFE is SteelFrameKit](#how-safe-is-steelframekit)
20
- - [How INTUITIVE is SteelFrameKit](#how-intuitive-is-steelframekit)
21
- - [How POWERFUL is SteelFrameKit](#how-powerful-is-steelframekit)
21
+ - [How SAFE is Steel Frame](#how-safe-is-steel-frame)
22
+ - [How INTUITIVE is Steel Frame](#how-intuitive-is-steel-frame)
23
+ - [How POWERFUL is Steel Frame](#how-powerful-is-steel-frame)
22
24
  - [Road map](#road-map)
23
25
  - [Change log](#change-log)
24
26
  - [7.0](#70)
@@ -38,7 +40,7 @@
38
40
  npm install steel-frame --save
39
41
  ```
40
42
 
41
- ## How to use SteelFramekit
43
+ ## How to use Steel Frame
42
44
 
43
45
  Create an app from a template
44
46
 
@@ -48,9 +50,10 @@ $ npm create steel-frame
48
50
 
49
51
  ### Full documentation:
50
52
 
51
- - [Learn `SteelFrameKit` in 5 minutes](https://github.com/vasille-js/vasille-js/blob/v5/doc/V4-API.md)
53
+ - [Learn `Steel Frame` in 5 minutes](https://github.com/vasille-js/vasille-js/blob/v5/doc/V7-API.md)
52
54
  - [Router Documentation](https://github.com/vasille-js/vasille-js/blob/v5/doc/Router-API.md)
53
- - [Compostion functions](https://github.com/vasille-js/vasille-js/blob/v5/doc/Compositions.md)
55
+ - [Compiler Hints](https://github.com/vasille-js/vasille-js/blob/v5/doc/CompilerHints.md)
56
+ - [Composition functions](https://github.com/vasille-js/vasille-js/blob/v5/doc/Compositions.md)
54
57
  - [Dependency injection](https://github.com/vasille-js/vasille-js/blob/v5/doc/Context.md)
55
58
 
56
59
  ### Examples
@@ -60,7 +63,7 @@ $ npm create steel-frame
60
63
 
61
64
  <hr>
62
65
 
63
- ## How SAFE is SteelFrameKit
66
+ ## How SAFE is Steel Frame
64
67
 
65
68
  The safe of your application is ensured by
66
69
 
@@ -68,7 +71,7 @@ The safe of your application is ensured by
68
71
  Each function, each branch is working as designed.
69
72
  - OOP, DRY, KISS and SOLID principles are applied.
70
73
  - `strong typing` makes your code safe.
71
- All entities of `SteelFrameKit` core library are strongly typed, including:
74
+ All entities of `Steel Frame` core library are strongly typed, including:
72
75
  - data fields & properties.
73
76
  - computed properties (function parameters and result).
74
77
  - methods.
@@ -78,7 +81,7 @@ The safe of your application is ensured by
78
81
  - references to children.
79
82
  - No asynchronous code, when the line of code is executed, the DOM and reactive things are already synced.
80
83
 
81
- ## How INTUITIVE is SteelFrameKit
84
+ ## How INTUITIVE is Steel Frame
82
85
 
83
86
  There is the "Hello World":
84
87
 
@@ -92,7 +95,7 @@ const App = compose(() => {
92
95
  mount(document.body, App, {});
93
96
  ```
94
97
 
95
- ## How POWERFUL is SteelFrameKit
98
+ ## How POWERFUL is Steel Frame
96
99
 
97
100
  All of these are supported:
98
101
 
@@ -132,7 +135,23 @@ We respect semantic versioning:
132
135
 
133
136
  ### 7.0
134
137
 
135
- - WIP
138
+ - Add `debounced` and `field` functions, which extend the reativity system.
139
+ - Add `Zombie` component, it keeps HTML elements alive some time after destruction.
140
+ - Add `abortSignal` to cancel fetch requests and timers when component is destroyed.
141
+ - Renamed `ref` to `state`, `bind` to `live`, `watch` to `effect`, depracated `calculate`.
142
+ - Add `safeState`, `safeLive`, `safeInit` functions, they make the JSX much safer.
143
+ - `callback` handler can return cleanup function.
144
+ - Navigation paths are now checked in compile time, missing paths are reported.
145
+ - Injected dependencies now are tracked in compile time, missing dependencies are reported.
146
+ - Support for wrapper in router, it can provide global dependencies.
147
+ - Reactive members are forbidden in live expressions. **[API change]**
148
+ - Reactive values are not unwrapped automatically, need `unwrap` call. **[API change]**
149
+ - Reactivity breaking is now reported in compile time. **[API change]**
150
+ - Writing to reactive states from effects is restricted,
151
+ workaround with `bypassWriteRestriction`. **[API change]**
152
+ - New reactivity marks `r_` & `wr_` insted of `$`,
153
+ workaround with `v4-naming` compilation flag. **[API change]**
154
+ - Component files have strict structure (imports, export, helpers, CSS). **[API change]**
136
155
 
137
156
  ### 6.0 RC (never released)
138
157
 
@@ -161,17 +180,17 @@ We respect semantic versioning:
161
180
 
162
181
  - Switch to a babel plugin to compile components code. **[API change]**
163
182
  - 100% of the code has been covered with unit tests.
164
- - New developement direction: `keep it simple`.
183
+ - New development direction: `keep it simple`.
165
184
 
166
185
  ### 2.0 - 2.3
167
186
 
168
187
  - Introduces components compilation via a typescript plugin. **[API change]**
169
- - New developement direction: `write less, do more`.
188
+ - New development direction: `write less, do more`.
170
189
 
171
190
  ### 1.0 - 1.2
172
191
 
173
192
  - Initial version of a core library.
174
- - Developemnt direction: `performance-first`.
193
+ - Development direction: `performance-first`.
175
194
 
176
195
  ## Questions
177
196
 
package/StartUp.md ADDED
@@ -0,0 +1,526 @@
1
+ # Getting Started with Steel Frame
2
+
3
+ `SteelFrameKit` is a front-end development kit designed to build **fault-tolerant web applications**. Code is compiled by a Babel plugin: your components are plain functions with JSX, and reactivity is expressed through variable naming conventions — no hooks, no virtual DOM, no asynchronous rendering.
4
+
5
+ ## Table of Content
6
+
7
+ - [Create a Project](#create-a-project)
8
+ - [CLI Commands](#cli-commands)
9
+ - [Project Structure](#project-structure)
10
+ - [Your First Component](#your-first-component)
11
+ - [Reactivity](#reactivity)
12
+ - [Conditional Rendering](#conditional-rendering)
13
+ - [Loops](#loops)
14
+ - [Components, Props & Slots](#components-props--slots)
15
+ - [Pages & Routing](#pages--routing)
16
+ - [Screens (SPA only)](#screens-spa-only)
17
+ - [Models & Stores](#models--stores)
18
+ - [Modals & Prompts](#modals--prompts)
19
+ - [Styling](#styling)
20
+ - [Lifecycle & Effects](#lifecycle--effects)
21
+ - [Dependency Injection](#dependency-injection)
22
+ - [Fault Tolerance Helpers](#fault-tolerance-helpers)
23
+
24
+ ## Create a Project
25
+
26
+ The fastest way to start is the official project generator:
27
+
28
+ ```bash
29
+ npm create steel-frame
30
+ ```
31
+
32
+ It scaffolds a starting project with everything configured. Then:
33
+
34
+ ```bash
35
+ cd my-app
36
+ npm install
37
+ npx web dev
38
+ ```
39
+
40
+ If you add Steel Frame to an existing project manually:
41
+
42
+ ```bash
43
+ npm install steel-frame --save
44
+ ```
45
+
46
+ And configure `tsconfig.json` to use the Steel Frame JSX runtime:
47
+
48
+ ```json
49
+ {
50
+ "compilerOptions": {
51
+ "jsx": "preserve",
52
+ "jsxImportSource": "steel-frame",
53
+ "module": "Node16",
54
+ "moduleResolution": "node16",
55
+ "strictNullChecks": true,
56
+ "lib": ["ES2024", "DOM"]
57
+ }
58
+ }
59
+ ```
60
+
61
+ ## CLI Commands
62
+
63
+ Steel Frame ships a CLI binary named `web`. Running `npx web` without arguments opens an interactive menu.
64
+
65
+ | Command | Description |
66
+ | ---------------------- | --------------------------------------------------------------- |
67
+ | `web dev` | Start a hot-reload development server (Vite based) |
68
+ | `web dev+lib` | Development server for a component library |
69
+ | `web build spa` | Build a Single Page Application with the built-in router |
70
+ | `web build html` | Build a static HTML site (SSG) |
71
+ | `web build md` | Build a static Markdown site (LLM dedicated) |
72
+ | `web build md+html` | Build documentation for git (Markdown with inline HTML) |
73
+ | `web build lib` | Build a component library usable in SPA or SSG |
74
+ | `web build components` | Build a web components library usable in any frontend framework |
75
+
76
+ Build output goes to `dist/` (`dist/spa`, `dist/html`, `dist/md`, `dist/lib`, `dist/components`).
77
+
78
+ ## Project Structure
79
+
80
+ ```
81
+ my-app/
82
+ ├── src/
83
+ │ ├── pages/ # file-based routes (universal: SPA, SSG, planned SSR)
84
+ │ │ ├── index.tsx # route "/"
85
+ │ │ ├── about.tsx # route "/about"
86
+ │ │ └── (id).tsx # dynamic route "/:id"
87
+ │ ├── router/ # optional router customization
88
+ │ │ ├── fallbackScreen.tsx
89
+ │ │ ├── errorScreen.tsx
90
+ │ │ ├── loadingScreen.tsx
91
+ │ │ └── loadingOverlay.tsx
92
+ │ ├── components/ # components (name: UpperCase)
93
+ │ ├── views/ # views (name: UpperCase + `View` suffix)
94
+ │ ├── screens/ # screens (name: `Screen` suffix, SPA only)
95
+ │ ├── modals/ # modals (name: UpperCase + `Modal` suffix)
96
+ │ ├── prompts/ # prompts (name: `prompt` prefix)
97
+ │ ├── models/ # models (name: lowercase + `Model` suffix)
98
+ │ └── stores/ # stores (name: lowercase + `Store` suffix)
99
+ ├── tsconfig.json
100
+ └── package.json
101
+ ```
102
+
103
+ Naming conventions are enforced at compile time: each entity kind must live in its dedicated folder and respect its naming pattern. The `@` import alias points to `src/`.
104
+
105
+ ## Your First Component
106
+
107
+ ```tsx
108
+ import { component, mount } from "steel-frame";
109
+
110
+ const App = component(() => {
111
+ <p>Hello world</p>;
112
+ });
113
+
114
+ mount(document.body, App, {});
115
+ ```
116
+
117
+ No `return` of JSX is needed — JSX statements render in place, synchronously. When a line of code has executed, the DOM is already in sync.
118
+
119
+ ## Reactivity
120
+
121
+ Reactivity is declared through **name prefixes** (reactivity marks):
122
+
123
+ | Prefix | Meaning | Declared with |
124
+ | ------ | --------------------------------------------- | ----------------------- |
125
+ | `wr_` | **writable reactive** value (state) | `let wr_x = ...` |
126
+ | `r_` | **readonly reactive** value (derived/expression) | `const r_y = wr_x + 1` |
127
+
128
+ > The `$` prefix is a legacy mark from older versions. Do not use it in new code.
129
+
130
+ ```tsx
131
+ import { component, state, live, field, debounced, effect, unwrap } from "steel-frame";
132
+
133
+ const Counter = component(() => {
134
+ // writable state: `let` + `wr_` prefix
135
+ let wr_count = 0; // implicit state
136
+ let wr_other = state(2); // explicit state constructor
137
+
138
+ // readonly derived values: `const` + `r_` prefix
139
+ const r_double = wr_count * 2; // implicit computed
140
+ const r_label = live(`Count: ${wr_count}`); // explicit computed
141
+
142
+ // reactive reference to an object field
143
+ let wr_obj = { a: { b: 1 } };
144
+ const wr_b = field(wr_obj.a.b);
145
+
146
+ // debounced readonly projection of a state
147
+ const r_debounced = debounced(wr_count, 100);
148
+
149
+ // effect: re-runs when a dependency changes
150
+ effect(() => {
151
+ console.log("count is", wr_count);
152
+ });
153
+
154
+ // unwrap() reads the raw value without creating a dependency
155
+ const initial = unwrap(wr_count);
156
+
157
+ <div>
158
+ <p>{r_label}</p>
159
+ <button onclick={() => (wr_count += 1)}>+1</button>
160
+ </div>;
161
+ });
162
+ ```
163
+
164
+ Rules enforced by the compiler:
165
+
166
+ - Assigning to an `r_` value is forbidden (`Writing to readonly reactive values is forbidden`).
167
+ - `const r_ = state(..)` is rejected — a state is writable, so it needs the `wr_` mark.
168
+ - `let wr_ = live(..)` or `wr_ = debounced(..)` is rejected — derived values are readonly, so they need the `r_` mark.
169
+ - A readonly value cannot be passed where a component expects a writable (`wr_`) prop.
170
+ - Inside `effect`, states cannot be written directly (escape hatch: `bypassWriteRestriction`, deprecated — report such cases).
171
+
172
+ ### Reactive Collections
173
+
174
+ Plain arrays/sets/maps are not implicitly reactive. Use models:
175
+
176
+ ```tsx
177
+ import { arrayModel, setModel, mapModel } from "steel-frame";
178
+
179
+ const items = arrayModel([1, 2, 3]); // push/splice/... trigger updates
180
+ const tags = setModel(["a", "b"]); // add/delete trigger updates
181
+ const dict = mapModel([["k", 1]]); // set/delete trigger updates
182
+ ```
183
+
184
+ ### Async Data
185
+
186
+ ```tsx
187
+ import { component, awaited, abortSignal } from "steel-frame";
188
+
189
+ const UserCard = component(() => {
190
+ // awaited: async data in a sync component
191
+ const [r_err, r_user] = awaited(signal => fetch("/api/user", { signal }).then(r => r.json()));
192
+
193
+ // abortSignal(): cancels requests/timers when the component is destroyed
194
+ const signal = abortSignal();
195
+ });
196
+ ```
197
+
198
+ ## Conditional Rendering
199
+
200
+ ```tsx
201
+ import { component, If, ElseIf, Else } from "steel-frame";
202
+
203
+ const Status = component((props: { wr_value: number }) => {
204
+ <>
205
+ <If $condition={props.wr_value > 10}>big</If>
206
+ <ElseIf $condition={props.wr_value > 5}>medium</ElseIf>
207
+ <Else>small</Else>
208
+
209
+ {/* inline forms are also reactive */}
210
+ {props.wr_value > 0 ? <>positive</> : <>non-positive</>}
211
+ {props.wr_value && <>non-zero</>}
212
+ </>;
213
+ });
214
+ ```
215
+
216
+ ## Loops
217
+
218
+ ```tsx
219
+ import { component, For, ArrayView, ArrayModelView, arrayModel } from "steel-frame";
220
+
221
+ const List = component(() => {
222
+ const items = arrayModel(["a", "b", "c"]);
223
+
224
+ <>
225
+ {/* static-ish iteration over array/set/map */}
226
+ <For of={items} slot={value => <li>{value}</li>} />
227
+
228
+ {/* reactive array with diff algorithm (keyed) */}
229
+ <ArrayView $of={items} key={v => v} slot={(r_value, r_index) => <li>{r_value}</li>} />
230
+
231
+ {/* fine-grained model views */}
232
+ <ArrayModelView of={items} slot={(value, r_index) => <li>{value}</li>} />
233
+ </>;
234
+ });
235
+ ```
236
+
237
+ Also available: `MapModelView`, `SetModelView`, `Iterate`, `ForEach`, `Watch`, `Delay`, `QueuedRender` (non-blocking rendering queue), and `Zombie` (keeps HTML elements alive for a while after destruction).
238
+
239
+ ## Components, Props & Slots
240
+
241
+ ```tsx
242
+ import { component, Slot } from "steel-frame";
243
+
244
+ interface Props {
245
+ // reactivity marks work in props too:
246
+ wr_value: number; // writable reactive prop (2-way binding)
247
+ r_label: string; // readonly reactive prop
248
+ max: number; // static prop
249
+ slot?: () => void; // slot
250
+ }
251
+
252
+ const Field = component((props: Props) => {
253
+ <div>
254
+ <span>{props.r_label}</span>
255
+ <input oninput={ev => (props.wr_value = Number(ev.currentTarget.value))} />
256
+ <Slot model={props.slot} />
257
+ </div>;
258
+ });
259
+
260
+ const Form = component(() => {
261
+ let wr_age = 18;
262
+ const r_title = "Age";
263
+
264
+ <Field wr_value={wr_age} r_label={r_title} max={100}>
265
+ <small>Required field</small>
266
+ </Field>;
267
+ });
268
+ ```
269
+
270
+ A component can expose data to its parent via `return` + the `callback` prop:
271
+
272
+ ```tsx
273
+ const Exposing = component(() => {
274
+ let wr_x = 1;
275
+ return { wr_x };
276
+ });
277
+
278
+ const Parent = component(() => {
279
+ <Exposing callback={data => console.log(data.wr_x)} />;
280
+ });
281
+ ```
282
+
283
+ DOM references and lifecycle per element use `callback` on tags (the returned function runs on element destruction):
284
+
285
+ ```tsx
286
+ <div
287
+ callback={div => {
288
+ div.style.display = "none";
289
+ return () => (div.style.display = "block");
290
+ }}
291
+ />;
292
+ ```
293
+
294
+ ## Pages & Routing
295
+
296
+ **`page` is the universal composition for application pages** — it works with SPA, SSG (static site generation), and planned SSR. It is available starting with v5.
297
+
298
+ Pages live in `src/pages/` and use file-based routing. Each page file **default-exports** a `page`, and its route type parameter must match the file path:
299
+
300
+ ```tsx
301
+ // src/pages/index.tsx → route "/"
302
+ import { page } from "steel-frame";
303
+
304
+ export default page<"/">(async props => {
305
+ <h1>Home</h1>;
306
+ });
307
+ ```
308
+
309
+ ```tsx
310
+ // src/pages/about.tsx → route "/about"
311
+ import { page } from "steel-frame";
312
+
313
+ export default page<"/about">(async props => {
314
+ <h1>About — {props.path}</h1>;
315
+ });
316
+ ```
317
+
318
+ Dynamic segments use parentheses in the file name:
319
+
320
+ ```tsx
321
+ // src/pages/(id).tsx → route "/:id"
322
+ import { page } from "steel-frame";
323
+
324
+ export default page<"/(id)">(async ({ params }) => {
325
+ <h1>Item {params.id}</h1>;
326
+ });
327
+ ```
328
+
329
+ Folders nest routes: `src/pages/blog/(slug).tsx` → `/blog/:slug`. An `index.tsx` inside a folder maps to the folder path itself.
330
+
331
+ Page props include `path`, `params`, `query`, `url` and `hash` — all strongly typed from the route string.
332
+
333
+ Navigation is done through the current router:
334
+
335
+ ```tsx
336
+ import { component, beforeMount, router } from "steel-frame";
337
+
338
+ const Nav = component(() => {
339
+ <button onclick={() => router()?.goTo("/about")}>About</button>;
340
+ });
341
+ ```
342
+
343
+ Router behavior can be customized by placing files in `src/router/`: `fallbackScreen` (not-found / no-access), `errorScreen`, `loadingScreen`, `loadingOverlay`, and `checkAccess` (access levels).
344
+
345
+ ## Screens (SPA only)
346
+
347
+ **`screen` is compatible with SPA only.** Use it when you build a pure Single Page Application with the programmatic router instead of (or alongside) file-based pages:
348
+
349
+ ```tsx
350
+ import { screen, routerApp } from "steel-frame";
351
+
352
+ const MainScreen = screen<"/">(async props => {
353
+ <h1>Main</h1>;
354
+ });
355
+
356
+ const ItemScreen = screen<"/item/(id)">(async ({ params }) => {
357
+ <h1>Item {params.id}</h1>;
358
+ });
359
+
360
+ routerApp({
361
+ routes: {
362
+ "/": { screen: MainScreen },
363
+ "/item/(id)": { screen: ItemScreen, minAccessLevel: 1 },
364
+ },
365
+ getAccessLevel: async () => 1,
366
+ fallbackScreen: ({ cause }) => {
367
+ <p>{cause === "not-found" ? "404" : "403"}</p>;
368
+ },
369
+ });
370
+ ```
371
+
372
+ If you target SSG or future SSR, prefer `page` — screens will not be rendered statically.
373
+
374
+ ## Models & Stores
375
+
376
+ A **model** is a reusable reactive state constructor; a **store** is a singleton state kept in memory:
377
+
378
+ ```tsx
379
+ // src/models/counterModel.ts
380
+ import { model, createModel, component, beforeMount } from "steel-frame";
381
+
382
+ export const counterModel = model((props: { start: number }) => {
383
+ let wr_count = props.start;
384
+ return { wr_count };
385
+ });
386
+
387
+ // usage inside a component
388
+ const Counter = component(() => {
389
+ const counter = createModel(counterModel, { start: 0 });
390
+
391
+ <button onclick={() => (counter.wr_count += 1)}>{counter.wr_count}</button>;
392
+ });
393
+ ```
394
+
395
+ ```tsx
396
+ // src/stores/userStore.ts
397
+ import { store } from "steel-frame";
398
+
399
+ export const userStore = store(() => {
400
+ let wr_name = "guest";
401
+ return { wr_name };
402
+ });
403
+
404
+ // anywhere: userStore.wr_name (readonly state view from outside)
405
+ ```
406
+
407
+ ## Modals & Prompts
408
+
409
+ ```tsx
410
+ // src/modals/ConfirmModal.tsx
411
+ import { modal } from "steel-frame";
412
+
413
+ export const ConfirmModal = modal((props: { wr_open: boolean }) => {
414
+ <If $condition={props.wr_open}>
415
+ <div class="overlay">...</div>
416
+ </If>;
417
+ });
418
+ ```
419
+
420
+ Prompts are modals that resolve a value, shown imperatively:
421
+
422
+ ```tsx
423
+ // src/prompts/promptName.tsx
424
+ import { prompt, showPrompt, component } from "steel-frame";
425
+
426
+ export const promptName = prompt<string>(props => {
427
+ <div>
428
+ <input onchange={ev => props.resolve(ev.currentTarget.value)} />
429
+ <button onclick={() => props.reject(new Error("cancelled"))}>Cancel</button>
430
+ </div>;
431
+ });
432
+
433
+ const C = component(() => {
434
+ <button onclick={async () => console.log(await showPrompt(promptName, {}))}>Ask name</button>;
435
+ });
436
+ ```
437
+
438
+ ## Styling
439
+
440
+ Local stylesheets with themes and responsive helpers:
441
+
442
+ ```tsx
443
+ import { styleSheet, dark, light, mobile, tablet, laptop, theme, prefersDark } from "steel-frame";
444
+
445
+ const styles = styleSheet({
446
+ card: {
447
+ padding: [10, 5],
448
+ display: "block",
449
+ margin: [laptop(40), tablet(20), mobile(10)],
450
+ color: ["#222", dark("#eee")],
451
+ background: [theme("red", "#f00"), theme("blue", "#00f")],
452
+ ":hover": { opacity: 0.8 },
453
+ "@media (max-width: 600px)": { padding: 4 },
454
+ },
455
+ });
456
+
457
+ const Card = component(() => {
458
+ <div class={styles.card}>...</div>;
459
+ });
460
+ ```
461
+
462
+ Breakpoints are configurable with `setMobileMaxWidth`, `setTabletMaxWidth`, `setLaptopMaxWidth`.
463
+
464
+ ## Lifecycle & Effects
465
+
466
+ ```tsx
467
+ import { component, beforeMount, afterMount, beforeDestroy, effect } from "steel-frame";
468
+
469
+ const C = component(() => {
470
+ beforeMount(() => { /* before DOM mount, may be async */ });
471
+ afterMount(() => { /* after DOM mount, may be async */ });
472
+ beforeDestroy(() => { /* cleanup */ });
473
+
474
+ effect(() => { /* re-runs when reactive dependencies change */ });
475
+ });
476
+ ```
477
+
478
+ ## Dependency Injection
479
+
480
+ Share values down the component tree:
481
+
482
+ ```tsx
483
+ import { component, context, share, receive, receiveOptional, impute } from "steel-frame";
484
+
485
+ const themeCtx = context((name: string) => ({ name }));
486
+
487
+ const Parent = component(() => {
488
+ share(themeCtx, "dark"); // share a context
489
+ share("api-url", "/api"); // share a setting
490
+ share(MyService, new MyService()); // share a class instance
491
+
492
+ <Child />;
493
+ });
494
+
495
+ const Child = component(() => {
496
+ const theme = receive(themeCtx); // required
497
+ const apiUrl = receiveOptional("api-url"); // optional
498
+ const svc = impute(MyService, () => new MyService()); // create when missing
499
+ });
500
+ ```
501
+
502
+ ## Fault Tolerance Helpers
503
+
504
+ Errors are contained, not propagated — a failing component does not crash the app:
505
+
506
+ ```tsx
507
+ import { setErrorHandler, safe, safeInit, safeState, safeLive } from "steel-frame";
508
+
509
+ setErrorHandler(e => reportToServer(e));
510
+
511
+ const C = component(() => {
512
+ const a = safeInit(mayThrow()); // undefined on failure
513
+ const wr_b = safeState(mayThrow()); // undefined state on failure
514
+ const r_c = safeLive(wr_b ?? 0 + mayThrow()); // undefined computed on failure
515
+ });
516
+ ```
517
+
518
+ JSX attribute and child expressions are automatically made safe by the compiler; errors are reported through the configured handler.
519
+
520
+ ---
521
+
522
+ **Next steps:**
523
+
524
+ - Run `npm create steel-frame` and explore the generated project.
525
+ - Start the dev server with `npx web dev`.
526
+ - Ship with `npx web build spa` or `npx web build html`.
@@ -0,0 +1,5 @@
1
+ import { NodePath, types } from "@babel/core";
2
+ export declare function abortStatements(paths: NodePath<types.Statement>[], abortsCheck: types.Expression): boolean;
3
+ export declare function abortExpression(path: NodePath<types.Expression | null | undefined>, abortsCheck: types.Expression): boolean;
4
+ export declare function abortStatement(path: NodePath<types.Statement | null | undefined>, abortsCheck: types.Expression): boolean;
5
+ export declare function abortFunction(path: NodePath<types.ArrowFunctionExpression | types.FunctionExpression>, abortsCheck: types.Expression): boolean;