You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 49c317d
Browse filesBrowse the repository at this point in the historyBrowse files
Monorepo: Fix contributing link and include package coverage
The library documentation moved under packages/tailwind-merge, but its contributing link still used the old relative depth. Point it at the repository-wide contribution guide and document how to resolve cross-package documentation links after moves.
Expand the root Vitest coverage include pattern to every workspace package's source. CI now reports configurator and Vite-plugin coverage alongside the runtime library without introducing percentage thresholds. Document the root-only coverage setting and the limits of coverage from spawned processes.
Record the Windows-path investigation: Tailwind forwards relative JavaScript requests to enhanced-resolve, whose Windows path normalization resolves the reported mixed separators for nested and parent-directory requests. Keep a full Windows integration run as explicit follow-up work instead of making an unsupported loader change. Imported-file startup recovery was already fixed in the preceding commit and remains covered by regression tests.
All 425 tests pass on macOS and on Linux using CI's Node version. Lint, type checks, and the contributing page's local links also pass validation.
Copy file name to clipboardExpand all lines: agents/configurator.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,13 +78,15 @@ The test paths and bare inspector command below are relative to `packages/config
78
78
-`tests/vanilla-coverage.test.ts` is a ratchet against Tailwind itself (unclassified classes, consecutive pairs, cross-group exemplar pairs) with file snapshots of known divergences under `tests/__snapshots__/vanilla-coverage/`. Those lists name tailwind-merge default-config gaps as much as configurator ones; a new line after a change is something to look at, a removed line is a fix — update the snapshot deliberately, never blindly with `-u`. Divergences the library keeps on purpose (grid `col-start`/`col-end` before `col-span` per tailwind-merge#176, `sr-only` as a toggle) go into the file's `INTENTIONAL_DIVERGENCES` allowlist with a reason instead of the snapshots; a companion test fails when an allowlisted pair stops diverging, so stale entries get removed. The oracle itself stays a pure statement about compiled CSS — never encode library policy in `mergeVerdict`.
79
79
- To look at a surprising merge without writing a test: `node scripts/explain.mts <entrypoint.css> "<class list>" …` prints compiled declarations, class groups (generated and default), both merge results, and the oracle's verdict.
80
80
- Both packages sweep stale `tests/.tmp-*` directories in a Vitest `globalSetup` before workers start; keep scratch files under that prefix.
81
+
- Relative JavaScript requests can contain Windows separators: Tailwind's `loadModule` forwards them to enhanced-resolve, which uses Windows path normalization for drive-letter bases. The installed resolver was checked with nested and parent-directory requests using an emulated Windows filesystem; this is not a substitute for running generation, module-cache invalidation, and native watching on Windows. Do not infer a loader defect from backslashes alone.
81
82
- Tailwind's scanner (`@tailwindcss/oxide`) switches its ignore rules off for sources that sit inside gitignored paths (so `@source` can point into `node_modules`), and follows symlinks there. Both packages' temp test directories (`tests/.tmp-*`) are gitignored, so a scan rooted in one sees everything reachable from it: the Vite suite therefore nests copied fixtures one level below the temp directory and puts the `@tailwind-merge/vite` symlink at the temp directory's level (outside the Vite root), and the configurator's CLI `--prune` test scans a dedicated subdirectory. Any generated module inside a scanned directory counts as sources too — it is full of class-name literals.
82
83
83
84
Run `pnpm --filter @tailwind-merge/configurator test` and the matching `test:types` script for changes here, and the Vite suite for effects on generated behavior. Complete the repository-wide checks in [AGENTS.md](../AGENTS.md) before finalizing. CLI examples can be smoke-tested with `node packages/configurator/src/cli.ts` after building the workspace library.
84
85
85
86
## Remaining development work and revisit conditions
86
87
87
88
- Add a tested Tailwind version matrix before widening compatibility claims; declared peers are not coverage. The implementation baseline is 4.3.x, with unstable API drift a primary maintenance risk.
89
+
- Run the integration suites on Windows before claiming platform parity; current validation is on macOS and Linux, with only focused resolver checks for Windows paths.
88
90
- Keep absolute vanilla coverage in addition to differential conformance: default and generated configs can agree on the same bug. Review known divergence snapshots and the intentional-policy allowlist as the library evolves.
89
91
- Candidate upstream improvements are resolver/dependency hooks on `__unstable__loadDesignSystem` and exposed inline candidates on `compile()`. They would simplify the bundler loader adapter, dependency collection, and local safelist adapter; they are optional follow-ups, not prerequisites.
90
92
- Re-measure a specialized runtime only if usage pruning makes engine size dominant enough to justify duplicate semantics. The prior prebuilt-trie experiment doubled compressed config size to save less than a millisecond of one-time setup.
Copy file name to clipboardExpand all lines: agents/tailwind-merge-internals.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ This file is a practical map for agent-driven changes in this repo.
4
4
5
5
Since the 2026-08-10 monorepo migration the library lives in `packages/tailwind-merge/`; all `src/`, `tests/`, `docs/`, and `scripts/` paths in this file are relative to that package directory unless a path starts with `packages/` or `.github/`.
6
6
7
+
Links from the library's `docs/` to repository-wide files must traverse three parents; for example, `../../../.github/CONTRIBUTING.md`. Resolve relative links from the owning document after moving files, not from the repository root.
8
+
7
9
## How merge execution works
8
10
9
11
1.`twMerge` in `src/lib/tw-merge.ts` is created via `createTailwindMerge(getDefaultConfig)`.
@@ -87,6 +89,8 @@ Package-specific generation, scanning, and Vite test guidance lives in [configur
87
89
88
90
Vitest is set up as one project per package: each package's `vitest.config.mts` carries its aliases and plugins, and the root `vitest.config.mts` aggregates them (plus an inline project for `.github/actions/**/*.test.mjs`, since the local actions aren't workspace packages) so root `pnpm test` runs everything with coverage. Because collection is scoped to those projects, stray test files elsewhere in the repo — notably full repo copies in `.claude/` worktrees, which the pre-monorepo root config silently collected and ran as duplicates — never join the suite.
89
91
92
+
The root coverage configuration measures `packages/*/src/**/*.ts`, including the configurator and Vite plugin. In projects mode, package-local coverage settings do not control the aggregate report. Coverage is diagnostic, with no percentage threshold; use uncovered branches to guide behavioral tests rather than weakening assertions or padding the percentage. The Vitest report does not capture code executed by spawned CLI/build processes, so interpret unmeasured entrypoints alongside their integration tests.
93
+
90
94
Recommended local sequence for non-trivial changes:
Copy file name to clipboardExpand all lines: vitest.config.mts
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,8 @@ export default defineConfig({
15
15
},
16
16
],
17
17
coverage: {
18
-
// Coverage options are only picked up from the root config in projects mode. Scope matches the pre-monorepo setup: only the library is measured.
19
-
include: ['packages/tailwind-merge/src/**/*.ts'],
18
+
// Coverage options are only picked up from the root config in projects mode. Measure every package's source so build-time integrations have the same visibility as the runtime library.
0 commit comments