Skip to content

Commit

Permalink
Merge pull request #935 from Pauan/fix/build-errors
Browse files Browse the repository at this point in the history
Fixing build errors and change-version script
  • Loading branch information
jaketarnow authored Sep 27, 2024
2 parents 667813e + f74ce92 commit 7341b71
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions scripts/change-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ async function updateVersions(newVersion) {
}


// Updates the version in `Cargo.toml`
async function updateCargo(newVersion) {
const toml = await readFile("wasm/Cargo.toml", { encoding: "utf8" });

const replaced = toml
.replace(/(\[package\]\s+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) {
Expand All @@ -51,4 +62,5 @@ async function updateDependencies(newVersion) {
const newVersion = process.argv[2];

await updateVersions(newVersion);
await updateCargo(newVersion);
await updateDependencies(newVersion);
2 changes: 1 addition & 1 deletion sdk/rollup.config.js
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion sdk/rollup.test.js
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 7341b71

Please sign in to comment.