Repository navigation
fix(core): keep theme test files out of dist - #655
Merged
Merged
Conversation
`publicDir: "src/assets"` copies every file in src/assets into dist/, so semantic-contrast.test.ts and theme-bridge.test.ts were published to npm and, after a local build, ran twice under vitest. Move both tests to packages/core/tests/ next to the other CSS tests, and exclude dist/** from vitest so build output is never collected as tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`publicDir` copies all of src/assets into dist/, so a test file added there later would ship again. The dist/ exclusion in vitest also hides the duplicate run that would otherwise reveal it. Exclude `dist/**/*.test.*` in `files` so such a file never reaches npm. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Code Metrics Report
Details | | main (5db7473) | #655 (db163a3) | +/- |
|---------------------|----------------|----------------|------|
| Coverage | 89.5% | 89.5% | 0.0% |
| Files | 236 | 236 | 0 |
| Lines | 7512 | 7512 | 0 |
| Covered | 6727 | 6727 | 0 |
- | Test Execution Time | 2m7s | 3m6s | +59s |Reported by octocov |
IzumiSy
reviewed
Oct 28, 2026
| }, | ||
| "files": [ | ||
| "dist/**", | ||
| "!dist/**/*.test.*", |
| test: { | ||
| environment: "happy-dom", | ||
| // `pnpm build` writes to dist/. Keep any test file there out of the run. | ||
| exclude: [...configDefaults.exclude, "dist/**"], |
Contributor
There was a problem hiding this comment.
This seems redundunt. Why does pnpm build write files in dist?
Contributor
Author
|
@IzumiSy Thanks. You are right about both.
After #641 is merged, I will update this PR so that it only moves |
#641 removed semantic-contrast.test.ts and added the dist/** exclude, so this PR now only moves theme-bridge.test.ts out of src/assets. Drop the !dist/**/*.test.* guard in files: no test file is copied into dist/ now. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
IzumiSy
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/core/vite.config.tssetspublicDir: "src/assets", so the build copies every file insrc/assetsintodist/.theme-bridge.test.tswas insrc/assets, so it was copied intodist/and published to npm.@tailor-platform/app-shell@1.17.0containspackage/dist/theme-bridge.test.ts(andpackage/dist/semantic-contrast.test.ts, which #641 has removed).Changes
theme-bridge.test.tstopackages/core/tests/, next to the other CSS tests. The CSS paths now start from../src/assets, the same as intypography-compile.test.ts.typography-compile.test.tsthat points to this file.publicDiris not changed. Theme CSS, fonts and the other assets still ship as before.After #641, this PR no longer changes
vitest.config.ts(#641 added thedist/**exclude) orsemantic-contrast.test.ts(#641 removed it). The!dist/**/*.test.*entry infilesis also removed: no test file is insrc/assetsnow, so nothing copies one intodist/.Verification
pnpm build,packages/core/dist/has no*.test.*files.npm pack --dry-runinpackages/corelists no test files.fmt:check,lint,type-check,test,docs:checkandbuildpass.🤖 Generated with Claude Code