@canyonjs/cli 1.0.10 → 1.0.12

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,25 +5,16 @@ import node_path from "node:path";
5
5
  import axios from "axios";
6
6
  import { log } from "node:console";
7
7
  var package_namespaceObject = {
8
- rE: "1.0.10"
8
+ rE: "1.0.12"
9
9
  };
10
10
  async function mapCommand(params, options) {
11
- const { dsn, repo_id: repoID, sha: sha, provider, build_target, debug } = params;
11
+ const { dsn, repo_id: repoID, sha: sha, provider, build_target, debug, instrument_cwd } = params;
12
12
  if (!node_fs.existsSync(node_path.resolve(process.cwd(), '.canyon_output'))) return void log('不存在');
13
13
  const files = node_fs.readdirSync(node_path.resolve(process.cwd(), '.canyon_output'));
14
14
  let data = {};
15
15
  for(let i = 0; i < files.length; i++){
16
16
  const fileCoverageString = node_fs.readFileSync(node_path.resolve(process.cwd(), '.canyon_output', files[i]), 'utf-8');
17
17
  const fileCoverage = JSON.parse(fileCoverageString);
18
- if (files[i].includes('-init-')) try {
19
- const pathString = node_fs.readFileSync(node_path.resolve(Object.keys(fileCoverage)[0] + '.map'), 'utf-8');
20
- Object.entries(fileCoverage).forEach((item)=>{
21
- item[1].inputSourceMap = JSON.parse(pathString);
22
- if ('true' === debug) log(`${item[1].path}有inputSourceMap`);
23
- });
24
- } catch (e) {
25
- if ('true' === debug) log(e);
26
- }
27
18
  data = {
28
19
  ...data,
29
20
  ...fileCoverage
@@ -34,7 +25,7 @@ async function mapCommand(params, options) {
34
25
  provider: provider || 'gitlab',
35
26
  repoID: repoID || process.env.CI_PROJECT_ID,
36
27
  sha: sha || process.env.CI_COMMIT_SHA,
37
- instrumentCwd: process.cwd(),
28
+ instrumentCwd: instrument_cwd || process.cwd(),
38
29
  reportID: 'initial_coverage_data',
39
30
  reportProvider: 'ci',
40
31
  buildTarget: build_target || '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canyonjs/cli",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {