Skip to content

build: exclude vitest.config*.ts from production tsc output#46

Merged
alexgomezlf merged 1 commit into
mainfrom
exclude-vitest-config-from-dist
May 7, 2026
Merged

build: exclude vitest.config*.ts from production tsc output#46
alexgomezlf merged 1 commit into
mainfrom
exclude-vitest-config-from-dist

Conversation

@bzajzon-laserfiche
Copy link
Copy Markdown
Contributor

@bzajzon-laserfiche bzajzon-laserfiche commented May 5, 2026

Summary

Fast-follow on #44. After the jest → vitest migration, packages/lf-api-js/tsconfig.json and packages/lf-repository-api-client-v1/tsconfig.json were leaking the new vitest.config*.ts files into their published dist/ artifacts because their exclude lists covered test/, dist/, and jest.*.js but not the vitest counterparts.

packages/lf-repository-api-client-v2/tsconfig.json already excluded vitest.config*.ts. This PR brings the V1 client and the lf-api-js root package into line.

Changes

  • packages/lf-api-js/tsconfig.json — add "vitest.config*.ts" to exclude.
  • packages/lf-repository-api-client-v1/tsconfig.json — same.

Two-line patch.

Verification

Before fix: V1 emitted dist/vitest.config.{js,d.ts,js.map} + .browser variants; lf-api-js emitted dist/vitest.config.{js,d.ts,js.map}. After clean rebuild on this branch: both dist/ directories are vitest-config-free, and pnpm test still passes (vitest reads its config independently of tsc).

Why it matters

Without this, the npm artifact includes a test-only TypeScript config that imports the dev dependency vitest/config. Consumers installing the package would get extra files in their node_modules and a phantom dev-only import path — not a runtime break (the file isn't in the entry tree) but unwanted shipping noise.

This must land before publishing 1.1.0 from main so the released artifact is clean.

Test plan

  • Local clean rebuild produces no vitest.config* files in dist/ for either package.
  • pnpm --filter @laserfiche/lf-api-js run test passes.
  • CI green on this branch.

`packages/lf-api-js/tsconfig.json` and `packages/lf-repository-api-client-v1/tsconfig.json` default-include root *.ts files. Their `exclude` lists covered `test/`, `dist/`, and `jest.*.js` but not the new `vitest.config*.ts` files added in #44, so `tsc -b` was emitting `dist/vitest.config.{js,d.ts,js.map}` (and the `.browser` variant for V1) into the published artifact.

Add `vitest.config*.ts` to both excludes, matching what `lf-repository-api-client-v2` already does.

Verified by clean rebuild: `dist/` no longer contains vitest config files. Vitest tests still pass (vitest reads its config independent of tsc).
@alexgomezlf alexgomezlf merged commit eefb6b4 into main May 7, 2026
10 checks passed
@alexgomezlf alexgomezlf deleted the exclude-vitest-config-from-dist branch May 7, 2026 15:29
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.

2 participants