feat: slightly better watch mode (#1398)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added a script to automatically prepare UI components before running
the build watch process in the web app.
- **Bug Fixes**
- Improved build and release processes to ensure directories are
properly cleaned and created, preventing potential errors during Docker
operations.
- **Chores**
- Updated build watch scripts for faster development feedback and more
efficient parallel execution.
- Refined Docker Compose configuration to use the correct release
directory for plugin builds.
- Introduced a new script to streamline and centralize file watching and
build triggering in the plugin system.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Eli Bosley
2025-05-22 10:42:08 -07:00
committed by GitHub
parent 7067e9e3dd
commit 881f1e0960
9 changed files with 32 additions and 5 deletions
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
nodemon --verbose \
--watch 'source/**/*' \
--watch 'plugins/dynamix.unraid.net.plg' \
--ext ts,js,plg,sh,xz,json \
--ignore '*.test.ts' \
--ignore 'node_modules/**' \
--ignore 'source/dynamix.unraid.net/doinst.sh' \
--ignore 'source/dynamix.unraid.net/usr/local/share/dynamix.unraid.net/config/vendor_archive.json' \
--delay 30s \
--exec 'pnpm run build'
+8
View File
@@ -25,6 +25,14 @@ API_VERSION=$([[ -n "$IS_TAGGED" ]] && echo "$PACKAGE_LOCK_VERSION" || echo "${P
# Define container name for easier management
CONTAINER_NAME="plugin-builder"
# Create the directory if it doesn't exist
# This is to prevent errors when mounting volumes in docker compose
NUXT_COMPONENTS_DIR="../web/.nuxt/nuxt-custom-elements/dist/unraid-components"
if [ ! -d "$NUXT_COMPONENTS_DIR" ]; then
echo "Creating directory $NUXT_COMPONENTS_DIR for Docker volume mount..."
mkdir -p "$NUXT_COMPONENTS_DIR"
fi
# Stop any running plugin-builder container first
echo "Stopping any running plugin-builder containers..."
docker ps -q --filter "name=${CONTAINER_NAME}" | xargs -r docker stop