mirror of
https://github.com/unraid/api.git
synced 2026-04-30 12:10:15 -05:00
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:
@@ -49,12 +49,19 @@ try {
|
||||
|
||||
await writeFile('package.json', JSON.stringify(parsedPackageJson, null, 4));
|
||||
|
||||
await $`XZ_OPT=-5 tar -cJf packed-node-modules.tar.xz node_modules`;
|
||||
const compressionLevel = process.env.WATCH_MODE ? '-1' : '-5';
|
||||
await $`XZ_OPT=${compressionLevel} tar -cJf packed-node-modules.tar.xz node_modules`;
|
||||
// Create a subdirectory for the node modules archive
|
||||
await mkdir('../node-modules-archive', { recursive: true });
|
||||
await $`mv packed-node-modules.tar.xz ../node-modules-archive/`;
|
||||
await $`rm -rf node_modules`;
|
||||
|
||||
// Clean the release directory
|
||||
await $`rm -rf ../release/*`;
|
||||
|
||||
// Copy other files to release directory
|
||||
await $`cp -r ./* ../release/`;
|
||||
|
||||
// chmod the cli
|
||||
await $`chmod +x ./dist/cli.js`;
|
||||
await $`chmod +x ./dist/main.js`;
|
||||
|
||||
Reference in New Issue
Block a user