From 37824edf06ea26ee598fbb8c2d702eefd6f7c834 Mon Sep 17 00:00:00 2001 From: Amir Date: Thu, 21 May 2026 13:13:56 +0200 Subject: [PATCH] build: stop compiling test files into dist `tsconfig.cjs.json` and `tsconfig.esm.json` were inheriting only the root `exclude` and so were compiling every `*.test.ts` into `dist/cjs/` and `dist/esm/`. The tarball then filtered them back out via `files`, but the build itself was doing wasted work and the glob list in `package.json` was carrying dead patterns (`!dist/testUtils`, `!dist/scratch.*`) that didn't match anything. Matched `todoist-sdk-typescript`'s pattern: exclude `**/*.test.ts` in both tsconfigs and keep the tarball filter to `!dist/**/*.test.js` + `!dist/**/*.test.d.ts`. Co-Authored-By: Claude Opus 4.7 (1M context) --- package.json | 5 ++--- tsconfig.cjs.json | 1 + tsconfig.esm.json | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8a4c95d..b2235db 100644 --- a/package.json +++ b/package.json @@ -83,8 +83,7 @@ "dist/cjs/**/*", "dist/esm/**/*", "dist/types/**/*", - "!dist/**/*.test.*", - "!dist/testUtils", - "!dist/scratch.*" + "!dist/**/*.test.js", + "!dist/**/*.test.d.ts" ] } diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index a250414..e7030ff 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -1,5 +1,6 @@ { "extends": "./tsconfig.json", + "exclude": ["node_modules", "dist", "**/testData", "**/*.test.ts"], "compilerOptions": { "module": "commonjs", "outDir": "dist/cjs", diff --git a/tsconfig.esm.json b/tsconfig.esm.json index 8d7962f..ee07e0c 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -1,5 +1,6 @@ { "extends": "./tsconfig.json", + "exclude": ["node_modules", "dist", "**/testData", "**/*.test.ts"], "compilerOptions": { "module": "esnext", "moduleResolution": "bundler",