toiljs 0.0.4 → 0.0.6

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 (409) hide show
  1. package/.idea/prettier.xml +1 -0
  2. package/as-pect.config.js +1 -1
  3. package/build/backend/.tsbuildinfo +1 -1
  4. package/build/backend/index.js +1 -2
  5. package/build/cli/.tsbuildinfo +1 -1
  6. package/build/cli/configure.d.ts +15 -0
  7. package/build/cli/configure.js +201 -0
  8. package/build/cli/create.d.ts +4 -0
  9. package/build/cli/create.js +193 -68
  10. package/build/cli/features.d.ts +23 -0
  11. package/build/cli/features.js +85 -0
  12. package/build/cli/index.js +42 -2
  13. package/build/cli/proc.d.ts +1 -0
  14. package/build/cli/proc.js +11 -0
  15. package/build/cli/ui.js +1 -2
  16. package/build/cli/validate.d.ts +4 -0
  17. package/build/cli/validate.js +19 -0
  18. package/build/client/.tsbuildinfo +1 -1
  19. package/build/client/Link.d.ts +8 -0
  20. package/build/client/Link.js +44 -0
  21. package/build/client/NavLink.d.ts +14 -0
  22. package/build/client/NavLink.js +37 -0
  23. package/build/client/Router.d.ts +7 -0
  24. package/build/client/Router.js +55 -0
  25. package/build/client/channel/channel.d.ts +23 -0
  26. package/build/client/channel/channel.js +94 -0
  27. package/build/client/error-boundary.d.ts +16 -0
  28. package/build/client/error-boundary.js +19 -0
  29. package/build/client/head/head.d.ts +26 -0
  30. package/build/client/head/head.js +87 -0
  31. package/build/client/head.d.ts +26 -0
  32. package/build/client/head.js +87 -0
  33. package/build/client/hooks.d.ts +17 -0
  34. package/build/client/hooks.js +48 -0
  35. package/build/client/index.d.ts +18 -6
  36. package/build/client/index.js +10 -3
  37. package/build/client/lazy.d.ts +16 -0
  38. package/build/client/lazy.js +53 -0
  39. package/build/client/match.js +7 -0
  40. package/build/client/mount.d.ts +2 -0
  41. package/build/client/mount.js +13 -0
  42. package/build/client/navigation/Link.d.ts +8 -0
  43. package/build/client/navigation/Link.js +44 -0
  44. package/build/client/navigation/NavLink.d.ts +14 -0
  45. package/build/client/navigation/NavLink.js +37 -0
  46. package/build/client/navigation/navigation.d.ts +13 -0
  47. package/build/client/navigation/navigation.js +97 -0
  48. package/build/client/navigation/prefetch.d.ts +11 -0
  49. package/build/client/navigation/prefetch.js +100 -0
  50. package/build/client/navigation/scroll.d.ts +8 -0
  51. package/build/client/navigation/scroll.js +36 -0
  52. package/build/client/navigation.d.ts +13 -0
  53. package/build/client/navigation.js +97 -0
  54. package/build/client/params-context.d.ts +2 -0
  55. package/build/client/params-context.js +2 -0
  56. package/build/client/prefetch.d.ts +11 -0
  57. package/build/client/prefetch.js +100 -0
  58. package/build/client/routing/Router.d.ts +7 -0
  59. package/build/client/routing/Router.js +55 -0
  60. package/build/client/routing/error-boundary.d.ts +16 -0
  61. package/build/client/routing/error-boundary.js +19 -0
  62. package/build/client/routing/hooks.d.ts +17 -0
  63. package/build/client/routing/hooks.js +48 -0
  64. package/build/client/routing/lazy.d.ts +16 -0
  65. package/build/client/routing/lazy.js +53 -0
  66. package/build/client/routing/match.d.ts +2 -0
  67. package/build/client/routing/match.js +32 -0
  68. package/build/client/routing/mount.d.ts +2 -0
  69. package/build/client/routing/mount.js +13 -0
  70. package/build/client/routing/params-context.d.ts +2 -0
  71. package/build/client/routing/params-context.js +2 -0
  72. package/build/client/scroll.d.ts +8 -0
  73. package/build/client/scroll.js +36 -0
  74. package/build/client/types.d.ts +27 -0
  75. package/build/client/types.js +1 -0
  76. package/build/compiler/.tsbuildinfo +1 -1
  77. package/build/compiler/config.d.ts +2 -0
  78. package/build/compiler/config.js +14 -2
  79. package/build/compiler/docs.d.ts +10 -0
  80. package/build/compiler/docs.js +59 -0
  81. package/build/compiler/generate.js +144 -16
  82. package/build/compiler/index.d.ts +4 -2
  83. package/build/compiler/index.js +4 -3
  84. package/build/compiler/plugin.js +16 -1
  85. package/build/compiler/routes.js +5 -1
  86. package/build/compiler/vite.d.ts +1 -1
  87. package/build/compiler/vite.js +17 -1
  88. package/build/io/.tsbuildinfo +1 -1
  89. package/build/io/BinaryWriter.js +2 -2
  90. package/eslint.config.js +1 -1
  91. package/examples/basic/.toil/docs/cli.md +3 -0
  92. package/examples/basic/.toil/docs/client.md +3 -0
  93. package/examples/basic/.toil/docs/index.md +3 -0
  94. package/examples/basic/.toil/docs/routing.md +3 -0
  95. package/examples/basic/.toil/docs/server.md +3 -0
  96. package/examples/basic/.toil/docs/styling.md +3 -0
  97. package/examples/basic/.toil/entry.tsx +3 -8
  98. package/examples/basic/.toil/globals.ts +6 -0
  99. package/examples/basic/.toil/index.html +16 -12
  100. package/examples/basic/.toil/public/images/.gitkeep +1 -0
  101. package/examples/basic/.toil/public/images/logo.svg +37 -0
  102. package/examples/basic/.toil/public/robots.txt +2 -0
  103. package/examples/basic/.toil/routes.ts +9 -7
  104. package/examples/basic/build/client/assets/404-Bq0jNTUo.js +1 -0
  105. package/examples/basic/build/client/assets/_...slug_-CXKf6qnB.js +1 -0
  106. package/examples/basic/build/client/assets/_id_-BadAyQnb.js +1 -0
  107. package/examples/basic/build/client/assets/about-BOhoEcEO.js +1 -0
  108. package/examples/basic/build/client/assets/get-started-BIXpcjkT.js +9 -0
  109. package/examples/basic/build/client/assets/index-BmqcTaBB.js +1 -0
  110. package/examples/basic/build/client/assets/io-DEVjjaJj.js +1 -0
  111. package/examples/basic/build/client/assets/layout-DJegirdz.js +1 -0
  112. package/examples/basic/build/client/assets/react-DEQrz1q7.js +9 -0
  113. package/examples/basic/build/client/assets/rolldown-runtime-KL5VtC6j.js +1 -0
  114. package/examples/basic/build/client/assets/routes-BYWn6TxK.js +1 -0
  115. package/examples/basic/build/client/css/style.css +2 -0
  116. package/examples/basic/build/client/images/.gitkeep +1 -0
  117. package/examples/basic/build/client/images/logo.svg +37 -0
  118. package/examples/basic/build/client/index.html +17 -0
  119. package/examples/basic/build/client/robots.txt +2 -0
  120. package/examples/basic/client/404.tsx +2 -5
  121. package/examples/basic/client/components/.gitkeep +1 -0
  122. package/examples/basic/client/components/Footer.tsx +8 -0
  123. package/examples/basic/client/components/HoneycombBackground.tsx +162 -0
  124. package/examples/basic/client/layout.tsx +43 -26
  125. package/examples/basic/client/public/favicon.ico +0 -0
  126. package/examples/basic/client/public/images/.gitkeep +1 -0
  127. package/examples/basic/client/public/images/logo.svg +37 -0
  128. package/examples/basic/client/public/index.html +16 -0
  129. package/examples/basic/client/public/robots.txt +2 -0
  130. package/examples/basic/client/routes/about.tsx +1 -3
  131. package/examples/basic/client/routes/blog/[id].tsx +2 -4
  132. package/examples/basic/client/routes/docs/[...slug].tsx +3 -6
  133. package/examples/basic/client/routes/get-started.tsx +84 -0
  134. package/examples/basic/client/routes/index.tsx +74 -7
  135. package/examples/basic/client/routes/io.tsx +3 -7
  136. package/examples/basic/client/styles/main.css +461 -0
  137. package/examples/basic/client/toil.tsx +7 -0
  138. package/examples/basic/node_modules/.bin/toilinit +16 -0
  139. package/examples/basic/node_modules/.bin/toilinit.cmd +17 -0
  140. package/examples/basic/node_modules/.bin/toilinit.ps1 +28 -0
  141. package/examples/basic/node_modules/.bin/toilscript +16 -0
  142. package/examples/basic/node_modules/.bin/toilscript.cmd +17 -0
  143. package/examples/basic/node_modules/.bin/toilscript.ps1 +28 -0
  144. package/examples/basic/node_modules/.bin/wasm-as +16 -0
  145. package/examples/basic/node_modules/.bin/wasm-as.cmd +17 -0
  146. package/examples/basic/node_modules/.bin/wasm-as.ps1 +28 -0
  147. package/examples/basic/node_modules/.bin/wasm-ctor-eval +16 -0
  148. package/examples/basic/node_modules/.bin/wasm-ctor-eval.cmd +17 -0
  149. package/examples/basic/node_modules/.bin/wasm-ctor-eval.ps1 +28 -0
  150. package/examples/basic/node_modules/.bin/wasm-dis +16 -0
  151. package/examples/basic/node_modules/.bin/wasm-dis.cmd +17 -0
  152. package/examples/basic/node_modules/.bin/wasm-dis.ps1 +28 -0
  153. package/examples/basic/node_modules/.bin/wasm-merge +16 -0
  154. package/examples/basic/node_modules/.bin/wasm-merge.cmd +17 -0
  155. package/examples/basic/node_modules/.bin/wasm-merge.ps1 +28 -0
  156. package/examples/basic/node_modules/.bin/wasm-metadce +16 -0
  157. package/examples/basic/node_modules/.bin/wasm-metadce.cmd +17 -0
  158. package/examples/basic/node_modules/.bin/wasm-metadce.ps1 +28 -0
  159. package/examples/basic/node_modules/.bin/wasm-opt +16 -0
  160. package/examples/basic/node_modules/.bin/wasm-opt.cmd +17 -0
  161. package/examples/basic/node_modules/.bin/wasm-opt.ps1 +28 -0
  162. package/examples/basic/node_modules/.bin/wasm-reduce +16 -0
  163. package/examples/basic/node_modules/.bin/wasm-reduce.cmd +17 -0
  164. package/examples/basic/node_modules/.bin/wasm-reduce.ps1 +28 -0
  165. package/examples/basic/node_modules/.bin/wasm-shell +16 -0
  166. package/examples/basic/node_modules/.bin/wasm-shell.cmd +17 -0
  167. package/examples/basic/node_modules/.bin/wasm-shell.ps1 +28 -0
  168. package/examples/basic/node_modules/.bin/wasm2js +16 -0
  169. package/examples/basic/node_modules/.bin/wasm2js.cmd +17 -0
  170. package/examples/basic/node_modules/.bin/wasm2js.ps1 +28 -0
  171. package/examples/basic/node_modules/.package-lock.json +49 -1
  172. package/examples/basic/node_modules/.vite/deps/_metadata.json +9 -9
  173. package/examples/basic/node_modules/binaryen/LICENSE +201 -0
  174. package/examples/basic/node_modules/binaryen/README.md +1362 -0
  175. package/examples/basic/node_modules/binaryen/bin/package.json +3 -0
  176. package/examples/basic/node_modules/binaryen/bin/wasm-as +0 -0
  177. package/examples/basic/node_modules/binaryen/bin/wasm-ctor-eval +0 -0
  178. package/examples/basic/node_modules/binaryen/bin/wasm-dis +0 -0
  179. package/examples/basic/node_modules/binaryen/bin/wasm-merge +0 -0
  180. package/examples/basic/node_modules/binaryen/bin/wasm-metadce +0 -0
  181. package/examples/basic/node_modules/binaryen/bin/wasm-opt +0 -0
  182. package/examples/basic/node_modules/binaryen/bin/wasm-reduce +0 -0
  183. package/examples/basic/node_modules/binaryen/bin/wasm-shell +0 -0
  184. package/examples/basic/node_modules/binaryen/bin/wasm2js +0 -0
  185. package/examples/basic/node_modules/binaryen/index.d.ts +2371 -0
  186. package/examples/basic/node_modules/binaryen/index.js +30552 -0
  187. package/examples/basic/node_modules/binaryen/package.json +50 -0
  188. package/examples/basic/node_modules/long/LICENSE +202 -0
  189. package/examples/basic/node_modules/long/README.md +286 -0
  190. package/examples/basic/node_modules/long/index.d.ts +2 -0
  191. package/examples/basic/node_modules/long/index.js +1581 -0
  192. package/examples/basic/node_modules/long/package.json +58 -0
  193. package/examples/basic/node_modules/long/types.d.ts +474 -0
  194. package/examples/basic/node_modules/long/umd/index.d.ts +3 -0
  195. package/examples/basic/node_modules/long/umd/index.js +1622 -0
  196. package/examples/basic/node_modules/long/umd/package.json +3 -0
  197. package/examples/basic/node_modules/long/umd/types.d.ts +474 -0
  198. package/examples/basic/node_modules/toilscript/LICENSE +201 -0
  199. package/examples/basic/node_modules/toilscript/NOTICE +94 -0
  200. package/examples/basic/node_modules/toilscript/README.md +66 -0
  201. package/examples/basic/node_modules/toilscript/bin/toilinit.js +468 -0
  202. package/examples/basic/node_modules/toilscript/bin/toilscript.js +35 -0
  203. package/examples/basic/node_modules/toilscript/dist/cli.d.ts +4 -0
  204. package/examples/basic/node_modules/toilscript/dist/cli.generated.d.ts +10027 -0
  205. package/examples/basic/node_modules/toilscript/dist/cli.js +24474 -0
  206. package/examples/basic/node_modules/toilscript/dist/cli.js.map +7 -0
  207. package/examples/basic/node_modules/toilscript/dist/importmap.json +9 -0
  208. package/examples/basic/node_modules/toilscript/dist/toilscript.d.ts +4 -0
  209. package/examples/basic/node_modules/toilscript/dist/toilscript.generated.d.ts +11242 -0
  210. package/examples/basic/node_modules/toilscript/dist/toilscript.js +337 -0
  211. package/examples/basic/node_modules/toilscript/dist/toilscript.js.map +7 -0
  212. package/examples/basic/node_modules/toilscript/dist/transform.cjs +1 -0
  213. package/examples/basic/node_modules/toilscript/dist/transform.d.ts +1 -0
  214. package/examples/basic/node_modules/toilscript/dist/transform.js +1 -0
  215. package/examples/basic/node_modules/toilscript/dist/web.js +22 -0
  216. package/examples/basic/node_modules/toilscript/lib/binaryen.d.ts +2 -0
  217. package/examples/basic/node_modules/toilscript/lib/binaryen.js +2 -0
  218. package/examples/basic/node_modules/toilscript/package.json +115 -0
  219. package/examples/basic/node_modules/toilscript/std/README.md +6 -0
  220. package/examples/basic/node_modules/toilscript/std/assembly/array.ts +550 -0
  221. package/examples/basic/node_modules/toilscript/std/assembly/arraybuffer.ts +77 -0
  222. package/examples/basic/node_modules/toilscript/std/assembly/atomics.ts +127 -0
  223. package/examples/basic/node_modules/toilscript/std/assembly/bindings/asyncify.ts +16 -0
  224. package/examples/basic/node_modules/toilscript/std/assembly/bindings/dom.ts +291 -0
  225. package/examples/basic/node_modules/toilscript/std/assembly/bindings/node.ts +6 -0
  226. package/examples/basic/node_modules/toilscript/std/assembly/bitflags.ts +53 -0
  227. package/examples/basic/node_modules/toilscript/std/assembly/builtins.ts +2650 -0
  228. package/examples/basic/node_modules/toilscript/std/assembly/byteslice.ts +177 -0
  229. package/examples/basic/node_modules/toilscript/std/assembly/compat.ts +2 -0
  230. package/examples/basic/node_modules/toilscript/std/assembly/console.ts +42 -0
  231. package/examples/basic/node_modules/toilscript/std/assembly/crypto.ts +9 -0
  232. package/examples/basic/node_modules/toilscript/std/assembly/dataview.ts +181 -0
  233. package/examples/basic/node_modules/toilscript/std/assembly/date.ts +375 -0
  234. package/examples/basic/node_modules/toilscript/std/assembly/diagnostics.ts +11 -0
  235. package/examples/basic/node_modules/toilscript/std/assembly/encoding.ts +151 -0
  236. package/examples/basic/node_modules/toilscript/std/assembly/endian.ts +45 -0
  237. package/examples/basic/node_modules/toilscript/std/assembly/error.ts +44 -0
  238. package/examples/basic/node_modules/toilscript/std/assembly/fixedarray.ts +173 -0
  239. package/examples/basic/node_modules/toilscript/std/assembly/fixedmap.ts +326 -0
  240. package/examples/basic/node_modules/toilscript/std/assembly/fixedset.ts +275 -0
  241. package/examples/basic/node_modules/toilscript/std/assembly/function.ts +42 -0
  242. package/examples/basic/node_modules/toilscript/std/assembly/index.d.ts +2892 -0
  243. package/examples/basic/node_modules/toilscript/std/assembly/iterator.ts +35 -0
  244. package/examples/basic/node_modules/toilscript/std/assembly/map.ts +269 -0
  245. package/examples/basic/node_modules/toilscript/std/assembly/math.ts +3289 -0
  246. package/examples/basic/node_modules/toilscript/std/assembly/memory.ts +123 -0
  247. package/examples/basic/node_modules/toilscript/std/assembly/number.ts +388 -0
  248. package/examples/basic/node_modules/toilscript/std/assembly/object.ts +36 -0
  249. package/examples/basic/node_modules/toilscript/std/assembly/performance.ts +9 -0
  250. package/examples/basic/node_modules/toilscript/std/assembly/pointer.ts +80 -0
  251. package/examples/basic/node_modules/toilscript/std/assembly/polyfills.ts +27 -0
  252. package/examples/basic/node_modules/toilscript/std/assembly/process.ts +50 -0
  253. package/examples/basic/node_modules/toilscript/std/assembly/reference.ts +48 -0
  254. package/examples/basic/node_modules/toilscript/std/assembly/regexp.ts +12 -0
  255. package/examples/basic/node_modules/toilscript/std/assembly/rt/README.md +83 -0
  256. package/examples/basic/node_modules/toilscript/std/assembly/rt/common.ts +81 -0
  257. package/examples/basic/node_modules/toilscript/std/assembly/rt/index-incremental.ts +2 -0
  258. package/examples/basic/node_modules/toilscript/std/assembly/rt/index-memory.ts +1 -0
  259. package/examples/basic/node_modules/toilscript/std/assembly/rt/index-minimal.ts +2 -0
  260. package/examples/basic/node_modules/toilscript/std/assembly/rt/index-stub.ts +1 -0
  261. package/examples/basic/node_modules/toilscript/std/assembly/rt/index.d.ts +37 -0
  262. package/examples/basic/node_modules/toilscript/std/assembly/rt/itcms.ts +419 -0
  263. package/examples/basic/node_modules/toilscript/std/assembly/rt/memory-runtime.ts +94 -0
  264. package/examples/basic/node_modules/toilscript/std/assembly/rt/rtrace.ts +15 -0
  265. package/examples/basic/node_modules/toilscript/std/assembly/rt/stub.ts +133 -0
  266. package/examples/basic/node_modules/toilscript/std/assembly/rt/tcms.ts +254 -0
  267. package/examples/basic/node_modules/toilscript/std/assembly/rt/tlsf.ts +592 -0
  268. package/examples/basic/node_modules/toilscript/std/assembly/rt.ts +90 -0
  269. package/examples/basic/node_modules/toilscript/std/assembly/set.ts +225 -0
  270. package/examples/basic/node_modules/toilscript/std/assembly/shared/feature.ts +68 -0
  271. package/examples/basic/node_modules/toilscript/std/assembly/shared/runtime.ts +13 -0
  272. package/examples/basic/node_modules/toilscript/std/assembly/shared/target.ts +11 -0
  273. package/examples/basic/node_modules/toilscript/std/assembly/shared/tsconfig.json +11 -0
  274. package/examples/basic/node_modules/toilscript/std/assembly/shared/typeinfo.ts +72 -0
  275. package/examples/basic/node_modules/toilscript/std/assembly/staticarray.ts +423 -0
  276. package/examples/basic/node_modules/toilscript/std/assembly/string.ts +850 -0
  277. package/examples/basic/node_modules/toilscript/std/assembly/symbol.ts +114 -0
  278. package/examples/basic/node_modules/toilscript/std/assembly/table.ts +16 -0
  279. package/examples/basic/node_modules/toilscript/std/assembly/toilscript.ts +16 -0
  280. package/examples/basic/node_modules/toilscript/std/assembly/tsconfig.json +6 -0
  281. package/examples/basic/node_modules/toilscript/std/assembly/typedarray.ts +1954 -0
  282. package/examples/basic/node_modules/toilscript/std/assembly/uri.ts +17 -0
  283. package/examples/basic/node_modules/toilscript/std/assembly/util/bytes.ts +107 -0
  284. package/examples/basic/node_modules/toilscript/std/assembly/util/casemap.ts +497 -0
  285. package/examples/basic/node_modules/toilscript/std/assembly/util/error.ts +58 -0
  286. package/examples/basic/node_modules/toilscript/std/assembly/util/hash.ts +117 -0
  287. package/examples/basic/node_modules/toilscript/std/assembly/util/math.ts +1922 -0
  288. package/examples/basic/node_modules/toilscript/std/assembly/util/memory.ts +290 -0
  289. package/examples/basic/node_modules/toilscript/std/assembly/util/number.ts +873 -0
  290. package/examples/basic/node_modules/toilscript/std/assembly/util/sort.ts +313 -0
  291. package/examples/basic/node_modules/toilscript/std/assembly/util/string.ts +1202 -0
  292. package/examples/basic/node_modules/toilscript/std/assembly/util/uri.ts +275 -0
  293. package/examples/basic/node_modules/toilscript/std/assembly/vector.ts +4 -0
  294. package/examples/basic/node_modules/toilscript/std/assembly.json +16 -0
  295. package/examples/basic/node_modules/toilscript/std/portable/index.d.ts +461 -0
  296. package/examples/basic/node_modules/toilscript/std/portable/index.js +416 -0
  297. package/examples/basic/node_modules/toilscript/std/portable.json +11 -0
  298. package/examples/basic/node_modules/toilscript/std/types/assembly/index.d.ts +1 -0
  299. package/examples/basic/node_modules/toilscript/std/types/assembly/package.json +3 -0
  300. package/examples/basic/node_modules/toilscript/std/types/portable/index.d.ts +1 -0
  301. package/examples/basic/node_modules/toilscript/std/types/portable/package.json +3 -0
  302. package/examples/basic/node_modules/toilscript/tsconfig-base.json +13 -0
  303. package/examples/basic/node_modules/toilscript/util/README.md +23 -0
  304. package/examples/basic/node_modules/toilscript/util/browser/fs.js +1 -0
  305. package/examples/basic/node_modules/toilscript/util/browser/module.js +5 -0
  306. package/examples/basic/node_modules/toilscript/util/browser/path.js +520 -0
  307. package/examples/basic/node_modules/toilscript/util/browser/process.js +59 -0
  308. package/examples/basic/node_modules/toilscript/util/browser/url.js +23 -0
  309. package/examples/basic/node_modules/toilscript/util/cpu.d.ts +9 -0
  310. package/examples/basic/node_modules/toilscript/util/cpu.js +42 -0
  311. package/examples/basic/node_modules/toilscript/util/find.d.ts +6 -0
  312. package/examples/basic/node_modules/toilscript/util/find.js +20 -0
  313. package/examples/basic/node_modules/toilscript/util/node.d.ts +21 -0
  314. package/examples/basic/node_modules/toilscript/util/node.js +34 -0
  315. package/examples/basic/node_modules/toilscript/util/options.d.ts +70 -0
  316. package/examples/basic/node_modules/toilscript/util/options.js +262 -0
  317. package/examples/basic/node_modules/toilscript/util/terminal.d.ts +52 -0
  318. package/examples/basic/node_modules/toilscript/util/terminal.js +35 -0
  319. package/examples/basic/node_modules/toilscript/util/text.d.ts +26 -0
  320. package/examples/basic/node_modules/toilscript/util/text.js +114 -0
  321. package/examples/basic/node_modules/toilscript/util/tsconfig.json +9 -0
  322. package/examples/basic/node_modules/toilscript/util/web.d.ts +11 -0
  323. package/examples/basic/node_modules/toilscript/util/web.js +33 -0
  324. package/examples/basic/package-lock.json +50 -1
  325. package/examples/basic/package.json +5 -2
  326. package/examples/basic/server/index.ts +3 -0
  327. package/examples/basic/server/main.ts +6 -0
  328. package/examples/basic/server/tsconfig.json +7 -0
  329. package/examples/basic/toil-env.d.ts +20 -1
  330. package/examples/basic/toil.config.ts +2 -5
  331. package/examples/basic/toilconfig.json +30 -0
  332. package/package.json +2 -2
  333. package/presets/eslint.js +2 -7
  334. package/presets/no-uint8array-tostring.js +4 -5
  335. package/presets/prettier.json +8 -1
  336. package/src/backend/index.ts +11 -18
  337. package/src/cli/configure.ts +272 -0
  338. package/src/cli/create.ts +267 -82
  339. package/src/cli/features.ts +128 -0
  340. package/src/cli/index.ts +44 -3
  341. package/src/cli/proc.ts +20 -0
  342. package/src/cli/ui.ts +4 -6
  343. package/src/cli/validate.ts +31 -0
  344. package/src/client/head/head.ts +140 -0
  345. package/src/client/index.ts +39 -9
  346. package/src/client/navigation/Link.tsx +99 -0
  347. package/src/client/navigation/NavLink.tsx +86 -0
  348. package/src/client/navigation/navigation.ts +142 -0
  349. package/src/client/navigation/prefetch.ts +130 -0
  350. package/src/client/navigation/scroll.ts +53 -0
  351. package/src/client/routing/Router.tsx +95 -0
  352. package/src/client/routing/error-boundary.tsx +43 -0
  353. package/src/client/routing/hooks.ts +115 -0
  354. package/src/client/routing/lazy.ts +93 -0
  355. package/src/client/{match.ts → routing/match.ts} +11 -3
  356. package/src/client/routing/mount.tsx +28 -0
  357. package/src/client/routing/params-context.ts +10 -0
  358. package/src/client/types.ts +36 -0
  359. package/src/compiler/config.ts +26 -10
  360. package/src/compiler/docs.ts +87 -0
  361. package/src/compiler/generate.ts +180 -23
  362. package/src/compiler/index.ts +6 -4
  363. package/src/compiler/plugin.ts +22 -1
  364. package/src/compiler/routes.ts +13 -7
  365. package/src/compiler/vite.ts +28 -5
  366. package/src/io/BinaryReader.ts +1 -5
  367. package/src/io/BinaryWriter.ts +3 -3
  368. package/src/server/index.ts +3 -4
  369. package/src/server/tsconfig.json +4 -0
  370. package/templates/app/client/404.tsx +11 -0
  371. package/templates/app/client/components/.gitkeep +1 -0
  372. package/templates/app/client/components/Footer.tsx +8 -0
  373. package/templates/app/client/components/HoneycombBackground.tsx +162 -0
  374. package/templates/app/client/layout.tsx +53 -0
  375. package/templates/app/client/public/favicon.ico +0 -0
  376. package/templates/app/client/public/images/.gitkeep +1 -0
  377. package/templates/app/client/public/images/logo.svg +37 -0
  378. package/templates/app/client/public/index.html +16 -0
  379. package/templates/app/client/public/robots.txt +2 -0
  380. package/templates/app/client/routes/about.tsx +11 -0
  381. package/templates/app/client/routes/blog/[id].tsx +12 -0
  382. package/templates/app/client/routes/docs/[...slug].tsx +12 -0
  383. package/templates/app/client/routes/get-started.tsx +84 -0
  384. package/templates/app/client/routes/index.tsx +80 -0
  385. package/templates/app/client/routes/io.tsx +24 -0
  386. package/templates/app/client/styles/main.css +461 -0
  387. package/templates/app/client/toil.tsx +7 -0
  388. package/test/channel.test.ts +1 -1
  389. package/test/configure.test.ts +90 -0
  390. package/test/features.test.ts +111 -0
  391. package/test/head.test.ts +35 -0
  392. package/test/io.test.ts +8 -0
  393. package/test/navlink.test.ts +28 -0
  394. package/test/routes.test.ts +16 -1
  395. package/test/validate.test.ts +42 -0
  396. package/vitest.config.ts +1 -1
  397. package/examples/basic/dist/assets/404-D1bS2aH_.js +0 -1
  398. package/examples/basic/dist/assets/_...slug_-wR3shlWn.js +0 -1
  399. package/examples/basic/dist/assets/_id_-EWYvHfi2.js +0 -1
  400. package/examples/basic/dist/assets/about-Ddvj1tjF.js +0 -1
  401. package/examples/basic/dist/assets/index-CdG0me90.js +0 -1
  402. package/examples/basic/dist/assets/io-CODNJU57.js +0 -1
  403. package/examples/basic/dist/assets/layout-C15ZTPYI.js +0 -1
  404. package/examples/basic/dist/assets/react-JbAfoxYe.js +0 -9
  405. package/examples/basic/dist/assets/rolldown-runtime-1VNLd2iN.js +0 -1
  406. package/examples/basic/dist/assets/routes-GoydenoY.js +0 -1
  407. package/examples/basic/dist/index.html +0 -12
  408. package/src/client/runtime.tsx +0 -190
  409. /package/src/client/{channel.ts → channel/channel.ts} +0 -0
@@ -0,0 +1,416 @@
1
+ /** @module std/portable *//***/
2
+
3
+ let globalScope = typeof window !== "undefined" && window || typeof global !== "undefined" && global || self;
4
+ if (typeof globalScope.ASC_TARGET === "undefined") {
5
+
6
+ globalScope.ASC_TARGET = 0; // Target.JS
7
+ globalScope.ASC_RUNTIME = 0; // Runtime.Stub
8
+ globalScope.ASC_NO_ASSERT = false;
9
+ globalScope.ASC_MEMORY_BASE = 0;
10
+ globalScope.ASC_OPTIMIZE_LEVEL = 3;
11
+ globalScope.ASC_SHRINK_LEVEL = 0;
12
+ globalScope.ASC_FEATURE_MUTABLE_GLOBAL = false;
13
+ globalScope.ASC_FEATURE_SIGN_EXTENSION = false;
14
+ globalScope.ASC_FEATURE_BULK_MEMORY = false;
15
+ globalScope.ASC_FEATURE_SIMD = false;
16
+ globalScope.ASC_FEATURE_THREADS = false;
17
+
18
+ let F64 = new Float64Array(1);
19
+ let U64 = new Uint32Array(F64.buffer);
20
+
21
+ Object.defineProperties(
22
+ globalScope["i8"] = function i8(value) { return value << 24 >> 24; },
23
+ {
24
+ "MIN_VALUE": { value: -128 },
25
+ "MAX_VALUE": { value: 127 },
26
+
27
+ parse(str, radix) { return parseInt(str, radix) << 24 >> 24; }
28
+ }
29
+ );
30
+
31
+ Object.defineProperties(
32
+ globalScope["i16"] = function i16(value) { return value << 16 >> 16; },
33
+ {
34
+ "MIN_VALUE": { value: -32768 },
35
+ "MAX_VALUE": { value: 32767 },
36
+
37
+ parse(str, radix) { return parseInt(str, radix) << 16 >> 16; }
38
+ }
39
+ );
40
+
41
+ Object.defineProperties(
42
+ globalScope["i32"] = globalScope["isize"] = function i32(value) { return value | 0; },
43
+ {
44
+ "MIN_VALUE": { value: -2147483648 },
45
+ "MAX_VALUE": { value: 2147483647 },
46
+
47
+ parse(str, radix) { return parseInt(str, radix) | 0; }
48
+ }
49
+ );
50
+
51
+ Object.defineProperties(
52
+ globalScope["u8"] = function u8(value) { return value & 0xff; },
53
+ {
54
+ "MIN_VALUE": { value: 0 },
55
+ "MAX_VALUE": { value: 255 },
56
+
57
+ parse(str, radix) { return parseInt(str, radix) & 0xff; }
58
+ }
59
+ );
60
+
61
+ Object.defineProperties(
62
+ globalScope["u16"] = function u16(value) { return value & 0xffff; },
63
+ {
64
+ "MIN_VALUE": { value: 0 },
65
+ "MAX_VALUE": { value: 65535 },
66
+
67
+ parse(str, radix) { return parseInt(str, radix) & 0xffff; }
68
+ }
69
+ );
70
+
71
+ Object.defineProperties(
72
+ globalScope["u32"] = globalScope["usize"] = function u32(value) { return value >>> 0; },
73
+ {
74
+ "MIN_VALUE": { value: 0 },
75
+ "MAX_VALUE": { value: 4294967295 },
76
+
77
+ parse(str, radix) { return parseInt(str, radix) >>> 0; }
78
+ }
79
+ );
80
+
81
+ Object.defineProperties(
82
+ globalScope["bool"] = function bool(value) { return !!value; },
83
+ {
84
+ "MIN_VALUE": { value: false },
85
+ "MAX_VALUE": { value: true },
86
+
87
+ parse(str) { return str.trim() === "true"; }
88
+ }
89
+ );
90
+
91
+ Object.defineProperties(
92
+ globalScope["f32"] = function f32(value) { return Math.fround(value); },
93
+ {
94
+ "EPSILON": { value: 1.1920928955078125e-07 },
95
+ "MIN_VALUE": { value: 1.401298464324817e-45 },
96
+ "MAX_VALUE": { value: 3.4028234663852886e+38 },
97
+ "MIN_NORMAL_VALUE": { value: 1.1754943508222875e-38 },
98
+ "MIN_SAFE_INTEGER": { value: -16777215 },
99
+ "MAX_SAFE_INTEGER": { value: 16777215 },
100
+ "POSITIVE_INFINITY": { value: Infinity },
101
+ "NEGATIVE_INFINITY": { value: -Infinity },
102
+ "NaN": { value: NaN },
103
+
104
+ parse(str) { return Math.fround(parseFloat(str)); }
105
+ }
106
+ );
107
+
108
+ Object.defineProperties(
109
+ globalScope["f64"] = function f64(value) { return +value; },
110
+ {
111
+ "EPSILON": { value: 2.2204460492503131e-016 },
112
+ "MIN_VALUE": { value: 5e-324 },
113
+ "MAX_VALUE": { value: 1.7976931348623157e+308 },
114
+ "MIN_NORMAL_VALUE": { value: 2.2250738585072014e-308 },
115
+ "MIN_SAFE_INTEGER": { value: -9007199254740991 },
116
+ "MAX_SAFE_INTEGER": { value: 9007199254740991 },
117
+ "POSITIVE_INFINITY": { value: Infinity },
118
+ "NEGATIVE_INFINITY": { value: -Infinity },
119
+ "NaN": { value: NaN },
120
+
121
+ parse(str) { return parseFloat(str); }
122
+ }
123
+ );
124
+
125
+ globalScope["clz"] = Math.clz32;
126
+
127
+ globalScope["ctz"] = function ctz(value) {
128
+ return 32 - Math.clz32(~value & (value - 1));
129
+ };
130
+
131
+ globalScope["popcnt"] = function popcnt(value) {
132
+ value -= value >>> 1 & 0x55555555;
133
+ value = (value & 0x33333333) + (value >>> 2 & 0x33333333);
134
+ return (((value + (value >>> 4)) & 0x0F0F0F0F) * 0x01010101) >>> 24;
135
+ };
136
+
137
+ globalScope["rotl"] = function rotl(value, shift) {
138
+ shift &= 31;
139
+ return (value << shift) | (value >>> (32 - shift));
140
+ };
141
+
142
+ globalScope["rotr"] = function rotr(value, shift) {
143
+ shift &= 31;
144
+ return (value >>> shift) | (value << (32 - shift));
145
+ };
146
+
147
+ globalScope["abs"] = Math.abs;
148
+
149
+ globalScope["max"] = Math.max;
150
+
151
+ globalScope["min"] = Math.min;
152
+
153
+ globalScope["ceil"] = Math.ceil;
154
+
155
+ globalScope["floor"] = Math.floor;
156
+
157
+ globalScope["nearest"] = function nearest(value) {
158
+ const INV_EPS64 = 4503599627370496.0;
159
+ const y = Math.abs(value);
160
+ return y < INV_EPS64
161
+ ? (y + INV_EPS64 - INV_EPS64) * Math.sign(value)
162
+ : value;
163
+ };
164
+
165
+ globalScope["select"] = function select(ifTrue, ifFalse, condition) {
166
+ return condition ? ifTrue : ifFalse;
167
+ };
168
+
169
+ globalScope["sqrt"] = Math.sqrt;
170
+
171
+ globalScope["trunc"] = Math.trunc;
172
+
173
+ globalScope["copysign"] = function copysign(x, y) {
174
+ return y
175
+ ? Math.abs(x) * Math.sign(y)
176
+ : (F64[0] = y, U64[1] >>> 31 ? -1 : 1); // +0, -0, -NaN, +NaN
177
+ };
178
+
179
+ globalScope["bswap"] = function bswap(value) {
180
+ let a = value >> 8 & 0x00FF00FF;
181
+ let b = (value & 0x00FF00FF) << 8;
182
+ value = a | b;
183
+ a = value >> 16 & 0x0000FFFF;
184
+ b = (value & 0x0000FFFF) << 16;
185
+ return a | b;
186
+ };
187
+
188
+ function UnreachableError() {
189
+ if (Error.captureStackTrace) {
190
+ Error.captureStackTrace(this, UnreachableError);
191
+ } else {
192
+ this.stack = this.name + ": " + this.message + "\n" + new Error().stack;
193
+ }
194
+ }
195
+ UnreachableError.prototype = Object.create(Error.prototype);
196
+ UnreachableError.prototype.name = "UnreachableError";
197
+ UnreachableError.prototype.message = "unreachable";
198
+
199
+ globalScope["unreachable"] = function unreachable() {
200
+ throw new UnreachableError();
201
+ };
202
+
203
+ function AssertionError(message) {
204
+ this.message = message || "assertion failed";
205
+ if (Error.captureStackTrace) {
206
+ Error.captureStackTrace(this, AssertionError);
207
+ } else {
208
+ this.stack = this.name + ": " + this.message + "\n" + new Error().stack;
209
+ }
210
+ }
211
+ AssertionError.prototype = Object.create(Error.prototype);
212
+ AssertionError.prototype.name = "AssertionError";
213
+
214
+ globalScope["assert"] = function assert(isTrueish, message) {
215
+ if (isTrueish) return isTrueish;
216
+ throw new AssertionError(message);
217
+ };
218
+
219
+ globalScope["changetype"] = function changetype(value) {
220
+ return value;
221
+ };
222
+
223
+ String["fromCharCodes"] = function fromCharCodes(arr) {
224
+ const CHUNKSIZE = 1 << 13;
225
+ const len = arr.length;
226
+ if (len <= CHUNKSIZE) {
227
+ return String.fromCharCode.apply(String, arr);
228
+ }
229
+ let index = 0;
230
+ let parts = '';
231
+ while (index < len) {
232
+ parts += String.fromCharCode.apply(
233
+ String,
234
+ arr.slice(index, Math.min(index + CHUNKSIZE, len))
235
+ );
236
+ index += CHUNKSIZE;
237
+ }
238
+ return parts;
239
+ };
240
+
241
+ String["fromCodePoints"] = function fromCodePoints(arr) {
242
+ const CHUNKSIZE = 1 << 13;
243
+ const len = arr.length;
244
+ if (len <= CHUNKSIZE) {
245
+ return String.fromCodePoint.apply(String, arr);
246
+ }
247
+ let index = 0;
248
+ let parts = '';
249
+ while (index < len) {
250
+ parts += String.fromCodePoint.apply(
251
+ String,
252
+ arr.slice(index, Math.min(index + CHUNKSIZE, len))
253
+ );
254
+ index += CHUNKSIZE;
255
+ }
256
+ return parts;
257
+ };
258
+
259
+ if (!String.prototype.at) {
260
+ Object.defineProperty(String.prototype, "at", {
261
+ value: function at(index) {
262
+ return this.charAt(index >= 0 ? index : index + this.length);
263
+ },
264
+ configurable: true
265
+ });
266
+ }
267
+
268
+ if (!String.prototype.replaceAll) {
269
+ Object.defineProperty(String.prototype, "replaceAll", {
270
+ value: function replaceAll(search, replacement) {
271
+ let res = this.split(search).join(replacement);
272
+ if (!search.length) res = replacement + res + replacement;
273
+ return res;
274
+ },
275
+ configurable: true
276
+ });
277
+ }
278
+
279
+ function defaultComparator(a, b) {
280
+ if (a == b) {
281
+ if (a != 0) return 0;
282
+ a = 1 / a;
283
+ b = 1 / b;
284
+ } else {
285
+ let nanA = a != a, nanB = b != b;
286
+ if (nanA | nanB) return nanA - nanB;
287
+ if (a == null) a = String(a);
288
+ if (b == null) b = String(b);
289
+ }
290
+ return a > b ? 1 : -1;
291
+ }
292
+
293
+ const arraySort = Array.prototype.sort;
294
+ Array.prototype.sort = function sort(comparator) {
295
+ return arraySort.call(this, comparator || defaultComparator);
296
+ };
297
+
298
+ [ Array,
299
+ Uint8ClampedArray,
300
+ Uint8Array, Int8Array,
301
+ Uint16Array, Int16Array,
302
+ Uint32Array, Int32Array,
303
+ Float32Array, Float64Array
304
+ ].forEach(Ctr => {
305
+ if (!Ctr.prototype.at) {
306
+ Object.defineProperty(Ctr.prototype, "at", {
307
+ value: function at(index) {
308
+ return this[index >= 0 ? index : index + this.length];
309
+ },
310
+ configurable: true
311
+ });
312
+ }
313
+
314
+ if (!Ctr.prototype.findLastIndex) {
315
+ Object.defineProperty(Ctr.prototype, "findLastIndex", {
316
+ value: function findLastIndex(fn) {
317
+ for (let i = this.length - 1; i >= 0; --i) {
318
+ if (fn(this[i], i, this)) return i;
319
+ }
320
+ return -1;
321
+ },
322
+ configurable: true
323
+ });
324
+ }
325
+
326
+ if (Ctr != Array) {
327
+ Object.defineProperty(Ctr, "wrap", {
328
+ value: function wrap(buffer, byteOffset, length) {
329
+ return new Ctr(buffer, byteOffset, length);
330
+ },
331
+ configurable: true
332
+ });
333
+ }
334
+ });
335
+
336
+ globalScope["isInteger"] = Number.isInteger;
337
+
338
+ globalScope["isFloat"] = function isFloat(arg) {
339
+ return typeof arg === "number";
340
+ };
341
+
342
+ globalScope["isNullable"] = function isNullable(arg) {
343
+ return true;
344
+ };
345
+
346
+ globalScope["isReference"] = function isReference(arg) {
347
+ return typeof arg === "object" || typeof arg === "string";
348
+ };
349
+
350
+ globalScope["isFunction"] = function isFunction(arg) {
351
+ return typeof arg === "function";
352
+ };
353
+
354
+ globalScope["isString"] = function isString(arg) {
355
+ return typeof arg === "string" || arg instanceof String;
356
+ };
357
+
358
+ globalScope["isArray"] = Array.isArray;
359
+ globalScope["isArrayLike"] = function isArrayLike(expr) {
360
+ return expr
361
+ && typeof expr === 'object'
362
+ && typeof expr.length === 'number'
363
+ && expr.length >= 0
364
+ && Math.trunc(expr.length) === expr.length;
365
+ };
366
+
367
+ globalScope["isDefined"] = function isDefined(expr) {
368
+ return typeof expr !== "undefined";
369
+ };
370
+
371
+ globalScope["isConstant"] = function isConstant(expr) {
372
+ return false;
373
+ };
374
+
375
+ globalScope["unchecked"] = function unchecked(expr) {
376
+ return expr;
377
+ };
378
+
379
+ globalScope["fmod"] = function fmod(x, y) {
380
+ return x % y;
381
+ };
382
+
383
+ globalScope["fmodf"] = function fmodf(x, y) {
384
+ return Math.fround(x % y);
385
+ };
386
+
387
+ globalScope["JSMath"] = Math;
388
+
389
+ Object.defineProperties(globalScope["JSMath"], {
390
+ sincos_sin: { value: 0.0, writable: true },
391
+ sincos_cos: { value: 0.0, writable: true },
392
+ signbit: {
393
+ value: function signbit(x) {
394
+ F64[0] = x; return Boolean(U64[1] >>> 31);
395
+ }
396
+ },
397
+ sincos: {
398
+ value: function sincos(x) {
399
+ this.sincos_sin = Math.sin(x);
400
+ this.sincos_cos = Math.cos(x);
401
+ }
402
+ },
403
+ exp2: {
404
+ value: function exp2(x) {
405
+ return Math.pow(2, x);
406
+ }
407
+ }
408
+ });
409
+
410
+ globalScope["unmanaged"] = function() { /* nop */ };
411
+
412
+ globalScope["trace"] = function(message, n) {
413
+ if (n) message += Array.prototype.slice.call(arguments, 2, 2 + n);
414
+ console.error("trace: " + message);
415
+ };
416
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../tsconfig-base.json",
3
+ "compilerOptions": {
4
+ "target": "esnext",
5
+ "module": "commonjs",
6
+ "allowJs": true,
7
+ "typeRoots": [ "types" ],
8
+ "types": [ "portable" ],
9
+ "lib": ["esnext", "esnext.string"]
10
+ }
11
+ }
@@ -0,0 +1 @@
1
+ import "../../assembly/index";
@@ -0,0 +1,3 @@
1
+ {
2
+ "types": "index.d.ts"
3
+ }
@@ -0,0 +1 @@
1
+ import "../../portable/index";
@@ -0,0 +1,3 @@
1
+ {
2
+ "types": "index.d.ts"
3
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "alwaysStrict": true,
5
+ "noImplicitAny": true,
6
+ "noImplicitReturns": true,
7
+ "noImplicitThis": true,
8
+ "noEmitOnError": true,
9
+ "strictNullChecks": true,
10
+ "experimentalDecorators": true,
11
+ "preserveConstEnums": false
12
+ }
13
+ }
@@ -0,0 +1,23 @@
1
+ Utility
2
+ =======
3
+
4
+ Various utility functions shared accross the codebase.
5
+
6
+ | Utility | Description
7
+ |----------|-------------------------------------------
8
+ | cpu | Obtains information about the CPU
9
+ | find | Provides support for finding files etc.
10
+ | node | Minimal polyfills for Node.js builtins
11
+ | options | Support for command line options parsing
12
+ | terminal | Provides support for terminal colors
13
+ | text | Utility for text processing
14
+ | web | Minimal polyfills for browser builtins
15
+
16
+ It is possible to reuse the utility in your own project like so:
17
+
18
+ ```ts
19
+ import { ... } from "toilscript/util/terminal.js";
20
+ ...
21
+ ```
22
+
23
+ Keep in mind, however, that utility can change at any time.
@@ -0,0 +1 @@
1
+ export const promises = {};
@@ -0,0 +1,5 @@
1
+ export function createRequire() {
2
+ return function require(path) {
3
+ throw new Error(`Cannot find module: '${path}'`);
4
+ };
5
+ }