diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 308220a04..b42824baa 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,4 +1,4 @@ -# Initial `make format` with Rome +# Initial `make format` with Rome (Biome) 5d4256efc96914b52c2bc98504a8e26ba68dbc36 # `make format` for Rome v0.10.1-next 4b8891790c651de031d8a35dd7687f59db5e84e2 diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f62738a7b..d56b0c23b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,7 +16,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - uses: rome/setup-rome@v0.4 + - uses: rome/setup-rome@v0.4 # TODO(https://github.com/cubing/cubing.js/issues/290) with: version: latest - run: npm ci diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 067d1987a..6c16e8f73 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,6 @@ { "recommendations": [ - "rome.rome" + "biomejs.biome" ], "unwantedRecommendations": [ "ms-vscode-remote.remote-containers" diff --git a/.vscode/settings.json b/.vscode/settings.json index f8612a114..eab013c45 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,9 @@ { "typescript.tsdk": "node_modules/typescript/lib", - "editor.defaultFormatter": "rome.rome", + "editor.defaultFormatter": "biomejs.biome", "[typescript]": { - "editor.defaultFormatter": "rome.rome" + "editor.defaultFormatter": "biomejs.biome" }, - "rome.lspBin": "./node_modules/.bin/rome", "[jsonc]": { "editor.defaultFormatter": "vscode.json-language-features" } diff --git a/Makefile b/Makefile index ae6240bf4..e2686e8ad 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # TODO: see if we can make everything compatible with `bun` NODE=node -ROME=./node_modules/.bin/rome +BIOME=npx @biomejs/biome WEB_TEST_RUNNER=./node_modules/.bin/wtr .PHONY: default @@ -159,7 +159,7 @@ test-dist-sites-experiments: build-sites ${NODE} ./script/test/dist/experiments/main.js .PHONY: format format: - ${ROME} format --write ./script ./src + ${BIOME} format --write ./script ./src .PHONY: setup setup: npm ci @@ -167,10 +167,10 @@ setup: quick-setup: | node_modules .PHONY: lint lint: - ${ROME} check ./script ./src + ${BIOME} check ./script ./src .PHONY: lint-ci lint-ci: - ${ROME} ci ./script ./src + ${BIOME} ci ./script ./src .PHONY: prepack prepack: clean build test-dist-esm-node-import test-dist-esm-plain-esbuild-compat .PHONY: prepublishOnly diff --git a/rome.json b/biome.json similarity index 91% rename from rome.json rename to biome.json index 43fa93bf1..4b0c41d71 100644 --- a/rome.json +++ b/biome.json @@ -4,6 +4,9 @@ "rules": { "recommended": true, "nursery": {}, + "complexity": { + "useLiteralKeys": "off" + }, "correctness": { "noUnreachableSuper": "off" }, @@ -41,5 +44,8 @@ "./src/sites/experiments.cubing.net/cubing.js/rust/wasm/*.js", "./src/sites/experiments.cubing.net/cubing.js/rust/wasm/*.d.ts" ] + }, + "organizeImports": { + "enabled": false } } diff --git a/package-lock.json b/package-lock.json index 6fa870e18..8682c65ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "three": "^0.150.1" }, "devDependencies": { + "@biomejs/biome": "^1.0.0", "@esm-bundle/chai": "^4.3.4-fix.0", "@types/chai": "^4.3.4", "@types/dom-speech-recognition": "^0.0.1", @@ -34,7 +35,6 @@ "node-fetch": "^3.3.1", "peggy": "^3.0.1", "playwright": "^1.31.2", - "rome": "^12.1.3-nightly.50eb45f", "tsup": "^6.7.0", "typedoc": "^0.23.28", "typescript": "^5.0.2", @@ -79,6 +79,123 @@ "node": ">=6.9.0" } }, + "node_modules/@biomejs/biome": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.0.0.tgz", + "integrity": "sha512-Y5CND1QZ5pF6hc4dFw5ItDutv9KJO91ksLdBIFyvHL7LmXN0UomqyyRWryvrqq+YlA8Q58cR6sqjjQuMp9E2Ig==", + "dev": true, + "hasInstallScript": true, + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.*" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.0.0", + "@biomejs/cli-darwin-x64": "1.0.0", + "@biomejs/cli-linux-arm64": "1.0.0", + "@biomejs/cli-linux-x64": "1.0.0", + "@biomejs/cli-win32-arm64": "1.0.0", + "@biomejs/cli-win32-x64": "1.0.0" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.0.0.tgz", + "integrity": "sha512-3v7kEyxkf3D246esH+q/lDK5wWn+xLCXZpHCuc1itAmC35GkEc6S7um6C1VD3XKXLx6N0sJR/rTmjKiRGV32Ig==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.0.0.tgz", + "integrity": "sha512-uxIMt/X7TQWicjsImkqMvUUEqaFZTOJJrtEhlHl/eIaETWJmK3uAR7ihIWctpGJnN16sUgpLgwczc7FETqu/PQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.0.0.tgz", + "integrity": "sha512-kJWtu3Xr4MdHV2Yn4U+eZudAGPgv0kRCjWAyzLRewJiqE5TLPrX08imB9SU1n3+VxNO8e2JJ0tWWBHo4J+aSEg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.0.0.tgz", + "integrity": "sha512-FK6hYZ0Lkk39eXYx1+2ZWtLkApc0RdOpcjDVM96JbvI0bxqvNnm193BPXuxh5A/fCl6N28RNUvcKnZ5LbgZ0Yw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.0.0.tgz", + "integrity": "sha512-kE+OY2isEJHBodiLPMlybZckHkl3CQWsvXuJEvSxkoMhLbGDPEV3yZ/0lEph3BlxP3KP5vUO3hOFGaTvHFOuqQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.0.0.tgz", + "integrity": "sha512-Ko6ZsbmbScPMEnh/xz4mwDSCZIUCAEjbbbnUVApgAAL2+1Hoe7Vnhh2RiwYRqy3tHrBIMDwXkSxj0vlf1G3EHg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.*" + } + }, "node_modules/@esbuild/android-arm": { "version": "0.19.2", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.2.tgz", @@ -543,84 +660,6 @@ "rollup": "^1.20.0||^2.0.0" } }, - "node_modules/@rometools/cli-darwin-arm64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-Dkink1NkKjE6tahQYWcuxdulQpQjIH5d3t2P+yTjLgovOV/JRWnx0dy1Dh0yaKKlFwa+oldFmRdU++Y3bdTNuQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rometools/cli-darwin-x64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-x64/-/cli-darwin-x64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-ujRlaslCUUveRoQY/8BZy/l4wC/diPZTgyg2Bx/Xz6LWj8x0GrovB29KG/FT7vnMsPDQ0P4zNOnD8Sw3ef820A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rometools/cli-linux-arm64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-linux-arm64/-/cli-linux-arm64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-jjPhONj1KhQFIff1QYLNF6LDJ96MHjzmWdhdcpJrR63qnGfNoGjX2xwRMFeFBxSMoqbBbT/Xb641/JB9djdexw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rometools/cli-linux-x64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-linux-x64/-/cli-linux-x64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-QhBc0Q8ZoRlxKr4orCmCbSmNZLEiMa/+anU89DGrC6ysbYTickajsMurZcr2tVa3LHeC3+rcqcTM6+ZY9mPXxA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rometools/cli-win32-arm64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-win32-arm64/-/cli-win32-arm64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-0fM+8zMAXuUOmMA7JVFPPz7Df6Tr5pndExJL8jQNspHexDuJGQyfBS50qoGaKKdrnQbKX8wN6ECk9dY5HjkkVg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rometools/cli-win32-x64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-win32-x64/-/cli-win32-x64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-07oLGYKTGi50d9w4/mqFieAjJwLLHUi3qmgMf1AWqmZj4CPxz6kAccKn44w895ZNVAgCUMEDptUkH/FO06j9FA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@types/accepts": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", @@ -5041,27 +5080,6 @@ "fsevents": "~2.3.2" } }, - "node_modules/rome": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/rome/-/rome-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-97HjxZPGS2w10CeU4qU8paKYwUSSJDLn6q66CR+y+mbpVDcxnh5buC2G+37o/FIhbszem/LyXEX4yeRZ+b/AdQ==", - "dev": true, - "hasInstallScript": true, - "bin": { - "rome": "bin/rome" - }, - "engines": { - "node": ">=14.*" - }, - "optionalDependencies": { - "@rometools/cli-darwin-arm64": "12.1.3-nightly.50eb45f", - "@rometools/cli-darwin-x64": "12.1.3-nightly.50eb45f", - "@rometools/cli-linux-arm64": "12.1.3-nightly.50eb45f", - "@rometools/cli-linux-x64": "12.1.3-nightly.50eb45f", - "@rometools/cli-win32-arm64": "12.1.3-nightly.50eb45f", - "@rometools/cli-win32-x64": "12.1.3-nightly.50eb45f" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6490,6 +6508,62 @@ "js-tokens": "^4.0.0" } }, + "@biomejs/biome": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.0.0.tgz", + "integrity": "sha512-Y5CND1QZ5pF6hc4dFw5ItDutv9KJO91ksLdBIFyvHL7LmXN0UomqyyRWryvrqq+YlA8Q58cR6sqjjQuMp9E2Ig==", + "dev": true, + "requires": { + "@biomejs/cli-darwin-arm64": "1.0.0", + "@biomejs/cli-darwin-x64": "1.0.0", + "@biomejs/cli-linux-arm64": "1.0.0", + "@biomejs/cli-linux-x64": "1.0.0", + "@biomejs/cli-win32-arm64": "1.0.0", + "@biomejs/cli-win32-x64": "1.0.0" + } + }, + "@biomejs/cli-darwin-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.0.0.tgz", + "integrity": "sha512-3v7kEyxkf3D246esH+q/lDK5wWn+xLCXZpHCuc1itAmC35GkEc6S7um6C1VD3XKXLx6N0sJR/rTmjKiRGV32Ig==", + "dev": true, + "optional": true + }, + "@biomejs/cli-darwin-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.0.0.tgz", + "integrity": "sha512-uxIMt/X7TQWicjsImkqMvUUEqaFZTOJJrtEhlHl/eIaETWJmK3uAR7ihIWctpGJnN16sUgpLgwczc7FETqu/PQ==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.0.0.tgz", + "integrity": "sha512-kJWtu3Xr4MdHV2Yn4U+eZudAGPgv0kRCjWAyzLRewJiqE5TLPrX08imB9SU1n3+VxNO8e2JJ0tWWBHo4J+aSEg==", + "dev": true, + "optional": true + }, + "@biomejs/cli-linux-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.0.0.tgz", + "integrity": "sha512-FK6hYZ0Lkk39eXYx1+2ZWtLkApc0RdOpcjDVM96JbvI0bxqvNnm193BPXuxh5A/fCl6N28RNUvcKnZ5LbgZ0Yw==", + "dev": true, + "optional": true + }, + "@biomejs/cli-win32-arm64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.0.0.tgz", + "integrity": "sha512-kE+OY2isEJHBodiLPMlybZckHkl3CQWsvXuJEvSxkoMhLbGDPEV3yZ/0lEph3BlxP3KP5vUO3hOFGaTvHFOuqQ==", + "dev": true, + "optional": true + }, + "@biomejs/cli-win32-x64": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.0.0.tgz", + "integrity": "sha512-Ko6ZsbmbScPMEnh/xz4mwDSCZIUCAEjbbbnUVApgAAL2+1Hoe7Vnhh2RiwYRqy3tHrBIMDwXkSxj0vlf1G3EHg==", + "dev": true, + "optional": true + }, "@esbuild/android-arm": { "version": "0.19.2", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.2.tgz", @@ -6732,48 +6806,6 @@ "picomatch": "^2.2.2" } }, - "@rometools/cli-darwin-arm64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-Dkink1NkKjE6tahQYWcuxdulQpQjIH5d3t2P+yTjLgovOV/JRWnx0dy1Dh0yaKKlFwa+oldFmRdU++Y3bdTNuQ==", - "dev": true, - "optional": true - }, - "@rometools/cli-darwin-x64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-x64/-/cli-darwin-x64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-ujRlaslCUUveRoQY/8BZy/l4wC/diPZTgyg2Bx/Xz6LWj8x0GrovB29KG/FT7vnMsPDQ0P4zNOnD8Sw3ef820A==", - "dev": true, - "optional": true - }, - "@rometools/cli-linux-arm64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-linux-arm64/-/cli-linux-arm64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-jjPhONj1KhQFIff1QYLNF6LDJ96MHjzmWdhdcpJrR63qnGfNoGjX2xwRMFeFBxSMoqbBbT/Xb641/JB9djdexw==", - "dev": true, - "optional": true - }, - "@rometools/cli-linux-x64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-linux-x64/-/cli-linux-x64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-QhBc0Q8ZoRlxKr4orCmCbSmNZLEiMa/+anU89DGrC6ysbYTickajsMurZcr2tVa3LHeC3+rcqcTM6+ZY9mPXxA==", - "dev": true, - "optional": true - }, - "@rometools/cli-win32-arm64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-win32-arm64/-/cli-win32-arm64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-0fM+8zMAXuUOmMA7JVFPPz7Df6Tr5pndExJL8jQNspHexDuJGQyfBS50qoGaKKdrnQbKX8wN6ECk9dY5HjkkVg==", - "dev": true, - "optional": true - }, - "@rometools/cli-win32-x64": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/@rometools/cli-win32-x64/-/cli-win32-x64-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-07oLGYKTGi50d9w4/mqFieAjJwLLHUi3qmgMf1AWqmZj4CPxz6kAccKn44w895ZNVAgCUMEDptUkH/FO06j9FA==", - "dev": true, - "optional": true - }, "@types/accepts": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.5.tgz", @@ -10021,20 +10053,6 @@ "fsevents": "~2.3.2" } }, - "rome": { - "version": "12.1.3-nightly.50eb45f", - "resolved": "https://registry.npmjs.org/rome/-/rome-12.1.3-nightly.50eb45f.tgz", - "integrity": "sha512-97HjxZPGS2w10CeU4qU8paKYwUSSJDLn6q66CR+y+mbpVDcxnh5buC2G+37o/FIhbszem/LyXEX4yeRZ+b/AdQ==", - "dev": true, - "requires": { - "@rometools/cli-darwin-arm64": "12.1.3-nightly.50eb45f", - "@rometools/cli-darwin-x64": "12.1.3-nightly.50eb45f", - "@rometools/cli-linux-arm64": "12.1.3-nightly.50eb45f", - "@rometools/cli-linux-x64": "12.1.3-nightly.50eb45f", - "@rometools/cli-win32-arm64": "12.1.3-nightly.50eb45f", - "@rometools/cli-win32-x64": "12.1.3-nightly.50eb45f" - } - }, "run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", diff --git a/package.json b/package.json index 0157e73e4..90342c2e4 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,7 @@ "three": "^0.150.1" }, "devDependencies": { + "@biomejs/biome": "^1.0.0", "@esm-bundle/chai": "^4.3.4-fix.0", "@types/chai": "^4.3.4", "@types/dom-speech-recognition": "^0.0.1", @@ -78,7 +79,6 @@ "node-fetch": "^3.3.1", "peggy": "^3.0.1", "playwright": "^1.31.2", - "rome": "^12.1.3-nightly.50eb45f", "tsup": "^6.7.0", "typedoc": "^0.23.28", "typescript": "^5.0.2", @@ -88,7 +88,7 @@ "barely-a-dev-server", "esbuild", "jszip", - "rome" + "@biomejs/biome" ], "engines": { "node": ">=19" diff --git a/script/fix-vendored-twsearch.js b/script/fix-vendored-twsearch.js index d0f5bb79e..47416cc85 100644 --- a/script/fix-vendored-twsearch.js +++ b/script/fix-vendored-twsearch.js @@ -3,7 +3,8 @@ import { join } from "path"; const DIR = new URL("../src/cubing/vendor/mpl/twsearch", import.meta.url) .pathname; -const ROME_JSON = new URL("../rome.json", import.meta.url).pathname; +// TODO(https://github.com/cubing/cubing.js/issues/290) +const BIOME_JSON = new URL("../biome.json", import.meta.url).pathname; let dynamicFileName = null; for (const fileName of await readdir(DIR)) { @@ -44,10 +45,10 @@ for (const fileName of await readdir(DIR)) { await writeFile(filePath, contents); } -console.log("Fixing:", ROME_JSON); -let contents = await readFile(ROME_JSON, "utf-8"); +console.log("Fixing:", BIOME_JSON); +let contents = await readFile(BIOME_JSON, "utf-8"); contents = contents.replaceAll( /"src\/cubing\/vendor\/mpl\/twsearch\/twsearch-.*.js"/g, `"src/cubing/vendor/mpl/twsearch/${dynamicFileName}"`, ); -await writeFile(ROME_JSON, contents); +await writeFile(BIOME_JSON, contents); diff --git a/src/cubing/twisty/views/control-panel/TwistyScrubber.ts b/src/cubing/twisty/views/control-panel/TwistyScrubber.ts index 14cc0925d..fe82a5067 100644 --- a/src/cubing/twisty/views/control-panel/TwistyScrubber.ts +++ b/src/cubing/twisty/views/control-panel/TwistyScrubber.ts @@ -157,7 +157,7 @@ export class TwistyScrubber extends ManagedCustomElement { const yDist = Math.abs(sliderY - y); let scale = 1; if (yDist > 64) { - scale = Math.max(Math.pow(2, -(yDist - 64) / 64), 1 / 32); + scale = Math.max(2 ** (-(yDist - 64) / 64), 1 / 32); } const preVal = parseInt(inputElem.value); console.log("cl", currentClickNum, clickNum, preVal); @@ -169,8 +169,7 @@ export class TwistyScrubber extends ManagedCustomElement { newVal = lastVal + delta * scale + - (preVal - lastVal) * - Math.min(1, Math.pow(1 / 2, (yDist * yDist) / 64)); + (preVal - lastVal) * Math.min(1, (1 / 2) ** ((yDist * yDist) / 64)); inputElem.value = newVal.toString(); console.log(scale); scaling = false;