File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717echo " Updating packages to version $VERSION ..."
1818
19- # Update all package.json files in packages/*
19+ # Update all package.json files in packages/* (excluding templates and private packages)
2020for package_dir in packages/* /; do
2121 if [ -f " ${package_dir} package.json" ]; then
2222 package_name=$( basename " $package_dir " )
23+
24+ # Skip template directories
25+ if [[ " $package_name " == * " -template" * ]] || [[ " $package_name " == " template-" * ]]; then
26+ echo " ⊘ Skipping template: $package_name "
27+ continue
28+ fi
29+
30+ # Check if package is private (skip private packages)
31+ is_private=$( node -e "
32+ try {
33+ const pkg = require('./${package_dir} package.json');
34+ console.log(pkg.private === true ? 'true' : 'false');
35+ } catch (e) {
36+ console.log('false');
37+ }
38+ " )
39+
40+ if [ " $is_private " = " true" ]; then
41+ echo " ⊘ Skipping private package: $package_name "
42+ continue
43+ fi
44+
2345 echo " - Updating $package_name "
24- cd " $package_dir "
25- npm version " $VERSION " --no-git-tag-version --allow-same-version
26- cd - > /dev/null
46+
47+ # Use Node.js to update the version in package.json
48+ node -e "
49+ const fs = require('fs');
50+ const path = '${package_dir} package.json';
51+ const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
52+ pkg.version = '${VERSION} ';
53+ fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n');
54+ "
2755 fi
2856done
2957
You can’t perform that action at this time.
0 commit comments