apex-code-coverage-transformer 2.17.0 → 2.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +20 -8
- package/lib/handlers/BaseHandler.d.ts +1 -1
- package/lib/handlers/BaseHandler.js.map +1 -1
- package/lib/handlers/html.d.ts +1 -1
- package/lib/handlers/html.js +15 -9
- package/lib/handlers/html.js.map +1 -1
- package/lib/transformers/coverageTransformer.js +19 -3
- package/lib/transformers/coverageTransformer.js.map +1 -1
- package/lib/transformers/reportGenerator.js +108 -52
- package/lib/transformers/reportGenerator.js.map +1 -1
- package/lib/utils/getTotalLines.d.ts +5 -1
- package/lib/utils/getTotalLines.js +4 -3
- package/lib/utils/getTotalLines.js.map +1 -1
- package/lib/utils/setCoveredLines.d.ts +5 -1
- package/lib/utils/setCoveredLines.js +6 -2
- package/lib/utils/setCoveredLines.js.map +1 -1
- package/lib/utils/types.d.ts +2 -1
- package/oclif.lock +43 -63
- package/oclif.manifest.json +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@
|
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## [2.18.1](https://github.com/mcarvin8/apex-code-coverage-transformer/compare/v2.18.0...v2.18.1) (2026-04-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **perf:** replace xmlbuilder2 with fast-xml-parser for xml formats ([#274](https://github.com/mcarvin8/apex-code-coverage-transformer/issues/274)) ([2952623](https://github.com/mcarvin8/apex-code-coverage-transformer/commit/2952623405d357b07504a368a20acfae562bf068))
|
|
14
|
+
|
|
15
|
+
## [2.18.0](https://github.com/mcarvin8/apex-code-coverage-transformer/compare/v2.17.0...v2.18.0) (2026-03-12)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **html:** show source code in File Coverage Details Code column ([#272](https://github.com/mcarvin8/apex-code-coverage-transformer/issues/272)) ([f1f4c84](https://github.com/mcarvin8/apex-code-coverage-transformer/commit/f1f4c8444911766bb6590d4dd82fa68114d01053))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **deps:** bump @oclif/core from 4.8.1 to 4.8.2 ([#269](https://github.com/mcarvin8/apex-code-coverage-transformer/issues/269)) ([a35b13a](https://github.com/mcarvin8/apex-code-coverage-transformer/commit/a35b13a43d446d6da981d591d82b55cbd705289e))
|
|
26
|
+
* **deps:** bump @salesforce/core from 8.26.2 to 8.26.3 ([#270](https://github.com/mcarvin8/apex-code-coverage-transformer/issues/270)) ([21980e7](https://github.com/mcarvin8/apex-code-coverage-transformer/commit/21980e70430835a6589b715b230053d2f183b4d1))
|
|
27
|
+
|
|
8
28
|
## [2.17.0](https://github.com/mcarvin8/apex-code-coverage-transformer/compare/v2.16.1...v2.17.0) (2026-02-24)
|
|
9
29
|
|
|
10
30
|
|
package/README.md
CHANGED
|
@@ -182,7 +182,7 @@ jobs:
|
|
|
182
182
|
- name: Install Salesforce CLI
|
|
183
183
|
run: npm install -g @salesforce/cli
|
|
184
184
|
- name: Install Coverage Transformer Plugin
|
|
185
|
-
run: sf plugins install apex-code-coverage-transformer
|
|
185
|
+
run: echo y | sf plugins install apex-code-coverage-transformer
|
|
186
186
|
- name: Authenticate to Salesforce
|
|
187
187
|
run: sf org login sfdx-url --sfdx-url-file ${{ secrets.SFDX_AUTH_URL }} --alias ci-org
|
|
188
188
|
- name: Run Apex Tests
|
|
@@ -231,7 +231,7 @@ jobs:
|
|
|
231
231
|
- name: Install Salesforce CLI
|
|
232
232
|
run: npm install -g @salesforce/cli
|
|
233
233
|
- name: Install Coverage Transformer Plugin
|
|
234
|
-
run: sf plugins install apex-code-coverage-transformer
|
|
234
|
+
run: echo y | sf plugins install apex-code-coverage-transformer
|
|
235
235
|
- name: Authenticate to Salesforce
|
|
236
236
|
run: sf org login sfdx-url --sfdx-url-file ${{ secrets.SFDX_AUTH_URL }} --alias ci-org
|
|
237
237
|
- name: Run Apex Tests
|
|
@@ -268,7 +268,7 @@ jobs:
|
|
|
268
268
|
- name: Install Salesforce CLI
|
|
269
269
|
run: npm install -g @salesforce/cli
|
|
270
270
|
- name: Install Coverage Transformer Plugin
|
|
271
|
-
run: sf plugins install apex-code-coverage-transformer
|
|
271
|
+
run: echo y | sf plugins install apex-code-coverage-transformer
|
|
272
272
|
- name: Authenticate to Salesforce
|
|
273
273
|
run: sf org login sfdx-url --sfdx-url-file ${{ secrets.SFDX_AUTH_URL }} --alias ci-org
|
|
274
274
|
- name: Run Apex Tests
|
|
@@ -303,20 +303,32 @@ apex-tests:
|
|
|
303
303
|
image: node:20
|
|
304
304
|
before_script:
|
|
305
305
|
- npm install -g @salesforce/cli
|
|
306
|
-
- sf plugins install apex-code-coverage-transformer
|
|
306
|
+
- echo y | sf plugins install apex-code-coverage-transformer
|
|
307
307
|
- echo $SFDX_AUTH_URL | sf org login sfdx-url --sfdx-url-stdin --alias ci-org
|
|
308
308
|
script:
|
|
309
309
|
- sf apex run test --code-coverage --output-dir coverage --target-org ci-org
|
|
310
310
|
- sf acc-transformer transform -j "coverage/test-result-codecoverage.json" -r "coverage.xml" -f "cobertura"
|
|
311
|
-
|
|
311
|
+
# Parse the coverage report and output the TOTAL coverage percentage (2 decimal places)
|
|
312
|
+
# to the job log. GitLab reads this line using the `coverage` keyword regex to track pipeline coverage.
|
|
313
|
+
- |
|
|
314
|
+
COVERAGE_FILE="coverage.xml"
|
|
315
|
+
if [ -s "$COVERAGE_FILE" ]; then
|
|
316
|
+
LINE_RATE="$(grep -oE '<coverage[^>]*\bline-rate="[^"]+"' "$COVERAGE_FILE" | head -1 | sed -E 's/.*line-rate="([^"]+)".*/\1/')"
|
|
317
|
+
if [ -n "$LINE_RATE" ]; then
|
|
318
|
+
PCT="$(awk -v r="$LINE_RATE" 'BEGIN { printf("%.2f%%", r*100) }')"
|
|
319
|
+
echo "TOTAL coverage: $PCT"
|
|
320
|
+
fi
|
|
321
|
+
fi
|
|
322
|
+
coverage: '/TOTAL.+ ([0-9]{1,3}(?:\.[0-9]+)?%)/'
|
|
312
323
|
artifacts:
|
|
324
|
+
when: always
|
|
325
|
+
paths:
|
|
326
|
+
- coverage.xml
|
|
327
|
+
expire_in: 2 weeks
|
|
313
328
|
reports:
|
|
314
329
|
coverage_report:
|
|
315
330
|
coverage_format: cobertura
|
|
316
331
|
path: coverage.xml
|
|
317
|
-
paths:
|
|
318
|
-
- coverage/
|
|
319
|
-
expire_in: 30 days
|
|
320
332
|
```
|
|
321
333
|
|
|
322
334
|
## Automatic Transformation (Hook)
|
|
@@ -46,6 +46,6 @@ export declare abstract class BaseHandler implements CoverageHandler {
|
|
|
46
46
|
'@filename'?: string;
|
|
47
47
|
'@name'?: string;
|
|
48
48
|
}>(items: T[]): T[];
|
|
49
|
-
abstract processFile(filePath: string, fileName: string, lines: Record<string, number
|
|
49
|
+
abstract processFile(filePath: string, fileName: string, lines: Record<string, number>, sourceContent?: string): void;
|
|
50
50
|
abstract finalize(): SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject | IstanbulCoverageObject | JsonSummaryCoverageObject | SimpleCovCoverageObject | OpenCoverCoverageObject | HtmlCoverageObject;
|
|
51
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseHandler.js","sourceRoot":"","sources":["../../src/handlers/BaseHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAgBb;;;GAGG;AACH,MAAM,OAAgB,WAAW;IAC/B;;;;;OAKG;IACH,kDAAkD;IACxC,iBAAiB,CAAC,KAA6B;QAMvD,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CA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5E,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;aACzB,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;aACvD,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aAC7B,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACO,sBAAsB,CAAC,KAA6B;QAI5D,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC;YAC/C,SAAS,EAAE,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC;SACnD,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,kDAAkD;IACxC,UAAU,CAAyE,KAAU;QACrG,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACzB,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC/D,MAAM,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC/D,OAAO,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC;CAoBF"}
|
package/lib/handlers/html.d.ts
CHANGED
|
@@ -24,6 +24,6 @@ export declare class HtmlCoverageHandler extends BaseHandler {
|
|
|
24
24
|
private coveredLinesAccumulator;
|
|
25
25
|
private readonly packageMap;
|
|
26
26
|
constructor();
|
|
27
|
-
processFile(filePath: string, fileName: string, lines: Record<string, number
|
|
27
|
+
processFile(filePath: string, fileName: string, lines: Record<string, number>, sourceContent?: string): void;
|
|
28
28
|
finalize(): HtmlCoverageObject;
|
|
29
29
|
}
|
package/lib/handlers/html.js
CHANGED
|
@@ -37,14 +37,20 @@ export class HtmlCoverageHandler extends BaseHandler {
|
|
|
37
37
|
files: [],
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
processFile(filePath, fileName, lines) {
|
|
40
|
+
processFile(filePath, fileName, lines, sourceContent) {
|
|
41
41
|
const { totalLines, coveredLines, uncoveredLines, lineRate } = this.calculateCoverage(lines);
|
|
42
|
+
const sourceLines = sourceContent ? sourceContent.split(/\r?\n/) : [];
|
|
42
43
|
const fileLines = Object.entries(lines)
|
|
43
|
-
.map(([lineNumber, hitCount]) =>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
.map(([lineNumber, hitCount]) => {
|
|
45
|
+
const num = Number(lineNumber);
|
|
46
|
+
const content = sourceLines[num - 1] ?? '';
|
|
47
|
+
return {
|
|
48
|
+
lineNumber: num,
|
|
49
|
+
hitCount,
|
|
50
|
+
covered: hitCount > 0,
|
|
51
|
+
content,
|
|
52
|
+
};
|
|
53
|
+
})
|
|
48
54
|
.sort((a, b) => a.lineNumber - b.lineNumber);
|
|
49
55
|
const fileCoverage = {
|
|
50
56
|
filePath,
|
|
@@ -60,7 +66,7 @@ export class HtmlCoverageHandler extends BaseHandler {
|
|
|
60
66
|
this.totalLinesAccumulator += totalLines;
|
|
61
67
|
this.coveredLinesAccumulator += coveredLines;
|
|
62
68
|
// Accumulate per-package-directory (e.g. force-app)
|
|
63
|
-
const directory = filePath.split('/')[0]
|
|
69
|
+
const directory = filePath.split('/')[0];
|
|
64
70
|
const existing = this.packageMap.get(directory);
|
|
65
71
|
if (existing) {
|
|
66
72
|
existing.totalLines += totalLines;
|
|
@@ -83,8 +89,8 @@ export class HtmlCoverageHandler extends BaseHandler {
|
|
|
83
89
|
};
|
|
84
90
|
// Sort files by package directory first, then by path (mimics folder structure)
|
|
85
91
|
this.coverageObj.files.sort((a, b) => {
|
|
86
|
-
const dirA = a.filePath.split('/')[0]
|
|
87
|
-
const dirB = b.filePath.split('/')[0]
|
|
92
|
+
const dirA = a.filePath.split('/')[0];
|
|
93
|
+
const dirB = b.filePath.split('/')[0];
|
|
88
94
|
if (dirA !== dirB)
|
|
89
95
|
return dirA.localeCompare(dirB);
|
|
90
96
|
return a.filePath.localeCompare(b.filePath);
|
package/lib/handlers/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/handlers/html.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAKvD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IACjC,WAAW,CAAqB;IACzC,qBAAqB,GAAG,CAAC,CAAC;IAC1B,uBAAuB,GAAG,CAAC,CAAC;IACnB,UAAU,GAAG,IAAI,GAAG,EAA8B,CAAC;IAEpE;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG;YACjB,OAAO,EAAE;gBACP,UAAU,EAAE,CAAC;gBACb,YAAY,EAAE,CAAC;gBACf,cAAc,EAAE,CAAC;gBACjB,QAAQ,EAAE,CAAC;aACZ;YACD,gBAAgB,EAAE,EAAE;YACpB,KAAK,EAAE,EAAE;SACV,CAAC;IACJ,CAAC;IAEM,WAAW,CAAC,QAAgB,EAAE,QAAgB,EAAE,KAA6B;
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/handlers/html.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,WAAW,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AC;aACD,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAE1D,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;CACF;AAED,6BAA6B;AAC7B,eAAe,CAAC,QAAQ,CAAC;IACvB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,iDAAiD;IAC9D,aAAa,EAAE,OAAO;IACtB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,mBAAmB,EAAE;IACxC,cAAc,EAAE,CAAC,cAAc,EAAE,iBAAiB,EAAE,mBAAmB,CAAC;CACzE,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-await-in-loop */
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
3
4
|
import { mapLimit } from 'async';
|
|
4
5
|
import { getCoverageHandler } from '../handlers/getHandler.js';
|
|
5
6
|
import { getPackageDirectories } from '../utils/getPackageDirectories.js';
|
|
@@ -51,6 +52,17 @@ export async function transformCoverageReport(jsonFilePath, outputReportPath, fo
|
|
|
51
52
|
}
|
|
52
53
|
return { finalPaths, warnings };
|
|
53
54
|
}
|
|
55
|
+
function hasSourceContent(result) {
|
|
56
|
+
return typeof result === 'object' && result !== null && 'sourceContent' in result;
|
|
57
|
+
}
|
|
58
|
+
async function readSourceFile(absolutePath) {
|
|
59
|
+
try {
|
|
60
|
+
return await readFile(absolutePath, 'utf-8');
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
54
66
|
async function tryReadJson(path, warnings) {
|
|
55
67
|
try {
|
|
56
68
|
return await readFile(path, 'utf-8');
|
|
@@ -77,9 +89,12 @@ async function processDeployCoverage(data, context) {
|
|
|
77
89
|
context.warnings.push(`The file name ${formattedName} was not found in any package directory.`);
|
|
78
90
|
return;
|
|
79
91
|
}
|
|
80
|
-
|
|
92
|
+
const setCoveredResult = await setCoveredLines(path, context.repoRoot, fileInfo.s, context.handlers.has('html'));
|
|
93
|
+
const updatedLines = hasSourceContent(setCoveredResult) ? setCoveredResult.updatedLines : setCoveredResult;
|
|
94
|
+
const sourceContent = hasSourceContent(setCoveredResult) ? setCoveredResult.sourceContent : undefined;
|
|
95
|
+
fileInfo.s = updatedLines;
|
|
81
96
|
for (const handler of context.handlers.values()) {
|
|
82
|
-
handler.processFile(path, formattedName,
|
|
97
|
+
handler.processFile(path, formattedName, updatedLines, sourceContent);
|
|
83
98
|
}
|
|
84
99
|
processed++;
|
|
85
100
|
});
|
|
@@ -95,8 +110,9 @@ async function processTestCoverage(data, context) {
|
|
|
95
110
|
context.warnings.push(`The file name ${formattedName} was not found in any package directory.`);
|
|
96
111
|
return;
|
|
97
112
|
}
|
|
113
|
+
const sourceContent = context.handlers.has('html') ? await readSourceFile(join(context.repoRoot, path)) : undefined;
|
|
98
114
|
for (const handler of context.handlers.values()) {
|
|
99
|
-
handler.processFile(path, formattedName, entry.lines);
|
|
115
|
+
handler.processFile(path, formattedName, entry.lines, sourceContent);
|
|
100
116
|
}
|
|
101
117
|
processed++;
|
|
102
118
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coverageTransformer.js","sourceRoot":"","sources":["../../src/transformers/coverageTransformer.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;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I,GAAG,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;QAEhE,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,iBAAiB,aAAa,0CAA0C,CAAC,CAAC;YAChG,OAAO;QACT,CAAC;QAED,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACpH,KAAK,MAAM,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YAChD,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;QACvE,CAAC;QACD,SAAS,EAAE,CAAC;IACd,CAAC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,7 +1,40 @@
|
|
|
1
1
|
import { writeFile } from 'node:fs/promises';
|
|
2
2
|
import { extname, basename, dirname, join } from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { XMLBuilder } from 'fast-xml-parser';
|
|
4
4
|
import { HandlerRegistry } from '../handlers/HandlerRegistry.js';
|
|
5
|
+
const JSON_PARSER_OPTION = {
|
|
6
|
+
commentPropName: '#comment',
|
|
7
|
+
ignoreAttributes: false,
|
|
8
|
+
ignoreNameSpace: false,
|
|
9
|
+
parseTagValue: false,
|
|
10
|
+
parseNodeValue: false,
|
|
11
|
+
parseAttributeValue: false,
|
|
12
|
+
trimValues: true,
|
|
13
|
+
processEntities: false,
|
|
14
|
+
format: true,
|
|
15
|
+
indentBy: ' ',
|
|
16
|
+
suppressBooleanAttributes: false,
|
|
17
|
+
suppressEmptyNode: true,
|
|
18
|
+
};
|
|
19
|
+
const XML_HEADER_CONFIG = {
|
|
20
|
+
cobertura: {
|
|
21
|
+
xmlDecl: '<?xml version="1.0" ?>',
|
|
22
|
+
doctype: '<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">',
|
|
23
|
+
},
|
|
24
|
+
clover: {
|
|
25
|
+
xmlDecl: '<?xml version="1.0" encoding="UTF-8"?>',
|
|
26
|
+
},
|
|
27
|
+
jacoco: {
|
|
28
|
+
xmlDecl: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',
|
|
29
|
+
doctype: '<!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN" "report.dtd">',
|
|
30
|
+
},
|
|
31
|
+
opencover: {
|
|
32
|
+
xmlDecl: '<?xml version="1.0" encoding="utf-8"?>',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
function isXmlReportFormat(format) {
|
|
36
|
+
return format in XML_HEADER_CONFIG;
|
|
37
|
+
}
|
|
5
38
|
export async function generateAndWriteReport(outputPath, coverageObj, format, formatAmount) {
|
|
6
39
|
const content = generateReportContent(coverageObj, format);
|
|
7
40
|
const extension = HandlerRegistry.getExtension(format);
|
|
@@ -22,9 +55,17 @@ function generateReportContent(coverageObj, format) {
|
|
|
22
55
|
if (format === 'json' || format === 'json-summary' || format === 'simplecov') {
|
|
23
56
|
return JSON.stringify(coverageObj, null, 2);
|
|
24
57
|
}
|
|
25
|
-
const isHeadless =
|
|
26
|
-
const
|
|
27
|
-
|
|
58
|
+
const isHeadless = isXmlReportFormat(format);
|
|
59
|
+
const builder = new XMLBuilder({
|
|
60
|
+
...JSON_PARSER_OPTION,
|
|
61
|
+
attributeNamePrefix: '@',
|
|
62
|
+
});
|
|
63
|
+
let xml = builder.build(coverageObj);
|
|
64
|
+
if (isHeadless) {
|
|
65
|
+
xml = xml.replace(/^<\?xml[^>]*>\s*/i, '');
|
|
66
|
+
}
|
|
67
|
+
const finalXml = prependXmlHeader(xml, format).trimEnd();
|
|
68
|
+
return finalXml;
|
|
28
69
|
}
|
|
29
70
|
function generateLcov(coverageObj) {
|
|
30
71
|
return coverageObj.files
|
|
@@ -46,18 +87,12 @@ function generateLcov(coverageObj) {
|
|
|
46
87
|
.join('\n');
|
|
47
88
|
}
|
|
48
89
|
function prependXmlHeader(xml, format) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.0//EN" "report.dtd">\n${xml}`;
|
|
56
|
-
case 'opencover':
|
|
57
|
-
return `<?xml version="1.0" encoding="utf-8"?>\n${xml}`;
|
|
58
|
-
default:
|
|
59
|
-
return xml;
|
|
60
|
-
}
|
|
90
|
+
// Remove any existing XML declaration to avoid duplicates
|
|
91
|
+
const stripped = xml.replace(/^<\?xml[^>]*>\s*/i, '');
|
|
92
|
+
const config = isXmlReportFormat(format) ? XML_HEADER_CONFIG[format] : undefined;
|
|
93
|
+
return [config?.xmlDecl ?? '<?xml version="1.0"?>', config?.doctype, stripped]
|
|
94
|
+
.filter(Boolean)
|
|
95
|
+
.join('\n');
|
|
61
96
|
}
|
|
62
97
|
export function getExtensionForFormat(format) {
|
|
63
98
|
return HandlerRegistry.getExtension(format);
|
|
@@ -68,16 +103,24 @@ function isLcovCoverageObject(obj) {
|
|
|
68
103
|
function isHtmlCoverageObject(obj) {
|
|
69
104
|
return typeof obj === 'object' && obj !== null && 'summary' in obj && 'files' in obj;
|
|
70
105
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
106
|
+
function getCoverageColor(lineRate) {
|
|
107
|
+
if (lineRate >= 0.8)
|
|
108
|
+
return '#4caf50';
|
|
109
|
+
if (lineRate >= 0.6)
|
|
110
|
+
return '#ff9800';
|
|
111
|
+
return '#f44336';
|
|
112
|
+
}
|
|
113
|
+
function formatPercent(lineRate) {
|
|
114
|
+
return (lineRate * 100).toFixed(2);
|
|
115
|
+
}
|
|
116
|
+
function buildPackageSummaryRows(packageSummaries) {
|
|
117
|
+
if (packageSummaries.length === 0)
|
|
118
|
+
return '';
|
|
119
|
+
return packageSummaries
|
|
120
|
+
.map((pkg) => {
|
|
121
|
+
const pkgPercent = formatPercent(pkg.lineRate);
|
|
122
|
+
const pkgColor = getCoverageColor(pkg.lineRate);
|
|
123
|
+
return `<tr>
|
|
81
124
|
<td class="package-dir">${escapeHtml(pkg.directory)}</td>
|
|
82
125
|
<td class="package-stat">${pkg.fileCount}</td>
|
|
83
126
|
<td class="package-stat">${pkg.totalLines}</td>
|
|
@@ -86,46 +129,45 @@ function generateHtml(coverageObj) {
|
|
|
86
129
|
<td class="package-pct" style="color: ${pkgColor}">${pkgPercent}%</td>
|
|
87
130
|
<td><span class="coverage-bar" style="background-color: ${pkgColor}; width: ${pkgPercent}%"></span></td>
|
|
88
131
|
</tr>`;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
132
|
+
})
|
|
133
|
+
.join('\n');
|
|
134
|
+
}
|
|
135
|
+
function groupFilesByDir(files) {
|
|
93
136
|
const filesByDir = new Map();
|
|
94
137
|
for (const file of files) {
|
|
95
|
-
const dir = file.filePath.split('/')[0]
|
|
138
|
+
const dir = file.filePath.split('/')[0];
|
|
96
139
|
const list = filesByDir.get(dir) ?? [];
|
|
97
140
|
list.push(file);
|
|
98
141
|
filesByDir.set(dir, list);
|
|
99
142
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
const fileColor = file.lineRate >= 0.8 ? '#4caf50' : file.lineRate >= 0.6 ? '#ff9800' : '#f44336';
|
|
108
|
-
const lineDetails = file.lines
|
|
109
|
-
.map((line) => {
|
|
110
|
-
const lineClass = line.covered ? 'covered' : 'uncovered';
|
|
111
|
-
const lineColor = line.covered ? '#c8e6c9' : '#ffcdd2';
|
|
112
|
-
return `<tr class="${lineClass}" style="background-color: ${lineColor}">
|
|
143
|
+
return filesByDir;
|
|
144
|
+
}
|
|
145
|
+
function buildLineRow(line) {
|
|
146
|
+
const lineClass = line.covered ? 'covered' : 'uncovered';
|
|
147
|
+
const lineColor = line.covered ? '#c8e6c9' : '#ffcdd2';
|
|
148
|
+
const codeContent = line.content !== undefined ? escapeHtml(line.content) : '';
|
|
149
|
+
return `<tr class="${lineClass}" style="background-color: ${lineColor}">
|
|
113
150
|
<td class="line-number">${line.lineNumber}</td>
|
|
114
151
|
<td class="hit-count">${line.hitCount}</td>
|
|
115
|
-
<td class="line-content"
|
|
152
|
+
<td class="line-content">${codeContent}</td>
|
|
116
153
|
</tr>`;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
154
|
+
}
|
|
155
|
+
function buildFileSection(file) {
|
|
156
|
+
const filePercent = formatPercent(file.lineRate);
|
|
157
|
+
const fileColor = getCoverageColor(file.lineRate);
|
|
158
|
+
const lineDetails = file.lines.map(buildLineRow).join('\n');
|
|
159
|
+
const fileId = file.filePath.replace(/[^a-zA-Z0-9]/g, '-');
|
|
160
|
+
const escapedPath = file.filePath.replace(/'/g, "\\'");
|
|
161
|
+
return `
|
|
120
162
|
<div class="file-section">
|
|
121
|
-
<h3 class="file-header" onclick="toggleFile('${
|
|
163
|
+
<h3 class="file-header" onclick="toggleFile('${escapedPath}')">
|
|
122
164
|
<span class="file-name">${escapeHtml(file.filePath)}</span>
|
|
123
165
|
<span class="file-stats">
|
|
124
166
|
${file.coveredLines}/${file.totalLines} lines (${filePercent}%)
|
|
125
167
|
<span class="coverage-bar" style="background-color: ${fileColor}; width: ${filePercent}%"></span>
|
|
126
168
|
</span>
|
|
127
169
|
</h3>
|
|
128
|
-
<div id="file-${
|
|
170
|
+
<div id="file-${fileId}" class="file-details" style="display: none;">
|
|
129
171
|
<table class="line-coverage">
|
|
130
172
|
<thead>
|
|
131
173
|
<tr>
|
|
@@ -141,8 +183,14 @@ function generateHtml(coverageObj) {
|
|
|
141
183
|
</div>
|
|
142
184
|
</div>
|
|
143
185
|
`;
|
|
144
|
-
|
|
145
|
-
|
|
186
|
+
}
|
|
187
|
+
function buildFileRows(files) {
|
|
188
|
+
const filesByDir = groupFilesByDir(files);
|
|
189
|
+
const sortedDirs = [...filesByDir.keys()].sort((a, b) => a.localeCompare(b));
|
|
190
|
+
return sortedDirs
|
|
191
|
+
.map((dir) => {
|
|
192
|
+
const dirFiles = filesByDir.get(dir);
|
|
193
|
+
const dirFileSections = dirFiles.map(buildFileSection).join('\n');
|
|
146
194
|
return `
|
|
147
195
|
<div class="package-files-group">
|
|
148
196
|
<h3 class="package-dir-header">${escapeHtml(dir)}/</h3>
|
|
@@ -151,6 +199,13 @@ function generateHtml(coverageObj) {
|
|
|
151
199
|
`;
|
|
152
200
|
})
|
|
153
201
|
.join('\n');
|
|
202
|
+
}
|
|
203
|
+
function generateHtml(coverageObj) {
|
|
204
|
+
const { summary, packageSummaries, files } = coverageObj;
|
|
205
|
+
const coveragePercent = formatPercent(summary.lineRate);
|
|
206
|
+
const coverageColor = getCoverageColor(summary.lineRate);
|
|
207
|
+
const packageSummaryRows = buildPackageSummaryRows(packageSummaries);
|
|
208
|
+
const fileRows = buildFileRows(files);
|
|
154
209
|
return `<!DOCTYPE html>
|
|
155
210
|
<html lang="en">
|
|
156
211
|
<head>
|
|
@@ -299,6 +354,7 @@ function generateHtml(coverageObj) {
|
|
|
299
354
|
}
|
|
300
355
|
.line-content {
|
|
301
356
|
width: auto;
|
|
357
|
+
white-space: pre;
|
|
302
358
|
}
|
|
303
359
|
.covered {
|
|
304
360
|
background-color: #c8e6c9 !important;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reportGenerator.js","sourceRoot":"","sources":["../../src/transformers/reportGenerator.ts"],"names":[],"mappings":"AAAA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AC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type GetTotalLinesResult = number | {
|
|
2
|
+
totalLines: number;
|
|
3
|
+
content: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function getTotalLines(filePath: string, returnContent?: boolean): Promise<GetTotalLinesResult>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { readFile } from 'node:fs/promises';
|
|
3
|
-
export async function getTotalLines(filePath) {
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
export async function getTotalLines(filePath, returnContent = false) {
|
|
4
|
+
const content = await readFile(filePath, 'utf8');
|
|
5
|
+
const totalLines = content.split(/\r\n|\r|\n/).length;
|
|
6
|
+
return returnContent ? { totalLines, content } : totalLines;
|
|
6
7
|
}
|
|
7
8
|
//# sourceMappingURL=getTotalLines.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTotalLines.js","sourceRoot":"","sources":["../../src/utils/getTotalLines.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"getTotalLines.js","sourceRoot":"","sources":["../../src/utils/getTotalLines.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,QAAgB,EAAE,aAAa,GAAG,KAAK;IACzE,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC;IACtD,OAAO,aAAa,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;AAC9D,CAAC"}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type SetCoveredLinesResult = Record<string, number> | {
|
|
2
|
+
updatedLines: Record<string, number>;
|
|
3
|
+
sourceContent: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function setCoveredLines(filePath: string, repoRoot: string, lines: Record<string, number>, returnSourceContent?: boolean): Promise<SetCoveredLinesResult>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { getTotalLines } from './getTotalLines.js';
|
|
4
|
-
export async function setCoveredLines(filePath, repoRoot, lines) {
|
|
5
|
-
const
|
|
4
|
+
export async function setCoveredLines(filePath, repoRoot, lines, returnSourceContent = false) {
|
|
5
|
+
const result = await getTotalLines(join(repoRoot, filePath), returnSourceContent);
|
|
6
|
+
const totalLines = typeof result === 'number' ? result : result.totalLines;
|
|
6
7
|
const updatedLines = {};
|
|
7
8
|
const usedLines = new Set();
|
|
8
9
|
const sortedLines = Object.entries(lines).sort(([lineA], [lineB]) => parseInt(lineA, 10) - parseInt(lineB, 10));
|
|
@@ -22,6 +23,9 @@ export async function setCoveredLines(filePath, repoRoot, lines) {
|
|
|
22
23
|
usedLines.add(lineNumber);
|
|
23
24
|
}
|
|
24
25
|
}
|
|
26
|
+
if (returnSourceContent && typeof result !== 'number') {
|
|
27
|
+
return { updatedLines, sourceContent: result.content };
|
|
28
|
+
}
|
|
25
29
|
return updatedLines;
|
|
26
30
|
}
|
|
27
31
|
//# sourceMappingURL=setCoveredLines.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setCoveredLines.js","sourceRoot":"","sources":["../../src/utils/setCoveredLines.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,oBA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AAC;oBAC/B,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,GAAG,MAAM,CAAC;oBAC7C,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;oBAC1B,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,YAAY,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;YAC5B,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,IAAI,mBAAmB,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACtD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/lib/utils/types.d.ts
CHANGED
|
@@ -154,7 +154,7 @@ export type CloverCoverageObject = {
|
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
156
|
export type CoverageHandler = {
|
|
157
|
-
processFile(filePath: string, fileName: string, lines: Record<string, number
|
|
157
|
+
processFile(filePath: string, fileName: string, lines: Record<string, number>, sourceContent?: string): void;
|
|
158
158
|
finalize(): SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject | IstanbulCoverageObject | JsonSummaryCoverageObject | SimpleCovCoverageObject | OpenCoverCoverageObject | HtmlCoverageObject;
|
|
159
159
|
};
|
|
160
160
|
type LcovLine = {
|
|
@@ -321,6 +321,7 @@ export type HtmlFileCoverage = {
|
|
|
321
321
|
lineNumber: number;
|
|
322
322
|
hitCount: number;
|
|
323
323
|
covered: boolean;
|
|
324
|
+
content?: string;
|
|
324
325
|
}>;
|
|
325
326
|
};
|
|
326
327
|
/** Summary for a package directory (e.g. force-app) in the HTML report */
|
package/oclif.lock
CHANGED
|
@@ -1977,10 +1977,10 @@
|
|
|
1977
1977
|
"@nodelib/fs.scandir" "2.1.5"
|
|
1978
1978
|
fastq "^1.6.0"
|
|
1979
1979
|
|
|
1980
|
-
"@oclif/core@^4", "@oclif/core@^4.5.2", "@oclif/core@^4.8.0", "@oclif/core@^4.8.
|
|
1981
|
-
version "4.8.
|
|
1982
|
-
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-4.8.
|
|
1983
|
-
integrity sha512-
|
|
1980
|
+
"@oclif/core@^4", "@oclif/core@^4.5.2", "@oclif/core@^4.8.0", "@oclif/core@^4.8.3":
|
|
1981
|
+
version "4.8.3"
|
|
1982
|
+
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-4.8.3.tgz#c1f488841cd0929dbe101f1b86a213bf4349de2a"
|
|
1983
|
+
integrity sha512-f7Rc1JBZO0wNMyDmNzP5IFOv5eM97S9pO4JUFdu2OLyk73YeBI9wog1Yyf666NOQvyptkbG1xh8inzMDQLNTyQ==
|
|
1984
1984
|
dependencies:
|
|
1985
1985
|
ansi-escapes "^4.3.2"
|
|
1986
1986
|
ansis "^3.17.0"
|
|
@@ -1992,7 +1992,7 @@
|
|
|
1992
1992
|
indent-string "^4.0.0"
|
|
1993
1993
|
is-wsl "^2.2.0"
|
|
1994
1994
|
lilconfig "^3.1.3"
|
|
1995
|
-
minimatch "^10.2.
|
|
1995
|
+
minimatch "^10.2.4"
|
|
1996
1996
|
semver "^7.7.3"
|
|
1997
1997
|
string-width "^4.2.3"
|
|
1998
1998
|
supports-color "^8"
|
|
@@ -2001,10 +2001,10 @@
|
|
|
2001
2001
|
wordwrap "^1.0.0"
|
|
2002
2002
|
wrap-ansi "^7.0.0"
|
|
2003
2003
|
|
|
2004
|
-
"@oclif/plugin-command-snapshot@^5.3.
|
|
2005
|
-
version "5.3.
|
|
2006
|
-
resolved "https://registry.yarnpkg.com/@oclif/plugin-command-snapshot/-/plugin-command-snapshot-5.3.
|
|
2007
|
-
integrity sha512-
|
|
2004
|
+
"@oclif/plugin-command-snapshot@^5.3.10":
|
|
2005
|
+
version "5.3.10"
|
|
2006
|
+
resolved "https://registry.yarnpkg.com/@oclif/plugin-command-snapshot/-/plugin-command-snapshot-5.3.10.tgz#7146eccb3ec4f66fb27bf5a362add7d0697ba2b1"
|
|
2007
|
+
integrity sha512-pGKxLQzE3NYsl63WmwiCndrskKFsQXZ8P5trvycqGHJ1YmffL4xPpfiDcMtiKuK0MX2vSnTkQ0k7n5kchmx+vA==
|
|
2008
2008
|
dependencies:
|
|
2009
2009
|
"@oclif/core" "^4"
|
|
2010
2010
|
ansis "^3.17.0"
|
|
@@ -2060,35 +2060,6 @@
|
|
|
2060
2060
|
strip-ansi "^7.1.2"
|
|
2061
2061
|
wrap-ansi "^9.0.2"
|
|
2062
2062
|
|
|
2063
|
-
"@oozcitak/dom@^2.0.2":
|
|
2064
|
-
version "2.0.2"
|
|
2065
|
-
resolved "https://registry.yarnpkg.com/@oozcitak/dom/-/dom-2.0.2.tgz#0f447f0b736aa6f36c5556ba811a44e56c71c26c"
|
|
2066
|
-
integrity sha512-GjpKhkSYC3Mj4+lfwEyI1dqnsKTgwGy48ytZEhm4A/xnH/8z9M3ZVXKr/YGQi3uCLs1AEBS+x5T2JPiueEDW8w==
|
|
2067
|
-
dependencies:
|
|
2068
|
-
"@oozcitak/infra" "^2.0.2"
|
|
2069
|
-
"@oozcitak/url" "^3.0.0"
|
|
2070
|
-
"@oozcitak/util" "^10.0.0"
|
|
2071
|
-
|
|
2072
|
-
"@oozcitak/infra@^2.0.2":
|
|
2073
|
-
version "2.0.2"
|
|
2074
|
-
resolved "https://registry.yarnpkg.com/@oozcitak/infra/-/infra-2.0.2.tgz#e2f1cc0eeca3ac5cd551f0326a5f66f00cf1138b"
|
|
2075
|
-
integrity sha512-2g+E7hoE2dgCz/APPOEK5s3rMhJvNxSMBrP+U+j1OWsIbtSpWxxlUjq1lU8RIsFJNYv7NMlnVsCuHcUzJW+8vA==
|
|
2076
|
-
dependencies:
|
|
2077
|
-
"@oozcitak/util" "^10.0.0"
|
|
2078
|
-
|
|
2079
|
-
"@oozcitak/url@^3.0.0":
|
|
2080
|
-
version "3.0.0"
|
|
2081
|
-
resolved "https://registry.yarnpkg.com/@oozcitak/url/-/url-3.0.0.tgz#a03c959c67e28aba9e29b2d35cd50d26cb5f2cc4"
|
|
2082
|
-
integrity sha512-ZKfET8Ak1wsLAiLWNfFkZc/BraDccuTJKR6svTYc7sVjbR+Iu0vtXdiDMY4o6jaFl5TW2TlS7jbLl4VovtAJWQ==
|
|
2083
|
-
dependencies:
|
|
2084
|
-
"@oozcitak/infra" "^2.0.2"
|
|
2085
|
-
"@oozcitak/util" "^10.0.0"
|
|
2086
|
-
|
|
2087
|
-
"@oozcitak/util@^10.0.0":
|
|
2088
|
-
version "10.0.0"
|
|
2089
|
-
resolved "https://registry.yarnpkg.com/@oozcitak/util/-/util-10.0.0.tgz#f6b40472d96c210094a556ee5ccb8e77f1bd30af"
|
|
2090
|
-
integrity sha512-hAX0pT/73190NLqBPPWSdBVGtbY6VOhWYK3qqHqtXQ1gK7kS2yz4+ivsN07hpJ6I3aeMtKP6J6npsEKOAzuTLA==
|
|
2091
|
-
|
|
2092
2063
|
"@pinojs/redact@^0.4.0":
|
|
2093
2064
|
version "0.4.0"
|
|
2094
2065
|
resolved "https://registry.yarnpkg.com/@pinojs/redact/-/redact-0.4.0.tgz#c3de060dd12640dcc838516aa2a6803cc7b2e9d6"
|
|
@@ -2141,10 +2112,10 @@
|
|
|
2141
2112
|
strip-ansi "6.0.1"
|
|
2142
2113
|
ts-retry-promise "^0.8.1"
|
|
2143
2114
|
|
|
2144
|
-
"@salesforce/core@^8.18.7", "@salesforce/core@^8.23.1", "@salesforce/core@^8.26.
|
|
2145
|
-
version "8.26.
|
|
2146
|
-
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.26.
|
|
2147
|
-
integrity sha512-
|
|
2115
|
+
"@salesforce/core@^8.18.7", "@salesforce/core@^8.23.1", "@salesforce/core@^8.26.3", "@salesforce/core@^8.8.0":
|
|
2116
|
+
version "8.26.3"
|
|
2117
|
+
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-8.26.3.tgz#0b2502cacca8977f2ae95283d944771040eb7869"
|
|
2118
|
+
integrity sha512-lPNFHjHFeC4V3KuH88xuVLGhAqmtM8meUcvyejNh8bQ5w642APKRTGDZ0pOnWHJAe5SQy7cSQ1WqvO3V73ouQw==
|
|
2148
2119
|
dependencies:
|
|
2149
2120
|
"@jsforce/jsforce-node" "^3.10.13"
|
|
2150
2121
|
"@salesforce/kit" "^3.2.4"
|
|
@@ -5128,6 +5099,13 @@ fast-uri@^3.0.1:
|
|
|
5128
5099
|
resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.0.tgz#66eecff6c764c0df9b762e62ca7edcfb53b4edfa"
|
|
5129
5100
|
integrity sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==
|
|
5130
5101
|
|
|
5102
|
+
fast-xml-builder@^1.1.4:
|
|
5103
|
+
version "1.1.4"
|
|
5104
|
+
resolved "https://registry.yarnpkg.com/fast-xml-builder/-/fast-xml-builder-1.1.4.tgz#0c407a1d9d5996336c0cd76f7ff785cac6413017"
|
|
5105
|
+
integrity sha512-f2jhpN4Eccy0/Uz9csxh3Nu6q4ErKxf0XIsasomfOihuSUa3/xw6w8dnOtCDgEItQFJG8KyXPzQXzcODDrrbOg==
|
|
5106
|
+
dependencies:
|
|
5107
|
+
path-expression-matcher "^1.1.3"
|
|
5108
|
+
|
|
5131
5109
|
fast-xml-parser@5.3.6:
|
|
5132
5110
|
version "5.3.6"
|
|
5133
5111
|
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.3.6.tgz#85a69117ca156b1b3c52e426495b6de266cb6a4b"
|
|
@@ -5135,6 +5113,15 @@ fast-xml-parser@5.3.6:
|
|
|
5135
5113
|
dependencies:
|
|
5136
5114
|
strnum "^2.1.2"
|
|
5137
5115
|
|
|
5116
|
+
fast-xml-parser@^5.5.11:
|
|
5117
|
+
version "5.5.11"
|
|
5118
|
+
resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-5.5.11.tgz#406a888587aed0ba6b3e60382dfbb3b1f80692ad"
|
|
5119
|
+
integrity sha512-QL0eb0YbSTVWF6tTf1+LEMSgtCEjBYPpnAjoLC8SscESlAjXEIRJ7cHtLG0pLeDFaZLa4VKZLArtA/60ZS7vyA==
|
|
5120
|
+
dependencies:
|
|
5121
|
+
fast-xml-builder "^1.1.4"
|
|
5122
|
+
path-expression-matcher "^1.4.0"
|
|
5123
|
+
strnum "^2.2.3"
|
|
5124
|
+
|
|
5138
5125
|
fastest-levenshtein@^1.0.7:
|
|
5139
5126
|
version "1.0.16"
|
|
5140
5127
|
resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5"
|
|
@@ -6815,13 +6802,6 @@ js-yaml@^4.1.0:
|
|
|
6815
6802
|
dependencies:
|
|
6816
6803
|
argparse "^2.0.1"
|
|
6817
6804
|
|
|
6818
|
-
js-yaml@^4.1.1:
|
|
6819
|
-
version "4.1.1"
|
|
6820
|
-
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b"
|
|
6821
|
-
integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==
|
|
6822
|
-
dependencies:
|
|
6823
|
-
argparse "^2.0.1"
|
|
6824
|
-
|
|
6825
6805
|
js2xmlparser@^4.0.1:
|
|
6826
6806
|
version "4.0.2"
|
|
6827
6807
|
resolved "https://registry.yarnpkg.com/js2xmlparser/-/js2xmlparser-4.0.2.tgz#2a1fdf01e90585ef2ae872a01bc169c6a8d5e60a"
|
|
@@ -7445,10 +7425,10 @@ minimatch@9.0.3:
|
|
|
7445
7425
|
dependencies:
|
|
7446
7426
|
brace-expansion "^2.0.1"
|
|
7447
7427
|
|
|
7448
|
-
minimatch@^10.0.3, minimatch@^10.2.
|
|
7449
|
-
version "10.2.
|
|
7450
|
-
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.2.
|
|
7451
|
-
integrity sha512
|
|
7428
|
+
minimatch@^10.0.3, minimatch@^10.2.4:
|
|
7429
|
+
version "10.2.4"
|
|
7430
|
+
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.2.4.tgz#465b3accbd0218b8281f5301e27cedc697f96fde"
|
|
7431
|
+
integrity sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==
|
|
7452
7432
|
dependencies:
|
|
7453
7433
|
brace-expansion "^5.0.2"
|
|
7454
7434
|
|
|
@@ -7989,6 +7969,11 @@ path-exists@^5.0.0:
|
|
|
7989
7969
|
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-5.0.0.tgz#a6aad9489200b21fab31e49cf09277e5116fb9e7"
|
|
7990
7970
|
integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==
|
|
7991
7971
|
|
|
7972
|
+
path-expression-matcher@^1.1.3, path-expression-matcher@^1.4.0:
|
|
7973
|
+
version "1.4.0"
|
|
7974
|
+
resolved "https://registry.yarnpkg.com/path-expression-matcher/-/path-expression-matcher-1.4.0.tgz#275730c9c21bbf2e124eba6d4c6453f02f3d331d"
|
|
7975
|
+
integrity sha512-s4DQMxIdhj3jLFWd9LxHOplj4p9yQ4ffMGowFf3cpEgrrJjEhN0V5nxw4Ye1EViAGDoL4/1AeO6qHpqYPOzE4Q==
|
|
7976
|
+
|
|
7992
7977
|
path-is-absolute@^1.0.0:
|
|
7993
7978
|
version "1.0.1"
|
|
7994
7979
|
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
|
@@ -9187,6 +9172,11 @@ strnum@^2.1.2:
|
|
|
9187
9172
|
resolved "https://registry.yarnpkg.com/strnum/-/strnum-2.1.2.tgz#a5e00ba66ab25f9cafa3726b567ce7a49170937a"
|
|
9188
9173
|
integrity sha512-l63NF9y/cLROq/yqKXSLtcMeeyOfnSQlfMSlzFt/K73oIaD8DGaQWd7Z34X9GPiKqP5rbSh84Hl4bOlLcjiSrQ==
|
|
9189
9174
|
|
|
9175
|
+
strnum@^2.2.3:
|
|
9176
|
+
version "2.2.3"
|
|
9177
|
+
resolved "https://registry.yarnpkg.com/strnum/-/strnum-2.2.3.tgz#0119fce02749a11bb126a4d686ac5dbdf6e57586"
|
|
9178
|
+
integrity sha512-oKx6RUCuHfT3oyVjtnrmn19H1SiCqgJSg+54XqURKp5aCMbrXrhLjRN9TjuwMjiYstZ0MzDrHqkGZ5dFTKd+zg==
|
|
9179
|
+
|
|
9190
9180
|
supports-color@^7, supports-color@^7.0.0, supports-color@^7.1.0:
|
|
9191
9181
|
version "7.2.0"
|
|
9192
9182
|
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
|
|
@@ -9960,16 +9950,6 @@ xml2js@^0.6.2:
|
|
|
9960
9950
|
sax ">=0.6.0"
|
|
9961
9951
|
xmlbuilder "~11.0.0"
|
|
9962
9952
|
|
|
9963
|
-
xmlbuilder2@^4.0.1:
|
|
9964
|
-
version "4.0.3"
|
|
9965
|
-
resolved "https://registry.yarnpkg.com/xmlbuilder2/-/xmlbuilder2-4.0.3.tgz#91660fa6d30f19d716f8b1194c567686d4402c63"
|
|
9966
|
-
integrity sha512-bx8Q1STctnNaaDymWnkfQLKofs0mGNN7rLLapJlGuV3VlvegD7Ls4ggMjE3aUSWItCCzU0PEv45lI87iSigiCA==
|
|
9967
|
-
dependencies:
|
|
9968
|
-
"@oozcitak/dom" "^2.0.2"
|
|
9969
|
-
"@oozcitak/infra" "^2.0.2"
|
|
9970
|
-
"@oozcitak/util" "^10.0.0"
|
|
9971
|
-
js-yaml "^4.1.1"
|
|
9972
|
-
|
|
9973
9953
|
xmlbuilder@~11.0.0:
|
|
9974
9954
|
version "11.0.1"
|
|
9975
9955
|
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-11.0.1.tgz#be9bae1c8a046e76b31127726347d0ad7002beb3"
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apex-code-coverage-transformer",
|
|
3
3
|
"description": "Transform Salesforce Apex code coverage JSONs into other formats accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.18.1",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@oclif/core": "^4.8.
|
|
7
|
-
"@salesforce/core": "^8.26.
|
|
6
|
+
"@oclif/core": "^4.8.3",
|
|
7
|
+
"@salesforce/core": "^8.26.3",
|
|
8
8
|
"@salesforce/sf-plugins-core": "^12.2.6",
|
|
9
9
|
"async": "^3.2.6",
|
|
10
|
-
"
|
|
10
|
+
"fast-xml-parser": "^5.5.11"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@commitlint/cli": "^19.8.1",
|
|
14
14
|
"@commitlint/config-conventional": "^19.8.1",
|
|
15
|
-
"@oclif/plugin-command-snapshot": "^5.3.
|
|
15
|
+
"@oclif/plugin-command-snapshot": "^5.3.10",
|
|
16
16
|
"@salesforce/cli-plugins-testkit": "^5.3.39",
|
|
17
17
|
"@salesforce/dev-scripts": "^10.2.11",
|
|
18
18
|
"@types/async": "^3.2.24",
|