fix: polish workspace files and editor shell

This commit is contained in:
2026-06-19 23:37:10 +08:00
parent a6412fa070
commit 5c979174f1
23 changed files with 497 additions and 249 deletions
+15 -17
View File
@@ -15,34 +15,34 @@ if [ ! -d "$OFFICIAL_PLUGINS" ]; then
exit 1
fi
# ── ensure dist package exists ──
DIST_PACKAGE="$OFFICIAL_PLUGINS/dist/platform-test"
if [ ! -d "$DIST_PACKAGE" ]; then
echo " ️ dist package not found at $DIST_PACKAGE"
# ── ensure dist packages exist ──
DIST_ROOT="$OFFICIAL_PLUGINS/dist"
if [ ! -d "$DIST_ROOT" ] || [ -z "$(find "$DIST_ROOT" -mindepth 1 -maxdepth 1 -type d 2>/dev/null)" ]; then
echo " ️ dist packages not found at $DIST_ROOT"
echo " → Running build.sh in verstak-official-plugins..."
(cd "$OFFICIAL_PLUGINS" && ./scripts/build.sh)
echo ""
if [ ! -d "$DIST_PACKAGE" ]; then
echo "❌ dist package still missing after build"
if [ ! -d "$DIST_ROOT" ] || [ -z "$(find "$DIST_ROOT" -mindepth 1 -maxdepth 1 -type d 2>/dev/null)" ]; then
echo "❌ dist packages still missing after build"
exit 1
fi
fi
# ── create ./plugins/platform-test ──
PLUGIN_DIR="$ROOT/plugins/platform-test"
echo " → installing platform-test to $PLUGIN_DIR"
# ── create ./plugins/* from official dist packages ──
PLUGIN_DIR="$ROOT/plugins"
echo " → installing official plugins to $PLUGIN_DIR"
mkdir -p "$ROOT/plugins"
# Clean up any leftover temp directories
for tmp in "$ROOT/plugins"/.platform-test-tmp.*; do
for tmp in "$ROOT"/.official-plugins-tmp.*; do
[ -d "$tmp" ] && rm -rf "$tmp"
done
# Atomic replace: install to temp then rename
TMP_DIR=$(mktemp -d "$ROOT/plugins/.platform-test-tmp.XXXXXX")
cp -r "$DIST_PACKAGE/." "$TMP_DIR/"
# Remove old directory (fix permissions first if needed)
TMP_DIR=$(mktemp -d "$ROOT/.official-plugins-tmp.XXXXXX")
cp -r "$DIST_ROOT/"* "$TMP_DIR/"
# Remove old plugin directories (fix permissions first if needed)
if [ -d "$PLUGIN_DIR" ]; then
chmod -R u+rwx "$PLUGIN_DIR" 2>/dev/null || true
rm -rf "$PLUGIN_DIR"
@@ -50,14 +50,12 @@ fi
mv "$TMP_DIR" "$PLUGIN_DIR"
# ── verify ──
if [ -f "$PLUGIN_DIR/plugin.json" ]; then
PLUGIN_ID=$(python3 -c "import json; print(json.load(open('$PLUGIN_DIR/plugin.json')).get('id','unknown'))" 2>/dev/null || echo "unknown")
if [ -d "$PLUGIN_DIR" ]; then
FILE_COUNT=$(find "$PLUGIN_DIR" -type f | wc -l)
echo " ✅ installed: $PLUGIN_DIR"
echo " plugin id: $PLUGIN_ID"
echo " files: $FILE_COUNT"
else
echo "❌ install failed: plugin.json missing in $PLUGIN_DIR"
echo "❌ install failed: $PLUGIN_DIR missing"
exit 1
fi
+5 -33
View File
@@ -29,49 +29,21 @@ OFFICIAL="$VERSTAK_ROOT/verstak-official-plugins"
if [ ! -d "$OFFICIAL" ]; then
echo " ⚠️ verstak-official-plugins not found — skipping"
else
# npm deps
if [ ! -d "$OFFICIAL/node_modules" ] && [ -f "$OFFICIAL/package.json" ]; then
echo " 📦 installing npm deps..."
(cd "$OFFICIAL" && npm install --no-audit --no-fund)
fi
# Build each plugin that has a frontend or backend
for plugin_dir in "$OFFICIAL"/plugins/*/; do
[ -d "$plugin_dir" ] || continue
plugin_name="$(basename "$plugin_dir")"
# Frontend build
fe_dir="$plugin_dir/frontend"
if [ -d "$fe_dir" ] && [ -f "$fe_dir/package.json" ]; then
echo "[$plugin_name] building frontend..."
if [ ! -d "$fe_dir/node_modules" ]; then
(cd "$fe_dir" && npm install --no-audit --no-fund)
fi
(cd "$fe_dir" && npm run build)
echo "$plugin_name frontend"
fi
# Backend build
backend_dir="$plugin_dir/backend"
if [ -f "$backend_dir/main.go" ]; then
echo "[$plugin_name] building backend..."
(cd "$backend_dir" && go build -o "$(basename "$backend_dir")" .)
echo "$plugin_name backend"
fi
done
(cd "$OFFICIAL" && ./scripts/build.sh)
echo " ✅ official plugins built"
fi
# ── 3. Copy plugins to desktop ──
# ── 3. Copy plugin packages to desktop ──
echo ""
echo "=== install plugins to desktop ==="
DEST="$ROOT/plugins"
rm -rf "$DEST"
mkdir -p "$DEST"
if [ -d "$OFFICIAL/plugins" ]; then
cp -r "$OFFICIAL/plugins/"* "$DEST/" 2>/dev/null
if [ -d "$OFFICIAL/dist" ] && [ -n "$(find "$OFFICIAL/dist" -mindepth 1 -maxdepth 1 -type d 2>/dev/null)" ]; then
cp -r "$OFFICIAL/dist/"* "$DEST/" 2>/dev/null
echo " ✅ plugins copied to $DEST"
else
echo " ️ no plugins to copy"
echo " ️ no plugin packages to copy"
fi
# ── 4. Build desktop ──