apex-code-coverage-transformer 1.6.5 → 1.6.7

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/README.md CHANGED
@@ -4,8 +4,12 @@
4
4
 
5
5
  The `apex-code-coverage-transformer` is a Salesforce CLI plugin to transform the Apex Code Coverage JSON files created during deployments into the Generic Test Coverage Format (XML). This format is accepted by static code analysis tools like SonarQube.
6
6
 
7
+ This plugin requires [git](https://git-scm.com/downloads) to be installed and that it can be called using the command `git`.
8
+
7
9
  This plugin supports code coverage metrics created for Apex Classes and Apex Triggers. This also supports multiple package directories as listed in your project's `sfdx-project.json` configuration, assuming unique file-names are used in your package directories.
8
10
 
11
+ This plugin is intended for users who deploy their Apex codebase from a git-based repository and use SonarQube for code quality. This plugin will work if you run local tests or run all tests in an org, including tests that originate from installed managed and unlocked packages. SonarQube relies on file-paths to map code coverage to the files in their file explorer interface. Since files from managed and unlocked packages aren't retrieved into git-based Salesforce repositories, these files cannot be included in your SonarQube scans. If your Apex code coverage JSON output includes managed/unlocked package files, they will not be added to the coverage XML created by this plugin. A warning will be printed for each file not found in a package directory in your git repository. See [Errors and Warnings](https://github.com/mcarvin8/apex-code-coverage-transformer?tab=readme-ov-file#errors-and-warnings) for more information.
12
+
9
13
  To create the code coverage JSON during a Salesforce CLI deployment/validation, append `--coverage-formatters json --results-dir coverage` to the `sf project deploy` command:
10
14
 
11
15
  ```
@@ -14,7 +18,7 @@ sf project deploy [start/validate] -x manifest/package.xml -l RunSpecifiedTests
14
18
 
15
19
  This will create a coverage JSON in this relative path - `coverage/coverage/coverage.json`
16
20
 
17
- This JSON isn't accepted by SonarQube automatically and needs to be converted using this plugin.
21
+ This JSON isn't accepted by SonarQube automatically for git-based Salesforce repositories and needs to be converted using this plugin.
18
22
 
19
23
  **Disclaimer**: Due to existing bugs with how the Salesforce CLI reports covered lines (see [5511](https://github.com/forcedotcom/salesforcedx-vscode/issues/5511) and [1568](https://github.com/forcedotcom/cli/issues/1568)), to add support for covered lines in this plugin, I had to add a function to re-number out-of-range covered lines the CLI may report (ex: line 100 in a 98-line Apex Class is reported back as covered by the Salesforce CLI deploy command). Salesforce's coverage result may also include extra lines as covered (ex: 120 lines are included in the coverage report for a 100 line file), so the coverage percentage may vary based on how many lines the API returns in the coverage report. Once Salesforce fixes the API to correctly return covered lines in the deploy command, this function will be removed.
20
24
 
@@ -30,18 +34,17 @@ The `apex-code-coverage-transformer` has 1 command:
30
34
 
31
35
  - `sf apex-code-coverage transformer transform`
32
36
 
33
- Recommend running this command in the same directory that your `sfdx-project.json` file is located in. This command will use the `packageDirectories` in the JSON file to set the file-paths in the coverage file.
37
+ This command needs to be ran somewhere inside your Salesforce DX git repository, whether in the root folder (recommended) or in a subfolder. This plugin will determine the root folder of this repository and read the `sfdx-project.json` file in the root folder. All package directories listed in the `sfdx-project.json` file will be processed when running this plugin.
34
38
 
35
39
  ## `sf apex-code-coverage transformer transform`
36
40
 
37
41
  ```
38
42
  USAGE
39
- $ sf apex-code-coverage transformer transform -j <value> -x <value> -c <value> [--json]
43
+ $ sf apex-code-coverage transformer transform -j <value> -x <value> [--json]
40
44
 
41
45
  FLAGS
42
46
  -j, --coverage-json=<value> Path to the code coverage JSON file created by the Salesforce CLI deployment command.
43
47
  -x, --xml=<value> [default: coverage.xml] Path to code coverage XML file that will be created by this plugin.
44
- -c, --sfdx-configuration=<value> [default: 'sfdx-project.json'] Path to your project's Salesforce DX configuration file.
45
48
 
46
49
  GLOBAL FLAGS
47
50
  --json Format output as json.
@@ -50,7 +53,7 @@ DESCRIPTION
50
53
  This plugin will convert the code coverage JSON file created by the Salesforce CLI during Apex deployments into an XML accepted by tools like SonarQube.
51
54
 
52
55
  EXAMPLES
53
- $ sf apex-code-coverage transformer transform -j "coverage.json" -x "coverage.xml" -c "sfdx-project.json"
56
+ $ sf apex-code-coverage transformer transform -j "coverage.json" -x "coverage.xml"
54
57
  ```
55
58
 
56
59
  ## Errors and Warnings
@@ -61,7 +64,7 @@ Any file in the coverage JSON that isn't found in any package directory will res
61
64
  Warning: The file name AccountTrigger was not found in any package directory.
62
65
  ```
63
66
 
64
- Files not found in any package directory will not be added to the coverage XML.
67
+ Files not found in any package directory will not be added to the coverage XML. This includes Apex classes that originate from installed managed and unlocked packages when running all tests in your org.
65
68
 
66
69
  If none of the files listed in the coverage JSON were found in a package directory, the plugin will fail with this error in addition to the above warnings:
67
70
 
@@ -71,7 +74,7 @@ Warning: The file name AccountProfile was not found in any package directory.
71
74
  Error (1): None of the files listed in the coverage JSON were processed.
72
75
  ```
73
76
 
74
- If the `sfdx-project.json` file was not found, the plugin will fail with:
77
+ If the `sfdx-project.json` file was not found in your repository's root folder, the plugin will fail with:
75
78
 
76
79
  ```
77
80
  Error (1): Salesforce DX Config File does not exist in this path: {filePath}
@@ -7,7 +7,6 @@ export default class TransformerTransform extends SfCommand<TransformerTransform
7
7
  static readonly description: string;
8
8
  static readonly examples: string[];
9
9
  static readonly flags: {
10
- 'sfdx-configuration': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
10
  'coverage-json': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
12
11
  xml: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
13
12
  };
@@ -11,13 +11,6 @@ export default class TransformerTransform extends SfCommand {
11
11
  static description = messages.getMessage('description');
12
12
  static examples = messages.getMessages('examples');
13
13
  static flags = {
14
- 'sfdx-configuration': Flags.file({
15
- summary: messages.getMessage('flags.sfdx-configuration.summary'),
16
- char: 'c',
17
- required: true,
18
- exists: true,
19
- default: 'sfdx-project.json',
20
- }),
21
14
  'coverage-json': Flags.file({
22
15
  summary: messages.getMessage('flags.coverage-json.summary'),
23
16
  char: 'j',
@@ -34,15 +27,11 @@ export default class TransformerTransform extends SfCommand {
34
27
  };
35
28
  async run() {
36
29
  const { flags } = await this.parse(TransformerTransform);
37
- let jsonFilePath = flags['coverage-json'];
38
- let xmlFilePath = flags['xml'];
39
- let sfdxConfigFile = flags['sfdx-configuration'];
40
- jsonFilePath = resolve(jsonFilePath);
41
- xmlFilePath = resolve(xmlFilePath);
42
- sfdxConfigFile = resolve(sfdxConfigFile);
30
+ const jsonFilePath = resolve(flags['coverage-json']);
31
+ const xmlFilePath = resolve(flags['xml']);
43
32
  const jsonData = await readFile(jsonFilePath, 'utf-8');
44
33
  const coverageData = JSON.parse(jsonData);
45
- const { xml: xmlData, warnings, filesProcessed, } = await convertToGenericCoverageReport(coverageData, sfdxConfigFile);
34
+ const { xml: xmlData, warnings, filesProcessed } = await convertToGenericCoverageReport(coverageData);
46
35
  // Print warnings if any
47
36
  if (warnings.length > 0) {
48
37
  warnings.forEach((warning) => {
@@ -1 +1 @@
1
- {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../../src/commands/apex-code-coverage/transformer/transform.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAC;AAEpG,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,gCAAgC,EAAE,uBAAuB,CAAC,CAAC;AAMlG,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,SAAqC;IAC9E,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACzD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,GAAG,MAAM,8BAA8B,CAAC,YAAY,CAAC,CAAC;QAEtG,wBAAwB;QACxB,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC3B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,cAAc,KAAK,CAAC,EAAE,CAAC;YACzB,IAAI,CAAC,KAAK,CAAC,+DAA+D,CAAC,CAAC;QAC9E,CAAC;QAED,MAAM,SAAS,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,oCAAoC,WAAW,EAAE,CAAC,CAAC;QAC5D,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC/B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { CoverageData } from './types.js';
2
- export declare function convertToGenericCoverageReport(data: CoverageData, dxConfigFile: string): Promise<{
2
+ export declare function convertToGenericCoverageReport(data: CoverageData): Promise<{
3
3
  xml: string;
4
4
  warnings: string[];
5
5
  filesProcessed: number;
@@ -3,7 +3,8 @@
3
3
  import { create } from 'xmlbuilder2';
4
4
  import { findFilePath } from './findFilePath.js';
5
5
  import { setCoveredLines } from './setCoveredLines.js';
6
- export async function convertToGenericCoverageReport(data, dxConfigFile) {
6
+ import { normalizePathToUnix } from './normalizePathToUnix.js';
7
+ export async function convertToGenericCoverageReport(data) {
7
8
  const coverageObj = { coverage: { '@version': '1', file: [] } };
8
9
  const warnings = [];
9
10
  let filesProcessed = 0;
@@ -12,8 +13,8 @@ export async function convertToGenericCoverageReport(data, dxConfigFile) {
12
13
  continue;
13
14
  const fileInfo = data[fileName];
14
15
  const formattedFileName = fileName.replace('no-map/', '');
15
- const filePath = await findFilePath(formattedFileName, dxConfigFile);
16
- if (filePath === undefined) {
16
+ const { repoRoot, relativeFilePath } = await findFilePath(formattedFileName);
17
+ if (relativeFilePath === undefined) {
17
18
  warnings.push(`The file name ${formattedFileName} was not found in any package directory.`);
18
19
  continue;
19
20
  }
@@ -24,14 +25,14 @@ export async function convertToGenericCoverageReport(data, dxConfigFile) {
24
25
  .filter((lineNumber) => fileInfo.s[lineNumber] === 1)
25
26
  .map(Number);
26
27
  const fileObj = {
27
- '@path': filePath,
28
+ '@path': normalizePathToUnix(relativeFilePath),
28
29
  lineToCover: uncoveredLines.map((lineNumber) => ({
29
30
  '@lineNumber': lineNumber,
30
31
  '@covered': 'false',
31
32
  })),
32
33
  };
33
34
  // this function is only needed until Salesforce fixes the API to correctly return covered lines
34
- await setCoveredLines(coveredLines, uncoveredLines, filePath, fileObj);
35
+ await setCoveredLines(coveredLines, uncoveredLines, repoRoot, relativeFilePath, fileObj);
35
36
  filesProcessed++;
36
37
  coverageObj.coverage.file.push(fileObj);
37
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"convertToGenericCoverageReport.js","sourceRoot":"","sources":["../../src/helpers/convertToGenericCoverageReport.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,qCAAqC;AAErC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,IAAkB,EAClB,YAAoB;IAEpB,MAAM,WAAW,GAAmB,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC;IAChF,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,cAAc,GAAW,CAAC,CAAC;IAE/B,KAAK,MAAM,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC;YAAE,SAAS;QAC7C,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D,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;aAC3C,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;aACpD,GAAG,CAAC,MAAM,CAAC,CAAC;QACf,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;aACzC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;aACpD,GAAG,CAAC,MAAM,CAAC,CAAC;QAEf,MAAM,OAAO,GAAe;YAC1B,OAAO,EAAE,mBAAmB,CAAC,gBAAgB,CAAC;YAC9C,WAAW,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,UAAkB,EAAE,EAAE,CAAC,CAAC;gBACvD,aAAa,EAAE,UAAU;gBACzB,UAAU,EAAE,OAAO;aACpB,CAAC,CAAC;SACJ,CAAC;QAEF,gGAAgG;QAChG,MAAM,eAAe,CAAC,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;QACzF,cAAc,EAAE,CAAC;QACjB,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1C,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IACzE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AAC3C,CAAC"}
@@ -1 +1,4 @@
1
- export declare function findFilePath(fileName: string, dxConfigFile: string): Promise<string | undefined>;
1
+ export declare function findFilePath(fileName: string): Promise<{
2
+ repoRoot: string;
3
+ relativeFilePath: string | undefined;
4
+ }>;
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
  /* eslint-disable no-await-in-loop */
3
3
  import { readdir, stat } from 'node:fs/promises';
4
- import { join } from 'node:path/posix';
4
+ import { join, relative } from 'node:path';
5
5
  import { getPackageDirectories } from './getPackageDirectories.js';
6
- export async function findFilePath(fileName, dxConfigFile) {
7
- const packageDirectories = await getPackageDirectories(dxConfigFile);
8
- let filePath;
6
+ export async function findFilePath(fileName) {
7
+ const { repoRoot, packageDirectories } = await getPackageDirectories();
8
+ let relativeFilePath;
9
9
  for (const directory of packageDirectories) {
10
- filePath = await findFilePathinDirectory(fileName, directory);
11
- if (filePath !== undefined) {
10
+ relativeFilePath = await findFilePathinDirectory(fileName, directory, repoRoot);
11
+ if (relativeFilePath !== undefined) {
12
12
  break;
13
13
  }
14
14
  }
15
- return filePath;
15
+ return { repoRoot, relativeFilePath };
16
16
  }
17
17
  async function searchRecursively(fileName, dxDirectory) {
18
18
  const files = await readdir(dxDirectory);
@@ -31,19 +31,22 @@ async function searchRecursively(fileName, dxDirectory) {
31
31
  }
32
32
  return undefined;
33
33
  }
34
- async function findFilePathinDirectory(fileName, dxDirectory) {
34
+ async function findFilePathinDirectory(fileName, dxDirectory, repoRoot) {
35
35
  const fileExtension = fileName.split('.').slice(1).join('.');
36
36
  let relativeFilePath;
37
37
  if (fileExtension) {
38
38
  // If file extension is defined, search recursively with that extension
39
- relativeFilePath = await searchRecursively(fileName, dxDirectory);
39
+ const absoluteFilePath = await searchRecursively(fileName, dxDirectory);
40
+ if (absoluteFilePath !== undefined)
41
+ relativeFilePath = relative(repoRoot, absoluteFilePath);
40
42
  }
41
43
  else {
42
44
  // If file extension is not defined, test each extension option
43
45
  const fileExts = ['cls', 'trigger'];
44
46
  for (const ext of fileExts) {
45
- relativeFilePath = await searchRecursively(`${fileName}.${ext}`, dxDirectory);
46
- if (relativeFilePath !== undefined) {
47
+ const absoluteFilePath = await searchRecursively(`${fileName}.${ext}`, dxDirectory);
48
+ if (absoluteFilePath !== undefined) {
49
+ relativeFilePath = relative(repoRoot, absoluteFilePath);
47
50
  break;
48
51
  }
49
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"findFilePath.js","sourceRoot":"","sources":["../../src/helpers/findFilePath.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,qCAAqC;AAErC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,QAAgB,EAAE,YAAoB;IACvE,MAAM,kBAAkB,GAAG,MAAM,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAErE,IAAI,QAA4B,CAAC;IACjC,KAAK,MAAM,SAAS,IAAI,kBAAkB,EAAE,CAAC;QAC3C,QAAQ,GAAG,MAAM,uBAAuB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAC9D,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM;QACR,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,KAAK,UAAU,iBAAiB,CAAC,QAAgB,EAAE,WAAmB;IACpE,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACzC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC3D,IAAI,MAAM,EAAE,CAAC;gBACX,OAAO,MAAM,CAAC;YAChB,CAAC;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,gBAAgB,GAAG,MAAM,iBAAiB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QACxE,IAAI,gBAAgB,KAAK,SAAS;YAAE,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IAC9F,CAAC;SAAM,CAAC;QACN,+DAA+D;QAC/D,MAAM,QAAQ,GAAa,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC9C,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,MAAM,gBAAgB,GAAG,MAAM,iBAAiB,CAAC,GAAG,QAAQ,IAAI,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;YACpF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBACnC,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;gBACxD,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
@@ -1 +1,4 @@
1
- export declare function getPackageDirectories(dxConfigFile: string): Promise<string[]>;
1
+ export declare function getPackageDirectories(): Promise<{
2
+ repoRoot: string;
3
+ packageDirectories: string[];
4
+ }>;
@@ -2,13 +2,24 @@
2
2
  /* eslint-disable no-await-in-loop */
3
3
  import { existsSync } from 'node:fs';
4
4
  import { readFile } from 'node:fs/promises';
5
- export async function getPackageDirectories(dxConfigFile) {
6
- if (!existsSync(dxConfigFile)) {
7
- throw Error(`Salesforce DX Config File does not exist in this path: ${dxConfigFile}`);
5
+ import { resolve } from 'node:path';
6
+ import { simpleGit } from 'simple-git';
7
+ export async function getPackageDirectories() {
8
+ const options = {
9
+ baseDir: process.cwd(),
10
+ binary: 'git',
11
+ maxConcurrentProcesses: 6,
12
+ trimmed: true,
13
+ };
14
+ const git = simpleGit(options);
15
+ const repoRoot = (await git.revparse('--show-toplevel')).trim();
16
+ const dxConfigPath = resolve(repoRoot, 'sfdx-project.json');
17
+ if (!existsSync(dxConfigPath)) {
18
+ throw Error(`Salesforce DX Config File does not exist in this path: ${dxConfigPath}`);
8
19
  }
9
- const sfdxProjectRaw = await readFile(dxConfigFile, 'utf-8');
20
+ const sfdxProjectRaw = await readFile(dxConfigPath, 'utf-8');
10
21
  const sfdxProject = JSON.parse(sfdxProjectRaw);
11
- const packageDirectories = sfdxProject.packageDirectories.map((directory) => directory.path);
12
- return packageDirectories;
22
+ const packageDirectories = sfdxProject.packageDirectories.map((directory) => resolve(repoRoot, directory.path));
23
+ return { repoRoot, packageDirectories };
13
24
  }
14
25
  //# sourceMappingURL=getPackageDirectories.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPackageDirectories.js","sourceRoot":"","sources":["../../src/helpers/getPackageDirectories.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,qCAAqC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,YAAoB;IAC9D,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,MAAM,KAAK,CAAC,0DAA0D,YAAY,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,MAAM,cAAc,GAAW,MAAM,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACrE,MAAM,WAAW,GAAgB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAgB,CAAC;IAC3E,MAAM,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC7F,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
1
+ {"version":3,"file":"getPackageDirectories.js","sourceRoot":"","sources":["../../src/helpers/getPackageDirectories.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,qCAAqC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAA+B,MAAM,YAAY,CAAC;AAIpE,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,MAAM,OAAO,GAA8B;QACzC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE;QACtB,MAAM,EAAE,KAAK;QACb,sBAAsB,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI;KACd,CAAC;IACF,MAAM,GAAG,GAAc,SAAS,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,CAAC,MAAM,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAChE,MAAM,YAAY,GAAG,OAAO,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IAC5D,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,MAAM,KAAK,CAAC,0DAA0D,YAAY,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,MAAM,cAAc,GAAW,MAAM,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACrE,MAAM,WAAW,GAAgB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAgB,CAAC;IAC3E,MAAM,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAChH,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function normalizePathToUnix(path: string): string;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+ export function normalizePathToUnix(path) {
3
+ return path.replace(/\\/g, '/');
4
+ }
5
+ //# sourceMappingURL=normalizePathToUnix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizePathToUnix.js","sourceRoot":"","sources":["../../src/helpers/normalizePathToUnix.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  import { FileObject } from './types.js';
2
- export declare function setCoveredLines(coveredLines: number[], uncoveredLines: number[], filePath: string, fileObj: FileObject): Promise<void>;
2
+ export declare function setCoveredLines(coveredLines: number[], uncoveredLines: number[], repoRoot: string, filePath: string, fileObj: FileObject): Promise<void>;
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
+ import { join } from 'node:path';
2
3
  import { getTotalLines } from './getTotalLines.js';
3
- export async function setCoveredLines(coveredLines, uncoveredLines, filePath, fileObj) {
4
+ export async function setCoveredLines(coveredLines, uncoveredLines, repoRoot, filePath, fileObj) {
4
5
  const randomLines = [];
5
- const totalLines = await getTotalLines(filePath);
6
+ const totalLines = await getTotalLines(join(repoRoot, filePath));
6
7
  for (const coveredLine of coveredLines) {
7
8
  if (coveredLine > totalLines) {
8
9
  for (let randomLineNumber = 1; randomLineNumber <= totalLines; randomLineNumber++) {
@@ -1 +1 @@
1
- {"version":3,"file":"setCoveredLines.js","sourceRoot":"","sources":["../../src/helpers/setCoveredLines.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,YAAsB,EACtB,cAAwB,EACxB,QAAgB,EAChB,OAAmB;IAEnB,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjD,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE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IAAI,gBAAgB,GAAG,CAAC,EAAE,gBAAgB,IAAI,UAAU,EAAE,gBAAgB,EAAE,EAAE,CAAC;gBAClF,IACE,CAAC,cAAc,CAAC,QAAQ,CAAC,gBAAgB,CAAC;oBAC1C,CAAC,YAAY,CAAC,QAAQ,CAAC,gBAAgB,CAAC;oBACxC,CAAC,WAAW,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EACvC,CAAC;oBACD,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC;wBACvB,aAAa,EAAE,gBAAgB;wBAC/B,UAAU,EAAE,MAAM;qBACnB,CAAC,CAAC;oBACH,WAAW,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;oBACnC,MAAM;gBACR,CAAC;YACH,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC;gBACvB,aAAa,EAAE,WAAW;gBAC1B,UAAU,EAAE,MAAM;aACnB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -8,11 +8,7 @@ This plugin will convert the code coverage JSON file created by the Salesforce C
8
8
 
9
9
  # examples
10
10
 
11
- - `sf apex-code-coverage transformer transform -j "coverage.json" -x "coverage.xml" -c "sfdx-project.json"`
12
-
13
- # flags.sfdx-configuration.summary
14
-
15
- Path to your project's Salesforce DX configuration file.
11
+ - `sf apex-code-coverage transformer transform -j "coverage.json" -x "coverage.xml"`
16
12
 
17
13
  # flags.coverage-json.summary
18
14
 
package/oclif.lock CHANGED
@@ -1382,6 +1382,18 @@
1382
1382
  "@jridgewell/resolve-uri" "^3.0.3"
1383
1383
  "@jridgewell/sourcemap-codec" "^1.4.10"
1384
1384
 
1385
+ "@kwsites/file-exists@^1.1.1":
1386
+ version "1.1.1"
1387
+ resolved "https://registry.yarnpkg.com/@kwsites/file-exists/-/file-exists-1.1.1.tgz#ad1efcac13e1987d8dbaf235ef3be5b0d96faa99"
1388
+ integrity sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==
1389
+ dependencies:
1390
+ debug "^4.1.1"
1391
+
1392
+ "@kwsites/promise-deferred@^1.1.1":
1393
+ version "1.1.1"
1394
+ resolved "https://registry.yarnpkg.com/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz#8ace5259254426ccef57f3175bc64ed7095ed919"
1395
+ integrity sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==
1396
+
1385
1397
  "@nodelib/fs.scandir@2.1.5":
1386
1398
  version "2.1.5"
1387
1399
  resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz"
@@ -10634,6 +10646,15 @@ sigstore@^2.2.0:
10634
10646
  "@sigstore/tuf" "^2.3.0"
10635
10647
  "@sigstore/verify" "^0.1.0"
10636
10648
 
10649
+ simple-git@^3.24.0:
10650
+ version "3.24.0"
10651
+ resolved "https://registry.yarnpkg.com/simple-git/-/simple-git-3.24.0.tgz#33a8c88dc6fa74e53eaf3d6bfc27d0182a49ec00"
10652
+ integrity sha512-QqAKee9Twv+3k8IFOFfPB2hnk6as6Y6ACUpwCtQvRYBAes23Wv3SZlHVobAzqcE8gfsisCvPw3HGW3HYM+VYYw==
10653
+ dependencies:
10654
+ "@kwsites/file-exists" "^1.1.1"
10655
+ "@kwsites/promise-deferred" "^1.1.1"
10656
+ debug "^4.3.4"
10657
+
10637
10658
  simple-swizzle@^0.2.2:
10638
10659
  version "0.2.2"
10639
10660
  resolved "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz"
@@ -5,7 +5,7 @@
5
5
  "args": {},
6
6
  "description": "This plugin will convert the code coverage JSON file created by the Salesforce CLI during Apex deployments into an XML accepted by tools like SonarQube.",
7
7
  "examples": [
8
- "`sf apex-code-coverage transformer transform -j \"coverage.json\" -x \"coverage.xml\" -c \"sfdx-project.json\"`"
8
+ "`sf apex-code-coverage transformer transform -j \"coverage.json\" -x \"coverage.xml\"`"
9
9
  ],
10
10
  "flags": {
11
11
  "json": {
@@ -15,16 +15,6 @@
15
15
  "allowNo": false,
16
16
  "type": "boolean"
17
17
  },
18
- "sfdx-configuration": {
19
- "char": "c",
20
- "name": "sfdx-configuration",
21
- "required": true,
22
- "summary": "Path to your project's Salesforce DX configuration file.",
23
- "default": "sfdx-project.json",
24
- "hasDynamicHelp": false,
25
- "multiple": false,
26
- "type": "option"
27
- },
28
18
  "coverage-json": {
29
19
  "char": "j",
30
20
  "name": "coverage-json",
@@ -73,5 +63,5 @@
73
63
  ]
74
64
  }
75
65
  },
76
- "version": "1.6.5"
66
+ "version": "1.6.7"
77
67
  }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "apex-code-coverage-transformer",
3
3
  "description": "Transforms the Apex code coverage JSON created during Salesforce deployments into the Generic Test Coverage Format (XML).",
4
- "version": "1.6.5",
4
+ "version": "1.6.7",
5
5
  "dependencies": {
6
6
  "@oclif/core": "^3.18.1",
7
7
  "@salesforce/core": "^6.4.7",
8
8
  "@salesforce/sf-plugins-core": "^7.1.3",
9
+ "simple-git": "^3.24.0",
9
10
  "xmlbuilder2": "^3.1.1"
10
11
  },
11
12
  "devDependencies": {
@@ -49,7 +50,8 @@
49
50
  "json",
50
51
  "sonarqube",
51
52
  "apex",
52
- "coverage"
53
+ "coverage",
54
+ "git"
53
55
  ],
54
56
  "license": "MIT",
55
57
  "oclif": {