From 3813b90bea7ceeb9b46251b407a669c02a62161c Mon Sep 17 00:00:00 2001 From: Pauan Date: Thu, 26 Sep 2024 21:15:48 -0700 Subject: [PATCH 1/4] Fixing build error with Node 22 --- sdk/rollup.config.js | 2 +- sdk/rollup.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/rollup.config.js b/sdk/rollup.config.js index b430f4a7c..585e85f93 100644 --- a/sdk/rollup.config.js +++ b/sdk/rollup.config.js @@ -1,6 +1,6 @@ import typescript from "rollup-plugin-typescript2"; import replace from "@rollup/plugin-replace"; -import $package from "./package.json" assert { type: "json" }; +import $package from "./package.json" with { type: "json" }; const networks = [ "testnet", diff --git a/sdk/rollup.test.js b/sdk/rollup.test.js index 57d7bb08b..5af466a1f 100644 --- a/sdk/rollup.test.js +++ b/sdk/rollup.test.js @@ -1,7 +1,7 @@ import typescript from "rollup-plugin-typescript2"; import replace from "@rollup/plugin-replace"; import { globSync } from "glob"; -import $package from "./package.json" assert { type: "json" }; +import $package from "./package.json" with { type: "json" }; const networks = [ "testnet", From cc0c59966964685e5aa79f3426148739c7cb40c6 Mon Sep 17 00:00:00 2001 From: Pauan Date: Thu, 26 Sep 2024 21:21:49 -0700 Subject: [PATCH 2/4] The change-version script now updates wasm/Cargo.toml --- scripts/change-version.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/change-version.js b/scripts/change-version.js index 71a1df4f8..f8b6e5e5d 100644 --- a/scripts/change-version.js +++ b/scripts/change-version.js @@ -37,6 +37,17 @@ async function updateVersions(newVersion) { } +// Updates the version in `Cargo.toml` +async function updateCargo(newVersion) { + const json = await readFile("wasm/Cargo.toml", { encoding: "utf8" }); + + const replaced = json + .replace(/(name *= *"aleo-wasm"\s+version *= *)"[^"]+"/, `$1"${newVersion}"`); + + await writeFile("wasm/Cargo.toml", replaced); +} + + // Updates all of the `package.json` files so they use the correct // version of `@provablehq/wasm` and `@provablehq/sdk` async function updateDependencies(newVersion) { @@ -51,4 +62,5 @@ async function updateDependencies(newVersion) { const newVersion = process.argv[2]; await updateVersions(newVersion); +await updateCargo(newVersion); await updateDependencies(newVersion); From 74a62473510e2206126a27c0a14ad63390718cc6 Mon Sep 17 00:00:00 2001 From: Pauan Date: Thu, 26 Sep 2024 21:25:24 -0700 Subject: [PATCH 3/4] Fixing minor typo --- scripts/change-version.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/change-version.js b/scripts/change-version.js index f8b6e5e5d..3bf4c9646 100644 --- a/scripts/change-version.js +++ b/scripts/change-version.js @@ -39,9 +39,9 @@ async function updateVersions(newVersion) { // Updates the version in `Cargo.toml` async function updateCargo(newVersion) { - const json = await readFile("wasm/Cargo.toml", { encoding: "utf8" }); + const toml = await readFile("wasm/Cargo.toml", { encoding: "utf8" }); - const replaced = json + const replaced = toml .replace(/(name *= *"aleo-wasm"\s+version *= *)"[^"]+"/, `$1"${newVersion}"`); await writeFile("wasm/Cargo.toml", replaced); From f74ce92d68e390c41e7ae0f95489f785938aef2f Mon Sep 17 00:00:00 2001 From: Pauan Date: Fri, 27 Sep 2024 07:36:47 -0700 Subject: [PATCH 4/4] Minor fix to change-version script --- scripts/change-version.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/change-version.js b/scripts/change-version.js index 3bf4c9646..604c5092a 100644 --- a/scripts/change-version.js +++ b/scripts/change-version.js @@ -42,7 +42,7 @@ async function updateCargo(newVersion) { const toml = await readFile("wasm/Cargo.toml", { encoding: "utf8" }); const replaced = toml - .replace(/(name *= *"aleo-wasm"\s+version *= *)"[^"]+"/, `$1"${newVersion}"`); + .replace(/(\[package\]\s+name *= *"aleo-wasm"\s+version *= *)"[^"]+"/, `$1"${newVersion}"`); await writeFile("wasm/Cargo.toml", replaced); }