@code-pushup/nx-plugin 0.81.0 → 0.83.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 -3
- package/src/executors/cli/README.md +3 -3
- package/src/executors/cli/executor.js +4 -3
- package/src/executors/cli/executor.js.map +1 -1
- package/src/executors/internal/config.d.ts +2 -1
- package/src/executors/internal/config.js +13 -8
- package/src/executors/internal/config.js.map +1 -1
- package/src/plugin/target/executor-target.js +6 -10
- package/src/plugin/target/executor-target.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.83.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Nx plugin to integrate the Code PushUp CLI into your workspace 🛠️",
|
|
6
6
|
"publishConfig": {
|
|
@@ -32,8 +32,8 @@
|
|
|
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.83.0",
|
|
36
|
+
"@code-pushup/utils": "0.83.0",
|
|
37
37
|
"@nx/devkit": ">=17.0.0",
|
|
38
38
|
"ansis": "^3.3.0",
|
|
39
39
|
"nx": ">=17.0.0"
|
|
@@ -7,10 +7,10 @@ For details on the CLI command read the [CLI commands documentation](https://git
|
|
|
7
7
|
|
|
8
8
|
## Usage
|
|
9
9
|
|
|
10
|
-
Configure a target in your project
|
|
10
|
+
Configure a target in your `project.json`.
|
|
11
11
|
|
|
12
12
|
```jsonc
|
|
13
|
-
//
|
|
13
|
+
// {projectRoot}/project.json
|
|
14
14
|
{
|
|
15
15
|
"name": "my-project",
|
|
16
16
|
"targets": {
|
|
@@ -74,4 +74,4 @@ Show what will be executed without actually executing it:
|
|
|
74
74
|
| **dryRun** | `boolean` | To debug the executor, dry run the command without real execution. |
|
|
75
75
|
| **bin** | `string` | Path to Code PushUp CLI |
|
|
76
76
|
|
|
77
|
-
For all other options see the [CLI autorun documentation](../../../../cli/README.md#autorun-command).
|
|
77
|
+
For all other options, see the [CLI autorun documentation](../../../../cli/README.md#autorun-command).
|
|
@@ -10,10 +10,11 @@ async function runAutorunExecutor(terminalAndExecutorOptions, context) {
|
|
|
10
10
|
const normalizedContext = (0, context_js_1.normalizeContext)(context);
|
|
11
11
|
const mergedOptions = (0, utils_js_1.mergeExecutorOptions)(context.target?.options, terminalAndExecutorOptions);
|
|
12
12
|
const cliArgumentObject = (0, utils_js_1.parseAutorunExecutorOptions)(mergedOptions, normalizedContext);
|
|
13
|
-
const { dryRun, verbose, command } = mergedOptions;
|
|
13
|
+
const { dryRun, verbose, command, bin } = mergedOptions;
|
|
14
14
|
const commandString = (0, cli_js_1.createCliCommandString)({
|
|
15
15
|
command,
|
|
16
16
|
args: cliArgumentObject,
|
|
17
|
+
bin,
|
|
17
18
|
});
|
|
18
19
|
if (verbose) {
|
|
19
20
|
devkit_1.logger.info(`Run CLI executor ${command ?? ''}`);
|
|
@@ -25,7 +26,7 @@ async function runAutorunExecutor(terminalAndExecutorOptions, context) {
|
|
|
25
26
|
else {
|
|
26
27
|
try {
|
|
27
28
|
await (0, execute_process_js_1.executeProcess)({
|
|
28
|
-
...(0, cli_js_1.createCliCommandObject)({ command, args: cliArgumentObject }),
|
|
29
|
+
...(0, cli_js_1.createCliCommandObject)({ command, args: cliArgumentObject, bin }),
|
|
29
30
|
...(context.cwd ? { cwd: context.cwd } : {}),
|
|
30
31
|
});
|
|
31
32
|
}
|
|
@@ -34,7 +35,7 @@ async function runAutorunExecutor(terminalAndExecutorOptions, context) {
|
|
|
34
35
|
return {
|
|
35
36
|
success: false,
|
|
36
37
|
command: commandString,
|
|
37
|
-
error: error,
|
|
38
|
+
error: error instanceof Error ? error : new Error(`${error}`),
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/executors/cli/executor.ts"],"names":[],"mappings":";;AAgBA,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/executors/cli/executor.ts"],"names":[],"mappings":";;AAgBA,qCA4CC;AA5DD,uCAA0D;AAC1D,0EAAmE;AACnE,+CAG4B;AAC5B,uDAA0D;AAE1D,yCAA+E;AAQhE,KAAK,UAAU,kBAAkB,CAC9C,0BAAyD,EACzD,OAAwB;IAExB,MAAM,iBAAiB,GAAG,IAAA,6BAAgB,EAAC,OAAO,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,IAAA,+BAAoB,EACxC,OAAO,CAAC,MAAM,EAAE,OAAO,EACvB,0BAA0B,CAC3B,CAAC;IACF,MAAM,iBAAiB,GAAG,IAAA,sCAA2B,EACnD,aAAa,EACb,iBAAiB,CAClB,CAAC;IACF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,aAAa,CAAC;IACxD,MAAM,aAAa,GAAG,IAAA,+BAAsB,EAAC;QAC3C,OAAO;QACP,IAAI,EAAE,iBAAiB;QACvB,GAAG;KACJ,CAAC,CAAC;IACH,IAAI,OAAO,EAAE,CAAC;QACZ,eAAM,CAAC,IAAI,CAAC,oBAAoB,OAAO,IAAI,EAAE,EAAE,CAAC,CAAC;QACjD,eAAM,CAAC,IAAI,CAAC,YAAY,aAAa,EAAE,CAAC,CAAC;IAC3C,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,eAAM,CAAC,IAAI,CAAC,wBAAwB,aAAa,EAAE,CAAC,CAAC;IACvD,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,MAAM,IAAA,mCAAc,EAAC;gBACnB,GAAG,IAAA,+BAAsB,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC;gBACpE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC7C,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,aAAa;gBACtB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC;aAC9D,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,aAAa;KACvB,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PersistConfig, UploadConfig } from '@code-pushup/models';
|
|
2
|
+
import type { NormalizedExecutorContext } from './context.js';
|
|
2
3
|
import type { BaseNormalizedExecutorContext, GlobalExecutorOptions, ProjectExecutorOnlyOptions } from './types.js';
|
|
3
4
|
export declare function globalConfig(options: Partial<GlobalExecutorOptions & Record<string, unknown>>, context: BaseNormalizedExecutorContext): GlobalExecutorOptions;
|
|
4
5
|
export declare function persistConfig(options: Partial<PersistConfig & ProjectExecutorOnlyOptions>, context: BaseNormalizedExecutorContext): Partial<PersistConfig>;
|
|
5
|
-
export declare function uploadConfig(options: Partial<UploadConfig & ProjectExecutorOnlyOptions>, context:
|
|
6
|
+
export declare function uploadConfig(options: Partial<UploadConfig & ProjectExecutorOnlyOptions>, context: NormalizedExecutorContext): Partial<UploadConfig>;
|
|
@@ -28,19 +28,24 @@ function persistConfig(options, context) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function uploadConfig(options, context) {
|
|
31
|
-
const {
|
|
32
|
-
const { name: projectName } = projectConfig ?? {};
|
|
31
|
+
const { workspaceRoot, projectName } = context;
|
|
33
32
|
const { projectPrefix, server, apiKey, organization, project, timeout } = options;
|
|
34
33
|
const applyPrefix = workspaceRoot === '.';
|
|
35
34
|
const prefix = projectPrefix ? `${projectPrefix}-` : '';
|
|
35
|
+
const derivedProject = projectName && !project
|
|
36
|
+
? applyPrefix
|
|
37
|
+
? `${prefix}${projectName}`
|
|
38
|
+
: projectName
|
|
39
|
+
: project;
|
|
36
40
|
return {
|
|
37
|
-
...(projectName
|
|
38
|
-
? {
|
|
39
|
-
project: applyPrefix ? `${prefix}${projectName}` : projectName,
|
|
40
|
-
}
|
|
41
|
-
: {}),
|
|
42
41
|
...(0, env_js_1.parseEnv)(process.env),
|
|
43
|
-
...Object.fromEntries(Object.entries({
|
|
42
|
+
...Object.fromEntries(Object.entries({
|
|
43
|
+
server,
|
|
44
|
+
apiKey,
|
|
45
|
+
organization,
|
|
46
|
+
...(derivedProject ? { project: derivedProject } : {}),
|
|
47
|
+
timeout,
|
|
48
|
+
}).filter(([_, v]) => v !== undefined)),
|
|
44
49
|
};
|
|
45
50
|
}
|
|
46
51
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/executors/internal/config.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/executors/internal/config.ts"],"names":[],"mappings":";;AAUA,oCAaC;AAED,sCAkBC;AAED,oCA8BC;AA3ED,kCAAkC;AAGlC,qCAAoC;AAOpC,SAAgB,YAAY,CAC1B,OAAiE,EACjE,OAAsC;IAEtC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,aAAa,IAAI,EAAE,CAAC;IACvD,gEAAgE;IAChE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE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AAC,GAAG,MAAM,GAAG,WAAW,EAAE;YAC3B,CAAC,CAAC,WAAW;QACf,CAAC,CAAC,OAAO,CAAC;IAEd,OAAO;QACL,GAAG,IAAA,iBAAQ,EAAC,OAAO,CAAC,GAAG,CAAC;QACxB,GAAG,MAAM,CAAC,WAAW,CACnB,MAAM,CAAC,OAAO,CAAC;YACb,MAAM;YACN,MAAM;YACN,YAAY;YACZ,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtD,OAAO;SACR,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CACvC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -3,16 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createExecutorTarget = createExecutorTarget;
|
|
4
4
|
const constants_js_1 = require("../../internal/constants.js");
|
|
5
5
|
function createExecutorTarget(options) {
|
|
6
|
-
const { bin
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
...(
|
|
10
|
-
|
|
11
|
-
options: {
|
|
12
|
-
projectPrefix,
|
|
13
|
-
},
|
|
14
|
-
}
|
|
15
|
-
: {}),
|
|
6
|
+
const { bin, projectPrefix } = options ?? {};
|
|
7
|
+
const executor = `${constants_js_1.PACKAGE_NAME}:cli`;
|
|
8
|
+
const executorOptions = (bin || projectPrefix) && {
|
|
9
|
+
...(bin && { bin }),
|
|
10
|
+
...(projectPrefix && { projectPrefix }),
|
|
16
11
|
};
|
|
12
|
+
return { executor, ...(executorOptions && { options: executorOptions }) };
|
|
17
13
|
}
|
|
18
14
|
//# sourceMappingURL=executor-target.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor-target.js","sourceRoot":"","sources":["../../../../src/plugin/target/executor-target.ts"],"names":[],"mappings":";;AAIA,
|
|
1
|
+
{"version":3,"file":"executor-target.js","sourceRoot":"","sources":["../../../../src/plugin/target/executor-target.ts"],"names":[],"mappings":";;AAIA,oDAYC;AAfD,8DAA2D;AAG3D,SAAgB,oBAAoB,CAAC,OAGpC;IACC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAE7C,MAAM,QAAQ,GAAG,GAAG,2BAAY,MAAM,CAAC;IACvC,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,aAAa,CAAC,IAAI;QAChD,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC;QACnB,GAAG,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,CAAC;KACxC,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,eAAe,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;AAC5E,CAAC"}
|