@code-pushup/cli 0.10.1 → 0.10.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/index.js +20 -24
- package/package.json +1 -1
- package/src/lib/implementation/core-config.middleware.d.ts +1 -3
- package/src/lib/implementation/core-config.model.d.ts +4 -1
- package/src/lib/implementation/core-config.options.d.ts +2 -2
- package/src/lib/implementation/global.model.d.ts +2 -3
- package/src/lib/implementation/only-plugins.middleware.d.ts +1 -3
package/index.js
CHANGED
|
@@ -1688,7 +1688,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
|
|
|
1688
1688
|
|
|
1689
1689
|
// packages/core/package.json
|
|
1690
1690
|
var name = "@code-pushup/core";
|
|
1691
|
-
var version = "0.10.
|
|
1691
|
+
var version = "0.10.2";
|
|
1692
1692
|
|
|
1693
1693
|
// packages/core/src/lib/implementation/collect.ts
|
|
1694
1694
|
async function collect(options2) {
|
|
@@ -1939,11 +1939,6 @@ function logErrorBeforeThrow(fn) {
|
|
|
1939
1939
|
}
|
|
1940
1940
|
};
|
|
1941
1941
|
}
|
|
1942
|
-
function coerceArray(param = []) {
|
|
1943
|
-
return [
|
|
1944
|
-
...new Set(toArray(param).flatMap((f) => f.split(",")) || [])
|
|
1945
|
-
];
|
|
1946
|
-
}
|
|
1947
1942
|
|
|
1948
1943
|
// packages/cli/src/lib/print-config/print-config-command.ts
|
|
1949
1944
|
function yargsConfigCommandObject() {
|
|
@@ -1996,25 +1991,30 @@ var commands = [
|
|
|
1996
1991
|
// packages/cli/src/lib/implementation/core-config.middleware.ts
|
|
1997
1992
|
async function coreConfigMiddleware(processArgs) {
|
|
1998
1993
|
const args = processArgs;
|
|
1999
|
-
const {
|
|
2000
|
-
|
|
1994
|
+
const {
|
|
1995
|
+
config,
|
|
1996
|
+
persist: cliPersist,
|
|
1997
|
+
upload: cliUpload,
|
|
1998
|
+
...remainingCliOptions
|
|
1999
|
+
} = args;
|
|
2000
|
+
const rcOptions = await readCodePushupConfig(config);
|
|
2001
|
+
const {
|
|
2002
|
+
persist: rcPersist,
|
|
2003
|
+
upload: rcUpload,
|
|
2004
|
+
...remainingRcConfig
|
|
2005
|
+
} = rcOptions;
|
|
2001
2006
|
const parsedProcessArgs = {
|
|
2002
2007
|
config,
|
|
2003
|
-
...
|
|
2004
|
-
...
|
|
2008
|
+
...remainingRcConfig,
|
|
2009
|
+
...remainingCliOptions,
|
|
2005
2010
|
upload: {
|
|
2006
|
-
...
|
|
2007
|
-
...
|
|
2011
|
+
...rcUpload,
|
|
2012
|
+
...cliUpload
|
|
2008
2013
|
},
|
|
2009
|
-
// we can't use a async rc file as yargs does not support it. see: https://github.com/yargs/yargs/issues/2234
|
|
2010
|
-
// therefore this can't live in option defaults as the order would be `config`->`provided options`->default
|
|
2011
|
-
// so we have to manually implement the order
|
|
2012
2014
|
persist: {
|
|
2013
|
-
outputDir:
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
cliOptions.persist?.format ?? importedRc.persist?.format ?? PERSIST_FORMAT
|
|
2017
|
-
)
|
|
2015
|
+
outputDir: cliPersist?.outputDir ?? rcPersist?.outputDir ?? PERSIST_OUTPUT_DIR,
|
|
2016
|
+
format: cliPersist?.format ?? rcPersist?.format ?? PERSIST_FORMAT,
|
|
2017
|
+
filename: cliPersist?.filename ?? rcPersist?.filename ?? PERSIST_FILENAME
|
|
2018
2018
|
}
|
|
2019
2019
|
};
|
|
2020
2020
|
return parsedProcessArgs;
|
|
@@ -2091,15 +2091,12 @@ var middlewares = [
|
|
|
2091
2091
|
// packages/cli/src/lib/implementation/core-config.options.ts
|
|
2092
2092
|
function yargsCoreConfigOptionsDefinition() {
|
|
2093
2093
|
return {
|
|
2094
|
-
// persist
|
|
2095
2094
|
...yargsPersistConfigOptionsDefinition(),
|
|
2096
|
-
// upload
|
|
2097
2095
|
...yargsUploadConfigOptionsDefinition()
|
|
2098
2096
|
};
|
|
2099
2097
|
}
|
|
2100
2098
|
function yargsPersistConfigOptionsDefinition() {
|
|
2101
2099
|
return {
|
|
2102
|
-
// persist
|
|
2103
2100
|
"persist.outputDir": {
|
|
2104
2101
|
describe: "Directory for the produced reports",
|
|
2105
2102
|
type: "string"
|
|
@@ -2116,7 +2113,6 @@ function yargsPersistConfigOptionsDefinition() {
|
|
|
2116
2113
|
}
|
|
2117
2114
|
function yargsUploadConfigOptionsDefinition() {
|
|
2118
2115
|
return {
|
|
2119
|
-
// upload
|
|
2120
2116
|
"upload.organization": {
|
|
2121
2117
|
describe: "Organization slug from portal",
|
|
2122
2118
|
type: "string"
|
package/package.json
CHANGED
|
@@ -222,6 +222,4 @@ export declare function coreConfigMiddleware<T extends Partial<GeneralCliOptions
|
|
|
222
222
|
project: string;
|
|
223
223
|
timeout?: number | undefined;
|
|
224
224
|
} | undefined;
|
|
225
|
-
} &
|
|
226
|
-
config: string;
|
|
227
|
-
} & import("@code-pushup/core").GlobalOptions>;
|
|
225
|
+
} & import("./core-config.model").ConfigCliOptions & import("@code-pushup/core").GlobalOptions>;
|
|
@@ -10,4 +10,7 @@ export type UploadConfigCliOptions = {
|
|
|
10
10
|
'upload.apiKey': string;
|
|
11
11
|
'upload.server': string;
|
|
12
12
|
};
|
|
13
|
-
export type
|
|
13
|
+
export type ConfigCliOptions = {
|
|
14
|
+
config: string;
|
|
15
|
+
};
|
|
16
|
+
export type CoreConfigCliOptions = ConfigCliOptions & PersistConfigCliOptions & UploadConfigCliOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Options } from 'yargs';
|
|
2
|
-
import {
|
|
3
|
-
export declare function yargsCoreConfigOptionsDefinition(): Record<keyof
|
|
2
|
+
import { PersistConfigCliOptions, UploadConfigCliOptions } from './core-config.model';
|
|
3
|
+
export declare function yargsCoreConfigOptionsDefinition(): Record<keyof (PersistConfigCliOptions & UploadConfigCliOptions), Options>;
|
|
4
4
|
export declare function yargsPersistConfigOptionsDefinition(): Record<keyof PersistConfigCliOptions, Options>;
|
|
5
5
|
export declare function yargsUploadConfigOptionsDefinition(): Record<keyof UploadConfigCliOptions, Options>;
|
|
@@ -223,6 +223,4 @@ export declare function onlyPluginsMiddleware<T extends Partial<GeneralCliOption
|
|
|
223
223
|
project: string;
|
|
224
224
|
timeout?: number | undefined;
|
|
225
225
|
} | undefined;
|
|
226
|
-
} &
|
|
227
|
-
config: string;
|
|
228
|
-
} & import("@code-pushup/core").GlobalOptions & OnlyPluginsOptions;
|
|
226
|
+
} & import("./core-config.model").ConfigCliOptions & import("@code-pushup/core").GlobalOptions & OnlyPluginsOptions;
|