Commit 61a0cb5
fix(merge-coverage): eliminate Windows path-separator duplication (#203)
* Initial plan
* fix: normalize coverage path separators on Windows in merge-coverage
- Add normalizeCoverageKeys() to convert backslash path keys and `path`
properties to forward slashes in coverage JSON blobs before merging.
This prevents nyc (backslash) vs karma-typescript (forward-slash) key
duplication on Windows.
- Normalize globby paths to forward slashes before the exclusion filter
so that `coverage/coverage-final.json` is correctly excluded even when
globby returns backslash-separated paths on Windows.
- Add tests for normalizeCoverageKeys in merge-coverage.test.ts
Agent-Logs-Url: https://github.com/nevware21/ts-build-tools/sessions/fe9562c3-39c4-4338-9207-223a423590cb
Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
* chore: revert accidental package.json changes from test setup
Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
* fix: use string types and const instead of any/var in merge-coverage
Address code review feedback: use string type annotations instead of any
in lambda parameters, and use const instead of var for jsonBlobs.
Agent-Logs-Url: https://github.com/nevware21/ts-build-tools/sessions/fe9562c3-39c4-4338-9207-223a423590cb
Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* fix: use simple overwrite instead of istanbul merge for key collision in normalizeCoverageKeys
The istanbul FileCoverage.merge() call requires complete statementMap
location data (start/end), which may not be present. Use simple
last-write-wins overwrite instead — cross-blob merging is handled by
istanbul in the main mergeCoverage loop. All 23 tests pass.
Agent-Logs-Url: https://github.com/nevware21/ts-build-tools/sessions/148514cb-94a7-4094-a057-e3cb05720107
Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
* chore: revert accidental package.json changes from local test setup
Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
* fix: move normalizeCoverageKeys to utils.ts to fix Node 18 ESM loader issue
merge-coverage.ts imports globby v13 (ESM-only). On Node 18, loading
any test that imports from merge-coverage.ts triggers the ESM loader,
which can't handle .ts file extensions (ERR_UNKNOWN_FILE_EXTENSION).
Moving normalizeCoverageKeys to utils.ts (only CJS deps: fs, path,
@nevware21/ts-utils) and updating the test to import from utils.ts
avoids this ESM cascade. merge-coverage.ts re-exports the function
for API compatibility. utils.ts also gets stronger types
(Record<string, any> instead of any).
Agent-Logs-Url: https://github.com/nevware21/ts-build-tools/sessions/4303ce38-8fd4-4261-a66a-f982cd20395a
Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: nevware21-bot <252503968+nevware21-bot@users.noreply.github.com>1 parent 1be4f31 commit 61a0cb5
3 files changed
Lines changed: 94 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | | - | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
| 63 | + | |
62 | 64 | | |
63 | | - | |
64 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
70 | 98 | | |
71 | 99 | | |
72 | 100 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
0 commit comments