@mostajs/orm-cli 0.4.5 → 0.4.6
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/bin/mostajs.sh +24 -5
- package/package.json +1 -1
package/bin/mostajs.sh
CHANGED
|
@@ -98,13 +98,32 @@ ensure_pkg() {
|
|
|
98
98
|
warn "Missing package(s): ${missing[*]}"
|
|
99
99
|
if confirm "Install now with $PKG_MANAGER?"; then
|
|
100
100
|
cd "$PROJECT_ROOT" || return 1
|
|
101
|
+
local log_file="/tmp/mostajs-install-$$.log"
|
|
101
102
|
case "$PKG_MANAGER" in
|
|
102
|
-
pnpm) pnpm add "${missing[@]}" 2>&1
|
|
103
|
-
yarn) yarn add "${missing[@]}" 2>&1
|
|
104
|
-
bun) bun add "${missing[@]}" 2>&1
|
|
105
|
-
*) npm install --save "${missing[@]}" --legacy-peer-deps 2>&1
|
|
103
|
+
pnpm) pnpm add "${missing[@]}" >"$log_file" 2>&1 & ;;
|
|
104
|
+
yarn) yarn add "${missing[@]}" >"$log_file" 2>&1 & ;;
|
|
105
|
+
bun) bun add "${missing[@]}" >"$log_file" 2>&1 & ;;
|
|
106
|
+
*) npm install --save "${missing[@]}" --legacy-peer-deps >"$log_file" 2>&1 & ;;
|
|
106
107
|
esac
|
|
107
|
-
local
|
|
108
|
+
local install_pid=$!
|
|
109
|
+
# Braille spinner — visual feedback while the install runs in background
|
|
110
|
+
local frames='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
|
|
111
|
+
local tick=0
|
|
112
|
+
while kill -0 "$install_pid" 2>/dev/null; do
|
|
113
|
+
local f="${frames:$((tick % 10)):1}"
|
|
114
|
+
local secs=$((tick / 5))
|
|
115
|
+
printf "\r ${YELLOW}%s${RESET} installing ${CYAN}%s${RESET} ${DIM}(%ds)${RESET} " \
|
|
116
|
+
"$f" "${missing[*]}" "$secs"
|
|
117
|
+
tick=$(( tick + 1 ))
|
|
118
|
+
sleep 0.2
|
|
119
|
+
done
|
|
120
|
+
wait "$install_pid"
|
|
121
|
+
local rc=$?
|
|
122
|
+
# Clear the spinner line
|
|
123
|
+
printf "\r%80s\r" ""
|
|
124
|
+
# Show the last lines of the install log (errors or summary)
|
|
125
|
+
tail -5 "$log_file"
|
|
126
|
+
rm -f "$log_file"
|
|
108
127
|
if [[ $rc -ne 0 ]]; then
|
|
109
128
|
err "Install failed"
|
|
110
129
|
return $rc
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mostajs/orm-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Universal CLI to integrate @mostajs/orm into any project — one-shot `mostajs bootstrap` migrates a Prisma project (codemod + deps + schema convert + DDL) to 13 databases with zero code change.",
|
|
5
5
|
"author": "Dr Hamid MADANI <drmdh@msn.com>",
|
|
6
6
|
"license": "AGPL-3.0-or-later",
|