@meistrari/mise-en-place 2.4.3 → 2.4.5
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 +15 -8
package/package.json
CHANGED
package/scripts/postinstall.sh
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
|
|
3
|
-
set -
|
|
3
|
+
set -eu
|
|
4
4
|
|
|
5
5
|
if test -f Makefile; then
|
|
6
6
|
echo 'Makefile already exists. Skipping initial Makefile generation'
|
|
@@ -28,6 +28,20 @@ else
|
|
|
28
28
|
MEISTRARI_LIBS_LIST=$(jq -r "$JQ_EXPRESSION" package.json 2>/dev/null | sort -u)
|
|
29
29
|
fi
|
|
30
30
|
|
|
31
|
+
# Ensure all @meistrari/* dependencies have caret (^) in all package.json files
|
|
32
|
+
for pkg_json in $PACKAGE_JSONS; do
|
|
33
|
+
PKG_JSON_DIR=$(dirname "$pkg_json")
|
|
34
|
+
cd "$PKG_JSON_DIR"
|
|
35
|
+
|
|
36
|
+
# Add caret (^) to each library that starts with @meistrari/ (if not already present)
|
|
37
|
+
# The line `"@meistrari/logger": "2.1.1"` becomes `"@meistrari/logger": "^2.1.1"`
|
|
38
|
+
# But `"@meistrari/logger": "^2.1.1"` stays as `"^2.1.1"` (no double caret)
|
|
39
|
+
ADD_CARET_JQ='with_entries(if .key | startswith("@meistrari/") then .value |= (if startswith("^") then . else "^" + . end) else . end)'
|
|
40
|
+
jq --indent 4 "if .dependencies then .dependencies |= $ADD_CARET_JQ else . end" package.json > package.json.tmp && mv package.json.tmp package.json
|
|
41
|
+
jq --indent 4 "if .devDependencies then .devDependencies |= $ADD_CARET_JQ else . end" package.json > package.json.tmp && mv package.json.tmp package.json
|
|
42
|
+
cd - > /dev/null
|
|
43
|
+
done
|
|
44
|
+
|
|
31
45
|
log_header () {
|
|
32
46
|
echo "File '$1' present. Updating @meistrari/* libraries..."
|
|
33
47
|
}
|
|
@@ -48,13 +62,6 @@ if [ -n "$MEISTRARI_LIBS_LIST" ]; then
|
|
|
48
62
|
PKG_JSON_DIR=$(dirname "$pkg_json")
|
|
49
63
|
cd "$PKG_JSON_DIR"
|
|
50
64
|
|
|
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
|
-
|
|
58
65
|
MEISTRARI_LIBS_LIST_LOCAL_DIR=$(jq -r "$JQ_EXPRESSION" package.json 2>/dev/null | sort -u)
|
|
59
66
|
|
|
60
67
|
# If no libraries, skip
|