@code-pushup/utils
Advanced tools
Comparing version 0.48.0 to 0.49.0
{ | ||
"name": "@code-pushup/utils", | ||
"version": "0.48.0", | ||
"version": "0.49.0", | ||
"dependencies": { | ||
"@code-pushup/models": "0.48.0", | ||
"@code-pushup/models": "0.49.0", | ||
"@isaacs/cliui": "^8.0.2", | ||
"@poppinss/cliui": "^6.4.0", | ||
"ansis": "^3.3.0", | ||
"build-md": "^0.4.1", | ||
"bundle-require": "^4.0.1", | ||
"esbuild": "^0.19.2", | ||
"chalk": "^5.3.0", | ||
"@isaacs/cliui": "^8.0.2", | ||
"simple-git": "^3.20.0", | ||
"multi-progress-bars": "^5.0.3", | ||
"@poppinss/cliui": "^6.4.0", | ||
"semver": "^7.6.0" | ||
"semver": "^7.6.0", | ||
"simple-git": "^3.20.0" | ||
}, | ||
@@ -15,0 +16,0 @@ "license": "MIT", |
@@ -19,2 +19,3 @@ export { exists } from '@code-pushup/models'; | ||
export { generateMdReportsDiff } from './lib/reports/generate-md-reports-diff'; | ||
export { loadReport } from './lib/reports/load-report'; | ||
export { logStdoutSummary } from './lib/reports/log-stdout-summary'; | ||
@@ -24,7 +25,7 @@ export { scoreReport } from './lib/reports/scoring'; | ||
export { ScoredCategoryConfig, ScoredGroup, ScoredReport, } from './lib/reports/types'; | ||
export { calcDuration, compareIssueSeverity, loadReport, } from './lib/reports/utils'; | ||
export { calcDuration, compareIssueSeverity } from './lib/reports/utils'; | ||
export { isSemver, normalizeSemver, sortSemvers } from './lib/semver'; | ||
export * from './lib/text-formats'; | ||
export { CliArgsObject, apostrophize, capitalize, countOccurrences, distinct, factorOf, fromJsonLines, objectFromEntries, objectToCliArgs, objectToEntries, objectToKeys, toArray, toJsonLines, toNumberPrecision, toOrdinal, toUnixNewlines, toUnixPath, } from './lib/transform'; | ||
export { CliArgsObject, capitalize, countOccurrences, distinct, factorOf, fromJsonLines, objectFromEntries, objectToCliArgs, objectToEntries, objectToKeys, toArray, toJsonLines, toNumberPrecision, toOrdinal, toUnixNewlines, toUnixPath, } from './lib/transform'; | ||
export { ExcludeNullFromPropertyTypes } from './lib/types'; | ||
export { verboseUtils } from './lib/verbose-utils'; |
@@ -6,31 +6,6 @@ export declare const TERMINAL_WIDTH = 80; | ||
}; | ||
export declare const CATEGORIES_TITLE = "\uD83C\uDFF7 Categories"; | ||
export declare const FOOTER_PREFIX = "Made with \u2764 by"; | ||
export declare const CODE_PUSHUP_DOMAIN = "code-pushup.dev"; | ||
export declare const README_LINK = "https://github.com/code-pushup/cli#readme"; | ||
export declare const reportHeadlineText = "Code PushUp Report"; | ||
export declare const reportOverviewTableHeaders: [{ | ||
readonly key: "category"; | ||
readonly label: "🏷 Category"; | ||
readonly align: "left"; | ||
}, { | ||
readonly key: "score"; | ||
readonly label: "⭐ Score"; | ||
}, { | ||
readonly key: "audits"; | ||
readonly label: "🛡 Audits"; | ||
}]; | ||
export declare const reportRawOverviewTableHeaders: string[]; | ||
export declare const issuesTableHeadings: [{ | ||
readonly key: "severity"; | ||
readonly label: "Severity"; | ||
}, { | ||
readonly key: "message"; | ||
readonly label: "Message"; | ||
}, { | ||
readonly key: "file"; | ||
readonly label: "Source file"; | ||
}, { | ||
readonly key: "line"; | ||
readonly label: "Line(s)"; | ||
}]; | ||
export declare const REPORT_HEADLINE_TEXT = "Code PushUp Report"; | ||
export declare const REPORT_RAW_OVERVIEW_TABLE_HEADERS: string[]; |
@@ -0,6 +1,6 @@ | ||
import { HeadingLevel, InlineText, MarkdownDocument } from 'build-md'; | ||
import { AuditReport, Table } from '@code-pushup/models'; | ||
import { Hierarchy } from '../text-formats'; | ||
export declare function tableSection(tableData: Table, options?: { | ||
level?: Hierarchy | 0; | ||
}): string; | ||
export declare function metaDescription({ docsUrl, description, }: Pick<AuditReport, 'docsUrl' | 'description'>): string; | ||
level?: HeadingLevel; | ||
}): MarkdownDocument | null; | ||
export declare function metaDescription(audit: Pick<AuditReport, 'docsUrl' | 'description'>): InlineText; |
@@ -0,6 +1,8 @@ | ||
import { InlineText, MarkdownDocument } from 'build-md'; | ||
import { AuditReport } from '@code-pushup/models'; | ||
import { ScoredGroup, ScoredReport } from './types'; | ||
export declare function categoriesOverviewSection(report: Pick<ScoredReport, 'categories' | 'plugins'>): string; | ||
export declare function categoriesDetailsSection(report: Pick<ScoredReport, 'categories' | 'plugins'>): string; | ||
export declare function categoryRef({ title, score, value, displayValue }: AuditReport, pluginTitle: string): string; | ||
export declare function categoryGroupItem({ score, title }: ScoredGroup, groupAudits: AuditReport[], pluginTitle: string): string; | ||
export declare function categoriesOverviewSection(report: Pick<ScoredReport, 'categories' | 'plugins'>): MarkdownDocument; | ||
export declare function categoriesDetailsSection(report: Pick<ScoredReport, 'categories' | 'plugins'>): MarkdownDocument; | ||
export declare function categoryRef({ title, score, value, displayValue }: AuditReport, pluginTitle: string): InlineText; | ||
export declare function categoryGroupItem({ score, title }: ScoredGroup, groupAudits: AuditReport[], pluginTitle: string): InlineText; | ||
export declare function binaryIconSuffix(score: number, isBinary: boolean | undefined): string; |
@@ -1,10 +0,11 @@ | ||
import { AuditReport, Issue, Report, Table } from '@code-pushup/models'; | ||
import { InlineText, MarkdownDocument } from 'build-md'; | ||
import { AuditReport, Issue, Report } from '@code-pushup/models'; | ||
import { ScoredReport } from './types'; | ||
export declare function auditDetailsAuditValue({ score, value, displayValue, }: AuditReport): string; | ||
export declare function auditDetailsAuditValue({ score, value, displayValue, }: AuditReport): InlineText; | ||
export declare function generateMdReport(report: ScoredReport): string; | ||
export declare function auditDetailsIssues(issues?: Issue[]): string; | ||
export declare function auditDetails(audit: AuditReport): string; | ||
export declare function auditsSection({ plugins, }: Pick<ScoredReport, 'plugins'>): string; | ||
export declare function aboutSection(report: Omit<ScoredReport, 'packageName'>): string; | ||
export declare function reportPluginMeta({ plugins }: Pick<Report, 'plugins'>): Table; | ||
export declare function reportMetaData({ commit, version, duration, plugins, categories, }: Pick<ScoredReport, 'date' | 'duration' | 'version' | 'commit' | 'plugins' | 'categories'>): Table; | ||
export declare function auditDetailsIssues(issues?: Issue[]): MarkdownDocument | null; | ||
export declare function auditDetails(audit: AuditReport): MarkdownDocument; | ||
export declare function auditsSection({ plugins, }: Pick<ScoredReport, 'plugins'>): MarkdownDocument; | ||
export declare function aboutSection(report: Omit<ScoredReport, 'packageName'>): MarkdownDocument; | ||
export declare function pluginMetaTable({ plugins, }: Pick<Report, 'plugins'>): Parameters<MarkdownDocument['table']>; | ||
export declare function reportMetaTable({ commit, version, duration, plugins, categories, }: Pick<ScoredReport, 'date' | 'duration' | 'version' | 'commit' | 'plugins' | 'categories'>): Parameters<MarkdownDocument['table']>; |
import { ReportsDiff } from '@code-pushup/models'; | ||
export declare function generateMdReportsDiff(diff: ReportsDiff): string; | ||
export declare function generateMdReportsDiff(diff: ReportsDiff, portalUrl?: string): string; |
import { ScoredReport } from './types'; | ||
export declare function logStdoutSummary(report: ScoredReport): void; | ||
export declare function logCategories({ categories, plugins }: ScoredReport): void; | ||
export declare function binaryIconPrefix(score: number, isBinary: boolean | undefined): string; |
@@ -1,2 +0,6 @@ | ||
import { ScoredReport } from './types'; | ||
import { CategoryRef, Group } from '@code-pushup/models'; | ||
import { ScoredReport, SortableAuditReport, SortableGroup } from './types'; | ||
export declare function getSortableAuditByRef({ slug, weight, plugin }: CategoryRef, plugins: ScoredReport['plugins']): SortableAuditReport; | ||
export declare function getSortedGroupAudits(group: Group, plugin: string, plugins: ScoredReport['plugins']): SortableAuditReport[]; | ||
export declare function getSortableGroupByRef({ plugin, slug, weight }: CategoryRef, plugins: ScoredReport['plugins']): SortableGroup; | ||
export declare function sortReport(report: ScoredReport): ScoredReport; |
@@ -1,2 +0,4 @@ | ||
import { AuditReport, CategoryRef, IssueSeverity as CliIssueSeverity, Format, Group, Issue, PersistConfig, Report } from '@code-pushup/models'; | ||
import { Ansis } from 'ansis'; | ||
import { InlineText } from 'build-md'; | ||
import { AuditDiff, AuditReport, CategoryRef, IssueSeverity as CliIssueSeverity, Issue } from '@code-pushup/models'; | ||
import { ScoredReport, SortableAuditReport, SortableGroup } from './types'; | ||
@@ -6,3 +8,3 @@ export declare function formatReportScore(score: number): string; | ||
skipBold?: boolean; | ||
}): string; | ||
}): InlineText; | ||
export type MarkerShape = 'circle' | 'square'; | ||
@@ -13,22 +15,26 @@ export type ScoreColors = 'red' | 'yellow' | 'green'; | ||
export declare function getDiffMarker(diff: number): string; | ||
export declare function colorByScoreDiff(text: string, diff: number): string; | ||
export declare function shieldsBadge(text: string, color: string): string; | ||
export declare function colorByScoreDiff(text: string, diff: number): InlineText; | ||
export declare function shieldsBadge(text: string, color: string): InlineText; | ||
export declare function formatDiffNumber(diff: number): string; | ||
export declare function severityMarker(severity: 'info' | 'warning' | 'error'): string; | ||
export declare function formatScoreChange(diff: number): InlineText; | ||
export declare function formatValueChange({ values, scores, }: Pick<AuditDiff, 'values' | 'scores'>): InlineText; | ||
export declare function calcDuration(start: number, stop?: number): number; | ||
export declare function countWeightedRefs(refs: CategoryRef[]): number; | ||
export declare function countCategoryAudits(refs: CategoryRef[], plugins: ScoredReport['plugins']): number; | ||
export declare function getSortableAuditByRef({ slug, weight, plugin }: CategoryRef, plugins: ScoredReport['plugins']): SortableAuditReport; | ||
export declare function getSortableGroupByRef({ plugin, slug, weight }: CategoryRef, plugins: ScoredReport['plugins']): SortableGroup; | ||
export declare function getSortedGroupAudits(group: Group, plugin: string, plugins: ScoredReport['plugins']): SortableAuditReport[]; | ||
export declare function compareCategoryAuditsAndGroups(a: SortableAuditReport | SortableGroup, b: SortableAuditReport | SortableGroup): number; | ||
export declare function compareAudits(a: AuditReport, b: AuditReport): number; | ||
export declare function compareIssueSeverity(severity1: CliIssueSeverity, severity2: CliIssueSeverity): number; | ||
type LoadedReportFormat<T extends Format> = T extends 'json' ? Report : string; | ||
export declare function loadReport<T extends Format>(options: Required<Omit<PersistConfig, 'format'>> & { | ||
format: T; | ||
}): Promise<LoadedReportFormat<T>>; | ||
export declare function throwIsNotPresentError(itemName: string, presentPlace: string): never; | ||
export declare function getPluginNameFromSlug(slug: string, plugins: ScoredReport['plugins']): string; | ||
export declare function compareIssues(a: Issue, b: Issue): number; | ||
export {}; | ||
export declare function applyScoreColor({ score, text }: { | ||
score: number; | ||
text?: string; | ||
}, style?: Ansis): string; | ||
export declare function targetScoreIcon(score: number, targetScore?: number, options?: { | ||
passIcon?: string; | ||
failIcon?: string; | ||
prefix?: string; | ||
postfix?: string; | ||
}): string; |
export declare const NEW_LINE = "\n"; | ||
export declare const TAB = " "; | ||
export declare const SPACE = " "; | ||
export declare const HIERARCHY: { | ||
readonly level_1: 1; | ||
readonly level_2: 2; | ||
readonly level_3: 3; | ||
readonly level_4: 4; | ||
readonly level_5: 5; | ||
readonly level_6: 6; | ||
}; |
import { details } from './html/details'; | ||
import { bold as boldHtml, code as codeHtml, italic as italicHtml } from './html/font-style'; | ||
import { link as linkHtml } from './html/link'; | ||
import { table as tableHtml } from './html/table'; | ||
import { bold as boldMd, code as codeMd, italic as italicMd, strikeThrough as strikeThroughMd } from './md/font-style'; | ||
import { h, h1, h2, h3, h4, h5, h6, headline } from './md/headline'; | ||
import { image } from './md/image'; | ||
import { link as linkMd } from './md/link'; | ||
import { indentation, li } from './md/list'; | ||
import { paragraphs } from './md/paragraphs'; | ||
import { lines, section } from './md/section'; | ||
import { table as tableMd } from './md/table'; | ||
export { NEW_LINE, SPACE, TAB } from './constants'; | ||
export { Hierarchy } from './types'; | ||
export declare const md: { | ||
bold: typeof boldMd; | ||
italic: typeof italicMd; | ||
strikeThrough: typeof strikeThroughMd; | ||
code: typeof codeMd; | ||
link: typeof linkMd; | ||
image: typeof image; | ||
headline: typeof headline; | ||
h: typeof h; | ||
h1: typeof h1; | ||
h2: typeof h2; | ||
h3: typeof h3; | ||
h4: typeof h4; | ||
h5: typeof h5; | ||
h6: typeof h6; | ||
indentation: typeof indentation; | ||
lines: typeof lines; | ||
li: typeof li; | ||
section: typeof section; | ||
paragraphs: typeof paragraphs; | ||
table: typeof tableMd; | ||
}; | ||
import { bold, code, italic } from './html/font-style'; | ||
import { link } from './html/link'; | ||
import { table } from './html/table'; | ||
export { NEW_LINE, SPACE, TAB, HIERARCHY } from './constants'; | ||
export declare const html: { | ||
bold: typeof boldHtml; | ||
italic: typeof italicHtml; | ||
code: typeof codeHtml; | ||
link: typeof linkHtml; | ||
bold: typeof bold; | ||
italic: typeof italic; | ||
code: typeof code; | ||
link: typeof link; | ||
details: typeof details; | ||
table: typeof tableHtml; | ||
table: typeof table; | ||
}; |
@@ -31,5 +31,4 @@ export declare function toArray<T>(val: T | T[]): T[]; | ||
export declare function capitalize<T extends string>(text: T): Capitalize<T>; | ||
export declare function apostrophize(text: string, upperCase?: boolean): string; | ||
export declare function toNumberPrecision(value: number, decimalPlaces: number): number; | ||
export declare function toOrdinal(value: number): string; | ||
export {}; |
Sorry, the diff of this file is too big to display
121404
10
41
3230
+ Addedansis@^3.3.0
+ Addedbuild-md@^0.4.1
+ Added@code-pushup/models@0.49.0(transitive)
+ Addedansis@3.16.0(transitive)
+ Addedbuild-md@0.4.2(transitive)
- Removedchalk@^5.3.0
- Removed@code-pushup/models@0.48.0(transitive)
Updated@code-pushup/models@0.49.0