-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LW-10333] - Bump cardano sdk to get ledgerjs v7.1.2 (#1107)
* 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
1 parent
dde0b45
commit 3ca0833
Showing
6 changed files
with
174 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.