Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing build errors and change-version script #935

Merged
merged 4 commits into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/change-version.js
Original file line number Diff line number Diff line change
@@ -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) {
@@ -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",
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",