@code-pushup/core 0.4.5 → 0.5.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
CHANGED
|
@@ -129,12 +129,14 @@ function scorableSchema(description, refSchema, duplicateCheckFn, duplicateMessa
|
|
|
129
129
|
return z.object(
|
|
130
130
|
{
|
|
131
131
|
slug: slugSchema('Human-readable unique ID, e.g. "performance"'),
|
|
132
|
-
refs: z.array(refSchema).refine(
|
|
132
|
+
refs: z.array(refSchema).min(1).refine(
|
|
133
133
|
(refs) => !duplicateCheckFn(refs),
|
|
134
134
|
(refs) => ({
|
|
135
135
|
message: duplicateMessageFn(refs)
|
|
136
136
|
})
|
|
137
|
-
)
|
|
137
|
+
).refine(hasWeightedRefsInCategories, () => ({
|
|
138
|
+
message: `In a category there has to be at least one ref with weight > 0`
|
|
139
|
+
}))
|
|
138
140
|
},
|
|
139
141
|
{ description }
|
|
140
142
|
);
|
|
@@ -143,6 +145,9 @@ var materialIconSchema = z.enum(
|
|
|
143
145
|
MATERIAL_ICONS,
|
|
144
146
|
{ description: "Icon from VSCode Material Icons extension" }
|
|
145
147
|
);
|
|
148
|
+
function hasWeightedRefsInCategories(categoryRefs) {
|
|
149
|
+
return categoryRefs.reduce((acc, { weight }) => weight + acc, 0) !== 0;
|
|
150
|
+
}
|
|
146
151
|
|
|
147
152
|
// packages/models/src/lib/category-config.ts
|
|
148
153
|
var categoryRefSchema = weightedRefSchema(
|
|
@@ -188,6 +193,23 @@ function getDuplicateRefsInCategoryMetrics(metrics) {
|
|
|
188
193
|
metrics.map(({ slug, type, plugin }) => `${type} :: ${plugin} / ${slug}`)
|
|
189
194
|
);
|
|
190
195
|
}
|
|
196
|
+
var categoriesSchema = z2.array(categoryConfigSchema, {
|
|
197
|
+
description: "Categorization of individual audits"
|
|
198
|
+
}).min(1).refine(
|
|
199
|
+
(categoryCfg) => !getDuplicateSlugCategories(categoryCfg),
|
|
200
|
+
(categoryCfg) => ({
|
|
201
|
+
message: duplicateSlugCategoriesErrorMsg(categoryCfg)
|
|
202
|
+
})
|
|
203
|
+
);
|
|
204
|
+
function duplicateSlugCategoriesErrorMsg(categories) {
|
|
205
|
+
const duplicateStringSlugs = getDuplicateSlugCategories(categories);
|
|
206
|
+
return `In the categories, the following slugs are duplicated: ${errorItems(
|
|
207
|
+
duplicateStringSlugs
|
|
208
|
+
)}`;
|
|
209
|
+
}
|
|
210
|
+
function getDuplicateSlugCategories(categories) {
|
|
211
|
+
return hasDuplicateStrings(categories.map(({ slug }) => slug));
|
|
212
|
+
}
|
|
191
213
|
|
|
192
214
|
// packages/models/src/lib/core-config.ts
|
|
193
215
|
import { z as z11 } from "zod";
|
|
@@ -196,10 +218,10 @@ import { z as z11 } from "zod";
|
|
|
196
218
|
import { z as z3 } from "zod";
|
|
197
219
|
var formatSchema = z3.enum(["json", "md"]);
|
|
198
220
|
var persistConfigSchema = z3.object({
|
|
199
|
-
outputDir: filePathSchema("Artifacts folder"),
|
|
200
|
-
filename: fileNameSchema(
|
|
201
|
-
"
|
|
202
|
-
),
|
|
221
|
+
outputDir: filePathSchema("Artifacts folder").optional(),
|
|
222
|
+
filename: fileNameSchema(
|
|
223
|
+
"Artifacts file name (without extension)"
|
|
224
|
+
).optional(),
|
|
203
225
|
format: z3.array(formatSchema).default(["json"]).optional()
|
|
204
226
|
// @TODO remove default or optional value and otherwise it will not set defaults.
|
|
205
227
|
});
|
|
@@ -435,17 +457,10 @@ var unrefinedCoreConfigSchema = z11.object({
|
|
|
435
457
|
description: "List of plugins to be used (official, community-provided, or custom)"
|
|
436
458
|
}),
|
|
437
459
|
/** portal configuration for persisting results */
|
|
438
|
-
persist: persistConfigSchema,
|
|
460
|
+
persist: persistConfigSchema.optional(),
|
|
439
461
|
/** portal configuration for uploading results */
|
|
440
462
|
upload: uploadConfigSchema.optional(),
|
|
441
|
-
categories:
|
|
442
|
-
description: "Categorization of individual audits"
|
|
443
|
-
}).refine(
|
|
444
|
-
(categoryCfg) => !getDuplicateSlugCategories(categoryCfg),
|
|
445
|
-
(categoryCfg) => ({
|
|
446
|
-
message: duplicateSlugCategoriesErrorMsg(categoryCfg)
|
|
447
|
-
})
|
|
448
|
-
)
|
|
463
|
+
categories: categoriesSchema
|
|
449
464
|
});
|
|
450
465
|
var coreConfigSchema = refineCoreConfig(unrefinedCoreConfigSchema);
|
|
451
466
|
function refineCoreConfig(schema) {
|
|
@@ -496,15 +511,11 @@ function getMissingRefsForCategories(coreCfg) {
|
|
|
496
511
|
}
|
|
497
512
|
return missingRefs.length ? missingRefs : false;
|
|
498
513
|
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
}
|
|
505
|
-
function getDuplicateSlugCategories(categories) {
|
|
506
|
-
return hasDuplicateStrings(categories.map(({ slug }) => slug));
|
|
507
|
-
}
|
|
514
|
+
|
|
515
|
+
// packages/models/src/lib/implementation/constants.ts
|
|
516
|
+
var PERSIST_OUTPUT_DIR = ".code-pushup";
|
|
517
|
+
var PERSIST_FORMAT = ["json"];
|
|
518
|
+
var PERSIST_FILENAME = "report";
|
|
508
519
|
|
|
509
520
|
// packages/models/src/lib/report.ts
|
|
510
521
|
import { z as z12 } from "zod";
|
|
@@ -1391,6 +1402,11 @@ function calculateScore(refs, scoreFn) {
|
|
|
1391
1402
|
},
|
|
1392
1403
|
{ numerator: 0, denominator: 0 }
|
|
1393
1404
|
);
|
|
1405
|
+
if (!numerator && !denominator) {
|
|
1406
|
+
throw new Error(
|
|
1407
|
+
"0 division for score. This can be caused by refs only weighted with 0 or empty refs"
|
|
1408
|
+
);
|
|
1409
|
+
}
|
|
1394
1410
|
return numerator / denominator;
|
|
1395
1411
|
}
|
|
1396
1412
|
function scoreReport(report) {
|
|
@@ -1473,11 +1489,8 @@ var PersistError = class extends Error {
|
|
|
1473
1489
|
super(`fileName: ${reportPath} could not be saved.`);
|
|
1474
1490
|
}
|
|
1475
1491
|
};
|
|
1476
|
-
async function persistReport(report,
|
|
1477
|
-
const {
|
|
1478
|
-
const outputDir = persist.outputDir;
|
|
1479
|
-
const filename = persist.filename;
|
|
1480
|
-
const format = persist.format ?? [];
|
|
1492
|
+
async function persistReport(report, options) {
|
|
1493
|
+
const { outputDir, filename, format } = options;
|
|
1481
1494
|
let scoredReport = scoreReport(report);
|
|
1482
1495
|
console.info(reportToStdout(scoredReport));
|
|
1483
1496
|
const results = [
|
|
@@ -1632,7 +1645,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
|
|
|
1632
1645
|
|
|
1633
1646
|
// packages/core/package.json
|
|
1634
1647
|
var name = "@code-pushup/core";
|
|
1635
|
-
var version = "0.
|
|
1648
|
+
var version = "0.5.2";
|
|
1636
1649
|
|
|
1637
1650
|
// packages/core/src/lib/implementation/collect.ts
|
|
1638
1651
|
async function collect(options) {
|
|
@@ -1730,16 +1743,23 @@ function transformSeverity(severity) {
|
|
|
1730
1743
|
}
|
|
1731
1744
|
}
|
|
1732
1745
|
|
|
1746
|
+
// packages/core/src/lib/normalize.ts
|
|
1747
|
+
var normalizePersistConfig = (cfg) => ({
|
|
1748
|
+
outputDir: PERSIST_OUTPUT_DIR,
|
|
1749
|
+
filename: PERSIST_FILENAME,
|
|
1750
|
+
format: PERSIST_FORMAT,
|
|
1751
|
+
...cfg
|
|
1752
|
+
});
|
|
1753
|
+
|
|
1733
1754
|
// packages/core/src/lib/upload.ts
|
|
1734
1755
|
async function upload(options, uploadFn = uploadToPortal) {
|
|
1735
|
-
|
|
1736
|
-
|
|
1756
|
+
const persist = normalizePersistConfig(options?.persist);
|
|
1757
|
+
if (!options?.upload) {
|
|
1758
|
+
throw new Error("upload config must be set");
|
|
1737
1759
|
}
|
|
1738
1760
|
const { apiKey, server, organization, project } = options.upload;
|
|
1739
|
-
const { outputDir, filename } = options.persist;
|
|
1740
1761
|
const report = await loadReport({
|
|
1741
|
-
|
|
1742
|
-
filename,
|
|
1762
|
+
...persist,
|
|
1743
1763
|
format: "json"
|
|
1744
1764
|
});
|
|
1745
1765
|
const commitData = await getLatestCommit();
|
|
@@ -1759,7 +1779,8 @@ async function upload(options, uploadFn = uploadToPortal) {
|
|
|
1759
1779
|
async function collectAndPersistReports(options) {
|
|
1760
1780
|
const { exec } = verboseUtils(options.verbose);
|
|
1761
1781
|
const report = await collect(options);
|
|
1762
|
-
const
|
|
1782
|
+
const persist = normalizePersistConfig(options?.persist);
|
|
1783
|
+
const persistResults = await persistReport(report, persist);
|
|
1763
1784
|
exec(() => logPersistedResults(persistResults));
|
|
1764
1785
|
report.plugins.forEach((plugin) => {
|
|
1765
1786
|
pluginReportSchema.parse(plugin);
|
|
@@ -1783,7 +1804,7 @@ async function readCodePushupConfig(filepath) {
|
|
|
1783
1804
|
{
|
|
1784
1805
|
filepath
|
|
1785
1806
|
},
|
|
1786
|
-
coreConfigSchema.parse
|
|
1807
|
+
(d) => coreConfigSchema.parse(d)
|
|
1787
1808
|
);
|
|
1788
1809
|
}
|
|
1789
1810
|
export {
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PersistConfig, Report } from '@code-pushup/models';
|
|
2
2
|
import { MultipleFileResults } from '@code-pushup/utils';
|
|
3
3
|
export declare class PersistDirError extends Error {
|
|
4
4
|
constructor(outputDir: string);
|
|
@@ -6,5 +6,5 @@ export declare class PersistDirError extends Error {
|
|
|
6
6
|
export declare class PersistError extends Error {
|
|
7
7
|
constructor(reportPath: string);
|
|
8
8
|
}
|
|
9
|
-
export declare function persistReport(report: Report,
|
|
9
|
+
export declare function persistReport(report: Report, options: Required<PersistConfig>): Promise<MultipleFileResults>;
|
|
10
10
|
export declare function logPersistedResults(persistResults: MultipleFileResults): void;
|
|
@@ -1,225 +1,5 @@
|
|
|
1
|
+
import { CoreConfig } from '@code-pushup/models';
|
|
1
2
|
export declare class ConfigPathError extends Error {
|
|
2
3
|
constructor(configPath: string);
|
|
3
4
|
}
|
|
4
|
-
export declare function readCodePushupConfig(filepath: string): Promise<
|
|
5
|
-
plugins: {
|
|
6
|
-
title: string;
|
|
7
|
-
slug: string;
|
|
8
|
-
icon: "slug" | "search" | "blink" | "folder-robot" | "folder-src" | "folder-dist" | "folder-css" | "folder-sass" | "folder-images" | "folder-scripts" | "folder-node" | "folder-javascript" | "folder-json" | "folder-font" | "folder-bower" | "folder-test" | "folder-jinja" | "folder-markdown" | "folder-php" | "folder-phpmailer" | "folder-sublime" | "folder-docs" | "folder-git" | "folder-github" | "folder-gitlab" | "folder-vscode" | "folder-views" | "folder-vue" | "folder-vuepress" | "folder-expo" | "folder-config" | "folder-i18n" | "folder-components" | "folder-verdaccio" | "folder-aurelia" | "folder-resource" | "folder-lib" | "folder-theme" | "folder-webpack" | "folder-global" | "folder-public" | "folder-include" | "folder-docker" | "folder-database" | "folder-log" | "folder-target" | "folder-temp" | "folder-aws" | "folder-audio" | "folder-video" | "folder-kubernetes" | "folder-import" | "folder-export" | "folder-wakatime" | "folder-circleci" | "folder-wordpress" | "folder-gradle" | "folder-coverage" | "folder-class" | "folder-other" | "folder-lua" | "folder-typescript" | "folder-graphql" | "folder-routes" | "folder-ci" | "folder-benchmark" | "folder-messages" | "folder-less" | "folder-gulp" | "folder-python" | "folder-mojo" | "folder-debug" | "folder-fastlane" | "folder-plugin" | "folder-middleware" | "folder-controller" | "folder-ansible" | "folder-server" | "folder-client" | "folder-tasks" | "folder-android" | "folder-ios" | "folder-upload" | "folder-download" | "folder-tools" | "folder-helper" | "folder-serverless" | "folder-api" | "folder-app" | "folder-apollo" | "folder-archive" | "folder-batch" | "folder-buildkite" | "folder-cluster" | "folder-command" | "folder-constant" | "folder-container" | "folder-content" | "folder-context" | "folder-core" | "folder-delta" | "folder-dump" | "folder-examples" | "folder-environment" | "folder-functions" | "folder-generator" | "folder-hook" | "folder-job" | "folder-keys" | "folder-layout" | "folder-mail" | "folder-mappings" | "folder-meta" | "folder-changesets" | "folder-packages" | "folder-shared" | "folder-shader" | "folder-stack" | "folder-template" | "folder-utils" | "folder-supabase" | "folder-private" | "folder-error" | "folder-event" | "folder-secure" | "folder-custom" | "folder-mock" | "folder-syntax" | "folder-vm" | "folder-stylus" | "folder-flow" | "folder-rules" | "folder-review" | "folder-animation" | "folder-guard" | "folder-prisma" | "folder-pipe" | "folder-svg" | "folder-terraform" | "folder-mobile" | "folder-stencil" | "folder-firebase" | "folder-svelte" | "folder-update" | "folder-intellij" | "folder-azure-pipelines" | "folder-mjml" | "folder-admin" | "folder-scala" | "folder-connection" | "folder-quasar" | "folder-next" | "folder-cobol" | "folder-yarn" | "folder-husky" | "folder-storybook" | "folder-base" | "folder-cart" | "folder-home" | "folder-project" | "folder-interface" | "folder-netlify" | "folder-enum" | "folder-contract" | "folder-queue" | "folder-vercel" | "folder-cypress" | "folder-decorators" | "folder-java" | "folder-resolver" | "folder-angular" | "folder-unity" | "folder-pdf" | "folder-proto" | "folder-plastic" | "folder-gamemaker" | "folder-mercurial" | "folder-godot" | "folder-robot-open" | "folder-src-open" | "folder-dist-open" | "folder-css-open" | "folder-sass-open" | "folder-images-open" | "folder-scripts-open" | "folder-node-open" | "folder-javascript-open" | "folder-json-open" | "folder-font-open" | "folder-bower-open" | "folder-test-open" | "folder-jinja-open" | "folder-markdown-open" | "folder-php-open" | "folder-phpmailer-open" | "folder-sublime-open" | "folder-docs-open" | "folder-git-open" | "folder-github-open" | "folder-gitlab-open" | "folder-vscode-open" | "folder-views-open" | "folder-vue-open" | "folder-vuepress-open" | "folder-expo-open" | "folder-config-open" | "folder-i18n-open" | "folder-components-open" | "folder-verdaccio-open" | "folder-aurelia-open" | "folder-resource-open" | "folder-lib-open" | "folder-theme-open" | "folder-webpack-open" | "folder-global-open" | "folder-public-open" | "folder-include-open" | "folder-docker-open" | "folder-database-open" | "folder-log-open" | "folder-target-open" | "folder-temp-open" | "folder-aws-open" | "folder-audio-open" | "folder-video-open" | "folder-kubernetes-open" | "folder-import-open" | "folder-export-open" | "folder-wakatime-open" | "folder-circleci-open" | "folder-wordpress-open" | "folder-gradle-open" | "folder-coverage-open" | "folder-class-open" | "folder-other-open" | "folder-lua-open" | "folder-typescript-open" | "folder-graphql-open" | "folder-routes-open" | "folder-ci-open" | "folder-benchmark-open" | "folder-messages-open" | "folder-less-open" | "folder-gulp-open" | "folder-python-open" | "folder-mojo-open" | "folder-debug-open" | "folder-fastlane-open" | "folder-plugin-open" | "folder-middleware-open" | "folder-controller-open" | "folder-ansible-open" | "folder-server-open" | "folder-client-open" | "folder-tasks-open" | "folder-android-open" | "folder-ios-open" | "folder-upload-open" | "folder-download-open" | "folder-tools-open" | "folder-helper-open" | "folder-serverless-open" | "folder-api-open" | "folder-app-open" | "folder-apollo-open" | "folder-archive-open" | "folder-batch-open" | "folder-buildkite-open" | "folder-cluster-open" | "folder-command-open" | "folder-constant-open" | "folder-container-open" | "folder-content-open" | "folder-context-open" | "folder-core-open" | "folder-delta-open" | "folder-dump-open" | "folder-examples-open" | "folder-environment-open" | "folder-functions-open" | "folder-generator-open" | "folder-hook-open" | "folder-job-open" | "folder-keys-open" | "folder-layout-open" | "folder-mail-open" | "folder-mappings-open" | "folder-meta-open" | "folder-changesets-open" | "folder-packages-open" | "folder-shared-open" | "folder-shader-open" | "folder-stack-open" | "folder-template-open" | "folder-utils-open" | "folder-supabase-open" | "folder-private-open" | "folder-error-open" | "folder-event-open" | "folder-secure-open" | "folder-custom-open" | "folder-mock-open" | "folder-syntax-open" | "folder-vm-open" | "folder-stylus-open" | "folder-flow-open" | "folder-rules-open" | "folder-review-open" | "folder-animation-open" | "folder-guard-open" | "folder-prisma-open" | "folder-pipe-open" | "folder-svg-open" | "folder-terraform-open" | "folder-mobile-open" | "folder-stencil-open" | "folder-firebase-open" | "folder-svelte-open" | "folder-update-open" | "folder-intellij-open" | "folder-azure-pipelines-open" | "folder-mjml-open" | "folder-admin-open" | "folder-scala-open" | "folder-connection-open" | "folder-quasar-open" | "folder-next-open" | "folder-cobol-open" | "folder-yarn-open" | "folder-husky-open" | "folder-storybook-open" | "folder-base-open" | "folder-cart-open" | "folder-home-open" | "folder-project-open" | "folder-interface-open" | "folder-netlify-open" | "folder-enum-open" | "folder-contract-open" | "folder-queue-open" | "folder-vercel-open" | "folder-cypress-open" | "folder-decorators-open" | "folder-java-open" | "folder-resolver-open" | "folder-angular-open" | "folder-unity-open" | "folder-pdf-open" | "folder-proto-open" | "folder-plastic-open" | "folder-gamemaker-open" | "folder-mercurial-open" | "folder-godot-open" | "html" | "pug" | "markdown" | "css" | "sass" | "less" | "json" | "jinja" | "proto" | "sublime" | "twine" | "yaml" | "xml" | "image" | "javascript" | "react" | "react_ts" | "routing" | "settings" | "typescript-def" | "markojs" | "astro" | "pdf" | "table" | "vscode" | "visualstudio" | "database" | "kusto" | "csharp" | "qsharp" | "zip" | "vala" | "zig" | "exe" | "hex" | "java" | "jar" | "javaclass" | "c" | "h" | "cpp" | "hpp" | "objective-c" | "objective-cpp" | "rc" | "go" | "python" | "python-misc" | "url" | "console" | "powershell" | "gradle" | "word" | "certificate" | "key" | "font" | "lib" | "ruby" | "fsharp" | "swift" | "arduino" | "docker" | "tex" | "powerpoint" | "video" | "virtual" | "email" | "audio" | "coffee" | "document" | "graphql" | "rust" | "raml" | "xaml" | "haskell" | "kotlin" | "otne" | "git" | "lua" | "clojure" | "groovy" | "r" | "dart" | "dart_generated" | "actionscript" | "mxml" | "autohotkey" | "flash" | "swc" | "cmake" | "assembly" | "vue" | "ocaml" | "odin" | "javascript-map" | "css-map" | "lock" | "handlebars" | "perl" | "haxe" | "test-ts" | "test-jsx" | "test-js" | "angular" | "angular-component" | "angular-guard" | "angular-service" | "angular-pipe" | "angular-directive" | "angular-resolver" | "puppet" | "elixir" | "livescript" | "erlang" | "twig" | "julia" | "elm" | "purescript" | "smarty" | "stylus" | "reason" | "bucklescript" | "merlin" | "verilog" | "mathematica" | "wolframlanguage" | "nunjucks" | "robot" | "solidity" | "autoit" | "haml" | "yang" | "mjml" | "terraform" | "laravel" | "applescript" | "cake" | "cucumber" | "nim" | "apiblueprint" | "riot" | "vfl" | "kl" | "postcss" | "todo" | "coldfusion" | "cabal" | "nix" | "slim" | "http" | "restql" | "kivy" | "graphcool" | "sbt" | "android" | "tune" | "gitlab" | "jenkins" | "figma" | "crystal" | "drone" | "cuda" | "log" | "dotjs" | "ejs" | "wakatime" | "processing" | "storybook" | "wepy" | "hcl" | "san" | "django" | "red" | "makefile" | "foxpro" | "i18n" | "webassembly" | "jupyter" | "d" | "mdx" | "mdsvex" | "ballerina" | "racket" | "bazel" | "mint" | "velocity" | "godot" | "godot-assets" | "azure-pipelines" | "azure" | "vagrant" | "prisma" | "razor" | "abc" | "asciidoc" | "edge" | "scheme" | "lisp" | "3d" | "svg" | "svelte" | "vim" | "moonscript" | "advpl_prw" | "advpl_ptm" | "advpl_tlpp" | "advpl_include" | "disc" | "fortran" | "tcl" | "liquid" | "prolog" | "coconut" | "sketch" | "pawn" | "forth" | "uml" | "meson" | "dhall" | "sml" | "opam" | "imba" | "drawio" | "pascal" | "shaderlab" | "sas" | "nuget" | "command" | "denizenscript" | "nginx" | "minecraft" | "rescript" | "rescript-interface" | "brainfuck" | "bicep" | "cobol" | "grain" | "lolcode" | "idris" | "pipeline" | "opa" | "windicss" | "scala" | "lilypond" | "vlang" | "chess" | "gemini" | "tsconfig" | "tauri" | "jsconfig" | "ada" | "horusec" | "coala" | "dinophp" | "teal" | "template" | "shader" | "siyuan" | "ndst" | "tobi" | "gleam" | "steadybit" | "tree" | "cadence" | "antlr" | "stylable" | "pinejs" | "gamemaker" | "tldraw" | "typst" | "mermaid" | "mojo" | "roblox" | "playwright" | "go-mod" | "gemfile" | "rubocop" | "semgrep" | "vue-config" | "nuxt" | "vercel" | "verdaccio" | "next" | "remix" | "posthtml" | "webpack" | "ionic" | "gulp" | "nodejs" | "npm" | "yarn" | "turborepo" | "babel" | "blitz" | "contributing" | "readme" | "changelog" | "architecture" | "credits" | "authors" | "flow" | "favicon" | "karma" | "bithound" | "svgo" | "appveyor" | "travis" | "codecov" | "sonarcloud" | "protractor" | "fusebox" | "heroku" | "editorconfig" | "bower" | "eslint" | "conduct" | "watchman" | "aurelia" | "auto" | "mocha" | "firebase" | "rollup" | "hack" | "hardhat" | "stylelint" | "code-climate" | "prettier" | "renovate" | "apollo" | "nodemon" | "webhint" | "browserlist" | "snyk" | "sequelize" | "gatsby" | "circleci" | "cloudfoundry" | "grunt" | "jest" | "fastlane" | "helm" | "wallaby" | "stencil" | "semantic-release" | "bitbucket" | "istanbul" | "tailwindcss" | "buildkite" | "netlify" | "nest" | "percy" | "gitpod" | "codeowners" | "gcp" | "husky" | "tilt" | "capacitor" | "adonis" | "commitlint" | "buck" | "nrwl" | "dune" | "roadmap" | "stryker" | "modernizr" | "stitches" | "replit" | "snowpack" | "quasar" | "dependabot" | "vite" | "vitest" | "lerna" | "textlint" | "sentry" | "phpunit" | "php-cs-fixer" | "robots" | "maven" | "serverless" | "supabase" | "ember" | "poetry" | "parcel" | "astyle" | "lighthouse" | "svgr" | "rome" | "cypress" | "plop" | "tobimake" | "pnpm" | "gridsome" | "caddy" | "bun" | "nano-staged" | "craco" | "mercurial" | "deno" | "plastic" | "unocss" | "ifanr-cloud" | "werf" | "panda" | "matlab" | "diff" | "typescript" | "php" | "salesforce" | "blink_light" | "jinja_light" | "crystal_light" | "drone_light" | "wakatime_light" | "hcl_light" | "uml_light" | "chess_light" | "tldraw_light" | "rubocop_light" | "vercel_light" | "next_light" | "remix_light" | "turborepo_light" | "auto_light" | "stylelint_light" | "code-climate_light" | "browserlist_light" | "circleci_light" | "semantic-release_light" | "netlify_light" | "stitches_light" | "snowpack_light" | "pnpm_light" | "bun_light" | "nano-staged_light" | "deno_light" | "folder-jinja_light" | "folder-intellij_light" | "folder-jinja-open_light" | "folder-intellij-open_light" | "file" | "folder" | "folder-open" | "folder-root" | "folder-root-open" | "php_elephant" | "php_elephant_pink" | "go_gopher" | "nodejs_alt" | "silverstripe";
|
|
9
|
-
runner: ({
|
|
10
|
-
command: string;
|
|
11
|
-
outputFile: string;
|
|
12
|
-
args?: string[] | undefined;
|
|
13
|
-
outputTransform?: ((args_0: unknown, ...args_1: unknown[]) => {
|
|
14
|
-
value: number;
|
|
15
|
-
slug: string;
|
|
16
|
-
score: number;
|
|
17
|
-
displayValue?: string | undefined;
|
|
18
|
-
details?: {
|
|
19
|
-
issues: {
|
|
20
|
-
message: string;
|
|
21
|
-
severity: "error" | "info" | "warning";
|
|
22
|
-
source?: {
|
|
23
|
-
file: string;
|
|
24
|
-
position?: {
|
|
25
|
-
startLine: number;
|
|
26
|
-
startColumn?: number | undefined;
|
|
27
|
-
endLine?: number | undefined;
|
|
28
|
-
endColumn?: number | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
} | undefined;
|
|
31
|
-
}[];
|
|
32
|
-
} | undefined;
|
|
33
|
-
}[] | Promise<{
|
|
34
|
-
value: number;
|
|
35
|
-
slug: string;
|
|
36
|
-
score: number;
|
|
37
|
-
displayValue?: string | undefined;
|
|
38
|
-
details?: {
|
|
39
|
-
issues: {
|
|
40
|
-
message: string;
|
|
41
|
-
severity: "error" | "info" | "warning";
|
|
42
|
-
source?: {
|
|
43
|
-
file: string;
|
|
44
|
-
position?: {
|
|
45
|
-
startLine: number;
|
|
46
|
-
startColumn?: number | undefined;
|
|
47
|
-
endLine?: number | undefined;
|
|
48
|
-
endColumn?: number | undefined;
|
|
49
|
-
} | undefined;
|
|
50
|
-
} | undefined;
|
|
51
|
-
}[];
|
|
52
|
-
} | undefined;
|
|
53
|
-
}[]>) | undefined;
|
|
54
|
-
} | ((args_0: ((args_0: unknown, ...args_1: unknown[]) => void) | undefined, ...args_1: unknown[]) => {
|
|
55
|
-
value: number;
|
|
56
|
-
slug: string;
|
|
57
|
-
score: number;
|
|
58
|
-
displayValue?: string | undefined;
|
|
59
|
-
details?: {
|
|
60
|
-
issues: {
|
|
61
|
-
message: string;
|
|
62
|
-
severity: "error" | "info" | "warning";
|
|
63
|
-
source?: {
|
|
64
|
-
file: string;
|
|
65
|
-
position?: {
|
|
66
|
-
startLine: number;
|
|
67
|
-
startColumn?: number | undefined;
|
|
68
|
-
endLine?: number | undefined;
|
|
69
|
-
endColumn?: number | undefined;
|
|
70
|
-
} | undefined;
|
|
71
|
-
} | undefined;
|
|
72
|
-
}[];
|
|
73
|
-
} | undefined;
|
|
74
|
-
}[] | Promise<{
|
|
75
|
-
value: number;
|
|
76
|
-
slug: string;
|
|
77
|
-
score: number;
|
|
78
|
-
displayValue?: string | undefined;
|
|
79
|
-
details?: {
|
|
80
|
-
issues: {
|
|
81
|
-
message: string;
|
|
82
|
-
severity: "error" | "info" | "warning";
|
|
83
|
-
source?: {
|
|
84
|
-
file: string;
|
|
85
|
-
position?: {
|
|
86
|
-
startLine: number;
|
|
87
|
-
startColumn?: number | undefined;
|
|
88
|
-
endLine?: number | undefined;
|
|
89
|
-
endColumn?: number | undefined;
|
|
90
|
-
} | undefined;
|
|
91
|
-
} | undefined;
|
|
92
|
-
}[];
|
|
93
|
-
} | undefined;
|
|
94
|
-
}[]>)) & ({
|
|
95
|
-
command: string;
|
|
96
|
-
outputFile: string;
|
|
97
|
-
args?: string[] | undefined;
|
|
98
|
-
outputTransform?: ((args_0: unknown, ...args_1: unknown[]) => {
|
|
99
|
-
value: number;
|
|
100
|
-
slug: string;
|
|
101
|
-
score: number;
|
|
102
|
-
displayValue?: string | undefined;
|
|
103
|
-
details?: {
|
|
104
|
-
issues: {
|
|
105
|
-
message: string;
|
|
106
|
-
severity: "error" | "info" | "warning";
|
|
107
|
-
source?: {
|
|
108
|
-
file: string;
|
|
109
|
-
position?: {
|
|
110
|
-
startLine: number;
|
|
111
|
-
startColumn?: number | undefined;
|
|
112
|
-
endLine?: number | undefined;
|
|
113
|
-
endColumn?: number | undefined;
|
|
114
|
-
} | undefined;
|
|
115
|
-
} | undefined;
|
|
116
|
-
}[];
|
|
117
|
-
} | undefined;
|
|
118
|
-
}[] | Promise<{
|
|
119
|
-
value: number;
|
|
120
|
-
slug: string;
|
|
121
|
-
score: number;
|
|
122
|
-
displayValue?: string | undefined;
|
|
123
|
-
details?: {
|
|
124
|
-
issues: {
|
|
125
|
-
message: string;
|
|
126
|
-
severity: "error" | "info" | "warning";
|
|
127
|
-
source?: {
|
|
128
|
-
file: string;
|
|
129
|
-
position?: {
|
|
130
|
-
startLine: number;
|
|
131
|
-
startColumn?: number | undefined;
|
|
132
|
-
endLine?: number | undefined;
|
|
133
|
-
endColumn?: number | undefined;
|
|
134
|
-
} | undefined;
|
|
135
|
-
} | undefined;
|
|
136
|
-
}[];
|
|
137
|
-
} | undefined;
|
|
138
|
-
}[]>) | undefined;
|
|
139
|
-
} | ((args_0: ((args_0: unknown, ...args_1: unknown[]) => void) | undefined, ...args_1: unknown[]) => {
|
|
140
|
-
value: number;
|
|
141
|
-
slug: string;
|
|
142
|
-
score: number;
|
|
143
|
-
displayValue?: string | undefined;
|
|
144
|
-
details?: {
|
|
145
|
-
issues: {
|
|
146
|
-
message: string;
|
|
147
|
-
severity: "error" | "info" | "warning";
|
|
148
|
-
source?: {
|
|
149
|
-
file: string;
|
|
150
|
-
position?: {
|
|
151
|
-
startLine: number;
|
|
152
|
-
startColumn?: number | undefined;
|
|
153
|
-
endLine?: number | undefined;
|
|
154
|
-
endColumn?: number | undefined;
|
|
155
|
-
} | undefined;
|
|
156
|
-
} | undefined;
|
|
157
|
-
}[];
|
|
158
|
-
} | undefined;
|
|
159
|
-
}[] | Promise<{
|
|
160
|
-
value: number;
|
|
161
|
-
slug: string;
|
|
162
|
-
score: number;
|
|
163
|
-
displayValue?: string | undefined;
|
|
164
|
-
details?: {
|
|
165
|
-
issues: {
|
|
166
|
-
message: string;
|
|
167
|
-
severity: "error" | "info" | "warning";
|
|
168
|
-
source?: {
|
|
169
|
-
file: string;
|
|
170
|
-
position?: {
|
|
171
|
-
startLine: number;
|
|
172
|
-
startColumn?: number | undefined;
|
|
173
|
-
endLine?: number | undefined;
|
|
174
|
-
endColumn?: number | undefined;
|
|
175
|
-
} | undefined;
|
|
176
|
-
} | undefined;
|
|
177
|
-
}[];
|
|
178
|
-
} | undefined;
|
|
179
|
-
}[]>) | undefined);
|
|
180
|
-
audits: {
|
|
181
|
-
title: string;
|
|
182
|
-
slug: string;
|
|
183
|
-
description?: string | undefined;
|
|
184
|
-
docsUrl?: string | undefined;
|
|
185
|
-
}[];
|
|
186
|
-
description?: string | undefined;
|
|
187
|
-
docsUrl?: string | undefined;
|
|
188
|
-
packageName?: string | undefined;
|
|
189
|
-
version?: string | undefined;
|
|
190
|
-
groups?: {
|
|
191
|
-
title: string;
|
|
192
|
-
slug: string;
|
|
193
|
-
refs: {
|
|
194
|
-
slug: string;
|
|
195
|
-
weight: number;
|
|
196
|
-
}[];
|
|
197
|
-
description?: string | undefined;
|
|
198
|
-
docsUrl?: string | undefined;
|
|
199
|
-
}[] | undefined;
|
|
200
|
-
}[];
|
|
201
|
-
persist: {
|
|
202
|
-
outputDir: string;
|
|
203
|
-
filename: string;
|
|
204
|
-
format?: ("json" | "md")[] | undefined;
|
|
205
|
-
};
|
|
206
|
-
categories: {
|
|
207
|
-
title: string;
|
|
208
|
-
slug: string;
|
|
209
|
-
refs: {
|
|
210
|
-
type: "audit" | "group";
|
|
211
|
-
slug: string;
|
|
212
|
-
weight: number;
|
|
213
|
-
plugin: string;
|
|
214
|
-
}[];
|
|
215
|
-
description?: string | undefined;
|
|
216
|
-
docsUrl?: string | undefined;
|
|
217
|
-
isBinary?: boolean | undefined;
|
|
218
|
-
}[];
|
|
219
|
-
upload?: {
|
|
220
|
-
server: string;
|
|
221
|
-
apiKey: string;
|
|
222
|
-
organization: string;
|
|
223
|
-
project: string;
|
|
224
|
-
} | undefined;
|
|
225
|
-
}>;
|
|
5
|
+
export declare function readCodePushupConfig(filepath: string): Promise<CoreConfig>;
|
package/src/lib/upload.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { uploadToPortal } from '@code-pushup/portal-client';
|
|
2
|
-
import {
|
|
2
|
+
import { PersistConfig, UploadConfig } from '@code-pushup/models';
|
|
3
3
|
import { GlobalOptions } from './types';
|
|
4
|
-
export type UploadOptions =
|
|
4
|
+
export type UploadOptions = {
|
|
5
|
+
upload: Required<UploadConfig>;
|
|
6
|
+
} & {
|
|
7
|
+
persist: Required<PersistConfig>;
|
|
8
|
+
} & GlobalOptions;
|
|
5
9
|
/**
|
|
6
10
|
* Uploads collected audits to the portal
|
|
7
11
|
* @param options
|