diff --git a/.gitignore b/.gitignore index 722d333..7112704 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ dist/ # WASM build output (built locally and in CI) ghostty-vt.wasm + +# Visual render test failure artifacts +demo/baselines/*.fail.png diff --git a/bun.lock b/bun.lock index 557c739..ab53ca0 100644 --- a/bun.lock +++ b/bun.lock @@ -12,6 +12,7 @@ "@xterm/xterm": "^5.5.0", "mitata": "^1.0.34", "prettier": "^3.6.2", + "puppeteer": "^24.37.5", "typescript": "^5.9.3", "vite": "^4.5.0", "vite-plugin-dts": "^4.5.4", @@ -19,6 +20,8 @@ }, }, "packages": { + "@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="], + "@babel/helper-string-parser": ["@babel/helper-string-parser@7.27.1", "", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="], "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.28.5", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="], @@ -105,6 +108,8 @@ "@microsoft/tsdoc-config": ["@microsoft/tsdoc-config@0.18.0", "", { "dependencies": { "@microsoft/tsdoc": "0.16.0", "ajv": "~8.12.0", "jju": "~1.4.0", "resolve": "~1.22.2" } }, "sha512-8N/vClYyfOH+l4fLkkr9+myAoR6M7akc8ntBJ4DJdWH2b09uVfr71+LTMpNyG19fNqWDg8KEDZhx5wxuqHyGjw=="], + "@puppeteer/browsers": ["@puppeteer/browsers@2.13.0", "", { "dependencies": { "debug": "^4.4.3", "extract-zip": "^2.0.1", "progress": "^2.0.3", "proxy-agent": "^6.5.0", "semver": "^7.7.4", "tar-fs": "^3.1.1", "yargs": "^17.7.2" }, "bin": { "browsers": "lib/cjs/main-cli.js" } }, "sha512-46BZJYJjc/WwmKjsvDFykHtXrtomsCIrwYQPOP7VfMJoZY2bsDF9oROBABR3paDjDcmkUye1Pb1BqdcdiipaWA=="], + "@rollup/pluginutils": ["@rollup/pluginutils@5.3.0", "", { "dependencies": { "@types/estree": "^1.0.0", "estree-walker": "^2.0.2", "picomatch": "^4.0.2" }, "peerDependencies": { "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "optionalPeers": ["rollup"] }, "sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q=="], "@rushstack/node-core-library": ["@rushstack/node-core-library@5.18.0", "", { "dependencies": { "ajv": "~8.13.0", "ajv-draft-04": "~1.0.0", "ajv-formats": "~3.0.1", "fs-extra": "~11.3.0", "import-lazy": "~4.0.0", "jju": "~1.4.0", "resolve": "~1.22.1", "semver": "~7.5.4" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-XDebtBdw5S3SuZIt+Ra2NieT8kQ3D2Ow1HxhDQ/2soinswnOu9e7S69VSwTOLlQnx5mpWbONu+5JJjDxMAb6Fw=="], @@ -117,6 +122,8 @@ "@rushstack/ts-command-line": ["@rushstack/ts-command-line@5.1.3", "", { "dependencies": { "@rushstack/terminal": "0.19.3", "@types/argparse": "1.0.38", "argparse": "~1.0.9", "string-argv": "~0.3.1" } }, "sha512-Kdv0k/BnnxIYFlMVC1IxrIS0oGQd4T4b7vKfx52Y2+wk2WZSDFIvedr7JrhenzSlm3ou5KwtoTGTGd5nbODRug=="], + "@tootallnate/quickjs-emscripten": ["@tootallnate/quickjs-emscripten@0.23.0", "", {}, "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA=="], + "@types/argparse": ["@types/argparse@1.0.38", "", {}, "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA=="], "@types/bun": ["@types/bun@1.3.2", "", { "dependencies": { "bun-types": "1.3.2" } }, "sha512-t15P7k5UIgHKkxwnMNkJbWlh/617rkDGEdSsDbu+qNHTaz9SKf7aC8fiIlUdD5RPpH6GEkP0cK7WlvmrEBRtWg=="], @@ -127,6 +134,8 @@ "@types/react": ["@types/react@19.2.2", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA=="], + "@types/yauzl": ["@types/yauzl@2.10.3", "", { "dependencies": { "@types/node": "*" } }, "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q=="], + "@volar/language-core": ["@volar/language-core@2.4.23", "", { "dependencies": { "@volar/source-map": "2.4.23" } }, "sha512-hEEd5ET/oSmBC6pi1j6NaNYRWoAiDhINbT8rmwtINugR39loROSlufGdYMF9TaKGfz+ViGs1Idi3mAhnuPcoGQ=="], "@volar/source-map": ["@volar/source-map@2.4.23", "", {}, "sha512-Z1Uc8IB57Lm6k7q6KIDu/p+JWtf3xsXJqAX/5r18hYOTpJyBn0KXUR8oTJ4WFYOcDzWC9n3IflGgHowx6U6z9Q=="], @@ -149,6 +158,8 @@ "acorn": ["acorn@8.15.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="], + "agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="], + "ajv": ["ajv@8.12.0", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", "uri-js": "^4.2.2" } }, "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA=="], "ajv-draft-04": ["ajv-draft-04@1.0.0", "", { "peerDependencies": { "ajv": "^8.5.0" }, "optionalPeers": ["ajv"] }, "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw=="], @@ -157,42 +168,116 @@ "alien-signals": ["alien-signals@0.4.14", "", {}, "sha512-itUAVzhczTmP2U5yX67xVpsbbOiquusbWVyA9N+sy6+r6YVbFkahXvNCeEPWEOMhwDYwbVbGHFkVL03N9I5g+Q=="], - "argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="], + "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + + "argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], + + "ast-types": ["ast-types@0.13.4", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w=="], + + "b4a": ["b4a@1.8.0", "", { "peerDependencies": { "react-native-b4a": "*" }, "optionalPeers": ["react-native-b4a"] }, "sha512-qRuSmNSkGQaHwNbM7J78Wwy+ghLEYF1zNrSeMxj4Kgw6y33O3mXcQ6Ie9fRvfU/YnxWkOchPXbaLb73TkIsfdg=="], "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + "bare-events": ["bare-events@2.8.2", "", { "peerDependencies": { "bare-abort-controller": "*" }, "optionalPeers": ["bare-abort-controller"] }, "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ=="], + + "bare-fs": ["bare-fs@4.7.0", "", { "dependencies": { "bare-events": "^2.5.4", "bare-path": "^3.0.0", "bare-stream": "^2.6.4", "bare-url": "^2.2.2", "fast-fifo": "^1.3.2" }, "peerDependencies": { "bare-buffer": "*" }, "optionalPeers": ["bare-buffer"] }, "sha512-xzqKsCFxAek9aezYhjJuJRXBIaYlg/0OGDTZp+T8eYmYMlm66cs6cYko02drIyjN2CBbi+I6L7YfXyqpqtKRXA=="], + + "bare-os": ["bare-os@3.8.7", "", {}, "sha512-G4Gr1UsGeEy2qtDTZwL7JFLo2wapUarz7iTMcYcMFdS89AIQuBoyjgXZz0Utv7uHs3xA9LckhVbeBi8lEQrC+w=="], + + "bare-path": ["bare-path@3.0.0", "", { "dependencies": { "bare-os": "^3.0.1" } }, "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw=="], + + "bare-stream": ["bare-stream@2.13.0", "", { "dependencies": { "streamx": "^2.25.0", "teex": "^1.0.1" }, "peerDependencies": { "bare-abort-controller": "*", "bare-buffer": "*", "bare-events": "*" }, "optionalPeers": ["bare-abort-controller", "bare-buffer", "bare-events"] }, "sha512-3zAJRZMDFGjdn+RVnNpF9kuELw+0Fl3lpndM4NcEOhb9zwtSo/deETfuIwMSE5BXanA0FrN1qVjffGwAg2Y7EA=="], + + "bare-url": ["bare-url@2.4.0", "", { "dependencies": { "bare-path": "^3.0.0" } }, "sha512-NSTU5WN+fy/L0DDenfE8SXQna4voXuW0FHM7wH8i3/q9khUSchfPbPezO4zSFMnDGIf9YE+mt/RWhZgNRKRIXA=="], + + "basic-ftp": ["basic-ftp@5.2.2", "", {}, "sha512-1tDrzKsdCg70WGvbFss/ulVAxupNauGnOlgpyjKzeQxzyllBLS0CGLV7tjIXTK3ZQA9/FBEm9qyFFN1bciA6pw=="], + "brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], + "buffer-crc32": ["buffer-crc32@0.2.13", "", {}, "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ=="], + "bun-types": ["bun-types@1.3.2", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-i/Gln4tbzKNuxP70OWhJRZz1MRfvqExowP7U6JKoI8cntFrtxg7RJK3jvz7wQW54UuvNC8tbKHHri5fy74FVqg=="], + "callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="], + + "chromium-bidi": ["chromium-bidi@14.0.0", "", { "dependencies": { "mitt": "^3.0.1", "zod": "^3.24.1" }, "peerDependencies": { "devtools-protocol": "*" } }, "sha512-9gYlLtS6tStdRWzrtXaTMnqcM4dudNegMXJxkR0I/CXObHalYeYcAMPrL19eroNZHtJ8DQmu1E+ZNOYu/IXMXw=="], + + "cliui": ["cliui@8.0.1", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="], + + "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], + + "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], + "compare-versions": ["compare-versions@6.1.1", "", {}, "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg=="], "confbox": ["confbox@0.2.2", "", {}, "sha512-1NB+BKqhtNipMsov4xI/NnhCKp9XG9NamYp5PVm9klAT0fsrNPjaFICsCFhNhwZJKNh7zB/3q8qXz0E9oaMNtQ=="], + "cosmiconfig": ["cosmiconfig@9.0.1", "", { "dependencies": { "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-hr4ihw+DBqcvrsEDioRO31Z17x71pUYoNe/4h6Z0wB72p7MU7/9gH8Q3s12NFhHPfYBBOV3qyfUxmr/Yn3shnQ=="], + "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], + "data-uri-to-buffer": ["data-uri-to-buffer@6.0.2", "", {}, "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw=="], + "de-indent": ["de-indent@1.0.2", "", {}, "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg=="], "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], + "degenerator": ["degenerator@5.0.1", "", { "dependencies": { "ast-types": "^0.13.4", "escodegen": "^2.1.0", "esprima": "^4.0.1" } }, "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ=="], + + "devtools-protocol": ["devtools-protocol@0.0.1581282", "", {}, "sha512-nv7iKtNZQshSW2hKzYNr46nM/Cfh5SEvE2oV0/SEGgc9XupIY5ggf84Cz8eJIkBce7S3bmTAauFD6aysMpnqsQ=="], + "diff": ["diff@8.0.2", "", {}, "sha512-sSuxWU5j5SR9QQji/o2qMvqRNYRDOcBTgsJ/DeCf4iSN4gW+gNMXM7wFIP+fdXZxoNiAnHUTGjCr+TSWXdRDKg=="], + "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + + "end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="], + "entities": ["entities@4.5.0", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="], + "env-paths": ["env-paths@2.2.1", "", {}, "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A=="], + + "error-ex": ["error-ex@1.3.4", "", { "dependencies": { "is-arrayish": "^0.2.1" } }, "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ=="], + "esbuild": ["esbuild@0.18.20", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="], + "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], + + "escodegen": ["escodegen@2.1.0", "", { "dependencies": { "esprima": "^4.0.1", "estraverse": "^5.2.0", "esutils": "^2.0.2" }, "optionalDependencies": { "source-map": "~0.6.1" }, "bin": { "esgenerate": "bin/esgenerate.js", "escodegen": "bin/escodegen.js" } }, "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w=="], + + "esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="], + + "estraverse": ["estraverse@5.3.0", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="], + "estree-walker": ["estree-walker@2.0.2", "", {}, "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="], + "esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="], + + "events-universal": ["events-universal@1.0.1", "", { "dependencies": { "bare-events": "^2.7.0" } }, "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw=="], + "exsolve": ["exsolve@1.0.8", "", {}, "sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA=="], + "extract-zip": ["extract-zip@2.0.1", "", { "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" }, "optionalDependencies": { "@types/yauzl": "^2.9.1" }, "bin": { "extract-zip": "cli.js" } }, "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg=="], + "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], + "fast-fifo": ["fast-fifo@1.3.2", "", {}, "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ=="], + + "fd-slicer": ["fd-slicer@1.1.0", "", { "dependencies": { "pend": "~1.2.0" } }, "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g=="], + "fs-extra": ["fs-extra@11.3.2", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-Xr9F6z6up6Ws+NjzMCZc6WXg2YFRlrLP9NQDO3VQrWrfiojdhS56TzueT88ze0uBdCTwEIhQ3ptnmKeWGFAe0A=="], "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], + "get-caller-file": ["get-caller-file@2.0.5", "", {}, "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg=="], + + "get-stream": ["get-stream@5.2.0", "", { "dependencies": { "pump": "^3.0.0" } }, "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA=="], + + "get-uri": ["get-uri@6.0.5", "", { "dependencies": { "basic-ftp": "^5.0.2", "data-uri-to-buffer": "^6.0.2", "debug": "^4.3.4" } }, "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg=="], + "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="], "happy-dom": ["happy-dom@15.11.7", "", { "dependencies": { "entities": "^4.5.0", "webidl-conversions": "^7.0.0", "whatwg-mimetype": "^3.0.0" } }, "sha512-KyrFvnl+J9US63TEzwoiJOQzZBJY7KgBushJA8X61DMbNsH+2ONkDuLDnCnwUiPTF42tLoEmrPyoqbenVA5zrg=="], @@ -203,23 +288,43 @@ "he": ["he@1.2.0", "", { "bin": { "he": "bin/he" } }, "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="], + "http-proxy-agent": ["http-proxy-agent@7.0.2", "", { "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="], + + "https-proxy-agent": ["https-proxy-agent@7.0.6", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="], + + "import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="], + "import-lazy": ["import-lazy@4.0.0", "", {}, "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw=="], + "ip-address": ["ip-address@10.1.0", "", {}, "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q=="], + + "is-arrayish": ["is-arrayish@0.2.1", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="], + "is-core-module": ["is-core-module@2.16.1", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="], + "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="], + "jju": ["jju@1.4.0", "", {}, "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA=="], + "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "js-yaml": ["js-yaml@4.1.1", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA=="], + + "json-parse-even-better-errors": ["json-parse-even-better-errors@2.3.1", "", {}, "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="], + "json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], "jsonfile": ["jsonfile@6.2.0", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg=="], "kolorist": ["kolorist@1.8.0", "", {}, "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ=="], + "lines-and-columns": ["lines-and-columns@1.2.4", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="], + "local-pkg": ["local-pkg@1.1.2", "", { "dependencies": { "mlly": "^1.7.4", "pkg-types": "^2.3.0", "quansync": "^0.2.11" } }, "sha512-arhlxbFRmoQHl33a0Zkle/YWlmNwoyt6QNZEIJcqNbdrsix5Lvc4HyyI3EnwxTYlZYc32EbYrQ8SzEZ7dqgg9A=="], "lodash": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="], - "lru-cache": ["lru-cache@6.0.0", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="], + "lru-cache": ["lru-cache@7.18.3", "", {}, "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA=="], "magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="], @@ -227,6 +332,8 @@ "mitata": ["mitata@1.0.34", "", {}, "sha512-Mc3zrtNBKIMeHSCQ0XqRLo1vbdIx1wvFV9c8NJAiyho6AjNfMY8bVhbS12bwciUdd1t4rj8099CH3N3NFahaUA=="], + "mitt": ["mitt@3.0.1", "", {}, "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw=="], + "mlly": ["mlly@1.8.0", "", { "dependencies": { "acorn": "^8.15.0", "pathe": "^2.0.3", "pkg-types": "^1.3.1", "ufo": "^1.6.1" } }, "sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g=="], "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], @@ -235,12 +342,26 @@ "nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="], + "netmask": ["netmask@2.1.1", "", {}, "sha512-eonl3sLUha+S1GzTPxychyhnUzKyeQkZ7jLjKrBagJgPla13F+uQ71HgpFefyHgqrjEbCPkDArxYsjY8/+gLKA=="], + + "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], + + "pac-proxy-agent": ["pac-proxy-agent@7.2.0", "", { "dependencies": { "@tootallnate/quickjs-emscripten": "^0.23.0", "agent-base": "^7.1.2", "debug": "^4.3.4", "get-uri": "^6.0.1", "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.6", "pac-resolver": "^7.0.1", "socks-proxy-agent": "^8.0.5" } }, "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA=="], + + "pac-resolver": ["pac-resolver@7.0.1", "", { "dependencies": { "degenerator": "^5.0.0", "netmask": "^2.0.2" } }, "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg=="], + + "parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="], + + "parse-json": ["parse-json@5.2.0", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="], + "path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="], "path-parse": ["path-parse@1.0.7", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="], "pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="], + "pend": ["pend@1.2.0", "", {}, "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg=="], + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], "picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="], @@ -251,17 +372,39 @@ "prettier": ["prettier@3.6.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="], + "progress": ["progress@2.0.3", "", {}, "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="], + + "proxy-agent": ["proxy-agent@6.5.0", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "^4.3.4", "http-proxy-agent": "^7.0.1", "https-proxy-agent": "^7.0.6", "lru-cache": "^7.14.1", "pac-proxy-agent": "^7.1.0", "proxy-from-env": "^1.1.0", "socks-proxy-agent": "^8.0.5" } }, "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A=="], + + "proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="], + + "pump": ["pump@3.0.4", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA=="], + "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], + "puppeteer": ["puppeteer@24.40.0", "", { "dependencies": { "@puppeteer/browsers": "2.13.0", "chromium-bidi": "14.0.0", "cosmiconfig": "^9.0.0", "devtools-protocol": "0.0.1581282", "puppeteer-core": "24.40.0", "typed-query-selector": "^2.12.1" }, "bin": { "puppeteer": "lib/cjs/puppeteer/node/cli.js" } }, "sha512-IxQbDq93XHVVLWHrAkFP7F7iHvb9o0mgfsSIMlhHb+JM+JjM1V4v4MNSQfcRWJopx9dsNOr9adYv0U5fm9BJBQ=="], + + "puppeteer-core": ["puppeteer-core@24.40.0", "", { "dependencies": { "@puppeteer/browsers": "2.13.0", "chromium-bidi": "14.0.0", "debug": "^4.4.3", "devtools-protocol": "0.0.1581282", "typed-query-selector": "^2.12.1", "webdriver-bidi-protocol": "0.4.1", "ws": "^8.19.0" } }, "sha512-MWL3XbUCfVgGR0gRsidzT6oKJT2QydPLhMITU6HoVWiiv4gkb6gJi3pcdAa8q4HwjBTbqISOWVP4aJiiyUJvag=="], + "quansync": ["quansync@0.2.11", "", {}, "sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA=="], + "require-directory": ["require-directory@2.1.1", "", {}, "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q=="], + "require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="], "resolve": ["resolve@1.22.11", "", { "dependencies": { "is-core-module": "^2.16.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ=="], + "resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="], + "rollup": ["rollup@3.29.5", "", { "optionalDependencies": { "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w=="], - "semver": ["semver@7.5.4", "", { "dependencies": { "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" } }, "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA=="], + "semver": ["semver@7.7.4", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="], + + "smart-buffer": ["smart-buffer@4.2.0", "", {}, "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg=="], + + "socks": ["socks@2.8.7", "", { "dependencies": { "ip-address": "^10.0.1", "smart-buffer": "^4.2.0" } }, "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A=="], + + "socks-proxy-agent": ["socks-proxy-agent@8.0.5", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "^4.3.4", "socks": "^2.8.3" } }, "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw=="], "source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], @@ -269,14 +412,32 @@ "sprintf-js": ["sprintf-js@1.0.3", "", {}, "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="], + "streamx": ["streamx@2.25.0", "", { "dependencies": { "events-universal": "^1.0.0", "fast-fifo": "^1.3.2", "text-decoder": "^1.1.0" } }, "sha512-0nQuG6jf1w+wddNEEXCF4nTg3LtufWINB5eFEN+5TNZW7KWJp6x87+JFL43vaAUPyCfH1wID+mNVyW6OHtFamg=="], + "string-argv": ["string-argv@0.3.2", "", {}, "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q=="], + "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + + "strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + "strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], "supports-color": ["supports-color@8.1.1", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q=="], "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], + "tar-fs": ["tar-fs@3.1.2", "", { "dependencies": { "pump": "^3.0.0", "tar-stream": "^3.1.5" }, "optionalDependencies": { "bare-fs": "^4.0.1", "bare-path": "^3.0.0" } }, "sha512-QGxxTxxyleAdyM3kpFs14ymbYmNFrfY+pHj7Z8FgtbZ7w2//VAgLMac7sT6nRpIHjppXO2AwwEOg0bPFVRcmXw=="], + + "tar-stream": ["tar-stream@3.1.8", "", { "dependencies": { "b4a": "^1.6.4", "bare-fs": "^4.5.5", "fast-fifo": "^1.2.0", "streamx": "^2.15.0" } }, "sha512-U6QpVRyCGHva435KoNWy9PRoi2IFYCgtEhq9nmrPPpbRacPs9IH4aJ3gbrFC8dPcXvdSZ4XXfXT5Fshbp2MtlQ=="], + + "teex": ["teex@1.0.1", "", { "dependencies": { "streamx": "^2.12.5" } }, "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg=="], + + "text-decoder": ["text-decoder@1.2.7", "", { "dependencies": { "b4a": "^1.6.4" } }, "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ=="], + + "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "typed-query-selector": ["typed-query-selector@2.12.1", "", {}, "sha512-uzR+FzI8qrUEIu96oaeBJmd9E7CFEiQ3goA5qCVgc4s5llSubcfGHq9yUstZx/k4s9dXHVKsE35YWoFyvEqEHA=="], + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], "ufo": ["ufo@1.6.1", "", {}, "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA=="], @@ -293,16 +454,42 @@ "vscode-uri": ["vscode-uri@3.1.0", "", {}, "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ=="], + "webdriver-bidi-protocol": ["webdriver-bidi-protocol@0.4.1", "", {}, "sha512-ARrjNjtWRRs2w4Tk7nqrf2gBI0QXWuOmMCx2hU+1jUt6d00MjMxURrhxhGbrsoiZKJrhTSTzbIrc554iKI10qw=="], + "webidl-conversions": ["webidl-conversions@7.0.0", "", {}, "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g=="], "whatwg-mimetype": ["whatwg-mimetype@3.0.0", "", {}, "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q=="], + "wrap-ansi": ["wrap-ansi@7.0.0", "", { "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" } }, "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q=="], + + "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], + + "ws": ["ws@8.20.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA=="], + + "y18n": ["y18n@5.0.8", "", {}, "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA=="], + "yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], + "yargs": ["yargs@17.7.2", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="], + + "yargs-parser": ["yargs-parser@21.1.1", "", {}, "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="], + + "yauzl": ["yauzl@2.10.0", "", { "dependencies": { "buffer-crc32": "~0.2.3", "fd-slicer": "~1.1.0" } }, "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g=="], + + "zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], + + "@microsoft/api-extractor/semver": ["semver@7.5.4", "", { "dependencies": { "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" } }, "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA=="], + "@microsoft/api-extractor/typescript": ["typescript@5.8.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ=="], "@rushstack/node-core-library/ajv": ["ajv@8.13.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", "uri-js": "^4.4.1" } }, "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA=="], + "@rushstack/node-core-library/semver": ["semver@7.5.4", "", { "dependencies": { "lru-cache": "^6.0.0" }, "bin": { "semver": "bin/semver.js" } }, "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA=="], + + "@rushstack/ts-command-line/argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="], + + "@types/yauzl/@types/node": ["@types/node@24.10.0", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A=="], + "@vue/language-core/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], "ajv-formats/ajv": ["ajv@8.13.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2", "uri-js": "^4.4.1" } }, "sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA=="], @@ -311,6 +498,12 @@ "mlly/pkg-types": ["pkg-types@1.3.1", "", { "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.4", "pathe": "^2.0.1" } }, "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ=="], + "@microsoft/api-extractor/semver/lru-cache": ["lru-cache@6.0.0", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="], + + "@rushstack/node-core-library/semver/lru-cache": ["lru-cache@6.0.0", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="], + + "@types/yauzl/@types/node/undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], + "bun-types/@types/node/undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], "mlly/pkg-types/confbox": ["confbox@0.1.8", "", {}, "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w=="], diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..808fbb2 Binary files /dev/null and b/bun.lockb differ diff --git a/demo/baselines/ansi-colors.png b/demo/baselines/ansi-colors.png new file mode 100644 index 0000000..348f11f Binary files /dev/null and b/demo/baselines/ansi-colors.png differ diff --git a/demo/baselines/basic-text.png b/demo/baselines/basic-text.png new file mode 100644 index 0000000..6b2ea9a Binary files /dev/null and b/demo/baselines/basic-text.png differ diff --git a/demo/baselines/cell-backgrounds.png b/demo/baselines/cell-backgrounds.png new file mode 100644 index 0000000..295f4f9 Binary files /dev/null and b/demo/baselines/cell-backgrounds.png differ diff --git a/demo/baselines/colorscript-art.png b/demo/baselines/colorscript-art.png new file mode 100644 index 0000000..ee97033 Binary files /dev/null and b/demo/baselines/colorscript-art.png differ diff --git a/demo/baselines/combined-styles.png b/demo/baselines/combined-styles.png new file mode 100644 index 0000000..5c38b49 Binary files /dev/null and b/demo/baselines/combined-styles.png differ diff --git a/demo/baselines/cursor-bar.png b/demo/baselines/cursor-bar.png new file mode 100644 index 0000000..14416ef Binary files /dev/null and b/demo/baselines/cursor-bar.png differ diff --git a/demo/baselines/cursor-block.png b/demo/baselines/cursor-block.png new file mode 100644 index 0000000..1b07cb0 Binary files /dev/null and b/demo/baselines/cursor-block.png differ diff --git a/demo/baselines/cursor-underline.png b/demo/baselines/cursor-underline.png new file mode 100644 index 0000000..813f598 Binary files /dev/null and b/demo/baselines/cursor-underline.png differ diff --git a/demo/baselines/hyperlink.png b/demo/baselines/hyperlink.png new file mode 100644 index 0000000..8eb1170 Binary files /dev/null and b/demo/baselines/hyperlink.png differ diff --git a/demo/baselines/inverse-video.png b/demo/baselines/inverse-video.png new file mode 100644 index 0000000..eaa53cb Binary files /dev/null and b/demo/baselines/inverse-video.png differ diff --git a/demo/baselines/invisible-text.png b/demo/baselines/invisible-text.png new file mode 100644 index 0000000..d828fc6 Binary files /dev/null and b/demo/baselines/invisible-text.png differ diff --git a/demo/baselines/powerline-prompt.png b/demo/baselines/powerline-prompt.png new file mode 100644 index 0000000..f26b6e8 Binary files /dev/null and b/demo/baselines/powerline-prompt.png differ diff --git a/demo/baselines/rgb-colors.png b/demo/baselines/rgb-colors.png new file mode 100644 index 0000000..a2ab2be Binary files /dev/null and b/demo/baselines/rgb-colors.png differ diff --git a/demo/baselines/text-styles.png b/demo/baselines/text-styles.png new file mode 100644 index 0000000..0893fc7 Binary files /dev/null and b/demo/baselines/text-styles.png differ diff --git a/demo/baselines/wide-chars.png b/demo/baselines/wide-chars.png new file mode 100644 index 0000000..3ad6287 Binary files /dev/null and b/demo/baselines/wide-chars.png differ diff --git a/demo/bin/render-test.ts b/demo/bin/render-test.ts new file mode 100644 index 0000000..a3b708b --- /dev/null +++ b/demo/bin/render-test.ts @@ -0,0 +1,265 @@ +#!/usr/bin/env bun +/** + * Headless visual regression test runner for the renderer. + * + * Usage: + * bun demo/bin/render-test.ts # Run tests against baselines + * bun demo/bin/render-test.ts --update # Update baselines from current renders + * + * Baselines are stored in demo/baselines/*.png + */ + +import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs'; +import { dirname, join } from 'path'; +import { fileURLToPath } from 'url'; + +// Get script directory +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); +const DEMO_DIR = dirname(__dirname); +const BASELINES_DIR = join(DEMO_DIR, 'baselines'); +const PROJECT_ROOT = dirname(DEMO_DIR); + +const CONTENT_TYPES: Record = { + html: 'text/html', + js: 'application/javascript', + css: 'text/css', + json: 'application/json', + wasm: 'application/wasm', + png: 'image/png', + ttf: 'font/ttf', +}; + +// Parse args +const args = process.argv.slice(2); +const updateMode = args.includes('--update') || args.includes('-u'); +const helpMode = args.includes('--help') || args.includes('-h'); + +if (helpMode) { + console.log(` +Visual Render Test Runner + +Usage: + bun demo/bin/render-test.ts [options] + +Options: + --update, -u Update baselines from current renders + --help, -h Show this help message + +Baselines are stored in demo/baselines/*.png +`); + process.exit(0); +} + +// Ensure baselines directory exists +if (!existsSync(BASELINES_DIR)) { + mkdirSync(BASELINES_DIR, { recursive: true }); +} + +interface TestResult { + id: string; + name: string; + status: 'pass' | 'fail' | 'new' | 'error'; + diffPercent?: number; + error?: string; +} + +async function main() { + console.log('๐Ÿงช Visual Render Test Runner\n'); + + const puppeteer = await import('puppeteer'); + + // Start local server + console.log('๐ŸŒ Starting local server...'); + const server = Bun.serve({ + port: 0, // Let OS pick a free port + async fetch(req) { + const url = new URL(req.url); + let filePath = join(PROJECT_ROOT, url.pathname); + + // Default to index.html for directories + if (filePath.endsWith('/')) { + filePath += 'index.html'; + } + + try { + const file = Bun.file(filePath); + if (await file.exists()) { + const ext = filePath.split('.').pop() || ''; + return new Response(file, { + headers: { 'Content-Type': CONTENT_TYPES[ext] || 'application/octet-stream' }, + }); + } + } catch { + // Fall through to 404 + } + return new Response('Not found', { status: 404 }); + }, + }); + + const serverUrl = `http://localhost:${server.port}`; + console.log(` Server running at ${serverUrl}`); + + // Launch browser + console.log('๐Ÿš€ Launching headless browser...'); + const browser = await puppeteer.default.launch({ + headless: true, + args: ['--no-sandbox', '--disable-setuid-sandbox'], + }); + + const page = await browser.newPage(); + + // Set viewport for consistent rendering + await page.setViewport({ width: 1200, height: 800, deviceScaleFactor: 1 }); + + try { + // Navigate to test page + console.log('๐Ÿ“„ Loading test page...\n'); + await page.goto(`${serverUrl}/demo/render-test.html`, { + waitUntil: 'networkidle0', + timeout: 30000, + }); + + // Wait for the page's runAllTests() to complete. + // render-test.html sets window.__testsComplete = true when done. + await page.waitForFunction('window.__testsComplete === true', { timeout: 60000 }); + + // Get test cases from the page + const testCases = await page.evaluate(() => { + // Access the module's test cases through the window exports + // We need to extract test info from the DOM since testCases is module-scoped + const cards = document.querySelectorAll('.test-case'); + return Array.from(cards).map((card) => { + const id = card.id.replace('test-', ''); + const name = card.querySelector('h3')?.textContent || id; + return { id, name }; + }); + }); + + if (testCases.length === 0) { + throw new Error('No test cases found. Make sure the page loaded correctly.'); + } + + console.log(`Found ${testCases.length} tests\n`); + + // Run tests and collect results + const results: TestResult[] = []; + let passed = 0; + let failed = 0; + let newTests = 0; + + for (const test of testCases) { + const baselinePath = join(BASELINES_DIR, `${test.id}.png`); + const hasBaseline = existsSync(baselinePath); + + // Get the canvas data URL from the page + const canvasDataUrl = await page.evaluate((testId: string) => { + const canvas = document.getElementById(`canvas-${testId}`) as HTMLCanvasElement; + return canvas?.toDataURL('image/png') || null; + }, test.id); + + if (!canvasDataUrl) { + results.push({ id: test.id, name: test.name, status: 'error', error: 'Canvas not found' }); + console.log(` โŒ ${test.name}: Canvas not found`); + failed++; + continue; + } + + const currentBuffer = Buffer.from(canvasDataUrl.split(',')[1], 'base64'); + + if (updateMode) { + // Update mode: save current as baseline + writeFileSync(baselinePath, currentBuffer); + console.log(` ๐Ÿ“ธ ${test.name}: Baseline ${hasBaseline ? 'updated' : 'created'}`); + results.push({ id: test.id, name: test.name, status: 'new' }); + newTests++; + } else if (!hasBaseline) { + // No baseline exists + console.log(` ๐Ÿ†• ${test.name}: No baseline (run with --update to create)`); + results.push({ id: test.id, name: test.name, status: 'new' }); + newTests++; + } else { + // Compare with baseline + const baselineBuffer = readFileSync(baselinePath); + + // Simple byte comparison first + if (currentBuffer.equals(baselineBuffer)) { + console.log(` โœ… ${test.name}: Pass (identical)`); + results.push({ id: test.id, name: test.name, status: 'pass', diffPercent: 0 }); + passed++; + } else { + // Buffers differ - calculate difference percentage + const diffPercent = calculateDiffPercent(currentBuffer, baselineBuffer); + + if (diffPercent <= 0.1) { + // Within threshold + console.log(` โœ… ${test.name}: Pass (${diffPercent.toFixed(3)}% diff)`); + results.push({ id: test.id, name: test.name, status: 'pass', diffPercent }); + passed++; + } else { + console.log(` โŒ ${test.name}: Fail (${diffPercent.toFixed(3)}% diff)`); + results.push({ id: test.id, name: test.name, status: 'fail', diffPercent }); + failed++; + + // Save the current render for debugging + const failPath = join(BASELINES_DIR, `${test.id}.fail.png`); + writeFileSync(failPath, currentBuffer); + } + } + } + } + + // Summary + console.log('\n' + 'โ”€'.repeat(50)); + console.log(`\n๐Ÿ“Š Results: ${passed} passed, ${failed} failed, ${newTests} new\n`); + + if (updateMode) { + console.log(`โœจ Baselines ${newTests > 0 ? 'updated' : 'unchanged'} in demo/baselines/\n`); + } + + // Exit with appropriate code + await browser.close(); + server.stop(); + + if (failed > 0) { + process.exit(1); + } else if (newTests > 0 && !updateMode) { + console.log('โš ๏ธ New tests detected. Run with --update to create baselines.\n'); + process.exit(1); + } + } catch (error) { + console.error('Error:', error); + await browser.close(); + server.stop(); + process.exit(1); + } +} + +/** + * Heuristic difference percentage between two PNG buffers (byte-level, not pixel-level). + * NOTE: compares compressed bytes โ€” identical-looking renders with different metadata + * may produce non-zero results. Replace with pixelmatch for pixel-accurate comparison. + */ +function calculateDiffPercent(buf1: Buffer, buf2: Buffer): number { + const maxSize = Math.max(buf1.length, buf2.length); + const sizeDiff = Math.abs(buf1.length - buf2.length); + + if (sizeDiff > 0) { + return (sizeDiff / maxSize) * 100; + } + + const threshold = maxSize * 0.001; // 0.1% + let diffBytes = 0; + for (let i = 0; i < buf1.length; i++) { + if (buf1[i] !== buf2[i] && ++diffBytes > threshold) { + return (diffBytes / maxSize) * 100; + } + } + + return (diffBytes / maxSize) * 100; +} + +main().catch((e) => { + console.error(e); + process.exit(1); +}); diff --git a/demo/render-test.html b/demo/render-test.html new file mode 100644 index 0000000..ccd2540 --- /dev/null +++ b/demo/render-test.html @@ -0,0 +1,1004 @@ + + + + + + Visual Render Tests - Ghostty WASM + + + +

Visual Render Tests

+

Renderer regression tests comparing against baseline images

+ +
+ Usage: Run bun test:render:web then open + http://localhost:3000/demo/render-test
+ To update baselines: bun test:render:update +
+ +
+ +
+
+ 0 +
Passed
+
+
+ 0 +
Failed
+
+
+ 0 +
New
+
+
+
+ +
+ + + + diff --git a/lib/renderer.ts b/lib/renderer.ts index 3018e01..eee8d48 100644 --- a/lib/renderer.ts +++ b/lib/renderer.ts @@ -18,7 +18,7 @@ import { CellFlags } from './types'; // Interface for objects that can be rendered export interface IRenderable { getLine(y: number): GhosttyCell[] | null; - getCursor(): { x: number; y: number; visible: boolean }; + getCursor(): { x: number; y: number; visible: boolean; style?: 'block' | 'underline' | 'bar' }; getDimensions(): { cols: number; rows: number }; isRowDirty(y: number): boolean; /** Returns true if a full redraw is needed (e.g., screen change) */ @@ -56,6 +56,8 @@ export interface FontMetrics { baseline: number; // Distance from top to text baseline } +const LINK_HOVER_COLOR = '#4A90E2'; + // ============================================================================ // Default Theme // ============================================================================ @@ -98,11 +100,10 @@ export class CanvasRenderer { private fontFamily: string; private cursorStyle: 'block' | 'underline' | 'bar'; private cursorBlink: boolean; - // Exposed as a getter for test access (see _theme getter below) - private _theme: Required; + private theme: Required; private devicePixelRatio: number; private metrics: FontMetrics; - private palette: string[]; + private fontStrings: { plain: string; bold: string; italic: string; boldItalic: string }; // Cursor blinking state private cursorVisible: boolean = true; @@ -139,11 +140,6 @@ export class CanvasRenderer { endY: number; } | null = null; - /** Read-only access to the resolved theme โ€” for use in tests only. */ - get theme(): Readonly> { - return this._theme; - } - constructor(canvas: HTMLCanvasElement, options: RendererOptions = {}) { this.canvas = canvas; const ctx = canvas.getContext('2d', { alpha: true }); @@ -157,30 +153,11 @@ export class CanvasRenderer { this.fontFamily = options.fontFamily ?? 'monospace'; this.cursorStyle = options.cursorStyle ?? 'block'; this.cursorBlink = options.cursorBlink ?? false; - this._theme = { ...DEFAULT_THEME, ...options.theme }; + this.theme = { ...DEFAULT_THEME, ...options.theme }; this.devicePixelRatio = options.devicePixelRatio ?? window.devicePixelRatio ?? 1; - // Build color palette (16 ANSI colors) - this.palette = [ - this._theme.black, - this._theme.red, - this._theme.green, - this._theme.yellow, - this._theme.blue, - this._theme.magenta, - this._theme.cyan, - this._theme.white, - this._theme.brightBlack, - this._theme.brightRed, - this._theme.brightGreen, - this._theme.brightYellow, - this._theme.brightBlue, - this._theme.brightMagenta, - this._theme.brightCyan, - this._theme.brightWhite, - ]; - - // Measure font metrics + // Measure font metrics (also builds cached font strings) + this.fontStrings = this.buildFontStrings(); this.metrics = this.measureFont(); // Setup cursor blinking if enabled @@ -193,26 +170,61 @@ export class CanvasRenderer { // Font Metrics Measurement // ========================================================================== + private buildFontStrings(): { plain: string; bold: string; italic: string; boldItalic: string } { + // Quote font family names that contain spaces but aren't already quoted + const quotedFamily = this.fontFamily + .split(',') + .map((f) => { + const trimmed = f.trim(); + if (trimmed.startsWith('"') || trimmed.startsWith("'") || !trimmed.includes(' ')) { + return trimmed; + } + return `"${trimmed}"`; + }) + .join(', '); + const base = `${this.fontSize}px ${quotedFamily}`; + return { + plain: base, + bold: `bold ${base}`, + italic: `italic ${base}`, + boldItalic: `bold italic ${base}`, + }; + } + + private getFontString(bold: boolean, italic: boolean): string { + if (bold && italic) return this.fontStrings.boldItalic; + if (bold) return this.fontStrings.bold; + if (italic) return this.fontStrings.italic; + return this.fontStrings.plain; + } + private measureFont(): FontMetrics { // Use an offscreen canvas for measurement const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d')!; // Set font (use actual pixel size for accurate measurement) - ctx.font = `${this.fontSize}px ${this.fontFamily}`; + ctx.font = this.fontStrings.plain; // Measure width using 'M' (typically widest character) const widthMetrics = ctx.measureText('M'); const width = Math.ceil(widthMetrics.width); - // Measure height using ascent + descent with padding for glyph overflow - const ascent = widthMetrics.actualBoundingBoxAscent || this.fontSize * 0.8; - const descent = widthMetrics.actualBoundingBoxDescent || this.fontSize * 0.2; - - // Add 2px padding to height to account for glyphs that overflow (like 'f', 'd', 'g', 'p') - // and anti-aliasing pixels - const height = Math.ceil(ascent + descent) + 2; - const baseline = Math.ceil(ascent) + 1; // Offset baseline by half the padding + // Use font-level metrics (fontBoundingBox) rather than glyph-specific metrics (actualBoundingBox). + // This ensures the cell height accommodates ALL glyphs in the font, including powerline + // characters (U+E0B0, U+E0B6, etc.) which are designed to fill the full cell height. + // Fall back to actual metrics if font metrics aren't available. + const ascent = + widthMetrics.fontBoundingBoxAscent ?? + widthMetrics.actualBoundingBoxAscent ?? + this.fontSize * 0.8; + const descent = + widthMetrics.fontBoundingBoxDescent ?? + widthMetrics.actualBoundingBoxDescent ?? + this.fontSize * 0.2; + + const height = Math.ceil(ascent + descent); + const baseline = Math.ceil(ascent); return { width, height, baseline }; } @@ -259,7 +271,7 @@ export class CanvasRenderer { this.ctx.textAlign = 'left'; // Fill background after resize - this.ctx.fillStyle = this._theme.background; + this.ctx.fillStyle = this.theme.background; this.ctx.fillRect(0, 0, cssWidth, cssHeight); } @@ -361,8 +373,10 @@ export class CanvasRenderer { // Track rows with hyperlinks that need redraw when hover changes const hyperlinkRows = new Set(); const hyperlinkChanged = this.hoveredHyperlinkId !== this.previousHoveredHyperlinkId; - const linkRangeChanged = - JSON.stringify(this.hoveredLinkRange) !== JSON.stringify(this.previousHoveredLinkRange); + const a = this.hoveredLinkRange, b = this.previousHoveredLinkRange; + const linkRangeChanged = a !== b && ( + !a || !b || a.startX !== b.startX || a.startY !== b.startY || a.endX !== b.endX || a.endY !== b.endY + ); if (hyperlinkChanged) { // Find rows containing the old or new hovered hyperlink @@ -491,7 +505,9 @@ export class CanvasRenderer { // Render cursor (only if we're at the bottom, not scrolled) if (viewportY === 0 && cursor.visible && this.cursorVisible) { - this.renderCursor(cursor.x, cursor.y); + // Use cursor style from buffer if provided, otherwise use renderer default + const cursorStyle = cursor.style ?? this.cursorStyle; + this.renderCursor(cursor.x, cursor.y, cursorStyle); } // Render scrollbar if scrolled or scrollback exists (with opacity for fade effect) @@ -529,7 +545,7 @@ export class CanvasRenderer { // clearRect is needed because fillRect composites rather than replaces, // so transparent/translucent backgrounds wouldn't clear previous content. this.ctx.clearRect(0, lineY, lineWidth, this.metrics.height); - this.ctx.fillStyle = this._theme.background; + this.ctx.fillStyle = this.theme.background; this.ctx.fillRect(0, lineY, lineWidth, this.metrics.height); // PASS 1: Draw all cell backgrounds first @@ -565,7 +581,7 @@ export class CanvasRenderer { if (isSelected) { // Draw selection background (solid color, not overlay) - this.ctx.fillStyle = this._theme.selectionBackground; + this.ctx.fillStyle = this.theme.selectionBackground; this.ctx.fillRect(cellX, cellY, cellWidth, this.metrics.height); return; // Selection background replaces cell background } @@ -591,6 +607,15 @@ export class CanvasRenderer { } } + private drawHorizontalLine(x: number, y: number, width: number, color: string): void { + this.ctx.strokeStyle = color; + this.ctx.lineWidth = 1; + this.ctx.beginPath(); + this.ctx.moveTo(x, y); + this.ctx.lineTo(x + width, y); + this.ctx.stroke(); + } + /** * Render a cell's text and decorations (Pass 2 of two-pass rendering) * Selection foreground color is applied here to match the selection background. @@ -608,32 +633,25 @@ export class CanvasRenderer { // Check if this cell is selected const isSelected = this.isInSelection(x, y); - // Set text style - let fontStyle = ''; - if (cell.flags & CellFlags.ITALIC) fontStyle += 'italic '; - if (cell.flags & CellFlags.BOLD) fontStyle += 'bold '; - this.ctx.font = `${fontStyle}${this.fontSize}px ${this.fontFamily}`; + this.ctx.font = this.getFontString( + !!(cell.flags & CellFlags.BOLD), + !!(cell.flags & CellFlags.ITALIC) + ); - // Set text color - use override, selection foreground, or normal color + // Set text color - use override if provided, otherwise selection or cell color + let fillColor: string; if (colorOverride) { - this.ctx.fillStyle = colorOverride; + fillColor = colorOverride; } else if (isSelected) { - this.ctx.fillStyle = this._theme.selectionForeground; + fillColor = this.theme.selectionForeground; } else { - // Extract colors and handle inverse - let fg_r = cell.fg_r, - fg_g = cell.fg_g, - fg_b = cell.fg_b; - + let fg_r = cell.fg_r, fg_g = cell.fg_g, fg_b = cell.fg_b; if (cell.flags & CellFlags.INVERSE) { - // When inverted, foreground becomes background - fg_r = cell.bg_r; - fg_g = cell.bg_g; - fg_b = cell.bg_b; + fg_r = cell.bg_r; fg_g = cell.bg_g; fg_b = cell.bg_b; } - - this.ctx.fillStyle = this.rgbToCSS(fg_r, fg_g, fg_b); + fillColor = this.rgbToCSS(fg_r, fg_g, fg_b); } + this.ctx.fillStyle = fillColor; // Apply faint effect if (cell.flags & CellFlags.FAINT) { @@ -644,91 +662,204 @@ export class CanvasRenderer { const textX = cellX; const textY = cellY + this.metrics.baseline; - // Get the character to render - use grapheme lookup for complex scripts - let char: string; - if (cell.grapheme_len > 0 && this.currentBuffer?.getGraphemeString) { - // Cell has additional codepoints - get full grapheme cluster - char = this.currentBuffer.getGraphemeString(y, x); + const codepoint = cell.codepoint || 32; + + // Handle special characters that need pixel-perfect rendering: + // - Block drawing characters (U+2580-U+259F): rectangles for gap-free ASCII art + // - Powerline glyphs (U+E0B0-U+E0BF): vector shapes to match exact cell height + if (codepoint >= 0x2580 && codepoint <= 0x259f && this.renderBlockChar(codepoint, cellX, cellY, cellWidth)) { + // rendered as rectangle + } else if (codepoint >= 0xe0b0 && codepoint <= 0xe0b7 && this.renderPowerlineGlyph(codepoint, cellX, cellY, cellWidth)) { + // rendered as vector path } else { - // Simple cell - single codepoint - char = String.fromCodePoint(cell.codepoint || 32); // Default to space if null + // Use grapheme lookup for complex scripts, single codepoint otherwise + const char = + cell.grapheme_len > 0 && this.currentBuffer?.getGraphemeString + ? this.currentBuffer.getGraphemeString(y, x) + : String.fromCodePoint(codepoint); + this.ctx.fillText(char, textX, textY); } - this.ctx.fillText(char, textX, textY); // Reset alpha if (cell.flags & CellFlags.FAINT) { this.ctx.globalAlpha = 1.0; } - // Draw underline + const underlineY = cellY + this.metrics.baseline + 2; + if (cell.flags & CellFlags.UNDERLINE) { - const underlineY = cellY + this.metrics.baseline + 2; - this.ctx.strokeStyle = this.ctx.fillStyle; - this.ctx.lineWidth = 1; - this.ctx.beginPath(); - this.ctx.moveTo(cellX, underlineY); - this.ctx.lineTo(cellX + cellWidth, underlineY); - this.ctx.stroke(); + this.drawHorizontalLine(cellX, underlineY, cellWidth, fillColor); } - - // Draw strikethrough if (cell.flags & CellFlags.STRIKETHROUGH) { - const strikeY = cellY + this.metrics.height / 2; - this.ctx.strokeStyle = this.ctx.fillStyle; - this.ctx.lineWidth = 1; - this.ctx.beginPath(); - this.ctx.moveTo(cellX, strikeY); - this.ctx.lineTo(cellX + cellWidth, strikeY); - this.ctx.stroke(); - } - - // Draw hyperlink underline (for OSC8 hyperlinks) - if (cell.hyperlink_id > 0) { - const isHovered = cell.hyperlink_id === this.hoveredHyperlinkId; - - // Only show underline when hovered (cleaner look) - if (isHovered) { - const underlineY = cellY + this.metrics.baseline + 2; - this.ctx.strokeStyle = '#4A90E2'; // Blue underline on hover - this.ctx.lineWidth = 1; - this.ctx.beginPath(); - this.ctx.moveTo(cellX, underlineY); - this.ctx.lineTo(cellX + cellWidth, underlineY); - this.ctx.stroke(); - } + this.drawHorizontalLine(cellX, cellY + this.metrics.height / 2, cellWidth, fillColor); + } + if (cell.hyperlink_id > 0 && cell.hyperlink_id === this.hoveredHyperlinkId) { + this.drawHorizontalLine(cellX, underlineY, cellWidth, LINK_HOVER_COLOR); } - - // Draw regex link underline (for plain text URLs) if (this.hoveredLinkRange) { const range = this.hoveredLinkRange; - // Check if this cell is within the hovered link range const isInRange = (y === range.startY && x >= range.startX && (y < range.endY || x <= range.endX)) || (y > range.startY && y < range.endY) || (y === range.endY && x <= range.endX && (y > range.startY || x >= range.startX)); - if (isInRange) { - const underlineY = cellY + this.metrics.baseline + 2; - this.ctx.strokeStyle = '#4A90E2'; // Blue underline on hover - this.ctx.lineWidth = 1; - this.ctx.beginPath(); - this.ctx.moveTo(cellX, underlineY); - this.ctx.lineTo(cellX + cellWidth, underlineY); - this.ctx.stroke(); + this.drawHorizontalLine(cellX, underlineY, cellWidth, LINK_HOVER_COLOR); } } } + /** + * Render block drawing characters as filled rectangles for pixel-perfect rendering. + * Returns true if the character was handled, false if it should be rendered as text. + */ + private renderBlockChar( + codepoint: number, + cellX: number, + cellY: number, + cellWidth: number + ): boolean { + const height = this.metrics.height; + + // Block Elements (U+2580-U+259F) + switch (codepoint) { + case 0x2580: // โ–€ UPPER HALF BLOCK + this.ctx.fillRect(cellX, cellY, cellWidth, height / 2); + return true; + case 0x2581: // โ– LOWER ONE EIGHTH BLOCK + this.ctx.fillRect(cellX, cellY + (height * 7) / 8, cellWidth, height / 8); + return true; + case 0x2582: // โ–‚ LOWER ONE QUARTER BLOCK + this.ctx.fillRect(cellX, cellY + (height * 3) / 4, cellWidth, height / 4); + return true; + case 0x2583: // โ–ƒ LOWER THREE EIGHTHS BLOCK + this.ctx.fillRect(cellX, cellY + (height * 5) / 8, cellWidth, (height * 3) / 8); + return true; + case 0x2584: // โ–„ LOWER HALF BLOCK + this.ctx.fillRect(cellX, cellY + height / 2, cellWidth, height / 2); + return true; + case 0x2585: // โ–… LOWER FIVE EIGHTHS BLOCK + this.ctx.fillRect(cellX, cellY + (height * 3) / 8, cellWidth, (height * 5) / 8); + return true; + case 0x2586: // โ–† LOWER THREE QUARTERS BLOCK + this.ctx.fillRect(cellX, cellY + height / 4, cellWidth, (height * 3) / 4); + return true; + case 0x2587: // โ–‡ LOWER SEVEN EIGHTHS BLOCK + this.ctx.fillRect(cellX, cellY + height / 8, cellWidth, (height * 7) / 8); + return true; + case 0x2588: // โ–ˆ FULL BLOCK + this.ctx.fillRect(cellX, cellY, cellWidth, height); + return true; + case 0x2589: // โ–‰ LEFT SEVEN EIGHTHS BLOCK + this.ctx.fillRect(cellX, cellY, (cellWidth * 7) / 8, height); + return true; + case 0x258a: // โ–Š LEFT THREE QUARTERS BLOCK + this.ctx.fillRect(cellX, cellY, (cellWidth * 3) / 4, height); + return true; + case 0x258b: // โ–‹ LEFT FIVE EIGHTHS BLOCK + this.ctx.fillRect(cellX, cellY, (cellWidth * 5) / 8, height); + return true; + case 0x258c: // โ–Œ LEFT HALF BLOCK + this.ctx.fillRect(cellX, cellY, cellWidth / 2, height); + return true; + case 0x258d: // โ– LEFT THREE EIGHTHS BLOCK + this.ctx.fillRect(cellX, cellY, (cellWidth * 3) / 8, height); + return true; + case 0x258e: // โ–Ž LEFT ONE QUARTER BLOCK + this.ctx.fillRect(cellX, cellY, cellWidth / 4, height); + return true; + case 0x258f: // โ– LEFT ONE EIGHTH BLOCK + this.ctx.fillRect(cellX, cellY, cellWidth / 8, height); + return true; + case 0x2590: // โ– RIGHT HALF BLOCK + this.ctx.fillRect(cellX + cellWidth / 2, cellY, cellWidth / 2, height); + return true; + case 0x2594: // โ–” UPPER ONE EIGHTH BLOCK + this.ctx.fillRect(cellX, cellY, cellWidth, height / 8); + return true; + case 0x2595: // โ–• RIGHT ONE EIGHTH BLOCK + this.ctx.fillRect(cellX + (cellWidth * 7) / 8, cellY, cellWidth / 8, height); + return true; + default: + return false; + } + } + + // Stroke the current path using the current fillStyle (for soft/outline powerline dividers) + private strokeWithFillColor(): void { + this.ctx.strokeStyle = this.ctx.fillStyle; + this.ctx.lineWidth = 1; + this.ctx.stroke(); + } + + /** + * Render Powerline glyphs as vector shapes for pixel-perfect cell height. + * Powerline glyphs (U+E0B0-U+E0BF) are designed to span the full cell height, + * but font rendering often makes them slightly taller/shorter than the cell. + * Drawing them as paths ensures they exactly fill the cell bounds. + * Returns true if the character was handled, false if it should be rendered as text. + */ + private renderPowerlineGlyph( + codepoint: number, + cellX: number, + cellY: number, + cellWidth: number + ): boolean { + const height = this.metrics.height; + const ctx = this.ctx; + + switch (codepoint) { + case 0xe0b0: // Right-pointing triangle (hard divider) + case 0xe0b1: // Right-pointing angle (soft divider) + ctx.beginPath(); + ctx.moveTo(cellX, cellY); + ctx.lineTo(cellX + cellWidth, cellY + height / 2); + ctx.lineTo(cellX, cellY + height); + if (codepoint === 0xe0b0) { ctx.closePath(); ctx.fill(); } else this.strokeWithFillColor(); + return true; + + case 0xe0b2: // Left-pointing triangle (hard divider) + case 0xe0b3: // Left-pointing angle (soft divider) + ctx.beginPath(); + ctx.moveTo(cellX + cellWidth, cellY); + ctx.lineTo(cellX, cellY + height / 2); + ctx.lineTo(cellX + cellWidth, cellY + height); + if (codepoint === 0xe0b2) { ctx.closePath(); ctx.fill(); } else this.strokeWithFillColor(); + return true; + + case 0xe0b4: // Right semicircle (filled) + case 0xe0b5: // Right semicircle (outline) + ctx.beginPath(); + ctx.moveTo(cellX, cellY); + // Ellipse curving right: center at left edge, radii = cellWidth (x) and height/2 (y) + ctx.ellipse(cellX, cellY + height / 2, cellWidth, height / 2, 0, -Math.PI / 2, Math.PI / 2, false); + if (codepoint === 0xe0b4) { ctx.closePath(); ctx.fill(); } else this.strokeWithFillColor(); + return true; + + case 0xe0b6: // Left semicircle (filled) + case 0xe0b7: // Left semicircle (outline) + ctx.beginPath(); + ctx.moveTo(cellX + cellWidth, cellY); + // Ellipse curving left: center at right edge, radii = cellWidth (x) and height/2 (y) + ctx.ellipse(cellX + cellWidth, cellY + height / 2, cellWidth, height / 2, 0, -Math.PI / 2, Math.PI / 2, true); + if (codepoint === 0xe0b6) { ctx.closePath(); ctx.fill(); } else this.strokeWithFillColor(); + return true; + + default: + return false; + } + } + /** * Render cursor */ - private renderCursor(x: number, y: number): void { + private renderCursor(x: number, y: number, style?: 'block' | 'underline' | 'bar'): void { const cursorX = x * this.metrics.width; const cursorY = y * this.metrics.height; + const cursorStyle = style ?? this.cursorStyle; - this.ctx.fillStyle = this._theme.cursor; + this.ctx.fillStyle = this.theme.cursor; - switch (this.cursorStyle) { + switch (cursorStyle) { case 'block': // Full cell block this.ctx.fillRect(cursorX, cursorY, this.metrics.width, this.metrics.height); @@ -740,7 +871,7 @@ export class CanvasRenderer { this.ctx.beginPath(); this.ctx.rect(cursorX, cursorY, this.metrics.width, this.metrics.height); this.ctx.clip(); - this.renderCellText(line[x], x, y, this._theme.cursorAccent); + this.renderCellText(line[x], x, y, this.theme.cursorAccent); this.ctx.restore(); } } @@ -792,28 +923,8 @@ export class CanvasRenderer { /** * Update theme colors */ - public setTheme(theme: Required): void { - this._theme = theme; - - // Rebuild palette - this.palette = [ - this._theme.black, - this._theme.red, - this._theme.green, - this._theme.yellow, - this._theme.blue, - this._theme.magenta, - this._theme.cyan, - this._theme.white, - this._theme.brightBlack, - this._theme.brightRed, - this._theme.brightGreen, - this._theme.brightYellow, - this._theme.brightBlue, - this._theme.brightMagenta, - this._theme.brightCyan, - this._theme.brightWhite, - ]; + public setTheme(theme: ITheme): void { + this.theme = { ...DEFAULT_THEME, ...theme }; } /** @@ -821,6 +932,7 @@ export class CanvasRenderer { */ public setFontSize(size: number): void { this.fontSize = size; + this.fontStrings = this.buildFontStrings(); this.metrics = this.measureFont(); } @@ -829,6 +941,7 @@ export class CanvasRenderer { */ public setFontFamily(family: string): void { this.fontFamily = family; + this.fontStrings = this.buildFontStrings(); this.metrics = this.measureFont(); } @@ -852,10 +965,6 @@ export class CanvasRenderer { } } - /** - * Get current font metrics - */ - /** * Render scrollbar (Phase 2) * Shows scroll position and allows click/drag interaction @@ -879,7 +988,7 @@ export class CanvasRenderer { // Always clear the scrollbar area first (fixes ghosting when fading out) ctx.clearRect(scrollbarX - 2, 0, scrollbarWidth + 6, canvasHeight); - ctx.fillStyle = this._theme.background; + ctx.fillStyle = this.theme.background; ctx.fillRect(scrollbarX - 2, 0, scrollbarWidth + 6, canvasHeight); // Don't draw scrollbar if fully transparent or no scrollback @@ -994,7 +1103,7 @@ export class CanvasRenderer { // clearRect first because fillRect composites rather than replaces, // so transparent/translucent backgrounds wouldn't clear previous content. this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); - this.ctx.fillStyle = this._theme.background; + this.ctx.fillStyle = this.theme.background; this.ctx.fillRect(0, 0, this.canvas.width, this.canvas.height); } diff --git a/package.json b/package.json index 12ece36..756c1fb 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,9 @@ "dev": "vite --port 8000", "demo": "node demo/bin/demo.js", "demo:dev": "node demo/bin/demo.js --dev", + "test:render": "bun demo/bin/render-test.ts", + "test:render:update": "bun demo/bin/render-test.ts --update", + "test:render:web": "bunx serve . -p 3000", "prebuild": "bun install", "build": "bun run clean && bun run build:wasm && bun run build:lib && bun run build:wasm-copy", "build:wasm": "./scripts/build-wasm.sh", @@ -70,6 +73,7 @@ "@xterm/xterm": "^5.5.0", "mitata": "^1.0.34", "prettier": "^3.6.2", + "puppeteer": "^24.37.5", "typescript": "^5.9.3", "vite": "^4.5.0", "vite-plugin-dts": "^4.5.4"