From ea545404e359075dda692bf3219344324cdbe11e Mon Sep 17 00:00:00 2001 From: Matias Galarza Date: Mon, 20 Apr 2026 09:01:06 -0300 Subject: [PATCH 1/4] fix: detect bun as package manager in build.sh Align build.sh with the monorepo's build_all.sh which already requires bun. Previously the script only checked for npm/pnpm/yarn, making local builds fail on setups that only have bun installed. Bun is now detected first (preferred), with npm/pnpm/yarn kept as fallbacks. Updated the error message to recommend bun over Node.js. --- build.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index 766e15b..6f40e1c 100644 --- a/build.sh +++ b/build.sh @@ -21,9 +21,11 @@ BUILD_DIR="$OUTPUT_DIR/$PLUGIN_NAME" echo "=== Building $PLUGIN_NAME v$VERSION ===" -# Detect package manager +# Detect package manager (bun is preferred — matches the monorepo's build_all.sh) detect_pm() { - if command -v pnpm &> /dev/null; then + if command -v bun &> /dev/null; then + echo "bun" + elif command -v pnpm &> /dev/null; then echo "pnpm" elif command -v yarn &> /dev/null; then echo "yarn" @@ -37,12 +39,11 @@ detect_pm() { PM=$(detect_pm) if [ -z "$PM" ]; then - echo "ERROR: No package manager found (npm, pnpm, or yarn)" + echo "ERROR: No package manager found (bun, npm, pnpm, or yarn)" echo "" - echo "Install Node.js first:" - echo " Option 1: toolbox create dev && toolbox enter dev && sudo dnf install nodejs" - echo " Option 2: rpm-ostree install nodejs && systemctl reboot" - echo " Option 3: curl -fsSL https://fnm.vercel.app/install | bash" + echo "Install one of the following:" + echo " Recommended: curl -fsSL https://bun.sh/install | bash" + echo " Alternative: curl -fsSL https://fnm.vercel.app/install | bash # then: fnm install --lts" exit 1 fi From f0739cfdf990b7bf4a4e184b87641ccf5637e707 Mon Sep 17 00:00:00 2001 From: Matias Galarza Date: Mon, 20 Apr 2026 09:07:41 -0300 Subject: [PATCH 2/4] fix: reorder build.sh steps to avoid dist being wiped by frontend build The package.json build script runs `shx rm -rf dist && rollup -c`, which wipes the entire dist/ directory. Previously, build.sh created $BUILD_DIR (which lives under dist/ in standalone mode) *before* invoking the frontend build, so it got deleted seconds later and the subsequent cp calls failed. Move the "clean previous plugin output" step to after the frontend build, so $BUILD_DIR survives for the file-copy phase. --- build.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 6f40e1c..addc91f 100644 --- a/build.sh +++ b/build.sh @@ -49,20 +49,21 @@ fi echo "Using package manager: $PM" -# Clean previous builds -rm -rf "$OUTPUT_DIR" -mkdir -p "$BUILD_DIR" - # Install dependencies if needed if [ ! -d "node_modules" ]; then echo "Installing dependencies..." $PM install fi -# Build frontend +# Build frontend — the package.json build script runs `shx rm -rf dist`, +# so any plugin output under $OUTPUT_DIR must be created *after* this step. echo "Building frontend..." $PM run build +# Clean previous plugin output and prepare build directory +rm -rf "$OUTPUT_DIR" +mkdir -p "$BUILD_DIR" + # Install Python dependencies into py_modules (bundled with the plugin) echo "Installing Python dependencies..." rm -rf py_modules From 8c8863c16f39ccefc4cd28de0e9c5750372600f7 Mon Sep 17 00:00:00 2001 From: Matias Galarza Date: Mon, 20 Apr 2026 09:08:41 -0300 Subject: [PATCH 3/4] fix: use build/ dir for standalone plugin output to avoid self-copy loop In standalone mode $DIST_DIR was $ROOT_DIR/dist, which collides with the frontend bundle directory owned by rollup. This made the later `cp -r dist "$BUILD_DIR/"` call try to copy ./dist into itself and abort with "cannot copy a directory into itself". Use $ROOT_DIR/build for standalone output so the plugin ZIP lives outside rollup's territory. Submodule mode keeps using $ROOT_DIR/dist (the monorepo's dist/) where the collision never existed. --- build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index addc91f..99eaefd 100644 --- a/build.sh +++ b/build.sh @@ -6,13 +6,16 @@ set -e SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$SCRIPT_DIR" -# Project directories — detect monorepo (submodule) or standalone +# Project directories — detect monorepo (submodule) or standalone. +# In standalone mode the plugin output cannot live under ./dist because +# rollup owns that path and wipes it on every build (shx rm -rf dist). if [ -f "../../../VERSION" ]; then ROOT_DIR="$(cd ../../.. && pwd)" + DIST_DIR="$ROOT_DIR/dist" else ROOT_DIR="$SCRIPT_DIR" + DIST_DIR="$ROOT_DIR/build" fi -DIST_DIR="$ROOT_DIR/dist" PLUGIN_NAME="CapyDeploy" VERSION=$(grep '"version"' package.json | head -1 | sed 's/.*: "\([^"]*\)".*/\1/') From 6ce2cf2e18491f5c2cf03a6d7d0886e4751d5cf3 Mon Sep 17 00:00:00 2001 From: Matias Galarza Date: Mon, 20 Apr 2026 09:09:15 -0300 Subject: [PATCH 4/4] chore: ignore standalone build/ output dir The standalone build mode now writes to ./build/ (separate from rollup's ./dist/). Keep it out of version control alongside the other build artifact directories. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 700c390..3bd638e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ yarn.lock # Build output dist/ out/ +build/ *.zip # Python