Skip to content

Commit 27d6ed5

Browse files
committed
fix(build): only clean dist for the packages being built
Purging every dist folder from the root build script meant a filtered build like pnpm build --filter=@statsify/util emptied the dist of every app it did not rebuild. Add a per-package clean task that build depends on, so turbo cleans exactly the packages it is about to build or restore from cache, including under turbo watch.
1 parent df1e2a9 commit 27d6ed5

14 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎apps/api/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"scripts": {
88
"start": "node --enable-source-maps .",
99
"build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths --delete-dir-on-start",
10+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
1011
"typecheck": "tsc --noEmit",
1112
"lint": "oxlint",
1213
"lint:ci": "oxlint --format=github"

‎apps/discord-bot/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"scripts": {
88
"start": "node --enable-source-maps .",
99
"build": "swc src --out-dir dist --strip-leading-paths --delete-dir-on-start",
10+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
1011
"typecheck": "tsc --noEmit",
1112
"lint": "oxlint",
1213
"lint:ci": "oxlint --format=github"

‎apps/support-bot/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"scripts": {
88
"start": "node --enable-source-maps .",
99
"build": "swc src --out-dir dist --strip-leading-paths --delete-dir-on-start",
10+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
1011
"typecheck": "tsc --noEmit",
1112
"lint": "oxlint",
1213
"lint:ci": "oxlint --format=github"

‎apps/verify-server/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"scripts": {
88
"start": "node --enable-source-maps .",
99
"build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths --delete-dir-on-start",
10+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
1011
"typecheck": "tsc --noEmit",
1112
"lint": "oxlint",
1213
"lint:ci": "oxlint --format=github"

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"url": "git+https://github.com/Statsify/statsify.git"
1010
},
1111
"scripts": {
12-
"build": "pnpm scripts purge --dist && turbo run build --filter=!site",
13-
"build:watch": "pnpm scripts purge --dist && turbo watch build --filter=!site",
12+
"build": "turbo run build --filter=!site",
13+
"build:watch": "turbo watch build --filter=!site",
1414
"typecheck": "turbo run typecheck",
1515
"test": "vitest",
1616
"test:ui": "vitest --ui",

‎packages/api-client/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths --delete-dir-on-start",
9+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
910
"typecheck": "tsc --noEmit",
1011
"lint": "oxlint",
1112
"lint:ci": "oxlint --format=github"

‎packages/assets/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths --delete-dir-on-start",
9+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
910
"typecheck": "tsc --noEmit",
1011
"lint": "oxlint",
1112
"lint:ci": "oxlint --format=github"

‎packages/discord/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths --delete-dir-on-start",
9+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
910
"typecheck": "tsc --noEmit",
1011
"lint": "oxlint",
1112
"lint:ci": "oxlint --format=github"

‎packages/logger/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths --delete-dir-on-start",
9+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
910
"typecheck": "tsc --noEmit",
1011
"lint": "oxlint",
1112
"lint:ci": "oxlint --format=github"

‎packages/math/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "module",
77
"scripts": {
88
"build": "swc src --config-file ../../.swcrc --out-dir dist --strip-leading-paths --delete-dir-on-start",
9+
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\"",
910
"typecheck": "tsc --noEmit",
1011
"lint": "oxlint",
1112
"lint:ci": "oxlint --format=github"

0 commit comments

Comments
 (0)