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.
- package/.idea/prettier.xml +1 -0
- package/as-pect.config.js +1 -1
- package/build/backend/.tsbuildinfo +1 -1
- package/build/backend/index.js +1 -2
- package/build/cli/.tsbuildinfo +1 -1
- package/build/cli/configure.d.ts +15 -0
- package/build/cli/configure.js +201 -0
- package/build/cli/create.d.ts +4 -0
- package/build/cli/create.js +193 -68
- package/build/cli/features.d.ts +23 -0
- package/build/cli/features.js +85 -0
- package/build/cli/index.js +42 -2
- package/build/cli/proc.d.ts +1 -0
- package/build/cli/proc.js +11 -0
- package/build/cli/ui.js +1 -2
- package/build/cli/validate.d.ts +4 -0
- package/build/cli/validate.js +19 -0
- package/build/client/.tsbuildinfo +1 -1
- package/build/client/Link.d.ts +8 -0
- package/build/client/Link.js +44 -0
- package/build/client/NavLink.d.ts +14 -0
- package/build/client/NavLink.js +37 -0
- package/build/client/Router.d.ts +7 -0
- package/build/client/Router.js +55 -0
- package/build/client/channel/channel.d.ts +23 -0
- package/build/client/channel/channel.js +94 -0
- package/build/client/error-boundary.d.ts +16 -0
- package/build/client/error-boundary.js +19 -0
- package/build/client/head/head.d.ts +26 -0
- package/build/client/head/head.js +87 -0
- package/build/client/head.d.ts +26 -0
- package/build/client/head.js +87 -0
- package/build/client/hooks.d.ts +17 -0
- package/build/client/hooks.js +48 -0
- package/build/client/index.d.ts +18 -6
- package/build/client/index.js +10 -3
- package/build/client/lazy.d.ts +16 -0
- package/build/client/lazy.js +53 -0
- package/build/client/match.js +7 -0
- package/build/client/mount.d.ts +2 -0
- package/build/client/mount.js +13 -0
- package/build/client/navigation/Link.d.ts +8 -0
- package/build/client/navigation/Link.js +44 -0
- package/build/client/navigation/NavLink.d.ts +14 -0
- package/build/client/navigation/NavLink.js +37 -0
- package/build/client/navigation/navigation.d.ts +13 -0
- package/build/client/navigation/navigation.js +97 -0
- package/build/client/navigation/prefetch.d.ts +11 -0
- package/build/client/navigation/prefetch.js +100 -0
- package/build/client/navigation/scroll.d.ts +8 -0
- package/build/client/navigation/scroll.js +36 -0
- package/build/client/navigation.d.ts +13 -0
- package/build/client/navigation.js +97 -0
- package/build/client/params-context.d.ts +2 -0
- package/build/client/params-context.js +2 -0
- package/build/client/prefetch.d.ts +11 -0
- package/build/client/prefetch.js +100 -0
- package/build/client/routing/Router.d.ts +7 -0
- package/build/client/routing/Router.js +55 -0
- package/build/client/routing/error-boundary.d.ts +16 -0
- package/build/client/routing/error-boundary.js +19 -0
- package/build/client/routing/hooks.d.ts +17 -0
- package/build/client/routing/hooks.js +48 -0
- package/build/client/routing/lazy.d.ts +16 -0
- package/build/client/routing/lazy.js +53 -0
- package/build/client/routing/match.d.ts +2 -0
- package/build/client/routing/match.js +32 -0
- package/build/client/routing/mount.d.ts +2 -0
- package/build/client/routing/mount.js +13 -0
- package/build/client/routing/params-context.d.ts +2 -0
- package/build/client/routing/params-context.js +2 -0
- package/build/client/scroll.d.ts +8 -0
- package/build/client/scroll.js +36 -0
- package/build/client/types.d.ts +27 -0
- package/build/client/types.js +1 -0
- package/build/compiler/.tsbuildinfo +1 -1
- package/build/compiler/config.d.ts +2 -0
- package/build/compiler/config.js +14 -2
- package/build/compiler/docs.d.ts +10 -0
- package/build/compiler/docs.js +59 -0
- package/build/compiler/generate.js +144 -16
- package/build/compiler/index.d.ts +4 -2
- package/build/compiler/index.js +4 -3
- package/build/compiler/plugin.js +16 -1
- package/build/compiler/routes.js +5 -1
- package/build/compiler/vite.d.ts +1 -1
- package/build/compiler/vite.js +17 -1
- package/build/io/.tsbuildinfo +1 -1
- package/build/io/BinaryWriter.js +2 -2
- package/eslint.config.js +1 -1
- package/examples/basic/.toil/docs/cli.md +3 -0
- package/examples/basic/.toil/docs/client.md +3 -0
- package/examples/basic/.toil/docs/index.md +3 -0
- package/examples/basic/.toil/docs/routing.md +3 -0
- package/examples/basic/.toil/docs/server.md +3 -0
- package/examples/basic/.toil/docs/styling.md +3 -0
- package/examples/basic/.toil/entry.tsx +3 -8
- package/examples/basic/.toil/globals.ts +6 -0
- package/examples/basic/.toil/index.html +16 -12
- package/examples/basic/.toil/public/images/.gitkeep +1 -0
- package/examples/basic/.toil/public/images/logo.svg +37 -0
- package/examples/basic/.toil/public/robots.txt +2 -0
- package/examples/basic/.toil/routes.ts +9 -7
- package/examples/basic/build/client/assets/404-Bq0jNTUo.js +1 -0
- package/examples/basic/build/client/assets/_...slug_-CXKf6qnB.js +1 -0
- package/examples/basic/build/client/assets/_id_-BadAyQnb.js +1 -0
- package/examples/basic/build/client/assets/about-BOhoEcEO.js +1 -0
- package/examples/basic/build/client/assets/get-started-BIXpcjkT.js +9 -0
- package/examples/basic/build/client/assets/index-BmqcTaBB.js +1 -0
- package/examples/basic/build/client/assets/io-DEVjjaJj.js +1 -0
- package/examples/basic/build/client/assets/layout-DJegirdz.js +1 -0
- package/examples/basic/build/client/assets/react-DEQrz1q7.js +9 -0
- package/examples/basic/build/client/assets/rolldown-runtime-KL5VtC6j.js +1 -0
- package/examples/basic/build/client/assets/routes-BYWn6TxK.js +1 -0
- package/examples/basic/build/client/css/style.css +2 -0
- package/examples/basic/build/client/images/.gitkeep +1 -0
- package/examples/basic/build/client/images/logo.svg +37 -0
- package/examples/basic/build/client/index.html +17 -0
- package/examples/basic/build/client/robots.txt +2 -0
- package/examples/basic/client/404.tsx +2 -5
- package/examples/basic/client/components/.gitkeep +1 -0
- package/examples/basic/client/components/Footer.tsx +8 -0
- package/examples/basic/client/components/HoneycombBackground.tsx +162 -0
- package/examples/basic/client/layout.tsx +43 -26
- package/examples/basic/client/public/favicon.ico +0 -0
- package/examples/basic/client/public/images/.gitkeep +1 -0
- package/examples/basic/client/public/images/logo.svg +37 -0
- package/examples/basic/client/public/index.html +16 -0
- package/examples/basic/client/public/robots.txt +2 -0
- package/examples/basic/client/routes/about.tsx +1 -3
- package/examples/basic/client/routes/blog/[id].tsx +2 -4
- package/examples/basic/client/routes/docs/[...slug].tsx +3 -6
- package/examples/basic/client/routes/get-started.tsx +84 -0
- package/examples/basic/client/routes/index.tsx +74 -7
- package/examples/basic/client/routes/io.tsx +3 -7
- package/examples/basic/client/styles/main.css +461 -0
- package/examples/basic/client/toil.tsx +7 -0
- package/examples/basic/node_modules/.bin/toilinit +16 -0
- package/examples/basic/node_modules/.bin/toilinit.cmd +17 -0
- package/examples/basic/node_modules/.bin/toilinit.ps1 +28 -0
- package/examples/basic/node_modules/.bin/toilscript +16 -0
- package/examples/basic/node_modules/.bin/toilscript.cmd +17 -0
- package/examples/basic/node_modules/.bin/toilscript.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-as +16 -0
- package/examples/basic/node_modules/.bin/wasm-as.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-as.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-ctor-eval +16 -0
- package/examples/basic/node_modules/.bin/wasm-ctor-eval.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-ctor-eval.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-dis +16 -0
- package/examples/basic/node_modules/.bin/wasm-dis.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-dis.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-merge +16 -0
- package/examples/basic/node_modules/.bin/wasm-merge.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-merge.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-metadce +16 -0
- package/examples/basic/node_modules/.bin/wasm-metadce.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-metadce.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-opt +16 -0
- package/examples/basic/node_modules/.bin/wasm-opt.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-opt.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-reduce +16 -0
- package/examples/basic/node_modules/.bin/wasm-reduce.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-reduce.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm-shell +16 -0
- package/examples/basic/node_modules/.bin/wasm-shell.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm-shell.ps1 +28 -0
- package/examples/basic/node_modules/.bin/wasm2js +16 -0
- package/examples/basic/node_modules/.bin/wasm2js.cmd +17 -0
- package/examples/basic/node_modules/.bin/wasm2js.ps1 +28 -0
- package/examples/basic/node_modules/.package-lock.json +49 -1
- package/examples/basic/node_modules/.vite/deps/_metadata.json +9 -9
- package/examples/basic/node_modules/binaryen/LICENSE +201 -0
- package/examples/basic/node_modules/binaryen/README.md +1362 -0
- package/examples/basic/node_modules/binaryen/bin/package.json +3 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-as +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-ctor-eval +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-dis +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-merge +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-metadce +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-opt +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-reduce +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm-shell +0 -0
- package/examples/basic/node_modules/binaryen/bin/wasm2js +0 -0
- package/examples/basic/node_modules/binaryen/index.d.ts +2371 -0
- package/examples/basic/node_modules/binaryen/index.js +30552 -0
- package/examples/basic/node_modules/binaryen/package.json +50 -0
- package/examples/basic/node_modules/long/LICENSE +202 -0
- package/examples/basic/node_modules/long/README.md +286 -0
- package/examples/basic/node_modules/long/index.d.ts +2 -0
- package/examples/basic/node_modules/long/index.js +1581 -0
- package/examples/basic/node_modules/long/package.json +58 -0
- package/examples/basic/node_modules/long/types.d.ts +474 -0
- package/examples/basic/node_modules/long/umd/index.d.ts +3 -0
- package/examples/basic/node_modules/long/umd/index.js +1622 -0
- package/examples/basic/node_modules/long/umd/package.json +3 -0
- package/examples/basic/node_modules/long/umd/types.d.ts +474 -0
- package/examples/basic/node_modules/toilscript/LICENSE +201 -0
- package/examples/basic/node_modules/toilscript/NOTICE +94 -0
- package/examples/basic/node_modules/toilscript/README.md +66 -0
- package/examples/basic/node_modules/toilscript/bin/toilinit.js +468 -0
- package/examples/basic/node_modules/toilscript/bin/toilscript.js +35 -0
- package/examples/basic/node_modules/toilscript/dist/cli.d.ts +4 -0
- package/examples/basic/node_modules/toilscript/dist/cli.generated.d.ts +10027 -0
- package/examples/basic/node_modules/toilscript/dist/cli.js +24474 -0
- package/examples/basic/node_modules/toilscript/dist/cli.js.map +7 -0
- package/examples/basic/node_modules/toilscript/dist/importmap.json +9 -0
- package/examples/basic/node_modules/toilscript/dist/toilscript.d.ts +4 -0
- package/examples/basic/node_modules/toilscript/dist/toilscript.generated.d.ts +11242 -0
- package/examples/basic/node_modules/toilscript/dist/toilscript.js +337 -0
- package/examples/basic/node_modules/toilscript/dist/toilscript.js.map +7 -0
- package/examples/basic/node_modules/toilscript/dist/transform.cjs +1 -0
- package/examples/basic/node_modules/toilscript/dist/transform.d.ts +1 -0
- package/examples/basic/node_modules/toilscript/dist/transform.js +1 -0
- package/examples/basic/node_modules/toilscript/dist/web.js +22 -0
- package/examples/basic/node_modules/toilscript/lib/binaryen.d.ts +2 -0
- package/examples/basic/node_modules/toilscript/lib/binaryen.js +2 -0
- package/examples/basic/node_modules/toilscript/package.json +115 -0
- package/examples/basic/node_modules/toilscript/std/README.md +6 -0
- package/examples/basic/node_modules/toilscript/std/assembly/array.ts +550 -0
- package/examples/basic/node_modules/toilscript/std/assembly/arraybuffer.ts +77 -0
- package/examples/basic/node_modules/toilscript/std/assembly/atomics.ts +127 -0
- package/examples/basic/node_modules/toilscript/std/assembly/bindings/asyncify.ts +16 -0
- package/examples/basic/node_modules/toilscript/std/assembly/bindings/dom.ts +291 -0
- package/examples/basic/node_modules/toilscript/std/assembly/bindings/node.ts +6 -0
- package/examples/basic/node_modules/toilscript/std/assembly/bitflags.ts +53 -0
- package/examples/basic/node_modules/toilscript/std/assembly/builtins.ts +2650 -0
- package/examples/basic/node_modules/toilscript/std/assembly/byteslice.ts +177 -0
- package/examples/basic/node_modules/toilscript/std/assembly/compat.ts +2 -0
- package/examples/basic/node_modules/toilscript/std/assembly/console.ts +42 -0
- package/examples/basic/node_modules/toilscript/std/assembly/crypto.ts +9 -0
- package/examples/basic/node_modules/toilscript/std/assembly/dataview.ts +181 -0
- package/examples/basic/node_modules/toilscript/std/assembly/date.ts +375 -0
- package/examples/basic/node_modules/toilscript/std/assembly/diagnostics.ts +11 -0
- package/examples/basic/node_modules/toilscript/std/assembly/encoding.ts +151 -0
- package/examples/basic/node_modules/toilscript/std/assembly/endian.ts +45 -0
- package/examples/basic/node_modules/toilscript/std/assembly/error.ts +44 -0
- package/examples/basic/node_modules/toilscript/std/assembly/fixedarray.ts +173 -0
- package/examples/basic/node_modules/toilscript/std/assembly/fixedmap.ts +326 -0
- package/examples/basic/node_modules/toilscript/std/assembly/fixedset.ts +275 -0
- package/examples/basic/node_modules/toilscript/std/assembly/function.ts +42 -0
- package/examples/basic/node_modules/toilscript/std/assembly/index.d.ts +2892 -0
- package/examples/basic/node_modules/toilscript/std/assembly/iterator.ts +35 -0
- package/examples/basic/node_modules/toilscript/std/assembly/map.ts +269 -0
- package/examples/basic/node_modules/toilscript/std/assembly/math.ts +3289 -0
- package/examples/basic/node_modules/toilscript/std/assembly/memory.ts +123 -0
- package/examples/basic/node_modules/toilscript/std/assembly/number.ts +388 -0
- package/examples/basic/node_modules/toilscript/std/assembly/object.ts +36 -0
- package/examples/basic/node_modules/toilscript/std/assembly/performance.ts +9 -0
- package/examples/basic/node_modules/toilscript/std/assembly/pointer.ts +80 -0
- package/examples/basic/node_modules/toilscript/std/assembly/polyfills.ts +27 -0
- package/examples/basic/node_modules/toilscript/std/assembly/process.ts +50 -0
- package/examples/basic/node_modules/toilscript/std/assembly/reference.ts +48 -0
- package/examples/basic/node_modules/toilscript/std/assembly/regexp.ts +12 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/README.md +83 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/common.ts +81 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index-incremental.ts +2 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index-memory.ts +1 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index-minimal.ts +2 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index-stub.ts +1 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/index.d.ts +37 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/itcms.ts +419 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/memory-runtime.ts +94 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/rtrace.ts +15 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/stub.ts +133 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/tcms.ts +254 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt/tlsf.ts +592 -0
- package/examples/basic/node_modules/toilscript/std/assembly/rt.ts +90 -0
- package/examples/basic/node_modules/toilscript/std/assembly/set.ts +225 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/feature.ts +68 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/runtime.ts +13 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/target.ts +11 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/tsconfig.json +11 -0
- package/examples/basic/node_modules/toilscript/std/assembly/shared/typeinfo.ts +72 -0
- package/examples/basic/node_modules/toilscript/std/assembly/staticarray.ts +423 -0
- package/examples/basic/node_modules/toilscript/std/assembly/string.ts +850 -0
- package/examples/basic/node_modules/toilscript/std/assembly/symbol.ts +114 -0
- package/examples/basic/node_modules/toilscript/std/assembly/table.ts +16 -0
- package/examples/basic/node_modules/toilscript/std/assembly/toilscript.ts +16 -0
- package/examples/basic/node_modules/toilscript/std/assembly/tsconfig.json +6 -0
- package/examples/basic/node_modules/toilscript/std/assembly/typedarray.ts +1954 -0
- package/examples/basic/node_modules/toilscript/std/assembly/uri.ts +17 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/bytes.ts +107 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/casemap.ts +497 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/error.ts +58 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/hash.ts +117 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/math.ts +1922 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/memory.ts +290 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/number.ts +873 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/sort.ts +313 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/string.ts +1202 -0
- package/examples/basic/node_modules/toilscript/std/assembly/util/uri.ts +275 -0
- package/examples/basic/node_modules/toilscript/std/assembly/vector.ts +4 -0
- package/examples/basic/node_modules/toilscript/std/assembly.json +16 -0
- package/examples/basic/node_modules/toilscript/std/portable/index.d.ts +461 -0
- package/examples/basic/node_modules/toilscript/std/portable/index.js +416 -0
- package/examples/basic/node_modules/toilscript/std/portable.json +11 -0
- package/examples/basic/node_modules/toilscript/std/types/assembly/index.d.ts +1 -0
- package/examples/basic/node_modules/toilscript/std/types/assembly/package.json +3 -0
- package/examples/basic/node_modules/toilscript/std/types/portable/index.d.ts +1 -0
- package/examples/basic/node_modules/toilscript/std/types/portable/package.json +3 -0
- package/examples/basic/node_modules/toilscript/tsconfig-base.json +13 -0
- package/examples/basic/node_modules/toilscript/util/README.md +23 -0
- package/examples/basic/node_modules/toilscript/util/browser/fs.js +1 -0
- package/examples/basic/node_modules/toilscript/util/browser/module.js +5 -0
- package/examples/basic/node_modules/toilscript/util/browser/path.js +520 -0
- package/examples/basic/node_modules/toilscript/util/browser/process.js +59 -0
- package/examples/basic/node_modules/toilscript/util/browser/url.js +23 -0
- package/examples/basic/node_modules/toilscript/util/cpu.d.ts +9 -0
- package/examples/basic/node_modules/toilscript/util/cpu.js +42 -0
- package/examples/basic/node_modules/toilscript/util/find.d.ts +6 -0
- package/examples/basic/node_modules/toilscript/util/find.js +20 -0
- package/examples/basic/node_modules/toilscript/util/node.d.ts +21 -0
- package/examples/basic/node_modules/toilscript/util/node.js +34 -0
- package/examples/basic/node_modules/toilscript/util/options.d.ts +70 -0
- package/examples/basic/node_modules/toilscript/util/options.js +262 -0
- package/examples/basic/node_modules/toilscript/util/terminal.d.ts +52 -0
- package/examples/basic/node_modules/toilscript/util/terminal.js +35 -0
- package/examples/basic/node_modules/toilscript/util/text.d.ts +26 -0
- package/examples/basic/node_modules/toilscript/util/text.js +114 -0
- package/examples/basic/node_modules/toilscript/util/tsconfig.json +9 -0
- package/examples/basic/node_modules/toilscript/util/web.d.ts +11 -0
- package/examples/basic/node_modules/toilscript/util/web.js +33 -0
- package/examples/basic/package-lock.json +50 -1
- package/examples/basic/package.json +5 -2
- package/examples/basic/server/index.ts +3 -0
- package/examples/basic/server/main.ts +6 -0
- package/examples/basic/server/tsconfig.json +7 -0
- package/examples/basic/toil-env.d.ts +20 -1
- package/examples/basic/toil.config.ts +2 -5
- package/examples/basic/toilconfig.json +30 -0
- package/package.json +2 -2
- package/presets/eslint.js +2 -7
- package/presets/no-uint8array-tostring.js +4 -5
- package/presets/prettier.json +8 -1
- package/src/backend/index.ts +11 -18
- package/src/cli/configure.ts +272 -0
- package/src/cli/create.ts +267 -82
- package/src/cli/features.ts +128 -0
- package/src/cli/index.ts +44 -3
- package/src/cli/proc.ts +20 -0
- package/src/cli/ui.ts +4 -6
- package/src/cli/validate.ts +31 -0
- package/src/client/head/head.ts +140 -0
- package/src/client/index.ts +39 -9
- package/src/client/navigation/Link.tsx +99 -0
- package/src/client/navigation/NavLink.tsx +86 -0
- package/src/client/navigation/navigation.ts +142 -0
- package/src/client/navigation/prefetch.ts +130 -0
- package/src/client/navigation/scroll.ts +53 -0
- package/src/client/routing/Router.tsx +95 -0
- package/src/client/routing/error-boundary.tsx +43 -0
- package/src/client/routing/hooks.ts +115 -0
- package/src/client/routing/lazy.ts +93 -0
- package/src/client/{match.ts → routing/match.ts} +11 -3
- package/src/client/routing/mount.tsx +28 -0
- package/src/client/routing/params-context.ts +10 -0
- package/src/client/types.ts +36 -0
- package/src/compiler/config.ts +26 -10
- package/src/compiler/docs.ts +87 -0
- package/src/compiler/generate.ts +180 -23
- package/src/compiler/index.ts +6 -4
- package/src/compiler/plugin.ts +22 -1
- package/src/compiler/routes.ts +13 -7
- package/src/compiler/vite.ts +28 -5
- package/src/io/BinaryReader.ts +1 -5
- package/src/io/BinaryWriter.ts +3 -3
- package/src/server/index.ts +3 -4
- package/src/server/tsconfig.json +4 -0
- package/templates/app/client/404.tsx +11 -0
- package/templates/app/client/components/.gitkeep +1 -0
- package/templates/app/client/components/Footer.tsx +8 -0
- package/templates/app/client/components/HoneycombBackground.tsx +162 -0
- package/templates/app/client/layout.tsx +53 -0
- package/templates/app/client/public/favicon.ico +0 -0
- package/templates/app/client/public/images/.gitkeep +1 -0
- package/templates/app/client/public/images/logo.svg +37 -0
- package/templates/app/client/public/index.html +16 -0
- package/templates/app/client/public/robots.txt +2 -0
- package/templates/app/client/routes/about.tsx +11 -0
- package/templates/app/client/routes/blog/[id].tsx +12 -0
- package/templates/app/client/routes/docs/[...slug].tsx +12 -0
- package/templates/app/client/routes/get-started.tsx +84 -0
- package/templates/app/client/routes/index.tsx +80 -0
- package/templates/app/client/routes/io.tsx +24 -0
- package/templates/app/client/styles/main.css +461 -0
- package/templates/app/client/toil.tsx +7 -0
- package/test/channel.test.ts +1 -1
- package/test/configure.test.ts +90 -0
- package/test/features.test.ts +111 -0
- package/test/head.test.ts +35 -0
- package/test/io.test.ts +8 -0
- package/test/navlink.test.ts +28 -0
- package/test/routes.test.ts +16 -1
- package/test/validate.test.ts +42 -0
- package/vitest.config.ts +1 -1
- package/examples/basic/dist/assets/404-D1bS2aH_.js +0 -1
- package/examples/basic/dist/assets/_...slug_-wR3shlWn.js +0 -1
- package/examples/basic/dist/assets/_id_-EWYvHfi2.js +0 -1
- package/examples/basic/dist/assets/about-Ddvj1tjF.js +0 -1
- package/examples/basic/dist/assets/index-CdG0me90.js +0 -1
- package/examples/basic/dist/assets/io-CODNJU57.js +0 -1
- package/examples/basic/dist/assets/layout-C15ZTPYI.js +0 -1
- package/examples/basic/dist/assets/react-JbAfoxYe.js +0 -9
- package/examples/basic/dist/assets/rolldown-runtime-1VNLd2iN.js +0 -1
- package/examples/basic/dist/assets/routes-GoydenoY.js +0 -1
- package/examples/basic/dist/index.html +0 -12
- package/src/client/runtime.tsx +0 -190
- /package/src/client/{channel.ts → channel/channel.ts} +0 -0
package/src/compiler/vite.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
1
2
|
import path from 'node:path';
|
|
3
|
+
import { pathToFileURL } from 'node:url';
|
|
2
4
|
|
|
3
5
|
import react from '@vitejs/plugin-react';
|
|
4
6
|
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
|
5
|
-
import { mergeConfig, type InlineConfig } from 'vite';
|
|
7
|
+
import { mergeConfig, type InlineConfig, type PluginOption } from 'vite';
|
|
6
8
|
|
|
7
9
|
import { type ResolvedToilConfig } from './config.js';
|
|
8
10
|
import { toilPlugin } from './plugin.js';
|
|
@@ -21,6 +23,23 @@ function assetFileName(name: string): string {
|
|
|
21
23
|
return 'assets/[name][extname]';
|
|
22
24
|
}
|
|
23
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Loads the Tailwind v4 Vite plugin if the project has `@tailwindcss/vite` installed (added by
|
|
28
|
+
* `toiljs create`/`configure` when Tailwind is enabled). Resolved from the project root so it picks
|
|
29
|
+
* up the project's copy; returns `undefined` when Tailwind is off, so the plugin simply isn't added.
|
|
30
|
+
*/
|
|
31
|
+
async function tailwindPlugin(root: string): Promise<PluginOption | undefined> {
|
|
32
|
+
let resolved: string;
|
|
33
|
+
try {
|
|
34
|
+
resolved = createRequire(path.join(root, 'package.json')).resolve('@tailwindcss/vite');
|
|
35
|
+
} catch {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- dynamic import() is typed any
|
|
39
|
+
const mod: { default?: () => PluginOption } = await import(pathToFileURL(resolved).href);
|
|
40
|
+
return mod.default?.();
|
|
41
|
+
}
|
|
42
|
+
|
|
24
43
|
/** Splits React's runtime into its own long-lived chunk for better caching. */
|
|
25
44
|
function manualChunks(id: string): string | undefined {
|
|
26
45
|
if (!id.includes('node_modules')) return undefined;
|
|
@@ -36,21 +55,24 @@ function manualChunks(id: string): string | undefined {
|
|
|
36
55
|
|
|
37
56
|
/**
|
|
38
57
|
* Builds the framework-owned Vite config. Vite's `root` is the generated `.toil` dir so its
|
|
39
|
-
* `index.html`
|
|
40
|
-
*
|
|
58
|
+
* `index.html` (built from the project's `public/index.html` template) emits at the output root
|
|
59
|
+
* with assets resolving correctly; static `public/` assets are mirrored to `.toil/public` and
|
|
60
|
+
* picked up via Vite's default publicDir. `fs.allow` opens the project (for `client/`) and the
|
|
61
|
+
* framework runtime. The opinionated default — Node polyfills
|
|
41
62
|
* (Buffer/global/process), React plugin, toil route plugin, typed asset folders, React chunk
|
|
42
63
|
* splitting and tuned build options — is applied here; `toiljs/client` is aliased to the
|
|
43
64
|
* runtime, and the user's `client.vite` overrides deep-merge on top.
|
|
44
65
|
*/
|
|
45
|
-
export function createViteConfig(cfg: ResolvedToilConfig): InlineConfig {
|
|
46
|
-
// .../build/client/index.js -> framework package root (covers build/ + node_modules in dev)
|
|
66
|
+
export async function createViteConfig(cfg: ResolvedToilConfig): Promise<InlineConfig> {
|
|
47
67
|
const frameworkRoot = path.resolve(path.dirname(cfg.runtimePath), '..', '..');
|
|
68
|
+
const tailwind = await tailwindPlugin(cfg.root);
|
|
48
69
|
|
|
49
70
|
const base: InlineConfig = {
|
|
50
71
|
root: cfg.toilDir,
|
|
51
72
|
base: cfg.base,
|
|
52
73
|
configFile: false,
|
|
53
74
|
plugins: [
|
|
75
|
+
tailwind,
|
|
54
76
|
nodePolyfills({ globals: { Buffer: true, global: true, process: true } }),
|
|
55
77
|
react(),
|
|
56
78
|
toilPlugin(cfg),
|
|
@@ -58,6 +80,7 @@ export function createViteConfig(cfg: ResolvedToilConfig): InlineConfig {
|
|
|
58
80
|
resolve: {
|
|
59
81
|
alias: {
|
|
60
82
|
'toiljs/client': cfg.runtimePath,
|
|
83
|
+
'toiljs/routes': path.join(cfg.toilDir, 'routes.ts'),
|
|
61
84
|
},
|
|
62
85
|
dedupe: ['react', 'react-dom'],
|
|
63
86
|
},
|
package/src/io/BinaryReader.ts
CHANGED
|
@@ -25,7 +25,6 @@ export class BinaryReader {
|
|
|
25
25
|
return this.buffer.byteLength;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// Helpers for comparisons; unchanged
|
|
29
28
|
public static stringCompare(a: string, b: string): number {
|
|
30
29
|
return a.localeCompare(b);
|
|
31
30
|
}
|
|
@@ -123,7 +122,6 @@ export class BinaryReader {
|
|
|
123
122
|
public readU128(be: boolean = true): bigint {
|
|
124
123
|
const raw = this.readBytes(U128_BYTE_LENGTH);
|
|
125
124
|
let bytes = raw;
|
|
126
|
-
// If data was written in little-endian, we reverse before interpreting
|
|
127
125
|
if (!be) {
|
|
128
126
|
bytes = this.reverseBytes(raw);
|
|
129
127
|
}
|
|
@@ -150,10 +148,8 @@ export class BinaryReader {
|
|
|
150
148
|
bytes = this.reverseBytes(raw);
|
|
151
149
|
}
|
|
152
150
|
|
|
153
|
-
// Construct as a 128-bit two's complement
|
|
154
151
|
let value = BigInt('0x' + this.toHexString(bytes));
|
|
155
152
|
|
|
156
|
-
// If the top bit is set (sign bit in big-endian), interpret negative
|
|
157
153
|
const signBitMask = 0x80;
|
|
158
154
|
if ((bytes[0] as number) & signBitMask) {
|
|
159
155
|
const twoTo128 = BigInt(1) << BigInt(128);
|
|
@@ -281,7 +277,7 @@ export class BinaryReader {
|
|
|
281
277
|
}
|
|
282
278
|
|
|
283
279
|
public readU8Array(): u8[] {
|
|
284
|
-
const length = this.readU16(true);
|
|
280
|
+
const length = this.readU16(true);
|
|
285
281
|
const result: u8[] = new Array<u8>(length);
|
|
286
282
|
for (let i = 0; i < length; i++) {
|
|
287
283
|
result[i] = this.readU8();
|
package/src/io/BinaryWriter.ts
CHANGED
|
@@ -46,7 +46,7 @@ export class BinaryWriter implements Disposable {
|
|
|
46
46
|
let totalLength: u32 = U16_BYTE_LENGTH;
|
|
47
47
|
|
|
48
48
|
for (let i = 0; i < values.length; i++) {
|
|
49
|
-
totalLength += U32_BYTE_LENGTH + (values[i] as Uint8Array).length;
|
|
49
|
+
totalLength += U32_BYTE_LENGTH + (values[i] as Uint8Array).length;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
return totalLength;
|
|
@@ -159,7 +159,7 @@ export class BinaryWriter implements Disposable {
|
|
|
159
159
|
public writeU256(bigIntValue: bigint, be: boolean = true): void {
|
|
160
160
|
if (
|
|
161
161
|
bigIntValue >
|
|
162
|
-
115792089237316195423570985008687907853269984665640564039457584007913129639935n
|
|
162
|
+
115792089237316195423570985008687907853269984665640564039457584007913129639935n ||
|
|
163
163
|
bigIntValue < 0n
|
|
164
164
|
) {
|
|
165
165
|
throw new Error('u256 value is too large or negative.');
|
|
@@ -184,7 +184,7 @@ export class BinaryWriter implements Disposable {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
public writeU128(bigIntValue: bigint, be: boolean = true): void {
|
|
187
|
-
if (bigIntValue > 340282366920938463463374607431768211455n
|
|
187
|
+
if (bigIntValue > 340282366920938463463374607431768211455n || bigIntValue < 0n) {
|
|
188
188
|
throw new Error('u128 value is too large or negative.');
|
|
189
189
|
}
|
|
190
190
|
|
package/src/server/index.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* toilscript server (WASM) entry, compiled to WebAssembly by `toilscript`.
|
|
3
3
|
*
|
|
4
|
-
* Placeholder module: a trivial exported function that compiles with the
|
|
5
|
-
*
|
|
6
|
-
* fork directly — no transformer required.
|
|
4
|
+
* Placeholder module: a trivial exported function that compiles with the toilscript std.
|
|
5
|
+
* Native decorators (e.g. `@main`) ship from toilscript directly — no transformer required.
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
8
|
export function add(a: i32, b: i32): i32 {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Place shared React components here.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { useRef, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const HEX_R = 34;
|
|
4
|
+
const GAP = 3;
|
|
5
|
+
const DRAW_R = HEX_R - GAP;
|
|
6
|
+
const GLOW_DIST = 140;
|
|
7
|
+
|
|
8
|
+
function tracePath(ctx: CanvasRenderingContext2D, cx: number, cy: number, r: number) {
|
|
9
|
+
ctx.beginPath();
|
|
10
|
+
|
|
11
|
+
for (let i = 0; i < 6; i++) {
|
|
12
|
+
const a = (Math.PI / 3) * i - Math.PI / 6;
|
|
13
|
+
const x = cx + r * Math.cos(a);
|
|
14
|
+
const y = cy + r * Math.sin(a);
|
|
15
|
+
|
|
16
|
+
if (i === 0) {
|
|
17
|
+
ctx.moveTo(x, y);
|
|
18
|
+
} else {
|
|
19
|
+
ctx.lineTo(x, y);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
ctx.closePath();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function buildGrid(w: number, h: number): Array<{ x: number; y: number }> {
|
|
27
|
+
const colW = Math.sqrt(3) * HEX_R;
|
|
28
|
+
|
|
29
|
+
const rowH = HEX_R * 1.5;
|
|
30
|
+
const cols = Math.ceil(w / colW) + 2;
|
|
31
|
+
const rows = Math.ceil(h / rowH) + 2;
|
|
32
|
+
const hexes: Array<{ x: number; y: number }> = [];
|
|
33
|
+
|
|
34
|
+
for (let row = -1; row < rows; row++) {
|
|
35
|
+
for (let col = -1; col < cols; col++) {
|
|
36
|
+
hexes.push({
|
|
37
|
+
x: col * colW + (row % 2 !== 0 ? colW / 2 : 0),
|
|
38
|
+
y: row * rowH,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return hexes;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default function HoneycombBackground() {
|
|
47
|
+
const canvasRef = useRef<HTMLCanvasElement>(null);
|
|
48
|
+
const mouse = useRef({ x: -9999, y: -9999 });
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const canvas = canvasRef.current;
|
|
52
|
+
|
|
53
|
+
if (!canvas) return;
|
|
54
|
+
|
|
55
|
+
const ctx = canvas.getContext('2d');
|
|
56
|
+
|
|
57
|
+
if (!ctx) return;
|
|
58
|
+
|
|
59
|
+
const dpr = window.devicePixelRatio || 1;
|
|
60
|
+
let hexes: Array<{ x: number; y: number }> = [];
|
|
61
|
+
let raf: number;
|
|
62
|
+
|
|
63
|
+
function resize() {
|
|
64
|
+
if (!canvas || !ctx) return;
|
|
65
|
+
|
|
66
|
+
const w = window.innerWidth;
|
|
67
|
+
const h = window.innerHeight;
|
|
68
|
+
canvas.width = w * dpr;
|
|
69
|
+
canvas.height = h * dpr;
|
|
70
|
+
canvas.style.width = `${w}px`;
|
|
71
|
+
canvas.style.height = `${h}px`;
|
|
72
|
+
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
73
|
+
hexes = buildGrid(w, h);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function draw() {
|
|
77
|
+
if (!ctx) return;
|
|
78
|
+
|
|
79
|
+
const w = window.innerWidth;
|
|
80
|
+
const h = window.innerHeight;
|
|
81
|
+
ctx.clearRect(0, 0, w, h);
|
|
82
|
+
|
|
83
|
+
const mx = mouse.current.x;
|
|
84
|
+
const my = mouse.current.y;
|
|
85
|
+
|
|
86
|
+
for (const { x, y } of hexes) {
|
|
87
|
+
const dist = Math.hypot(x - mx, y - my);
|
|
88
|
+
const t = Math.max(0, 1 - dist / GLOW_DIST);
|
|
89
|
+
const ease = t * t * (3 - 2 * t);
|
|
90
|
+
|
|
91
|
+
tracePath(ctx, x, y, DRAW_R);
|
|
92
|
+
|
|
93
|
+
ctx.fillStyle = 'rgba(255,255,255,0.018)';
|
|
94
|
+
ctx.fill();
|
|
95
|
+
|
|
96
|
+
if (ease > 0) {
|
|
97
|
+
ctx.fillStyle = `rgba(72,148,255,${ease * 0.025})`;
|
|
98
|
+
ctx.fill();
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
ctx.strokeStyle = 'rgba(255,255,255,0.055)';
|
|
102
|
+
ctx.lineWidth = 1;
|
|
103
|
+
ctx.stroke();
|
|
104
|
+
|
|
105
|
+
if (ease > 0) {
|
|
106
|
+
ctx.save();
|
|
107
|
+
ctx.shadowColor = `rgba(72,148,255,${ease * 0.2})`;
|
|
108
|
+
ctx.shadowBlur = 8 * ease;
|
|
109
|
+
ctx.strokeStyle = `rgba(120,180,255,${ease * 0.2})`;
|
|
110
|
+
ctx.lineWidth = 1 + ease * 0.4;
|
|
111
|
+
ctx.stroke();
|
|
112
|
+
ctx.restore();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
raf = requestAnimationFrame(draw);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
resize();
|
|
120
|
+
draw();
|
|
121
|
+
|
|
122
|
+
const onResize = () => {
|
|
123
|
+
cancelAnimationFrame(raf);
|
|
124
|
+
resize();
|
|
125
|
+
draw();
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const onMove = (e: MouseEvent) => {
|
|
129
|
+
mouse.current = { x: e.clientX, y: e.clientY };
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const onLeave = () => {
|
|
133
|
+
mouse.current = { x: -9999, y: -9999 };
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
window.addEventListener('resize', onResize);
|
|
137
|
+
window.addEventListener('mousemove', onMove);
|
|
138
|
+
document.addEventListener('mouseleave', onLeave);
|
|
139
|
+
|
|
140
|
+
return () => {
|
|
141
|
+
cancelAnimationFrame(raf);
|
|
142
|
+
window.removeEventListener('resize', onResize);
|
|
143
|
+
window.removeEventListener('mousemove', onMove);
|
|
144
|
+
document.removeEventListener('mouseleave', onLeave);
|
|
145
|
+
};
|
|
146
|
+
}, []);
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
<canvas
|
|
150
|
+
ref={canvasRef}
|
|
151
|
+
style={{
|
|
152
|
+
position: 'fixed',
|
|
153
|
+
inset: 0,
|
|
154
|
+
width: '100%',
|
|
155
|
+
height: '100%',
|
|
156
|
+
pointerEvents: 'none',
|
|
157
|
+
zIndex: 0,
|
|
158
|
+
}}
|
|
159
|
+
/>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import Footer from './components/Footer';
|
|
3
|
+
import HoneycombBackground from './components/HoneycombBackground';
|
|
4
|
+
|
|
5
|
+
const GitHubIcon = () => (
|
|
6
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
7
|
+
<path d="M12 2C6.477 2 2 6.477 2 12c0 4.418 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.009-.868-.013-1.703-2.782.604-3.369-1.341-3.369-1.341-.454-1.154-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0 1 12 6.836a9.59 9.59 0 0 1 2.504.337c1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.202 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.579.688.481C19.138 20.163 22 16.418 22 12c0-5.523-4.477-10-10-10z" />
|
|
8
|
+
</svg>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export default function Layout({ children }: { children?: ReactNode }) {
|
|
12
|
+
return (
|
|
13
|
+
<div className="app">
|
|
14
|
+
<HoneycombBackground />
|
|
15
|
+
<Toil.Head
|
|
16
|
+
titleTemplate="%s By Dacely"
|
|
17
|
+
title="ToilJS"
|
|
18
|
+
meta={[{ name: 'description', content: 'The most performant React framework.' }]}
|
|
19
|
+
/>
|
|
20
|
+
<header className="nav">
|
|
21
|
+
<Toil.Link href="/" className="nav-logo">
|
|
22
|
+
<img src="images/logo.svg" alt="ToilJS" width={28} height={28} />
|
|
23
|
+
<span>ToilJS</span>
|
|
24
|
+
</Toil.Link>
|
|
25
|
+
|
|
26
|
+
<nav className="nav-center">
|
|
27
|
+
<Toil.NavLink href="/" end className="nav-center-link">
|
|
28
|
+
Home
|
|
29
|
+
</Toil.NavLink>
|
|
30
|
+
<Toil.NavLink href="/get-started" className="nav-center-link">
|
|
31
|
+
Get Started
|
|
32
|
+
</Toil.NavLink>
|
|
33
|
+
</nav>
|
|
34
|
+
|
|
35
|
+
<nav className="nav-links">
|
|
36
|
+
<Toil.Link href="https://toil.org/docs">Docs</Toil.Link>
|
|
37
|
+
<a
|
|
38
|
+
href="https://github.com/btc-vision/toiljs"
|
|
39
|
+
target="_blank"
|
|
40
|
+
rel="noopener noreferrer"
|
|
41
|
+
className="nav-github">
|
|
42
|
+
<GitHubIcon />
|
|
43
|
+
GitHub
|
|
44
|
+
</a>
|
|
45
|
+
</nav>
|
|
46
|
+
</header>
|
|
47
|
+
|
|
48
|
+
<main className="content">{children}</main>
|
|
49
|
+
|
|
50
|
+
<Footer />
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Place images and other static assets here; served at /images/*.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 500 500">
|
|
3
|
+
<!-- Generator: Adobe Illustrator 30.4.0, SVG Export Plug-In . SVG Version: 2.1.4 Build 226) -->
|
|
4
|
+
<defs>
|
|
5
|
+
<style>
|
|
6
|
+
.st0 {
|
|
7
|
+
fill: #fff;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.st1 {
|
|
11
|
+
fill: url(#linear-gradient1);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.st2 {
|
|
15
|
+
fill: url(#linear-gradient);
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
18
|
+
<linearGradient id="linear-gradient" x1="43.27" y1="43.27" x2="467.12" y2="467.12" gradientUnits="userSpaceOnUse">
|
|
19
|
+
<stop offset="0" stop-color="#6990ff"/>
|
|
20
|
+
<stop offset=".03" stop-color="#6479f9"/>
|
|
21
|
+
<stop offset=".08" stop-color="#5d57f0"/>
|
|
22
|
+
<stop offset=".12" stop-color="#583de9"/>
|
|
23
|
+
<stop offset=".17" stop-color="#542ae3"/>
|
|
24
|
+
<stop offset=".23" stop-color="#521ee0"/>
|
|
25
|
+
<stop offset=".28" stop-color="#521be0"/>
|
|
26
|
+
<stop offset=".66" stop-color="#6900f4"/>
|
|
27
|
+
<stop offset="1" stop-color="#7f00f6"/>
|
|
28
|
+
</linearGradient>
|
|
29
|
+
<linearGradient id="linear-gradient1" x1="149.99" y1="355.49" x2="149.99" y2="0" gradientUnits="userSpaceOnUse">
|
|
30
|
+
<stop offset=".15" stop-color="#6990ff" stop-opacity=".6"/>
|
|
31
|
+
<stop offset=".55" stop-color="#531ae1"/>
|
|
32
|
+
</linearGradient>
|
|
33
|
+
</defs>
|
|
34
|
+
<rect class="st2" width="500" height="500" rx="130" ry="130"/>
|
|
35
|
+
<path class="st1" d="M299.98,0L0,355.49v-225.49C0,58.2,58.2,0,130,0h169.98Z"/>
|
|
36
|
+
<path class="st0" d="M106.17,111.11h285.24c9.9,0,16.7,9.96,13.09,19.18l-17.98,45.96c-2.11,5.39-7.31,8.94-13.09,8.94h-74.65c-7.76,0-14.06,6.29-14.06,14.06v214.94c0,7.76-6.29,14.06-14.06,14.06h-45.96c-7.76,0-14.06-6.29-14.06-14.06v-217.25c0-7.76-6.29-14.06-14.06-14.06h-73.66c-5.82,0-11.04-3.59-13.12-9.02l-16.76-43.64c-3.54-9.21,3.26-19.1,13.12-19.1Z"/>
|
|
37
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="theme-color" content="#080D11" />
|
|
7
|
+
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
8
|
+
<title>ToilJS By Dacely</title>
|
|
9
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
10
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
11
|
+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&display=swap" rel="stylesheet" />
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="root"></div>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default function BlogPost() {
|
|
2
|
+
const { id } = Toil.useParams();
|
|
3
|
+
return (
|
|
4
|
+
<main>
|
|
5
|
+
<h1>Blog post {id}</h1>
|
|
6
|
+
<p>
|
|
7
|
+
Dynamic route from <code>client/routes/blog/[id].tsx</code>.
|
|
8
|
+
</p>
|
|
9
|
+
<Toil.Link href="/">Back home</Toil.Link>
|
|
10
|
+
</main>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default function Docs() {
|
|
2
|
+
const { slug } = Toil.useParams();
|
|
3
|
+
return (
|
|
4
|
+
<main>
|
|
5
|
+
<h1>Docs</h1>
|
|
6
|
+
<p>
|
|
7
|
+
Catch-all route <code>client/routes/docs/[...slug].tsx</code> matched: <code>{slug}</code>
|
|
8
|
+
</p>
|
|
9
|
+
<Toil.Link href="/">Back home</Toil.Link>
|
|
10
|
+
</main>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export default function GetStarted() {
|
|
2
|
+
return (
|
|
3
|
+
<div className="gs-page">
|
|
4
|
+
|
|
5
|
+
{/* Hero */}
|
|
6
|
+
<div className="gs-hero">
|
|
7
|
+
<h1 className="gs-title">Get Started</h1>
|
|
8
|
+
<p className="gs-desc">Everything you need to build your first ToilJS app.</p>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
{/* Info grid */}
|
|
13
|
+
<section className="gs-section">
|
|
14
|
+
<h2 className="gs-section-title">Project Structure</h2>
|
|
15
|
+
<div className="gs-grid">
|
|
16
|
+
|
|
17
|
+
<div className="gs-card gs-card--accent1">
|
|
18
|
+
<div className="gs-card-icon">
|
|
19
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>
|
|
20
|
+
</div>
|
|
21
|
+
<h3>File-based Routing</h3>
|
|
22
|
+
<p>Every <code>.tsx</code> file in <code>client/routes/</code> becomes a route. No config required.</p>
|
|
23
|
+
<pre><code>{`index.tsx → /
|
|
24
|
+
about.tsx → /about
|
|
25
|
+
[id].tsx → /:id
|
|
26
|
+
[...slug].tsx → /*`}</code></pre>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div className="gs-card gs-card--accent2">
|
|
30
|
+
<div className="gs-card-icon">
|
|
31
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/></svg>
|
|
32
|
+
</div>
|
|
33
|
+
<h3>Public Folder</h3>
|
|
34
|
+
<p>Files in <code>public/</code> are copied as-is to the build root. Reference them with an absolute path.</p>
|
|
35
|
+
<pre><code>{`public/images/logo.svg
|
|
36
|
+
→ /images/logo.svg`}</code></pre>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div className="gs-card gs-card--accent3">
|
|
40
|
+
<div className="gs-card-icon">
|
|
41
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18M9 21V9"/></svg>
|
|
42
|
+
</div>
|
|
43
|
+
<h3>Layout</h3>
|
|
44
|
+
<p><code>client/layout.tsx</code> wraps every page. Use it for your nav, footer, providers, and global styles.</p>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<div className="gs-card gs-card--accent4">
|
|
48
|
+
<div className="gs-card-icon">
|
|
49
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>
|
|
50
|
+
</div>
|
|
51
|
+
<h3>Entry Point</h3>
|
|
52
|
+
<p><code>client/toil.tsx</code> is the app entry. Import global CSS and call <code>Toil.mount()</code> — runs once on startup.</p>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
</div>
|
|
56
|
+
</section>
|
|
57
|
+
|
|
58
|
+
{/* Navigation section */}
|
|
59
|
+
<section className="gs-section">
|
|
60
|
+
<h2 className="gs-section-title">Navigation</h2>
|
|
61
|
+
<div className="gs-card gs-card--flat">
|
|
62
|
+
<div className="gs-card-icon">
|
|
63
|
+
<svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>
|
|
64
|
+
</div>
|
|
65
|
+
<h3>Use <code>{'<Toil.Link>'}</code> for client-side navigation</h3>
|
|
66
|
+
<p>Avoids full page reloads and keeps transitions instant. Use a regular <code>{'<a>'}</code> only for external links.</p>
|
|
67
|
+
<pre><code>{`// ✅ Internal navigation
|
|
68
|
+
<Toil.Link href="/about">About</Toil.Link>
|
|
69
|
+
|
|
70
|
+
// ✅ External link
|
|
71
|
+
<a href="https://toil.org" target="_blank">Docs</a>`}</code></pre>
|
|
72
|
+
</div>
|
|
73
|
+
</section>
|
|
74
|
+
|
|
75
|
+
<div className="gs-actions">
|
|
76
|
+
<Toil.Link href="/" className="btn btn-secondary">← Back home</Toil.Link>
|
|
77
|
+
<a href="https://toil.org/docs" target="_blank" rel="noopener noreferrer" className="btn btn-primary">
|
|
78
|
+
Read the Docs
|
|
79
|
+
</a>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
</div>
|
|
83
|
+
);
|
|
84
|
+
}
|