toiljs 0.0.3 → 0.0.5
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 +169 -56
- 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/error-boundary.d.ts +16 -0
- package/build/client/error-boundary.js +19 -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 +14 -2
- package/build/client/index.js +8 -1
- 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.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/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 +4 -1
- package/build/compiler/docs.d.ts +10 -0
- package/build/compiler/docs.js +59 -0
- package/build/compiler/generate.d.ts +1 -0
- package/build/compiler/generate.js +139 -21
- package/build/compiler/index.d.ts +5 -2
- package/build/compiler/index.js +5 -3
- package/build/compiler/plugin.js +2 -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/layout.tsx +39 -26
- 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 +15 -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 +1 -1
- 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 +228 -67
- 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/Link.tsx +99 -0
- package/src/client/NavLink.tsx +86 -0
- package/src/client/Router.tsx +95 -0
- package/src/client/error-boundary.tsx +43 -0
- package/src/client/head.ts +140 -0
- package/src/client/hooks.ts +115 -0
- package/src/client/index.ts +35 -5
- package/src/client/lazy.ts +93 -0
- package/src/client/match.ts +11 -3
- package/src/client/mount.tsx +28 -0
- package/src/client/navigation.ts +142 -0
- package/src/client/params-context.ts +10 -0
- package/src/client/prefetch.ts +130 -0
- package/src/client/scroll.ts +53 -0
- package/src/client/types.ts +36 -0
- package/src/compiler/config.ts +15 -8
- package/src/compiler/docs.ts +87 -0
- package/src/compiler/generate.ts +180 -33
- package/src/compiler/index.ts +7 -4
- package/src/compiler/plugin.ts +3 -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/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 +15 -0
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./react-DEQrz1q7.js";var t=e(),n=()=>(0,t.jsx)(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,children:(0,t.jsx)(`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`})}),r={hmr:(0,t.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,t.jsx)(`polygon`,{points:`13 2 3 14 12 14 11 22 21 10 12 10 13 2`})}),routing:(0,t.jsx)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,t.jsx)(`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`})}),typescript:(0,t.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`currentColor`,children:[(0,t.jsx)(`rect`,{x:`2`,y:`2`,width:`20`,height:`20`,rx:`3`,fill:`currentColor`}),(0,t.jsx)(`path`,{d:`M13.5 12H15.5V18H17V12H19V10.5H13.5V12Z`,fill:`var(--bg)`}),(0,t.jsx)(`path`,{d:`M11 10.5C9.07 10.5 7.5 12.07 7.5 14C7.5 15.45 8.38 16.69 9.65 17.23L7.5 18H11C12.93 18 14.5 16.43 14.5 14.5C14.5 13.26 13.86 12.17 12.9 11.55C12.42 11.22 11.73 10.5 11 10.5ZM11 12C12.1 12 13 12.9 13 14C13 15.1 12.1 16 11 16H9.72C9.28 15.57 9 14.81 9 14C9 12.9 9.9 12 11 12Z`,fill:`var(--bg)`})]}),builds:(0,t.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,t.jsx)(`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`}),(0,t.jsx)(`polyline`,{points:`3.27 6.96 12 12.01 20.73 6.96`}),(0,t.jsx)(`line`,{x1:`12`,y1:`22.08`,x2:`12`,y2:`12`})]})},i=[{icon:r.hmr,label:`Instant HMR`},{icon:r.routing,label:`File Routing`},{icon:r.typescript,label:`TypeScript`},{icon:r.builds,label:`Optimized Builds`}];function a(){return(0,t.jsxs)(`section`,{className:`hero`,children:[(0,t.jsxs)(`div`,{className:`hero-logo`,children:[(0,t.jsx)(`img`,{src:`images/logo.svg`,className:`hero-logo-glow`,alt:``,"aria-hidden":`true`,width:96,height:96}),(0,t.jsx)(`img`,{src:`images/logo.svg`,className:`hero-logo-img`,alt:`ToilJS`,width:96,height:96})]}),(0,t.jsx)(`h1`,{className:`hero-title`,children:`ToilJS`}),(0,t.jsxs)(`p`,{className:`hero-tagline`,children:[`Next-gen React.`,(0,t.jsx)(`br`,{}),(0,t.jsx)(`span`,{children:`Zero config.`})]}),(0,t.jsxs)(`p`,{className:`hero-desc`,children:[`File-based routing, blazing-fast HMR, and full TypeScript.`,(0,t.jsx)(`br`,{}),`All powered by Vite.`]}),(0,t.jsx)(`ul`,{className:`features`,children:i.map(e=>(0,t.jsxs)(`li`,{className:`feature-badge`,children:[e.icon,e.label]},e.label))}),(0,t.jsxs)(`div`,{className:`hero-cta`,children:[(0,t.jsx)(Toil.Link,{href:`/get-started`,className:`btn btn-primary`,children:`Get Started`}),(0,t.jsxs)(`a`,{className:`btn btn-secondary`,href:`https://github.com/btc-vision/toiljs`,target:`_blank`,rel:`noopener noreferrer`,children:[(0,t.jsx)(n,{}),`GitHub`]})]})]})}export{a as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
:root{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--accent:#2563ff;--accent2:#7c3aed;--accent3:#22e3ab;--bg:#080d11;--surface:#0e1520;--border:#1b2330;--text:#f5f6fa;--muted:#8b9ab4}*,:before,:after{box-sizing:border-box}body{background:var(--bg);min-height:100vh;color:var(--text);margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;line-height:1.6}a{color:var(--accent);text-decoration:none}a:hover{color:var(--accent3)}.app{flex-direction:column;min-height:100vh;display:flex}.content{flex:1;justify-content:center;align-items:center;display:flex}.nav{border-bottom:1px solid var(--border);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);z-index:100;background:#080d11d9;justify-content:space-between;align-items:center;height:60px;padding:0 2rem;display:flex;position:sticky;top:0}.nav-logo{align-items:center;gap:.6rem;font-family:Montserrat,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:1.05rem;font-weight:800;line-height:1;display:flex;color:var(--text)!important}.nav-logo span{padding-top:.1em;line-height:1;display:block}.nav-logo img{border-radius:6px;flex-shrink:0;display:block}.nav-links{gap:1.5rem;font-size:.95rem;display:flex}.nav-links a{color:var(--muted)}.nav-links a:hover{color:var(--text)}.nav-github{align-items:center;gap:.4rem;display:flex}.nav-github svg{display:block}.hero{text-align:center;flex-direction:column;align-items:center;gap:1.25rem;max-width:680px;margin:0 auto;padding:5rem 1.5rem 4rem;display:flex}.hero-logo{width:96px;height:96px;position:relative}.hero-logo-img{z-index:1;border-radius:22px;transition:transform .3s;display:block;position:relative}.hero-logo-img:hover{transform:scale(1.06)}.hero-logo-glow{z-index:0;filter:blur(18px)saturate(1.4);opacity:.65;border-radius:22px;transition:opacity .3s,filter .3s,transform .3s;display:block;position:absolute;top:0;bottom:0;left:0;right:0;transform:scale(1.1)}.hero-logo:hover .hero-logo-glow{opacity:.9;filter:blur(24px)saturate(1.8);transform:scale(1.15)}.hero-title{letter-spacing:-.03em;background:linear-gradient(100deg, var(--accent), var(--accent2) 50%, var(--accent3));color:#0000;-webkit-background-clip:text;background-clip:text;margin:0;font-family:Montserrat,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:clamp(2.8rem,7vw,4.5rem);font-weight:900}.hero-tagline{color:var(--text);margin:0;font-size:clamp(1.2rem,3vw,1.6rem);font-weight:600;line-height:1.4}.hero-tagline span{color:var(--muted);font-weight:400}.hero-desc{color:var(--muted);max-width:480px;margin:0;font-size:1rem}.features{flex-wrap:wrap;justify-content:center;gap:.6rem;margin:.25rem 0 0;padding:0;list-style:none;display:flex}.feature-badge{background:var(--surface);border:1px solid var(--border);color:var(--muted);border-radius:999px;align-items:center;gap:.45rem;padding:.35em .9em;font-size:.88rem;transition:border-color .2s,color .2s;display:flex}.feature-badge svg{color:var(--accent);flex-shrink:0;transition:color .2s;display:block}.feature-badge:hover{border-color:var(--accent);color:var(--text)}.feature-badge:hover svg{color:var(--accent3)}.hero-cta{flex-wrap:wrap;justify-content:center;gap:.75rem;margin-top:.5rem;display:flex}.btn{cursor:pointer;border-radius:8px;justify-content:center;align-items:center;gap:.45rem;padding:.65em 1.6em;font-family:inherit;font-size:.95rem;font-weight:600;transition:filter .2s,background .2s,border-color .2s;display:inline-flex;text-decoration:none!important}.btn svg{display:block}.btn-primary{background:var(--accent);border:1px solid var(--accent);color:#fff!important}.btn-primary:hover{filter:brightness(1.15)}.btn-secondary{background:var(--surface);border:1px solid var(--border);color:var(--text)!important}.btn-secondary:hover{border-color:var(--accent);background:#131d2e}.footer{text-align:center;color:var(--muted);border-top:1px solid var(--border);padding:1.25rem;font-size:.82rem}code{color:var(--accent3);background:#0d131c;border-radius:4px;padding:.1rem .4rem;font-size:.88em}.gs-page{flex-direction:column;gap:3rem;width:100%;max-width:860px;margin:0 auto;padding:4rem 1.5rem 5rem;display:flex}.gs-hero{text-align:center}.gs-title{letter-spacing:-.03em;background:linear-gradient(100deg, var(--accent), var(--accent2) 50%, var(--accent3));color:#0000;-webkit-background-clip:text;background-clip:text;margin:0 0 .5rem;font-family:Montserrat,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:clamp(2.2rem,5vw,3.2rem);font-weight:900}.gs-desc{color:var(--muted);margin:0;font-size:1.05rem}.gs-section{flex-direction:column;gap:1rem;display:flex}.gs-section-title{letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin:0;font-size:.72rem;font-weight:700}.gs-grid{grid-template-columns:repeat(2,1fr);gap:1rem;display:grid}@media (max-width:560px){.gs-grid{grid-template-columns:1fr}}.gs-card{background:var(--surface);border:1px solid var(--border);border-radius:14px;flex-direction:column;gap:.6rem;padding:1.5rem;transition:border-color .2s,transform .2s,box-shadow .2s;display:flex;position:relative;overflow:hidden}.gs-card:before{content:"";opacity:0;border-radius:inherit;transition:opacity .3s;position:absolute;top:0;bottom:0;left:0;right:0}.gs-card:hover{transform:translateY(-2px)}.gs-card--accent1{border-top:2px solid var(--accent)}.gs-card--accent1:hover{box-shadow:0 8px 32px #2563ff26}.gs-card--accent2{border-top:2px solid var(--accent2)}.gs-card--accent2:hover{box-shadow:0 8px 32px #7c3aed26}.gs-card--accent3{border-top:2px solid var(--accent3)}.gs-card--accent3:hover{box-shadow:0 8px 32px #22e3ab1f}.gs-card--accent4{border-top:2px solid #f59e0b}.gs-card--accent4:hover{box-shadow:0 8px 32px #f59e0b1f}.gs-card--flat{border-top:2px solid var(--accent)}.gs-card--flat:hover{border-color:var(--accent);box-shadow:0 8px 32px #2563ff1f}.gs-card-icon{width:42px;height:42px;color:var(--accent);background:#2563ff1a;border-radius:10px;justify-content:center;align-items:center;margin-bottom:.25rem;display:flex}.gs-card--accent2 .gs-card-icon{color:var(--accent2);background:#7c3aed1a}.gs-card--accent3 .gs-card-icon{color:var(--accent3);background:#22e3ab1a}.gs-card--accent4 .gs-card-icon{color:#f59e0b;background:#f59e0b1a}.gs-card h3{color:var(--text);margin:0;font-size:.97rem;font-weight:700}.gs-card p{color:var(--muted);margin:0;font-size:.85rem;line-height:1.6}.gs-card pre{border:1px solid var(--border);background:#0a0f18;border-radius:6px;margin:0;padding:.6rem .85rem;overflow-x:auto}.gs-card pre code{color:var(--accent3);white-space:pre;background:0 0;padding:0;font-size:.8rem}.gs-actions{flex-wrap:wrap;gap:.75rem;display:flex}
|
|
2
|
+
/*$vite$:1*/
|
|
@@ -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,17 @@
|
|
|
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
|
+
<title>toiljs · basic</title>
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&display=swap" rel="stylesheet" />
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-BmqcTaBB.js"></script>
|
|
12
|
+
<link rel="stylesheet" crossorigin href="/css/style.css">
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<div id="root"></div>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { Link } from 'toiljs/client';
|
|
2
|
-
|
|
3
1
|
export default function NotFound() {
|
|
4
2
|
return (
|
|
5
3
|
<main>
|
|
6
4
|
<h1>404 — Page not found</h1>
|
|
7
5
|
<p>
|
|
8
|
-
This custom page is served from <code>client/404.tsx</code> whenever no route
|
|
9
|
-
matches.
|
|
6
|
+
This custom page is served from <code>client/404.tsx</code> whenever no route matches.
|
|
10
7
|
</p>
|
|
11
|
-
<Link href="/">Back home</Link>
|
|
8
|
+
<Toil.Link href="/">Back home</Toil.Link>
|
|
12
9
|
</main>
|
|
13
10
|
);
|
|
14
11
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Place shared React components here.
|
|
@@ -1,36 +1,49 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import Footer from './components/Footer';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
a { color: #2563FF; text-decoration: none; }
|
|
9
|
-
a:hover { color: #22E3AB; }
|
|
10
|
-
code { background: #11161f; color: #22E3AB; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
|
|
11
|
-
h1 { background: linear-gradient(90deg, #2563FF, #7C3AED, #22E3AB); -webkit-background-clip: text; background-clip: text; color: transparent; }
|
|
12
|
-
`;
|
|
4
|
+
const GitHubIcon = () => (
|
|
5
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
6
|
+
<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" />
|
|
7
|
+
</svg>
|
|
8
|
+
);
|
|
13
9
|
|
|
14
10
|
export default function Layout({ children }: { children?: ReactNode }) {
|
|
15
11
|
return (
|
|
16
|
-
<div
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<nav
|
|
29
|
-
<
|
|
30
|
-
<
|
|
12
|
+
<div className="app">
|
|
13
|
+
<Toil.Head
|
|
14
|
+
titleTemplate="%s · ToilJS"
|
|
15
|
+
title="ToilJS"
|
|
16
|
+
meta={[{ name: 'description', content: 'The most performant React framework.' }]}
|
|
17
|
+
/>
|
|
18
|
+
<header className="nav">
|
|
19
|
+
<a href="/" className="nav-logo">
|
|
20
|
+
<img src="images/logo.svg" alt="ToilJS" width={28} height={28} />
|
|
21
|
+
<span>ToilJS</span>
|
|
22
|
+
</a>
|
|
23
|
+
|
|
24
|
+
<nav className="nav-center">
|
|
25
|
+
<Toil.NavLink href="/" end className="nav-center-link">Home</Toil.NavLink>
|
|
26
|
+
<Toil.NavLink href="/get-started" className="nav-center-link">Get Started</Toil.NavLink>
|
|
27
|
+
</nav>
|
|
28
|
+
|
|
29
|
+
<nav className="nav-links">
|
|
30
|
+
<Toil.Link href="https://toil.org/docs">
|
|
31
|
+
Docs
|
|
32
|
+
</Toil.Link>
|
|
33
|
+
<a
|
|
34
|
+
href="https://github.com/btc-vision/toiljs"
|
|
35
|
+
target="_blank"
|
|
36
|
+
rel="noopener noreferrer"
|
|
37
|
+
className="nav-github">
|
|
38
|
+
<GitHubIcon />
|
|
39
|
+
GitHub
|
|
40
|
+
</a>
|
|
31
41
|
</nav>
|
|
32
42
|
</header>
|
|
33
|
-
|
|
43
|
+
|
|
44
|
+
<main className="content">{children}</main>
|
|
45
|
+
|
|
46
|
+
<Footer />
|
|
34
47
|
</div>
|
|
35
48
|
);
|
|
36
49
|
}
|
|
@@ -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,15 @@
|
|
|
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
|
+
<title>toiljs · basic</title>
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&display=swap" rel="stylesheet" />
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="root"></div>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { Link } from 'toiljs/client';
|
|
2
|
-
|
|
3
1
|
export default function About() {
|
|
4
2
|
return (
|
|
5
3
|
<main>
|
|
@@ -7,7 +5,7 @@ export default function About() {
|
|
|
7
5
|
<p>
|
|
8
6
|
This page is served by <code>client/routes/about.tsx</code>.
|
|
9
7
|
</p>
|
|
10
|
-
<Link href="/">Back home</Link>
|
|
8
|
+
<Toil.Link href="/">Back home</Toil.Link>
|
|
11
9
|
</main>
|
|
12
10
|
);
|
|
13
11
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { Link, useParams } from 'toiljs/client';
|
|
2
|
-
|
|
3
1
|
export default function BlogPost() {
|
|
4
|
-
const { id } = useParams();
|
|
2
|
+
const { id } = Toil.useParams();
|
|
5
3
|
return (
|
|
6
4
|
<main>
|
|
7
5
|
<h1>Blog post {id}</h1>
|
|
8
6
|
<p>
|
|
9
7
|
Dynamic route from <code>client/routes/blog/[id].tsx</code>.
|
|
10
8
|
</p>
|
|
11
|
-
<Link href="/">Back home</Link>
|
|
9
|
+
<Toil.Link href="/">Back home</Toil.Link>
|
|
12
10
|
</main>
|
|
13
11
|
);
|
|
14
12
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { Link, useParams } from 'toiljs/client';
|
|
2
|
-
|
|
3
1
|
export default function Docs() {
|
|
4
|
-
const { slug } = useParams();
|
|
2
|
+
const { slug } = Toil.useParams();
|
|
5
3
|
return (
|
|
6
4
|
<main>
|
|
7
5
|
<h1>Docs</h1>
|
|
8
6
|
<p>
|
|
9
|
-
Catch-all route <code>client/routes/docs/[...slug].tsx</code> matched:{
|
|
10
|
-
<code>{slug}</code>
|
|
7
|
+
Catch-all route <code>client/routes/docs/[...slug].tsx</code> matched: <code>{slug}</code>
|
|
11
8
|
</p>
|
|
12
|
-
<Link href="/">Back home</Link>
|
|
9
|
+
<Toil.Link href="/">Back home</Toil.Link>
|
|
13
10
|
</main>
|
|
14
11
|
);
|
|
15
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
|
+
}
|
|
@@ -1,13 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
const GitHubIcon = () => (
|
|
2
|
+
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
3
|
+
<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" />
|
|
4
|
+
</svg>
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
const icons = {
|
|
8
|
+
hmr: (
|
|
9
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
10
|
+
<polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />
|
|
11
|
+
</svg>
|
|
12
|
+
),
|
|
13
|
+
routing: (
|
|
14
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
15
|
+
<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" />
|
|
16
|
+
</svg>
|
|
17
|
+
),
|
|
18
|
+
typescript: (
|
|
19
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
|
|
20
|
+
<rect x="2" y="2" width="20" height="20" rx="3" fill="currentColor" />
|
|
21
|
+
<path d="M13.5 12H15.5V18H17V12H19V10.5H13.5V12Z" fill="var(--bg)" />
|
|
22
|
+
<path d="M11 10.5C9.07 10.5 7.5 12.07 7.5 14C7.5 15.45 8.38 16.69 9.65 17.23L7.5 18H11C12.93 18 14.5 16.43 14.5 14.5C14.5 13.26 13.86 12.17 12.9 11.55C12.42 11.22 11.73 10.5 11 10.5ZM11 12C12.1 12 13 12.9 13 14C13 15.1 12.1 16 11 16H9.72C9.28 15.57 9 14.81 9 14C9 12.9 9.9 12 11 12Z" fill="var(--bg)" />
|
|
23
|
+
</svg>
|
|
24
|
+
),
|
|
25
|
+
builds: (
|
|
26
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
|
|
27
|
+
<path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" />
|
|
28
|
+
<polyline points="3.27 6.96 12 12.01 20.73 6.96" />
|
|
29
|
+
<line x1="12" y1="22.08" x2="12" y2="12" />
|
|
30
|
+
</svg>
|
|
31
|
+
),
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const features = [
|
|
35
|
+
{ icon: icons.hmr, label: 'Instant HMR' },
|
|
36
|
+
{ icon: icons.routing, label: 'File Routing' },
|
|
37
|
+
{ icon: icons.typescript, label: 'TypeScript' },
|
|
38
|
+
{ icon: icons.builds, label: 'Optimized Builds' },
|
|
39
|
+
];
|
|
2
40
|
|
|
3
41
|
export default function Home() {
|
|
4
42
|
return (
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
43
|
+
<section className="hero">
|
|
44
|
+
<div className="hero-logo">
|
|
45
|
+
<img src="images/logo.svg" className="hero-logo-glow" alt="" aria-hidden="true" width={96} height={96} />
|
|
46
|
+
<img src="images/logo.svg" className="hero-logo-img" alt="ToilJS" width={96} height={96} />
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<h1 className="hero-title">ToilJS</h1>
|
|
50
|
+
|
|
51
|
+
<p className="hero-tagline">
|
|
52
|
+
Next-gen React.<br />
|
|
53
|
+
<span>Zero config.</span>
|
|
10
54
|
</p>
|
|
11
|
-
|
|
55
|
+
|
|
56
|
+
<p className="hero-desc">
|
|
57
|
+
File-based routing, blazing-fast HMR, and full TypeScript.
|
|
58
|
+
<br />All powered by Vite.
|
|
59
|
+
</p>
|
|
60
|
+
|
|
61
|
+
<ul className="features">
|
|
62
|
+
{features.map(f => (
|
|
63
|
+
<li key={f.label} className="feature-badge">
|
|
64
|
+
{f.icon}{f.label}
|
|
65
|
+
</li>
|
|
66
|
+
))}
|
|
67
|
+
</ul>
|
|
68
|
+
|
|
69
|
+
<div className="hero-cta">
|
|
70
|
+
<Toil.Link href="/get-started" className="btn btn-primary">
|
|
71
|
+
Get Started
|
|
72
|
+
</Toil.Link>
|
|
73
|
+
<a className="btn btn-secondary" href="https://github.com/btc-vision/toiljs" target="_blank" rel="noopener noreferrer">
|
|
74
|
+
<GitHubIcon />
|
|
75
|
+
GitHub
|
|
76
|
+
</a>
|
|
77
|
+
</div>
|
|
78
|
+
</section>
|
|
12
79
|
);
|
|
13
80
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { Link } from 'toiljs/client';
|
|
2
|
-
|
|
3
|
-
// Note: BinaryWriter / BinaryReader / FastMap / FastSet are NATIVE globals in a toil app —
|
|
4
|
-
// no import needed. They're injected at runtime and typed via the generated .toil/toil-env.d.ts.
|
|
5
1
|
export default function IoDemo() {
|
|
6
2
|
const writer = new BinaryWriter();
|
|
7
3
|
writer.writeU32(42);
|
|
@@ -19,10 +15,10 @@ export default function IoDemo() {
|
|
|
19
15
|
<main>
|
|
20
16
|
<h1>Native IO</h1>
|
|
21
17
|
<p>
|
|
22
|
-
<code>new BinaryWriter()</code> with no import — round-tripped {n} and
|
|
23
|
-
|
|
18
|
+
<code>new BinaryWriter()</code> with no import — round-tripped {n} and "{s}" through{' '}
|
|
19
|
+
{bytes.length} bytes; FastSet size {seen.size}.
|
|
24
20
|
</p>
|
|
25
|
-
<Link href="/">Back home</Link>
|
|
21
|
+
<Toil.Link href="/">Back home</Toil.Link>
|
|
26
22
|
</main>
|
|
27
23
|
);
|
|
28
24
|
}
|