From b2318b9e7c4f369cebaa45f59231eae4a962410b Mon Sep 17 00:00:00 2001 From: duckietm Date: Mon, 18 May 2026 16:13:09 +0200 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=86=95=20Added=20support=20for=20JSON?= =?UTF-8?q?5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/bootstrap.ts | 12 +- yarn.lock | 631 +++++++++++++++++++++++------------------------ 3 files changed, 325 insertions(+), 319 deletions(-) diff --git a/package.json b/package.json index 13915c1..f31d0c6 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "emoji-mart": "^5.6.0", "emoji-toolkit": "10.0.0", "framer-motion": "^12.38.0", + "json5": "^2.2.3", "react": "^19.2.5", "react-dom": "^19.2.5", "react-icons": "^5.5.0", diff --git a/src/bootstrap.ts b/src/bootstrap.ts index ecff7b4..71406fe 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -1,3 +1,4 @@ +import JSON5 from 'json5'; import { configFileUrl, getClientMode, installSecureFetch } from './secure-assets'; const ensureMobileViewport = () => @@ -74,7 +75,16 @@ const loadClientMode = async () => if(!response.ok) throw new Error(`HTTP ${ response.status }`); - (window as any).__nitroClientMode = await response.json(); + const text = await response.text(); + + try + { + (window as any).__nitroClientMode = JSON.parse(text); + } + catch + { + (window as any).__nitroClientMode = JSON5.parse(text); + } setBootDebug('boot: client-mode loaded'); } catch(error) diff --git a/yarn.lock b/yarn.lock index 81e8375..05928f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -151,7 +151,7 @@ "@babel/helper-string-parser" "^7.27.1" "@babel/helper-validator-identifier" "^7.28.5" -"@emnapi/core@1.10.0", "@emnapi/core@^1.8.1": +"@emnapi/core@1.10.0", "@emnapi/core@^1.10.0": version "1.10.0" resolved "https://registry.yarnpkg.com/@emnapi/core/-/core-1.10.0.tgz#380ccc8f2412ea22d1d972df7f8ee23a3b9c7467" integrity sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw== @@ -159,14 +159,14 @@ "@emnapi/wasi-threads" "1.2.1" tslib "^2.4.0" -"@emnapi/runtime@1.10.0", "@emnapi/runtime@^1.8.1": +"@emnapi/runtime@1.10.0", "@emnapi/runtime@^1.10.0": version "1.10.0" resolved "https://registry.yarnpkg.com/@emnapi/runtime/-/runtime-1.10.0.tgz#4b260c0d3534204e98c6110b8db1a987d26ec87c" integrity sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA== dependencies: tslib "^2.4.0" -"@emnapi/wasi-threads@1.2.1", "@emnapi/wasi-threads@^1.1.0": +"@emnapi/wasi-threads@1.2.1", "@emnapi/wasi-threads@^1.2.1": version "1.2.1" resolved "https://registry.yarnpkg.com/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz#28fed21a1ba1ce797c44a070abc94d42f3ae8548" integrity sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w== @@ -204,10 +204,10 @@ debug "^4.3.1" minimatch "^10.2.4" -"@eslint/config-helpers@^0.5.5": - version "0.5.5" - resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.5.5.tgz#ae16134e4792ac5fbdc533548a24ac1ea9f7f3ae" - integrity sha512-eIJYKTCECbP/nsKaaruF6LW967mtbQbsw4JTtSVkUQc9MneSkbrgPJAbKl9nWr0ZeowV8BfsarBmPpBzGelA2w== +"@eslint/config-helpers@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@eslint/config-helpers/-/config-helpers-0.6.0.tgz#ef9a36881d39dfd5dbeac22b0da997fabfb08b03" + integrity sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA== dependencies: "@eslint/core" "^1.2.1" @@ -323,17 +323,17 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@napi-rs/wasm-runtime@^1.1.1", "@napi-rs/wasm-runtime@^1.1.4": +"@napi-rs/wasm-runtime@^1.1.4": version "1.1.4" resolved "https://registry.yarnpkg.com/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz#a46bbfedc29751b7170c5d23bc1d8ee8c7e3c1e1" integrity sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow== dependencies: "@tybys/wasm-util" "^0.10.1" -"@oxc-project/types@=0.127.0": - version "0.127.0" - resolved "https://registry.yarnpkg.com/@oxc-project/types/-/types-0.127.0.tgz#8374fcdfb4a641861218daa5700c447c00b66663" - integrity sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ== +"@oxc-project/types@=0.130.0": + version "0.130.0" + resolved "https://registry.yarnpkg.com/@oxc-project/types/-/types-0.130.0.tgz#a7825148711dc28805c46cfc21d94b63a4d41e88" + integrity sha512-ibD2usx9JRu7f5pu2tMKMI4cpA4NgXJQoYRP4pQ7Pxmn1l6k/53qWtQWZayhYy3X4QZkt90Ot+mJEaeXouio6Q== "@parcel/watcher-android-arm64@2.5.6": version "2.5.6" @@ -638,94 +638,89 @@ resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.1.1.tgz#78244efe12930c56fd255d7923865857c41ac8cb" integrity sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw== -"@rolldown/binding-android-arm64@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.0-rc.17.tgz#0a502a88c39d0ffa81aa30b561dade6f6217dcc5" - integrity sha512-s70pVGhw4zqGeFnXWvAzJDlvxhlRollagdCCKRgOsgUOH3N1l0LIxf83AtGzmb5SiVM4Hjl5HyarMRfdfj3DaQ== +"@rolldown/binding-android-arm64@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.1.tgz#7b250c89f16d74affd581dbe38f702e8c2c644d3" + integrity sha512-fJI3I0r3C3Oj/zdBCpaCmBRZYf07xpaq4yCfDDoSFm+beWNzbIl26puW8RraUdugoJw/95zerNOn6jasAhzSmg== -"@rolldown/binding-darwin-arm64@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.17.tgz#8b7f05ac9000ab19161a79a0346b1b64a1bc7ba3" - integrity sha512-4ksWc9n0mhlZpZ9PMZgTGjeOPRu8MB1Z3Tz0Mo02eWfWCHMW1zN82Qz/pL/rC+yQa+8ZnutMF0JjJe7PjwasYw== +"@rolldown/binding-darwin-arm64@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.1.tgz#cd4de96687e6522062984b0503fbffbbc9220023" + integrity sha512-cKnAhWEsV7TPcA/5EAteDp6KcJZBQ2G+BqE7zayMMi7kMvwRsbv7WT9aOnn0WNl4SKEIf43vjS31iUPu80nzXg== -"@rolldown/binding-darwin-x64@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.0-rc.17.tgz#f8b465b3a4e992053890b162f1ae19e4f1719a6a" - integrity sha512-SUSDOI6WwUVNcWxd02QEBjLdY1VPHvlEkw6T/8nYG322iYWCTxRb1vzk4E+mWWYehTp7ERibq54LSJGjmouOsw== +"@rolldown/binding-darwin-x64@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.1.tgz#5b0a631e3784d5a7741dd93097dcf6dfca029960" + integrity sha512-YKrVwQjIRBPo+5G/u03wGjbdy4q7pyzCe93DK9VJ7zkVmeg8LJ7GbgsiHWdR4xSoe4CAXRD7Bcjgbtr64bkXNg== -"@rolldown/binding-freebsd-x64@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.0-rc.17.tgz#a8281e14fa9c243fe22dc2d0e54900e66b31935e" - integrity sha512-hwnz3nw9dbJ05EDO/PvcjaaewqqDy7Y1rn1UO81l8iIK1GjenME75dl16ajbvSSMfv66WXSRCYKIqfgq2KCfxw== +"@rolldown/binding-freebsd-x64@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.1.tgz#d82e561079db89f796438f56ec11bb3565ee1875" + integrity sha512-z/oBsREo46SsFqBwYtFe0kpJeBijAT48O/WXLI4suiCLBkr03RTtTJMCzSdDd2znlh8VJizL09XVkQgk8IZonw== -"@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.0-rc.17.tgz#cd29cf869ddd4fac8d6929abf94b91ddb0494650" - integrity sha512-IS+W7epTcwANmFSQFrS1SivEXHtl1JtuQA9wlxrZTcNi6mx+FDOYrakGevvvTwgj2JvWiK8B29/qD9BELZPyXQ== +"@rolldown/binding-linux-arm-gnueabihf@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.1.tgz#f2645afff4253c7b46b80ba14af5fd3fc18d45dc" + integrity sha512-ik8q7GM11zxvYxFc2PeDcT6TBvhCQMaUxfph/M5l9sKuTs/Sjg3L+Byw0F7w0ZVLBZmx30P+gG0ECzzN+MFcmQ== -"@rolldown/binding-linux-arm64-gnu@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.0-rc.17.tgz#91c331236ec3728366218d61a62f0bd226546c6c" - integrity sha512-e6usGaHKW5BMNZOymS1UcEYGowQMWcgZ71Z17Sl/h2+ZziNJ1a9n3Zvcz6LdRyIW5572wBCTH/Z+bKuZouGk9Q== +"@rolldown/binding-linux-arm64-gnu@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.1.tgz#a16b97f175e7b115c5ece77c7b648d0c868f4486" + integrity sha512-QoSx2EkyrrdZ6kcyE8stqZ62t0Yra8Fs5ia9lOxJrh6TMQJK7gQKmscdTHf7pOXKREKrVwOtJcQG3qVSfc866A== -"@rolldown/binding-linux-arm64-musl@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.0-rc.17.tgz#80108957db752e7826836e22240e56b8140e9684" - integrity sha512-b/CgbwAJpmrRLp02RPfhbudf5tZnN9nsPWK82znefso832etkem8H7FSZwxrOI9djcdTP7U6YfNhbRnh7djErg== +"@rolldown/binding-linux-arm64-musl@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.1.tgz#e695aec4ef2c8713c9d959b42a208059891276da" + integrity sha512-uwNwFpwKeNiZawfAWBgg0VIztPTV3ihhh1vV334h9ivnNLorxnQMU6Fz8wG1Zb4Qh9LC1/MkcyT3YlDXG3Rsgg== -"@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.0-rc.17.tgz#1dce51148cbc6bab3c3f9157b5323d2a31aac924" - integrity sha512-4EII1iNGRUN5WwGbF/kOh/EIkoDN9HsupgLQoXfY+D1oyJm7/F4t5PYU5n8SWZgG0FEwakyM8pGgwcBYruGTlA== +"@rolldown/binding-linux-ppc64-gnu@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.1.tgz#4a9edf16112cbe99cdd396c60efac39cbd1758ac" + integrity sha512-zY1bul7OWr7DFBiJ++wofXvnr8B45ce3QsQUhKrIhXsygAh7bTkwyeM1bi1a2g5C/yC/N8TZyGDEoMfm/l9mpg== -"@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.0-rc.17.tgz#d4a0d2e01d8d441e4ac3af3fa68eec17a7d0e9cd" - integrity sha512-AH8oq3XqQo4IibpVXvPeLDI5pzkpYn0WiZAfT05kFzoJ6tQNzwRdDYQ45M8I/gslbodRZwW8uxLhbSBbkv96rA== +"@rolldown/binding-linux-s390x-gnu@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.1.tgz#314aa3ec1ce8251501d865f98fb91e42a1e671e4" + integrity sha512-0frlsT/f4Ft6I7SMESTKnF3cZsdicQn1dCMkF/jT9wDLE+gGoiQfv1nmT9e+s7s/fekvvy6tZM2jHvI2tkbJDQ== -"@rolldown/binding-linux-x64-gnu@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.0-rc.17.tgz#0ac8b3139cefeea798ad147f30ea70572b133af1" - integrity sha512-cLnjV3xfo7KslbU41Z7z8BH/E1y5mzUYzAqih1d1MDaIGZRCMqTijqLv76/P7fyHuvUcfGsIpqCdddbxLLK9rA== +"@rolldown/binding-linux-x64-gnu@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.1.tgz#7c51f13cf1141c503ee162830b4fc692d91640be" + integrity sha512-XABVmGp9Tg0WspTVvwduTc4fpqy6JnAUrSQe6OuyqD/03nI7r0O9OWUkMIwFrjKAIqolvqoA4ZrJppgwE0Gxmw== -"@rolldown/binding-linux-x64-musl@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.0-rc.17.tgz#2af61bee087571728f58f1c47734bbbd41dd7050" - integrity sha512-0phclDw1spsL7dUB37sIARuis2tAgomCJXAHZlpt8PXZ4Ba0dRP1e+66lsRqrfhISeN9bEGNjQs+T/Fbd7oYGw== +"@rolldown/binding-linux-x64-musl@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.1.tgz#b7213936bbc9310b02a34f71cefd25f9e71f329b" + integrity sha512-bV4fzswuzVcKD90o/VM6QqKxnxlDq0g2BISDLNVmxrnhpv1DDbyPhCIjYfvzYLV+MvkKKnQt2Q6AO86SEBULUQ== -"@rolldown/binding-openharmony-arm64@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.0-rc.17.tgz#56c1afbf6c592819abf47b4a983987dc288b30c1" - integrity sha512-0ag/hEgXOwgw4t8QyQvUCxvEg+V0KBcA6YuOx9g0r02MprutRF5dyljgm3EmR02O292UX7UeS6HzWHAl6KgyhA== +"@rolldown/binding-openharmony-arm64@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.1.tgz#006e88acde4f12b41a4c72292685c9dc9e6a3627" + integrity sha512-/Mh0Zhq3OP7fVs0kcQHZP6lZEthMGTaSf8UBQYSFEZDWGXXlEC+nJ6EqenaK2t4LBXMe3A+K/G2BVXXdtOr4PQ== -"@rolldown/binding-wasm32-wasi@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.0-rc.17.tgz#5d112ff4dd0d268a60fb4e0eb3077e3ea2531f0d" - integrity sha512-LEXei6vo0E5wTGwpkJ4KoT3OZJRnglwldt5ziLzOlc6qqb55z4tWNq2A+PFqCJuvWWdP53CVhG1Z9NtToDPJrA== +"@rolldown/binding-wasm32-wasi@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.1.tgz#033525c84da217418232f35be19f1ddc0af4f31e" + integrity sha512-+1xc9X45l8ufsBAm6Gjvx2qDRIY9lTVt0cgWNcJ+1gdhXvkbxePA60yRTwSTuXL09CMhyJmjpV7E3NoyxbqFQQ== dependencies: "@emnapi/core" "1.10.0" "@emnapi/runtime" "1.10.0" "@napi-rs/wasm-runtime" "^1.1.4" -"@rolldown/binding-win32-arm64-msvc@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.0-rc.17.tgz#5125a85222d64a543201d28e16a395cc45bf4d17" - integrity sha512-gUmyzBl3SPMa6hrqFUth9sVfcLBlYsbMzBx5PlexMroZStgzGqlZ26pYG89rBb45Mnia+oil6YAIFeEWGWhoZA== +"@rolldown/binding-win32-arm64-msvc@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.1.tgz#febbf109cf1b5837e21369f0e0d2fefca1519c39" + integrity sha512-1D+UqZdfnuR+Jy1GgMJwi85bD40H21uNmOPRWQhw4oRSuolZ/B5rixZ45DK2KXOTCvmVCecauWgEhbw8bI7tOw== -"@rolldown/binding-win32-x64-msvc@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.17.tgz#fc6b78e759a0bb2054b5c0a3489da12b2cae54b4" - integrity sha512-3hkiolcUAvPB9FLb3UZdfjVVNWherN1f/skkGWJP/fgSQhYUZpSIRr0/I8ZK9TkF3F7kxvJAk0+IcKvPHk9qQg== +"@rolldown/binding-win32-x64-msvc@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.1.tgz#dfb32a67ccb0deaa3c9a57f6cb4890b5697dfa2c" + integrity sha512-INAycaWuhlOK3wk4mRHGsdgwYWmd9cChdPdE9bwWmy6rn9VqVNYNFGhOdXrofXUxwHIncSiPNb8tNm8knDVIeQ== -"@rolldown/pluginutils@1.0.0-rc.17": - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.17.tgz#a89b30833fb628bc834fe2e89fea93a2da9fa69a" - integrity sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg== - -"@rolldown/pluginutils@1.0.0-rc.7": - version "1.0.0-rc.7" - resolved "https://registry.yarnpkg.com/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.7.tgz#0414869467f0e471a6515d4f506c85fde867e022" - integrity sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA== +"@rolldown/pluginutils@^1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz#e3fcee093fbb5ce765e1ad088ff4de2889f6f9be" + integrity sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw== "@tailwindcss/forms@^0.5.11": version "0.5.11" @@ -734,114 +729,114 @@ dependencies: mini-svg-data-uri "^1.2.3" -"@tailwindcss/node@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/node/-/node-4.2.4.tgz#1f7fc0c1741037ded1fa92fbe62a786a197771ce" - integrity sha512-Ai7+yQPxz3ddrDQzFfBKdHEVBg0w3Zl83jnjuwxnZOsnH9pGn93QHQtpU0p/8rYWxvbFZHneni6p1BSLK4DkGA== +"@tailwindcss/node@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/node/-/node-4.3.0.tgz#9dc5312bf41c48658529f36021e0b466c4eb7860" + integrity sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g== dependencies: "@jridgewell/remapping" "^2.3.5" - enhanced-resolve "^5.19.0" + enhanced-resolve "^5.21.0" jiti "^2.6.1" lightningcss "1.32.0" magic-string "^0.30.21" source-map-js "^1.2.1" - tailwindcss "4.2.4" + tailwindcss "4.3.0" -"@tailwindcss/oxide-android-arm64@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.2.4.tgz#d533e52ee98d58f55d1d4753774251513ba8a911" - integrity sha512-e7MOr1SAn9U8KlZzPi1ZXGZHeC5anY36qjNwmZv9pOJ8E4Q6jmD1vyEHkQFmNOIN7twGPEMXRHmitN4zCMN03g== +"@tailwindcss/oxide-android-arm64@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.3.0.tgz#e4533b6125236fe81a899cf5a82028c85244def8" + integrity sha512-TJPiq67tKlLuObP6RkwvVGDoxCMBVtDgKkLfa/uyj7/FyxvQwHS+UOnVrXXgbEsfUaMgiVvC4KbJnRr26ho4Ng== -"@tailwindcss/oxide-darwin-arm64@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.2.4.tgz#2a6250aa7d8791fc1b5797e64e09e51da57514a6" - integrity sha512-tSC/Kbqpz/5/o/C2sG7QvOxAKqyd10bq+ypZNf+9Fi2TvbVbv1zNpcEptcsU7DPROaSbVgUXmrzKhurFvo5eDg== +"@tailwindcss/oxide-darwin-arm64@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.0.tgz#96b074ef64ec6c41d580063740c8d36cf5c459ce" + integrity sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ== -"@tailwindcss/oxide-darwin-x64@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.2.4.tgz#d647299812946b6ab5140c61a334c8ebc8d877de" - integrity sha512-yPyUXn3yO/ufR6+Kzv0t4fCg2qNr90jxXc5QqBpjlPNd0NqyDXcmQb/6weunH/MEDXW5dhyEi+agTDiqa3WsGg== +"@tailwindcss/oxide-darwin-x64@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.3.0.tgz#0d9638d06d38684339b2dc06631966a7296bb64e" + integrity sha512-N6CUmu4a6bKVADfw77p+iw6Yd9Q3OBhe0veaDX+QazfuVYlQsHfDgxBrsjQ/IW+zywL8mTrNd0SdJT/zgtvMdA== -"@tailwindcss/oxide-freebsd-x64@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.2.4.tgz#019b7fce37aaf5ddfed0f231c536108292e87ffb" - integrity sha512-BoMIB4vMQtZsXdGLVc2z+P9DbETkiopogfWZKbWwM8b/1Vinbs4YcUwo+kM/KeLkX3Ygrf4/PsRndKaYhS8Eiw== +"@tailwindcss/oxide-freebsd-x64@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.3.0.tgz#efc7acd17cd38d7585c07cb938a4f1b703f79d7a" + integrity sha512-zDL5hBkQdH5C6MpqbK3gQAgP80tsMwSI26vjOzjJtNCMUo0lFgOItzHKBIupOZNQxt3ouPH7RPhvNhiTfCe5CQ== -"@tailwindcss/oxide-linux-arm-gnueabihf@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.2.4.tgz#c88a95d69095e84f811b302daa66f5287ad8ce0f" - integrity sha512-7pIHBLTHYRAlS7V22JNuTh33yLH4VElwKtB3bwchK/UaKUPpQ0lPQiOWcbm4V3WP2I6fNIJ23vABIvoy2izdwA== +"@tailwindcss/oxide-linux-arm-gnueabihf@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.3.0.tgz#e41c945e529670cd93fd6ed0c6a2880de5c40333" + integrity sha512-R06HdNi7A7OEoMsf6d4tjZ71RCWnZQPHj2mnotSFURjNLdBC+cIgXQ7l81CqeoiQftjf6OOblxXMInMgN2VzMA== -"@tailwindcss/oxide-linux-arm64-gnu@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.2.4.tgz#1292f1c222994bfe4a5e990ac0a701de6487dd02" - integrity sha512-+E4wxJ0ZGOzSH325reXTWB48l42i93kQqMvDyz5gqfRzRZ7faNhnmvlV4EPGJU3QJM/3Ab5jhJ5pCRUsKn6OQw== +"@tailwindcss/oxide-linux-arm64-gnu@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.3.0.tgz#6bb608b16ba7146d61097c2f4c7ee927d1f3580a" + integrity sha512-qTJHELX8jetjhRQHCLilkVLmybpzNQAtaI/gaoVoidn/ufbNDbAo8KlK2J+yPoc8wQxvDxCmh/5lr8nC1+lTbg== -"@tailwindcss/oxide-linux-arm64-musl@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.2.4.tgz#afb6492b22616f0d9d3346d39c1a6e285f994a08" - integrity sha512-bBADEGAbo4ASnppIziaQJelekCxdMaxisrk+fB7Thit72IBnALp9K6ffA2G4ruj90G9XRS2VQ6q2bCKbfFV82g== +"@tailwindcss/oxide-linux-arm64-musl@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.3.0.tgz#1bb443aa371bb99b50cb39d4d688151fadcd8a63" + integrity sha512-Z6sukiQsngnWO+l39X4pPbiWT81IC+PLKF+PHxIlyZbGNb9MODfYlXEVlFvej5BOZInWX01kVyzeLvHsXhfczQ== -"@tailwindcss/oxide-linux-x64-gnu@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.2.4.tgz#400b0ccfc53937c7804ed8e0e9652b42bd86f2eb" - integrity sha512-7Mx25E4WTfnht0TVRTyC00j3i0M+EeFe7wguMDTlX4mRxafznw0CA8WJkFjWYH5BlgELd1kSjuU2JiPnNZbJDA== +"@tailwindcss/oxide-linux-x64-gnu@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.3.0.tgz#5267c0bb2597426c0d2e759acb5389cde2aa71fd" + integrity sha512-DRNdQRpSGzRGfARVuVkxvM8Q12nh19l4BF/G7zGA1oe+9wcC6saFBHTISrpIcKzhiXtSrlSrluCfvMuledoCTQ== -"@tailwindcss/oxide-linux-x64-musl@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.2.4.tgz#5c23c476e5de4ed9cd6ab39c2718b9a4be2bbb2b" - integrity sha512-2wwJRF7nyhOR0hhHoChc04xngV3iS+akccHTGtz965FwF0up4b2lOdo6kI1EbDaEXKgvcrFBYcYQQ/rrnWFVfA== +"@tailwindcss/oxide-linux-x64-musl@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.3.0.tgz#fb2da97c67b218e5c7c723cb32782d55d7e4a5d5" + integrity sha512-Z0IADbDo8bh6I7h2IQMx601AdXBLfFpEdUotft86evd/8ZPflZe9COPO8Q1vw+pfLWIUo9zN/JGZvwuAJqduqg== -"@tailwindcss/oxide-wasm32-wasi@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.2.4.tgz#21b7f53ba7c6c03f26ccb8cef5d09f5c2973ae5e" - integrity sha512-FQsqApeor8Fo6gUEklzmaa9994orJZZDBAlQpK2Mq+DslRKFJeD6AjHpBQ0kZFQohVr8o85PPh8eOy86VlSCmw== +"@tailwindcss/oxide-wasm32-wasi@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.3.0.tgz#3f6538e511066d67d8683863dcaeeb16c22de849" + integrity sha512-HNZGOUxEmElksYR7S6sC5jTeNGpobAsy9u7Gu0AskJ8/20FR9GqebUyB+HBcU/ax6BHuiuJi+Oda4B+YX6H1yA== dependencies: - "@emnapi/core" "^1.8.1" - "@emnapi/runtime" "^1.8.1" - "@emnapi/wasi-threads" "^1.1.0" - "@napi-rs/wasm-runtime" "^1.1.1" + "@emnapi/core" "^1.10.0" + "@emnapi/runtime" "^1.10.0" + "@emnapi/wasi-threads" "^1.2.1" + "@napi-rs/wasm-runtime" "^1.1.4" "@tybys/wasm-util" "^0.10.1" tslib "^2.8.1" -"@tailwindcss/oxide-win32-arm64-msvc@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.2.4.tgz#13bc1cf3818e3345a965d36b40c237817124d070" - integrity sha512-L9BXqxC4ToVgwMFqj3pmZRqyHEztulpUJzCxUtLjobMCzTPsGt1Fa9enKbOpY2iIyVtaHNeNvAK8ERP/64sqGQ== +"@tailwindcss/oxide-win32-arm64-msvc@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.3.0.tgz#ec45fba773c76759338c05d4fe5cf42c4eea2e4e" + integrity sha512-Pe+RPVTi1T+qymuuRpcdvwSVZjnll/f7n8gBxMMh3xLTctMDKqpdfGimbMyioqtLhUYZxdJ9wGNhV7MKHvgZsQ== -"@tailwindcss/oxide-win32-x64-msvc@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.2.4.tgz#5476dbbbf6b8934d58452340cec737fdaa5ec8c6" - integrity sha512-ESlKG0EpVJQwRjXDDa9rLvhEAh0mhP1sF7sap9dNZT0yyl9SAG6T7gdP09EH0vIv0UNTlo6jPWyujD6559fZvw== +"@tailwindcss/oxide-win32-x64-msvc@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.3.0.tgz#58cdd6e06adbe2e3160274edfcd0b0b43e17fee4" + integrity sha512-Mvrf2kXW/yeW/OTezZlCGOirXRcUuLIBx/5Y12BaPM7wJoryG6dfS/NJL8aBPqtTEx/Vm4T4vKzFUcKDT+TKUA== -"@tailwindcss/oxide@4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/oxide/-/oxide-4.2.4.tgz#e2ca51d04e8ad94d569222fa727de479b097db39" - integrity sha512-9El/iI069DKDSXwTvB9J4BwdO5JhRrOweGaK25taBAvBXyXqJAX+Jqdvs8r8gKpsI/1m0LeJLyQYTf/WLrBT1Q== +"@tailwindcss/oxide@4.3.0": + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/oxide/-/oxide-4.3.0.tgz#cc1c61e88f62c0e9f56062de3e7873acaa2159d4" + integrity sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg== optionalDependencies: - "@tailwindcss/oxide-android-arm64" "4.2.4" - "@tailwindcss/oxide-darwin-arm64" "4.2.4" - "@tailwindcss/oxide-darwin-x64" "4.2.4" - "@tailwindcss/oxide-freebsd-x64" "4.2.4" - "@tailwindcss/oxide-linux-arm-gnueabihf" "4.2.4" - "@tailwindcss/oxide-linux-arm64-gnu" "4.2.4" - "@tailwindcss/oxide-linux-arm64-musl" "4.2.4" - "@tailwindcss/oxide-linux-x64-gnu" "4.2.4" - "@tailwindcss/oxide-linux-x64-musl" "4.2.4" - "@tailwindcss/oxide-wasm32-wasi" "4.2.4" - "@tailwindcss/oxide-win32-arm64-msvc" "4.2.4" - "@tailwindcss/oxide-win32-x64-msvc" "4.2.4" + "@tailwindcss/oxide-android-arm64" "4.3.0" + "@tailwindcss/oxide-darwin-arm64" "4.3.0" + "@tailwindcss/oxide-darwin-x64" "4.3.0" + "@tailwindcss/oxide-freebsd-x64" "4.3.0" + "@tailwindcss/oxide-linux-arm-gnueabihf" "4.3.0" + "@tailwindcss/oxide-linux-arm64-gnu" "4.3.0" + "@tailwindcss/oxide-linux-arm64-musl" "4.3.0" + "@tailwindcss/oxide-linux-x64-gnu" "4.3.0" + "@tailwindcss/oxide-linux-x64-musl" "4.3.0" + "@tailwindcss/oxide-wasm32-wasi" "4.3.0" + "@tailwindcss/oxide-win32-arm64-msvc" "4.3.0" + "@tailwindcss/oxide-win32-x64-msvc" "4.3.0" "@tailwindcss/postcss@^4.2.4": - version "4.2.4" - resolved "https://registry.yarnpkg.com/@tailwindcss/postcss/-/postcss-4.2.4.tgz#548ed07584a41411574e8b1ec5f1543d09c439a4" - integrity sha512-wgAVj6nUWAolAu8YFvzT2cTBIElWHkjZwFYovF+xsqKsW2ADxM/X2opxj5NsF/qVccAOjRNe8X2IdPzMsWyHTg== + version "4.3.0" + resolved "https://registry.yarnpkg.com/@tailwindcss/postcss/-/postcss-4.3.0.tgz#58a087d8c6f06c6aa81e8a3f6c1e7282b8ee94d9" + integrity sha512-Jm05Tjx+9yCLGv5qw1c+84Psds8MnyrEQYCB+FFk2lgGiUjlRqdxke4mVTuYrj2xnVZqKim2Apr5ySuQRYAw/w== dependencies: "@alloc/quick-lru" "^5.2.0" - "@tailwindcss/node" "4.2.4" - "@tailwindcss/oxide" "4.2.4" - postcss "^8.5.6" - tailwindcss "4.2.4" + "@tailwindcss/node" "4.3.0" + "@tailwindcss/oxide" "4.3.0" + postcss "^8.5.10" + tailwindcss "4.3.0" "@tanstack/react-virtual@3.13.24": version "3.13.24" @@ -868,9 +863,9 @@ integrity sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw== "@types/estree@^1.0.6", "@types/estree@^1.0.8": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" - integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== + version "1.0.9" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.9.tgz#cf3f0e876d7bee15a93ab925b82bf570a3904a24" + integrity sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg== "@types/json-schema@^7.0.15": version "7.0.15" @@ -878,11 +873,11 @@ integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node@^25.6.0": - version "25.6.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-25.6.0.tgz#4e09bad9b469871f2d0f68140198cbd714f4edca" - integrity sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ== + version "25.9.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-25.9.0.tgz#4823e66e0f486bfd8d9019fb445fbbb9e6f77348" + integrity sha512-AOQwYUNolgy3VosiRqXrACUXTN8nJUtPl7FJXMqZVyxiiCLhQuG3jXKvCS1ALr+Y2OmZhzzLVlYPEqJaiqkaJQ== dependencies: - undici-types "~7.19.0" + undici-types ">=7.24.0 <7.24.7" "@types/react-dom@^19.2.3": version "19.2.3" @@ -901,108 +896,108 @@ resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11" integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw== -"@typescript-eslint/eslint-plugin@8.59.2", "@typescript-eslint/eslint-plugin@^8.59.1": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.2.tgz#f37b2c189a0177141fe3de3b08f2a83991bfdbfa" - integrity sha512-j/bwmkBvHUtPNxzuWe5z6BEk3q54YRyGlBXkSsmfoih7zNrBvl5A9A98anlp/7JbyZcWIJ8KXo/3Tq/DjFLtuQ== +"@typescript-eslint/eslint-plugin@8.59.3", "@typescript-eslint/eslint-plugin@^8.59.1": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.59.3.tgz#5d6da7e7b236b46452fa00d3904bb6f59615bfde" + integrity sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw== dependencies: "@eslint-community/regexpp" "^4.12.2" - "@typescript-eslint/scope-manager" "8.59.2" - "@typescript-eslint/type-utils" "8.59.2" - "@typescript-eslint/utils" "8.59.2" - "@typescript-eslint/visitor-keys" "8.59.2" + "@typescript-eslint/scope-manager" "8.59.3" + "@typescript-eslint/type-utils" "8.59.3" + "@typescript-eslint/utils" "8.59.3" + "@typescript-eslint/visitor-keys" "8.59.3" ignore "^7.0.5" natural-compare "^1.4.0" ts-api-utils "^2.5.0" -"@typescript-eslint/parser@8.59.2", "@typescript-eslint/parser@^8.59.1": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.59.2.tgz#e2fd0084baa5dd0c24cd789af1c72cbc3a7a1c62" - integrity sha512-plR3pp6D+SSUn1HM7xvSkx12/DhoHInI2YF35KAcVFNZvlC0gtrWqx7Qq1oH2Ssgi0vlFRCTbP+DZc7B9+TtsQ== +"@typescript-eslint/parser@8.59.3", "@typescript-eslint/parser@^8.59.1": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.59.3.tgz#f46cbc70ae0a25119ef94eac9ecd46714788e1a1" + integrity sha512-HPwA+hVkfcriajbNvTmZv4VRauibay+cWArYUYq7u7W7PmGShMxbPxLvrwDme55a6d5alG3nrYfhyJ/G28XlLg== dependencies: - "@typescript-eslint/scope-manager" "8.59.2" - "@typescript-eslint/types" "8.59.2" - "@typescript-eslint/typescript-estree" "8.59.2" - "@typescript-eslint/visitor-keys" "8.59.2" + "@typescript-eslint/scope-manager" "8.59.3" + "@typescript-eslint/types" "8.59.3" + "@typescript-eslint/typescript-estree" "8.59.3" + "@typescript-eslint/visitor-keys" "8.59.3" debug "^4.4.3" -"@typescript-eslint/project-service@8.59.2": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.59.2.tgz#f8b8cbf8692e3a51c2c394acf8cf6900f7e755af" - integrity sha512-+2hqvEkeyf/0FBor67duF0Ll7Ot8jyKzDQOSrxazF/danillRq2DwR9dLptsXpoZQqxE1UisSmoZewrlPas9Vw== +"@typescript-eslint/project-service@8.59.3": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.59.3.tgz#1be5ae152aad987a156c9a1a9b4256e75cfbbe0c" + integrity sha512-ECiUWa/KYRGDFUqTNehaRgzDshnJfkTABJxVemHk4ko22gcr0ukloKjWvyQ64g8YCV/UI47kN1dbmjf/GaQYng== dependencies: - "@typescript-eslint/tsconfig-utils" "^8.59.2" - "@typescript-eslint/types" "^8.59.2" + "@typescript-eslint/tsconfig-utils" "^8.59.3" + "@typescript-eslint/types" "^8.59.3" debug "^4.4.3" -"@typescript-eslint/scope-manager@8.59.2": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.59.2.tgz#63cbd0af2e3180949d6be81122cc555bc71e736d" - integrity sha512-JzfyEpEtOU89CcFSwyNS3mu4MLvLSXqnmX05+aKBDM+TdR5jzcGOEBwxwGNxrEQ7p/z6kK2WyioCGBf2zZBnvg== +"@typescript-eslint/scope-manager@8.59.3": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.59.3.tgz#91a60f66803fe9dae0696fbab2451f5723f119d2" + integrity sha512-t2LvZnoEfzKtnPjgeEu41xw5gxq9mQVfYy4OoZ4Vlt0sk3JwxmhCca/AR7DwOiHrjWgjAj6as4AhRLKSDfvZIA== dependencies: - "@typescript-eslint/types" "8.59.2" - "@typescript-eslint/visitor-keys" "8.59.2" + "@typescript-eslint/types" "8.59.3" + "@typescript-eslint/visitor-keys" "8.59.3" -"@typescript-eslint/tsconfig-utils@8.59.2", "@typescript-eslint/tsconfig-utils@^8.59.2": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.2.tgz#6e92bc412083753185a79c9f1431e78169d9232f" - integrity sha512-BKK4alN7oi4C/zv4VqHQ+uRU+lTa6JGIZ7s1juw7b3RHo9OfKB+bKX3u0iVZetdsUCBBkSbdWbarJbmN0fTeSw== +"@typescript-eslint/tsconfig-utils@8.59.3", "@typescript-eslint/tsconfig-utils@^8.59.3": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.59.3.tgz#88ca9036b42ccdd1e630cfdafd2e042c2ca6a835" + integrity sha512-PcIJHjmaREXLgIAIzLnSY9VucEzz8FKXsRgFa1DmdGCK/5tJpW03TKJF01Q6VZd1lLdz2sIKPWaDUZN9dp//dw== -"@typescript-eslint/type-utils@8.59.2": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.59.2.tgz#a60a1192a804fa472a92c41656853ac6a9ba7176" - integrity sha512-nhqaj1nmTdVVl/BP5omXNRGO38jn5iosis2vbdmupF2txCf8ylWT8lx+JlvMYYVqzGVKtjojUFoQ3JRWK+mfzQ== +"@typescript-eslint/type-utils@8.59.3": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.59.3.tgz#421fb2448bdfeb301d134a01cd02503f67fd8192" + integrity sha512-g71d8QD8UaiHGvrJwyIS1hCX5r63w6Jll+4VEYhEAHXTDIqX1JgxhTAbEHtKntL9kuc4jRo7/GWw5xfCepSccQ== dependencies: - "@typescript-eslint/types" "8.59.2" - "@typescript-eslint/typescript-estree" "8.59.2" - "@typescript-eslint/utils" "8.59.2" + "@typescript-eslint/types" "8.59.3" + "@typescript-eslint/typescript-estree" "8.59.3" + "@typescript-eslint/utils" "8.59.3" debug "^4.4.3" ts-api-utils "^2.5.0" -"@typescript-eslint/types@8.59.2", "@typescript-eslint/types@^8.59.2": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.59.2.tgz#01caabcd7e4715c33ad5e11cab260829714d6b9c" - integrity sha512-e82GVOE8Ps3E++Egvb6Y3Dw0S10u8NkQ9KXmtRhCWJJ8kDhOJTvtMAWnFL16kB1583goCWXsr0NieKCZMs2/0Q== +"@typescript-eslint/types@8.59.3", "@typescript-eslint/types@^8.59.3": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.59.3.tgz#b7ca539c5e302fdde9a7cadb73caed107ef8f2cd" + integrity sha512-ePFoH0g4ludssdRFqqDxQePCxU4WQyRa9+XVwjm7yLn0FKhMeoetC+qBEEI1Eyb1pGSDveTIT09Bvw2WhlGayg== -"@typescript-eslint/typescript-estree@8.59.2": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.2.tgz#6a217ef65b18dbd12c718fc86a675d1d7a1414cc" - integrity sha512-o0XPGNwcWw+FIwStOWn+BwBuEmL6QXP0rsvAFg7ET1dey1Nr6Wb1ac8p5HEsK0ygO/6mUxlk+YWQD9xcb/nnXg== +"@typescript-eslint/typescript-estree@8.59.3": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.59.3.tgz#e6bb1408e00b47e431427a40268db4e86cb121ab" + integrity sha512-CbRjVRAf7Lr9Kr8RopKcbY45p2VfmmHrm0ygOCYFi7oU8q19m0Fs/6iHS7kNOmwpp+ob07ZVcAqlxUod9lYdmg== dependencies: - "@typescript-eslint/project-service" "8.59.2" - "@typescript-eslint/tsconfig-utils" "8.59.2" - "@typescript-eslint/types" "8.59.2" - "@typescript-eslint/visitor-keys" "8.59.2" + "@typescript-eslint/project-service" "8.59.3" + "@typescript-eslint/tsconfig-utils" "8.59.3" + "@typescript-eslint/types" "8.59.3" + "@typescript-eslint/visitor-keys" "8.59.3" debug "^4.4.3" minimatch "^10.2.2" semver "^7.7.3" tinyglobby "^0.2.15" ts-api-utils "^2.5.0" -"@typescript-eslint/utils@8.59.2": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.59.2.tgz#ff619a6a3075f4017fa91b8610b752a8ca3366aa" - integrity sha512-Juw3EinkXqjaffxz6roowvV7GZT/kET5vSKKZT6upl5TXdWkLkYmNPXwDDL2Vkt2DPn0nODIS4egC/0AGxKo/Q== +"@typescript-eslint/utils@8.59.3": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.59.3.tgz#f693f979deb4dc3994de03ff8b23976d625c36c5" + integrity sha512-JAvT14goBzRzzzZyqq3P9BLArIxTtQURUtFgQ/V7FO+eU+Gg6ES+5ymOPP1wRxXcxAYeivCk4uS3jCKWI1K8Zg== dependencies: "@eslint-community/eslint-utils" "^4.9.1" - "@typescript-eslint/scope-manager" "8.59.2" - "@typescript-eslint/types" "8.59.2" - "@typescript-eslint/typescript-estree" "8.59.2" + "@typescript-eslint/scope-manager" "8.59.3" + "@typescript-eslint/types" "8.59.3" + "@typescript-eslint/typescript-estree" "8.59.3" -"@typescript-eslint/visitor-keys@8.59.2": - version "8.59.2" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.2.tgz#5ccc486913cd347883d69158836b1189a660bfe6" - integrity sha512-NwjLUnGy8/Zfx23fl50tRC8rYaYnM52xNRYFAXvmiil9yh1+K6aRVQMnzW6gQB/1DLgWt977lYQn7C+wtgXZiA== +"@typescript-eslint/visitor-keys@8.59.3": + version "8.59.3" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.59.3.tgz#820843b1b5ca4290009cf189382abcf6fe00dfa6" + integrity sha512-f1UQF7ggd42YiwI5wGrRaPsa+P0CINBlrkLPmGfpq/u/I/oVtecoEIfFR9ag/oa1sLOsRNZ6xehf6qMZhQGBDg== dependencies: - "@typescript-eslint/types" "8.59.2" + "@typescript-eslint/types" "8.59.3" eslint-visitor-keys "^5.0.0" "@vitejs/plugin-react@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-6.0.1.tgz#d9113b71a0a592714913eafd9e5e63bcafd0ff15" - integrity sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ== + version "6.0.2" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-6.0.2.tgz#f70cb8ed0ce225dbc3055d78070f820d8aa35eda" + integrity sha512-DlSMqo4WhThw4vB8Mpn0Woe9J+Jfq1geJ61AKW0QEgLzGMNwtIMdxbDUzLxcun8W7NbJO0e2Jg/Nxm3cCSVzzg== dependencies: - "@rolldown/pluginutils" "1.0.0-rc.7" + "@rolldown/pluginutils" "^1.0.0" acorn-jsx@^5.3.2: version "5.3.2" @@ -1132,9 +1127,9 @@ balanced-match@^4.0.2: integrity sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA== baseline-browser-mapping@^2.10.12: - version "2.10.27" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.27.tgz#fee941c2a0b42cdf83c6427e4c830b1d0bdab2c3" - integrity sha512-zEs/ufmZoUd7WftKpKyXaT6RFxpQ5Qm9xytKRHvJfxFV9DFJkZph9RvJ1LcOUi0Z1ZVijMte65JbILeV+8QQEA== + version "2.10.30" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.30.tgz#58915c74388b05f3b3504026194ea9fa98f6e6b6" + integrity sha512-xjOFN16Ha1+Rz4nFYKqHU/LSB+gx/Vi3yQLX7r7sAW+Wa+8hhF2h4pvqTrTMc8+WcDBEunnUurr46Jvv0jk3Vg== brace-expansion@^1.1.7: version "1.1.14" @@ -1145,9 +1140,9 @@ brace-expansion@^1.1.7: concat-map "0.0.1" brace-expansion@^5.0.5: - version "5.0.5" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.0.5.tgz#dcc3a37116b79f3e1b46db994ced5d570e930fdb" - integrity sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ== + version "5.0.6" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-5.0.6.tgz#ec68fe0a641a29d8711579caf641d05bae1f2285" + integrity sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g== dependencies: balanced-match "^4.0.2" @@ -1189,9 +1184,9 @@ call-bound@^1.0.2, call-bound@^1.0.3, call-bound@^1.0.4: get-intrinsic "^1.3.0" caniuse-lite@^1.0.30001782: - version "1.0.30001791" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001791.tgz#dfb93d85c40ad380c57123e72e10f3c575786b51" - integrity sha512-yk0l/YSrOnFZk3UROpDLQD9+kC1l4meK/wed583AXrzoarMGJcbRi2Q4RaUYbKxYAsZ8sWmaSa/DsLmdBeI1vQ== + version "1.0.30001793" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001793.tgz#238887ddf5fcfc8c36d872394d0a78a517312a72" + integrity sha512-iwSsYWaCOoh26cV8NwNRViHlrfUvYsHDfRVcbtmw0Kg6PJIZZXwMkj1442FYLBGkeUf1juAsU3DTfxW579mrPA== chokidar@^4.0.0: version "4.0.3" @@ -1309,9 +1304,9 @@ doctrine@^2.1.0: esutils "^2.0.2" dompurify@^3.4.1: - version "3.4.2" - resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.4.2.tgz#f0ff81be682c485505097ba8195a058d8f575218" - integrity sha512-lHeS9SA/IKeIFFyYciHBr2n0v1VMPlSj843HdLOwjb2OxNwdq9Xykxqhk+FE42MzAdHvInbAolSE4mhahPpjXA== + version "3.4.5" + resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.4.5.tgz#bedc7d30a6007ae9a8937b952be6adb76a28e871" + integrity sha512-OrwIBKsdNSVEeubdJ1HBv/wNENRM9ytAVCv7YXt//A3vPdVMNuACRqK9mXCGCBW2ln7BT/A4X0jXHo2Gu89miA== optionalDependencies: "@types/trusted-types" "^2.0.7" @@ -1325,9 +1320,9 @@ dunder-proto@^1.0.0, dunder-proto@^1.0.1: gopd "^1.2.0" electron-to-chromium@^1.5.328: - version "1.5.351" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.351.tgz#7314fbb5b4835a1869feaec09665541b6a84cd37" - integrity sha512-9D7Iqx8RImSvCnOsj86rCH6eQjZFQoM04Jn6HnZVM0Nu/G58/gmKYQ1d12MZTbjQbQSTGI8nwEy07ErsA2slLA== + version "1.5.357" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.357.tgz#fb4ecbf08fe0082b7278d12d1f5da386436575b9" + integrity sha512-NHlTIQDK8fmVwHwuIzmXYEJ1Ewq3D9wDNc0cWXxDGysP6Pb21giwGNkxiTifyKy/4SoPuN5l6GLP1W9Sv7zB2g== emoji-mart@^5.6.0: version "5.6.0" @@ -1339,10 +1334,10 @@ emoji-toolkit@10.0.0: resolved "https://registry.yarnpkg.com/emoji-toolkit/-/emoji-toolkit-10.0.0.tgz#4a4dc29c86c30cea9bb1e5ef1d45bb36f6858397" integrity sha512-GkIAvgutEVbkqcT2HjBzV002SWvpdNaT3aP9q/YjQ6hlgDq8HhE9GcqxWkyYkRRQnLADGpwDoj1heTw9KzO9wQ== -enhanced-resolve@^5.19.0: - version "5.21.0" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.21.0.tgz#bb8e6fabaf74930de70e61397798750429e5b1ae" - integrity sha512-otxSQPw4lkOZWkHpB3zaEQs6gWYEsmX4xQF68ElXC/TWvGxGMSGOvoNbaLXm6/cS/fSfHtsEdw90y20PCd+sCA== +enhanced-resolve@^5.21.0: + version "5.21.3" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.21.3.tgz#fa7fed23679e9169dfb705b8e201924421c4414a" + integrity sha512-QyL119InA+XXEkNLNTPCXPugSvOfhwv0JOlGNzvxs0hZaiHLNvXSpudUWsOlsXGWJh8G6ckCScEkVHfX3kw/2Q== dependencies: graceful-fs "^4.2.4" tapable "^2.3.3" @@ -1538,14 +1533,14 @@ eslint-visitor-keys@^5.0.0, eslint-visitor-keys@^5.0.1: integrity sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA== eslint@^10.2.1: - version "10.3.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-10.3.0.tgz#ed5b810eb8e0191bf24bddcf9cdb45b974e0a16d" - integrity sha512-XbEXaRva5cF0ZQB8w6MluHA0kZZfV2DuCMJ3ozyEOHLwDpZX2Lmm/7Pp0xdJmI0GL1W05VH5VwIFHEm1Vcw2gw== + version "10.4.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-10.4.0.tgz#d86b6c405de0f19f3318c47139b8cb6771b3f592" + integrity sha512-loXy6bWOoP3EP6JA7jo6p5jMpBJmHmsNZM5SFRHLdh1MGOPurMnNBj4ZlAbaqUAaQWbCr7jHV4P7gzAyryZWkQ== dependencies: "@eslint-community/eslint-utils" "^4.8.0" "@eslint-community/regexpp" "^4.12.2" "@eslint/config-array" "^0.23.5" - "@eslint/config-helpers" "^0.5.5" + "@eslint/config-helpers" "^0.6.0" "@eslint/core" "^1.2.1" "@eslint/plugin-kit" "^0.7.1" "@humanfs/node" "^0.16.6" @@ -1889,7 +1884,7 @@ is-callable@^1.2.7: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== -is-core-module@^2.16.1: +is-core-module@^2.16.2: version "2.16.2" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.2.tgz#3e07450a8080ebce3fbf0cac494f4d2ab324e082" integrity sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA== @@ -2288,9 +2283,9 @@ node-exports-info@^1.6.0: semver "^6.3.1" node-releases@^2.0.36: - version "2.0.38" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.38.tgz#791569b9e4424a044e12c3abfad418ed83ce9947" - integrity sha512-3qT/88Y3FbH/Kx4szpQQ4HzUbVrHPKTLVpVocKiLfoYvw9XSGOX2FmD2d6DrXbVYyAQTF2HeF6My8jmzx7/CRw== + version "2.0.44" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.44.tgz#212c9b983f5bb70d311dd68c27d55dd0e65d1ca7" + integrity sha512-5WUyunoPMsvvEhS8AxHtRzP+oA8UCkJ7YRxatWKjngndhDGLiqEVAQKWjFAiAiuL8zMRGzGSJxFnLetoa43qGQ== object-assign@^4.1.1: version "4.1.1" @@ -2429,7 +2424,7 @@ postcss-selector-parser@^7.0.0: cssesc "^3.0.0" util-deprecate "^1.0.2" -postcss@^8.5.10, postcss@^8.5.12, postcss@^8.5.6: +postcss@^8.5.10, postcss@^8.5.12, postcss@^8.5.14: version "8.5.14" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.14.tgz#a66c2d7808fadf69ebb5b84a03f8bafd76c4919c" integrity sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg== @@ -2458,9 +2453,9 @@ punycode@^2.1.0: integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== react-dom@^19.2.5: - version "19.2.5" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.2.5.tgz#b8768b10837d0b8e9ca5b9e2d58dff3d880ea25e" - integrity sha512-J5bAZz+DXMMwW/wV3xzKke59Af6CHY7G4uYLN1OvBcKEsWOs4pQExj86BBKamxl/Ik5bx9whOrvBlSDfWzgSag== + version "19.2.6" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.2.6.tgz#44a81b0bcca22da814c00847d09d01c8615529b7" + integrity sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g== dependencies: scheduler "^0.27.0" @@ -2518,9 +2513,9 @@ react-style-singleton@^2.2.2, react-style-singleton@^2.2.3: tslib "^2.0.0" react@^19.2.5: - version "19.2.5" - resolved "https://registry.yarnpkg.com/react/-/react-19.2.5.tgz#c888ab8b8ef33e2597fae8bdb2d77edbdb42858b" - integrity sha512-llUJLzz1zTUBrskt2pwZgLq59AemifIftw4aB7JxOqf1HY2FDaGDxgwpAPVzHU1kdWabH7FauP4i1oEeer2WCA== + version "19.2.6" + resolved "https://registry.yarnpkg.com/react/-/react-19.2.6.tgz#3dadb8e12b2a7934c1d5317973e5dce1301f9a4d" + integrity sha512-sfWGGfavi0xr8Pg0sVsyHMAOziVYKgPLNrS7ig+ivMNb3wbCBw3KxtflsGBAwD3gYQlE/AEZsTLgToRrSCjb0Q== readdirp@^4.0.1: version "4.1.2" @@ -2554,40 +2549,40 @@ regexp.prototype.flags@^1.5.3, regexp.prototype.flags@^1.5.4: set-function-name "^2.0.2" resolve@^2.0.0-next.5: - version "2.0.0-next.6" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.6.tgz#b3961812be69ace7b3bc35d5bf259434681294af" - integrity sha512-3JmVl5hMGtJ3kMmB3zi3DL25KfkCEyy3Tw7Gmw7z5w8M9WlwoPFnIvwChzu1+cF3iaK3sp18hhPz8ANeimdJfA== + version "2.0.0-next.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.7.tgz#ba3b035d4b1ee7c522426eee73cabcb0fd5515dd" + integrity sha512-tqt+NBWwyaMgw3zDsnygx4CByWjQEJHOPMdslYhppaQSJUtL/D4JO9CcBBlhPoI8lz9oJIDXkwXfhF4aWqP8xQ== dependencies: es-errors "^1.3.0" - is-core-module "^2.16.1" + is-core-module "^2.16.2" node-exports-info "^1.6.0" object-keys "^1.1.1" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -rolldown@1.0.0-rc.17: - version "1.0.0-rc.17" - resolved "https://registry.yarnpkg.com/rolldown/-/rolldown-1.0.0-rc.17.tgz#c524fc22f6bb37b5588aec862ab1ee11382610f3" - integrity sha512-ZrT53oAKrtA4+YtBWPQbtPOxIbVDbxT0orcYERKd63VJTF13zPcgXTvD4843L8pcsI7M6MErt8QtON6lrB9tyA== +rolldown@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/rolldown/-/rolldown-1.0.1.tgz#2e2e839106dc47951e42dbba414f0f0ecf97ac68" + integrity sha512-X0KQHljNnEkWNqqiz9zJrGunh1B0HgOxLXvnFpCOcadzcy5qohZ3tqMEUg00vncoRovXuK3ZqCT9KnnKzoInFQ== dependencies: - "@oxc-project/types" "=0.127.0" - "@rolldown/pluginutils" "1.0.0-rc.17" + "@oxc-project/types" "=0.130.0" + "@rolldown/pluginutils" "^1.0.0" optionalDependencies: - "@rolldown/binding-android-arm64" "1.0.0-rc.17" - "@rolldown/binding-darwin-arm64" "1.0.0-rc.17" - "@rolldown/binding-darwin-x64" "1.0.0-rc.17" - "@rolldown/binding-freebsd-x64" "1.0.0-rc.17" - "@rolldown/binding-linux-arm-gnueabihf" "1.0.0-rc.17" - "@rolldown/binding-linux-arm64-gnu" "1.0.0-rc.17" - "@rolldown/binding-linux-arm64-musl" "1.0.0-rc.17" - "@rolldown/binding-linux-ppc64-gnu" "1.0.0-rc.17" - "@rolldown/binding-linux-s390x-gnu" "1.0.0-rc.17" - "@rolldown/binding-linux-x64-gnu" "1.0.0-rc.17" - "@rolldown/binding-linux-x64-musl" "1.0.0-rc.17" - "@rolldown/binding-openharmony-arm64" "1.0.0-rc.17" - "@rolldown/binding-wasm32-wasi" "1.0.0-rc.17" - "@rolldown/binding-win32-arm64-msvc" "1.0.0-rc.17" - "@rolldown/binding-win32-x64-msvc" "1.0.0-rc.17" + "@rolldown/binding-android-arm64" "1.0.1" + "@rolldown/binding-darwin-arm64" "1.0.1" + "@rolldown/binding-darwin-x64" "1.0.1" + "@rolldown/binding-freebsd-x64" "1.0.1" + "@rolldown/binding-linux-arm-gnueabihf" "1.0.1" + "@rolldown/binding-linux-arm64-gnu" "1.0.1" + "@rolldown/binding-linux-arm64-musl" "1.0.1" + "@rolldown/binding-linux-ppc64-gnu" "1.0.1" + "@rolldown/binding-linux-s390x-gnu" "1.0.1" + "@rolldown/binding-linux-x64-gnu" "1.0.1" + "@rolldown/binding-linux-x64-musl" "1.0.1" + "@rolldown/binding-openharmony-arm64" "1.0.1" + "@rolldown/binding-wasm32-wasi" "1.0.1" + "@rolldown/binding-win32-arm64-msvc" "1.0.1" + "@rolldown/binding-win32-x64-msvc" "1.0.1" safe-array-concat@^1.1.3: version "1.1.4" @@ -2639,9 +2634,9 @@ semver@^6.3.1: integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.7.3: - version "7.7.4" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a" - integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA== + version "7.8.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.8.0.tgz#ed0661039fcbcda2ce71f01fa6adbefaa77040df" + integrity sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA== set-function-length@^1.2.2: version "1.2.2" @@ -2803,10 +2798,10 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -tailwindcss@4.2.4, tailwindcss@^4.2.4: - version "4.2.4" - resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-4.2.4.tgz#f7e3090edb22d56394db4d68e6464d2628dc2aa9" - integrity sha512-HhKppgO81FQof5m6TEnuBWCZGgfRAWbaeOaGT00KOy/Pf/j6oUihdvBpA7ltCeAvZpFhW3j0PTclkxsd4IXYDA== +tailwindcss@4.3.0, tailwindcss@^4.2.4: + version "4.3.0" + resolved "https://registry.yarnpkg.com/tailwindcss/-/tailwindcss-4.3.0.tgz#0a874e044a859cf6de413f3a59e76a9bedf05264" + integrity sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q== tapable@^2.3.3: version "2.3.3" @@ -2884,14 +2879,14 @@ typed-array-length@^1.0.7: reflect.getprototypeof "^1.0.6" typescript-eslint@^8.59.1: - version "8.59.2" - resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.59.2.tgz#e24b4f7232e20112e40572dba162a829a738ce98" - integrity sha512-pJw051uomb3ZeCzGTpRb8RbEqB5Y4WWet8gl/GcTlU35BSx0PVdZ86/bqkQCyKKuraVQEK7r6kBHQXF+fBhkoQ== + version "8.59.3" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.59.3.tgz#4a41d9007faa539a66292189e2795eeb0b9fca29" + integrity sha512-KgusgyDgG4LI8Ih/sWaCtZ06tckLAS5CvT5A4D1Q7bYVoAAyzwiZvE4BmwDHkhRVkvhRBepKeASoFzQetha7Fg== dependencies: - "@typescript-eslint/eslint-plugin" "8.59.2" - "@typescript-eslint/parser" "8.59.2" - "@typescript-eslint/typescript-estree" "8.59.2" - "@typescript-eslint/utils" "8.59.2" + "@typescript-eslint/eslint-plugin" "8.59.3" + "@typescript-eslint/parser" "8.59.3" + "@typescript-eslint/typescript-estree" "8.59.3" + "@typescript-eslint/utils" "8.59.3" typescript@^6.0.3: version "6.0.3" @@ -2908,10 +2903,10 @@ unbox-primitive@^1.1.0: has-symbols "^1.1.0" which-boxed-primitive "^1.1.1" -undici-types@~7.19.0: - version "7.19.2" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.19.2.tgz#1b67fc26d0f157a0cba3a58a5b5c1e2276b8ba2a" - integrity sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg== +"undici-types@>=7.24.0 <7.24.7": + version "7.24.6" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.24.6.tgz#61275b485d7fd4e9d269c7cf04ec2873c9cc0f91" + integrity sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg== update-browserslist-db@^1.2.3: version "1.2.3" @@ -2954,14 +2949,14 @@ util-deprecate@^1.0.2: integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== vite@^8.0.10: - version "8.0.10" - resolved "https://registry.yarnpkg.com/vite/-/vite-8.0.10.tgz#fb31868526ec874101fac084172a2cdc6776319b" - integrity sha512-rZuUu9j6J5uotLDs+cAA4O5H4K1SfPliUlQwqa6YEwSrWDZzP4rhm00oJR5snMewjxF5V/K3D4kctsUTsIU9Mw== + version "8.0.13" + resolved "https://registry.yarnpkg.com/vite/-/vite-8.0.13.tgz#d75fb40aeee761051b0eb4620993da625c7719ab" + integrity sha512-MFtjBYgzmSxmgA4RAfjIyXWpGe1oALnjgUTzzV7QLx/TKxCzjtMH6Fd9/eVK+5Fg1qNoz5VAwsmMs/NofrmJvw== dependencies: lightningcss "^1.32.0" picomatch "^4.0.4" - postcss "^8.5.10" - rolldown "1.0.0-rc.17" + postcss "^8.5.14" + rolldown "1.0.1" tinyglobby "^0.2.16" optionalDependencies: fsevents "~2.3.3" From 2fded7bc79796cc9405a3875d06a42c4d6ab2ed9 Mon Sep 17 00:00:00 2001 From: medievalshell Date: Mon, 18 May 2026 20:38:26 +0200 Subject: [PATCH 2/5] feat: interactive JSON / JSON5 mode selector at build time Lets the operator pick between strict JSON (legacy) and JSON5 for every configuration file consumed by Nitro and the renderer. - scripts/configure-json.mjs: interactive prompt (JSON5 recommended), with --if-missing and --non-interactive flags for CI use - package.json: yarn configure / prestart / prebuild hooks - vite.config.mjs: reads .nitro-build.json (or NITRO_JSON_MODE env) and injects the compile-time constant __NITRO_JSON_MODE__ via define - src/bootstrap.ts: routes client-mode.json parsing through the selected mode - .gitignore: ignore the per-deployment .nitro-build.json - README: full usage and override section - public/configuration assets regenerated by the updated prebuild flow The renderer side (@nitrots/utils JsonParser) is updated in the companion Nitro_Render_V3 commit on the dev branch. --- .gitignore | 3 + README.md | 65 +++++++++++++++ package.json | 8 +- public/configuration/asset-loader.js | 27 +++++- public/configuration/bootstrap.js | 13 --- scripts/configure-json.mjs | 120 +++++++++++++++++++++++++++ src/bootstrap.ts | 34 +++++++- vite.config.mjs | 28 ++++++- 8 files changed, 276 insertions(+), 22 deletions(-) create mode 100644 scripts/configure-json.mjs diff --git a/.gitignore b/.gitignore index 90a9bfe..b2f21a6 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,9 @@ Thumbs.db .env .claude/ +# Per-deploy build configuration (yarn configure) +/.nitro-build.json + # Local runtime config copies /public/configuration/renderer-config.json /public/configuration/ui-config.json diff --git a/README.md b/README.md index bc91d90..1b00a3d 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,71 @@ - `yarn build` <== the final step to build the DIST folder this is where your browser needs to point / or upload this to your /client if you do the compile on a other machine (preferd) - You can override any variable by passing it to `NitroConfig` in the index.html +## JSON / JSON5 configuration mode + +Starting with this version of Nitro V3, you can choose how the client parses the +configuration files (`renderer-config.json`, `ui-config.json`, `client-mode.json`, +and the gamedata JSONs served by the renderer): + +- **JSON5** (recommended) — accepts comments, trailing commas, single quotes + and unquoted identifiers. Easier to maintain, especially in `ui-config.json` + where you may want inline notes. +- **JSON (legacy strict)** — only valid standard JSON is accepted. Any comment + or trailing comma will fail the load with a clear error. + +### Picking a mode + +The first time you run `yarn start` or `yarn build`, an interactive prompt asks +which mode to use: + +``` +════════════════════════════════════════════════════════════ + Nitro V3 — JSON mode configuration +════════════════════════════════════════════════════════════ + + 1) JSON5 (recommended) + 2) JSON (legacy strict) + +Scelta [1=JSON5]: +``` + +Your choice is stored in `.nitro-build.json` at the project root (gitignored, so +each deployment keeps its own setting). Subsequent builds reuse it silently. + +### Changing the mode later + +Run the prompt again at any time: + +``` +yarn configure +``` + +You can also set the mode without interaction (useful in CI / scripts): + +``` +# one-shot override for a single build +NITRO_JSON_MODE=legacy yarn build +NITRO_JSON_MODE=json5 yarn build + +# write the choice persistently +echo '{"jsonMode":"legacy"}' > .nitro-build.json +``` + +The recognized values are `legacy`, `json5`, and `auto` (auto = try strict JSON +first, fall back to JSON5 — equivalent to the original Render V3 behaviour). + +### How it propagates + +The chosen mode is injected at build time as the compile-time constant +`__NITRO_JSON_MODE__`. It is honoured by: + +- `src/bootstrap.ts` when loading `client-mode.json` +- `@nitrots/utils` → `JsonParser.ts` in Render V3, used for every config file + and every gamedata JSON loaded by the renderer + +In `legacy` mode, an invalid file produces a clear error that suggests switching +to JSON5; nothing is silently coerced. + ## Usage - To use Nitro you need `.nitro` assets generated, see [nitro-converter](https://git.krews.org/nitro/nitro-converter) for instructions diff --git a/package.json b/package.json index f31d0c6..3aaca07 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,11 @@ "homepage": ".", "private": true, "scripts": { - "prebuild": "node scripts/write-asset-loader.mjs", - "start": "vite --host", - "build": "vite build && node scripts/minify-dist.mjs", + "configure": "node scripts/configure-json.mjs", + "prestart": "node scripts/configure-json.mjs --if-missing", + "prebuild": "node scripts/configure-json.mjs --if-missing && node scripts/write-asset-loader.mjs", + "start": "vite --base=/nitro/ --host", + "build": "vite build --base=/nitro/ && node scripts/minify-dist.mjs", "build:prod": "npx browserslist@latest --update-db && yarn build", "eslint": "eslint ./src" }, diff --git a/public/configuration/asset-loader.js b/public/configuration/asset-loader.js index 19e2307..7483733 100644 --- a/public/configuration/asset-loader.js +++ b/public/configuration/asset-loader.js @@ -44,6 +44,11 @@ return new URL(".", source); }; + const getDeployBase = () => { + try { return new URL("..", getBase()); } + catch { return new URL("/", location.href); } + }; + const withCacheBust = (url) => { url.searchParams.set("v", Date.now().toString(36)); return url; @@ -71,9 +76,14 @@ const resolveAssetCandidates = (path) => { const base = getBase(); + const deploy = getDeployBase(); const normalized = path.replace(/^\.\//, ""); const file = normalized.split("/").pop(); + const relative = normalized.replace(/^\//, ""); const urls = [ + new URL("src/assets/" + file, deploy), + new URL("assets/" + file, deploy), + new URL(relative, deploy), new URL("./src/assets/" + file, base), new URL("./assets/" + file, base), new URL("/src/assets/" + file, base.origin), @@ -205,7 +215,10 @@ const fetchManifest = async () => { const base = getBase(); + const deploy = getDeployBase(); const candidates = [ + new URL(".vite/manifest.json", deploy), + new URL("manifest.json", deploy), new URL(".vite/manifest.json", base.origin + "/"), new URL("manifest.json", base.origin + "/"), new URL(".vite/manifest.json", base), @@ -221,7 +234,11 @@ const json = await response.json(); if(json && typeof json === "object") { debug("loader: manifest from " + candidate.href); - return { manifest: json, base: new URL(".", candidate.href) }; + let manifestBase = new URL(".", candidate.href); + if(/\/\.vite\/manifest\.json$/.test(candidate.pathname)) { + manifestBase = new URL("..", manifestBase); + } + return { manifest: json, base: manifestBase }; } } catch {} } @@ -247,18 +264,24 @@ const resolveManifestPath = (manifestBase, file) => { if(/^https?:\/\//i.test(file)) return file; if(file.startsWith("/")) return file; - return new URL(file, manifestBase.origin + "/").pathname; + return new URL(file, manifestBase).pathname; }; const isLoaderUrl = (href) => /(?:^|\/)bootstrap\.js(?:$|\?|#)/i.test(href) || /(?:^|\/)asset-loader\.js(?:$|\?|#)/i.test(href); const fetchEntryFromIndexHtml = async () => { const base = getBase(); + const deploy = getDeployBase(); const candidates = [ + new URL("index.html", deploy), + new URL("./", deploy), new URL("/index.html", base.origin + "/"), new URL("/", base.origin + "/") ]; + const seen = new Set(); for(const candidate of candidates) { + if(seen.has(candidate.href)) continue; + seen.add(candidate.href); try { const response = await fetch(withCacheBust(new URL(candidate.href)), { cache: "no-store" }); if(!response.ok) continue; diff --git a/public/configuration/bootstrap.js b/public/configuration/bootstrap.js index 997602f..13c1d8f 100644 --- a/public/configuration/bootstrap.js +++ b/public/configuration/bootstrap.js @@ -1,17 +1,4 @@ (() => { - const API_BASE = "http://localhost:2096"; - - const ensureMobileViewport = () => { - let viewport = document.querySelector('meta[name="viewport"]'); - if(!viewport) { - viewport = document.createElement("meta"); - viewport.name = "viewport"; - document.head.appendChild(viewport); - } - viewport.content = "width=device-width, initial-scale=1, viewport-fit=cover"; - }; - - ensureMobileViewport(); const FALLBACK_API_BASE = ""; const getBase = () => { diff --git a/scripts/configure-json.mjs b/scripts/configure-json.mjs new file mode 100644 index 0000000..6dfa846 --- /dev/null +++ b/scripts/configure-json.mjs @@ -0,0 +1,120 @@ +#!/usr/bin/env node +import { existsSync, readFileSync, writeFileSync } from 'fs'; +import { resolve } from 'path'; +import { fileURLToPath } from 'url'; +import readline from 'readline'; + +const SCRIPT_DIR = fileURLToPath(new URL('.', import.meta.url)); +const PROJECT_ROOT = resolve(SCRIPT_DIR, '..'); +const CONFIG_FILE = resolve(PROJECT_ROOT, '.nitro-build.json'); +const VALID_MODES = new Set(['legacy', 'json5']); +const DEFAULT_MODE = 'json5'; + +const args = process.argv.slice(2); +const ifMissing = args.includes('--if-missing'); +const nonInteractive = args.includes('--non-interactive') || !process.stdin.isTTY; + +const readExisting = () => +{ + if(!existsSync(CONFIG_FILE)) return null; + + try + { + const raw = readFileSync(CONFIG_FILE, 'utf8'); + const parsed = JSON.parse(raw); + if(parsed && VALID_MODES.has(parsed.jsonMode)) return parsed; + } + catch {} + + return null; +}; + +const writeChoice = (mode) => +{ + const payload = { + jsonMode: mode, + configuredAt: new Date().toISOString() + }; + writeFileSync(CONFIG_FILE, `${ JSON.stringify(payload, null, 2) }\n`, 'utf8'); +}; + +const printBanner = () => +{ + const line = '═'.repeat(60); + process.stdout.write(`\n${ line }\n Nitro V3 — JSON mode configuration\n${ line }\n\n`); + process.stdout.write('I file di configurazione (renderer-config, ui-config, gamedata)\npossono essere parsati in due modi:\n\n'); + process.stdout.write(' 1) JSON5 (consigliato — accetta commenti, trailing comma,\n single quote, identifier non quotati)\n'); + process.stdout.write(' 2) JSON (legacy strict — solo JSON valido standard)\n\n'); +}; + +const normalizeAnswer = (raw) => +{ + const v = (raw || '').trim().toLowerCase(); + if(!v || v === '1' || v === 'json5' || v === 'y' || v === 'yes') return 'json5'; + if(v === '2' || v === 'json' || v === 'legacy' || v === 'n' || v === 'no') return 'legacy'; + return null; +}; + +const promptUser = () => new Promise(resolveFn => +{ + const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); + + const ask = () => + { + rl.question('Scelta [1=JSON5]: ', answer => + { + const normalized = normalizeAnswer(answer); + if(normalized === null) + { + process.stdout.write(' ↳ Risposta non valida. Inserisci 1, 2, json5 o json.\n'); + return ask(); + } + rl.close(); + resolveFn(normalized); + }); + }; + + ask(); +}); + +const main = async () => +{ + const existing = readExisting(); + + if(ifMissing && existing) + { + process.stdout.write(`[configure-json] modalità già configurata: ${ existing.jsonMode } (skip)\n`); + return; + } + + if(nonInteractive) + { + const mode = existing?.jsonMode || DEFAULT_MODE; + writeChoice(mode); + process.stdout.write(`[configure-json] non interattivo — salvato: ${ mode }\n`); + return; + } + + printBanner(); + if(existing) process.stdout.write(`Modalità corrente: ${ existing.jsonMode }\n\n`); + + const choice = await promptUser(); + writeChoice(choice); + + process.stdout.write(`\n✓ Salvato in .nitro-build.json — modalità: ${ choice }\n`); + if(choice === 'legacy') + { + process.stdout.write(' Attenzione: i file di config devono essere JSON valido stretto\n (no commenti, no trailing comma).\n'); + } + else + { + process.stdout.write(' JSON5 attivo: puoi usare commenti, trailing comma e single quote\n nei file di configurazione.\n'); + } + process.stdout.write('\n Per cambiare modalità in futuro: yarn configure\n\n'); +}; + +main().catch(err => +{ + process.stderr.write(`[configure-json] errore: ${ err?.message || err }\n`); + process.exit(1); +}); diff --git a/src/bootstrap.ts b/src/bootstrap.ts index 71406fe..7646c5d 100644 --- a/src/bootstrap.ts +++ b/src/bootstrap.ts @@ -1,6 +1,22 @@ import JSON5 from 'json5'; import { configFileUrl, getClientMode, installSecureFetch } from './secure-assets'; +declare const __NITRO_JSON_MODE__: 'legacy' | 'json5' | 'auto' | undefined; + +const resolveJsonMode = (): 'legacy' | 'json5' | 'auto' => +{ + try + { + if(typeof __NITRO_JSON_MODE__ !== 'undefined' && __NITRO_JSON_MODE__) + { + if(__NITRO_JSON_MODE__ === 'legacy' || __NITRO_JSON_MODE__ === 'json5' || __NITRO_JSON_MODE__ === 'auto') return __NITRO_JSON_MODE__; + } + } + catch {} + + return 'auto'; +}; + const ensureMobileViewport = () => { let viewport = document.querySelector('meta[name="viewport"]'); @@ -76,16 +92,28 @@ const loadClientMode = async () => if(!response.ok) throw new Error(`HTTP ${ response.status }`); const text = await response.text(); + const mode = resolveJsonMode(); - try + if(mode === 'legacy') { (window as any).__nitroClientMode = JSON.parse(text); } - catch + else if(mode === 'json5') { (window as any).__nitroClientMode = JSON5.parse(text); } - setBootDebug('boot: client-mode loaded'); + else + { + try + { + (window as any).__nitroClientMode = JSON.parse(text); + } + catch + { + (window as any).__nitroClientMode = JSON5.parse(text); + } + } + setBootDebug(`boot: client-mode loaded (mode=${ mode })`); } catch(error) { diff --git a/vite.config.mjs b/vite.config.mjs index b8c3177..994cf7f 100644 --- a/vite.config.mjs +++ b/vite.config.mjs @@ -1,5 +1,5 @@ import react from '@vitejs/plugin-react'; -import { existsSync } from 'fs'; +import { existsSync, readFileSync } from 'fs'; import { resolve } from 'path'; import { defineConfig } from 'vite'; @@ -7,9 +7,34 @@ const legacyRendererRoot = resolve(__dirname, '..', 'renderer'); const currentRendererRoot = resolve(__dirname, '..', 'Nitro_Render_V3'); const rendererRoot = existsSync(currentRendererRoot) ? currentRendererRoot : legacyRendererRoot; +const resolveJsonMode = () => +{ + const envOverride = process.env.NITRO_JSON_MODE; + if(envOverride === 'legacy' || envOverride === 'json5' || envOverride === 'auto') return envOverride; + + const configFile = resolve(__dirname, '.nitro-build.json'); + if(existsSync(configFile)) + { + try + { + const parsed = JSON.parse(readFileSync(configFile, 'utf8')); + if(parsed?.jsonMode === 'legacy' || parsed?.jsonMode === 'json5' || parsed?.jsonMode === 'auto') return parsed.jsonMode; + } + catch {} + } + + return 'auto'; +}; + +const nitroJsonMode = resolveJsonMode(); +process.stdout.write(`[vite] __NITRO_JSON_MODE__ = ${ nitroJsonMode }\n`); + export default defineConfig({ base: process.env.VITE_BASE || './', plugins: [ react() ], + define: { + __NITRO_JSON_MODE__: JSON.stringify(nitroJsonMode) + }, server: { fs: { allow: [ @@ -29,6 +54,7 @@ export default defineConfig({ alias: { '@': resolve(__dirname, 'src'), '~': resolve(__dirname, 'node_modules'), + '@nitrots/nitro-renderer': resolve(rendererRoot, 'index.ts'), '@nitrots/api': resolve(rendererRoot, 'packages/api/src/index.ts'), '@nitrots/assets': resolve(rendererRoot, 'packages/assets/src/index.ts'), '@nitrots/avatar': resolve(rendererRoot, 'packages/avatar/src/index.ts'), From 0028b03b6a569f38ba1788633af4c51c41050397 Mon Sep 17 00:00:00 2001 From: medievalshell Date: Mon, 18 May 2026 20:54:29 +0200 Subject: [PATCH 3/5] feat: cross-platform installer with JSON-mode integration Adds install.bat / install.sh / install.mjs at the project root for a one-shot setup: prereqs check, renderer clone & link, dependency install, config copy, JSON parser mode selection, URL prompt with validation, and the production build. - install.bat / install.sh: thin OS-specific wrappers around install.mjs - install.mjs: 9-step installer with --help, --non-interactive, --skip-build/clone/link and per-URL override flags - new step 6 'Choose JSON parsing mode': prompts the operator (json5 recommended) or accepts --json-mode=json5|legacy|auto in CI; writes .nitro-build.json so the final 'yarn build' picks it up directly - summary now reports the selected JSON mode and its source - .gitattributes: force LF on install.sh / install.mjs so the shebang stays valid on Linux/macOS after a Windows checkout - install.sh marked executable in the index (100755) - README: new 'Quick install' section with interactive and CI usage, plus a complete --non-interactive example --- .gitattributes | 4 + README.md | 70 ++++++- install.bat | 2 + install.mjs | 556 +++++++++++++++++++++++++++++++++++++++++++++++++ install.sh | 4 + 5 files changed, 635 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 install.bat create mode 100644 install.mjs create mode 100755 install.sh diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..df6d9a0 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +install.sh text eol=lf +install.mjs text eol=lf +*.sh text eol=lf +*.bat text eol=crlf diff --git a/README.md b/README.md index 1b00a3d..05a93c7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,75 @@ - If using NodeJS < 18 remove `--openssl-legacy-provider` from the package.json scripts - [Yarn](https://yarnpkg.com/) `npm i yarn -g` -## Installation +## Quick install (recommended) + +The repository ships a cross-platform installer that performs the full setup +in one go: prerequisites check, renderer clone & link, dependency install, +config copy, JSON parsing mode selection, URL prompt with validation, and the +production build. + +After cloning Nitro V3, from its root run: + +``` +# Windows +install.bat + +# Linux / macOS +./install.sh +``` + +Both wrappers just exec `node install.mjs`, so you can also invoke it directly: + +``` +node install.mjs +``` + +The installer walks through these steps: + +``` +[1/9] Check prerequisites (node >= 18, yarn, git) +[2/9] Clone Nitro_Render_V3 +[3/9] Setup renderer (yarn install + yarn link) +[4/9] Setup client (yarn install + yarn link "@nitrots/nitro-renderer") +[5/9] Copy public/configuration/*.example -> *.json +[6/9] Choose JSON parsing mode (json5 recommended) -> writes .nitro-build.json +[7/9] Configure URLs (interactive, validated) +[8/9] Build (yarn build) +[9/9] Summary +``` + +### Headless / CI runs + +Every step can be driven from flags so the installer can be used in pipelines: + +``` +node install.mjs --non-interactive \ + --json-mode=json5 \ + --socket-url=wss://example.com/ws \ + --api-url=https://example.com \ + --asset-url=https://example.com/nitro-assets/ \ + --image-library-url=https://example.com/c_images \ + --hof-furni-url=https://example.com/hof_furni \ + --camera-url=https://example.com/camera \ + --thumbnails-url=https://example.com/thumbnails \ + --habbopages-url=/habbopages \ + --api-base-url=https://example.com \ + --plain-config-base-url=https://example.com/configuration \ + --plain-gamedata-base-url=https://example.com/gamedata \ + --skip-link +``` + +Useful workflow flags: + +- `--non-interactive` / `--skip-prompts` — keep example defaults unless a URL override is passed +- `--json-mode=` — pick the parser without the JSON mode prompt +- `--skip-build`, `--skip-clone`, `--skip-link` — re-runs without redoing those steps +- `--help` — full flag reference and per-key URL flags + +`install.mjs` is idempotent: re-running it keeps any `*.json` config files +that already exist and only patches the URL keys you pass on the CLI. + +## Installation (manual) - First you should open terminal and navigate to the folder where you want to clone Nitro and Nitro-Renderer - Clone Nitro (Expl. C:\Github\) diff --git a/install.bat b/install.bat new file mode 100644 index 0000000..46cbf0c --- /dev/null +++ b/install.bat @@ -0,0 +1,2 @@ +@echo off +node "%~dp0install.mjs" %* diff --git a/install.mjs b/install.mjs new file mode 100644 index 0000000..186b595 --- /dev/null +++ b/install.mjs @@ -0,0 +1,556 @@ +#!/usr/bin/env node +import { spawn } from 'node:child_process'; +import { copyFile, readFile, writeFile } from 'node:fs/promises'; +import { existsSync } from 'node:fs'; +import { dirname, join, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { platform } from 'node:os'; +import * as readline from 'node:readline/promises'; +import { stdin as input, stdout as output } from 'node:process'; + +const ROOT = dirname(fileURLToPath(import.meta.url)); +const RENDERER_REPO_URL = 'https://github.com/duckietm/Nitro_Render_V3.git'; +const RENDERER_DIR = resolve(ROOT, '..', 'Nitro_Render_V3'); +const CONFIG_DIR = join(ROOT, 'public', 'configuration'); +const NITRO_BUILD_FILE = join(ROOT, '.nitro-build.json'); +const IS_WINDOWS = platform() === 'win32'; +const MIN_NODE_MAJOR = 18; +const VALID_JSON_MODES = ['json5', 'legacy', 'auto']; +const DEFAULT_JSON_MODE = 'json5'; + +const KEY_SPECS = { + 'socket.url': { type: 'url', schemes: ['ws:', 'wss:'], flag: 'socket-url' }, + 'api.url': { type: 'url', schemes: ['http:', 'https:'], flag: 'api-url' }, + 'asset.url': { type: 'url', schemes: ['http:', 'https:'], flag: 'asset-url' }, + 'image.library.url': { type: 'url', schemes: ['http:', 'https:'], flag: 'image-library-url' }, + 'hof.furni.url': { type: 'url', schemes: ['http:', 'https:'], flag: 'hof-furni-url' }, + 'camera.url': { type: 'url', schemes: ['http:', 'https:'], flag: 'camera-url' }, + 'thumbnails.url': { type: 'url', schemes: ['http:', 'https:'], flag: 'thumbnails-url' }, + 'url.prefix': { type: 'pathOrUrl', schemes: ['http:', 'https:'], flag: 'url-prefix' }, + 'habbopages.url': { type: 'pathOrUrl', schemes: ['http:', 'https:'], flag: 'habbopages-url' }, + 'apiBaseUrl': { type: 'url', schemes: ['http:', 'https:'], flag: 'api-base-url' }, + 'plainConfigBaseUrl': { type: 'url', schemes: ['http:', 'https:'], flag: 'plain-config-base-url' }, + 'plainGamedataBaseUrl': { type: 'url', schemes: ['http:', 'https:'], flag: 'plain-gamedata-base-url' } +}; + +const FLAG_TO_KEY = Object.fromEntries( + Object.entries(KEY_SPECS).map(([key, spec]) => [spec.flag, key]) +); + +const CONFIG_FILES = [ + { + example: 'renderer-config.example', + target: 'renderer-config.json', + keys: ['socket.url', 'api.url', 'asset.url', 'image.library.url', 'hof.furni.url'] + }, + { + example: 'ui-config.example', + target: 'ui-config.json', + keys: ['camera.url', 'thumbnails.url', 'url.prefix', 'habbopages.url'] + }, + { + example: 'client-mode.example', + target: 'client-mode.json', + keys: ['apiBaseUrl', 'plainConfigBaseUrl', 'plainGamedataBaseUrl'] + } +]; + +const STEPS = [ + 'Check prerequisites', + 'Clone Nitro_Render_V3', + 'Setup renderer (yarn install + yarn link)', + 'Setup client (yarn install + yarn link)', + 'Copy config files', + 'Choose JSON parsing mode', + 'Configure URLs', + 'Build (yarn build)', + 'Summary' +]; + +let currentStep = 0; +let activeReadline = null; +const summary = { + rendererCloned: false, + rendererSkipped: false, + configsCreated: [], + configsKept: [], + configsPatched: [], + jsonMode: null, + jsonModeSource: null, + buildRan: false, + buildSkipped: false +}; + +const useColor = !process.env.NO_COLOR && process.stdout.isTTY; +const c = { + reset: useColor ? '\x1b[0m' : '', + bold: useColor ? '\x1b[1m' : '', + dim: useColor ? '\x1b[2m' : '', + red: useColor ? '\x1b[31m' : '', + green: useColor ? '\x1b[32m' : '', + yellow: useColor ? '\x1b[33m' : '', + cyan: useColor ? '\x1b[36m' : '' +}; + +function info(msg) { console.log(c.cyan + '[i]' + c.reset + ' ' + msg); } +function ok(msg) { console.log(c.green + '[+]' + c.reset + ' ' + msg); } +function warn(msg) { console.log(c.yellow + '[!]' + c.reset + ' ' + msg); } +function err(msg) { console.error(c.red + '[x]' + c.reset + ' ' + msg); } + +function step(label) { + currentStep += 1; + const sep = '----------------------------------------------------------------'; + console.log(''); + console.log(c.dim + sep + c.reset); + console.log(c.bold + '[' + currentStep + '/' + STEPS.length + '] ' + label + c.reset); + console.log(c.dim + sep + c.reset); +} + +function runShell(cmdString, cwd) { + return new Promise((resolveFn, rejectFn) => { + const child = spawn(cmdString, { shell: true, cwd, stdio: 'inherit' }); + child.on('error', e => rejectFn(new Error("'" + cmdString + "' (cwd: " + cwd + ") failed to start: " + e.message))); + child.on('exit', code => { + if (code === 0) resolveFn(); + else rejectFn(new Error("'" + cmdString + "' (cwd: " + cwd + ") exited with code " + code)); + }); + }); +} + +function runCapture(cmdString) { + return new Promise((resolveFn, rejectFn) => { + const child = spawn(cmdString, { shell: true, stdio: ['ignore', 'pipe', 'pipe'] }); + let stdout = ''; + let stderr = ''; + child.stdout.on('data', d => { stdout += d.toString(); }); + child.stderr.on('data', d => { stderr += d.toString(); }); + child.on('error', e => rejectFn(new Error("'" + cmdString + "' failed to start: " + e.message))); + child.on('exit', code => { + if (code === 0) resolveFn(stdout.trim()); + else rejectFn(new Error("'" + cmdString + "' exited with code " + code + (stderr ? ': ' + stderr.trim() : ''))); + }); + }); +} + +function validateValue(value, spec) { + if (value === '' || value === undefined || value === null) { + if (spec.type === 'pathOrUrl') return { valid: true }; + return { valid: false, error: 'value cannot be empty' }; + } + if (spec.type === 'pathOrUrl' && value.startsWith('/')) { + return { valid: true }; + } + let parsed; + try { + parsed = new URL(value); + } catch { + return { valid: false, error: 'not a valid URL' }; + } + if (spec.schemes.length > 0 && !spec.schemes.includes(parsed.protocol)) { + const allowed = spec.schemes.map(s => s.replace(':', '')).join(', '); + return { valid: false, error: 'scheme must be one of: ' + allowed }; + } + return { valid: true }; +} + +function parseArgs() { + const opts = { + interactive: true, + skipBuild: false, + skipClone: false, + skipLink: false, + help: false, + jsonMode: null, + urlOverrides: {} + }; + const builtinFlags = new Set([ + '--non-interactive', '--skip-prompts', + '--skip-build', '--skip-clone', '--skip-link', + '--help', '-h' + ]); + for (const arg of process.argv.slice(2)) { + if (builtinFlags.has(arg)) { + switch (arg) { + case '--non-interactive': + case '--skip-prompts': opts.interactive = false; break; + case '--skip-build': opts.skipBuild = true; break; + case '--skip-clone': opts.skipClone = true; break; + case '--skip-link': opts.skipLink = true; break; + case '--help': + case '-h': opts.help = true; break; + } + continue; + } + const eq = arg.indexOf('='); + if (arg.startsWith('--') && eq > 2) { + const flagName = arg.slice(2, eq); + const value = arg.slice(eq + 1); + if (flagName === 'json-mode') { + if (!VALID_JSON_MODES.includes(value)) { + warn('Invalid --json-mode=' + value + ' (expected: ' + VALID_JSON_MODES.join(', ') + '), ignored'); + continue; + } + opts.jsonMode = value; + continue; + } + const key = FLAG_TO_KEY[flagName]; + if (key) { + opts.urlOverrides[key] = value; + continue; + } + } + warn('Unknown flag: ' + arg + ' (ignored)'); + } + return opts; +} + +function printUsage() { + const flagList = Object.entries(KEY_SPECS) + .map(([key, spec]) => ' --' + spec.flag + '=' + ' '.repeat(Math.max(1, 32 - spec.flag.length)) + 'Set ' + key) + .join('\n'); + console.log([ + 'Nitro-V3 cross-platform installer', + '', + 'Usage: node install.mjs [flags]', + '', + 'Workflow flags:', + ' --non-interactive, --skip-prompts Keep default URLs unless overridden by --=', + ' --json-mode= Choose the JSON parsing mode without prompting', + ' --skip-build Skip the final yarn build', + ' --skip-clone Skip cloning Nitro_Render_V3', + ' --skip-link Skip yarn link calls (useful when re-running)', + ' --help, -h Show this help and exit', + '', + 'URL override flags (override interactive prompts; combine with --non-interactive for fully automated runs):', + flagList, + '', + 'Steps performed:', + ' 1. Check Node >= ' + MIN_NODE_MAJOR + ', yarn, git', + ' 2. Clone Nitro_Render_V3 to ../Nitro_Render_V3', + ' 3. yarn install + yarn link in the renderer', + ' 4. yarn install + yarn link "@nitrots/nitro-renderer" in this project', + ' 5. Copy public/configuration/*.example -> *.json (keeps existing files)', + ' 6. Choose JSON parsing mode (json5 recommended) -> writes .nitro-build.json', + ' 7. Prompt for URLs and patch the JSON config files', + ' 8. yarn build (honours the JSON mode chosen at step 6)', + '' + ].join('\n')); +} + +async function checkPrereqs() { + const nodeVer = process.versions.node; + const major = parseInt(nodeVer.split('.')[0], 10); + if (Number.isNaN(major) || major < MIN_NODE_MAJOR) { + throw new Error('Node >= ' + MIN_NODE_MAJOR + ' required (you have v' + nodeVer + '). Install from https://nodejs.org/'); + } + ok('Node v' + nodeVer); + + try { + const v = await runCapture('yarn --version'); + ok('yarn ' + v); + } catch { + const hint = IS_WINDOWS ? 'npm i -g yarn' : 'sudo npm i -g yarn'; + throw new Error('yarn not found on PATH. Install with: ' + hint); + } + + try { + const v = await runCapture('git --version'); + ok(v); + } catch { + const hint = IS_WINDOWS ? 'winget install Git.Git' : 'sudo apt-get install git (or your distro equivalent)'; + throw new Error('git not found on PATH. Install with: ' + hint); + } +} + +async function cloneRenderer(opts) { + if (opts.skipClone) { info('--skip-clone: not cloning Nitro_Render_V3'); summary.rendererSkipped = true; return; } + if (existsSync(RENDERER_DIR)) { + warn('Nitro_Render_V3 already exists at ' + RENDERER_DIR + ' - skipping clone (yarn install/link will still run).'); + summary.rendererSkipped = true; + return; + } + await runShell('git clone ' + RENDERER_REPO_URL + ' "' + RENDERER_DIR + '"', dirname(RENDERER_DIR)); + summary.rendererCloned = true; + ok('Cloned Nitro_Render_V3 to ' + RENDERER_DIR); +} + +async function setupRenderer(opts) { + if (!existsSync(RENDERER_DIR)) { + throw new Error('Renderer directory not found: ' + RENDERER_DIR + '. Re-run without --skip-clone or clone it manually.'); + } + await runShell('yarn install', RENDERER_DIR); + if (opts.skipLink) { info('--skip-link: skipping yarn link in renderer'); return; } + try { + await runShell('yarn link', RENDERER_DIR); + } catch (e) { + warn('yarn link in renderer failed (likely already linked): ' + e.message); + } +} + +async function setupClient(opts) { + await runShell('yarn install', ROOT); + if (opts.skipLink) { info('--skip-link: skipping yarn link in client'); return; } + try { + await runShell('yarn link "@nitrots/nitro-renderer"', ROOT); + } catch (e) { + warn('yarn link "@nitrots/nitro-renderer" failed (likely already linked): ' + e.message); + } +} + +async function writeJsonMode(mode) { + const payload = { jsonMode: mode, configuredAt: new Date().toISOString() }; + await writeFile(NITRO_BUILD_FILE, JSON.stringify(payload, null, 2) + '\n', 'utf8'); +} + +async function chooseJsonMode(opts) { + if (opts.jsonMode) { + await writeJsonMode(opts.jsonMode); + summary.jsonMode = opts.jsonMode; + summary.jsonModeSource = 'CLI (--json-mode)'; + ok('JSON mode set to ' + opts.jsonMode + ' (from --json-mode)'); + return; + } + + let existing = null; + if (existsSync(NITRO_BUILD_FILE)) { + try { + const raw = await readFile(NITRO_BUILD_FILE, 'utf8'); + const parsed = JSON.parse(raw); + if (VALID_JSON_MODES.includes(parsed?.jsonMode)) existing = parsed.jsonMode; + } catch {} + } + + if (!opts.interactive) { + const mode = existing || DEFAULT_JSON_MODE; + await writeJsonMode(mode); + summary.jsonMode = mode; + summary.jsonModeSource = existing ? 'existing .nitro-build.json' : 'default (non-interactive)'; + info('--non-interactive: JSON mode = ' + mode + (existing ? ' (preserved)' : ' (default)')); + return; + } + + info('Pick how configuration files (renderer-config, ui-config, gamedata) are parsed.'); + info(' 1) JSON5 (recommended - accepts comments, trailing commas, single quotes)'); + info(' 2) JSON (legacy strict - only standard JSON valid)'); + if (existing) info(' Current value in .nitro-build.json: ' + existing); + + const rl = readline.createInterface({ input, output }); + activeReadline = rl; + let chosen = null; + try { + while (chosen === null) { + const defaultLabel = existing || '1=JSON5'; + const answer = (await rl.question(' Choice [' + defaultLabel + ']: ')).trim().toLowerCase(); + if (answer.length === 0) { + chosen = existing || DEFAULT_JSON_MODE; + } else if (answer === '1' || answer === 'json5' || answer === 'y' || answer === 'yes') { + chosen = 'json5'; + } else if (answer === '2' || answer === 'json' || answer === 'legacy' || answer === 'n' || answer === 'no') { + chosen = 'legacy'; + } else if (answer === 'auto') { + chosen = 'auto'; + } else { + warn('Invalid choice. Enter 1, 2, json5, json, legacy, or auto.'); + } + } + } finally { + activeReadline = null; + rl.close(); + } + + await writeJsonMode(chosen); + summary.jsonMode = chosen; + summary.jsonModeSource = 'interactive prompt'; + ok('JSON mode set to ' + chosen + ' -> wrote .nitro-build.json'); + if (chosen === 'legacy') { + warn('Legacy mode is strict: config files must be valid standard JSON (no comments, no trailing commas).'); + } +} + +async function copyConfigs() { + for (const entry of CONFIG_FILES) { + const src = join(CONFIG_DIR, entry.example); + const dst = join(CONFIG_DIR, entry.target); + if (!existsSync(src)) { + throw new Error('Missing example file: ' + src); + } + if (existsSync(dst)) { + warn(entry.target + ' already exists - keeping existing file (URL overrides will still patch it).'); + summary.configsKept.push(entry.target); + } else { + await copyFile(src, dst); + ok('Created ' + entry.target); + summary.configsCreated.push(entry.target); + } + } +} + +async function applyOverridesNonInteractive(opts) { + for (const entry of CONFIG_FILES) { + const dst = join(CONFIG_DIR, entry.target); + const raw = await readFile(dst, 'utf8'); + let obj; + try { + obj = JSON.parse(raw); + } catch (e) { + throw new Error('Could not parse ' + entry.target + ' as JSON: ' + e.message); + } + let changed = false; + for (const key of entry.keys) { + if (Object.prototype.hasOwnProperty.call(opts.urlOverrides, key)) { + const value = opts.urlOverrides[key]; + const result = validateValue(value, KEY_SPECS[key]); + if (!result.valid) { + throw new Error('Invalid value for --' + KEY_SPECS[key].flag + '=' + JSON.stringify(value) + ': ' + result.error); + } + if (obj[key] !== value) { + obj[key] = value; + changed = true; + } + } + } + if (changed) { + await writeFile(dst, JSON.stringify(obj, null, 4) + '\n'); + ok('Updated ' + entry.target + ' (from CLI flags)'); + summary.configsPatched.push(entry.target); + } + } +} + +async function promptConfigs(opts) { + const overrideKeys = Object.keys(opts.urlOverrides); + if (!opts.interactive) { + if (overrideKeys.length > 0) { + info('--non-interactive with ' + overrideKeys.length + ' URL override(s); applying without prompts'); + await applyOverridesNonInteractive(opts); + } else { + info('--non-interactive: keeping URL values from .example defaults'); + } + return; + } + info('Press Enter to keep the current value shown in [brackets]. URLs are validated.'); + if (overrideKeys.length > 0) { + info('CLI overrides take precedence and skip prompts: ' + overrideKeys.map(k => '--' + KEY_SPECS[k].flag).join(', ')); + } + const rl = readline.createInterface({ input, output }); + activeReadline = rl; + try { + for (const entry of CONFIG_FILES) { + const dst = join(CONFIG_DIR, entry.target); + const raw = await readFile(dst, 'utf8'); + let obj; + try { + obj = JSON.parse(raw); + } catch (e) { + throw new Error('Could not parse ' + entry.target + ' as JSON: ' + e.message); + } + console.log('\n ' + c.bold + entry.target + c.reset); + let changed = false; + for (const key of entry.keys) { + const spec = KEY_SPECS[key]; + if (Object.prototype.hasOwnProperty.call(opts.urlOverrides, key)) { + const value = opts.urlOverrides[key]; + const result = validateValue(value, spec); + if (!result.valid) { + throw new Error('Invalid value for --' + spec.flag + '=' + JSON.stringify(value) + ': ' + result.error); + } + if (obj[key] !== value) { obj[key] = value; changed = true; } + console.log(' ' + c.dim + key + ' = ' + value + ' (from --' + spec.flag + ')' + c.reset); + continue; + } + const current = obj[key] === undefined ? '' : String(obj[key]); + while (true) { + const answer = await rl.question(' ' + key + ' [' + current + ']: '); + const trimmed = answer.trim(); + if (trimmed.length === 0) break; + if (trimmed === current) break; + const result = validateValue(trimmed, spec); + if (!result.valid) { + warn('Invalid: ' + result.error + '. Try again or press Enter to keep current.'); + continue; + } + obj[key] = trimmed; + changed = true; + break; + } + } + if (changed) { + await writeFile(dst, JSON.stringify(obj, null, 4) + '\n'); + ok('Updated ' + entry.target); + summary.configsPatched.push(entry.target); + } else { + info('No changes to ' + entry.target); + } + } + } finally { + activeReadline = null; + rl.close(); + } +} + +async function runBuild(opts) { + if (opts.skipBuild) { info('--skip-build: skipping yarn build'); summary.buildSkipped = true; return; } + await runShell('yarn build', ROOT); + summary.buildRan = true; +} + +function printSummary() { + const distPath = join(ROOT, 'dist'); + console.log(''); + console.log(c.bold + '================================================================' + c.reset); + console.log(c.bold + ' Installation summary' + c.reset); + console.log(c.bold + '================================================================' + c.reset); + console.log(' Renderer: ' + RENDERER_DIR + (summary.rendererCloned ? ' (cloned)' : ' (already present)')); + if (summary.configsCreated.length) console.log(' Created: ' + summary.configsCreated.join(', ')); + if (summary.configsKept.length) console.log(' Kept: ' + summary.configsKept.join(', ')); + if (summary.configsPatched.length) console.log(' Patched: ' + summary.configsPatched.join(', ')); + if (summary.jsonMode) console.log(' JSON mode: ' + summary.jsonMode + (summary.jsonModeSource ? ' (' + summary.jsonModeSource + ')' : '')); + if (summary.buildRan) console.log(' Build: ' + c.green + 'OK' + c.reset + ' -> ' + distPath); + else if (summary.buildSkipped) console.log(' Build: skipped'); + console.log(''); + console.log(' Next steps:'); + console.log(' - Development: yarn start'); + if (summary.buildRan) { + console.log(' - Production: deploy the contents of ' + distPath + ' to your webserver'); + } else { + console.log(' - Production: yarn build, then deploy ' + distPath); + } + console.log(c.bold + '================================================================' + c.reset); +} + +async function main() { + const opts = parseArgs(); + if (opts.help) { printUsage(); process.exit(0); } + + console.log(c.bold + 'Nitro-V3 installer' + c.reset + ' (' + (IS_WINDOWS ? 'Windows' : platform()) + ')'); + console.log('Project root: ' + ROOT); + + step(STEPS[0]); await checkPrereqs(); + step(STEPS[1]); await cloneRenderer(opts); + step(STEPS[2]); await setupRenderer(opts); + step(STEPS[3]); await setupClient(opts); + step(STEPS[4]); await copyConfigs(); + step(STEPS[5]); await chooseJsonMode(opts); + step(STEPS[6]); await promptConfigs(opts); + step(STEPS[7]); await runBuild(opts); + step(STEPS[8]); printSummary(); +} + +process.on('SIGINT', () => { + if (activeReadline) { + try { activeReadline.close(); } catch {} + activeReadline = null; + } + const label = STEPS[currentStep - 1] || 'startup'; + console.error(''); + warn('Aborted at step ' + currentStep + ' (' + label + ')'); + process.exit(130); +}); + +main().catch(e => { + const label = STEPS[currentStep - 1] || 'startup'; + err(''); + err('Step ' + currentStep + ' (' + label + ') failed:'); + err(' ' + e.message); + process.exit(1); +}); diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..e75c44b --- /dev/null +++ b/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e +DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +exec node "$DIR/install.mjs" "$@" From 8200132b1fe8396d04a895314896cb6b3114ca7a Mon Sep 17 00:00:00 2001 From: medievalshell Date: Mon, 18 May 2026 21:20:13 +0200 Subject: [PATCH 4/5] feat(scripts): add split-gamedata.mjs CLI splitter Companion tool for the split-aware gamedata loader added in @nitrots/utils. Takes a legacy single-file gamedata JSON/JSON5 and produces the directory layout the loader expects: / manifest.json5 (root manifest, tier order) core/ manifest.json5 (file list in load order) .json5 ... The tool auto-detects the gamedata type from top-level keys and applies the right split strategy: - EffectMap -> one file per effect type (dance, fx, ...) - FigureData -> palettes + one file per setType - FigureMap -> chunked libraries (default 500/file) - FurnitureData -> floor/wall, chunks of furnitype (default 300) - HabboAvatarActions -> grouped by state - ProductData -> chunked products (default 500) - ExternalTexts/UITexts-> grouped by key prefix Only the core/ tier is generated; custom/ and seasonal/ are operator- owned and the loader auto-discovers them when their manifest.json5 exists. Flags: --input, --output, --type, --chunk-size, --json (legacy emit), --force, --help. README extended with a 'Splitting gamedata' section covering the layout, the strategy table, CLI usage and the renderer-config migration step. --- README.md | 88 +++++++++ scripts/split-gamedata.mjs | 357 +++++++++++++++++++++++++++++++++++++ 2 files changed, 445 insertions(+) create mode 100644 scripts/split-gamedata.mjs diff --git a/README.md b/README.md index 05a93c7..cbfe365 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,94 @@ Useful workflow flags: `install.mjs` is idempotent: re-running it keeps any `*.json` config files that already exist and only patches the URL keys you pass on the CLI. +## Splitting gamedata + +The renderer can load gamedata files (FigureData, FurnitureData, FigureMap, +EffectMap, ProductData, HabboAvatarActions, ExternalTexts, UITexts) either as +a single legacy JSON/JSON5 file or as a **directory of small files** organised +in three tiers: `core/` (vendor baseline), `custom/` (your additions / overrides), +`seasonal/` (date-bound content such as Christmas or Easter). + +The split layout is much easier to maintain — you edit a small focused file +instead of a 43 MB FurnitureData.json — and lets you keep vendor and operator +content cleanly separated. + +### Directory layout + +``` +nitro-assets/gamedata/furnidata/ + manifest.json5 # { "tiers": ["core", "custom", "seasonal"] } + core/ + manifest.json5 # { "files": ["floor-001.json5", ..., "wall-001.json5"] } + floor-001.json5 + floor-002.json5 + wall-001.json5 + custom/ # OPTIONAL — created by you + manifest.json5 # { "files": ["my-rares.json5"] } + my-rares.json5 + seasonal/ # OPTIONAL — created by you + manifest.json5 + xmas-2026.json5 +``` + +Each tier is loaded in order. Within a tier, files load in the order listed in +its `manifest.json5`. Items in later layers override items in earlier layers +when they share the same identifier (`id`, `classname`, `name`, or the +top-level key for flat dictionaries). + +### Generating the `core/` tier from a legacy file + +Use the bundled CLI splitter: + +``` +node scripts/split-gamedata.mjs \ + --input ~/legacy-gamedata/FurnitureData.json \ + --output ~/nitro-assets/gamedata/furnidata +``` + +It auto-detects the gamedata type from the file's top-level keys and applies +the strategy that makes the most sense: + +| Type | Split strategy | +|----------------------|---------------------------------------------| +| EffectMap | one file per effect `type` (dance, fx, ...) | +| FigureData | one `palettes.json5` + one file per setType | +| FigureMap | chunks of `libraries` (default 500/file) | +| FurnitureData | floor / wall, chunks of `furnitype` (300) | +| HabboAvatarActions | grouped by `state` (or single file if ≤1) | +| ProductData | chunks of products (default 500) | +| ExternalTexts/UITexts| grouped by key prefix (e.g. `gamecenter.*`) | + +Useful flags: `--type=` to force the type, `--chunk-size=N` to override +the default chunk size, `--json` to emit standard JSON instead of JSON5, +`--force` to overwrite an existing output directory. Full reference: + +``` +node scripts/split-gamedata.mjs --help +``` + +We only ship the `core/` tier with vendor baselines — `custom/` and `seasonal/` +are operator-owned: create their manifests when you need them and the loader +picks them up automatically. + +### Pointing the renderer at a directory + +In `public/configuration/renderer-config.json`, replace the legacy file URL +with the directory URL (note the trailing slash — that's how the loader +detects split mode): + +```json5 +{ + // single file (legacy, still supported): + "furnidata.url": "https://example.com/nitro-assets/gamedata/FurnitureData.json", + + // directory (split mode): + "furnidata.url": "https://example.com/nitro-assets/gamedata/furnidata/", +} +``` + +Both styles work; you can migrate one gamedata file at a time. + ## Installation (manual) - First you should open terminal and navigate to the folder where you want to clone Nitro and Nitro-Renderer diff --git a/scripts/split-gamedata.mjs b/scripts/split-gamedata.mjs new file mode 100644 index 0000000..efeef7f --- /dev/null +++ b/scripts/split-gamedata.mjs @@ -0,0 +1,357 @@ +#!/usr/bin/env node +import { existsSync, mkdirSync, readFileSync, writeFileSync, rmSync } from 'node:fs'; +import { dirname, basename, resolve, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const HELP = ` +Nitro V3 — gamedata splitter + +Takes a legacy single-file gamedata JSON (EffectMap, FigureData, FigureMap, +FurnitureData, HabboAvatarActions, ProductData, ExternalTexts, UITexts) and +produces the directory layout consumed by the split-aware loader: + + / + manifest.json5 tier order (defaults to core/custom/seasonal) + core/ + manifest.json5 files list, in load order + .json5 + .json5 + ... + +Custom and seasonal tiers are NOT generated — those are operator-owned and +will be auto-discovered by the loader if their manifest.json5 exists. + +Usage: + node scripts/split-gamedata.mjs --input --output [flags] + +Required: + --input Path to the legacy JSON (or JSON5) file + --output Target directory (will contain core/, manifest.json5) + +Optional: + --type Force the gamedata type (effectmap, figuredata, + figuremap, furnidata, avatar-actions, productdata, + external-texts, ui-texts). Default: auto-detect + --chunk-size Items per chunk for the bucket-based splits. + Defaults: figuremap=500, furnidata=300, productdata=500, + external-texts/ui-texts split by prefix instead + --json (or --legacy) Emit standard JSON instead of JSON5 (no comments) + --force Overwrite the output directory if it already exists + --help, -h Show this help + +Examples: + node scripts/split-gamedata.mjs \\ + --input ~/gamedata/FurnitureData.json \\ + --output ~/nitro-assets/gamedata/furnidata + + node scripts/split-gamedata.mjs \\ + --input ./EffectMap.json --output ./effectmap --chunk-size 50 + +After splitting, point your renderer-config at the directory (note the +trailing slash): + + "furnidata.url": "https://example.com/nitro-assets/gamedata/furnidata/" +`; + +const args = process.argv.slice(2); +const opts = { + input: null, + output: null, + type: null, + chunkSize: null, + asJson5: true, + force: false, + help: false +}; + +for (let i = 0; i < args.length; i++) { + const a = args[i]; + if (a === '--help' || a === '-h') opts.help = true; + else if (a === '--input') opts.input = args[++i]; + else if (a === '--output') opts.output = args[++i]; + else if (a === '--type') opts.type = args[++i]; + else if (a === '--chunk-size') opts.chunkSize = parseInt(args[++i], 10); + else if (a === '--json' || a === '--legacy') opts.asJson5 = false; + else if (a === '--json5') opts.asJson5 = true; + else if (a === '--force') opts.force = true; + else if (a.startsWith('--input=')) opts.input = a.slice('--input='.length); + else if (a.startsWith('--output=')) opts.output = a.slice('--output='.length); + else if (a.startsWith('--type=')) opts.type = a.slice('--type='.length); + else if (a.startsWith('--chunk-size=')) opts.chunkSize = parseInt(a.slice('--chunk-size='.length), 10); + else { + process.stderr.write(`Unknown flag: ${ a }\n`); + process.exit(2); + } +} + +if (opts.help) { + process.stdout.write(HELP); + process.exit(0); +} + +if (!opts.input || !opts.output) { + process.stderr.write('Missing --input or --output. Use --help for usage.\n'); + process.exit(2); +} + +if (!existsSync(opts.input)) { + process.stderr.write(`Input file not found: ${ opts.input }\n`); + process.exit(1); +} + +const detectType = (data) => { + if (!data || typeof data !== 'object') return null; + const keys = new Set(Object.keys(data)); + if (keys.has('roomitemtypes') || keys.has('wallitemtypes')) return 'furnidata'; + if (keys.has('palettes') && keys.has('setTypes')) return 'figuredata'; + if (keys.has('libraries')) return 'figuremap'; + if (keys.has('effects')) return 'effectmap'; + if (keys.has('actions')) return 'avatar-actions'; + if (keys.has('productdata')) return 'productdata'; + // Flat dict heuristic: many top-level scalar keys with dots → texts + if (keys.size > 30 && Object.values(data).every(v => typeof v === 'string')) { + const sampleKey = Object.keys(data)[0] || ''; + return sampleKey.includes('.') ? 'external-texts' : 'ui-texts'; + } + return null; +}; + +const splitArrayInChunks = (arr, size) => { + const chunks = []; + for (let i = 0; i < arr.length; i += size) chunks.push(arr.slice(i, i + size)); + return chunks; +}; + +const splitByPrefix = (dict, maxPerBucket = 800) => { + const buckets = new Map(); + for (const key of Object.keys(dict)) { + const prefix = key.split('.')[0] || '_other'; + if (!buckets.has(prefix)) buckets.set(prefix, {}); + buckets.get(prefix)[key] = dict[key]; + } + // Merge small buckets into a shared one to reduce manifest noise + const out = []; + const small = {}; + let smallCount = 0; + for (const [name, content] of buckets) { + const size = Object.keys(content).length; + if (size < 50) { + Object.assign(small, content); + smallCount += size; + } else { + // split further if oversized + if (size > maxPerBucket) { + const entries = Object.entries(content); + const slices = splitArrayInChunks(entries, maxPerBucket); + slices.forEach((slice, idx) => { + const part = {}; + for (const [k, v] of slice) part[k] = v; + out.push([ `${ name }-${ String(idx + 1).padStart(3, '0') }`, part ]); + }); + } else { + out.push([ name, content ]); + } + } + } + if (smallCount > 0) out.push([ '_misc', small ]); + return out; +}; + +const sanitizeName = (name) => name.replace(/[^a-zA-Z0-9_-]/g, '_').toLowerCase(); + +const ext = () => opts.asJson5 ? 'json5' : 'json'; + +const writePart = (filePath, data, headerComment) => { + const body = JSON.stringify(data, null, 4); + const out = opts.asJson5 && headerComment + ? `// ${ headerComment }\n${ body }\n` + : `${ body }\n`; + writeFileSync(filePath, out, 'utf8'); +}; + +const buildSplits = (type, data) => { + switch (type) { + case 'effectmap': { + const effects = data.effects || []; + const byType = new Map(); + for (const e of effects) { + const t = sanitizeName(e.type || 'other'); + if (!byType.has(t)) byType.set(t, []); + byType.get(t).push(e); + } + return Array.from(byType, ([ t, items ]) => ({ + name: `effects-${ t }.${ ext() }`, + comment: `Effects of type "${ t }" (${ items.length } items)`, + content: { effects: items } + })); + } + case 'figuredata': { + const parts = []; + if (data.palettes?.length) { + parts.push({ + name: `palettes.${ ext() }`, + comment: `Color palettes (${ data.palettes.length })`, + content: { palettes: data.palettes } + }); + } + for (const st of (data.setTypes || [])) { + const t = sanitizeName(st.type); + parts.push({ + name: `settype-${ t }.${ ext() }`, + comment: `setType "${ st.type }" (paletteId=${ st.paletteId })`, + content: { setTypes: [ st ] } + }); + } + return parts; + } + case 'figuremap': { + const libs = data.libraries || []; + const size = opts.chunkSize || 500; + const chunks = splitArrayInChunks(libs, size); + return chunks.map((chunk, idx) => ({ + name: `libraries-${ String(idx + 1).padStart(3, '0') }.${ ext() }`, + comment: `libraries ${ idx * size + 1 }..${ idx * size + chunk.length } of ${ libs.length }`, + content: { libraries: chunk } + })); + } + case 'furnidata': { + const parts = []; + const size = opts.chunkSize || 300; + const floor = data.roomitemtypes?.furnitype || []; + const wall = data.wallitemtypes?.furnitype || []; + const floorChunks = splitArrayInChunks(floor, size); + floorChunks.forEach((chunk, idx) => { + parts.push({ + name: `floor-${ String(idx + 1).padStart(3, '0') }.${ ext() }`, + comment: `Floor furniture ${ idx * size + 1 }..${ idx * size + chunk.length } of ${ floor.length }`, + content: { roomitemtypes: { furnitype: chunk } } + }); + }); + const wallChunks = splitArrayInChunks(wall, size); + wallChunks.forEach((chunk, idx) => { + parts.push({ + name: `wall-${ String(idx + 1).padStart(3, '0') }.${ ext() }`, + comment: `Wall furniture ${ idx * size + 1 }..${ idx * size + chunk.length } of ${ wall.length }`, + content: { wallitemtypes: { furnitype: chunk } } + }); + }); + return parts; + } + case 'avatar-actions': { + const actions = data.actions || []; + const byState = new Map(); + for (const a of actions) { + const s = sanitizeName(a.state || 'other'); + if (!byState.has(s)) byState.set(s, []); + byState.get(s).push(a); + } + if (byState.size <= 1) { + return [ { + name: `actions.${ ext() }`, + comment: `All avatar actions (${ actions.length })`, + content: { actions } + } ]; + } + return Array.from(byState, ([ s, items ]) => ({ + name: `actions-${ s }.${ ext() }`, + comment: `Actions in state "${ s }" (${ items.length })`, + content: { actions: items } + })); + } + case 'productdata': { + const products = data.productdata?.product || []; + const size = opts.chunkSize || 500; + const chunks = splitArrayInChunks(products, size); + return chunks.map((chunk, idx) => ({ + name: `products-${ String(idx + 1).padStart(3, '0') }.${ ext() }`, + comment: `Products ${ idx * size + 1 }..${ idx * size + chunk.length } of ${ products.length }`, + content: { productdata: { product: chunk } } + })); + } + case 'external-texts': + case 'ui-texts': { + const buckets = splitByPrefix(data, opts.chunkSize || 800); + return buckets.map(([ name, content ]) => ({ + name: `${ sanitizeName(name) }.${ ext() }`, + comment: `${ name } (${ Object.keys(content).length } keys)`, + content + })); + } + default: + throw new Error(`Unknown gamedata type: ${ type }. Use --type to force one.`); + } +}; + +const main = () => { + const raw = readFileSync(opts.input, 'utf8'); + + let data; + try { + data = JSON.parse(raw); + } catch { + try { + const JSON5 = require('json5'); + data = JSON5.parse(raw); + } catch (e) { + process.stderr.write(`Could not parse ${ opts.input } as JSON nor JSON5: ${ e.message }\n`); + process.exit(1); + } + } + + const type = opts.type || detectType(data); + if (!type) { + process.stderr.write('Could not auto-detect gamedata type. Pass --type=. See --help.\n'); + process.exit(1); + } + + const outDir = resolve(opts.output); + const coreDir = join(outDir, 'core'); + + if (existsSync(outDir)) { + if (!opts.force) { + process.stderr.write(`Output directory already exists: ${ outDir }. Use --force to overwrite.\n`); + process.exit(1); + } + rmSync(outDir, { recursive: true, force: true }); + } + mkdirSync(coreDir, { recursive: true }); + + const parts = buildSplits(type, data); + if (!parts.length) { + process.stderr.write(`No content produced for type ${ type }. Input may be empty.\n`); + process.exit(1); + } + + for (const part of parts) { + writePart(join(coreDir, part.name), part.content, part.comment); + } + + const coreManifest = { + files: parts.map(p => p.name) + }; + const coreManifestBody = opts.asJson5 + ? `// Auto-generated by split-gamedata.mjs from ${ basename(opts.input) }\n// Type: ${ type } — ${ parts.length } files, ${ parts.reduce((n, p) => n + JSON.stringify(p.content).length, 0).toLocaleString() } chars total\n${ JSON.stringify(coreManifest, null, 4) }\n` + : `${ JSON.stringify(coreManifest, null, 4) }\n`; + writeFileSync(join(coreDir, `manifest.${ ext() }`), coreManifestBody, 'utf8'); + + const rootManifest = { tiers: [ 'core', 'custom', 'seasonal' ] }; + const rootManifestBody = opts.asJson5 + ? `// Root manifest — load order of tiers (later overrides earlier by id/classname).\n// Drop a custom/manifest.${ ext() } and/or seasonal/manifest.${ ext() } to add\n// override tiers without touching core/.\n${ JSON.stringify(rootManifest, null, 4) }\n` + : `${ JSON.stringify(rootManifest, null, 4) }\n`; + writeFileSync(join(outDir, `manifest.${ ext() }`), rootManifestBody, 'utf8'); + + process.stdout.write([ + `[split-gamedata] ${ type } -> ${ outDir }`, + ` ${ parts.length } file(s) in core/`, + ` tiers: core (always loaded), custom (optional), seasonal (optional)`, + ` point renderer-config at: ${ outDir.replace(/\\/g, '/') }/`, + '' + ].join('\n')); +}; + +try { + main(); +} catch (e) { + process.stderr.write(`[split-gamedata] ${ e.message }\n`); + process.exit(1); +} From 53b208e7b00a1f2d92650f5d963ba603331dfb0e Mon Sep 17 00:00:00 2001 From: duckietm Date: Tue, 19 May 2026 10:28:09 +0200 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=86=99=20IT=20=3D=3D>=20ENG=20and=20R?= =?UTF-8?q?emove=20the=20base=20path=20(this=20should=20a=20user=20do=20ma?= =?UTF-8?q?nual)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- scripts/configure-json.mjs | 46 ++++++++++++-------------------------- 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 3aaca07..cc82251 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "configure": "node scripts/configure-json.mjs", "prestart": "node scripts/configure-json.mjs --if-missing", "prebuild": "node scripts/configure-json.mjs --if-missing && node scripts/write-asset-loader.mjs", - "start": "vite --base=/nitro/ --host", - "build": "vite build --base=/nitro/ && node scripts/minify-dist.mjs", + "start": "vite --host", + "build": "vite build && node scripts/minify-dist.mjs", "build:prod": "npx browserslist@latest --update-db && yarn build", "eslint": "eslint ./src" }, diff --git a/scripts/configure-json.mjs b/scripts/configure-json.mjs index 6dfa846..5677096 100644 --- a/scripts/configure-json.mjs +++ b/scripts/configure-json.mjs @@ -3,21 +3,17 @@ import { existsSync, readFileSync, writeFileSync } from 'fs'; import { resolve } from 'path'; import { fileURLToPath } from 'url'; import readline from 'readline'; - const SCRIPT_DIR = fileURLToPath(new URL('.', import.meta.url)); const PROJECT_ROOT = resolve(SCRIPT_DIR, '..'); const CONFIG_FILE = resolve(PROJECT_ROOT, '.nitro-build.json'); const VALID_MODES = new Set(['legacy', 'json5']); const DEFAULT_MODE = 'json5'; - const args = process.argv.slice(2); const ifMissing = args.includes('--if-missing'); const nonInteractive = args.includes('--non-interactive') || !process.stdin.isTTY; - const readExisting = () => { if(!existsSync(CONFIG_FILE)) return null; - try { const raw = readFileSync(CONFIG_FILE, 'utf8'); @@ -25,10 +21,8 @@ const readExisting = () => if(parsed && VALID_MODES.has(parsed.jsonMode)) return parsed; } catch {} - return null; }; - const writeChoice = (mode) => { const payload = { @@ -37,16 +31,14 @@ const writeChoice = (mode) => }; writeFileSync(CONFIG_FILE, `${ JSON.stringify(payload, null, 2) }\n`, 'utf8'); }; - const printBanner = () => { const line = '═'.repeat(60); process.stdout.write(`\n${ line }\n Nitro V3 — JSON mode configuration\n${ line }\n\n`); - process.stdout.write('I file di configurazione (renderer-config, ui-config, gamedata)\npossono essere parsati in due modi:\n\n'); - process.stdout.write(' 1) JSON5 (consigliato — accetta commenti, trailing comma,\n single quote, identifier non quotati)\n'); - process.stdout.write(' 2) JSON (legacy strict — solo JSON valido standard)\n\n'); + process.stdout.write('Configuration files (renderer-config, ui-config, gamedata)\ncan be parsed in two ways:\n\n'); + process.stdout.write(' 1) JSON5 (recommended — accepts comments, trailing commas,\n single quotes, unquoted identifiers)\n'); + process.stdout.write(' 2) JSON (legacy strict — only standard valid JSON)\n\n'); }; - const normalizeAnswer = (raw) => { const v = (raw || '').trim().toLowerCase(); @@ -54,67 +46,57 @@ const normalizeAnswer = (raw) => if(v === '2' || v === 'json' || v === 'legacy' || v === 'n' || v === 'no') return 'legacy'; return null; }; - const promptUser = () => new Promise(resolveFn => { const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); - const ask = () => { - rl.question('Scelta [1=JSON5]: ', answer => + rl.question('Choice [1=JSON5]: ', answer => { const normalized = normalizeAnswer(answer); if(normalized === null) { - process.stdout.write(' ↳ Risposta non valida. Inserisci 1, 2, json5 o json.\n'); + process.stdout.write(' ↳ Invalid response. Please enter 1, 2, json5 or json.\n'); return ask(); } rl.close(); resolveFn(normalized); }); }; - ask(); }); - const main = async () => { const existing = readExisting(); - if(ifMissing && existing) { - process.stdout.write(`[configure-json] modalità già configurata: ${ existing.jsonMode } (skip)\n`); + process.stdout.write(`[configure-json] mode already configured: ${ existing.jsonMode } (skip)\n`); return; } - if(nonInteractive) { const mode = existing?.jsonMode || DEFAULT_MODE; writeChoice(mode); - process.stdout.write(`[configure-json] non interattivo — salvato: ${ mode }\n`); + process.stdout.write(`[configure-json] non-interactive — saved: ${ mode }\n`); return; } - printBanner(); - if(existing) process.stdout.write(`Modalità corrente: ${ existing.jsonMode }\n\n`); - + if(existing) process.stdout.write(`Current mode: ${ existing.jsonMode }\n\n`); const choice = await promptUser(); writeChoice(choice); - - process.stdout.write(`\n✓ Salvato in .nitro-build.json — modalità: ${ choice }\n`); + process.stdout.write(`\n✓ Saved to .nitro-build.json — mode: ${ choice }\n`); if(choice === 'legacy') { - process.stdout.write(' Attenzione: i file di config devono essere JSON valido stretto\n (no commenti, no trailing comma).\n'); + process.stdout.write(' Warning: config files must be strict valid JSON\n (no comments, no trailing commas).\n'); } else { - process.stdout.write(' JSON5 attivo: puoi usare commenti, trailing comma e single quote\n nei file di configurazione.\n'); + process.stdout.write(' JSON5 active: you can use comments, trailing commas and single quotes\n in configuration files.\n'); } - process.stdout.write('\n Per cambiare modalità in futuro: yarn configure\n\n'); + process.stdout.write('\n To change mode in the future: yarn configure\n\n'); }; - main().catch(err => { - process.stderr.write(`[configure-json] errore: ${ err?.message || err }\n`); + process.stderr.write(`[configure-json] error: ${ err?.message || err }\n`); process.exit(1); -}); +}); \ No newline at end of file