@meistrari/mise-en-place 2.4.1 → 2.4.3
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 +1 -1
- package/scripts/postinstall.sh +18 -1
package/package.json
CHANGED
package/scripts/postinstall.sh
CHANGED
|
@@ -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,24 @@ 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
|
+
ADD_CARET_JQ='with_entries(if .key | startswith("@meistrari/") then .value |= (if startswith("^") then . else "^" + . end) else . end)'
|
|
55
|
+
jq --indent 4 "if .dependencies then .dependencies |= $ADD_CARET_JQ else . end" package.json > package.json.tmp && mv package.json.tmp package.json
|
|
56
|
+
jq --indent 4 "if .devDependencies then .devDependencies |= $ADD_CARET_JQ else . end" package.json > package.json.tmp && mv package.json.tmp package.json
|
|
57
|
+
|
|
48
58
|
MEISTRARI_LIBS_LIST_LOCAL_DIR=$(jq -r "$JQ_EXPRESSION" package.json 2>/dev/null | sort -u)
|
|
49
59
|
|
|
50
|
-
|
|
60
|
+
# If no libraries, skip
|
|
61
|
+
if [ -z "$MEISTRARI_LIBS_LIST_LOCAL_DIR" ]; then
|
|
62
|
+
echo "No @meistrari/* libraries found in $PKG_JSON_DIR. Skipping."
|
|
63
|
+
cd - > /dev/null
|
|
64
|
+
continue
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
echo "Updating $(echo $MEISTRARI_LIBS_LIST_LOCAL_DIR | tr '\n' ' ') libraries in $PKG_JSON_DIR"
|
|
51
68
|
|
|
52
69
|
bun update --silent $MEISTRARI_LIBS_LIST_LOCAL_DIR --ignore-scripts
|
|
53
70
|
cd - > /dev/null
|