From e2566fb580967b81858297cca9e2d6191afc0901 Mon Sep 17 00:00:00 2001 From: Hemmi Shinichi Date: Thu, 19 Nov 2026 12:04:54 +0900 Subject: [PATCH 1/4] ci: install wasm-bindgen-cli with --locked --- .github/workflows/checks_js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks_js.yml b/.github/workflows/checks_js.yml index c519fc9a..28752081 100644 --- a/.github/workflows/checks_js.yml +++ b/.github/workflows/checks_js.yml @@ -44,7 +44,7 @@ jobs: run: | WASM_BINDGEN_VERSION=$(cargo metadata --format-version 1 --locked | jq -r '.packages[] | select(.name == "wasm-bindgen") | .version') if ! command -v wasm-bindgen &> /dev/null || [ "$(wasm-bindgen --version | awk '{print $2}')" != "$WASM_BINDGEN_VERSION" ]; then - cargo install wasm-bindgen-cli --version "$WASM_BINDGEN_VERSION" --force + cargo install wasm-bindgen-cli --version "$WASM_BINDGEN_VERSION" --locked --force fi if ! command -v wasm-opt &> /dev/null; then cargo install wasm-opt From 9e1d6ca2389e98ca16c20c6b2424bc741a27380c Mon Sep 17 00:00:00 2001 From: Shinichi Hemmi Date: Thu, 19 Nov 2026 12:27:34 +0900 Subject: [PATCH 2/4] ci: install wasm-opt with a pinned version and --locked --- .github/workflows/checks_js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks_js.yml b/.github/workflows/checks_js.yml index 28752081..5993461b 100644 --- a/.github/workflows/checks_js.yml +++ b/.github/workflows/checks_js.yml @@ -47,7 +47,7 @@ jobs: cargo install wasm-bindgen-cli --version "$WASM_BINDGEN_VERSION" --locked --force fi if ! command -v wasm-opt &> /dev/null; then - cargo install wasm-opt + cargo install wasm-opt --version 0.116.1 --locked fi - name: Build JS binding working-directory: rustuna_js From cf6aff1b475e8ab1d7cfacf50b49bf80afb1ed13 Mon Sep 17 00:00:00 2001 From: Shinichi Hemmi Date: Thu, 19 Nov 2026 15:24:30 +0900 Subject: [PATCH 3/4] ci: install TypeScript explicitly --- .github/workflows/checks_js.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/checks_js.yml b/.github/workflows/checks_js.yml index 5993461b..349fa05d 100644 --- a/.github/workflows/checks_js.yml +++ b/.github/workflows/checks_js.yml @@ -30,6 +30,8 @@ jobs: - name: Installing biome.js working-directory: rustuna_js run: npm i -g biome + - name: Install TypeScript + run: npm i -g typescript@7.0.2 - name: Lint working-directory: rustuna_js run: biome ci examples/*.ts test/*.mjs From f18e813ca438f7f92f63e65e539f8f14d282ada5 Mon Sep 17 00:00:00 2001 From: Shinichi Hemmi Date: Thu, 19 Nov 2026 15:29:25 +0900 Subject: [PATCH 4/4] ci: install the real Biome and fix lint errors --- .github/workflows/checks_js.yml | 2 +- rustuna_js/test/distribution.mjs | 10 +++++----- rustuna_js/test/study_optimize.mjs | 7 +++---- rustuna_js/test/user_attr.mjs | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/checks_js.yml b/.github/workflows/checks_js.yml index 349fa05d..470b209c 100644 --- a/.github/workflows/checks_js.yml +++ b/.github/workflows/checks_js.yml @@ -29,7 +29,7 @@ jobs: node-version: '24' - name: Installing biome.js working-directory: rustuna_js - run: npm i -g biome + run: npm i -g @biomejs/biome@2.6.8 - name: Install TypeScript run: npm i -g typescript@7.0.2 - name: Lint diff --git a/rustuna_js/test/distribution.mjs b/rustuna_js/test/distribution.mjs index b476d337..b0d4b4f2 100644 --- a/rustuna_js/test/distribution.mjs +++ b/rustuna_js/test/distribution.mjs @@ -1,5 +1,5 @@ -import test from "node:test"; import assert from "node:assert"; +import test from "node:test"; import * as rustuna from "../pkg/node/rustuna.js"; @@ -8,24 +8,24 @@ test("optimize simple quadratic function", () => { study.optimize((trial) => { const x = trial.suggest_float("x", -10.0, 10.0); const y = trial.suggest_int("y", -10, 10); - const z = trial.suggest_categorical("z", ["foo", "bar"]); + trial.suggest_categorical("z", ["foo", "bar"]); const value = (x - 5) ** 2 + (y + 2) ** 2; return value; }, 30); const best_trial = study.best_trial; assert.equal(best_trial.params.length, 3); - let x_param = best_trial.params.find((param) => param.name === "x"); + const x_param = best_trial.params.find((param) => param.name === "x"); assert.equal(x_param.name, "x"); assert.equal( x_param.internal_value >= -10 && x_param.internal_value <= 10, true, ); - let z_param = best_trial.params.find((param) => param.name === "z"); + const z_param = best_trial.params.find((param) => param.name === "z"); assert.equal(z_param.name, "z"); assert.equal( - z_param.external_value == "foo" || z_param.external_value == "bar", + z_param.external_value === "foo" || z_param.external_value === "bar", true, ); }); diff --git a/rustuna_js/test/study_optimize.mjs b/rustuna_js/test/study_optimize.mjs index 218aedf2..a2103638 100644 --- a/rustuna_js/test/study_optimize.mjs +++ b/rustuna_js/test/study_optimize.mjs @@ -1,15 +1,14 @@ -import test from "node:test"; import assert from "node:assert"; +import test from "node:test"; import * as rustuna from "../pkg/node/rustuna.js"; -import { type } from "node:os"; test("optimize simple quadratic function", () => { const study = rustuna.create_study("test"); study.optimize((trial) => { const x = trial.suggest_float("x", -10.0, 10.0); const y = trial.suggest_int("y", -10, 10); - const z = trial.suggest_categorical("z", ["foo", "bar"]); + trial.suggest_categorical("z", ["foo", "bar"]); const value = (x - 5) ** 2 + (y + 2) ** 2; return value; }, 30); @@ -20,7 +19,7 @@ test("optimize simple quadratic function", () => { test("sample categorical values", () => { const study = rustuna.create_study("test"); study.optimize((trial) => { - const z = trial.suggest_categorical("z", ["foo", 1, true, false, null]); + trial.suggest_categorical("z", ["foo", 1, true, false, null]); // console.log(z); // console.log(typeof z); return 1.0; diff --git a/rustuna_js/test/user_attr.mjs b/rustuna_js/test/user_attr.mjs index 8181c604..f4cb9184 100644 --- a/rustuna_js/test/user_attr.mjs +++ b/rustuna_js/test/user_attr.mjs @@ -1,5 +1,5 @@ -import test from "node:test"; import assert from "node:assert"; +import test from "node:test"; import * as rustuna from "../pkg/node/rustuna.js";