@code-pushup/cli 0.8.16 → 0.8.17

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 CHANGED
@@ -1725,7 +1725,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
1725
1725
 
1726
1726
  // packages/core/package.json
1727
1727
  var name = "@code-pushup/core";
1728
- var version = "0.8.16";
1728
+ var version = "0.8.17";
1729
1729
 
1730
1730
  // packages/core/src/lib/implementation/collect.ts
1731
1731
  async function collect(options2) {
@@ -1895,7 +1895,7 @@ async function readCodePushupConfig(filepath) {
1895
1895
  var CLI_NAME = "Code PushUp CLI";
1896
1896
  var CLI_SCRIPT_NAME = "code-pushup";
1897
1897
 
1898
- // packages/cli/src/lib/implementation/only-plugins-options.ts
1898
+ // packages/cli/src/lib/implementation/only-plugins.options.ts
1899
1899
  var onlyPluginsOption = {
1900
1900
  describe: "List of plugins to run. If not set all plugins are run.",
1901
1901
  type: "array",
@@ -1955,7 +1955,7 @@ function yargsCollectCommandObject() {
1955
1955
  };
1956
1956
  }
1957
1957
 
1958
- // packages/cli/src/lib/implementation/filter-kebab-case-keys.ts
1958
+ // packages/cli/src/lib/implementation/global.utils.ts
1959
1959
  function filterKebabCaseKeys(obj) {
1960
1960
  return Object.entries(obj).filter(([key]) => !key.includes("-")).reduce(
1961
1961
  (acc, [key, value]) => typeof value === "string" || typeof value === "object" && Array.isArray(obj[key]) ? { ...acc, [key]: value } : typeof value === "object" && !Array.isArray(value) && value != null ? {
@@ -1965,6 +1965,22 @@ function filterKebabCaseKeys(obj) {
1965
1965
  {}
1966
1966
  );
1967
1967
  }
1968
+ function logErrorBeforeThrow(fn) {
1969
+ return async (...args) => {
1970
+ try {
1971
+ return await fn(...args);
1972
+ } catch (error) {
1973
+ console.error(error);
1974
+ await new Promise((resolve) => process.stdout.write("", resolve));
1975
+ throw error;
1976
+ }
1977
+ };
1978
+ }
1979
+ function coerceArray(param = []) {
1980
+ return [
1981
+ ...new Set(toArray(param).flatMap((f) => f.split(",")) || [])
1982
+ ];
1983
+ }
1968
1984
 
1969
1985
  // packages/cli/src/lib/print-config/print-config-command.ts
1970
1986
  function yargsConfigCommandObject() {
@@ -2014,7 +2030,7 @@ var commands = [
2014
2030
  yargsConfigCommandObject()
2015
2031
  ];
2016
2032
 
2017
- // packages/cli/src/lib/implementation/only-plugins-utils.ts
2033
+ // packages/cli/src/lib/implementation/only-plugins.utils.ts
2018
2034
  import chalk8 from "chalk";
2019
2035
  function filterPluginsByOnlyPluginsOption(plugins, { onlyPlugins }) {
2020
2036
  if (!onlyPlugins?.length) {
@@ -2057,26 +2073,8 @@ function validateOnlyPluginsOption(plugins, {
2057
2073
  }
2058
2074
  }
2059
2075
 
2060
- // packages/cli/src/lib/implementation/utils.ts
2061
- function logErrorBeforeThrow(fn) {
2062
- return async (...args) => {
2063
- try {
2064
- return await fn(...args);
2065
- } catch (error) {
2066
- console.error(error);
2067
- await new Promise((resolve) => process.stdout.write("", resolve));
2068
- throw error;
2069
- }
2070
- };
2071
- }
2072
- function coerceArray(param = []) {
2073
- return [
2074
- ...new Set(toArray(param).flatMap((f) => f.split(",")) || [])
2075
- ];
2076
- }
2077
-
2078
- // packages/cli/src/lib/implementation/config-middleware.ts
2079
- async function configMiddleware(processArgs) {
2076
+ // packages/cli/src/lib/implementation/core-config.middleware.ts
2077
+ async function coreConfigMiddleware(processArgs) {
2080
2078
  const args = processArgs;
2081
2079
  const { config, ...cliOptions } = args;
2082
2080
  const importedRc = await readCodePushupConfig(config);
@@ -2111,10 +2109,10 @@ async function configMiddleware(processArgs) {
2111
2109
 
2112
2110
  // packages/cli/src/lib/middlewares.ts
2113
2111
  var middlewares = [
2114
- { middlewareFunction: configMiddleware }
2112
+ { middlewareFunction: coreConfigMiddleware }
2115
2113
  ];
2116
2114
 
2117
- // packages/cli/src/lib/implementation/core-config-options.ts
2115
+ // packages/cli/src/lib/implementation/core-config.options.ts
2118
2116
  function yargsCoreConfigOptionsDefinition() {
2119
2117
  return {
2120
2118
  // persist
@@ -2162,7 +2160,7 @@ function yargsUploadConfigOptionsDefinition() {
2162
2160
  };
2163
2161
  }
2164
2162
 
2165
- // packages/cli/src/lib/implementation/global-options.ts
2163
+ // packages/cli/src/lib/implementation/global.options.ts
2166
2164
  function yargsGlobalOptionsDefinition() {
2167
2165
  return {
2168
2166
  progress: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-pushup/cli",
3
- "version": "0.8.16",
3
+ "version": "0.8.17",
4
4
  "bin": {
5
5
  "code-pushup": "index.js"
6
6
  },
@@ -1,6 +1,7 @@
1
1
  import { CoreConfig } from '@code-pushup/models';
2
- import { GeneralCliOptions, OnlyPluginsOptions } from './model';
3
- export declare function configMiddleware<T extends Partial<GeneralCliOptions & CoreConfig & OnlyPluginsOptions>>(processArgs: T): Promise<{
2
+ import { GeneralCliOptions } from './global.model';
3
+ import { OnlyPluginsOptions } from './only-plugins.model';
4
+ export declare function coreConfigMiddleware<T extends Partial<GeneralCliOptions & CoreConfig & OnlyPluginsOptions>>(processArgs: T): Promise<{
4
5
  categories: {
5
6
  slug: string;
6
7
  refs: {
@@ -1,8 +1,4 @@
1
- import { GlobalOptions } from '@code-pushup/core';
2
1
  import { Format } from '@code-pushup/models';
3
- export type GeneralCliOptions = {
4
- config: string;
5
- } & GlobalOptions;
6
2
  export type PersistConfigCliOptions = {
7
3
  'persist.outputDir': string;
8
4
  'persist.filename': string;
@@ -15,6 +11,3 @@ export type UploadConfigCliOptions = {
15
11
  'upload.server': string;
16
12
  };
17
13
  export type CoreConfigCliOptions = PersistConfigCliOptions & UploadConfigCliOptions;
18
- export type OnlyPluginsOptions = {
19
- onlyPlugins: string[];
20
- };
@@ -1,5 +1,5 @@
1
1
  import { Options } from 'yargs';
2
- import { CoreConfigCliOptions, PersistConfigCliOptions, UploadConfigCliOptions } from './model';
2
+ import { CoreConfigCliOptions, PersistConfigCliOptions, UploadConfigCliOptions } from './core-config.model';
3
3
  export declare function yargsCoreConfigOptionsDefinition(): Record<keyof CoreConfigCliOptions, Options>;
4
4
  export declare function yargsPersistConfigOptionsDefinition(): Record<keyof PersistConfigCliOptions, Options>;
5
5
  export declare function yargsUploadConfigOptionsDefinition(): Record<keyof UploadConfigCliOptions, Options>;
@@ -0,0 +1,4 @@
1
+ import { GlobalOptions } from '@code-pushup/core';
2
+ export type GeneralCliOptions = {
3
+ config: string;
4
+ } & GlobalOptions;
@@ -1,3 +1,3 @@
1
1
  import { Options } from 'yargs';
2
- import { GeneralCliOptions } from './model';
2
+ import { GeneralCliOptions } from './global.model';
3
3
  export declare function yargsGlobalOptionsDefinition(): Record<keyof GeneralCliOptions, Options>;
@@ -1,2 +1,3 @@
1
+ export declare function filterKebabCaseKeys<T extends Record<string, unknown>>(obj: T): T;
1
2
  export declare function logErrorBeforeThrow<T extends (...args: any[]) => any>(fn: T): T;
2
3
  export declare function coerceArray<T extends string>(param?: T | T[]): T[];
@@ -0,0 +1,3 @@
1
+ export type OnlyPluginsOptions = {
2
+ onlyPlugins: string[];
3
+ };
@@ -1 +0,0 @@
1
- export declare function filterKebabCaseKeys<T extends Record<string, unknown>>(obj: T): T;