@code-pushup/nx-plugin 0.65.0 → 0.65.2
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/utils.js +3 -3
- package/src/executors/cli/utils.js.map +1 -1
- package/src/index.d.ts +8 -8
- package/src/index.js +11 -11
- package/src/index.js.map +1 -1
- package/src/internal/constants.d.ts +2 -1
- package/src/internal/constants.js +3 -3
- package/src/internal/constants.js.map +1 -1
- package/src/internal/execute-process.d.ts +1 -1
- package/src/internal/execute-process.js +1 -1
- package/src/internal/versions.js +4 -0
- package/src/internal/versions.js.map +1 -1
- package/src/plugin/plugin.js +1 -1
- package/src/plugin/plugin.js.map +1 -1
- package/src/plugin/target/targets.d.ts +7 -2
- package/src/plugin/target/targets.js.map +1 -1
- package/src/plugin/types.d.ts +4 -6
- package/src/plugin/utils.d.ts +3 -2
- package/src/plugin/utils.js +17 -0
- package/src/plugin/utils.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-pushup/nx-plugin",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.2",
|
|
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.65.
|
|
36
|
-
"@code-pushup/utils": "0.65.
|
|
35
|
+
"@code-pushup/models": "0.65.2",
|
|
36
|
+
"@code-pushup/utils": "0.65.2",
|
|
37
37
|
"@nx/devkit": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
38
38
|
"ansis": "^3.3.0",
|
|
39
39
|
"nx": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
@@ -15,6 +15,8 @@ function parseAutorunExecutorOnlyOptions(options) {
|
|
|
15
15
|
function parseAutorunExecutorOptions(options, normalizedContext) {
|
|
16
16
|
const { projectPrefix, persist, upload, command } = options;
|
|
17
17
|
const needsUploadParams = command === 'upload' || command === 'autorun' || command === undefined;
|
|
18
|
+
const uploadCfg = (0, config_js_1.uploadConfig)({ projectPrefix, ...upload }, normalizedContext);
|
|
19
|
+
const hasApiToken = uploadCfg?.apiKey != null;
|
|
18
20
|
return {
|
|
19
21
|
...parseAutorunExecutorOnlyOptions(options),
|
|
20
22
|
...(0, config_js_1.globalConfig)(options, normalizedContext),
|
|
@@ -22,9 +24,7 @@ function parseAutorunExecutorOptions(options, normalizedContext) {
|
|
|
22
24
|
// @TODO This is a hack to avoid validation errors of upload config for commands that dont need it.
|
|
23
25
|
// Fix: use utils and execute the core logic directly
|
|
24
26
|
// Blocked by Nx plugins can't compile to es6
|
|
25
|
-
upload:
|
|
26
|
-
? (0, config_js_1.uploadConfig)({ projectPrefix, ...upload }, normalizedContext)
|
|
27
|
-
: undefined,
|
|
27
|
+
...(needsUploadParams && hasApiToken ? { upload: uploadCfg } : {}),
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/cli/utils.ts"],"names":[],"mappings":";;AAWA,0EASC;AAED,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/cli/utils.ts"],"names":[],"mappings":";;AAWA,0EASC;AAED,kEAqBC;AAcD,oDAwBC;AAjFD,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,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E,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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createNodes } from './plugin/index.js';
|
|
2
2
|
export default createNodes;
|
|
3
|
-
export
|
|
4
|
-
export {
|
|
5
|
-
export { initGenerator, initSchematic } from './generators/init/generator.js';
|
|
6
|
-
export type { ConfigurationGeneratorOptions } from './generators/configuration/schema.js';
|
|
7
|
-
export { configurationGenerator } from './generators/configuration/generator.js';
|
|
3
|
+
export type { AutorunCommandExecutorOptions } from './executors/cli/schema.js';
|
|
4
|
+
export { objectToCliArgs } from './executors/internal/cli.js';
|
|
8
5
|
export { generateCodePushupConfig } from './generators/configuration/code-pushup-config.js';
|
|
9
|
-
export {
|
|
6
|
+
export { configurationGenerator } from './generators/configuration/generator.js';
|
|
7
|
+
export type { ConfigurationGeneratorOptions } from './generators/configuration/schema.js';
|
|
8
|
+
export { initGenerator, initSchematic } from './generators/init/generator.js';
|
|
9
|
+
export { type InitGeneratorSchema } from './generators/init/schema.js';
|
|
10
10
|
export { executeProcess, type ProcessConfig, } from './internal/execute-process.js';
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export * from './internal/versions.js';
|
|
12
|
+
export { createNodes } from './plugin/index.js';
|
package/src/index.js
CHANGED
|
@@ -14,22 +14,22 @@ 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.
|
|
17
|
+
exports.createNodes = exports.executeProcess = 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
|
exports.default = index_js_1.createNodes;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Object.defineProperty(exports, "initGenerator", { enumerable: true, get: function () { return generator_js_1.initGenerator; } });
|
|
24
|
-
Object.defineProperty(exports, "initSchematic", { enumerable: true, get: function () { return generator_js_1.initSchematic; } });
|
|
25
|
-
var generator_js_2 = require("./generators/configuration/generator.js");
|
|
26
|
-
Object.defineProperty(exports, "configurationGenerator", { enumerable: true, get: function () { return generator_js_2.configurationGenerator; } });
|
|
21
|
+
var cli_js_1 = require("./executors/internal/cli.js");
|
|
22
|
+
Object.defineProperty(exports, "objectToCliArgs", { enumerable: true, get: function () { return cli_js_1.objectToCliArgs; } });
|
|
27
23
|
var code_pushup_config_js_1 = require("./generators/configuration/code-pushup-config.js");
|
|
28
24
|
Object.defineProperty(exports, "generateCodePushupConfig", { enumerable: true, get: function () { return code_pushup_config_js_1.generateCodePushupConfig; } });
|
|
29
|
-
var
|
|
30
|
-
Object.defineProperty(exports, "
|
|
25
|
+
var generator_js_1 = require("./generators/configuration/generator.js");
|
|
26
|
+
Object.defineProperty(exports, "configurationGenerator", { enumerable: true, get: function () { return generator_js_1.configurationGenerator; } });
|
|
27
|
+
var generator_js_2 = require("./generators/init/generator.js");
|
|
28
|
+
Object.defineProperty(exports, "initGenerator", { enumerable: true, get: function () { return generator_js_2.initGenerator; } });
|
|
29
|
+
Object.defineProperty(exports, "initSchematic", { enumerable: true, get: function () { return generator_js_2.initSchematic; } });
|
|
31
30
|
var execute_process_js_1 = require("./internal/execute-process.js");
|
|
32
31
|
Object.defineProperty(exports, "executeProcess", { enumerable: true, get: function () { return execute_process_js_1.executeProcess; } });
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
__exportStar(require("./internal/versions.js"), exports);
|
|
33
|
+
var index_js_2 = require("./plugin/index.js");
|
|
34
|
+
Object.defineProperty(exports, "createNodes", { enumerable: true, get: function () { return index_js_2.createNodes; } });
|
|
35
35
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/nx-plugin/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAAgD;AAEhD,qCAAqC;AACrC,kBAAe,sBAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/nx-plugin/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAAgD;AAEhD,qCAAqC;AACrC,kBAAe,sBAAW,CAAC;AAG3B,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,oEAGuC;AAFrC,oHAAA,cAAc,OAAA;AAGhB,yDAAuC;AACvC,8CAAgD;AAAvC,uGAAA,WAAW,OAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const PROJECT_JSON_FILE_NAME = "project.json";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const CODE_PUSHUP_CONFIG_REGEX: RegExp;
|
|
3
|
+
export declare const PACKAGE_NAME = "@code-pushup/nx-plugin";
|
|
3
4
|
export declare const DEFAULT_TARGET_NAME = "code-pushup";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_TARGET_NAME = exports.PACKAGE_NAME = exports.PROJECT_JSON_FILE_NAME = void 0;
|
|
4
|
-
const package_json_1 = require("../../package.json");
|
|
3
|
+
exports.DEFAULT_TARGET_NAME = exports.PACKAGE_NAME = exports.CODE_PUSHUP_CONFIG_REGEX = exports.PROJECT_JSON_FILE_NAME = void 0;
|
|
5
4
|
exports.PROJECT_JSON_FILE_NAME = 'project.json';
|
|
6
|
-
exports.
|
|
5
|
+
exports.CODE_PUSHUP_CONFIG_REGEX = /^code-pushup(?:\.[\w-]+)?\.ts$/;
|
|
6
|
+
exports.PACKAGE_NAME = '@code-pushup/nx-plugin';
|
|
7
7
|
exports.DEFAULT_TARGET_NAME = 'code-pushup';
|
|
8
8
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/internal/constants.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/internal/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG,cAAc,CAAC;AACxC,QAAA,wBAAwB,GAAG,gCAAgC,CAAC;AAC5D,QAAA,YAAY,GAAG,wBAAwB,CAAC;AACxC,QAAA,mBAAmB,GAAG,aAAa,CAAC"}
|
|
@@ -108,7 +108,7 @@ export type ProcessObserver = {
|
|
|
108
108
|
* // async process execution
|
|
109
109
|
* const result = await executeProcess({
|
|
110
110
|
* command: 'node',
|
|
111
|
-
* args: ['download-data
|
|
111
|
+
* args: ['download-data'],
|
|
112
112
|
* observer: {
|
|
113
113
|
* onStdout: updateProgress,
|
|
114
114
|
* error: handleError,
|
|
@@ -55,7 +55,7 @@ exports.ProcessError = ProcessError;
|
|
|
55
55
|
* // async process execution
|
|
56
56
|
* const result = await executeProcess({
|
|
57
57
|
* command: 'node',
|
|
58
|
-
* args: ['download-data
|
|
58
|
+
* args: ['download-data'],
|
|
59
59
|
* observer: {
|
|
60
60
|
* onStdout: updateProgress,
|
|
61
61
|
* error: handleError,
|
package/src/internal/versions.js
CHANGED
|
@@ -9,6 +9,10 @@ exports.cpNxPluginVersion = loadPackageJson(workspaceRoot).version;
|
|
|
9
9
|
exports.cpModelVersion = loadPackageJson(path.join(projectsFolder, 'cli')).version;
|
|
10
10
|
exports.cpUtilsVersion = loadPackageJson(path.join(projectsFolder, 'utils')).version;
|
|
11
11
|
exports.cpCliVersion = loadPackageJson(path.join(projectsFolder, 'models')).version;
|
|
12
|
+
/**
|
|
13
|
+
* Load the package.json file from the given folder path.
|
|
14
|
+
* @param folderPath
|
|
15
|
+
*/
|
|
12
16
|
function loadPackageJson(folderPath) {
|
|
13
17
|
return (0, devkit_1.readJsonFile)(path.join(folderPath, 'package.json'));
|
|
14
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/internal/versions.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAC1C,kCAAkC;AAGlC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACrD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAE5C,QAAA,iBAAiB,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC;AAC3D,QAAA,cAAc,GAAG,eAAe,CAC3C,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CACjC,CAAC,OAAO,CAAC;AACG,QAAA,cAAc,GAAG,eAAe,CAC3C,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CACnC,CAAC,OAAO,CAAC;AACG,QAAA,YAAY,GAAG,eAAe,CACzC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CACpC,CAAC,OAAO,CAAC;AAEV,SAAS,eAAe,CAAC,UAAkB;IACzC,OAAO,IAAA,qBAAY,EAAc,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/internal/versions.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAC1C,kCAAkC;AAGlC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACrD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAE5C,QAAA,iBAAiB,GAAG,eAAe,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC;AAC3D,QAAA,cAAc,GAAG,eAAe,CAC3C,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CACjC,CAAC,OAAO,CAAC;AACG,QAAA,cAAc,GAAG,eAAe,CAC3C,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CACnC,CAAC,OAAO,CAAC;AACG,QAAA,YAAY,GAAG,eAAe,CACzC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CACpC,CAAC,OAAO,CAAC;AAEV;;;GAGG;AACH,SAAS,eAAe,CAAC,UAAkB;IACzC,OAAO,IAAA,qBAAY,EAAc,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
package/src/plugin/plugin.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.createNodes = void 0;
|
|
|
4
4
|
const constants_js_1 = require("../internal/constants.js");
|
|
5
5
|
const targets_js_1 = require("./target/targets.js");
|
|
6
6
|
const utils_js_1 = require("./utils.js");
|
|
7
|
-
// name has to be "createNodes" to get picked up by Nx
|
|
7
|
+
// name has to be "createNodes" to get picked up by Nx <v20
|
|
8
8
|
exports.createNodes = [
|
|
9
9
|
`**/${constants_js_1.PROJECT_JSON_FILE_NAME}`,
|
|
10
10
|
async (projectConfigurationFile, createNodesOptions, context) => {
|
package/src/plugin/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/plugin/plugin.ts"],"names":[],"mappings":";;;AAKA,2DAAkE;AAClE,oDAAoD;AAEpD,yCAA0D;AAE1D,
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/plugin/plugin.ts"],"names":[],"mappings":";;;AAKA,2DAAkE;AAClE,oDAAoD;AAEpD,yCAA0D;AAE1D,2DAA2D;AAC9C,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,iBAAiB,GAAG,MAAM,IAAA,uCAA4B,EAC1D,OAAO,EACP,wBAAwB,EACxB,wBAAwB,CACzB,CAAC;QAEF,OAAO;YACL,QAAQ,EAAE;gBACR,CAAC,iBAAiB,CAAC,WAAW,CAAC,EAAE;oBAC/B,OAAO,EAAE,MAAM,IAAA,0BAAa,EAAC,iBAAiB,CAAC;iBAChD;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export
|
|
1
|
+
import type { CreateNodesOptions, ProjectConfigurationWithName } from '../types.js';
|
|
2
|
+
export type CreateTargetsOptions = {
|
|
3
|
+
projectJson: ProjectConfigurationWithName;
|
|
4
|
+
projectRoot: string;
|
|
5
|
+
createOptions: CreateNodesOptions;
|
|
6
|
+
};
|
|
7
|
+
export declare function createTargets(normalizedContext: CreateTargetsOptions): Promise<{
|
|
3
8
|
[x: string]: import("@nx/devkit").TargetConfiguration<import("../types.js").ProjectPrefixOptions>;
|
|
4
9
|
} | {
|
|
5
10
|
[x: string]: import("@nx/devkit").TargetConfiguration<import("nx/src/executors/run-commands/run-commands.impl.js").RunCommandsOptions>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"targets.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/plugin/target/targets.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"targets.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/plugin/target/targets.ts"],"names":[],"mappings":";;AAgBA,sCAmBC;AAnCD,+CAA2C;AAC3C,kDAAiD;AAKjD,uEAAsE;AACtE,iDAA0D;AAC1D,6DAA4D;AAQrD,KAAK,UAAU,aAAa,CAAC,iBAAuC;IACzE,MAAM,EACJ,UAAU,GAAG,6BAAc,EAC3B,GAAG,EACH,aAAa,GACd,GAAG,iBAAiB,CAAC,aAAa,CAAC;IACpC,MAAM,SAAS,GAAG,MAAM,IAAA,kBAAO,EAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC/D,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,uCAAwB,CAAC,CAAC;QACzE,CAAC,CAAC;YACE,CAAC,UAAU,CAAC,EAAE,IAAA,yCAAoB,EAAC,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC;SAC3D;QACH,CAAC,CAAC,gFAAgF;YAChF;gBACE,CAAC,GAAG,UAAU,iBAAiB,CAAC,EAAE,IAAA,mDAAyB,EAAC;oBAC1D,UAAU;oBACV,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,IAAI;oBAC/C,GAAG;iBACJ,CAAC;aACH,CAAC;AACR,CAAC"}
|
package/src/plugin/types.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import type { CreateNodesContext, ProjectConfiguration } from '@nx/devkit';
|
|
1
|
+
import type { CreateNodesContext, CreateNodesContextV2, ProjectConfiguration } from '@nx/devkit';
|
|
2
2
|
import type { WithRequired } from '@code-pushup/utils';
|
|
3
3
|
import type { DynamicTargetOptions } from '../internal/types.js';
|
|
4
|
+
import type { CreateTargetsOptions } from './target/targets.js';
|
|
4
5
|
export type ProjectPrefixOptions = {
|
|
5
6
|
projectPrefix?: string;
|
|
6
7
|
};
|
|
7
8
|
export type CreateNodesOptions = DynamicTargetOptions & ProjectPrefixOptions;
|
|
8
9
|
export type ProjectConfigurationWithName = WithRequired<ProjectConfiguration, 'name'>;
|
|
9
|
-
export type NormalizedCreateNodesContext = CreateNodesContext &
|
|
10
|
-
|
|
11
|
-
projectRoot: string;
|
|
12
|
-
createOptions: CreateNodesOptions;
|
|
13
|
-
};
|
|
10
|
+
export type NormalizedCreateNodesContext = CreateNodesContext & CreateTargetsOptions;
|
|
11
|
+
export type NormalizedCreateNodesV2Context = CreateNodesContextV2 & CreateTargetsOptions;
|
package/src/plugin/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type { CreateNodesContext } from '@nx/devkit';
|
|
2
|
-
import type { CreateNodesOptions, NormalizedCreateNodesContext } from './types.js';
|
|
1
|
+
import type { CreateNodesContext, CreateNodesContextV2 } from '@nx/devkit';
|
|
2
|
+
import type { CreateNodesOptions, NormalizedCreateNodesContext, NormalizedCreateNodesV2Context } from './types.js';
|
|
3
3
|
export declare function normalizedCreateNodesContext(context: CreateNodesContext, projectConfigurationFile: string, createOptions?: CreateNodesOptions): Promise<NormalizedCreateNodesContext>;
|
|
4
|
+
export declare function normalizedCreateNodesV2Context(context: CreateNodesContextV2, projectConfigurationFile: string, createOptions?: CreateNodesOptions): Promise<NormalizedCreateNodesV2Context>;
|
package/src/plugin/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizedCreateNodesContext = normalizedCreateNodesContext;
|
|
4
|
+
exports.normalizedCreateNodesV2Context = normalizedCreateNodesV2Context;
|
|
4
5
|
const promises_1 = require("node:fs/promises");
|
|
5
6
|
const path = require("node:path");
|
|
6
7
|
const constants_js_1 = require("./constants.js");
|
|
@@ -23,4 +24,20 @@ async function normalizedCreateNodesContext(context, projectConfigurationFile, c
|
|
|
23
24
|
throw new Error(`Error parsing project.json file ${projectConfigurationFile}.`);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
async function normalizedCreateNodesV2Context(context, projectConfigurationFile, createOptions = {}) {
|
|
28
|
+
const projectRoot = path.dirname(projectConfigurationFile);
|
|
29
|
+
try {
|
|
30
|
+
const projectJson = JSON.parse((await (0, promises_1.readFile)(projectConfigurationFile)).toString());
|
|
31
|
+
const { targetName = constants_js_1.CP_TARGET_NAME } = createOptions;
|
|
32
|
+
return {
|
|
33
|
+
...context,
|
|
34
|
+
projectJson,
|
|
35
|
+
projectRoot,
|
|
36
|
+
createOptions: { ...createOptions, targetName },
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
throw new Error(`Error parsing project.json file ${projectConfigurationFile}.`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
26
43
|
//# sourceMappingURL=utils.js.map
|
package/src/plugin/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/plugin/utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/plugin/utils.ts"],"names":[],"mappings":";;AAWA,oEA2BC;AAED,wEAwBC;AA/DD,+CAA4C;AAC5C,kCAAkC;AAClC,iDAAgD;AAQzC,KAAK,UAAU,4BAA4B,CAChD,OAA2B,EAC3B,wBAAgC,EAChC,gBAAoC,EAAE;IAEtC,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAE3D,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,CAAC,MAAM,IAAA,mB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