@code-pushup/nx-plugin 0.57.0 → 0.58.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/README.md +1 -1
- package/package.json +3 -3
- package/src/executors/cli/README.md +1 -1
- package/src/executors/cli/executor.js +3 -2
- package/src/executors/cli/executor.js.map +1 -1
- package/src/executors/cli/utils.d.ts +13 -0
- package/src/executors/cli/utils.js +35 -0
- package/src/executors/cli/utils.js.map +1 -1
- package/src/index.d.ts +1 -0
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-pushup/nx-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.58.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.58.0",
|
|
36
|
+
"@code-pushup/utils": "0.58.0",
|
|
37
37
|
"@nx/devkit": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
38
38
|
"nx": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
39
39
|
"zod": "^3.22.4"
|
|
@@ -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](
|
|
77
|
+
For all other options see the [CLI autorun documentation](../../../../cli/README.md#autorun-command).
|
|
@@ -8,8 +8,9 @@ const context_js_1 = require("../internal/context.js");
|
|
|
8
8
|
const utils_js_1 = require("./utils.js");
|
|
9
9
|
function runAutorunExecutor(terminalAndExecutorOptions, context) {
|
|
10
10
|
const normalizedContext = (0, context_js_1.normalizeContext)(context);
|
|
11
|
-
const
|
|
12
|
-
const
|
|
11
|
+
const mergedOptions = (0, utils_js_1.mergeExecutorOptions)(context.target?.options, terminalAndExecutorOptions);
|
|
12
|
+
const cliArgumentObject = (0, utils_js_1.parseAutorunExecutorOptions)(mergedOptions, normalizedContext);
|
|
13
|
+
const { dryRun, verbose, command } = mergedOptions;
|
|
13
14
|
const commandString = (0, cli_js_1.createCliCommand)({ command, args: cliArgumentObject });
|
|
14
15
|
const commandStringOptions = context.cwd ? { cwd: context.cwd } : {};
|
|
15
16
|
if (verbose) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/cli/executor.ts"],"names":[],"mappings":";;AAaA,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/cli/executor.ts"],"names":[],"mappings":";;AAaA,qCA0CC;AAvDD,uCAA0D;AAC1D,2DAA8C;AAC9C,+CAAsD;AACtD,uDAA0D;AAE1D,yCAA+E;AAQ/E,SAAwB,kBAAkB,CACxC,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,aAAa,CAAC;IAEnD,MAAM,aAAa,GAAG,IAAA,yBAAgB,EAAC,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;IAC7E,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACrE,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,0EAA0E;YAC1E,qCAAqC;YACrC,IAAA,6BAAQ,EAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;QAChD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACpB,OAAO,OAAO,CAAC,OAAO,CAAC;gBACrB,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,aAAa;gBACtB,KAAK,EAAE,KAAc;aACtB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC;QACrB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,aAAa;KACvB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -2,3 +2,16 @@ import type { NormalizedExecutorContext } from '../internal/context.js';
|
|
|
2
2
|
import type { AutorunCommandExecutorOnlyOptions, AutorunCommandExecutorOptions } from './schema.js';
|
|
3
3
|
export declare function parseAutorunExecutorOnlyOptions(options: Partial<AutorunCommandExecutorOnlyOptions>): AutorunCommandExecutorOnlyOptions;
|
|
4
4
|
export declare function parseAutorunExecutorOptions(options: Partial<AutorunCommandExecutorOptions>, normalizedContext: NormalizedExecutorContext): AutorunCommandExecutorOptions;
|
|
5
|
+
/**
|
|
6
|
+
* Deeply merges executor options.
|
|
7
|
+
*
|
|
8
|
+
* @param targetOptions - The original options from the target configuration.
|
|
9
|
+
* @param cliOptions - The options from Nx, combining target options and CLI arguments.
|
|
10
|
+
* @returns A new object with deeply merged properties.
|
|
11
|
+
*
|
|
12
|
+
* Nx performs a shallow merge by default, where command-line arguments can override entire objects
|
|
13
|
+
* (e.g., `--persist.filename` replaces the entire `persist` object).
|
|
14
|
+
* This function ensures that nested properties are deeply merged,
|
|
15
|
+
* preserving the original target options where CLI arguments are not provided.
|
|
16
|
+
*/
|
|
17
|
+
export declare function mergeExecutorOptions(targetOptions: Partial<AutorunCommandExecutorOptions>, cliOptions: Partial<AutorunCommandExecutorOptions>): AutorunCommandExecutorOptions;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseAutorunExecutorOnlyOptions = parseAutorunExecutorOnlyOptions;
|
|
4
4
|
exports.parseAutorunExecutorOptions = parseAutorunExecutorOptions;
|
|
5
|
+
exports.mergeExecutorOptions = mergeExecutorOptions;
|
|
5
6
|
const config_js_1 = require("../internal/config.js");
|
|
6
7
|
function parseAutorunExecutorOnlyOptions(options) {
|
|
7
8
|
const { projectPrefix, dryRun, onlyPlugins } = options;
|
|
@@ -26,4 +27,38 @@ function parseAutorunExecutorOptions(options, normalizedContext) {
|
|
|
26
27
|
: undefined,
|
|
27
28
|
};
|
|
28
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Deeply merges executor options.
|
|
32
|
+
*
|
|
33
|
+
* @param targetOptions - The original options from the target configuration.
|
|
34
|
+
* @param cliOptions - The options from Nx, combining target options and CLI arguments.
|
|
35
|
+
* @returns A new object with deeply merged properties.
|
|
36
|
+
*
|
|
37
|
+
* Nx performs a shallow merge by default, where command-line arguments can override entire objects
|
|
38
|
+
* (e.g., `--persist.filename` replaces the entire `persist` object).
|
|
39
|
+
* This function ensures that nested properties are deeply merged,
|
|
40
|
+
* preserving the original target options where CLI arguments are not provided.
|
|
41
|
+
*/
|
|
42
|
+
function mergeExecutorOptions(targetOptions, cliOptions) {
|
|
43
|
+
return {
|
|
44
|
+
...targetOptions,
|
|
45
|
+
...cliOptions,
|
|
46
|
+
...(targetOptions?.persist || cliOptions?.persist
|
|
47
|
+
? {
|
|
48
|
+
persist: {
|
|
49
|
+
...targetOptions?.persist,
|
|
50
|
+
...cliOptions?.persist,
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
: {}),
|
|
54
|
+
...(targetOptions?.upload || cliOptions?.upload
|
|
55
|
+
? {
|
|
56
|
+
upload: {
|
|
57
|
+
...targetOptions?.upload,
|
|
58
|
+
...cliOptions?.upload,
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
: {}),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
29
64
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/cli/utils.ts"],"names":[],"mappings":";;AAWA,0EASC;AAED,kEAkBC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/cli/utils.ts"],"names":[],"mappings":";;AAWA,0EASC;AAED,kEAkBC;AAcD,oDAwBC;AA9ED,qDAI+B;AAO/B,SAAgB,+BAA+B,CAC7C,OAAmD;IAEnD,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IACvD,OAAO;QACL,GAAG,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,CAAC;QACvC,GAAG,CAAC,MAAM,IAAI,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC;QACjC,GAAG,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,CAAC;KACpC,CAAC;AACJ,CAAC;AAED,SAAgB,2BAA2B,CACzC,OAA+C,EAC/C,iBAA4C;IAE5C,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5D,MAAM,iBAAiB,GACrB,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,CAAC;IACzE,OAAO;QACL,GAAG,+BAA+B,CAAC,OAAO,CAAC;QAC3C,GAAG,IAAA,wBAAY,EAAC,OAAO,EAAE,iBAAiB,CAAC;QAC3C,OAAO,EAAE,IAAA,yBAAa,EAAC,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,EAAE,iBAAiB,CAAC;QACxE,mGAAmG;QACnG,qDAAqD;QACrD,6CAA6C;QAC7C,MAAM,EAAE,iBAAiB;YACvB,CAAC,CAAC,IAAA,wBAAY,EAAC,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,EAAE,iBAAiB,CAAC;YAC/D,CAAC,CAAC,SAAS;KACd,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAgB,oBAAoB,CAClC,aAAqD,EACrD,UAAkD;IAElD,OAAO;QACL,GAAG,aAAa;QAChB,GAAG,UAAU;QACb,GAAG,CAAC,aAAa,EAAE,OAAO,IAAI,UAAU,EAAE,OAAO;YAC/C,CAAC,CAAC;gBACE,OAAO,EAAE;oBACP,GAAG,aAAa,EAAE,OAAO;oBACzB,GAAG,UAAU,EAAE,OAAO;iBACvB;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,aAAa,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM;YAC7C,CAAC,CAAC;gBACE,MAAM,EAAE;oBACN,GAAG,aAAa,EAAE,MAAM;oBACxB,GAAG,UAAU,EAAE,MAAM;iBACtB;aACF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
|
package/src/index.d.ts
CHANGED
|
@@ -9,3 +9,4 @@ export { generateCodePushupConfig } from './generators/configuration/code-pushup
|
|
|
9
9
|
export { createNodes } from './plugin/index.js';
|
|
10
10
|
export { executeProcess, type ProcessConfig, } from './internal/execute-process.js';
|
|
11
11
|
export { objectToCliArgs } from './executors/internal/cli.js';
|
|
12
|
+
export type { AutorunCommandExecutorOptions } from './executors/cli/schema.js';
|