Skip to content

Commit

Permalink
[LW-10333] - Bump cardano sdk to get ledgerjs v7.1.2 (#1107)
Browse files Browse the repository at this point in the history
* chore(extension): bump cardano-js-sdk, adds ledgerjs-7.1.2

* chore(extension): added a tool for bumping cardano-skd packages to the latest version

* fix(extension): fix removing caret from versions

* fix(extension): fix bump script to include also devDependencies

* fix(extension): fix yarn.lock

* fix(extension): added peerDependencies to be included in the bump

* fix(extension): updated yarn.lock

* chore(extension): added a yarn install at the end of the script
  • Loading branch information
danielmain committed Apr 30, 2024
1 parent dde0b45 commit 3ca0833
Show file tree
Hide file tree
Showing 6 changed files with 174 additions and 254 deletions.
14 changes: 7 additions & 7 deletions apps/browser-extension-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
},
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@cardano-sdk/cardano-services-client": "0.19.1",
"@cardano-sdk/core": "0.30.1",
"@cardano-sdk/dapp-connector": "0.12.15",
"@cardano-sdk/input-selection": "0.12.28",
"@cardano-sdk/tx-construction": "0.18.4",
"@cardano-sdk/cardano-services-client": "0.19.2",
"@cardano-sdk/core": "0.30.2",
"@cardano-sdk/dapp-connector": "0.12.16",
"@cardano-sdk/input-selection": "0.12.29",
"@cardano-sdk/tx-construction": "0.18.5",
"@cardano-sdk/util": "0.15.1",
"@cardano-sdk/wallet": "0.37.2",
"@cardano-sdk/web-extension": "0.27.2",
"@cardano-sdk/wallet": "0.37.3",
"@cardano-sdk/web-extension": "0.27.3",
"@emurgo/cip14-js": "~3.0.1",
"@koralabs/handles-public-api-interfaces": "^1.6.6",
"@lace/cardano": "0.1.0",
Expand Down
35 changes: 35 additions & 0 deletions bump-cardano-js-sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env

# Requirements: Linux/Mac, curl and jq

# Script to update @cardano-sdk/* dependencies, peerDependencies and devDependencies in all package.json files within the lace monorepo

# Using find to locate all package.json files in the monorepo.
find "." -type d -name 'node_modules' -prune -o -type f -name 'package.json' -print | while IFS= read -r package_file; do
echo "Processing $package_file"

# Function to update a given section (dependencies, peerDependencies or devDependencies)
function update_dependencies {
dep_type="$1" # either "dependencies", "peerDependencies" or "devDependencies"
jq -r "if .$dep_type then .$dep_type | keys[] | select(startswith(\"@cardano-sdk/\")) else empty end" "$package_file" | while IFS= read -r package; do
echo "Updating $package in $dep_type of $package_file"
latest_version=$(curl -s "https://registry.npmjs.org/$package" | jq -r '.["dist-tags"].latest')
if [ -z "$latest_version" ]; then
echo "Failed to fetch latest version for $package"
continue
fi
jq --arg pkg "$package" --arg ver "$latest_version" ".$dep_type[\$pkg] = \$ver" "$package_file" > "$package_file.tmp" && mv "$package_file.tmp" "$package_file"
echo "Updated $package to version $latest_version in $dep_type of $package_file"
done
}

# Update dependencies, peerDependencies and devDependencies
update_dependencies "dependencies"
update_dependencies "devDependencies"
update_dependencies "peerDependencies"
done

yarn install
echo "Yarn install completed."

echo "Dependency updates complete."
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"browser": "APP_NAME=browser-extension-wallet yarn $0",
"build": "yarn base-command-for-build-scripts -c build",
"build-deps": "EXCLUDE_APP=true yarn build",
"bump-cardano-js-sdk": "sh bump-cardano-js-sdk.sh",
"cardano:lint": "yarn eslint-cmd \"packages/cardano/**/*.{js,ts,tsx}\"",
"chromatic": "ENV=development yarn build-storybook; chromatic --exit-zero-on-changes --project-token=e28776c940b9 -d storybook-static/",
"cleanup": "yarn workspaces foreach run cleanup && yarn exec rm -rf node_modules storybook-static && rm -rf .cache/eslintcache",
Expand Down
16 changes: 8 additions & 8 deletions packages/cardano/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
"watch": "yarn build --watch"
},
"dependencies": {
"@cardano-sdk/cardano-services-client": "0.19.0",
"@cardano-sdk/core": "0.30.1",
"@cardano-sdk/cardano-services-client": "0.19.2",
"@cardano-sdk/core": "0.30.2",
"@cardano-sdk/crypto": "0.1.23",
"@cardano-sdk/hardware-ledger": "0.9.2",
"@cardano-sdk/hardware-trezor": "0.4.22",
"@cardano-sdk/key-management": "0.20.2",
"@cardano-sdk/hardware-ledger": "0.9.3",
"@cardano-sdk/hardware-trezor": "0.4.23",
"@cardano-sdk/key-management": "0.20.3",
"@cardano-sdk/util": "0.15.1",
"@cardano-sdk/wallet": "0.37.2",
"@cardano-sdk/web-extension": "0.27.2",
"@cardano-sdk/wallet": "0.37.3",
"@cardano-sdk/web-extension": "0.27.3",
"@lace/common": "0.1.0",
"@ledgerhq/devices": "^8.2.1",
"@stablelib/chacha20poly1305": "1.0.1",
Expand All @@ -68,7 +68,7 @@
"webextension-polyfill": "0.8.0"
},
"devDependencies": {
"@cardano-sdk/util-dev": "0.19.18",
"@cardano-sdk/util-dev": "0.20.2",
"@emurgo/cardano-message-signing-browser": "1.0.1",
"rollup-plugin-polyfill-node": "^0.8.0",
"typescript": "^4.9.5"
Expand Down
18 changes: 9 additions & 9 deletions packages/staking/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@
},
"devDependencies": {
"@babel/core": "^7.21.0",
"@cardano-sdk/core": "0.30.1",
"@cardano-sdk/input-selection": "0.12.28",
"@cardano-sdk/tx-construction": "0.18.4",
"@cardano-sdk/core": "0.30.2",
"@cardano-sdk/input-selection": "0.12.29",
"@cardano-sdk/tx-construction": "0.18.5",
"@cardano-sdk/util": "0.15.1",
"@cardano-sdk/wallet": "0.37.2",
"@cardano-sdk/web-extension": "0.27.2",
"@cardano-sdk/wallet": "0.37.3",
"@cardano-sdk/web-extension": "0.27.3",
"@storybook/addon-actions": "^7.6.7",
"@storybook/addon-essentials": "^7.6.7",
"@storybook/addon-interactions": "^7.6.7",
Expand Down Expand Up @@ -122,11 +122,11 @@
"wait-on": "^7.0.1"
},
"peerDependencies": {
"@cardano-sdk/input-selection": "0.12.26",
"@cardano-sdk/tx-construction": "0.18.2",
"@cardano-sdk/input-selection": "0.12.29",
"@cardano-sdk/tx-construction": "0.18.5",
"@cardano-sdk/util": "0.15.1",
"@cardano-sdk/wallet": "0.36.0",
"@cardano-sdk/web-extension": "0.26.2",
"@cardano-sdk/wallet": "0.37.3",
"@cardano-sdk/web-extension": "0.27.3",
"@lace/cardano": "^0.1.0",
"@lace/common": "^0.1.0",
"@lace/core": "0.1.0",
Expand Down

0 comments on commit 3ca0833

Please sign in to comment.