apex-code-coverage-transformer 2.7.1 → 2.8.0
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 +14 -0
- package/README.md +43 -34
- package/lib/handlers/getCoverageHandler.js +2 -0
- package/lib/handlers/getCoverageHandler.js.map +1 -1
- package/lib/handlers/jacocoCoverageHandler.d.ts +8 -0
- package/lib/handlers/jacocoCoverageHandler.js +58 -0
- package/lib/handlers/jacocoCoverageHandler.js.map +1 -0
- package/lib/helpers/constants.js +1 -1
- package/lib/helpers/constants.js.map +1 -1
- package/lib/helpers/generateReport.d.ts +2 -2
- package/lib/helpers/generateReport.js.map +1 -1
- package/lib/helpers/getRepoRoot.js +19 -25
- package/lib/helpers/getRepoRoot.js.map +1 -1
- package/lib/helpers/types.d.ts +41 -1
- package/messages/transformer.transform.md +2 -2
- package/oclif.lock +79 -64
- package/oclif.manifest.json +5 -4
- package/package.json +11 -6
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@
|
|
|
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.8.0](https://github.com/mcarvin8/apex-code-coverage-transformer/compare/v2.7.2...v2.8.0) (2025-02-07)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add jacoco format ([ecd74f6](https://github.com/mcarvin8/apex-code-coverage-transformer/commit/ecd74f6cc79663b0a0a1bae024620eb69426de60))
|
|
14
|
+
|
|
15
|
+
## [2.7.2](https://github.com/mcarvin8/apex-code-coverage-transformer/compare/v2.7.1...v2.7.2) (2025-02-02)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **deps:** bump @salesforce/sf-plugins-core from 12.1.1 to 12.1.3 ([28f0eeb](https://github.com/mcarvin8/apex-code-coverage-transformer/commit/28f0eeb83ef1855bc0fd5f4c5fb186a6aaeaa5a9))
|
|
21
|
+
|
|
8
22
|
## [2.7.1](https://github.com/mcarvin8/apex-code-coverage-transformer/compare/v2.7.0...v2.7.1) (2025-01-16)
|
|
9
23
|
|
|
10
24
|
|
package/README.md
CHANGED
|
@@ -13,14 +13,17 @@
|
|
|
13
13
|
- [What this Plugin fixes in the Salesforce CLI Coverage Reports](#what-this-plugin-fixes-in-the-salesforce-cli-coverage-reports)
|
|
14
14
|
- [Command](#command)
|
|
15
15
|
- [`sf acc-transformer transform`](#sf-acc-transformer-transform)
|
|
16
|
+
- [Coverage Report Formats](#coverage-report-formats)
|
|
16
17
|
- [Hook](#hook)
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
18
|
+
- [Debugging](#debugging)
|
|
19
|
+
- [Contributing](#contributing)
|
|
19
20
|
- [Issues](#issues)
|
|
20
21
|
- [License](#license)
|
|
21
22
|
</details>
|
|
22
23
|
|
|
23
|
-
A Salesforce CLI plugin to transform the Apex code coverage JSON files created during deployments and test runs into SonarQube,
|
|
24
|
+
A Salesforce CLI plugin to transform the Apex code coverage JSON files created during deployments and test runs into other [formats](#coverage-report-formats) accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.
|
|
25
|
+
|
|
26
|
+
If there's a coverage format not yet supported by this plugin, feel free to provide a pull request or issue for the coverage format.
|
|
24
27
|
|
|
25
28
|
## Install
|
|
26
29
|
|
|
@@ -30,15 +33,15 @@ sf plugins install apex-code-coverage-transformer@x.y.z
|
|
|
30
33
|
|
|
31
34
|
## Who is the Plugin For?
|
|
32
35
|
|
|
33
|
-
This plugin is intended for users who deploy their Apex
|
|
36
|
+
This plugin is intended for users who deploy their Apex classes and triggers from any Salesforce DX project (`sfdx-project.json` file). You should be running this plugin somewhere inside your Salesforce DX project. This plugin searches for your project's `sfdx-project.json` file to know which package directories to search into.
|
|
34
37
|
|
|
35
|
-
This plugin will work
|
|
38
|
+
This plugin will work regardless of your testing strategy (running all tests, running specified tests, running all local tests). The files in the original coverage JSON has to be found in one of the package directories to be added to the final report. This ensures external tools like SonarQube can match files in the coverage report to a file in the project.
|
|
36
39
|
|
|
37
|
-
When the plugin is unable to find
|
|
40
|
+
When the plugin is unable to find a matching Apex file in your project (i.e. Apex from managed and unlocked packages), it will print a warning and not add that file's coverage data to the final coverage report. See [Debugging](#debugging) for more information.
|
|
38
41
|
|
|
39
42
|
## Creating Code Coverage Files with the Salesforce CLI
|
|
40
43
|
|
|
41
|
-
**This tool will only support the "json" coverage format from the Salesforce CLI. Do not use
|
|
44
|
+
**This tool will only support the "json" coverage format from the Salesforce CLI. Do not use other coverage formats from the Salesforce CLI.**
|
|
42
45
|
|
|
43
46
|
To create the code coverage JSON when deploying or validating, append `--coverage-formatters json --results-dir "coverage"` to the `sf project deploy` command. This will create a coverage JSON in this relative path - `coverage/coverage/coverage.json`.
|
|
44
47
|
|
|
@@ -46,11 +49,11 @@ To create the code coverage JSON when deploying or validating, append `--coverag
|
|
|
46
49
|
sf project deploy [start/validate] --coverage-formatters json --results-dir "coverage"
|
|
47
50
|
```
|
|
48
51
|
|
|
49
|
-
To create the code coverage JSON when running tests directly in the org, append `--code-coverage --
|
|
52
|
+
To create the code coverage JSON when running tests directly in the org, append `--code-coverage --output-dir "coverage"` to the `sf apex run test` or `sf apex get test` command. This will create the code coverage JSON in this relative path - `coverage/test-result-codecoverage.json`
|
|
50
53
|
|
|
51
54
|
```
|
|
52
|
-
sf apex run test --code-coverage --
|
|
53
|
-
sf apex get test --test-run-id <test run id> --code-coverage --
|
|
55
|
+
sf apex run test --code-coverage --output-dir "coverage"
|
|
56
|
+
sf apex get test --test-run-id <test run id> --code-coverage --output-dir "coverage"
|
|
54
57
|
```
|
|
55
58
|
|
|
56
59
|
The code coverage JSONs created by the Salesforce CLI aren't accepted automatically for Salesforce DX repositories and needs to be converted using this plugin.
|
|
@@ -63,16 +66,16 @@ Both hardis commands will create the code coverage JSON to transform here: `hard
|
|
|
63
66
|
|
|
64
67
|
## What this Plugin fixes in the Salesforce CLI Coverage Reports
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
- The coverage reports created by this plugin will add correct file-paths per your Salesforce DX repository. Salesforce CLI coverage reports have the `no-map/` prefix hard-coded into their coverage reports. The coverage report created in this plugin will only contain Apex coverage results against files found in your Salesforce DX repository, allowing you to use these reports in external code quality tools like SonarQube.
|
|
70
|
+
- Normalizes the coverage reports created by the Salesforce CLI deploy and test command. The coverage reports created by both CLI commands follow different formats and have different coverage format options. These differences cause issues when trying to have external tools like SonarQube parse the coverage reports. This plugin handles parsing both command coverage reports and converting them into common formats accepted by external tools like SonarQube and GitLab.
|
|
71
|
+
- The coverage reports created by this plugin "fixes" an issue with Salesforce CLI deploy command coverage reports. The coverage reports created by the deploy command contains several inaccuracies in their covered lines.
|
|
72
|
+
- Salesforce's deploy covered report may report out-of-range lines as "covered", i.e. line 100 in a 98-line apex class is reported as "covered".
|
|
73
|
+
- Salesforce's deploy covered report may report extra lines than the total lines in the apex class, i.e. 120 lines are included in the deploy coverage report for a 100-line apex class.
|
|
74
|
+
- The coverage percentage may vary based on how many lines the API returns in the original deploy coverage report.
|
|
75
|
+
- I had to add a re-numbering function to this plugin to work-around these inaccuracies and ensure the transformed coverage reports are accepted by external tools like SonarQube.
|
|
76
|
+
- Once the Salesforce server team fixes the API to correctly return coverage in deploy command reports, I will remove this re-numbering function in this plugin.
|
|
77
|
+
- See issues [5511](https://github.com/forcedotcom/salesforcedx-vscode/issues/5511) and [1568](https://github.com/forcedotcom/cli/issues/1568).
|
|
78
|
+
- **NOTE**: This does not affect coverage reports created by the Salesforce CLI test commands.
|
|
76
79
|
|
|
77
80
|
## Command
|
|
78
81
|
|
|
@@ -91,14 +94,13 @@ FLAGS
|
|
|
91
94
|
-r, --output-report=<value> Path to the code coverage file that will be created by this plugin.
|
|
92
95
|
[default: "coverage.[xml/info]"]
|
|
93
96
|
-f, --format=<value> Output format for the code coverage format.
|
|
94
|
-
Valid options are "sonar", "clover", "lcovonly", or "cobertura".
|
|
95
97
|
[default: "sonar"]
|
|
96
98
|
|
|
97
99
|
GLOBAL FLAGS
|
|
98
100
|
--json Format output as json.
|
|
99
101
|
|
|
100
102
|
DESCRIPTION
|
|
101
|
-
Transform the Apex code coverage JSON file created by the Salesforce CLI deploy and test command into SonarQube,
|
|
103
|
+
Transform the Apex code coverage JSON file created by the Salesforce CLI deploy and test command into other formats accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.
|
|
102
104
|
|
|
103
105
|
EXAMPLES
|
|
104
106
|
$ sf acc-transformer transform -j "coverage.json" -r "coverage.xml" -f "sonar"
|
|
@@ -110,6 +112,18 @@ EXAMPLES
|
|
|
110
112
|
$ sf acc-transformer transform -j "coverage.json" -r "coverage.info" -f "lcovonly"
|
|
111
113
|
```
|
|
112
114
|
|
|
115
|
+
## Coverage Report Formats
|
|
116
|
+
|
|
117
|
+
The `-f`/`--format` flag allows you to specify the format of the coverage report.
|
|
118
|
+
|
|
119
|
+
| Flag Option | Description | Example |
|
|
120
|
+
| ----------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
121
|
+
| `sonar` | Generates a SonarQube-compatible coverage report. This is the default option. | [sonar example](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/sonar_baseline.xml) |
|
|
122
|
+
| `clover` | Produces a Clover XML report format, commonly used with Atlassian tools. | [Clover example](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/clover_baseline.xml) |
|
|
123
|
+
| `lcovonly` | Outputs coverage data in LCOV format, useful for integrating with LCOV-based tools. | [LCovOnly example](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/lcov_baseline.info) |
|
|
124
|
+
| `cobertura` | Creates a Cobertura XML report, a widely used format for coverage reporting. | [Cobertura example](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/cobertura_baseline.xml) |
|
|
125
|
+
| `jacoco` | Creates a JaCoCo XML report, a format for Java. | [JaCoCo example](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/jacoco_baseline.xml) |
|
|
126
|
+
|
|
113
127
|
## Hook
|
|
114
128
|
|
|
115
129
|
A post-run hook has been configured if you opt into using it by creating a `.apexcodecovtransformer.config.json` config file in the root of your repo. If the config file is found, the post-run hook will automatically run after the following commands:
|
|
@@ -120,8 +134,8 @@ A post-run hook has been configured if you opt into using it by creating a `.ape
|
|
|
120
134
|
- `sf project deploy resume`
|
|
121
135
|
- `sf apex run test`
|
|
122
136
|
- `sf apex get test`
|
|
123
|
-
- `hardis
|
|
124
|
-
- `hardis
|
|
137
|
+
- `sf hardis project deploy smart` (only if sfdx-hardis is installed and `COVERAGE_FORMATTER_JSON=true` environment variable is defined)
|
|
138
|
+
- `sf hardis org test apex` (only if sfdx-hardis is installed)
|
|
125
139
|
|
|
126
140
|
You can copy the sample [Salesforce CLI .apexcodecovtransformer.config.json](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/defaults/salesforce-cli/.apexcodecovtransformer.config.json), which assumes you are running the Salesforce CLI commands and specifying the `--results-dir`/`--output-dir` directory as "coverage". Update this sample with your desired output report path and format.
|
|
127
141
|
|
|
@@ -132,11 +146,11 @@ The `.apexcodecovtransformer.config.json` follows this structure:
|
|
|
132
146
|
- `deployCoverageJsonPath` is required to use the hook after deploy commands and should be the path to the code coverage JSON created by the Salesforce CLI/SFDX Hardis deploy command. Recommend using a relative path.
|
|
133
147
|
- `testCoverageJsonPath` is required to use the hook after test commands and should be the path to the code coverage JSON created by the Salesforce CLI/SFDX Hardis test command. Recommend using a relative path.
|
|
134
148
|
- `outputReportPath` is optional and should be the path to the code coverage file created by this plugin. Recommend using a relative path. If this isn't provided, it will default to `coverage.[xml/info]` in the working directory.
|
|
135
|
-
- `format` is optional and should be the intended
|
|
149
|
+
- `format` is optional and should be the intended coverage report format created by this plugin. If this isn't provided, it will default to "sonar".
|
|
136
150
|
|
|
137
151
|
If the `.apexcodecovtransformer.config.json` file isn't found, the hook will be skipped.
|
|
138
152
|
|
|
139
|
-
##
|
|
153
|
+
## Debugging
|
|
140
154
|
|
|
141
155
|
Any file in the coverage JSON that isn't found in any package directory will result in this warning:
|
|
142
156
|
|
|
@@ -154,7 +168,7 @@ Warning: The file name AccountProfile was not found in any package directory.
|
|
|
154
168
|
Warning: None of the files listed in the coverage JSON were processed. The coverage report will be empty.
|
|
155
169
|
```
|
|
156
170
|
|
|
157
|
-
The code coverage JSON files created by the Salesforce CLI
|
|
171
|
+
The code coverage JSON files created by the Salesforce CLI deploy and test commands follow different formats. If the code coverage JSON file provided does not match 1 of the 2 expected coverage data types, the plugin will fail with:
|
|
158
172
|
|
|
159
173
|
```
|
|
160
174
|
Error (1): The provided JSON does not match a known coverage data format from the Salesforce deploy or test command.
|
|
@@ -172,14 +186,9 @@ Any ENOENT failures indicate that the plugin had issues finding one of the packa
|
|
|
172
186
|
Error (1): ENOENT: no such file or directory: {packageDirPath}
|
|
173
187
|
```
|
|
174
188
|
|
|
175
|
-
##
|
|
176
|
-
|
|
177
|
-
This [code coverage JSON file](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/deploy_coverage_no_file_exts.json) created during a Salesforce CLI deployment can be transformed into:
|
|
189
|
+
## Contributing
|
|
178
190
|
|
|
179
|
-
|
|
180
|
-
- [Cobertura format](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/deploy_coverage_baseline_cobertura.xml)
|
|
181
|
-
- [Clover format](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/deploy_coverage_baseline_clover.xml)
|
|
182
|
-
- [LCovOnly format](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/deploy_coverage_baseline_lcov.info)
|
|
191
|
+
Contributions are welcome! See [Contributing](https://github.com/mcarvin8/apex-code-coverage-transformer/blob/main/CONTRIBUTING.md).
|
|
183
192
|
|
|
184
193
|
## Issues
|
|
185
194
|
|
|
@@ -3,12 +3,14 @@ import { CloverCoverageHandler } from './cloverCoverageHandler.js';
|
|
|
3
3
|
import { CoberturaCoverageHandler } from './coberturaCoverageHandler.js';
|
|
4
4
|
import { SonarCoverageHandler } from './sonarCoverageHandler.js';
|
|
5
5
|
import { LcovCoverageHandler } from './lcovCoverageHandler.js';
|
|
6
|
+
import { JaCoCoCoverageHandler } from './jacocoCoverageHandler.js';
|
|
6
7
|
export function getCoverageHandler(format) {
|
|
7
8
|
const handlers = {
|
|
8
9
|
sonar: new SonarCoverageHandler(),
|
|
9
10
|
cobertura: new CoberturaCoverageHandler(),
|
|
10
11
|
clover: new CloverCoverageHandler(),
|
|
11
12
|
lcovonly: new LcovCoverageHandler(),
|
|
13
|
+
jacoco: new JaCoCoCoverageHandler(),
|
|
12
14
|
};
|
|
13
15
|
const handler = handlers[format];
|
|
14
16
|
if (!handler) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCoverageHandler.js","sourceRoot":"","sources":["../../src/handlers/getCoverageHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"getCoverageHandler.js","sourceRoot":"","sources":["../../src/handlers/getCoverageHandler.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAGb,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,MAAM,QAAQ,GAAoC;QAChD,KAAK,EAAE,IAAI,oBAAoB,EAAE;QACjC,SAAS,EAAE,IAAI,wBAAwB,EAAE;QACzC,MAAM,EAAE,IAAI,qBAAqB,EAAE;QACnC,QAAQ,EAAE,IAAI,mBAAmB,EAAE;QACnC,MAAM,EAAE,IAAI,qBAAqB,EAAE;KACpC,CAAC;IAEF,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,uBAAuB,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JaCoCoCoverageObject, CoverageHandler } from '../helpers/types.js';
|
|
2
|
+
export declare class JaCoCoCoverageHandler implements CoverageHandler {
|
|
3
|
+
private readonly coverageObj;
|
|
4
|
+
private packageObj;
|
|
5
|
+
constructor();
|
|
6
|
+
processFile(filePath: string, fileName: string, lines: Record<string, number>): void;
|
|
7
|
+
finalize(): JaCoCoCoverageObject;
|
|
8
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
export class JaCoCoCoverageHandler {
|
|
3
|
+
coverageObj;
|
|
4
|
+
packageObj;
|
|
5
|
+
constructor() {
|
|
6
|
+
this.coverageObj = {
|
|
7
|
+
report: {
|
|
8
|
+
'@name': 'JaCoCo Coverage Report',
|
|
9
|
+
sessionInfo: [],
|
|
10
|
+
packages: { package: [] },
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
this.packageObj = {
|
|
14
|
+
'@name': 'main',
|
|
15
|
+
classes: { class: [] },
|
|
16
|
+
};
|
|
17
|
+
this.coverageObj.report.packages.package.push(this.packageObj);
|
|
18
|
+
}
|
|
19
|
+
processFile(filePath, fileName, lines) {
|
|
20
|
+
const classObj = {
|
|
21
|
+
'@name': fileName,
|
|
22
|
+
'@sourcefile': filePath,
|
|
23
|
+
lines: { line: [] },
|
|
24
|
+
counters: { counter: [] },
|
|
25
|
+
};
|
|
26
|
+
let coveredLines = 0;
|
|
27
|
+
let totalLines = 0;
|
|
28
|
+
for (const [lineNumber, isCovered] of Object.entries(lines)) {
|
|
29
|
+
totalLines++;
|
|
30
|
+
if (isCovered === 1)
|
|
31
|
+
coveredLines++;
|
|
32
|
+
const lineObj = {
|
|
33
|
+
'@nr': Number(lineNumber),
|
|
34
|
+
'@mi': isCovered === 0 ? 1 : 0,
|
|
35
|
+
'@ci': isCovered === 1 ? 1 : 0,
|
|
36
|
+
};
|
|
37
|
+
classObj.lines.line.push(lineObj);
|
|
38
|
+
}
|
|
39
|
+
classObj.counters.counter.push({
|
|
40
|
+
'@type': 'LINE',
|
|
41
|
+
'@missed': totalLines - coveredLines,
|
|
42
|
+
'@covered': coveredLines,
|
|
43
|
+
});
|
|
44
|
+
this.packageObj.classes.class.push(classObj);
|
|
45
|
+
}
|
|
46
|
+
finalize() {
|
|
47
|
+
if (this.coverageObj.report?.packages?.package) {
|
|
48
|
+
this.coverageObj.report.packages.package.sort((a, b) => a['@name'].localeCompare(b['@name']));
|
|
49
|
+
for (const pkg of this.coverageObj.report.packages.package) {
|
|
50
|
+
if (pkg.classes?.class) {
|
|
51
|
+
pkg.classes.class.sort((a, b) => a['@sourcefile'].localeCompare(b['@sourcefile']));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return this.coverageObj;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=jacocoCoverageHandler.js.map
|
|
@@ -0,0 +1 @@
|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-
export const formatOptions = ['sonar', 'cobertura', 'clover', 'lcovonly'];
|
|
1
|
+
export const formatOptions = ['sonar', 'cobertura', 'clover', 'lcovonly', 'jacoco'];
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAa,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/helpers/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAa,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SonarCoverageObject, CoberturaCoverageObject, CloverCoverageObject, LcovCoverageObject } from './types.js';
|
|
2
|
-
export declare function generateReport(coverageObj: SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject, format: string): string;
|
|
1
|
+
import { SonarCoverageObject, CoberturaCoverageObject, CloverCoverageObject, LcovCoverageObject, JaCoCoCoverageObject } from './types.js';
|
|
2
|
+
export declare function generateReport(coverageObj: SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject, format: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateReport.js","sourceRoot":"","sources":["../../src/helpers/generateReport.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"generateReport.js","sourceRoot":"","sources":["../../src/helpers/generateReport.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC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ict';
|
|
2
|
-
/* eslint-disable no-await-in-loop */
|
|
3
2
|
import { access } from 'node:fs/promises';
|
|
4
3
|
import { join, dirname } from 'node:path';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
found = true;
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
20
|
-
// If file not found, move up one directory level
|
|
21
|
-
const parentDir = dirname(currentDir);
|
|
22
|
-
if (currentDir === parentDir) {
|
|
23
|
-
// Reached the root without finding the file, throw an error
|
|
24
|
-
throw new Error('sfdx-project.json not found in any parent directory.');
|
|
25
|
-
}
|
|
26
|
-
currentDir = parentDir;
|
|
4
|
+
async function findRepoRoot(dir) {
|
|
5
|
+
const filePath = join(dir, 'sfdx-project.json');
|
|
6
|
+
try {
|
|
7
|
+
// Check if sfdx-project.json exists in the current directory
|
|
8
|
+
await access(filePath);
|
|
9
|
+
return { repoRoot: dir, dxConfigFilePath: filePath };
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
const parentDir = dirname(dir);
|
|
13
|
+
if (dir === parentDir) {
|
|
14
|
+
// Reached the root without finding the file, throw an error
|
|
15
|
+
throw new Error('sfdx-project.json not found in any parent directory.');
|
|
27
16
|
}
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
// Recursively search in the parent directory
|
|
18
|
+
return findRepoRoot(parentDir);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export async function getRepoRoot() {
|
|
22
|
+
const currentDir = process.cwd();
|
|
23
|
+
return findRepoRoot(currentDir);
|
|
30
24
|
}
|
|
31
25
|
//# sourceMappingURL=getRepoRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRepoRoot.js","sourceRoot":"","sources":["../../src/helpers/getRepoRoot.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,
|
|
1
|
+
{"version":3,"file":"getRepoRoot.js","sourceRoot":"","sources":["../../src/helpers/getRepoRoot.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,KAAK,UAAU,YAAY,CAAC,GAAW;IACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IAChD,IAAI,CAAC;QACH,6DAA6D;QAC7D,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACvB,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC;IACvD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,4DAA4D;YAC5D,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;QAC1E,CAAC;QACD,6CAA6C;QAC7C,OAAO,YAAY,CAAC,SAAS,CAAC,CAAC;IACjC,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IACjC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC"}
|
package/lib/helpers/types.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ export type CloverCoverageObject = {
|
|
|
145
145
|
};
|
|
146
146
|
export type CoverageHandler = {
|
|
147
147
|
processFile(filePath: string, fileName: string, lines: Record<string, number>): void;
|
|
148
|
-
finalize(): SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject;
|
|
148
|
+
finalize(): SonarCoverageObject | CoberturaCoverageObject | CloverCoverageObject | LcovCoverageObject | JaCoCoCoverageObject;
|
|
149
149
|
};
|
|
150
150
|
type LcovLine = {
|
|
151
151
|
lineNumber: number;
|
|
@@ -160,4 +160,44 @@ export type LcovFile = {
|
|
|
160
160
|
export type LcovCoverageObject = {
|
|
161
161
|
files: LcovFile[];
|
|
162
162
|
};
|
|
163
|
+
export type JaCoCoCounter = {
|
|
164
|
+
'@type': 'INSTRUCTION' | 'BRANCH' | 'LINE' | 'METHOD' | 'CLASS';
|
|
165
|
+
'@missed': number;
|
|
166
|
+
'@covered': number;
|
|
167
|
+
};
|
|
168
|
+
export type JaCoCoLine = {
|
|
169
|
+
'@nr': number;
|
|
170
|
+
'@mi': number;
|
|
171
|
+
'@ci': number;
|
|
172
|
+
};
|
|
173
|
+
export type JaCoCoClass = {
|
|
174
|
+
'@name': string;
|
|
175
|
+
'@sourcefile': string;
|
|
176
|
+
lines: {
|
|
177
|
+
line: JaCoCoLine[];
|
|
178
|
+
};
|
|
179
|
+
counters: {
|
|
180
|
+
counter: JaCoCoCounter[];
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
export type JaCoCoPackage = {
|
|
184
|
+
'@name': string;
|
|
185
|
+
classes: {
|
|
186
|
+
class: JaCoCoClass[];
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
export type JaCoCoSessionInfo = {
|
|
190
|
+
'@id': string;
|
|
191
|
+
'@start': number;
|
|
192
|
+
'@dump': number;
|
|
193
|
+
};
|
|
194
|
+
export type JaCoCoCoverageObject = {
|
|
195
|
+
report: {
|
|
196
|
+
'@name': string;
|
|
197
|
+
sessionInfo: JaCoCoSessionInfo[];
|
|
198
|
+
packages: {
|
|
199
|
+
package: JaCoCoPackage[];
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
};
|
|
163
203
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# summary
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Transform Salesforce Apex code coverage JSONs created during deployments and test runs into other formats accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.
|
|
4
4
|
|
|
5
5
|
# description
|
|
6
6
|
|
|
7
|
-
Transform
|
|
7
|
+
Transform Salesforce Apex code coverage JSONs created during deployments and test runs into other formats accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.
|
|
8
8
|
|
|
9
9
|
# examples
|
|
10
10
|
|
package/oclif.lock
CHANGED
|
@@ -1543,13 +1543,13 @@
|
|
|
1543
1543
|
"@nodelib/fs.scandir" "2.1.5"
|
|
1544
1544
|
fastq "^1.6.0"
|
|
1545
1545
|
|
|
1546
|
-
"@oclif/core@^4", "@oclif/core@^4.0.
|
|
1547
|
-
version "4.2.
|
|
1548
|
-
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-4.2.
|
|
1549
|
-
integrity sha512-
|
|
1546
|
+
"@oclif/core@^4", "@oclif/core@^4.0.37", "@oclif/core@^4.2.0", "@oclif/core@^4.2.4":
|
|
1547
|
+
version "4.2.5"
|
|
1548
|
+
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-4.2.5.tgz#6b51e1db17272204b2431fee3eba93a21d59ebbe"
|
|
1549
|
+
integrity sha512-bdXOojq8GaPnWnDgVOw030JlUROJEiDLXiV3XUUGUQDEp6YpVQvEYLIrUsEvyfASU3z3FGg3DC9k0kprcOYdhw==
|
|
1550
1550
|
dependencies:
|
|
1551
1551
|
ansi-escapes "^4.3.2"
|
|
1552
|
-
ansis "^3.
|
|
1552
|
+
ansis "^3.9.0"
|
|
1553
1553
|
clean-stack "^3.0.1"
|
|
1554
1554
|
cli-spinners "^2.9.2"
|
|
1555
1555
|
debug "^4.4.0"
|
|
@@ -1567,13 +1567,13 @@
|
|
|
1567
1567
|
wordwrap "^1.0.0"
|
|
1568
1568
|
wrap-ansi "^7.0.0"
|
|
1569
1569
|
|
|
1570
|
-
"@oclif/plugin-command-snapshot@^5.2.
|
|
1571
|
-
version "5.2.
|
|
1572
|
-
resolved "https://registry.yarnpkg.com/@oclif/plugin-command-snapshot/-/plugin-command-snapshot-5.2.
|
|
1573
|
-
integrity sha512-
|
|
1570
|
+
"@oclif/plugin-command-snapshot@^5.2.28":
|
|
1571
|
+
version "5.2.28"
|
|
1572
|
+
resolved "https://registry.yarnpkg.com/@oclif/plugin-command-snapshot/-/plugin-command-snapshot-5.2.28.tgz#676a2bc483faafa95d782e201439dddf3ff6d57f"
|
|
1573
|
+
integrity sha512-uXN+42xe8/FLLELRWvP0g1ZsVKYAANAOKOgxqr98KRZVFe4roh3klQtlNj2RHvSTxLQyz/K/V/Mf1q9HDUf7Eg==
|
|
1574
1574
|
dependencies:
|
|
1575
1575
|
"@oclif/core" "^4"
|
|
1576
|
-
ansis "^3.
|
|
1576
|
+
ansis "^3.9.0"
|
|
1577
1577
|
globby "^14.0.2"
|
|
1578
1578
|
just-diff "^5.2.0"
|
|
1579
1579
|
lodash.difference "^4.5.0"
|
|
@@ -1611,16 +1611,16 @@
|
|
|
1611
1611
|
lodash "^4.17.21"
|
|
1612
1612
|
registry-auth-token "^5.0.3"
|
|
1613
1613
|
|
|
1614
|
-
"@oclif/table@^0.
|
|
1615
|
-
version "0.
|
|
1616
|
-
resolved "https://registry.yarnpkg.com/@oclif/table/-/table-0.
|
|
1617
|
-
integrity sha512-
|
|
1614
|
+
"@oclif/table@^0.4.0":
|
|
1615
|
+
version "0.4.4"
|
|
1616
|
+
resolved "https://registry.yarnpkg.com/@oclif/table/-/table-0.4.4.tgz#aa48c0d37f1a4aaeb1d9095e3be8231f44c88c65"
|
|
1617
|
+
integrity sha512-AxUKOgWfW/QmoENZHJjV99OOPEAJMq88Eq5drIK0Xeguf9M0NKrNY7uJwyjXmLs7Gl18yFW/oRxrmedXOzg8JA==
|
|
1618
1618
|
dependencies:
|
|
1619
1619
|
"@oclif/core" "^4"
|
|
1620
1620
|
"@types/react" "^18.3.12"
|
|
1621
1621
|
change-case "^5.4.4"
|
|
1622
1622
|
cli-truncate "^4.0.0"
|
|
1623
|
-
ink "
|
|
1623
|
+
ink "5.0.1"
|
|
1624
1624
|
natural-orderby "^3.0.2"
|
|
1625
1625
|
object-hash "^3.0.0"
|
|
1626
1626
|
react "^18.3.1"
|
|
@@ -1781,15 +1781,15 @@
|
|
|
1781
1781
|
resolved "https://registry.yarnpkg.com/@salesforce/schemas/-/schemas-1.9.0.tgz#ba477a112653a20b4edcf989c61c57bdff9aa3ca"
|
|
1782
1782
|
integrity sha512-LiN37zG5ODT6z70sL1fxF7BQwtCX9JOWofSU8iliSNIM+WDEeinnoFtVqPInRSNt8I0RiJxIKCrqstsmQRBNvA==
|
|
1783
1783
|
|
|
1784
|
-
"@salesforce/sf-plugins-core@^12.1.
|
|
1785
|
-
version "12.1.
|
|
1786
|
-
resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-12.1.
|
|
1787
|
-
integrity sha512-
|
|
1784
|
+
"@salesforce/sf-plugins-core@^12.1.3":
|
|
1785
|
+
version "12.1.3"
|
|
1786
|
+
resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-12.1.3.tgz#4150b231f50bcdb64d6bd471a9d8f25f7ca57273"
|
|
1787
|
+
integrity sha512-xJSzwl2G7OYSpZTokzWgq9Ybfw/ZtR3reQEFvJTNATLoPk7nv7UGo8WWbX1gcaepURBVvtmQlHsa8mVyoKjYmw==
|
|
1788
1788
|
dependencies:
|
|
1789
1789
|
"@inquirer/confirm" "^3.1.22"
|
|
1790
1790
|
"@inquirer/password" "^2.2.0"
|
|
1791
|
-
"@oclif/core" "^4.
|
|
1792
|
-
"@oclif/table" "^0.
|
|
1791
|
+
"@oclif/core" "^4.2.4"
|
|
1792
|
+
"@oclif/table" "^0.4.0"
|
|
1793
1793
|
"@salesforce/core" "^8.5.1"
|
|
1794
1794
|
"@salesforce/kit" "^3.2.3"
|
|
1795
1795
|
"@salesforce/ts-types" "^2.0.12"
|
|
@@ -2562,9 +2562,9 @@
|
|
|
2562
2562
|
undici-types "~6.20.0"
|
|
2563
2563
|
|
|
2564
2564
|
"@types/node@18", "@types/node@^18.19.41":
|
|
2565
|
-
version "18.19.
|
|
2566
|
-
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.
|
|
2567
|
-
integrity sha512-
|
|
2565
|
+
version "18.19.74"
|
|
2566
|
+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.74.tgz#4d093acd2a558ebbc5f0efa4e20ce63791b0cc58"
|
|
2567
|
+
integrity sha512-HMwEkkifei3L605gFdV+/UwtpxP6JSzM+xFk2Ia6DNFSwSVBRh9qp5Tgf4lNFOMfPVuU0WnkcWpXZpgn5ufO4A==
|
|
2568
2568
|
dependencies:
|
|
2569
2569
|
undici-types "~5.26.4"
|
|
2570
2570
|
|
|
@@ -2904,10 +2904,10 @@ ansi-styles@^6.0.0, ansi-styles@^6.1.0, ansi-styles@^6.2.1:
|
|
|
2904
2904
|
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5"
|
|
2905
2905
|
integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==
|
|
2906
2906
|
|
|
2907
|
-
ansis@^3.3.2, ansis@^3.5.2:
|
|
2908
|
-
version "3.
|
|
2909
|
-
resolved "https://registry.yarnpkg.com/ansis/-/ansis-3.
|
|
2910
|
-
integrity sha512-
|
|
2907
|
+
ansis@^3.3.2, ansis@^3.5.2, ansis@^3.9.0:
|
|
2908
|
+
version "3.10.0"
|
|
2909
|
+
resolved "https://registry.yarnpkg.com/ansis/-/ansis-3.10.0.tgz#6886afb0f729b1fa865df6b710b97a9915b7d0d4"
|
|
2910
|
+
integrity sha512-hxDKLYT7hy3Y4sF3HxI926A3urzPxi73mZBB629m9bCVF+NyKNxbwCqqm+C/YrGPtxLwnl6d8/ZASCsz6SyvJA==
|
|
2911
2911
|
|
|
2912
2912
|
anymatch@~3.1.2:
|
|
2913
2913
|
version "3.1.3"
|
|
@@ -4209,11 +4209,6 @@ es-to-primitive@^1.2.1:
|
|
|
4209
4209
|
is-date-object "^1.0.1"
|
|
4210
4210
|
is-symbol "^1.0.2"
|
|
4211
4211
|
|
|
4212
|
-
es-toolkit@^1.22.0:
|
|
4213
|
-
version "1.30.1"
|
|
4214
|
-
resolved "https://registry.yarnpkg.com/es-toolkit/-/es-toolkit-1.30.1.tgz#311be8eec88f53b0b1a9d40117f3f3c1e763e274"
|
|
4215
|
-
integrity sha512-ZXflqanzH8BpHkDhFa10bBf6ONDCe84EPUm7SSICGzuuROSluT2ynTPtwn9PcRelMtorCRozSknI/U0MNYp0Uw==
|
|
4216
|
-
|
|
4217
4212
|
es6-error@^4.0.1:
|
|
4218
4213
|
version "4.1.1"
|
|
4219
4214
|
resolved "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz"
|
|
@@ -5394,10 +5389,10 @@ ini@^1.3.4:
|
|
|
5394
5389
|
resolved "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz"
|
|
5395
5390
|
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
|
|
5396
5391
|
|
|
5397
|
-
ink
|
|
5398
|
-
version "5.1
|
|
5399
|
-
resolved "https://registry.yarnpkg.com/ink/-/ink-5.1.
|
|
5400
|
-
integrity sha512-
|
|
5392
|
+
ink@5.0.1:
|
|
5393
|
+
version "5.0.1"
|
|
5394
|
+
resolved "https://registry.yarnpkg.com/ink/-/ink-5.0.1.tgz#f2ef9796a3911830c3995dedd227ec84ae27de4b"
|
|
5395
|
+
integrity sha512-ae4AW/t8jlkj/6Ou21H2av0wxTk8vrGzXv+v2v7j4in+bl1M5XRMVbfNghzhBokV++FjF8RBDJvYo+ttR9YVRg==
|
|
5401
5396
|
dependencies:
|
|
5402
5397
|
"@alcalzone/ansi-tokenize" "^0.1.3"
|
|
5403
5398
|
ansi-escapes "^7.0.0"
|
|
@@ -5408,20 +5403,20 @@ ink@^5.1.0:
|
|
|
5408
5403
|
cli-cursor "^4.0.0"
|
|
5409
5404
|
cli-truncate "^4.0.0"
|
|
5410
5405
|
code-excerpt "^4.0.0"
|
|
5411
|
-
es-toolkit "^1.22.0"
|
|
5412
5406
|
indent-string "^5.0.0"
|
|
5413
|
-
is-in-ci "^1.0
|
|
5407
|
+
is-in-ci "^0.1.0"
|
|
5408
|
+
lodash "^4.17.21"
|
|
5414
5409
|
patch-console "^2.0.0"
|
|
5415
5410
|
react-reconciler "^0.29.0"
|
|
5416
5411
|
scheduler "^0.23.0"
|
|
5417
5412
|
signal-exit "^3.0.7"
|
|
5418
5413
|
slice-ansi "^7.1.0"
|
|
5419
5414
|
stack-utils "^2.0.6"
|
|
5420
|
-
string-width "^7.
|
|
5421
|
-
type-fest "^4.
|
|
5415
|
+
string-width "^7.0.0"
|
|
5416
|
+
type-fest "^4.8.3"
|
|
5422
5417
|
widest-line "^5.0.0"
|
|
5423
5418
|
wrap-ansi "^9.0.0"
|
|
5424
|
-
ws "^8.
|
|
5419
|
+
ws "^8.15.0"
|
|
5425
5420
|
yoga-wasm-web "~0.3.3"
|
|
5426
5421
|
|
|
5427
5422
|
internal-slot@^1.0.5:
|
|
@@ -5611,10 +5606,10 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1:
|
|
|
5611
5606
|
dependencies:
|
|
5612
5607
|
is-extglob "^2.1.1"
|
|
5613
5608
|
|
|
5614
|
-
is-in-ci@^1.0
|
|
5615
|
-
version "1.0
|
|
5616
|
-
resolved "https://registry.yarnpkg.com/is-in-ci/-/is-in-ci-1.0.
|
|
5617
|
-
integrity sha512-
|
|
5609
|
+
is-in-ci@^0.1.0:
|
|
5610
|
+
version "0.1.0"
|
|
5611
|
+
resolved "https://registry.yarnpkg.com/is-in-ci/-/is-in-ci-0.1.0.tgz#5e07d6a02ec3a8292d3f590973357efa3fceb0d3"
|
|
5612
|
+
integrity sha512-d9PXLEY0v1iJ64xLiQMJ51J128EYHAaOR4yZqQi8aHGfw6KgifM3/Viw1oZZ1GCVmb3gBuyhLyHj0HgR2DhSXQ==
|
|
5618
5613
|
|
|
5619
5614
|
is-map@^2.0.3:
|
|
5620
5615
|
version "2.0.3"
|
|
@@ -8041,7 +8036,16 @@ stack-utils@^2.0.6:
|
|
|
8041
8036
|
dependencies:
|
|
8042
8037
|
escape-string-regexp "^2.0.0"
|
|
8043
8038
|
|
|
8044
|
-
"string-width-cjs@npm:string-width@^4.2.0"
|
|
8039
|
+
"string-width-cjs@npm:string-width@^4.2.0":
|
|
8040
|
+
version "4.2.3"
|
|
8041
|
+
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
|
|
8042
|
+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
|
8043
|
+
dependencies:
|
|
8044
|
+
emoji-regex "^8.0.0"
|
|
8045
|
+
is-fullwidth-code-point "^3.0.0"
|
|
8046
|
+
strip-ansi "^6.0.1"
|
|
8047
|
+
|
|
8048
|
+
string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
|
8045
8049
|
version "4.2.3"
|
|
8046
8050
|
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
|
|
8047
8051
|
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
|
@@ -8059,7 +8063,7 @@ string-width@^5.0.1, string-width@^5.1.2:
|
|
|
8059
8063
|
emoji-regex "^9.2.2"
|
|
8060
8064
|
strip-ansi "^7.0.1"
|
|
8061
8065
|
|
|
8062
|
-
string-width@^7.0.0
|
|
8066
|
+
string-width@^7.0.0:
|
|
8063
8067
|
version "7.2.0"
|
|
8064
8068
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-7.2.0.tgz#b5bb8e2165ce275d4d43476dd2700ad9091db6dc"
|
|
8065
8069
|
integrity sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==
|
|
@@ -8149,7 +8153,14 @@ stringify-entities@^4.0.0:
|
|
|
8149
8153
|
character-entities-html4 "^2.0.0"
|
|
8150
8154
|
character-entities-legacy "^3.0.0"
|
|
8151
8155
|
|
|
8152
|
-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1"
|
|
8156
|
+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
|
|
8157
|
+
version "6.0.1"
|
|
8158
|
+
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
|
|
8159
|
+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
|
8160
|
+
dependencies:
|
|
8161
|
+
ansi-regex "^5.0.1"
|
|
8162
|
+
|
|
8163
|
+
strip-ansi@6.0.1, strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
|
8153
8164
|
version "6.0.1"
|
|
8154
8165
|
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
|
|
8155
8166
|
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
|
@@ -8465,10 +8476,10 @@ type-fest@^1.0.2:
|
|
|
8465
8476
|
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1"
|
|
8466
8477
|
integrity sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==
|
|
8467
8478
|
|
|
8468
|
-
type-fest@^4.
|
|
8469
|
-
version "4.
|
|
8470
|
-
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.
|
|
8471
|
-
integrity sha512-
|
|
8479
|
+
type-fest@^4.8.3:
|
|
8480
|
+
version "4.33.0"
|
|
8481
|
+
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.33.0.tgz#2da0c135b9afa76cf8b18ecfd4f260ecd414a432"
|
|
8482
|
+
integrity sha512-s6zVrxuyKbbAsSAD5ZPTB77q4YIdRctkTbJ2/Dqlinwz+8ooH2gd+YA7VA6Pa93KML9GockVvoxjZ2vHP+mu8g==
|
|
8472
8483
|
|
|
8473
8484
|
typed-array-buffer@^1.0.0:
|
|
8474
8485
|
version "1.0.0"
|
|
@@ -8577,15 +8588,10 @@ typedoc@^0.26.5:
|
|
|
8577
8588
|
shiki "^1.16.2"
|
|
8578
8589
|
yaml "^2.5.1"
|
|
8579
8590
|
|
|
8580
|
-
"typescript@^4.6.4 || ^5.2.2":
|
|
8581
|
-
version "5.
|
|
8582
|
-
resolved "https://registry.
|
|
8583
|
-
integrity sha512-
|
|
8584
|
-
|
|
8585
|
-
typescript@^5.5.4, typescript@^5.7.2:
|
|
8586
|
-
version "5.7.2"
|
|
8587
|
-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6"
|
|
8588
|
-
integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==
|
|
8591
|
+
"typescript@^4.6.4 || ^5.2.2", typescript@^5.5.4, typescript@^5.7.3:
|
|
8592
|
+
version "5.7.3"
|
|
8593
|
+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e"
|
|
8594
|
+
integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==
|
|
8589
8595
|
|
|
8590
8596
|
typescript@~5.4.2:
|
|
8591
8597
|
version "5.4.5"
|
|
@@ -8908,7 +8914,7 @@ workerpool@^6.5.1:
|
|
|
8908
8914
|
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544"
|
|
8909
8915
|
integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==
|
|
8910
8916
|
|
|
8911
|
-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0"
|
|
8917
|
+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
|
8912
8918
|
version "7.0.0"
|
|
8913
8919
|
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
|
|
8914
8920
|
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
|
@@ -8926,6 +8932,15 @@ wrap-ansi@^6.2.0:
|
|
|
8926
8932
|
string-width "^4.1.0"
|
|
8927
8933
|
strip-ansi "^6.0.0"
|
|
8928
8934
|
|
|
8935
|
+
wrap-ansi@^7.0.0:
|
|
8936
|
+
version "7.0.0"
|
|
8937
|
+
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz"
|
|
8938
|
+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
|
8939
|
+
dependencies:
|
|
8940
|
+
ansi-styles "^4.0.0"
|
|
8941
|
+
string-width "^4.1.0"
|
|
8942
|
+
strip-ansi "^6.0.0"
|
|
8943
|
+
|
|
8929
8944
|
wrap-ansi@^8.1.0:
|
|
8930
8945
|
version "8.1.0"
|
|
8931
8946
|
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz"
|
|
@@ -8959,7 +8974,7 @@ write-file-atomic@^3.0.0:
|
|
|
8959
8974
|
signal-exit "^3.0.2"
|
|
8960
8975
|
typedarray-to-buffer "^3.1.5"
|
|
8961
8976
|
|
|
8962
|
-
ws@^8.
|
|
8977
|
+
ws@^8.15.0:
|
|
8963
8978
|
version "8.18.0"
|
|
8964
8979
|
resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc"
|
|
8965
8980
|
integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==
|
package/oclif.manifest.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"acc-transformer:transform": {
|
|
4
4
|
"aliases": [],
|
|
5
5
|
"args": {},
|
|
6
|
-
"description": "Transform
|
|
6
|
+
"description": "Transform Salesforce Apex code coverage JSONs created during deployments and test runs into other formats accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.",
|
|
7
7
|
"examples": [
|
|
8
8
|
"`sf acc-transformer transform -j \"coverage.json\" -r \"coverage.xml\" -f \"sonar\"`",
|
|
9
9
|
"`sf acc-transformer transform -j \"coverage.json\" -r \"coverage.xml\" -f \"cobertura\"`",
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
"sonar",
|
|
58
58
|
"cobertura",
|
|
59
59
|
"clover",
|
|
60
|
-
"lcovonly"
|
|
60
|
+
"lcovonly",
|
|
61
|
+
"jacoco"
|
|
61
62
|
],
|
|
62
63
|
"type": "option"
|
|
63
64
|
}
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"pluginName": "apex-code-coverage-transformer",
|
|
70
71
|
"pluginType": "core",
|
|
71
72
|
"strict": true,
|
|
72
|
-
"summary": "
|
|
73
|
+
"summary": "Transform Salesforce Apex code coverage JSONs created during deployments and test runs into other formats accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.",
|
|
73
74
|
"enableJsonFlag": true,
|
|
74
75
|
"isESM": true,
|
|
75
76
|
"relativePath": [
|
|
@@ -85,5 +86,5 @@
|
|
|
85
86
|
]
|
|
86
87
|
}
|
|
87
88
|
},
|
|
88
|
-
"version": "2.
|
|
89
|
+
"version": "2.8.0"
|
|
89
90
|
}
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apex-code-coverage-transformer",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "2.
|
|
3
|
+
"description": "Transform Salesforce Apex code coverage JSONs created during deployments and test runs into other formats accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.",
|
|
4
|
+
"version": "2.8.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@oclif/core": "^4.0.37",
|
|
7
7
|
"@salesforce/core": "^8.8.0",
|
|
8
|
-
"@salesforce/sf-plugins-core": "^12.1.
|
|
8
|
+
"@salesforce/sf-plugins-core": "^12.1.3",
|
|
9
9
|
"async": "^3.2.6",
|
|
10
10
|
"xmlbuilder2": "^3.1.1"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@commitlint/cli": "^19.6.1",
|
|
14
14
|
"@commitlint/config-conventional": "^19.6.0",
|
|
15
|
-
"@oclif/plugin-command-snapshot": "^5.2.
|
|
15
|
+
"@oclif/plugin-command-snapshot": "^5.2.28",
|
|
16
16
|
"@salesforce/cli-plugins-testkit": "^5.3.39",
|
|
17
17
|
"@salesforce/dev-scripts": "^10.2.11",
|
|
18
18
|
"@types/async": "^3.2.24",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"oclif": "^4.17.7",
|
|
23
23
|
"shx": "0.3.4",
|
|
24
24
|
"ts-node": "^10.9.2",
|
|
25
|
-
"typescript": "^5.7.
|
|
25
|
+
"typescript": "^5.7.3"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=18.0.0"
|
|
@@ -55,7 +55,12 @@
|
|
|
55
55
|
"code",
|
|
56
56
|
"quality",
|
|
57
57
|
"validation",
|
|
58
|
-
"deployment"
|
|
58
|
+
"deployment",
|
|
59
|
+
"gitlab",
|
|
60
|
+
"github",
|
|
61
|
+
"azure",
|
|
62
|
+
"bitbucket",
|
|
63
|
+
"jacoco"
|
|
59
64
|
],
|
|
60
65
|
"license": "MIT",
|
|
61
66
|
"oclif": {
|