@code-pushup/nx-plugin 0.83.0 → 0.85.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/package.json +3 -4
- package/src/executors/internal/cli.d.ts +1 -2
- package/src/executors/internal/cli.js +0 -9
- package/src/executors/internal/cli.js.map +1 -1
- package/src/index.d.ts +0 -1
- package/src/index.js +1 -3
- package/src/index.js.map +1 -1
- package/src/internal/execute-process.d.ts +3 -120
- package/src/internal/execute-process.js +5 -100
- package/src/internal/execute-process.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-pushup/nx-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Nx plugin to integrate the Code PushUp CLI into your workspace 🛠️",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,10 +32,9 @@
|
|
|
32
32
|
"generators": "./generators.json",
|
|
33
33
|
"executors": "./executors.json",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@code-pushup/models": "0.
|
|
36
|
-
"@code-pushup/utils": "0.
|
|
35
|
+
"@code-pushup/models": "0.85.0",
|
|
36
|
+
"@code-pushup/utils": "0.85.0",
|
|
37
37
|
"@nx/devkit": ">=17.0.0",
|
|
38
|
-
"ansis": "^3.3.0",
|
|
39
38
|
"nx": ">=17.0.0"
|
|
40
39
|
},
|
|
41
40
|
"files": [
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ProcessConfig } from '../../internal/execute-process.js';
|
|
2
1
|
export declare function createCliCommandString(options?: {
|
|
3
2
|
args?: Record<string, unknown>;
|
|
4
3
|
command?: string;
|
|
@@ -8,7 +7,7 @@ export declare function createCliCommandObject(options?: {
|
|
|
8
7
|
args?: Record<string, unknown>;
|
|
9
8
|
command?: string;
|
|
10
9
|
bin?: string;
|
|
11
|
-
}): ProcessConfig;
|
|
10
|
+
}): import('@code-pushup/utils').ProcessConfig;
|
|
12
11
|
type ArgumentValue = number | string | boolean | string[];
|
|
13
12
|
export type CliArgsObject<T extends object = Record<string, ArgumentValue>> = T extends never ? Record<string, ArgumentValue | undefined> | {
|
|
14
13
|
_: string;
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createCliCommandString = createCliCommandString;
|
|
4
4
|
exports.createCliCommandObject = createCliCommandObject;
|
|
5
5
|
exports.objectToCliArgs = objectToCliArgs;
|
|
6
|
-
const devkit_1 = require("@nx/devkit");
|
|
7
6
|
function createCliCommandString(options) {
|
|
8
7
|
const { bin = '@code-pushup/cli', command, args } = options ?? {};
|
|
9
8
|
return `npx ${bin} ${objectToCliArgs({ _: command ?? [], ...args }).join(' ')}`;
|
|
@@ -13,14 +12,6 @@ function createCliCommandObject(options) {
|
|
|
13
12
|
return {
|
|
14
13
|
command: 'npx',
|
|
15
14
|
args: [bin, ...objectToCliArgs({ _: command ?? [], ...args })],
|
|
16
|
-
observer: {
|
|
17
|
-
onError: error => {
|
|
18
|
-
devkit_1.logger.error(error.message);
|
|
19
|
-
},
|
|
20
|
-
onStdout: data => {
|
|
21
|
-
devkit_1.logger.log(data);
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
15
|
};
|
|
25
16
|
}
|
|
26
17
|
// @TODO import from @code-pushup/utils => get rid of poppins for cjs support
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../src/executors/internal/cli.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../src/executors/internal/cli.ts"],"names":[],"mappings":";;AAEA,wDASC;AAED,wDAUC;AASD,0CA8CC;AA5ED,SAAgB,sBAAsB,CAAC,OAItC;IACC,MAAM,EAAE,GAAG,GAAG,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAClE,OAAO,OAAO,GAAG,IAAI,eAAe,CAAC,EAAE,CAAC,EAAE,OAAO,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,CACtE,GAAG,CACJ,EAAE,CAAC;AACN,CAAC;AAED,SAAgB,sBAAsB,CAAC,OAItC;IACC,MAAM,EAAE,GAAG,GAAG,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAClE,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,eAAe,CAAC,EAAE,CAAC,EAAE,OAAO,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;KAC/D,CAAC;AACJ,CAAC;AAQD,6EAA6E;AAC7E,SAAgB,eAAe,CAE7B,MAAyB;IACzB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACrD,sBAAsB;QACtB,IAAI,GAAG,KAAK,GAAG,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,MAAM,CACzD,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,CACf,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;QAC7C,8BAA8B;QAC9B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,CAAC,OAAO;YAC7D,4DAA4D;YAC5D,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CACpD,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,MAAM,GAAG,GAAG,KAAK,KAAK,GAAG,CAAC,CAAC;QACxC,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,GAAG,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;QACtC,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,KAAK,YAAY,GAAG,EAAE,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/src/index.d.ts
CHANGED
|
@@ -11,6 +11,5 @@ export { configurationGenerator } from './generators/configuration/generator.js'
|
|
|
11
11
|
export type { ConfigurationGeneratorOptions } from './generators/configuration/schema.js';
|
|
12
12
|
export { initGenerator, initSchematic } from './generators/init/generator.js';
|
|
13
13
|
export { type InitGeneratorSchema } from './generators/init/schema.js';
|
|
14
|
-
export { executeProcess, type ProcessConfig, } from './internal/execute-process.js';
|
|
15
14
|
export * from './internal/versions.js';
|
|
16
15
|
export { createNodes, createNodesV2 } from './plugin/index.js';
|
package/src/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createNodesV2 = exports.createNodes = exports.
|
|
17
|
+
exports.createNodesV2 = exports.createNodes = exports.initSchematic = exports.initGenerator = exports.configurationGenerator = exports.generateCodePushupConfig = exports.objectToCliArgs = void 0;
|
|
18
18
|
const index_js_1 = require("./plugin/index.js");
|
|
19
19
|
// default export for nx.json#plugins
|
|
20
20
|
const plugin = {
|
|
@@ -33,8 +33,6 @@ Object.defineProperty(exports, "configurationGenerator", { enumerable: true, get
|
|
|
33
33
|
var generator_js_2 = require("./generators/init/generator.js");
|
|
34
34
|
Object.defineProperty(exports, "initGenerator", { enumerable: true, get: function () { return generator_js_2.initGenerator; } });
|
|
35
35
|
Object.defineProperty(exports, "initSchematic", { enumerable: true, get: function () { return generator_js_2.initSchematic; } });
|
|
36
|
-
var execute_process_js_1 = require("./internal/execute-process.js");
|
|
37
|
-
Object.defineProperty(exports, "executeProcess", { enumerable: true, get: function () { return execute_process_js_1.executeProcess; } });
|
|
38
36
|
__exportStar(require("./internal/versions.js"), exports);
|
|
39
37
|
var index_js_2 = require("./plugin/index.js");
|
|
40
38
|
Object.defineProperty(exports, "createNodes", { enumerable: true, get: function () { return index_js_2.createNodes; } });
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAA+D;AAE/D,qCAAqC;AACrC,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,wBAAwB;IAC9B,aAAa,EAAb,wBAAa;IACb,gDAAgD;IAChD,WAAW,EAAX,sBAAW;CACZ,CAAC;AAEF,kBAAe,MAAM,CAAC;AAGtB,sDAA8D;AAArD,yGAAA,eAAe,OAAA;AACxB,0FAA4F;AAAnF,iIAAA,wBAAwB,OAAA;AACjC,wEAAiF;AAAxE,sHAAA,sBAAsB,OAAA;AAE/B,+DAA8E;AAArE,6GAAA,aAAa,OAAA;AAAE,6GAAA,aAAa,OAAA;AAErC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAA+D;AAE/D,qCAAqC;AACrC,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,wBAAwB;IAC9B,aAAa,EAAb,wBAAa;IACb,gDAAgD;IAChD,WAAW,EAAX,sBAAW;CACZ,CAAC;AAEF,kBAAe,MAAM,CAAC;AAGtB,sDAA8D;AAArD,yGAAA,eAAe,OAAA;AACxB,0FAA4F;AAAnF,iIAAA,wBAAwB,OAAA;AACjC,wEAAiF;AAAxE,sHAAA,sBAAsB,OAAA;AAE/B,+DAA8E;AAArE,6GAAA,aAAa,OAAA;AAAE,6GAAA,aAAa,OAAA;AAErC,yDAAuC;AACvC,8CAA+D;AAAtD,uGAAA,WAAW,OAAA;AAAE,yGAAA,aAAa,OAAA"}
|
|
@@ -1,123 +1,6 @@
|
|
|
1
|
-
export declare function calcDuration(start: number, stop?: number): number;
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
* @category Types
|
|
5
|
-
* @public
|
|
6
|
-
* @property {string} stdout - The stdout of the process.
|
|
7
|
-
* @property {string} stderr - The stderr of the process.
|
|
8
|
-
* @property {number | null} code - The exit code of the process.
|
|
9
|
-
*/
|
|
10
|
-
export type ProcessResult = {
|
|
11
|
-
stdout: string;
|
|
12
|
-
stderr: string;
|
|
13
|
-
code: number | null;
|
|
14
|
-
date: string;
|
|
15
|
-
duration: number;
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Error class for process errors.
|
|
19
|
-
* Contains additional information about the process result.
|
|
20
|
-
* @category Error
|
|
21
|
-
* @public
|
|
22
|
-
* @class
|
|
23
|
-
* @extends Error
|
|
24
|
-
* @example
|
|
25
|
-
* const result = await executeProcess({})
|
|
26
|
-
* .catch((error) => {
|
|
27
|
-
* if (error instanceof ProcessError) {
|
|
28
|
-
* console.error(error.code);
|
|
29
|
-
* console.error(error.stderr);
|
|
30
|
-
* console.error(error.stdout);
|
|
31
|
-
* }
|
|
32
|
-
* });
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
export declare class ProcessError extends Error {
|
|
36
|
-
code: number | null;
|
|
37
|
-
stderr: string;
|
|
38
|
-
stdout: string;
|
|
39
|
-
constructor(result: ProcessResult);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Process config object. Contains the command, args and observer.
|
|
43
|
-
* @param cfg - process config object with command, args and observer (optional)
|
|
44
|
-
* @category Types
|
|
45
|
-
* @public
|
|
46
|
-
* @property {string} command - The command to execute.
|
|
47
|
-
* @property {string[]} args - The arguments for the command.
|
|
48
|
-
* @property {ProcessObserver} observer - The observer for the process.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
*
|
|
52
|
-
* // bash command
|
|
53
|
-
* const cfg = {
|
|
54
|
-
* command: 'bash',
|
|
55
|
-
* args: ['-c', 'echo "hello world"']
|
|
56
|
-
* };
|
|
57
|
-
*
|
|
58
|
-
* // node command
|
|
59
|
-
* const cfg = {
|
|
60
|
-
* command: 'node',
|
|
61
|
-
* args: ['--version']
|
|
62
|
-
* };
|
|
63
|
-
*
|
|
64
|
-
* // npx command
|
|
65
|
-
* const cfg = {
|
|
66
|
-
* command: 'npx',
|
|
67
|
-
* args: ['--version']
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
export type ProcessConfig = {
|
|
71
|
-
command: string;
|
|
72
|
-
args?: string[];
|
|
73
|
-
cwd?: string;
|
|
74
|
-
observer?: ProcessObserver;
|
|
75
|
-
ignoreExitCode?: boolean;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Process observer object. Contains the onStdout, error and complete function.
|
|
79
|
-
* @category Types
|
|
80
|
-
* @public
|
|
81
|
-
* @property {function} onStdout - The onStdout function of the observer (optional).
|
|
82
|
-
* @property {function} onError - The error function of the observer (optional).
|
|
83
|
-
* @property {function} onComplete - The complete function of the observer (optional).
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* const observer = {
|
|
87
|
-
* onStdout: (stdout) => console.info(stdout)
|
|
88
|
-
* }
|
|
89
|
-
*/
|
|
90
|
-
export type ProcessObserver = {
|
|
91
|
-
onStdout?: (stdout: string) => void;
|
|
92
|
-
onError?: (error: ProcessError) => void;
|
|
93
|
-
onComplete?: () => void;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Executes a process and returns a promise with the result as `ProcessResult`.
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
*
|
|
100
|
-
* // sync process execution
|
|
101
|
-
* const result = await executeProcess({
|
|
102
|
-
* command: 'node',
|
|
103
|
-
* args: ['--version']
|
|
104
|
-
* });
|
|
105
|
-
*
|
|
106
|
-
* console.info(result);
|
|
107
|
-
*
|
|
108
|
-
* // async process execution
|
|
109
|
-
* const result = await executeProcess({
|
|
110
|
-
* command: 'node',
|
|
111
|
-
* args: ['download-data'],
|
|
112
|
-
* observer: {
|
|
113
|
-
* onStdout: updateProgress,
|
|
114
|
-
* error: handleError,
|
|
115
|
-
* complete: cleanLogs,
|
|
116
|
-
* }
|
|
117
|
-
* });
|
|
118
|
-
*
|
|
119
|
-
* console.info(result);
|
|
2
|
+
* Dynamically imports and executes function from utils.
|
|
120
3
|
*
|
|
121
|
-
*
|
|
4
|
+
* This is a workaround for Nx only supporting plugins in CommonJS format.
|
|
122
5
|
*/
|
|
123
|
-
export declare function executeProcess(cfg: ProcessConfig): Promise<ProcessResult>;
|
|
6
|
+
export declare function executeProcess(cfg: import('@code-pushup/utils').ProcessConfig): Promise<import('@code-pushup/utils').ProcessResult>;
|
|
@@ -1,108 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProcessError = void 0;
|
|
4
|
-
exports.calcDuration = calcDuration;
|
|
5
3
|
exports.executeProcess = executeProcess;
|
|
6
|
-
const ansis_1 = require("ansis");
|
|
7
|
-
const node_child_process_1 = require("node:child_process");
|
|
8
|
-
const utils_1 = require("@code-pushup/utils");
|
|
9
|
-
function calcDuration(start, stop) {
|
|
10
|
-
return Math.round((stop ?? performance.now()) - start);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Error class for process errors.
|
|
14
|
-
* Contains additional information about the process result.
|
|
15
|
-
* @category Error
|
|
16
|
-
* @public
|
|
17
|
-
* @class
|
|
18
|
-
* @extends Error
|
|
19
|
-
* @example
|
|
20
|
-
* const result = await executeProcess({})
|
|
21
|
-
* .catch((error) => {
|
|
22
|
-
* if (error instanceof ProcessError) {
|
|
23
|
-
* console.error(error.code);
|
|
24
|
-
* console.error(error.stderr);
|
|
25
|
-
* console.error(error.stdout);
|
|
26
|
-
* }
|
|
27
|
-
* });
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
class ProcessError extends Error {
|
|
31
|
-
code;
|
|
32
|
-
stderr;
|
|
33
|
-
stdout;
|
|
34
|
-
constructor(result) {
|
|
35
|
-
super(result.stderr);
|
|
36
|
-
this.code = result.code;
|
|
37
|
-
this.stderr = result.stderr;
|
|
38
|
-
this.stdout = result.stdout;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.ProcessError = ProcessError;
|
|
42
4
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
*
|
|
47
|
-
* // sync process execution
|
|
48
|
-
* const result = await executeProcess({
|
|
49
|
-
* command: 'node',
|
|
50
|
-
* args: ['--version']
|
|
51
|
-
* });
|
|
52
|
-
*
|
|
53
|
-
* console.info(result);
|
|
54
|
-
*
|
|
55
|
-
* // async process execution
|
|
56
|
-
* const result = await executeProcess({
|
|
57
|
-
* command: 'node',
|
|
58
|
-
* args: ['download-data'],
|
|
59
|
-
* observer: {
|
|
60
|
-
* onStdout: updateProgress,
|
|
61
|
-
* error: handleError,
|
|
62
|
-
* complete: cleanLogs,
|
|
63
|
-
* }
|
|
64
|
-
* });
|
|
65
|
-
*
|
|
66
|
-
* console.info(result);
|
|
5
|
+
* Dynamically imports and executes function from utils.
|
|
67
6
|
*
|
|
68
|
-
*
|
|
7
|
+
* This is a workaround for Nx only supporting plugins in CommonJS format.
|
|
69
8
|
*/
|
|
70
|
-
function executeProcess(cfg) {
|
|
71
|
-
const {
|
|
72
|
-
|
|
73
|
-
const date = new Date().toISOString();
|
|
74
|
-
const start = performance.now();
|
|
75
|
-
const logCommand = [command, ...(args || [])].join(' ');
|
|
76
|
-
(0, utils_1.ui)().logger.log((0, ansis_1.gray)(`Executing command:\n${logCommand}\nIn working directory:\n${cfg.cwd ?? process.cwd()}`));
|
|
77
|
-
return new Promise((resolve, reject) => {
|
|
78
|
-
// shell:true tells Windows to use shell command for spawning a child process
|
|
79
|
-
const process = (0, node_child_process_1.spawn)(command, args, { cwd, shell: true });
|
|
80
|
-
// eslint-disable-next-line functional/no-let
|
|
81
|
-
let stdout = '';
|
|
82
|
-
// eslint-disable-next-line functional/no-let
|
|
83
|
-
let stderr = '';
|
|
84
|
-
process.stdout.on('data', data => {
|
|
85
|
-
stdout += String(data);
|
|
86
|
-
onStdout?.(String(data));
|
|
87
|
-
});
|
|
88
|
-
process.stderr.on('data', data => {
|
|
89
|
-
stderr += String(data);
|
|
90
|
-
});
|
|
91
|
-
process.on('error', err => {
|
|
92
|
-
stderr += err.toString();
|
|
93
|
-
});
|
|
94
|
-
process.on('close', code => {
|
|
95
|
-
const timings = { date, duration: calcDuration(start) };
|
|
96
|
-
if (code === 0 || ignoreExitCode) {
|
|
97
|
-
onComplete?.();
|
|
98
|
-
resolve({ code, stdout, stderr, ...timings });
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
const errorMsg = new ProcessError({ code, stdout, stderr, ...timings });
|
|
102
|
-
onError?.(errorMsg);
|
|
103
|
-
reject(errorMsg);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
});
|
|
9
|
+
async function executeProcess(cfg) {
|
|
10
|
+
const { executeProcess } = await Promise.resolve().then(() => require('@code-pushup/utils'));
|
|
11
|
+
return executeProcess(cfg);
|
|
107
12
|
}
|
|
108
13
|
//# sourceMappingURL=execute-process.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-process.js","sourceRoot":"","sources":["../../../src/internal/execute-process.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execute-process.js","sourceRoot":"","sources":["../../../src/internal/execute-process.ts"],"names":[],"mappings":";;AAKA,wCAKC;AAVD;;;;GAIG;AACI,KAAK,UAAU,cAAc,CAClC,GAA+C;IAE/C,MAAM,EAAE,cAAc,EAAE,GAAG,2CAAa,oBAAoB,EAAC,CAAC;IAC9D,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC"}
|