test(components): build path expectations with pathe, not node:path - #427
Merged
Conversation
Port of nuxt/ui@ccd48940. The spec built its expected paths with `node:path` while the module under test builds them with `pathe`. On Windows those disagree — `node:path` emits backslashes, `pathe` forward slashes — so the assertions compared two spellings of the same directory and failed. The defect is ours in full. `src/utils/components.ts` imports `dirname`, `join`, `normalize` and `resolve` from `pathe`, so `resolveExtraScanDirs` emits forward slashes, and the spec compared against `node:path` output in the two places fed by `fixtureRoot()`: `.toEqual([outside])` and `.toEqual([join(outside, 'components')])`. `normalize` is needed on top of the import switch because `realpathSync` comes from `node:fs` and returns native separators regardless. `pathe` is already a root dependency, so nothing new is pulled in, and no `node:path` import remains in the file. This cannot be demonstrated on Linux, which is worth stating plainly rather than implying coverage. On POSIX `pathe.join` and `node:path.join` return identical strings and `normalize` is an identity on an already-normal path — checked, both give `/tmp/x/z` — so the suite is green before and after and no mutation can turn it red here. What is verifiable locally is the mechanism: implementation and test now use the same module, and the two comparison sites are exactly the ones consuming `fixtureRoot()`. The Windows behaviour rests on upstream's report, not on a run here. Verify (CI=true): lint · typecheck · test (6622 passed, 6 skipped, 288 files) · build — all green. No docs:generate; the commit touches no docs/.
IgorShevchik
pushed a commit
that referenced
this pull request
Aug 20, 2026
release-please parses every commit with `@conventional-commits/parser`, and when the parse throws it catches, writes two `logger.debug` lines and moves on. Nothing turns red: CI is green, the release PR renders normally, and the commit is simply absent. dcb3bac — `test(components): build path expectations with pathe, not node:path (#427)` — went missing from the 2.12.0 notes that way; the range holds seven `test:` commits and the notes list six. Fidelity is measured, not assumed. Over all 3240 commits on `main`, this oracle and release-please's own `parseConventionalCommits` agree on every one: 67 rejected by both, zero disagreements in either direction. The hazard is live at roughly one commit in a hundred in the current style, and every one of the 29 line-leading call tokens in the whole history sits in the last 400 commits. The trigger is broader than nested parentheses, which is what this commit first claimed. A body line beginning with a call-like token arms the parser's scope rule, which then rejects unless the very next `(`, `)` or line-end is a `)`. So an unclosed call — `writeTemplates(config.root` running to end of line, or a call wrapped across two lines — fails identically. Any `:` or `!` before the paren disarms it, as does one space of indentation, and only the first group on the line is scanned. The reliable repairs are indenting or prefixing; reflowing works only where the parentheses balance once joined. More importantly, 64 of the 67 real rejections are on the SUBJECT, not in the body — missing colons, `Revert "…"`, a space between type and scope. The first version of the error text sent all of them hunting for nested parens in a body that does not have them, while the parser's own message pointed at line 1. The guard now branches on the reported position and lists the shapes for each. Merge commits are exempt. Their subject is `Merge pull request …`, which the parser rejects and release-please is right to drop — failing there would redden `main` for correct behaviour. Thirteen exist in this history, the last from 2026-05-07. The parser is an ordinary devDependency. `pnpm add`-ing it downgraded TypeScript 6.0.3 to 5.9.3, which this commit first blamed on the package; the cause is that `typescript` is a non-optional peer not listed in devDependencies while `@nuxt/module-builder` peers `^5.9.3`, so any root `pnpm add` does it (#451). Appending to `package.json` by hand and running `pnpm install` gives a 33-line pure-addition lockfile diff with `typescript` untouched — so the CI-time install, the only npm fetch in this repository outside `--frozen-lockfile`, is gone. Tests moved from `test/workflows/` to `test/utils/commit-parses.spec.ts`, because `run.sh` executes before `pnpm install` and the parser now lives in `node_modules`. Eighteen accepted shapes are pinned, weighted by what this repository actually writes — `Co-authored-by:` appears in 83% of recent commits, `Claude-Session:` in 74%, a `(#NNN)` subject in 98%, an indented body line in 28% — because a guard that reddened `main` on ordinary messages would be removed within the week. Closes #436.
8 tasks
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.
Port of
nuxt/ui@ccd48940. Second of six in the queue, after #425.The defect
The spec built its expected paths with
node:pathwhile the module under test builds them withpathe. On Windows those disagree —node:pathemits backslashes,patheforward slashes — so the assertions compared two spellings of the same directory and failed.It is ours in full, not merely upstream-shaped:
src/utils/components.tsimportsdirname,join,normalize,resolvefrompathe, soresolveExtraScanDirsemits forward slashes;node:pathoutput in the two places fed byfixtureRoot()—.toEqual([outside])and.toEqual([join(outside, 'components')]).normalizeis needed on top of the import switch:realpathSynccomes fromnode:fsand returns native separators regardless of whichjoinproduced its argument.patheis already a rootdependenciesentry (^2.0.3), so nothing new is pulled in, and nonode:pathimport remains in the file.Deviations
None. The only difference from upstream's diff in the touched lines is the fixture prefix,
b24ui-cd-againstnuxt-ui-cd-.Verification — and what it cannot show
This cannot be demonstrated on Linux. Worth stating plainly rather than implying coverage the run does not have. On POSIX
pathe.joinandnode:path.joinreturn identical strings, andnormalizeis an identity on an already-normal path. Checked rather than assumed:So the suite is green before and after, and no mutation can turn it red here — the usual proof for a change like this is unavailable.
What is verifiable locally is the mechanism: implementation and test now resolve paths through the same module, and the two comparison sites are exactly the ones consuming
fixtureRoot(). The Windows behaviour rests on upstream's report, not on a run here.Verify (
CI=true)lint·typecheck·test·build— all green. Tests 6622 passed | 6 skipped across 288 files.No
docs:generate— the commit touches nodocs/, perPORTING.md§6.Ledger
6bcc97a6reconciled with #425 and squashe5c7e658.cursor→ccd48940, entry added, log at.sync/log/ccd48940….md.Remaining:
f065438d(reka-ui 2.10.3),f3c2ac21(the Slider fix — applies here asRange, see #423),cf5f15e3andf6d188bd(showcase; the second has a schema half worth taking).Generated by Claude Code