Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion modules/abstract-utxo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@bitgo/utxo-core": "^1.28.0",
"@bitgo/utxo-lib": "^11.19.0",
"@bitgo/utxo-ord": "^1.22.20",
"@bitgo/wasm-utxo": "1.19.0",
"@bitgo/wasm-utxo": "^1.20.0",
"@types/lodash": "^4.14.121",
"@types/superagent": "4.1.15",
"bignumber.js": "^9.0.2",
Expand Down
2 changes: 1 addition & 1 deletion modules/utxo-bin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@bitgo/unspents": "^0.50.13",
"@bitgo/utxo-core": "^1.28.0",
"@bitgo/utxo-lib": "^11.19.0",
"@bitgo/wasm-utxo": "1.19.0",
"@bitgo/wasm-utxo": "^1.20.0",
"@noble/curves": "1.8.1",
"archy": "^1.0.0",
"bech32": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/utxo-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@bitgo/secp256k1": "^1.8.0",
"@bitgo/unspents": "^0.50.13",
"@bitgo/utxo-lib": "^11.19.0",
"@bitgo/wasm-utxo": "1.19.0",
"@bitgo/wasm-utxo": "^1.20.0",
"bip174": "npm:@bitgo-forks/bip174@3.1.0-master.4",
"bitcoinjs-message": "npm:@bitgo-forks/bitcoinjs-message@1.0.0-master.3",
"fast-sha256": "^1.3.0"
Expand Down
2 changes: 1 addition & 1 deletion modules/utxo-staking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@bitgo/babylonlabs-io-btc-staking-ts": "^3.3.0",
"@bitgo/utxo-core": "^1.28.0",
"@bitgo/utxo-lib": "^11.19.0",
"@bitgo/wasm-utxo": "1.19.0",
"@bitgo/wasm-utxo": "^1.20.0",
"bip174": "npm:@bitgo-forks/bip174@3.1.0-master.4",
"bip322-js": "^2.0.0",
"bitcoinjs-lib": "^6.1.7",
Expand Down
22 changes: 18 additions & 4 deletions scripts/upgrade-workspace-dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ async function findPackagesWithDependency(depName: string): Promise<PackageWithD
return packagesWithDep;
}

async function getLatestVersion(packageName: string): Promise<string> {
async function getLatestVersion(packageName: string, versionPrefix?: string): Promise<string> {
console.log(`Fetching latest version for ${packageName}...`);
const { stdout } = await execa('npm', ['view', packageName, 'version']);
return stdout.trim();
const version = stdout.trim();
if (versionPrefix) {
return version.startsWith(versionPrefix) ? version : `${versionPrefix}${version}`;
}
return version;
}

async function updatePackageJson(
Expand All @@ -92,7 +96,12 @@ async function runYarnInstall(): Promise<void> {
});
}

async function cmdUpgrade(opts: { package: string; version?: string; dryRun: boolean }): Promise<void> {
async function cmdUpgrade(opts: {
package: string;
version?: string;
versionPrefix?: string;
dryRun: boolean;
}): Promise<void> {
const { package: depName, version: targetVersion, dryRun } = opts;

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

Expand Down Expand Up @@ -158,6 +167,11 @@ yargs
describe: 'Target version (defaults to latest from npm registry)',
alias: 'v',
},
versionPrefix: {
type: 'string',
describe: 'Version prefix to use when getting latest version',
default: '^',
},
dryRun: {
type: 'boolean',
default: false,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -985,10 +985,10 @@
monocle-ts "^2.3.13"
newtype-ts "^0.3.5"

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

"@brandonblack/musig@^0.0.1-alpha.0":
version "0.0.1-alpha.1"
Expand Down