@meistrari/mise-en-place 2.4.0 → 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.0",
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
@@ -12,9 +14,9 @@ make mise-en-place
12
14
  WORKSPACE_PATTERNS=$(jq -r '.workspaces[]? // empty' package.json 2>/dev/null)
13
15
  JQ_EXPRESSION='(.dependencies // {}, .devDependencies // {}) | keys[] | select(startswith("@meistrari/"))'
14
16
 
17
+ PACKAGE_JSONS="./package.json"
15
18
  # If workspaces exist, find package.json files matching the patterns, otherwise just use root
16
19
  if [ -n "$WORKSPACE_PATTERNS" ]; then
17
- PACKAGE_JSONS="package.json"
18
20
  for pattern in $WORKSPACE_PATTERNS; do
19
21
  # Use find with the workspace pattern (e.g., "packages/*" becomes "packages/*/package.json")
20
22
  PACKAGE_JSONS="$PACKAGE_JSONS $(find $pattern -maxdepth 1 -name "package.json" 2>/dev/null)"
@@ -38,15 +40,42 @@ if [ -n "$MEISTRARI_LIBS_LIST" ]; then
38
40
  if test -f pnpm-lock.yaml; then
39
41
  log_header "pnpm-lock.yaml"
40
42
  pnpm update $MEISTRARI_LIBS_LIST --ignore-scripts -r
43
+
41
44
  elif test -f bun.lock || test -f bun.lockb; then
42
45
  log_header "bun.lock or bun.lockb"
43
- bun update $MEISTRARI_LIBS_LIST --ignore-scripts -r
46
+
47
+ for pkg_json in $PACKAGE_JSONS; do
48
+ PKG_JSON_DIR=$(dirname "$pkg_json")
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
+
56
+ MEISTRARI_LIBS_LIST_LOCAL_DIR=$(jq -r "$JQ_EXPRESSION" package.json 2>/dev/null | sort -u)
57
+
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"
66
+
67
+ bun update --silent $MEISTRARI_LIBS_LIST_LOCAL_DIR --ignore-scripts
68
+ cd - > /dev/null
69
+ done
70
+
44
71
  elif test -f yarn.lock; then
45
72
  log_header "yarn.lock"
46
73
  yarn up $MEISTRARI_LIBS_LIST --ignore-scripts -r
74
+
47
75
  elif test -f package-lock.json; then
48
76
  log_header "package-lock.json"
49
77
  npm update $MEISTRARI_LIBS_LIST --ignore-scripts
78
+
50
79
  else
51
80
  echo "No recognized lock file found (pnpm-lock.yaml, yarn.lock, package-lock.json)"
52
81
  exit 1
@@ -54,4 +83,3 @@ if [ -n "$MEISTRARI_LIBS_LIST" ]; then
54
83
  else
55
84
  echo "No @meistrari/* libraries found in dependencies. Skipping update."
56
85
  fi
57
-