@code-pushup/nx-plugin 0.56.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 +9 -9
- package/src/executors/cli/README.md +1 -1
- package/src/executors/cli/executor.d.ts +1 -1
- package/src/executors/cli/executor.js +9 -9
- package/src/executors/cli/executor.js.map +1 -1
- package/src/executors/cli/schema.d.ts +1 -1
- package/src/executors/cli/utils.d.ts +15 -2
- package/src/executors/cli/utils.js +41 -7
- package/src/executors/cli/utils.js.map +1 -1
- package/src/executors/internal/cli.d.ts +1 -2
- package/src/executors/internal/cli.js +2 -6
- package/src/executors/internal/cli.js.map +1 -1
- package/src/executors/internal/config.d.ts +1 -1
- package/src/executors/internal/config.js +8 -9
- package/src/executors/internal/config.js.map +1 -1
- package/src/executors/internal/context.d.ts +1 -1
- package/src/executors/internal/context.js +1 -2
- package/src/executors/internal/context.js.map +1 -1
- package/src/executors/internal/env.js +1 -3
- package/src/executors/internal/env.js.map +1 -1
- package/src/generators/configuration/code-pushup-config.d.ts +1 -1
- package/src/generators/configuration/code-pushup-config.js +14 -14
- package/src/generators/configuration/code-pushup-config.js.map +1 -1
- package/src/generators/configuration/generator.d.ts +1 -1
- package/src/generators/configuration/generator.js +7 -8
- package/src/generators/configuration/generator.js.map +1 -1
- package/src/generators/configuration/schema.d.ts +1 -1
- package/src/generators/configuration/utils.d.ts +2 -2
- package/src/generators/configuration/utils.js +5 -6
- package/src/generators/configuration/utils.js.map +1 -1
- package/src/generators/init/generator.d.ts +1 -1
- package/src/generators/init/generator.js +11 -11
- package/src/generators/init/generator.js.map +1 -1
- package/src/index.d.ts +11 -10
- package/src/index.js +30 -17
- package/src/index.js.map +1 -1
- package/src/internal/execute-process.js +3 -3
- package/src/internal/execute-process.js.map +1 -1
- package/src/internal/versions.js +7 -7
- package/src/internal/versions.js.map +1 -1
- package/src/plugin/index.d.ts +2 -2
- package/src/plugin/index.js +2 -2
- package/src/plugin/index.js.map +1 -1
- package/src/plugin/plugin.js +6 -6
- package/src/plugin/plugin.js.map +1 -1
- package/src/plugin/target/configuration-target.js +6 -7
- package/src/plugin/target/configuration-target.js.map +1 -1
- package/src/plugin/target/executor-target.d.ts +1 -1
- package/src/plugin/target/executor-target.js +3 -4
- package/src/plugin/target/executor-target.js.map +1 -1
- package/src/plugin/target/targets.d.ts +3 -3
- package/src/plugin/target/targets.js +9 -10
- package/src/plugin/target/targets.js.map +1 -1
- package/src/plugin/types.d.ts +1 -1
- package/src/plugin/utils.d.ts +1 -1
- package/src/plugin/utils.js +5 -6
- package/src/plugin/utils.js.map +1 -1
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,11 +32,11 @@
|
|
|
32
32
|
"generators": "./generators.json",
|
|
33
33
|
"executors": "./executors.json",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@
|
|
36
|
-
"
|
|
37
|
-
"nx": "^17.
|
|
38
|
-
"
|
|
39
|
-
"zod": "^3.22.4"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
35
|
+
"@code-pushup/models": "0.58.0",
|
|
36
|
+
"@code-pushup/utils": "0.58.0",
|
|
37
|
+
"@nx/devkit": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
38
|
+
"nx": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
39
|
+
"zod": "^3.22.4"
|
|
40
|
+
},
|
|
41
|
+
"types": "./src/index.d.ts"
|
|
42
|
+
}
|
|
@@ -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).
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = runAutorunExecutor;
|
|
3
4
|
const devkit_1 = require("@nx/devkit");
|
|
4
|
-
// eslint-disable-next-line n/no-sync
|
|
5
5
|
const node_child_process_1 = require("node:child_process");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
6
|
+
const cli_js_1 = require("../internal/cli.js");
|
|
7
|
+
const context_js_1 = require("../internal/context.js");
|
|
8
|
+
const utils_js_1 = require("./utils.js");
|
|
9
9
|
function runAutorunExecutor(terminalAndExecutorOptions, context) {
|
|
10
|
-
const normalizedContext = (0,
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
10
|
+
const normalizedContext = (0, context_js_1.normalizeContext)(context);
|
|
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;
|
|
14
|
+
const commandString = (0, cli_js_1.createCliCommand)({ command, args: cliArgumentObject });
|
|
14
15
|
const commandStringOptions = context.cwd ? { cwd: context.cwd } : {};
|
|
15
16
|
if (verbose) {
|
|
16
17
|
devkit_1.logger.info(`Run CLI executor ${command ?? ''}`);
|
|
@@ -39,5 +40,4 @@ function runAutorunExecutor(terminalAndExecutorOptions, context) {
|
|
|
39
40
|
command: commandString,
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
exports.default = runAutorunExecutor;
|
|
43
43
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/cli/executor.ts"],"names":[],"mappings":";;
|
|
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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PersistConfig, UploadConfig } from '@code-pushup/models';
|
|
2
|
-
import type { CollectExecutorOnlyOptions, GeneralExecutorOnlyOptions, GlobalExecutorOptions, ProjectExecutorOnlyOptions } from '../internal/types';
|
|
2
|
+
import type { CollectExecutorOnlyOptions, GeneralExecutorOnlyOptions, GlobalExecutorOptions, ProjectExecutorOnlyOptions } from '../internal/types.js';
|
|
3
3
|
export type AutorunCommandExecutorOnlyOptions = ProjectExecutorOnlyOptions & CollectExecutorOnlyOptions & GeneralExecutorOnlyOptions;
|
|
4
4
|
export type AutorunCommandExecutorOptions = Partial<{
|
|
5
5
|
upload: Partial<UploadConfig>;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
import type { NormalizedExecutorContext } from '../internal/context';
|
|
2
|
-
import type { AutorunCommandExecutorOnlyOptions, AutorunCommandExecutorOptions } from './schema';
|
|
1
|
+
import type { NormalizedExecutorContext } from '../internal/context.js';
|
|
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;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.parseAutorunExecutorOnlyOptions = parseAutorunExecutorOnlyOptions;
|
|
4
|
+
exports.parseAutorunExecutorOptions = parseAutorunExecutorOptions;
|
|
5
|
+
exports.mergeExecutorOptions = mergeExecutorOptions;
|
|
6
|
+
const config_js_1 = require("../internal/config.js");
|
|
5
7
|
function parseAutorunExecutorOnlyOptions(options) {
|
|
6
8
|
const { projectPrefix, dryRun, onlyPlugins } = options;
|
|
7
9
|
return {
|
|
@@ -10,21 +12,53 @@ function parseAutorunExecutorOnlyOptions(options) {
|
|
|
10
12
|
...(onlyPlugins && { onlyPlugins }),
|
|
11
13
|
};
|
|
12
14
|
}
|
|
13
|
-
exports.parseAutorunExecutorOnlyOptions = parseAutorunExecutorOnlyOptions;
|
|
14
15
|
function parseAutorunExecutorOptions(options, normalizedContext) {
|
|
15
16
|
const { projectPrefix, persist, upload, command } = options;
|
|
16
17
|
const needsUploadParams = command === 'upload' || command === 'autorun' || command === undefined;
|
|
17
18
|
return {
|
|
18
19
|
...parseAutorunExecutorOnlyOptions(options),
|
|
19
|
-
...(0,
|
|
20
|
-
persist: (0,
|
|
20
|
+
...(0, config_js_1.globalConfig)(options, normalizedContext),
|
|
21
|
+
persist: (0, config_js_1.persistConfig)({ projectPrefix, ...persist }, normalizedContext),
|
|
21
22
|
// @TODO This is a hack to avoid validation errors of upload config for commands that dont need it.
|
|
22
23
|
// Fix: use utils and execute the core logic directly
|
|
23
24
|
// Blocked by Nx plugins can't compile to es6
|
|
24
25
|
upload: needsUploadParams
|
|
25
|
-
? (0,
|
|
26
|
+
? (0, config_js_1.uploadConfig)({ projectPrefix, ...upload }, normalizedContext)
|
|
26
27
|
: undefined,
|
|
27
28
|
};
|
|
28
29
|
}
|
|
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
|
+
}
|
|
30
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":"
|
|
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"}
|
|
@@ -4,8 +4,7 @@ export declare function createCliCommand(options?: {
|
|
|
4
4
|
bin?: string;
|
|
5
5
|
}): string;
|
|
6
6
|
type ArgumentValue = number | string | boolean | string[];
|
|
7
|
-
export type CliArgsObject<T extends object = Record<string, ArgumentValue>> = T extends never ?
|
|
8
|
-
Record<string, ArgumentValue | undefined> | {
|
|
7
|
+
export type CliArgsObject<T extends object = Record<string, ArgumentValue>> = T extends never ? Record<string, ArgumentValue | undefined> | {
|
|
9
8
|
_: string;
|
|
10
9
|
} : T;
|
|
11
10
|
export declare function objectToCliArgs<T extends object = Record<string, ArgumentValue>>(params?: CliArgsObject<T>): string[];
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createCliCommand = createCliCommand;
|
|
4
|
+
exports.objectToCliArgs = objectToCliArgs;
|
|
4
5
|
function createCliCommand(options) {
|
|
5
6
|
const { bin = '@code-pushup/cli', command, args } = options ?? {};
|
|
6
7
|
return `npx ${bin} ${objectToCliArgs({ _: command ?? [], ...args }).join(' ')}`;
|
|
7
8
|
}
|
|
8
|
-
exports.createCliCommand = createCliCommand;
|
|
9
9
|
// @TODO import from @code-pushup/utils => get rid of poppins for cjs support
|
|
10
|
-
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
11
10
|
function objectToCliArgs(params) {
|
|
12
11
|
if (!params) {
|
|
13
12
|
return [];
|
|
14
13
|
}
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
16
14
|
return Object.entries(params).flatMap(([key, value]) => {
|
|
17
15
|
// process/file/script
|
|
18
16
|
if (key === '_') {
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
20
17
|
return (Array.isArray(value) ? value : [`${value}`]).filter(v => v != null);
|
|
21
18
|
}
|
|
22
19
|
const prefix = key.length === 1 ? '-' : '--';
|
|
@@ -44,5 +41,4 @@ function objectToCliArgs(params) {
|
|
|
44
41
|
throw new Error(`Unsupported type ${typeof value} for key ${key}`);
|
|
45
42
|
});
|
|
46
43
|
}
|
|
47
|
-
exports.objectToCliArgs = objectToCliArgs;
|
|
48
44
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/internal/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/internal/cli.ts"],"names":[],"mappings":";;AAAA,4CASC;AASD,0CA8CC;AAhED,SAAgB,gBAAgB,CAAC,OAIhC;IACC,MAAM,EAAE,GAAG,GAAG,kBAAkB,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,OAA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C,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PersistConfig, UploadConfig } from '@code-pushup/models';
|
|
2
|
-
import type { BaseNormalizedExecutorContext, GlobalExecutorOptions, ProjectExecutorOnlyOptions } from './types';
|
|
2
|
+
import type { BaseNormalizedExecutorContext, GlobalExecutorOptions, ProjectExecutorOnlyOptions } from './types.js';
|
|
3
3
|
export declare function globalConfig(options: Partial<GlobalExecutorOptions & Record<string, unknown>>, context: BaseNormalizedExecutorContext): GlobalExecutorOptions;
|
|
4
4
|
export declare function persistConfig(options: Partial<PersistConfig & ProjectExecutorOnlyOptions>, context: BaseNormalizedExecutorContext): Partial<PersistConfig>;
|
|
5
5
|
export declare function uploadConfig(options: Partial<UploadConfig & ProjectExecutorOnlyOptions>, context: BaseNormalizedExecutorContext): Partial<UploadConfig>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
exports.globalConfig = globalConfig;
|
|
4
|
+
exports.persistConfig = persistConfig;
|
|
5
|
+
exports.uploadConfig = uploadConfig;
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
const env_js_1 = require("./env.js");
|
|
6
8
|
function globalConfig(options, context) {
|
|
7
9
|
const { projectConfig } = context;
|
|
8
10
|
const { root: projectRoot = '' } = projectConfig ?? {};
|
|
@@ -11,14 +13,13 @@ function globalConfig(options, context) {
|
|
|
11
13
|
return {
|
|
12
14
|
verbose: !!verbose,
|
|
13
15
|
progress: !!progress,
|
|
14
|
-
config: config ??
|
|
16
|
+
config: config ?? path.join(projectRoot, 'code-pushup.config.ts'),
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
|
-
exports.globalConfig = globalConfig;
|
|
18
19
|
function persistConfig(options, context) {
|
|
19
20
|
const { projectConfig, workspaceRoot } = context;
|
|
20
21
|
const { name: projectName = '' } = projectConfig ?? {};
|
|
21
|
-
const { format, outputDir =
|
|
22
|
+
const { format, outputDir = path.join(workspaceRoot, '.code-pushup', projectName), // always in <root>/.code-pushup/<project-name>,
|
|
22
23
|
filename, } = options;
|
|
23
24
|
return {
|
|
24
25
|
outputDir,
|
|
@@ -26,7 +27,6 @@ function persistConfig(options, context) {
|
|
|
26
27
|
...(filename ? { filename } : {}),
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
|
-
exports.persistConfig = persistConfig;
|
|
30
30
|
function uploadConfig(options, context) {
|
|
31
31
|
const { projectConfig, workspaceRoot } = context;
|
|
32
32
|
const { name: projectName } = projectConfig ?? {};
|
|
@@ -39,9 +39,8 @@ function uploadConfig(options, context) {
|
|
|
39
39
|
project: applyPrefix ? `${prefix}${projectName}` : projectName,
|
|
40
40
|
}
|
|
41
41
|
: {}),
|
|
42
|
-
...(0,
|
|
42
|
+
...(0, env_js_1.parseEnv)(process.env),
|
|
43
43
|
...Object.fromEntries(Object.entries({ server, apiKey, organization, project, timeout }).filter(([_, v]) => v !== undefined)),
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
exports.uploadConfig = uploadConfig;
|
|
47
46
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/internal/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/internal/config.ts"],"names":[],"mappings":";;AASA,oCAaC;AAED,sCAkBC;AAED,oCAwBC;AApED,kCAAkC;AAElC,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,GAAG,OAAO,CAAC;IAC9C,OAAO;QACL,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,MAAM,EAAE,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,uBAAuB,CAAC;KAClE,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa,CAC3B,OAA4D,EAC5D,OAAsC;IAEtC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAEjD,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,aAAa,IAAI,EAAE,CAAC;IACvD,MAAM,EACJ,MAAM,EACN,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,WAAW,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,5 +1,5 @@
|
|
|
1
1
|
import type { ExecutorContext } from 'nx/src/config/misc-interfaces';
|
|
2
|
-
import type { BaseNormalizedExecutorContext } from './types';
|
|
2
|
+
import type { BaseNormalizedExecutorContext } from './types.js';
|
|
3
3
|
export type NormalizedExecutorContext = BaseNormalizedExecutorContext & {
|
|
4
4
|
projectName: string;
|
|
5
5
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeContext =
|
|
3
|
+
exports.normalizeContext = normalizeContext;
|
|
4
4
|
function normalizeContext(context) {
|
|
5
5
|
const { projectName = '', root: workspaceRoot, projectsConfigurations, } = context;
|
|
6
6
|
return {
|
|
@@ -9,5 +9,4 @@ function normalizeContext(context) {
|
|
|
9
9
|
workspaceRoot,
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
exports.normalizeContext = normalizeContext;
|
|
13
12
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/internal/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/internal/context.ts"],"names":[],"mappings":";;AAOA,4CAaC;AAbD,SAAgB,gBAAgB,CAC9B,OAAwB;IAExB,MAAM,EACJ,WAAW,GAAG,EAAE,EAChB,IAAI,EAAE,aAAa,EACnB,sBAAsB,GACvB,GAAG,OAAO,CAAC;IACZ,OAAO;QACL,WAAW;QACX,aAAa,EAAE,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAAC;QAC5D,aAAa;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parseEnv =
|
|
3
|
+
exports.parseEnv = parseEnv;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// load upload configuration from environment
|
|
6
6
|
const envSchema = zod_1.z
|
|
@@ -14,7 +14,6 @@ const envSchema = zod_1.z
|
|
|
14
14
|
.partial();
|
|
15
15
|
function parseEnv(env = {}) {
|
|
16
16
|
const upload = envSchema.parse(env);
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
18
17
|
return Object.fromEntries(Object.entries(upload).map(([envKey, value]) => {
|
|
19
18
|
switch (envKey) {
|
|
20
19
|
case 'CP_SERVER':
|
|
@@ -32,5 +31,4 @@ function parseEnv(env = {}) {
|
|
|
32
31
|
}
|
|
33
32
|
}));
|
|
34
33
|
}
|
|
35
|
-
exports.parseEnv = parseEnv;
|
|
36
34
|
//# sourceMappingURL=env.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/internal/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/executors/internal/env.ts"],"names":[],"mappings":";;AAgBA,4BAoBC;AApCD,6BAAwB;AAGxB,6CAA6C;AAC7C,MAAM,SAAS,GAAG,OAAC;KAChB,MAAM,CAAC;IACN,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACtC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxC,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxC,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;CACjD,CAAC;KACD,OAAO,EAAE,CAAC;AAIb,SAAgB,QAAQ,CAAC,MAAe,EAAE;IACxC,MAAM,MAAM,GAAkB,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE;QAC7C,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,WAAW;gBACd,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC3B,KAAK,YAAY;gBACf,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAC3B,KAAK,iBAAiB;gBACpB,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;YACjC,KAAK,YAAY;gBACf,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YAC5B,KAAK,YAAY;gBACf,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9D;gBACE,OAAO,EAAE,CAAC;QACd,CAAC;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
2
|
import type { PersistConfig, UploadConfig } from '@code-pushup/models';
|
|
3
3
|
import type { ItemOrArray } from '@code-pushup/utils';
|
|
4
|
-
import type { ExecutableCode } from './types';
|
|
4
|
+
import type { ExecutableCode } from './types.js';
|
|
5
5
|
export declare const DEFAULT_IMPORTS: string[];
|
|
6
6
|
export type GenerateCodePushupConfigOptions = {
|
|
7
7
|
fileImports?: ItemOrArray<string>;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DEFAULT_IMPORTS = void 0;
|
|
4
|
+
exports.generateCodePushupConfig = generateCodePushupConfig;
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
const utils_js_1 = require("./utils.js");
|
|
7
8
|
exports.DEFAULT_IMPORTS = [
|
|
8
9
|
"import type { CoreConfig } from '@code-pushup/models';",
|
|
9
10
|
];
|
|
10
11
|
function generateCodePushupConfig(tree, root, options) {
|
|
11
12
|
const supportedFormats = ['ts', 'mjs', 'js'];
|
|
12
|
-
const firstExistingFormat = supportedFormats.find(ext => tree.exists(
|
|
13
|
+
const firstExistingFormat = supportedFormats.find(ext => tree.exists(path.join(root, `code-pushup.config.${ext}`)));
|
|
13
14
|
if (firstExistingFormat) {
|
|
14
15
|
devkit_1.logger.warn(`NOTE: No config file created as code-pushup.config.${firstExistingFormat} file already exists.`);
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
17
18
|
const { fileImports: rawImports, persist, upload, plugins: rawPlugins = [], // plugins are required
|
|
18
19
|
categories: rawCategories, } = options ?? {};
|
|
19
|
-
const plugins = rawPlugins.map(
|
|
20
|
-
const categories = rawCategories?.map(
|
|
20
|
+
const plugins = rawPlugins.map(utils_js_1.normalizeExecutableCode);
|
|
21
|
+
const categories = rawCategories?.map(utils_js_1.normalizeExecutableCode);
|
|
21
22
|
const configFileImports = [
|
|
22
|
-
...(rawImports ? (0,
|
|
23
|
+
...(rawImports ? (0, utils_js_1.normalizeItemOrArray)(rawImports) : exports.DEFAULT_IMPORTS),
|
|
23
24
|
...plugins.flatMap(({ fileImports }) => fileImports),
|
|
24
25
|
...(categories ?? []).flatMap(({ fileImports }) => fileImports),
|
|
25
26
|
];
|
|
26
|
-
(0, devkit_1.generateFiles)(tree,
|
|
27
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'files'), root, {
|
|
27
28
|
...options,
|
|
28
|
-
fileImports: (0,
|
|
29
|
-
persist: (0,
|
|
30
|
-
upload: (0,
|
|
31
|
-
plugins:
|
|
29
|
+
fileImports: (0, utils_js_1.formatArrayToLinesOfJsString)(configFileImports),
|
|
30
|
+
persist: (0, utils_js_1.formatObjectToFormattedJsString)(persist),
|
|
31
|
+
upload: (0, utils_js_1.formatObjectToFormattedJsString)(upload),
|
|
32
|
+
plugins: `[${plugins.map(({ codeStrings }) => codeStrings).join(',')}]`,
|
|
32
33
|
categories: categories &&
|
|
33
|
-
|
|
34
|
+
`[${categories.map(({ codeStrings }) => codeStrings).join(',')}]`,
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
exports.generateCodePushupConfig = generateCodePushupConfig;
|
|
38
38
|
//# sourceMappingURL=code-pushup-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-pushup-config.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/configuration/code-pushup-config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"code-pushup-config.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/configuration/code-pushup-config.ts"],"names":[],"mappings":";;;AAwBA,4DAyCC;AAjED,uCAA8D;AAC9D,kCAAkC;AAIlC,yCAKoB;AAEP,QAAA,eAAe,GAAG;IAC7B,wDAAwD;CACzD,CAAC;AAUF,SAAgB,wBAAwB,CACtC,IAAU,EACV,IAAY,EACZ,OAAyC;IAEzC,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7C,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CACtD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,sBAAsB,GAAG,EAAE,CAAC,CAAC,CAC1D,CAAC;IACF,I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,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;SACpE,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
2
|
import type { ProjectConfiguration } from 'nx/src/config/workspace-json-project-json';
|
|
3
|
-
import type { ConfigurationGeneratorOptions } from './schema';
|
|
3
|
+
import type { ConfigurationGeneratorOptions } from './schema.js';
|
|
4
4
|
export declare function configurationGenerator(tree: Tree, options: ConfigurationGeneratorOptions): Promise<void>;
|
|
5
5
|
export declare function addTargetToProject(tree: Tree, projectConfiguration: ProjectConfiguration, options: ConfigurationGeneratorOptions): void;
|
|
6
6
|
export default configurationGenerator;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.configurationGenerator = configurationGenerator;
|
|
4
|
+
exports.addTargetToProject = addTargetToProject;
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
6
|
+
const constants_js_1 = require("../../internal/constants.js");
|
|
7
|
+
const code_pushup_config_js_1 = require("./code-pushup-config.js");
|
|
7
8
|
async function configurationGenerator(tree, options) {
|
|
8
9
|
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
9
10
|
const { skipConfig, skipTarget, skipFormat } = options;
|
|
@@ -11,7 +12,7 @@ async function configurationGenerator(tree, options) {
|
|
|
11
12
|
devkit_1.logger.info('Skip config file creation');
|
|
12
13
|
}
|
|
13
14
|
else {
|
|
14
|
-
(0,
|
|
15
|
+
(0, code_pushup_config_js_1.generateCodePushupConfig)(tree, projectConfiguration.root);
|
|
15
16
|
}
|
|
16
17
|
if (skipTarget === true) {
|
|
17
18
|
devkit_1.logger.info('Skip adding target to project');
|
|
@@ -26,21 +27,19 @@ async function configurationGenerator(tree, options) {
|
|
|
26
27
|
await (0, devkit_1.formatFiles)(tree);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
exports.configurationGenerator = configurationGenerator;
|
|
30
30
|
function addTargetToProject(tree, projectConfiguration, options) {
|
|
31
31
|
const { targets } = projectConfiguration;
|
|
32
32
|
const { targetName, project } = options;
|
|
33
33
|
const codePushupTargetConfig = {
|
|
34
|
-
executor: `${
|
|
34
|
+
executor: `${constants_js_1.PACKAGE_NAME}:cli`,
|
|
35
35
|
};
|
|
36
36
|
(0, devkit_1.updateProjectConfiguration)(tree, project, {
|
|
37
37
|
...projectConfiguration,
|
|
38
38
|
targets: {
|
|
39
39
|
...targets,
|
|
40
|
-
[targetName ??
|
|
40
|
+
[targetName ?? constants_js_1.DEFAULT_TARGET_NAME]: codePushupTargetConfig,
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
exports.addTargetToProject = addTargetToProject;
|
|
45
44
|
exports.default = configurationGenerator;
|
|
46
45
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/configuration/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/configuration/generator.ts"],"names":[],"mappings":";;AAYA,wDAyBC;AAED,gDAmBC;AA1DD,uCAMoB;AAEpB,8DAAgF;AAChF,mEAAmE;AAG5D,KAAK,UAAU,sBAAsB,CAC1C,IAAU,EACV,OAAsC;IAEtC,MAAM,oBAAoB,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7E,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvD,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxB,eAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;IAC3C,CAAC;SAAM,CAAC;QACN,IAAA,gDAAwB,EAAC,IAAI,EAAE,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxB,eAAM,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IAC/C,CAAC;SAAM,CAAC;QACN,kBAAkB,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxB,eAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,SAAgB,kBAAkB,CAChC,IAAU,EACV,oBAA0C,EAC1C,OAAsC;IAEtC,MAAM,EAAE,OAAO,EAAE,GAAG,oBAAoB,CAAC;IACzC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAExC,MAAM,sBAAsB,GAAG;QAC7B,QAAQ,EAAE,GAAG,2BAAY,MAAM;KAChC,CAAC;IAEF,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,EAAE;QACxC,GAAG,oBAAoB;QACvB,OAAO,EAAE;YACP,GAAG,OAAO;YACV,CAAC,UAAU,IAAI,kCAAmB,CAAC,EAAE,sBAAsB;SAC5D;KACF,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ExtractArrays } from '@code-pushup/utils';
|
|
2
|
-
import type { ExecutableCode } from './types';
|
|
2
|
+
import type { ExecutableCode } from './types.js';
|
|
3
3
|
export declare function normalizeExecutableCode(executableCode: ExecutableCode): ExtractArrays<ExecutableCode>;
|
|
4
4
|
export declare function normalizeItemOrArray<T>(itemOrArray: T | T[]): T[];
|
|
5
5
|
export declare function formatObjectToFormattedJsString(jsonObj?: {
|
|
6
6
|
[key: string]: unknown;
|
|
7
|
-
} |
|
|
7
|
+
} | unknown[]): string | undefined;
|
|
8
8
|
export declare function formatArrayToLinesOfJsString(lines?: string[], separator?: string): string | undefined;
|
|
9
9
|
export declare function formatArrayToJSArray(lines?: string[]): string | undefined;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.normalizeExecutableCode = normalizeExecutableCode;
|
|
4
|
+
exports.normalizeItemOrArray = normalizeItemOrArray;
|
|
5
|
+
exports.formatObjectToFormattedJsString = formatObjectToFormattedJsString;
|
|
6
|
+
exports.formatArrayToLinesOfJsString = formatArrayToLinesOfJsString;
|
|
7
|
+
exports.formatArrayToJSArray = formatArrayToJSArray;
|
|
4
8
|
function normalizeExecutableCode(executableCode) {
|
|
5
9
|
const { fileImports: rawFileImports, codeStrings: rawCodeStrings } = executableCode;
|
|
6
10
|
return {
|
|
@@ -8,7 +12,6 @@ function normalizeExecutableCode(executableCode) {
|
|
|
8
12
|
codeStrings: normalizeItemOrArray(rawCodeStrings),
|
|
9
13
|
};
|
|
10
14
|
}
|
|
11
|
-
exports.normalizeExecutableCode = normalizeExecutableCode;
|
|
12
15
|
function normalizeItemOrArray(itemOrArray) {
|
|
13
16
|
if (itemOrArray == null) {
|
|
14
17
|
return undefined;
|
|
@@ -18,7 +21,6 @@ function normalizeItemOrArray(itemOrArray) {
|
|
|
18
21
|
}
|
|
19
22
|
return [itemOrArray];
|
|
20
23
|
}
|
|
21
|
-
exports.normalizeItemOrArray = normalizeItemOrArray;
|
|
22
24
|
// Return a formatted JSON in TS object with the same keys as the input object but remove the " for the properties
|
|
23
25
|
function formatObjectToFormattedJsString(jsonObj) {
|
|
24
26
|
if (!jsonObj) {
|
|
@@ -29,19 +31,16 @@ function formatObjectToFormattedJsString(jsonObj) {
|
|
|
29
31
|
// Remove double quotes around property names
|
|
30
32
|
return jsonString.replace(/"(\w+)":/g, '$1:');
|
|
31
33
|
}
|
|
32
|
-
exports.formatObjectToFormattedJsString = formatObjectToFormattedJsString;
|
|
33
34
|
function formatArrayToLinesOfJsString(lines, separator = '\n') {
|
|
34
35
|
if (lines == null || lines.length === 0) {
|
|
35
36
|
return;
|
|
36
37
|
}
|
|
37
38
|
return lines.join(separator).replace(/'/g, '"');
|
|
38
39
|
}
|
|
39
|
-
exports.formatArrayToLinesOfJsString = formatArrayToLinesOfJsString;
|
|
40
40
|
function formatArrayToJSArray(lines) {
|
|
41
41
|
if (!Array.isArray(lines)) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
44
|
return `[${formatArrayToLinesOfJsString(lines, ',\n') ?? ''}]`.replace(/"/g, '');
|
|
45
45
|
}
|
|
46
|
-
exports.formatArrayToJSArray = formatArrayToJSArray;
|
|
47
46
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/configuration/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/configuration/utils.ts"],"names":[],"mappings":";;AAGA,0DAUC;AAGD,oDAUC;AAGD,0EAeC;AAED,oEAQC;AAED,oDASC;AA9DD,SAAgB,uBAAuB,CACrC,cAA8B;IAE9B,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,GAChE,cAAc,CAAC;IAEjB,OAAO;QACL,WAAW,EAAE,oBAAoB,CAAC,cAAc,CAAC;QACjD,WAAW,EAAE,oBAAoB,CAAC,cAAc,CAAC;KAClD,CAAC;AACJ,CAAC;AAGD,SAAgB,oBAAoB,CAClC,WAAgC;IAEhC,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,CAAC,WAAW,CAAC,CAAC;AACvB,CAAC;AAED,kHAAkH;AAClH,SAAgB,+BAA+B,CAC7C,OAIa;IAEb,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IACD,mDAAmD;IACnD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAEpD,6CAA6C;IAC7C,OAAO,UAAU,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,SAAgB,4BAA4B,CAC1C,KAAgB,EAChB,SAAS,GAAG,IAAI;IAEhB,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO;IACT,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAClD,CAAC;AAED,SAAgB,oBAAoB,CAAC,KAAgB;IACnD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IAED,OAAO,IAAI,4BAA4B,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,OAAO,CACpE,IAAI,EACJ,EAAE,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Tree } from '@nx/devkit';
|
|
2
|
-
import type { InitGeneratorSchema } from './schema';
|
|
2
|
+
import type { InitGeneratorSchema } from './schema.js';
|
|
3
3
|
export declare function initGenerator(tree: Tree, schema: InitGeneratorSchema): import("@nx/devkit").GeneratorCallback;
|
|
4
4
|
export default initGenerator;
|
|
5
5
|
export declare const initSchematic: (generatorOptions: InitGeneratorSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initSchematic =
|
|
3
|
+
exports.initSchematic = void 0;
|
|
4
|
+
exports.initGenerator = initGenerator;
|
|
4
5
|
/* eslint-disable functional/immutable-data */
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
7
|
+
const constants_js_1 = require("../../internal/constants.js");
|
|
8
|
+
const versions_js_1 = require("../../internal/versions.js");
|
|
8
9
|
function checkDependenciesInstalled(host) {
|
|
9
10
|
const packageJson = (0, devkit_1.readJson)(host, 'package.json');
|
|
10
11
|
const devDependencies = {};
|
|
@@ -12,10 +13,10 @@ function checkDependenciesInstalled(host) {
|
|
|
12
13
|
packageJson.dependencies = packageJson.dependencies ?? {};
|
|
13
14
|
packageJson.devDependencies = packageJson.devDependencies ?? {};
|
|
14
15
|
// base deps
|
|
15
|
-
devDependencies[
|
|
16
|
-
devDependencies['@code-pushup/models'] =
|
|
17
|
-
devDependencies['@code-pushup/utils'] =
|
|
18
|
-
devDependencies['@code-pushup/cli'] =
|
|
16
|
+
devDependencies[constants_js_1.PACKAGE_NAME] = versions_js_1.cpNxPluginVersion;
|
|
17
|
+
devDependencies['@code-pushup/models'] = versions_js_1.cpModelVersion;
|
|
18
|
+
devDependencies['@code-pushup/utils'] = versions_js_1.cpUtilsVersion;
|
|
19
|
+
devDependencies['@code-pushup/cli'] = versions_js_1.cpCliVersion;
|
|
19
20
|
return (0, devkit_1.addDependenciesToPackageJson)(host, dependencies, devDependencies);
|
|
20
21
|
}
|
|
21
22
|
function moveToDevDependencies(tree) {
|
|
@@ -25,14 +26,14 @@ function moveToDevDependencies(tree) {
|
|
|
25
26
|
devDependencies: {},
|
|
26
27
|
...packageJson,
|
|
27
28
|
};
|
|
28
|
-
if (newPackageJson.dependencies?.[
|
|
29
|
-
const { [
|
|
29
|
+
if (newPackageJson.dependencies?.[constants_js_1.PACKAGE_NAME] !== undefined) {
|
|
30
|
+
const { [constants_js_1.PACKAGE_NAME]: version, ...dependencies } = newPackageJson.dependencies;
|
|
30
31
|
return {
|
|
31
32
|
...newPackageJson,
|
|
32
33
|
dependencies,
|
|
33
34
|
devDependencies: {
|
|
34
35
|
...newPackageJson.devDependencies,
|
|
35
|
-
[
|
|
36
|
+
[constants_js_1.PACKAGE_NAME]: version,
|
|
36
37
|
},
|
|
37
38
|
};
|
|
38
39
|
}
|
|
@@ -72,7 +73,6 @@ function initGenerator(tree, schema) {
|
|
|
72
73
|
}
|
|
73
74
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
74
75
|
}
|
|
75
|
-
exports.initGenerator = initGenerator;
|
|
76
76
|
exports.default = initGenerator;
|
|
77
77
|
exports.initSchematic = (0, devkit_1.convertNxGenerator)(initGenerator);
|
|
78
78
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/init/generator.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/generators/init/generator.ts"],"names":[],"mappings":";;;AA6EA,sCAoBC;AAjGD,8CAA8C;AAC9C,uCAWoB;AAEpB,8DAA2D;AAC3D,4DAKoC;AAGpC,SAAS,0BAA0B,CAAC,IAAU;IAC5C,MAAM,WAAW,GAAG,IAAA,iBAAQ,EAAc,IAAI,EAAE,cAAc,CAAC,CAAC;IAChE,MAAM,eAAe,GAA2B,EAAE,CAAC;IACnD,MAAM,YAAY,GAAG,EAAE,CAAC;IACxB,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC,YAAY,IAAI,EAAE,CAAC;IAC1D,WA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AS,EAAE,aAAa,CAAC;QAClC,KAAK,EAAE,IAAI;KACZ,CAAC;IAEF,IAAA,qBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC;AAED,SAAgB,aAAa,CAAC,IAAU,EAAE,MAA2B;IACnE,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;QACtB,eAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;QAC3B,eAAM,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;IAC5C,CAAC;SAAM,CAAC;QACN,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAC5B,MAAM,mBAAmB,GAAG,0BAA0B,CAAC,IAAI,CAAC,CAAC;QAC7D,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,eAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;AACpC,CAAC;AAED,kBAAe,aAAa,CAAC;AAChB,QAAA,aAAa,GAAG,IAAA,2BAAkB,EAAC,aAAa,CAAC,CAAC"}
|
package/src/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { createNodes } from './plugin';
|
|
1
|
+
import { createNodes } from './plugin/index.js';
|
|
2
2
|
export default createNodes;
|
|
3
|
-
export * from './internal/versions';
|
|
4
|
-
export { type InitGeneratorSchema } from './generators/init/schema';
|
|
5
|
-
export { initGenerator, initSchematic } from './generators/init/generator';
|
|
6
|
-
export type { ConfigurationGeneratorOptions } from './generators/configuration/schema';
|
|
7
|
-
export { configurationGenerator } from './generators/configuration/generator';
|
|
8
|
-
export { generateCodePushupConfig } from './generators/configuration/code-pushup-config';
|
|
9
|
-
export { createNodes } from './plugin';
|
|
10
|
-
export { executeProcess, type ProcessConfig } from './internal/execute-process';
|
|
11
|
-
export { objectToCliArgs } from './executors/internal/cli';
|
|
3
|
+
export * from './internal/versions.js';
|
|
4
|
+
export { type InitGeneratorSchema } from './generators/init/schema.js';
|
|
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';
|
|
8
|
+
export { generateCodePushupConfig } from './generators/configuration/code-pushup-config.js';
|
|
9
|
+
export { createNodes } from './plugin/index.js';
|
|
10
|
+
export { executeProcess, type ProcessConfig, } from './internal/execute-process.js';
|
|
11
|
+
export { objectToCliArgs } from './executors/internal/cli.js';
|
|
12
|
+
export type { AutorunCommandExecutorOptions } from './executors/cli/schema.js';
|
package/src/index.js
CHANGED
|
@@ -1,22 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.objectToCliArgs = exports.executeProcess = exports.createNodes = exports.generateCodePushupConfig = exports.configurationGenerator = exports.initSchematic = exports.initGenerator = void 0;
|
|
4
|
-
const
|
|
5
|
-
const plugin_1 = require("./plugin");
|
|
18
|
+
const index_js_1 = require("./plugin/index.js");
|
|
6
19
|
// default export for nx.json#plugins
|
|
7
|
-
exports.default =
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
Object.defineProperty(exports, "initGenerator", { enumerable: true, get: function () { return
|
|
11
|
-
Object.defineProperty(exports, "initSchematic", { enumerable: true, get: function () { return
|
|
12
|
-
var
|
|
13
|
-
Object.defineProperty(exports, "configurationGenerator", { enumerable: true, get: function () { return
|
|
14
|
-
var
|
|
15
|
-
Object.defineProperty(exports, "generateCodePushupConfig", { enumerable: true, get: function () { return
|
|
16
|
-
var
|
|
17
|
-
Object.defineProperty(exports, "createNodes", { enumerable: true, get: function () { return
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "executeProcess", { enumerable: true, get: function () { return
|
|
20
|
-
var
|
|
21
|
-
Object.defineProperty(exports, "objectToCliArgs", { enumerable: true, get: function () { return
|
|
20
|
+
exports.default = index_js_1.createNodes;
|
|
21
|
+
__exportStar(require("./internal/versions.js"), exports);
|
|
22
|
+
var generator_js_1 = require("./generators/init/generator.js");
|
|
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; } });
|
|
27
|
+
var code_pushup_config_js_1 = require("./generators/configuration/code-pushup-config.js");
|
|
28
|
+
Object.defineProperty(exports, "generateCodePushupConfig", { enumerable: true, get: function () { return code_pushup_config_js_1.generateCodePushupConfig; } });
|
|
29
|
+
var index_js_2 = require("./plugin/index.js");
|
|
30
|
+
Object.defineProperty(exports, "createNodes", { enumerable: true, get: function () { return index_js_2.createNodes; } });
|
|
31
|
+
var execute_process_js_1 = require("./internal/execute-process.js");
|
|
32
|
+
Object.defineProperty(exports, "executeProcess", { enumerable: true, get: function () { return execute_process_js_1.executeProcess; } });
|
|
33
|
+
var cli_js_1 = require("./executors/internal/cli.js");
|
|
34
|
+
Object.defineProperty(exports, "objectToCliArgs", { enumerable: true, get: function () { return cli_js_1.objectToCliArgs; } });
|
|
22
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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/nx-plugin/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAAgD;AAEhD,qCAAqC;AACrC,kBAAe,sBAAW,CAAC;AAE3B,yDAAuC;AAEvC,+DAA8E;AAArE,6GAAA,aAAa,OAAA;AAAE,6GAAA,aAAa,OAAA;AAErC,wEAAiF;AAAxE,sHAAA,sBAAsB,OAAA;AAC/B,0FAA4F;AAAnF,iIAAA,wBAAwB,OAAA;AACjC,8CAAgD;AAAvC,uGAAA,WAAW,OAAA;AACpB,oEAGuC;AAFrC,oHAAA,cAAc,OAAA;AAGhB,sDAA8D;AAArD,yGAAA,eAAe,OAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProcessError = void 0;
|
|
4
|
+
exports.calcDuration = calcDuration;
|
|
5
|
+
exports.executeProcess = executeProcess;
|
|
4
6
|
const node_child_process_1 = require("node:child_process");
|
|
5
7
|
function calcDuration(start, stop) {
|
|
6
8
|
return Math.round((stop ?? performance.now()) - start);
|
|
7
9
|
}
|
|
8
|
-
exports.calcDuration = calcDuration;
|
|
9
10
|
/**
|
|
10
11
|
* Error class for process errors.
|
|
11
12
|
* Contains additional information about the process result.
|
|
@@ -100,5 +101,4 @@ function executeProcess(cfg) {
|
|
|
100
101
|
});
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
|
-
exports.executeProcess = executeProcess;
|
|
104
104
|
//# sourceMappingURL=execute-process.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-process.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/internal/execute-process.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"execute-process.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/internal/execute-process.ts"],"names":[],"mappings":";;;AAEA,oCAEC;AAqID,wCAuCC;AAhLD,2DAA2C;AAE3C,SAAgB,YAAY,CAAC,KAAa,EAAE,IAAa;IACvD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,IAAI,WAAW,CAAC,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;AACzD,CAAC;AAkBD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,YAAa,SAAQ,KAAK;IACrC,IAAI,CAAgB;IACpB,MAAM,CAAS;IACf,MAAM,CAAS;IAEf,YAAY,MAAqB;QAC/B,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;CACF;AAXD,oCAWC;AA0DD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,cAAc,CAAC,GAAkB;IAC/C,MAAM,EAAE,QAAQ,EAAE,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AC;YACxD,IAAI,IAAI,KAAK,CAAC,IAAI,cAAc,EAAE,CAAC;gBACjC,UAAU,EAAE,EAAE,CAAC;gBACf,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,MAAM,QAAQ,GAAG,IAAI,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;gBACxE,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC;gBACpB,MAAM,CAAC,QAAQ,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/src/internal/versions.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.cpCliVersion = exports.cpUtilsVersion = exports.cpModelVersion = exports.cpNxPluginVersion = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const workspaceRoot =
|
|
7
|
-
const projectsFolder =
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const workspaceRoot = path.join(__dirname, '../../');
|
|
7
|
+
const projectsFolder = path.join(__dirname, '../../../');
|
|
8
8
|
exports.cpNxPluginVersion = loadPackageJson(workspaceRoot).version;
|
|
9
|
-
exports.cpModelVersion = loadPackageJson(
|
|
10
|
-
exports.cpUtilsVersion = loadPackageJson(
|
|
11
|
-
exports.cpCliVersion = loadPackageJson(
|
|
9
|
+
exports.cpModelVersion = loadPackageJson(path.join(projectsFolder, 'cli')).version;
|
|
10
|
+
exports.cpUtilsVersion = loadPackageJson(path.join(projectsFolder, 'utils')).version;
|
|
11
|
+
exports.cpCliVersion = loadPackageJson(path.join(projectsFolder, 'models')).version;
|
|
12
12
|
function loadPackageJson(folderPath) {
|
|
13
|
-
return (0, devkit_1.readJsonFile)(
|
|
13
|
+
return (0, devkit_1.readJsonFile)(path.join(folderPath, 'package.json'));
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=versions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/internal/versions.ts"],"names":[],"mappings":";;;AAAA,uCAA0C;AAC1C,
|
|
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"}
|
package/src/plugin/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createNodes } from './plugin';
|
|
2
|
-
export type { CreateNodesOptions } from './types';
|
|
1
|
+
export { createNodes } from './plugin.js';
|
|
2
|
+
export type { CreateNodesOptions } from './types.js';
|
package/src/plugin/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodes = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "createNodes", { enumerable: true, get: function () { return
|
|
4
|
+
var plugin_js_1 = require("./plugin.js");
|
|
5
|
+
Object.defineProperty(exports, "createNodes", { enumerable: true, get: function () { return plugin_js_1.createNodes; } });
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/src/plugin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/plugin/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/plugin/index.ts"],"names":[],"mappings":";;;AAAA,yCAA0C;AAAjC,wGAAA,WAAW,OAAA"}
|
package/src/plugin/plugin.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNodes = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const constants_js_1 = require("../internal/constants.js");
|
|
5
|
+
const targets_js_1 = require("./target/targets.js");
|
|
6
|
+
const utils_js_1 = require("./utils.js");
|
|
7
7
|
// name has to be "createNodes" to get picked up by Nx
|
|
8
8
|
exports.createNodes = [
|
|
9
|
-
`**/${
|
|
9
|
+
`**/${constants_js_1.PROJECT_JSON_FILE_NAME}`,
|
|
10
10
|
async (projectConfigurationFile, createNodesOptions, context) => {
|
|
11
11
|
const parsedCreateNodesOptions = createNodesOptions;
|
|
12
|
-
const normalizedContext = await (0,
|
|
12
|
+
const normalizedContext = await (0, utils_js_1.normalizedCreateNodesContext)(context, projectConfigurationFile, parsedCreateNodesOptions);
|
|
13
13
|
return {
|
|
14
14
|
projects: {
|
|
15
15
|
[normalizedContext.projectRoot]: {
|
|
16
|
-
targets: await (0,
|
|
16
|
+
targets: await (0, targets_js_1.createTargets)(normalizedContext),
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
};
|
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":";;;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/plugin/plugin.ts"],"names":[],"mappings":";;;AAKA,2DAAkE;AAClE,oDAAoD;AAEpD,yCAA0D;AAE1D,sDAAsD;AACzC,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,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createConfigurationTarget =
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
3
|
+
exports.createConfigurationTarget = createConfigurationTarget;
|
|
4
|
+
const cli_js_1 = require("../../executors/internal/cli.js");
|
|
5
|
+
const constants_js_1 = require("../../internal/constants.js");
|
|
6
|
+
const constants_js_2 = require("../constants.js");
|
|
7
7
|
function createConfigurationTarget(options) {
|
|
8
|
-
const { projectName, bin =
|
|
8
|
+
const { projectName, bin = constants_js_1.PACKAGE_NAME, targetName = constants_js_2.CP_TARGET_NAME, } = options ?? {};
|
|
9
9
|
return {
|
|
10
|
-
command: `nx g ${bin}:configuration ${(0,
|
|
10
|
+
command: `nx g ${bin}:configuration ${(0, cli_js_1.objectToCliArgs)({
|
|
11
11
|
skipTarget: true,
|
|
12
12
|
targetName,
|
|
13
13
|
...(projectName ? { project: projectName } : {}),
|
|
14
14
|
}).join(' ')}`,
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
exports.createConfigurationTarget = createConfigurationTarget;
|
|
18
17
|
//# sourceMappingURL=configuration-target.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration-target.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/plugin/target/configuration-target.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configuration-target.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/plugin/target/configuration-target.ts"],"names":[],"mappings":";;AAMA,8DAiBC;AArBD,4DAAkE;AAClE,8DAA2D;AAC3D,kDAAiD;AAEjD,SAAgB,yBAAyB,CAAC,OAIzC;IACC,MAAM,EACJ,WAAW,EACX,GAAG,GAAG,2BAAY,EAClB,UAAU,GAAG,6BAAc,GAC5B,GAAG,OAAO,IAAI,EAAE,CAAC;IAClB,OAAO;QACL,OAAO,EAAE,QAAQ,GAAG,kBAAkB,IAAA,wBAAe,EAAC;YACpD,UAAU,EAAE,IAAI;YAChB,UAAU;YACV,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACjD,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;KACf,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TargetConfiguration } from '@nx/devkit';
|
|
2
|
-
import type { ProjectPrefixOptions } from '../types';
|
|
2
|
+
import type { ProjectPrefixOptions } from '../types.js';
|
|
3
3
|
export declare function createExecutorTarget(options?: {
|
|
4
4
|
bin?: string;
|
|
5
5
|
projectPrefix?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createExecutorTarget =
|
|
4
|
-
const
|
|
3
|
+
exports.createExecutorTarget = createExecutorTarget;
|
|
4
|
+
const constants_js_1 = require("../../internal/constants.js");
|
|
5
5
|
function createExecutorTarget(options) {
|
|
6
|
-
const { bin =
|
|
6
|
+
const { bin = constants_js_1.PACKAGE_NAME, projectPrefix } = options ?? {};
|
|
7
7
|
return {
|
|
8
8
|
executor: `${bin}:cli`,
|
|
9
9
|
...(projectPrefix
|
|
@@ -15,5 +15,4 @@ function createExecutorTarget(options) {
|
|
|
15
15
|
: {}),
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
exports.createExecutorTarget = createExecutorTarget;
|
|
19
18
|
//# sourceMappingURL=executor-target.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor-target.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/plugin/target/executor-target.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor-target.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/plugin/target/executor-target.ts"],"names":[],"mappings":";;AAIA,oDAeC;AAlBD,8DAA2D;AAG3D,SAAgB,oBAAoB,CAAC,OAGpC;IACC,MAAM,EAAE,GAAG,GAAG,2BAAY,EAAE,aAAa,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAC5D,OAAO;QACL,QAAQ,EAAE,GAAG,GAAG,MAAM;QACtB,GAAG,CAAC,aAAa;YACf,CAAC,CAAC;gBACE,OAAO,EAAE;oBACP,aAAa;iBACd;aACF;YACH,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { NormalizedCreateNodesContext } from '../types';
|
|
1
|
+
import type { NormalizedCreateNodesContext } from '../types.js';
|
|
2
2
|
export declare function createTargets(normalizedContext: NormalizedCreateNodesContext): Promise<{
|
|
3
|
-
[x: string]: import("@nx/devkit").TargetConfiguration<import("../types").ProjectPrefixOptions>;
|
|
3
|
+
[x: string]: import("@nx/devkit").TargetConfiguration<import("../types.js").ProjectPrefixOptions>;
|
|
4
4
|
} | {
|
|
5
|
-
[x: string]: import("@nx/devkit").TargetConfiguration<import("nx/src/executors/run-commands/run-commands.impl").RunCommandsOptions>;
|
|
5
|
+
[x: string]: import("@nx/devkit").TargetConfiguration<import("nx/src/executors/run-commands/run-commands.impl.js").RunCommandsOptions>;
|
|
6
6
|
}>;
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTargets =
|
|
3
|
+
exports.createTargets = createTargets;
|
|
4
4
|
const promises_1 = require("node:fs/promises");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
5
|
+
const constants_js_1 = require("../constants.js");
|
|
6
|
+
const configuration_target_js_1 = require("./configuration-target.js");
|
|
7
|
+
const constants_js_2 = require("./constants.js");
|
|
8
|
+
const executor_target_js_1 = require("./executor-target.js");
|
|
9
9
|
async function createTargets(normalizedContext) {
|
|
10
|
-
const { targetName =
|
|
10
|
+
const { targetName = constants_js_1.CP_TARGET_NAME, bin, projectPrefix, } = normalizedContext.createOptions;
|
|
11
11
|
const rootFiles = await (0, promises_1.readdir)(normalizedContext.projectRoot);
|
|
12
|
-
return rootFiles.some(filename => filename.match(
|
|
12
|
+
return rootFiles.some(filename => filename.match(constants_js_2.CODE_PUSHUP_CONFIG_REGEX))
|
|
13
13
|
? {
|
|
14
|
-
[targetName]: (0,
|
|
14
|
+
[targetName]: (0, executor_target_js_1.createExecutorTarget)({ bin, projectPrefix }),
|
|
15
15
|
}
|
|
16
16
|
: // if NO code-pushup.config.*.(ts|js|mjs) is present return configuration target
|
|
17
17
|
{
|
|
18
|
-
[`${targetName}--configuration`]: (0,
|
|
18
|
+
[`${targetName}--configuration`]: (0, configuration_target_js_1.createConfigurationTarget)({
|
|
19
19
|
targetName,
|
|
20
20
|
projectName: normalizedContext.projectJson.name,
|
|
21
21
|
bin,
|
|
22
22
|
}),
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
exports.createTargets = createTargets;
|
|
26
25
|
//# sourceMappingURL=targets.js.map
|
|
@@ -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":";;AAOA,sCAqBC;AA5BD,+CAA2C;AAC3C,kDAAiD;AAEjD,uEAAsE;AACtE,iDAA0D;AAC1D,6DAA4D;AAErD,KAAK,UAAU,aAAa,CACjC,iBAA+C;IAE/C,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,6 +1,6 @@
|
|
|
1
1
|
import type { CreateNodesContext, ProjectConfiguration } from '@nx/devkit';
|
|
2
2
|
import type { WithRequired } from '@code-pushup/utils';
|
|
3
|
-
import type { DynamicTargetOptions } from '../internal/types';
|
|
3
|
+
import type { DynamicTargetOptions } from '../internal/types.js';
|
|
4
4
|
export type ProjectPrefixOptions = {
|
|
5
5
|
projectPrefix?: string;
|
|
6
6
|
};
|
package/src/plugin/utils.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CreateNodesContext } from '@nx/devkit';
|
|
2
|
-
import type { CreateNodesOptions, NormalizedCreateNodesContext } from './types';
|
|
2
|
+
import type { CreateNodesOptions, NormalizedCreateNodesContext } from './types.js';
|
|
3
3
|
export declare function normalizedCreateNodesContext(context: CreateNodesContext, projectConfigurationFile: string, createOptions?: CreateNodesOptions): Promise<NormalizedCreateNodesContext>;
|
package/src/plugin/utils.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizedCreateNodesContext =
|
|
3
|
+
exports.normalizedCreateNodesContext = normalizedCreateNodesContext;
|
|
4
4
|
const promises_1 = require("node:fs/promises");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const path = require("node:path");
|
|
6
|
+
const constants_js_1 = require("./constants.js");
|
|
7
7
|
async function normalizedCreateNodesContext(context, projectConfigurationFile, createOptions = {}) {
|
|
8
|
-
const projectRoot =
|
|
8
|
+
const projectRoot = path.dirname(projectConfigurationFile);
|
|
9
9
|
try {
|
|
10
10
|
const projectJson = JSON.parse((await (0, promises_1.readFile)(projectConfigurationFile)).toString());
|
|
11
|
-
const { targetName =
|
|
11
|
+
const { targetName = constants_js_1.CP_TARGET_NAME } = createOptions;
|
|
12
12
|
return {
|
|
13
13
|
...context,
|
|
14
14
|
projectJson,
|
|
@@ -23,5 +23,4 @@ async function normalizedCreateNodesContext(context, projectConfigurationFile, c
|
|
|
23
23
|
throw new Error(`Error parsing project.json file ${projectConfigurationFile}.`);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
exports.normalizedCreateNodesContext = normalizedCreateNodesContext;
|
|
27
26
|
//# 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":";;AAUA,oEA2BC;AApCD,+CAA4C;AAC5C,kCAAkC;AAClC,iDAAgD;AAOzC,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,mBAAQ,EAAC,wBAAwB,CAAC,CAAC,CAAC,QAAQ,EAAE,CACtB,CAAC;QAElC,MAAM,EAAE,UAAU,GAAG,6BAAc,EAAE,GAAG,aAAa,CAAC;QACtD,OAAO;YACL,GAAG,OAAO;YACV,WAAW;YACX,WAAW;YACX,aAAa,EAAE;gBACb,GAAG,aAAa;gBAChB,UAAU;aACX;SACF,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,mCAAmC,wBAAwB,GAAG,CAC/D,CAAC;IACJ,CAAC;AACH,CAAC"}
|