diff --git a/cleanup.sh b/cleanup.sh new file mode 100755 index 0000000000..ad64ca097f --- /dev/null +++ b/cleanup.sh @@ -0,0 +1,18 @@ +#!/bin/bash + + +set -euo pipefail + +echo "Removing dependency, build, and cache directories..." + +find . -name 'node_modules' -type d -prune -exec rm -rf '{}' + +find . -name 'lib' -type d -prune -exec rm -rf '{}' + +find . -name 'build' -type d -prune -exec rm -rf '{}' + +find . -name 'dist' -type d -prune -exec rm -rf '{}' + +find . -name '.vite' -type d -prune -exec rm -rf '{}' + +find . -name '.cache' -type d -prune -exec rm -rf '{}' + +find . -name '.pnpm-store' -type d -prune -exec rm -rf '{}' + +find . -name '.eslintcache' -type f -delete +find . -name '*.tsbuildinfo' -type f -delete + +echo "Cleanup completed." \ No newline at end of file diff --git a/package.json b/package.json index 38b32990e5..10967c5305 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ "local:version-snapshot": "pnpm -r exec pnpm version prepatch --preid $(cat /dev/urandom | LC_ALL=C tr -dc 'a-z' | fold -w 8 | head -n 1)", "local:publish-snapshot": "pnpm -r publish --access public --no-git-checks --registry http://localhost:4873", "local:dangerously-undo-version-snapshot": "git restore --source=$(git branch --show-current) '**/*/package.json'", - "local:release": "pnpm build && pnpm dts && pnpm local:version-snapshot && pnpm local:publish-snapshot && pnpm local:dangerously-undo-version-snapshot && echo \"now execute\npnpm up -r -L '@webstudio-is/*' --registry http://localhost:4873\"" + "local:release": "pnpm build && pnpm dts && pnpm local:version-snapshot && pnpm local:publish-snapshot && pnpm local:dangerously-undo-version-snapshot && echo \"now execute\npnpm up -r -L '@webstudio-is/*' --registry http://localhost:4873\"", + "clean:deep": "bash ./cleanup.sh" }, "simple-git-hooks": { "pre-commit": "./node_modules/.bin/nano-staged"