@code-pushup/core 0.5.0 → 0.5.3
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
|
@@ -193,6 +193,23 @@ function getDuplicateRefsInCategoryMetrics(metrics) {
|
|
|
193
193
|
metrics.map(({ slug, type, plugin }) => `${type} :: ${plugin} / ${slug}`)
|
|
194
194
|
);
|
|
195
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
|
+
}
|
|
196
213
|
|
|
197
214
|
// packages/models/src/lib/core-config.ts
|
|
198
215
|
import { z as z11 } from "zod";
|
|
@@ -201,12 +218,11 @@ import { z as z11 } from "zod";
|
|
|
201
218
|
import { z as z3 } from "zod";
|
|
202
219
|
var formatSchema = z3.enum(["json", "md"]);
|
|
203
220
|
var persistConfigSchema = z3.object({
|
|
204
|
-
outputDir: filePathSchema("Artifacts folder"),
|
|
205
|
-
filename: fileNameSchema(
|
|
206
|
-
"
|
|
207
|
-
),
|
|
208
|
-
format: z3.array(formatSchema).
|
|
209
|
-
// @TODO remove default or optional value and otherwise it will not set defaults.
|
|
221
|
+
outputDir: filePathSchema("Artifacts folder").optional(),
|
|
222
|
+
filename: fileNameSchema(
|
|
223
|
+
"Artifacts file name (without extension)"
|
|
224
|
+
).optional(),
|
|
225
|
+
format: z3.array(formatSchema).optional()
|
|
210
226
|
});
|
|
211
227
|
|
|
212
228
|
// packages/models/src/lib/plugin-config.ts
|
|
@@ -440,17 +456,10 @@ var unrefinedCoreConfigSchema = z11.object({
|
|
|
440
456
|
description: "List of plugins to be used (official, community-provided, or custom)"
|
|
441
457
|
}),
|
|
442
458
|
/** portal configuration for persisting results */
|
|
443
|
-
persist: persistConfigSchema,
|
|
459
|
+
persist: persistConfigSchema.optional(),
|
|
444
460
|
/** portal configuration for uploading results */
|
|
445
461
|
upload: uploadConfigSchema.optional(),
|
|
446
|
-
categories:
|
|
447
|
-
description: "Categorization of individual audits"
|
|
448
|
-
}).min(1).refine(
|
|
449
|
-
(categories) => !getDuplicateSlugCategories(categories),
|
|
450
|
-
(categories) => ({
|
|
451
|
-
message: duplicateSlugCategoriesErrorMsg(categories)
|
|
452
|
-
})
|
|
453
|
-
)
|
|
462
|
+
categories: categoriesSchema
|
|
454
463
|
});
|
|
455
464
|
var coreConfigSchema = refineCoreConfig(unrefinedCoreConfigSchema);
|
|
456
465
|
function refineCoreConfig(schema) {
|
|
@@ -501,15 +510,11 @@ function getMissingRefsForCategories(coreCfg) {
|
|
|
501
510
|
}
|
|
502
511
|
return missingRefs.length ? missingRefs : false;
|
|
503
512
|
}
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
}
|
|
510
|
-
function getDuplicateSlugCategories(categories) {
|
|
511
|
-
return hasDuplicateStrings(categories.map(({ slug }) => slug));
|
|
512
|
-
}
|
|
513
|
+
|
|
514
|
+
// packages/models/src/lib/implementation/constants.ts
|
|
515
|
+
var PERSIST_OUTPUT_DIR = ".code-pushup";
|
|
516
|
+
var PERSIST_FORMAT = ["json"];
|
|
517
|
+
var PERSIST_FILENAME = "report";
|
|
513
518
|
|
|
514
519
|
// packages/models/src/lib/report.ts
|
|
515
520
|
import { z as z12 } from "zod";
|
|
@@ -1483,23 +1488,20 @@ var PersistError = class extends Error {
|
|
|
1483
1488
|
super(`fileName: ${reportPath} could not be saved.`);
|
|
1484
1489
|
}
|
|
1485
1490
|
};
|
|
1486
|
-
async function persistReport(report,
|
|
1487
|
-
const {
|
|
1488
|
-
const
|
|
1489
|
-
const filename = persist.filename;
|
|
1490
|
-
const format = persist.format ?? [];
|
|
1491
|
-
let scoredReport = scoreReport(report);
|
|
1491
|
+
async function persistReport(report, options) {
|
|
1492
|
+
const { outputDir, filename, format } = options;
|
|
1493
|
+
const scoredReport = scoreReport(report);
|
|
1492
1494
|
console.info(reportToStdout(scoredReport));
|
|
1493
|
-
const results = [
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1495
|
+
const results = [];
|
|
1496
|
+
if (format.includes("json")) {
|
|
1497
|
+
results.push({
|
|
1498
|
+
format: "json",
|
|
1499
|
+
content: JSON.stringify(report, null, 2)
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1497
1502
|
if (format.includes("md")) {
|
|
1498
|
-
scoredReport = scoredReport || scoreReport(report);
|
|
1499
1503
|
const commitData = await getLatestCommit();
|
|
1500
|
-
|
|
1501
|
-
console.warn("no commit data available");
|
|
1502
|
-
}
|
|
1504
|
+
validateCommitData(commitData);
|
|
1503
1505
|
results.push({
|
|
1504
1506
|
format: "md",
|
|
1505
1507
|
content: reportToMd(scoredReport, commitData)
|
|
@@ -1526,6 +1528,11 @@ async function persistReport(report, config) {
|
|
|
1526
1528
|
function logPersistedResults(persistResults) {
|
|
1527
1529
|
logMultipleFileResults(persistResults, "Generated reports");
|
|
1528
1530
|
}
|
|
1531
|
+
function validateCommitData(commitData) {
|
|
1532
|
+
if (!commitData) {
|
|
1533
|
+
console.warn("no commit data available");
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1529
1536
|
|
|
1530
1537
|
// packages/core/src/lib/implementation/execute-plugin.ts
|
|
1531
1538
|
import chalk4 from "chalk";
|
|
@@ -1642,7 +1649,7 @@ function auditOutputsCorrelateWithPluginOutput(auditOutputs, pluginConfigAudits)
|
|
|
1642
1649
|
|
|
1643
1650
|
// packages/core/package.json
|
|
1644
1651
|
var name = "@code-pushup/core";
|
|
1645
|
-
var version = "0.5.
|
|
1652
|
+
var version = "0.5.3";
|
|
1646
1653
|
|
|
1647
1654
|
// packages/core/src/lib/implementation/collect.ts
|
|
1648
1655
|
async function collect(options) {
|
|
@@ -1740,16 +1747,23 @@ function transformSeverity(severity) {
|
|
|
1740
1747
|
}
|
|
1741
1748
|
}
|
|
1742
1749
|
|
|
1750
|
+
// packages/core/src/lib/normalize.ts
|
|
1751
|
+
var normalizePersistConfig = (cfg) => ({
|
|
1752
|
+
outputDir: PERSIST_OUTPUT_DIR,
|
|
1753
|
+
filename: PERSIST_FILENAME,
|
|
1754
|
+
format: PERSIST_FORMAT,
|
|
1755
|
+
...cfg
|
|
1756
|
+
});
|
|
1757
|
+
|
|
1743
1758
|
// packages/core/src/lib/upload.ts
|
|
1744
1759
|
async function upload(options, uploadFn = uploadToPortal) {
|
|
1745
|
-
|
|
1746
|
-
|
|
1760
|
+
const persist = normalizePersistConfig(options?.persist);
|
|
1761
|
+
if (!options?.upload) {
|
|
1762
|
+
throw new Error("upload config must be set");
|
|
1747
1763
|
}
|
|
1748
1764
|
const { apiKey, server, organization, project } = options.upload;
|
|
1749
|
-
const { outputDir, filename } = options.persist;
|
|
1750
1765
|
const report = await loadReport({
|
|
1751
|
-
|
|
1752
|
-
filename,
|
|
1766
|
+
...persist,
|
|
1753
1767
|
format: "json"
|
|
1754
1768
|
});
|
|
1755
1769
|
const commitData = await getLatestCommit();
|
|
@@ -1769,7 +1783,8 @@ async function upload(options, uploadFn = uploadToPortal) {
|
|
|
1769
1783
|
async function collectAndPersistReports(options) {
|
|
1770
1784
|
const { exec } = verboseUtils(options.verbose);
|
|
1771
1785
|
const report = await collect(options);
|
|
1772
|
-
const
|
|
1786
|
+
const persist = normalizePersistConfig(options?.persist);
|
|
1787
|
+
const persistResults = await persistReport(report, persist);
|
|
1773
1788
|
exec(() => logPersistedResults(persistResults));
|
|
1774
1789
|
report.plugins.forEach((plugin) => {
|
|
1775
1790
|
pluginReportSchema.parse(plugin);
|
|
@@ -1793,7 +1808,7 @@ async function readCodePushupConfig(filepath) {
|
|
|
1793
1808
|
{
|
|
1794
1809
|
filepath
|
|
1795
1810
|
},
|
|
1796
|
-
coreConfigSchema.parse
|
|
1811
|
+
(d) => coreConfigSchema.parse(d)
|
|
1797
1812
|
);
|
|
1798
1813
|
}
|
|
1799
1814
|
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
|