@code-pushup/nx-plugin 0.96.1 → 0.98.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/executor.js +3 -2
- package/src/executors/cli/executor.js.map +1 -1
- package/src/executors/internal/config.js +3 -7
- package/src/executors/internal/config.js.map +1 -1
- package/src/index.js +2 -1
- package/src/index.js.map +1 -1
- package/src/plugin/constants.d.ts +1 -0
- package/src/plugin/constants.js +2 -1
- package/src/plugin/constants.js.map +1 -1
- package/src/plugin/plugin.d.ts +3 -0
- package/src/plugin/plugin.js +11 -2
- package/src/plugin/plugin.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.98.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.98.0",
|
|
36
|
+
"@code-pushup/utils": "0.98.0",
|
|
37
37
|
"@nx/devkit": ">=17.0.0",
|
|
38
38
|
"nx": ">=17.0.0"
|
|
39
39
|
},
|
|
@@ -8,7 +8,8 @@ const utils_js_1 = require("./utils.js");
|
|
|
8
8
|
async function runCliExecutor(terminalAndExecutorOptions, context) {
|
|
9
9
|
const { objectToCliArgs, formatCommandStatus, logger, stringifyError } = await Promise.resolve().then(() => require('@code-pushup/utils'));
|
|
10
10
|
const normalizedContext = (0, context_js_1.normalizeContext)(context);
|
|
11
|
-
const { command: cliCommand, verbose = false, dryRun, env: executorEnv, bin,
|
|
11
|
+
const { command: cliCommand, verbose = false, dryRun, env: executorEnv, bin, projectPrefix, // Do not forward to CLI, it is handled plugin logic only
|
|
12
|
+
...restArgs } = (0, utils_js_1.parseCliExecutorOptions)(terminalAndExecutorOptions, normalizedContext);
|
|
12
13
|
// this sets `CP_VERBOSE=true` on process.env
|
|
13
14
|
logger.setVerbose(verbose);
|
|
14
15
|
const command = bin ? `node` : 'npx';
|
|
@@ -30,7 +31,7 @@ async function runCliExecutor(terminalAndExecutorOptions, context) {
|
|
|
30
31
|
}
|
|
31
32
|
else {
|
|
32
33
|
try {
|
|
33
|
-
logger.debug(`Run CLI with env vars: ${loggedEnvVars}`);
|
|
34
|
+
logger.debug(`Run CLI with env vars: ${JSON.stringify(loggedEnvVars)}`);
|
|
34
35
|
await (0, execute_process_js_1.executeProcess)({
|
|
35
36
|
command,
|
|
36
37
|
args,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/executors/cli/executor.ts"],"names":[],"mappings":";;AAaA,
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../src/executors/cli/executor.ts"],"names":[],"mappings":";;AAaA,iCAmEC;AA/ED,0EAAmE;AACnE,uDAA0D;AAE1D,yCAAqD;AAQrD,qDAAqD;AACtC,KAAK,UAAU,cAAc,CAC1C,0BAAqD,EACrD,OAAwB;IAExB,MAAM,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,EAAE,cAAc,EAAE,GACpE,2CAAa,oBAAoB,EAAC,CAAC;IACrC,MAAM,iBAAiB,GAAG,IAAA,6BAAgB,EAAC,OAAO,CAAC,CAAC;IACpD,MAAM,EACJ,OAAO,EAAE,UAAU,EACnB,OAAO,GAAG,KAAK,EACf,MAAM,EACN,GAAG,EAAE,WAAW,EAChB,GAAG,EACH,aAAa,EAAE,yDAAyD;IACxE,GAAG,QAAQ,EACZ,GAAG,IAAA,kCAAuB,EAAC,0BAA0B,EAAE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,OAAO,CAAC,GAAG;4BACd,4EAA4E;4BAC5E,GAAG,WAAW;yBACf;qBACF;oBACH,CAAC,CAAC,EAAE,CAAC;aACR,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;YACpC,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"}
|
|
@@ -29,13 +29,9 @@ function persistConfig(options, context) {
|
|
|
29
29
|
function uploadConfig(options, context) {
|
|
30
30
|
const { workspaceRoot, projectName } = context;
|
|
31
31
|
const { projectPrefix, server, apiKey, organization, project, timeout } = options;
|
|
32
|
-
const applyPrefix = workspaceRoot
|
|
33
|
-
const prefix = projectPrefix ? `${projectPrefix}-` : '';
|
|
34
|
-
const derivedProject = projectName && !project
|
|
35
|
-
? applyPrefix
|
|
36
|
-
? `${prefix}${projectName}`
|
|
37
|
-
: projectName
|
|
38
|
-
: project;
|
|
32
|
+
const applyPrefix = workspaceRoot !== '.';
|
|
33
|
+
const prefix = projectPrefix && applyPrefix ? `${projectPrefix}-` : '';
|
|
34
|
+
const derivedProject = projectName && !project ? `${prefix}${projectName}` : project;
|
|
39
35
|
return {
|
|
40
36
|
...(0, env_js_1.parseEnv)(process.env),
|
|
41
37
|
...Object.fromEntries(Object.entries({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/executors/internal/config.ts"],"names":[],"mappings":";;AAUA,oCAYC;AAED,sCAkBC;AAED,
|
|
1
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OAAO,CAAC;IAE/C,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,GACrE,OAAO,CAAC;IACV,MAAM,WAAW,GAAG,aAAa,KAAK,GAAG,CAAC;IAC1C,MAAM,MAAM,GAAG,aAAa,IAAI,WAAW,CAAC,CAAC,CAAC,GAAG,aAAa,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAEvE,MAAM,cAAc,GAClB,WAAW,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,WAAW,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAEhE,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"}
|
package/src/index.js
CHANGED
|
@@ -15,10 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.createNodesV2 = exports.createNodes = exports.initSchematic = exports.initGenerator = exports.configurationGenerator = exports.generateCodePushupConfig = void 0;
|
|
18
|
+
const constants_js_1 = require("./plugin/constants.js");
|
|
18
19
|
const index_js_1 = require("./plugin/index.js");
|
|
19
20
|
// default export for nx.json#plugins
|
|
20
21
|
const plugin = {
|
|
21
|
-
name:
|
|
22
|
+
name: constants_js_1.PLUGIN_NAME,
|
|
22
23
|
createNodesV2: index_js_1.createNodesV2,
|
|
23
24
|
// Keep for backwards compatibility with Nx < 21
|
|
24
25
|
createNodes: index_js_1.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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wDAAoD;AACpD,gDAA+D;AAE/D,qCAAqC;AACrC,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,0BAAW;IACjB,aAAa,EAAb,wBAAa;IACb,gDAAgD;IAChD,WAAW,EAAX,sBAAW;CACZ,CAAC;AAEF,kBAAe,MAAM,CAAC;AAGtB,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"}
|
package/src/plugin/constants.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CP_TARGET_NAME = void 0;
|
|
3
|
+
exports.PLUGIN_NAME = exports.CP_TARGET_NAME = void 0;
|
|
4
4
|
exports.CP_TARGET_NAME = 'code-pushup';
|
|
5
|
+
exports.PLUGIN_NAME = '@code-pushup/nx-plugin';
|
|
5
6
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plugin/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/plugin/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,aAAa,CAAC;AAC/B,QAAA,WAAW,GAAG,wBAAwB,CAAC"}
|
package/src/plugin/plugin.d.ts
CHANGED
package/src/plugin/plugin.js
CHANGED
|
@@ -2,14 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodesV2 = exports.createNodes = void 0;
|
|
4
4
|
const constants_js_1 = require("../internal/constants.js");
|
|
5
|
+
const constants_js_2 = require("./constants.js");
|
|
5
6
|
const targets_js_1 = require("./target/targets.js");
|
|
6
7
|
const utils_js_1 = require("./utils.js");
|
|
7
8
|
// name has to be "createNodes" to get picked up by Nx <v20
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
8
12
|
exports.createNodes = [
|
|
9
13
|
`**/${constants_js_1.PROJECT_JSON_FILE_NAME}`,
|
|
10
14
|
async (projectConfigurationFile, createNodesOptions, context) => {
|
|
11
15
|
const parsedCreateNodesOptions = createNodesOptions;
|
|
12
|
-
const
|
|
16
|
+
const pluginsConfig = context.nxJsonConfiguration.pluginsConfig?.[constants_js_2.PLUGIN_NAME] ?? {};
|
|
17
|
+
const mergedOptions = { ...pluginsConfig, ...parsedCreateNodesOptions };
|
|
18
|
+
const normalizedContext = await (0, utils_js_1.normalizedCreateNodesContext)(context, projectConfigurationFile, mergedOptions);
|
|
13
19
|
return {
|
|
14
20
|
projects: {
|
|
15
21
|
[normalizedContext.projectRoot]: {
|
|
@@ -23,8 +29,11 @@ exports.createNodesV2 = [
|
|
|
23
29
|
`**/${constants_js_1.PROJECT_JSON_FILE_NAME}`,
|
|
24
30
|
async (projectConfigurationFiles, createNodesOptions, context) => {
|
|
25
31
|
const parsedCreateNodesOptions = createNodesOptions;
|
|
32
|
+
const { pluginsConfig = {} } = context.nxJsonConfiguration;
|
|
33
|
+
const pluginsConfigObj = pluginsConfig[constants_js_2.PLUGIN_NAME] ?? {};
|
|
34
|
+
const mergedOptions = { ...pluginsConfigObj, ...parsedCreateNodesOptions };
|
|
26
35
|
return await Promise.all(projectConfigurationFiles.map(async (projectConfigurationFile) => {
|
|
27
|
-
const normalizedContext = await (0, utils_js_1.normalizedCreateNodesV2Context)(context, projectConfigurationFile,
|
|
36
|
+
const normalizedContext = await (0, utils_js_1.normalizedCreateNodesV2Context)(context, projectConfigurationFile, mergedOptions);
|
|
28
37
|
const result = {
|
|
29
38
|
projects: {
|
|
30
39
|
[normalizedContext.projectRoot]: {
|
package/src/plugin/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/plugin/plugin.ts"],"names":[],"mappings":";;;AAQA,2DAAkE;AAClE,oDAAoD;AAEpD,yCAGoB;AAEpB,2DAA2D;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/plugin/plugin.ts"],"names":[],"mappings":";;;AAQA,2DAAkE;AAClE,iDAA6C;AAC7C,oDAAoD;AAEpD,yCAGoB;AAEpB,2DAA2D;AAC3D;;GAEG;AACU,QAAA,WAAW,GAAgB;IACtC,MAAM,qCAAsB,EAAE;IAC9B,KAAK,EACH,wBAAgC,EAChC,kBAA2B,EAC3B,OAA2B,EACC,EAAE;QAC9B,MAAM,wBAAwB,GAAG,kBAAwC,CAAC;QAC1E,MAAM,aAAa,GACjB,OAAO,CAAC,mBAAmB,CAAC,aAAa,EAAE,CAAC,0BAAW,CAAC,IAAI,EAAE,CAAC;QACjE,MAAM,aAAa,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,wBAAwB,EAAE,CAAC;QAExE,MAAM,iBAAiB,GAAG,MAAM,IAAA,uCAA4B,EAC1D,OAAO,EACP,wBAAwB,EACxB,aAAa,CACd,CAAC;QAEF,OAA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