From df1658d92353dca3dff32cb3366267948e3b7f00 Mon Sep 17 00:00:00 2001 From: Fleny Date: Wed, 17 Sep 2025 21:28:00 +0200 Subject: [PATCH] build(packages): Remove swc `--delete-dir-on-start` (#4433) Since we build the .js files and the .d.ts files in 2 different steps, you could run the tsc build and then the swc one, making swc delete the tsc build. This is somewhat mitigated if you ran the tsc build with turbo as it will restore the cache, but it is annoying + the TS server in vscode for example will someone require you to restart it as it did not found the declration files for the package while it was building. I did not find any good reason for this flag to be present, as while it will preserve files that no longer have a source, this matters only for local builds, as CI will always cleanly build the packages (and this issue exists with type declration as well anyway) Co-authored-by: Awesome Stickz --- packages/benchmarks/package.json | 2 +- packages/bot/package.json | 2 +- packages/discordeno/package.json | 2 +- packages/gateway/package.json | 2 +- packages/rest/package.json | 2 +- packages/types/package.json | 2 +- packages/utils/package.json | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/benchmarks/package.json b/packages/benchmarks/package.json index 9daab70ea..09bfc1cd2 100644 --- a/packages/benchmarks/package.json +++ b/packages/benchmarks/package.json @@ -10,7 +10,7 @@ "url": "git+https://github.com/discordeno/discordeno.git" }, "scripts": { - "build": "swc src --strip-leading-paths --delete-dir-on-start --out-dir dist", + "build": "swc src --strip-leading-paths --out-dir dist", "build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist", "release-build": "yarn build && yarn build:type", "check": "biome check --write", diff --git a/packages/bot/package.json b/packages/bot/package.json index ec202fdcf..6887eab3c 100644 --- a/packages/bot/package.json +++ b/packages/bot/package.json @@ -13,7 +13,7 @@ "!dist/.tsbuildinfo" ], "scripts": { - "build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist", + "build": "swc src --strip-leading-paths src --out-dir dist", "build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist", "release-build": "yarn build && yarn build:type", "check": "biome check --write", diff --git a/packages/discordeno/package.json b/packages/discordeno/package.json index a23c3719d..2babbba56 100644 --- a/packages/discordeno/package.json +++ b/packages/discordeno/package.json @@ -13,7 +13,7 @@ "!dist/.tsbuildinfo" ], "scripts": { - "build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist", + "build": "swc src --strip-leading-paths src --out-dir dist", "build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist", "release-build": "yarn build && yarn build:type", "check": "biome check --write", diff --git a/packages/gateway/package.json b/packages/gateway/package.json index 9d53486e5..6e481d80b 100644 --- a/packages/gateway/package.json +++ b/packages/gateway/package.json @@ -13,7 +13,7 @@ "!dist/.tsbuildinfo" ], "scripts": { - "build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist", + "build": "swc src --strip-leading-paths src --out-dir dist", "build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist", "release-build": "yarn build && yarn build:type", "check": "biome check --write", diff --git a/packages/rest/package.json b/packages/rest/package.json index 38a6a9e77..7be23cf53 100644 --- a/packages/rest/package.json +++ b/packages/rest/package.json @@ -13,7 +13,7 @@ "!dist/.tsbuildinfo" ], "scripts": { - "build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist", + "build": "swc src --strip-leading-paths src --out-dir dist", "build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist", "release-build": "yarn build && yarn build:type", "check": "biome check --write", diff --git a/packages/types/package.json b/packages/types/package.json index a704b45ba..48f1ece27 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -13,7 +13,7 @@ "!dist/.tsbuildinfo" ], "scripts": { - "build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist", + "build": "swc src --strip-leading-paths src --out-dir dist", "build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist", "release-build": "yarn build && yarn build:type", "check": "biome check --write", diff --git a/packages/utils/package.json b/packages/utils/package.json index 238d5ab0b..248bcaded 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -13,7 +13,7 @@ "!dist/.tsbuildinfo" ], "scripts": { - "build": "swc src --strip-leading-paths --delete-dir-on-start src --out-dir dist", + "build": "swc src --strip-leading-paths src --out-dir dist", "build:type": "tsc --declaration --emitDeclarationOnly --declarationDir dist", "release-build": "yarn build && yarn build:type", "check": "biome check --write",