fix: unbreak build.sh in standalone mode#22
Merged
Conversation
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.
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.
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.
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.
This was referenced Apr 20, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Decky plugin's
build.shwas broken end-to-end in standalone mode and relied onnpm/pnpm/yarnbeing present locally — but the monorepo'sbuild_all.shalready mandatesbun, leaving the two scripts inconsistent. This PR makesbuild.shwork withbunand fixes two latent bugs that prevented the standalone build from ever completing.Changes (4 atomic commits)
fix: detect bun as package manager in build.sh— addbunas the first option indetect_pm(), matching the monorepo's requirement. Updated the error message to recommendbunovertoolbox/rpm-ostree.fix: reorder build.sh steps to avoid dist being wiped by frontend build—package.json's build script runsshx rm -rf dist, which wiped$BUILD_DIRseconds after it was created. Moved the "clean plugin output" step after the frontend build so$BUILD_DIRsurvives for the copy phase.fix: use build/ dir for standalone plugin output to avoid self-copy loop— in standalone mode,$DIST_DIRcollided with rollup's./dist/, makingcp -r dist "$BUILD_DIR/"try to copy./distinto itself. Submodule mode keeps using$ROOT_DIR/dist(the monorepo'sdist/), where the collision never existed.chore: ignore standalone build/ output dir— keep the newbuild/dir out of version control.Context
Ran
./build_all.shfrom the monorepo: step [6/6] failed withERROR: No package manager foundyet the summary reported a false ✓ thanks to a stale ZIP indist/decky/from a previous build with npm. The failure had been masked by cached artifacts.Test plan
./build.shfromdecky-capydeploystandalone producesbuild/decky/CapyDeploy-v1.0.2.zipsuccessfully./build_all.shfrom the monorepo completes step [6/6] with a fresh ZIP once the submodule pointer is bumped (follow-up PR)