Skip to content

fix: exclude test files from the published build#276

Open
ivanauth wants to merge 3 commits into
authzed:mainfrom
ivanauth:fix/issue-161-exclude-test-builds
Open

fix: exclude test files from the published build#276
ivanauth wants to merge 3 commits into
authzed:mainfrom
ivanauth:fix/issue-161-exclude-test-builds

Conversation

@ivanauth

@ivanauth ivanauth commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #161.

*.test.ts files were compiled into dist/ and published to npm. The
tsconfig exclude pattern was src/**/*.test.*/*, whose trailing /*
only matches files inside a directory named like *.test.* (never
exists), so it excluded nothing.

Fixing the glob alone would break the build-js-client CI job, which
compiles into js-dist/ and runs the tests there. So this splits the
config:

  • tsconfig.json: excludes only node_modules - tests stay included for
    editor type-checking and the build-js-client CI job.
  • tsconfig.build.json (new): extends tsconfig.json and excludes
    src/**/.test.; the build script uses it for the published dist/.

Verified: pnpm build emits 0 test artifacts into dist/ (was 12) and
npm pack --dry-run ships zero test files; pnpm build-js-client still
emits its test files into js-dist/ so that CI job is unaffected.

ivanauth added 3 commits June 16, 2026 20:12
Excluding tests in the shared tsconfig broke the js-client CI job, which
builds with build-js-client into js-dist and runs vitest there against
the emitted test files. Keep tests in the default project (editor and
js-dist unchanged) and add tsconfig.build.json, used by the build
script, to exclude them from dist/ and the published package.
@ivanauth ivanauth requested a review from a team as a code owner July 9, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exclude test files from builds

1 participant