Skip to content

The native runtime for three.js: three.js, down to the metal. 45× smaller than Electron, on a Sony PS3, and path-traced at 60 fps on ray-tracing GPUs.

feat(site): add Windows installer and portable downloads (#83)

Evan (Yifeng) Wange38956962042
diff --git a/package-lock.json b/package-lock.json
index 7907960..8cef007 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -22,7 +22,132 @@
"qrcode-generator": "^2.0.4",
"sharp": "^0.35.5",
"three": "^0.187.0",
- "typescript": "^5.9.3"
+ "typescript": "^5.9.3",
+ "wrangler": "4.160.1"
+ }
+ },
+ "node_modules/@cloudflare/kv-asset-handler": {
+ "version": "0.5.0",
+ "resolved": "https://registry.npmjs.org/@cloudflare/kv-asset-handler/-/kv-asset-handler-0.5.0.tgz",
+ "integrity": "sha512-jxQYkj8dSIzc0cD6cMMNdOc1UVjqSqu8BZdor5s8cGjW2I8BjODt/kWPVdY+u9zj3ms75Q5qaZgnxUad83+eAg==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "engines": {
+ "node": ">=22.0.0"
+ }
+ },
+ "node_modules/@cloudflare/unenv-preset": {
+ "version": "2.16.2",
+ "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.2.tgz",
+ "integrity": "sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "peerDependencies": {
+ "unenv": "2.0.0-rc.24",
+ "workerd": ">1.20260305.0 <2.0.0-0"
+ },
+ "peerDependenciesMeta": {
+ "workerd": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@cloudflare/workerd-darwin-64": {
+ "version": "1.20261110.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261110.1.tgz",
+ "integrity": "sha512-RazOdADqTgwYhE60+i6c/R5BA1J5aC//39oousnWBxmoVAiqUh1qsXNCGMbaEV6UC5RnZyWsIBRIcAYNDe1xTg==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-darwin-arm64": {
+ "version": "1.20261110.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261110.1.tgz",
+ "integrity": "sha512-TFsn/t+wczWnWdm+ytlWe+xHEO9sDgfIBmtMo8OxujuS2DXCmGimiyvJHmuv+6+N9OhUb0dM+fveXJI9yjuzew==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-linux-64": {
+ "version": "1.20261110.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261110.1.tgz",
+ "integrity": "sha512-i4080Pp6Q0nwS8OMqt3cbpJoWvbCrIlFKa+4Inbn+y2pWKTVsq6F9bgdi0l8CBZPMszd03gDlQR++dqMbErh2Q==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-linux-arm64": {
+ "version": "1.20261110.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261110.1.tgz",
+ "integrity": "sha512-0l+JyYWOhEzTs7yOkIdf1ZzcXd9WalPZ1kD0bBAobFvDhO/1jBnQkS4rzzyUkGV7g8pb3dkfrBP9c2ZiRLOfdw==",
+ "cpu": [
+ "arm64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cloudflare/workerd-windows-64": {
+ "version": "1.20261110.1",
+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261110.1.tgz",
+ "integrity": "sha512-zP8IGyWvohyJhbNjHOnTA9anRQtGN7X01T/dG+R9IA4vu2egRODsD02aoYzv0a0qImjt7tTpOOA+uVotDJPcSA==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "license": "Apache-2.0",
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">=16"
+ }
+ },
+ "node_modules/@cspotcode/source-map-support": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/trace-mapping": "0.3.9"
+ },
+ "engines": {
+ "node": ">=12"
}
},
"node_modules/@dimforge/rapier3d-compat": {
@@ -1060,6 +1185,83 @@
"url": "https://opencollective.com/libvips"
}
},
+ "node_modules/@jridgewell/resolve-uri": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz",
+ "integrity": "sha512-lhTtjtoEArWBjismtfS761S9Hlyn+nIZqOZVYoZ1Xn82PMNMVnk+jj/NhC4fAXGTs7ydONcJiR5vyQBTMDu27g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.0.0"
+ }
+ },
+ "node_modules/@jridgewell/sourcemap-codec": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",
+ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@jridgewell/trace-mapping": {
+ "version": "0.3.9",
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",
+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@jridgewell/resolve-uri": "^3.0.3",
+ "@jridgewell/sourcemap-codec": "^1.4.10"
+ }
+ },
+ "node_modules/@poppinss/colors": {
+ "version": "4.1.6",
+ "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz",
+ "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "kleur": "^4.1.5"
+ }
+ },
+ "node_modules/@poppinss/dumper": {
+ "version": "0.6.5",
+ "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz",
+ "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/colors": "^4.1.5",
+ "@sindresorhus/is": "^7.0.2",
+ "supports-color": "^10.0.0"
+ }
+ },
+ "node_modules/@poppinss/exception": {
+ "version": "1.2.3",
+ "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz",
+ "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/@sindresorhus/is": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz",
+ "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/is?sponsor=1"
+ }
+ },
+ "node_modules/@speed-highlight/core": {
+ "version": "1.2.24",
+ "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.24.tgz",
+ "integrity": "sha512-qeW2e1l78afw8VhRPfPQ1Gjj+KU5XFQ/OFV5ti6eTa9bruO7mJyZtA4vw0ofqmA3tKCkROE9xLk3VZoeRc98nw==",
+ "dev": true,
+ "license": "CC0-1.0"
+ },
"node_modules/@threert/gameplay": {
"resolved": "packages/gameplay",
"link": true
@@ -1118,6 +1320,27 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/blake3-wasm": {
+ "version": "2.1.5",
+ "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz",
+ "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/cookie": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",
+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
"node_modules/detect-libc": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
@@ -1135,6 +1358,16 @@
"dev": true,
"license": "ISC"
},
+ "node_modules/error-stack-parser-es": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz",
+ "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==",
+ "dev": true,
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/antfu"
+ }
+ },
"node_modules/esbuild": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz",
@@ -1184,6 +1417,31 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/fsevents": {
+ "version": "2.3.3",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "MIT",
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/kleur": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",
+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/meshoptimizer": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.1.1.tgz",
@@ -1191,6 +1449,46 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/miniflare": {
+ "version": "5.20261110.1-beta",
+ "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261110.1-beta.tgz",
+ "integrity": "sha512-CO8T1DO3/JFxEWvJ7yaHiPx5Ph/5FhRzYKve6cM8O2frHmY7yWudV5p8FU11bfGRAerChGpuK+l0HoxOCw2nFw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@cspotcode/source-map-support": "0.8.1",
+ "sharp": "0.35.5",
+ "undici": "7.30.1",
+ "workerd": "1.20261110.1",
+ "ws": "8.21.0",
+ "youch": "4.1.0-beta.10"
+ },
+ "engines": {
+ "node": ">=22.12.0"
+ },
+ "peerDependencies": {
+ "kerberos": "^2.0.0"
+ },
+ "peerDependenciesMeta": {
+ "kerberos": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
+ "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/pathe": {
+ "version": "2.0.3",
+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",
+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/playwright-core": {
"version": "1.65.0",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.0.tgz",
@@ -1312,6 +1610,19 @@
"node": ">=18.20 || >=20"
}
},
+ "node_modules/supports-color": {
+ "version": "10.2.2",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",
+ "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
"node_modules/three": {
"version": "0.187.0",
"resolved": "https://registry.npmjs.org/three/-/three-0.187.0.tgz",
@@ -1341,6 +1652,16 @@
"node": ">=14.17"
}
},
+ "node_modules/undici": {
+ "version": "7.30.1",
+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz",
+ "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=20.18.1"
+ }
+ },
"node_modules/undici-types": {
"version": "7.24.6",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
@@ -1348,6 +1669,121 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/unenv": {
+ "version": "2.0.0-rc.24",
+ "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz",
+ "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "pathe": "^2.0.3"
+ }
+ },
+ "node_modules/workerd": {
+ "version": "1.20261110.1",
+ "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261110.1.tgz",
+ "integrity": "sha512-GKdtki7t19f16vegol8Iw5Dh0mnjHLuwLx8rlhTPvyRBEXM0Osl9eYexWAW8uZD7OMw4WKNq9yvENg5kPDUJ9w==",
+ "dev": true,
+ "hasInstallScript": true,
+ "license": "Apache-2.0",
+ "bin": {
+ "workerd": "bin/workerd"
+ },
+ "engines": {
+ "node": ">=16"
+ },
+ "optionalDependencies": {
+ "@cloudflare/workerd-darwin-64": "1.20261110.1",
+ "@cloudflare/workerd-darwin-arm64": "1.20261110.1",
+ "@cloudflare/workerd-linux-64": "1.20261110.1",
+ "@cloudflare/workerd-linux-arm64": "1.20261110.1",
+ "@cloudflare/workerd-windows-64": "1.20261110.1"
+ }
+ },
+ "node_modules/wrangler": {
+ "version": "4.160.1",
+ "resolved": "https://registry.npmjs.org/wrangler/-/wrangler-4.160.1.tgz",
+ "integrity": "sha512-gM8daj5geYTEw+038dV5OQAmrSIo/9e97FoJuNf+r9PllWR0ZnqMI2LXZZDSHpGsMez3mKKFYH5o/hBsf1ZTHg==",
+ "dev": true,
+ "license": "MIT OR Apache-2.0",
+ "dependencies": {
+ "@cloudflare/kv-asset-handler": "0.5.0",
+ "@cloudflare/unenv-preset": "2.16.2",
+ "@cspotcode/source-map-support": "0.8.1",
+ "blake3-wasm": "2.1.5",
+ "esbuild": "0.28.2",
+ "miniflare": "5.20261110.1-beta",
+ "path-to-regexp": "6.3.0",
+ "unenv": "2.0.0-rc.24",
+ "workerd": "1.20261110.1"
+ },
+ "bin": {
+ "cf-wrangler": "bin/cf-wrangler.js",
+ "wrangler": "bin/wrangler.js",
+ "wrangler2": "bin/wrangler.js"
+ },
+ "engines": {
+ "node": ">=22.12.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "2.3.3"
+ },
+ "peerDependencies": {
+ "@cloudflare/workers-types": "^5.20261110.1"
+ },
+ "peerDependenciesMeta": {
+ "@cloudflare/workers-types": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ws": {
+ "version": "8.21.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",
+ "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/youch": {
+ "version": "4.1.0-beta.10",
+ "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz",
+ "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/colors": "^4.1.5",
+ "@poppinss/dumper": "^0.6.4",
+ "@speed-highlight/core": "^1.2.7",
+ "cookie": "^1.0.2",
+ "youch-core": "^0.3.3"
+ }
+ },
+ "node_modules/youch-core": {
+ "version": "0.3.3",
+ "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz",
+ "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@poppinss/exception": "^1.2.2",
+ "error-stack-parser-es": "^1.0.5"
+ }
+ },
"packages/gameplay": {
"name": "@threert/gameplay",
"license": "MIT",
diff --git a/package.json b/package.json
index e1d5007..3bfb0d2 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,7 @@
],
"scripts": {
"typecheck": "tsc -p packages/scene && tsc -p packages/gameplay && tsc -p packages/voxel && tsc -p games && tsc -p tools && tsc -p tests && tsc -p renderer/web/www",
- "test": "node --test packages/*/test/*.test.ts tools/*/test/*.test.ts",
+ "test": "node --test packages/*/test/*.test.ts tools/*/test/*.test.ts site/*.test.ts",
"scenes": "node tools/build-scenes.ts",
"test:render": "node tools/test-render.ts",
"test:layer-b": "node tools/test-layer-b.ts",
@@ -27,7 +27,8 @@
"qrcode-generator": "^2.0.4",
"sharp": "^0.35.5",
"three": "^0.187.0",
- "typescript": "^5.9.3"
+ "typescript": "^5.9.3",
+ "wrangler": "4.160.1"
},
"allowScripts": {
"esbuild": true
diff --git a/site/README.md b/site/README.md
index 1630774..a119801 100644
--- a/site/README.md
+++ b/site/README.md
@@ -106,6 +106,7 @@ disclosure. **Keep it that terse**: a card that grows a paragraph stops matching
| Card | From `latest.json` | Under the button |
|---|---|---|
+| ThreeRT for Windows | `windows`: the per-user EXE installer (x64) | unsigned preview notice, portable ZIP, SHA-256 file and installer digest |
| ThreeRT for macOS | `macos`: the disk image | SHA-256 |
| ThreeRT for iPhone | `ios.url`: TestFlight or the App Store | the link as a QR code in the card's corner |
| ThreeRT for Steam Deck | `linux`: the tarball (x86_64; Linux is in the requirement line) | the two commands that install it, in a block with a Copy button (`tar xzf ~/Downloads/<file>`, `ThreeRT/install.sh`: what the tarball's README says, with the place a browser saves to), one line on what they do, SHA-256 |
@@ -286,3 +287,17 @@ offline references and every number on the page are still the M5 run's. Kept fro
were not plainly better: `hello/sun-room-rt.webp` (its walls read more mottled on 2d4e88a) and all of Zero-Day
(sharper on 2d4e88a, but more orange fireflies in its dark floor and walls).
Amazon Lumberyard Bistro and Zero-Day are from NVIDIA's ORCA (CC BY 4.0); the credits are in the page's footer.
+
+### Windows preview releases
+
+Windows is distributed directly as an unsigned preview; a Microsoft Store account or paid signing service is not required for this channel. SmartScreen may warn on first use. The page states this without asking people to disable protection. Windows 10 2004+ or Windows 11 x64 and a DirectX 12 GPU with ray queries are required. The installer runs per-user and updates an existing install; the ZIP is a portable alternative.
+
+`latest.json.windows` has the installer `file`, `size`, `sha256`, `version`, `date`, `arch`, `minOS`, `signed: false`, and `channel: "preview"`. Its `portable` and `checksums` objects each have `file`, `size`, and `sha256`. All three files are checked, uploaded to R2, and served as attachments with HEAD and range support. The shared release script carries them over when another platform releases.
+
+From the client checkout, after Windows installation and runtime acceptance:
+
+```sh
+bun tools/release.ts --no-macos --windows-file dist/ThreeRT-<version>-windows-x64-setup.exe --site <site-checkout>/site
+```
+
+The matching ZIP must be beside the installer. The release script computes the checksums and preserves other platforms and the live macOS appcast. In this checkout run `bun test site/worker.test.ts`, `bun site/tools/build.ts --require-release`, `bunx wrangler deploy --dry-run --config site/wrangler.jsonc`, then `bun site/tools/deploy.ts`. Wrangler is pinned in package-lock.json. Before publishing from a separate checkout, refresh the release drop from the current live manifest so another platform's newer release is retained.
diff --git a/site/download/index.html b/site/download/index.html
index df3084c..2597762 100644
--- a/site/download/index.html
+++ b/site/download/index.html
@@ -3,12 +3,12 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
-<title>Download ThreeRT — macOS, iPhone, Steam Deck and Android</title>
-<meta name="description" content="ThreeRT for macOS, iPhone and iPad, Steam Deck and Linux, and Android: the free clients that open ThreeRT apps and games, from threert.app or your own dev server, and path-trace them on your own GPU.">
+<title>Download ThreeRT — Windows, macOS, iPhone, Steam Deck and Android</title>
+<meta name="description" content="ThreeRT for Windows, macOS, iPhone and iPad, Steam Deck and Linux, and Android: free clients that open ThreeRT apps and games from threert.app or your own dev server and path-trace them on your GPU.">
<link rel="icon" href="../brand/favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="../css/threert.css">
<style>
- /* Four cards, two a row. A card's three parts (what it is, three lines, the button) sit on rows the two cards of a
+ /* Client cards, two a row. A card's three parts (what it is, three lines, the button) sit on rows the two cards of a
row share, so the buttons are level whatever the lines above them wrap to. */
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dl .card { display: grid; grid-template-rows: auto 1fr auto; row-gap: 22px; }
@@ -85,6 +85,21 @@
</div>
</div>
+ <div class="card" id="windows">
+ <div class="top">
+ <div class="glyph" aria-hidden="true"><svg width="26" height="26" viewBox="0 0 26 26" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round"><path d="M3 4h9v9H3zM15 4h8v9h-8zM3 16h9v7H3zM15 16h8v7h-8z"/></svg></div>
+ <div><h2>ThreeRT for Windows</h2><span class="req">Windows&nbsp;10&nbsp;(2004)+ or&nbsp;11 · x64 · DirectX&nbsp;12</span></div>
+ </div>
+ <ul class="ticks">
+ <li>Apps and games from <a href="https://threert.app/" rel="noopener">threert.app</a>, in a native Windows client</li>
+ <li>For GPUs with DirectX 12 ray queries</li>
+ <li>Includes the <code>threert</code> command line; installs for your account</li>
+ </ul>
+ <div class="act" id="windowsAct">
+ <p class="fine">Looking for the build on this host…</p>
+ </div>
+ </div>
+
<div class="card" id="ios">
<div class="top">
<div class="glyph" aria-hidden="true"><svg width="26" height="26" viewBox="0 0 26 26" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" stroke-linecap="round"><rect x="7.5" y="2.5" width="11" height="21" rx="2.6"/><path d="M11.5 5.2h3"/></svg></div>
@@ -197,7 +212,7 @@
// The visitor's own client first, and lit; the one for a device like it beside it. Before anything is fetched, so
// nothing moves afterwards.
const here = platform();
- const order = { ios: ["ios", "mac", "deck", "android"], linux: ["deck", "android", "mac", "ios"], android: ["android", "deck", "mac", "ios"] }[here];
+ const order = { windows: ["windows", "mac", "deck", "android", "ios"], ios: ["ios", "mac", "windows", "deck", "android"], linux: ["deck", "windows", "android", "mac", "ios"], android: ["android", "deck", "windows", "mac", "ios"] }[here];
if (order) {
$(".dl").append(...order.map((id) => document.getElementById(id)));
for (const card of $(".dl").children) card.classList.toggle("lit", card.id === order[0]);
@@ -220,6 +235,15 @@
const m = r?.macos;
$("#macAct").innerHTML = m?.file ? row(clientUrl(m), "Download for macOS", version(m), megabytes(m.size)) + sha(m) : none("macOS");
+ const w = r?.windows;
+ if (w?.file) {
+ $("#windowsAct").innerHTML = row(clientUrl(w), "Download for Windows", `${version(w)} · Preview`, megabytes(w.size)) +
+ `<p class="fine">Open the installer. To update, run the newer installer.</p>` +
+ (w.signed === false ? `<p class="fine">Unsigned preview. Windows SmartScreen may warn that this app is unrecognized. Verify the download source before proceeding.</p>` : "") +
+ `<div class="row">${w.portable?.file ? `<a href="${esc(clientUrl(w.portable))}" download>Portable ZIP · ${megabytes(w.portable.size)}</a>` : ""}
+ ${w.checksums?.file ? `<a href="${esc(clientUrl(w.checksums))}" download>SHA-256 checksums</a>` : ""}</div>` + sha(w);
+ } else $("#windowsAct").innerHTML = none("Windows");
+
// iPhone: a link once the beta is open; until then, say so.
const i = r?.ios;
if (i?.url) {
diff --git a/site/js/site.js b/site/js/site.js
index 9c0249c..146118b 100644
--- a/site/js/site.js
+++ b/site/js/site.js
@@ -9,10 +9,10 @@ export const ROOT = new URL("..", import.meta.url);
export const GITHUB = "https://github.com/meshy-dev/ThreeRT";
/** The clients there are, as a visitor knows the device each is for. */
-export const CLIENTS = { macos: "macOS", ios: "iPhone", linux: "Steam Deck", android: "Android" };
+export const CLIENTS = { macos: "macOS", windows: "Windows", ios: "iPhone", linux: "Steam Deck", android: "Android" };
/**
- * "macos" | "ios" | "android" | "linux" | "other": the client a visitor's device takes. An iPad asks for the desktop
+ * "macos" | "windows" | "ios" | "android" | "linux" | "other": the client a visitor's device takes. An iPad asks for the desktop
* site as a Mac with a touch screen. An Android browser says Linux too, so it is asked first. "linux" is x86_64
* alone, what the tarball is built for: a Steam Deck's browsers say "X11; Linux x86_64", in Desktop Mode and in Game
* Mode alike.
@@ -20,6 +20,7 @@ export const CLIENTS = { macos: "macOS", ios: "iPhone", linux: "Steam Deck", and
export function platform(ua = navigator.userAgent, touchPoints = navigator.maxTouchPoints) {
if (/iPhone|iPod|iPad/.test(ua) || (/Macintosh/.test(ua) && touchPoints > 1)) return "ios";
if (/Android/.test(ua)) return "android";
+ if (/Windows NT/.test(ua)) return "windows";
if (/Macintosh|Mac OS X/.test(ua)) return "macos";
if (/Linux x86_64/.test(ua)) return "linux";
return "other";
@@ -31,7 +32,7 @@ export function platform(ua = navigator.userAgent, touchPoints = navigator.maxTo
*/
export function downloadButtons(root = document) {
const p = platform();
- const text = { macos: "Download for macOS", ios: "Get ThreeRT for iPhone", linux: "Download for Steam Deck", android: "Download for Android", other: "Download" }[p];
+ const text = { macos: "Download for macOS", windows: "Download for Windows", ios: "Get ThreeRT for iPhone", linux: "Download for Steam Deck", android: "Download for Android", other: "Download" }[p];
for (const a of root.querySelectorAll("a[data-dl]")) {
const label = a.querySelector("span") ?? a;
label.textContent = text;
@@ -51,10 +52,11 @@ async function json(rel) {
}
/**
- * The clients released on this host, or null: {version, date, macos, ios, linux, android}, an entry a client, each
+ * The clients released on this host, or null: {version, date, macos, ios, linux, android, windows}, an entry a client, each
* with its own `version` (clients are released on different days; an entry without one has the top-level version):
* macos {file, url, size, sha256, minOS, arch, signed, notarized}, ios {url, channel, minOS},
- * linux {file, url, size, sha256, arch, needs}, android {file, url, size, sha256, arch, minOS, signed}.
+ * linux {file, url, size, sha256, arch, needs}, android {file, url, size, sha256, arch, minOS, signed},
+ * windows {file, size, sha256, arch, minOS, signed, channel, portable, checksums}.
* A client without an entry is not published here.
*/
export const release = () => json("releases/latest.json");
diff --git a/site/serve.ts b/site/serve.ts
index 56ab2da..70800a6 100644
--- a/site/serve.ts
+++ b/site/serve.ts
@@ -9,6 +9,7 @@ import { existsSync, statSync } from "node:fs";
import { networkInterfaces } from "node:os";
import { extname, join, normalize, resolve } from "node:path";
import { VENDOR } from "./tools/vendor.ts";
+import { clientFile } from "./worker.ts";
const root = resolve(import.meta.dir);
const args = process.argv.slice(2);
@@ -60,7 +61,11 @@ Bun.serve({
// Packages are fetched by native clients and by pages on other origins (a playground, a game's own site).
if (rel.startsWith("play/")) headers["access-control-allow-origin"] = "*";
// The clients' files are downloads, as the Worker serves them.
- if (/^releases\/[^/]+\.(dmg|tar\.gz|apk)$/.test(rel)) headers["content-disposition"] = `attachment; filename="${rel.slice("releases/".length)}"`;
+ const client = clientFile(`/${rel}`);
+ if (client) {
+ headers["content-type"] = client.type;
+ headers["content-disposition"] = `attachment; filename="${client.key}"`;
+ }
return new Response(Bun.file(file), { headers });
},
});
diff --git a/site/tools/build.ts b/site/tools/build.ts
index 3356a10..b1d219a 100644
--- a/site/tools/build.ts
+++ b/site/tools/build.ts
@@ -12,7 +12,9 @@
// from R2.
import { cpSync, copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync } from "node:fs";
import { dirname, join, relative, resolve } from "node:path";
+import { createHash } from "node:crypto";
import { VENDOR } from "./vendor.ts";
+import { releaseArtifacts } from "./releases.ts";
const site = resolve(import.meta.dir, "..");
const args = process.argv.slice(2);
@@ -33,7 +35,7 @@ for (const [rel, file] of Object.entries(VENDOR)) {
// The clients' release.
/** A client's file: never a static asset here (worker.ts serves it from R2), whatever its size. */
-const CLIENT_FILE = /\.(dmg|tar\.gz|apk)$/;
+const CLIENT_FILE = /(?:\.(?:dmg|tar\.gz|apk|exe|zip)|-SHA256SUMS\.txt)$/;
const latest = join(site, "releases/latest.json");
if (existsSync(latest)) {
const r = JSON.parse(readFileSync(latest, "utf8"));
@@ -43,8 +45,7 @@ if (existsSync(latest)) {
// plain file host without that limit.
const withImage = args.includes("--with-image");
const said: string[] = [];
- for (const [key, name, required] of [["macos", "macOS", true], ["linux", "Linux", false], ["android", "Android", false]] as const) {
- const e = r[key];
+ for (const { key, name, required, entry: e } of releaseArtifacts(r)) {
if (!e && !required) {
said.push(`${name} not published`);
continue;
@@ -54,6 +55,8 @@ if (existsSync(latest)) {
if (!/^https:\/\//.test(e.url)) problems.push(`site/releases/latest.json: ${key}.url is not an https URL (${e.url})`);
} else if (!file || !existsSync(file)) problems.push(`site/releases/latest.json names ${e?.file ?? `no ${name} file`}, which is not in site/releases/`);
else if (statSync(file).size !== e.size) problems.push(`site/releases/${e.file} is ${statSync(file).size} bytes, latest.json says ${e.size}`);
+ else if (!/^[a-f0-9]{64}$/.test(e.sha256 ?? "") || createHash("sha256").update(readFileSync(file)).digest("hex") !== e.sha256)
+ problems.push(`site/releases/${e.file}: SHA-256 does not match latest.json`);
said.push(`${name} ${e?.version ?? r.version} ${e?.url ?? e?.file ?? "no file"}`);
}
// A public build opens like any app: never one that asks the user to get past Gatekeeper.
diff --git a/site/tools/deploy.ts b/site/tools/deploy.ts
index 5e933a5..cf00faa 100644
--- a/site/tools/deploy.ts
+++ b/site/tools/deploy.ts
@@ -3,8 +3,8 @@
// bun site/tools/deploy.ts needs `wrangler login` as a member of the account in site/wrangler.jsonc
// The build is strict: it stops when site/releases/ or site/play/ is missing or incomplete, so a deploy never puts up
// a Download button with nothing behind it (site/README.md: where the two directories come from).
-// Every file latest.json names (the macOS disk image, the Linux tarball, the Android APK) goes to the R2 bucket
-// first (site/wrangler.jsonc: `threert-releases`, created once with `bunx wrangler@4 r2 bucket create
+// Every file latest.json names (including the Windows installer, portable ZIP and checksums) goes to the R2 bucket
+// first (site/wrangler.jsonc: `threert-releases`, created once with `bunx wrangler r2 bucket create
// threert-releases`), so the page never links a file that is not there yet. A file the bucket already has is not
// sent again: the live site is asked for it (HEAD /releases/<file>: the Worker answers with the object's size and
// ETag), and the same size, and the same MD5 where the ETag is one, means it is there.
@@ -13,6 +13,7 @@ import { createHash } from "node:crypto";
import { existsSync, readFileSync, statSync } from "node:fs";
import { join, resolve } from "node:path";
import { clientFile } from "../worker.ts";
+import { releaseArtifacts } from "./releases.ts";
const site = resolve(import.meta.dir, "..");
const config = resolve(site, "wrangler.jsonc");
@@ -34,19 +35,18 @@ async function hosted(name: string, file: string): Promise<boolean> {
await $`bun ${resolve(site, "tools/build.ts")} --require-release`;
const latest = JSON.parse(readFileSync(join(site, "releases/latest.json"), "utf8"));
-for (const key of ["macos", "linux", "android"]) {
- const entry = latest[key];
+for (const { entry } of releaseArtifacts(latest)) {
// (An entry with a `url` is hosted elsewhere.)
if (!entry?.file || entry.url) continue;
const file = join(site, "releases", entry.file);
if (!existsSync(file)) throw new Error(`${file} is missing`);
// The type the Worker serves it with; a name it would not serve stops here.
const type = clientFile(`/releases/${entry.file}`)?.type;
- if (!type) throw new Error(`${entry.file}: not a file the Worker serves (/releases/<name>.dmg, .tar.gz or .apk)`);
+ if (!type) throw new Error(`${entry.file}: not a download the Worker serves`);
if (await hosted(entry.file, file)) {
console.log(`${entry.file}: already in R2, not sent again`);
continue;
}
- await $`bunx wrangler@4 r2 object put ${`threert-releases/${entry.file}`} --file ${file} --content-type ${type} --remote --config ${config}`;
+ await $`bunx wrangler r2 object put ${`threert-releases/${entry.file}`} --file ${file} --content-type ${type} --remote --config ${config}`;
}
-await $`bunx wrangler@4 deploy --config ${config}`;
+await $`bunx wrangler deploy --config ${config}`;
diff --git a/site/tools/releases.ts b/site/tools/releases.ts
new file mode 100644
index 0000000..46824a8
--- /dev/null
+++ b/site/tools/releases.ts
@@ -0,0 +1,12 @@
+/** Every downloadable artifact, including the Windows portable build and checksum file. */
+export function releaseArtifacts(latest: Record<string, any>) {
+ const entries = [
+ { key: "macos", name: "macOS", required: true, entry: latest.macos },
+ { key: "linux", name: "Linux", required: false, entry: latest.linux },
+ { key: "android", name: "Android", required: false, entry: latest.android },
+ { key: "windows", name: "Windows", required: false, entry: latest.windows },
+ ];
+ if (latest.windows) for (const part of ["portable", "checksums"])
+ entries.push({ key: `windows.${part}`, name: `Windows ${part}`, required: true, entry: latest.windows[part] });
+ return entries;
+}
diff --git a/site/worker.test.ts b/site/worker.test.ts
new file mode 100644
index 0000000..3f9be5f
--- /dev/null
+++ b/site/worker.test.ts
@@ -0,0 +1,39 @@
+import { test } from "node:test";
+import { strict as assert } from "node:assert";
+import worker, { clientFile } from "./worker.ts";
+import { releaseArtifacts } from "./tools/releases.ts";
+
+test("Windows downloads are attachments from R2, with HEAD and resume support", async () => {
+ const env = {
+ ASSETS: { fetch: async () => new Response("unexpected asset", { status: 500 }) },
+ RELEASES: {
+ head: async () => ({ size: 100, httpEtag: '"abc"', writeHttpMetadata() {} }),
+ get: async (_: string, options: any) => ({
+ size: 100, httpEtag: '"abc"', writeHttpMetadata() {},
+ range: options.range.has("range") ? { offset: 10, length: 3 } : undefined,
+ body: new Blob([new Uint8Array(options.range.has("range") ? 3 : 100)]).stream(),
+ }),
+ },
+ };
+ for (const [name, type] of [["ThreeRT-0.4.3-windows-x64-setup.exe", "application/vnd.microsoft.portable-executable"], ["ThreeRT-0.4.3-windows-x64.zip", "application/zip"], ["ThreeRT-0.4.3-windows-x64-SHA256SUMS.txt", "text/plain; charset=utf-8"]]) {
+ const url = `https://threert.dev/releases/${name}`;
+ const head = await worker.fetch(new Request(url, { method: "HEAD" }), env);
+ assert.equal(head.status, 200);
+ assert.equal(head.headers.get("content-type"), type);
+ assert.equal(head.headers.get("content-disposition"), `attachment; filename="${name}"`);
+ assert.equal(head.headers.get("content-length"), "100");
+ assert.equal(await head.text(), "");
+ const range = await worker.fetch(new Request(url, { headers: { Range: "bytes=10-12" } }), env);
+ assert.equal(range.status, 206);
+ assert.equal(range.headers.get("content-range"), "bytes 10-12/100");
+ assert.equal((await range.arrayBuffer()).byteLength, 3);
+ assert.equal((await worker.fetch(new Request(url, { method: "POST" }), env)).status, 405);
+ }
+ assert.equal(clientFile("/releases/../secret.exe"), null);
+ assert.equal(clientFile("/releases/config.txt"), null);
+});
+
+test("the site validates and uploads all three Windows artifacts", () => {
+ const windows = { file: "a.exe", portable: { file: "a.zip" }, checksums: { file: "a-SHA256SUMS.txt" } };
+ assert.deepEqual(releaseArtifacts({ windows }).filter(a => a.key.startsWith("windows")).map(a => a.entry.file), ["a.exe", "a.zip", "a-SHA256SUMS.txt"]);
+});
diff --git a/site/worker.ts b/site/worker.ts
index c797850..4f6a079 100644
--- a/site/worker.ts
+++ b/site/worker.ts
@@ -35,11 +35,14 @@ const CLIENT_TYPES: Record<string, string> = {
".dmg": "application/x-apple-diskimage",
".tar.gz": "application/gzip",
".apk": "application/vnd.android.package-archive",
+ ".exe": "application/vnd.microsoft.portable-executable",
+ ".zip": "application/zip",
+ "-SHA256SUMS.txt": "text/plain; charset=utf-8",
};
-/** /releases/<name>.dmg, .tar.gz or .apk -> the bucket key (the file name) and its type, or null for everything else. */
+/** A client download under /releases/ -> the bucket key and MIME type, or null for everything else. */
export function clientFile(pathname: string): { key: string; type: string } | null {
- const m = /^\/releases\/([A-Za-z0-9][A-Za-z0-9._-]*?(\.dmg|\.tar\.gz|\.apk))$/.exec(pathname);
+ const m = /^\/releases\/([A-Za-z0-9][A-Za-z0-9._-]*?(\.dmg|\.tar\.gz|\.apk|\.exe|\.zip|-SHA256SUMS\.txt))$/.exec(pathname);
return m ? { key: m[1], type: CLIENT_TYPES[m[2]] } : null;
}