@bamboocss/reporter 1.11.4 → 1.12.1
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/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
- package/dist/index.d.cts +0 -85
- package/dist/index.d.mts +0 -85
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/reporter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"description": "Track and report usage of tokens and recipes",
|
|
5
5
|
"homepage": "https://bamboo-css.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"table": "6.9.0",
|
|
37
37
|
"wordwrapjs": "5.1.1",
|
|
38
|
-
"@bamboocss/core": "1.
|
|
39
|
-
"@bamboocss/
|
|
40
|
-
"@bamboocss/
|
|
41
|
-
"@bamboocss/
|
|
42
|
-
"@bamboocss/
|
|
38
|
+
"@bamboocss/core": "1.12.1",
|
|
39
|
+
"@bamboocss/generator": "1.12.1",
|
|
40
|
+
"@bamboocss/logger": "1.12.1",
|
|
41
|
+
"@bamboocss/types": "1.12.1",
|
|
42
|
+
"@bamboocss/shared": "1.12.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"markdown-table": "3.0.4"
|
package/dist/index.d.cts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ParserOptions } from "@bamboocss/core";
|
|
2
|
-
import { AnalysisReport, ClassifyReport, Nullable, ParserResultInterface } from "@bamboocss/types";
|
|
3
|
-
import { Generator } from "@bamboocss/generator";
|
|
4
|
-
|
|
5
|
-
//#region src/reporter-recipe.d.ts
|
|
6
|
-
interface RecipeReportEntry {
|
|
7
|
-
recipeName: string;
|
|
8
|
-
usedInXFiles: number;
|
|
9
|
-
usedCount: number;
|
|
10
|
-
variantCount: number;
|
|
11
|
-
usedCombinations: number;
|
|
12
|
-
percentUsed: number;
|
|
13
|
-
jsxPercentUsed: number;
|
|
14
|
-
fnPercentUsed: number;
|
|
15
|
-
possibleCombinations: string[];
|
|
16
|
-
unusedCombinations: number;
|
|
17
|
-
mostUsedCombinations: string[];
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/reporter-token.d.ts
|
|
21
|
-
interface TokenUsageItem {
|
|
22
|
-
category: string;
|
|
23
|
-
value: string;
|
|
24
|
-
filePath: string;
|
|
25
|
-
type: 'token' | 'nonToken';
|
|
26
|
-
loc: Nullable<{
|
|
27
|
-
line: number;
|
|
28
|
-
column: number;
|
|
29
|
-
}>;
|
|
30
|
-
}
|
|
31
|
-
interface TokenReportEntry {
|
|
32
|
-
category: string;
|
|
33
|
-
usedInXFiles: number;
|
|
34
|
-
usedCount: number;
|
|
35
|
-
count: number;
|
|
36
|
-
percentUsed: number;
|
|
37
|
-
hardcoded: number;
|
|
38
|
-
mostUsedNames: string[];
|
|
39
|
-
}
|
|
40
|
-
interface TokenAnalysisReport {
|
|
41
|
-
usageMap: Map<string, TokenUsageItem[]>;
|
|
42
|
-
percentMap: Map<string, {
|
|
43
|
-
total: number;
|
|
44
|
-
used: number;
|
|
45
|
-
unused: number;
|
|
46
|
-
percent: number;
|
|
47
|
-
}>;
|
|
48
|
-
tokenNameMap: Map<string, string[]>;
|
|
49
|
-
fileUsageMap: Map<string, Set<string>>;
|
|
50
|
-
hardcodedTokenMap: Map<string, number>;
|
|
51
|
-
totalMap: Map<string, number>;
|
|
52
|
-
getSummary(): TokenReportEntry[];
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/report-format.d.ts
|
|
56
|
-
type ReportFormat = 'json' | 'markdown' | 'csv' | 'text' | 'table';
|
|
57
|
-
declare function formatTokenReport(result: TokenReportEntry[], format: ReportFormat): string;
|
|
58
|
-
declare function formatRecipeReport(result: RecipeReportEntry[], format: ReportFormat): string;
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region src/reporter.d.ts
|
|
61
|
-
declare class Reporter {
|
|
62
|
-
#private;
|
|
63
|
-
private ctx;
|
|
64
|
-
private options;
|
|
65
|
-
constructor(ctx: Generator, options: ReporterOptions);
|
|
66
|
-
private setup;
|
|
67
|
-
get report(): AnalysisReport;
|
|
68
|
-
private parseFiles;
|
|
69
|
-
private parseFile;
|
|
70
|
-
init: () => void;
|
|
71
|
-
getTokenReport: () => TokenAnalysisReport;
|
|
72
|
-
getRecipeReport: () => RecipeReportEntry[];
|
|
73
|
-
}
|
|
74
|
-
interface ReporterOptions {
|
|
75
|
-
onResult?: (file: string, result: ParserResultInterface) => void;
|
|
76
|
-
project: {
|
|
77
|
-
parserOptions: ParserOptions;
|
|
78
|
-
parseSourceFile: (file: string) => ParserResultInterface | undefined;
|
|
79
|
-
classify: (fileMap: Map<string, ParserResultInterface>) => ClassifyReport;
|
|
80
|
-
};
|
|
81
|
-
getFiles: () => string[];
|
|
82
|
-
getRelativePath: (cwd: string, file: string) => string;
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
export { type RecipeReportEntry, ReportFormat, Reporter, ReporterOptions, type TokenAnalysisReport, type TokenReportEntry, formatRecipeReport, formatTokenReport };
|
package/dist/index.d.mts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { ParserOptions } from "@bamboocss/core";
|
|
2
|
-
import { AnalysisReport, ClassifyReport, Nullable, ParserResultInterface } from "@bamboocss/types";
|
|
3
|
-
import { Generator } from "@bamboocss/generator";
|
|
4
|
-
|
|
5
|
-
//#region src/reporter-recipe.d.ts
|
|
6
|
-
interface RecipeReportEntry {
|
|
7
|
-
recipeName: string;
|
|
8
|
-
usedInXFiles: number;
|
|
9
|
-
usedCount: number;
|
|
10
|
-
variantCount: number;
|
|
11
|
-
usedCombinations: number;
|
|
12
|
-
percentUsed: number;
|
|
13
|
-
jsxPercentUsed: number;
|
|
14
|
-
fnPercentUsed: number;
|
|
15
|
-
possibleCombinations: string[];
|
|
16
|
-
unusedCombinations: number;
|
|
17
|
-
mostUsedCombinations: string[];
|
|
18
|
-
}
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/reporter-token.d.ts
|
|
21
|
-
interface TokenUsageItem {
|
|
22
|
-
category: string;
|
|
23
|
-
value: string;
|
|
24
|
-
filePath: string;
|
|
25
|
-
type: 'token' | 'nonToken';
|
|
26
|
-
loc: Nullable<{
|
|
27
|
-
line: number;
|
|
28
|
-
column: number;
|
|
29
|
-
}>;
|
|
30
|
-
}
|
|
31
|
-
interface TokenReportEntry {
|
|
32
|
-
category: string;
|
|
33
|
-
usedInXFiles: number;
|
|
34
|
-
usedCount: number;
|
|
35
|
-
count: number;
|
|
36
|
-
percentUsed: number;
|
|
37
|
-
hardcoded: number;
|
|
38
|
-
mostUsedNames: string[];
|
|
39
|
-
}
|
|
40
|
-
interface TokenAnalysisReport {
|
|
41
|
-
usageMap: Map<string, TokenUsageItem[]>;
|
|
42
|
-
percentMap: Map<string, {
|
|
43
|
-
total: number;
|
|
44
|
-
used: number;
|
|
45
|
-
unused: number;
|
|
46
|
-
percent: number;
|
|
47
|
-
}>;
|
|
48
|
-
tokenNameMap: Map<string, string[]>;
|
|
49
|
-
fileUsageMap: Map<string, Set<string>>;
|
|
50
|
-
hardcodedTokenMap: Map<string, number>;
|
|
51
|
-
totalMap: Map<string, number>;
|
|
52
|
-
getSummary(): TokenReportEntry[];
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
//#region src/report-format.d.ts
|
|
56
|
-
type ReportFormat = 'json' | 'markdown' | 'csv' | 'text' | 'table';
|
|
57
|
-
declare function formatTokenReport(result: TokenReportEntry[], format: ReportFormat): string;
|
|
58
|
-
declare function formatRecipeReport(result: RecipeReportEntry[], format: ReportFormat): string;
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region src/reporter.d.ts
|
|
61
|
-
declare class Reporter {
|
|
62
|
-
#private;
|
|
63
|
-
private ctx;
|
|
64
|
-
private options;
|
|
65
|
-
constructor(ctx: Generator, options: ReporterOptions);
|
|
66
|
-
private setup;
|
|
67
|
-
get report(): AnalysisReport;
|
|
68
|
-
private parseFiles;
|
|
69
|
-
private parseFile;
|
|
70
|
-
init: () => void;
|
|
71
|
-
getTokenReport: () => TokenAnalysisReport;
|
|
72
|
-
getRecipeReport: () => RecipeReportEntry[];
|
|
73
|
-
}
|
|
74
|
-
interface ReporterOptions {
|
|
75
|
-
onResult?: (file: string, result: ParserResultInterface) => void;
|
|
76
|
-
project: {
|
|
77
|
-
parserOptions: ParserOptions;
|
|
78
|
-
parseSourceFile: (file: string) => ParserResultInterface | undefined;
|
|
79
|
-
classify: (fileMap: Map<string, ParserResultInterface>) => ClassifyReport;
|
|
80
|
-
};
|
|
81
|
-
getFiles: () => string[];
|
|
82
|
-
getRelativePath: (cwd: string, file: string) => string;
|
|
83
|
-
}
|
|
84
|
-
//#endregion
|
|
85
|
-
export { type RecipeReportEntry, ReportFormat, Reporter, ReporterOptions, type TokenAnalysisReport, type TokenReportEntry, formatRecipeReport, formatTokenReport };
|