@meistrari/mise-en-place 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/mise-en-place",
3
- "version": "2.4.1",
3
+ "version": "2.4.2",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,5 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
+ set -euo pipefail
4
+
3
5
  if test -f Makefile; then
4
6
  echo 'Makefile already exists. Skipping initial Makefile generation'
5
7
  else
@@ -45,9 +47,22 @@ if [ -n "$MEISTRARI_LIBS_LIST" ]; then
45
47
  for pkg_json in $PACKAGE_JSONS; do
46
48
  PKG_JSON_DIR=$(dirname "$pkg_json")
47
49
  cd "$PKG_JSON_DIR"
50
+
51
+ # Add caret (^) to each library that starts with @meistrari/ (if not already present)
52
+ # The line `"@meistrari/logger": "2.1.1"` becomes `"@meistrari/logger": "^2.1.1"`
53
+ # But `"@meistrari/logger": "^2.1.1"` stays as `"^2.1.1"` (no double caret)
54
+ jq --indent 4 '(.dependencies // {}, .devDependencies // {}) |= with_entries(if .key | startswith("@meistrari/") and (.value | startswith("^") | not) then .value |= "^" + . else . end)' package.json > package.json.tmp && mv package.json.tmp package.json
55
+
48
56
  MEISTRARI_LIBS_LIST_LOCAL_DIR=$(jq -r "$JQ_EXPRESSION" package.json 2>/dev/null | sort -u)
49
57
 
50
- echo "Updating $MEISTRARI_LIBS_LIST_LOCAL_DIR libraries in $PKG_JSON_DIR"
58
+ # If no libraries, skip
59
+ if [ -z "$MEISTRARI_LIBS_LIST_LOCAL_DIR" ]; then
60
+ echo "No @meistrari/* libraries found in $PKG_JSON_DIR. Skipping."
61
+ cd - > /dev/null
62
+ continue
63
+ fi
64
+
65
+ echo "Updating $(echo $MEISTRARI_LIBS_LIST_LOCAL_DIR | tr '\n' ' ') libraries in $PKG_JSON_DIR"
51
66
 
52
67
  bun update --silent $MEISTRARI_LIBS_LIST_LOCAL_DIR --ignore-scripts
53
68
  cd - > /dev/null