Skip to content

Commit a7836cd

Browse files
authored
Merge pull request #7867 from BitGo/BTC-0.bump-wasm-utxo-wide
feat(dependencies): upgrade wasm-utxo and enhance upgrade script
2 parents a24a351 + b57480c commit a7836cd

6 files changed

Lines changed: 26 additions & 12 deletions

File tree

modules/abstract-utxo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"@bitgo/utxo-core": "^1.28.0",
6969
"@bitgo/utxo-lib": "^11.19.0",
7070
"@bitgo/utxo-ord": "^1.22.20",
71-
"@bitgo/wasm-utxo": "1.19.0",
71+
"@bitgo/wasm-utxo": "^1.20.0",
7272
"@types/lodash": "^4.14.121",
7373
"@types/superagent": "4.1.15",
7474
"bignumber.js": "^9.0.2",

modules/utxo-bin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@bitgo/unspents": "^0.50.13",
3232
"@bitgo/utxo-core": "^1.28.0",
3333
"@bitgo/utxo-lib": "^11.19.0",
34-
"@bitgo/wasm-utxo": "1.19.0",
34+
"@bitgo/wasm-utxo": "^1.20.0",
3535
"@noble/curves": "1.8.1",
3636
"archy": "^1.0.0",
3737
"bech32": "^2.0.0",

modules/utxo-core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"@bitgo/secp256k1": "^1.8.0",
8282
"@bitgo/unspents": "^0.50.13",
8383
"@bitgo/utxo-lib": "^11.19.0",
84-
"@bitgo/wasm-utxo": "1.19.0",
84+
"@bitgo/wasm-utxo": "^1.20.0",
8585
"bip174": "npm:@bitgo-forks/bip174@3.1.0-master.4",
8686
"bitcoinjs-message": "npm:@bitgo-forks/bitcoinjs-message@1.0.0-master.3",
8787
"fast-sha256": "^1.3.0"

modules/utxo-staking/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@bitgo/babylonlabs-io-btc-staking-ts": "^3.3.0",
6464
"@bitgo/utxo-core": "^1.28.0",
6565
"@bitgo/utxo-lib": "^11.19.0",
66-
"@bitgo/wasm-utxo": "1.19.0",
66+
"@bitgo/wasm-utxo": "^1.20.0",
6767
"bip174": "npm:@bitgo-forks/bip174@3.1.0-master.4",
6868
"bip322-js": "^2.0.0",
6969
"bitcoinjs-lib": "^6.1.7",

scripts/upgrade-workspace-dependency.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,14 @@ async function findPackagesWithDependency(depName: string): Promise<PackageWithD
6262
return packagesWithDep;
6363
}
6464

65-
async function getLatestVersion(packageName: string): Promise<string> {
65+
async function getLatestVersion(packageName: string, versionPrefix?: string): Promise<string> {
6666
console.log(`Fetching latest version for ${packageName}...`);
6767
const { stdout } = await execa('npm', ['view', packageName, 'version']);
68-
return stdout.trim();
68+
const version = stdout.trim();
69+
if (versionPrefix) {
70+
return version.startsWith(versionPrefix) ? version : `${versionPrefix}${version}`;
71+
}
72+
return version;
6973
}
7074

7175
async function updatePackageJson(
@@ -92,7 +96,12 @@ async function runYarnInstall(): Promise<void> {
9296
});
9397
}
9498

95-
async function cmdUpgrade(opts: { package: string; version?: string; dryRun: boolean }): Promise<void> {
99+
async function cmdUpgrade(opts: {
100+
package: string;
101+
version?: string;
102+
versionPrefix?: string;
103+
dryRun: boolean;
104+
}): Promise<void> {
96105
const { package: depName, version: targetVersion, dryRun } = opts;
97106

98107
console.log(`\n🔍 Searching for packages with dependency: ${depName}\n`);
@@ -114,7 +123,7 @@ async function cmdUpgrade(opts: { package: string; version?: string; dryRun: boo
114123
newVersion = targetVersion;
115124
console.log(`\n📦 Target version: ${newVersion}`);
116125
} else {
117-
newVersion = await getLatestVersion(depName);
126+
newVersion = await getLatestVersion(depName, opts.versionPrefix ?? '');
118127
console.log(`\n📦 Latest version: ${newVersion}`);
119128
}
120129

@@ -158,6 +167,11 @@ yargs
158167
describe: 'Target version (defaults to latest from npm registry)',
159168
alias: 'v',
160169
},
170+
versionPrefix: {
171+
type: 'string',
172+
describe: 'Version prefix to use when getting latest version',
173+
default: '^',
174+
},
161175
dryRun: {
162176
type: 'boolean',
163177
default: false,

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -985,10 +985,10 @@
985985
monocle-ts "^2.3.13"
986986
newtype-ts "^0.3.5"
987987

988-
"@bitgo/wasm-utxo@1.19.0":
989-
version "1.19.0"
990-
resolved "https://registry.npmjs.org/@bitgo/wasm-utxo/-/wasm-utxo-1.19.0.tgz#c44db54da8bfa748f3a7a24f769519ff56783236"
991-
integrity sha512-M6NtRfJrWoJP68IF1bm2eNMzUdIGnIQjIDwcIMXaqJCuWXPQot8KbKHVJPe3EpdB9g4a/J5hd6JIhZRF8m7Dhw==
988+
"@bitgo/wasm-utxo@^1.20.0":
989+
version "1.20.0"
990+
resolved "https://registry.npmjs.org/@bitgo/wasm-utxo/-/wasm-utxo-1.20.0.tgz#c1051995da5f5218a7fd5f946d2f7f7b6bb3d00c"
991+
integrity sha512-r9YzGu+zb0jHO+fttvG62goiNFZlUfj6sF6Cx/+ZjGK2g54heD3F64TQNj9klxJY8l6q7p4ka/v4CyIj5MEFQA==
992992

993993
"@brandonblack/musig@^0.0.1-alpha.0":
994994
version "0.0.1-alpha.1"

0 commit comments

Comments
 (0)