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
17 changes: 17 additions & 0 deletions .github/tools/version-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
echo "Verifying that all packages have the same major and minor version (patch version can be different)..."
version_base=$(cat package.json | jq '.version' --raw-output)
version_base=${version_base%.*}
echo "Base Version: $version_base"

find . -name "package.json" -type f -not -path "*/node_modules/*" -not -path "*/.next/*" -not -path "*/state/*" | sort | while read -r file; do
name_pkg=$(cat $file | jq '.name' --raw-output)
version_pkg_original=$(cat $file | jq '.version' --raw-output)
version_pkg="${version_pkg_original%.*}"

if [ "$version_base" != "$version_pkg" ]; then
echo "- $name_pkg: ❌ mismatch! (at $version_pkg_original)"
exit 1
else
echo "- $name_pkg: ✅ correct at $version_pkg_original"
fi
done
21 changes: 1 addition & 20 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,4 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Check versions
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "Verifying that all packages have the same major and minor version (patch version can be different)..."
version_base=$(cat package.json | jq '.version' --raw-output)
version_base=${version_base%.*}
echo "Base Version: $version_base"

find . -name "package.json" -type f -not -path "*/node_modules/*" -not -path "*/.next/*" -not -path "*/state/*" | sort | while read -r file; do
name_pkg=$(cat $file | jq '.name' --raw-output)
version_pkg=$(cat $file | jq '.version' --raw-output)
version_pkg="${version_pkg%.*}"

if [ "$version_base" != "$version_pkg" ]; then
echo "- $name_pkg: mismatch! (at $version_pkg)"
exit 1
else
echo "- $name_pkg: correct"
fi
done
run: .github/tools/version-check.sh
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"scripts": {
"postinstall": "npm --prefix base install && npm --prefix server install && npm --prefix client install && npm --prefix client-react install && npm --prefix state install && npm --prefix docs install",
"audit:fix": "npm --prefix base audit fix && npm --prefix server audit fix && npm --prefix client audit fix && npm --prefix client-react audit fix && npm --prefix state run audit:fix && npm --prefix docs audit fix",
"validate": "npm install && npm run --prefix base validate && npm run --prefix server validate && npm run --prefix client validate && npm run --prefix client-react validate && npm run --prefix state validate && npm run --prefix docs validate",
"validate": "npm install && .github/tools/version-check.sh && npm run --prefix base validate && npm run --prefix server validate && npm run --prefix client validate && npm run --prefix client-react validate && npm run --prefix state validate && npm run --prefix docs validate",
"dev": "npm-run-all --parallel dev:*",
"dev:base": "npm run --prefix base dev",
"dev:server": "sleep 250 && npm run --prefix server dev",
"dev:client": "sleep 500 && npm run --prefix client dev",
"dev:client-react": "sleep 750 && npm run --prefix client-react dev",
"dev:docs": "npm run --prefix docs dev",
"versions": "npm install && npm --prefix base run postversion && npm --prefix server run postversion && npm --prefix client run postversion && npm --prefix client-react run postversion && npm --prefix state run versions"
"versions": ".github/tools/version-check.sh && npm install && npm --prefix base run postversion && npm --prefix server run postversion && npm --prefix client run postversion && npm --prefix client-react run postversion && npm --prefix state run versions"
},
"dependencies": {
"npm-run-all": "^4.1.5",
Expand Down