@reliverse/dler 2.2.5 → 2.2.10

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.
Files changed (56) hide show
  1. package/README.md +14 -14
  2. package/dist/cli.js +1 -1
  3. package/dist/cmds/biome/cmd.js +58 -0
  4. package/dist/cmds/biome/impl.d.ts +26 -0
  5. package/dist/cmds/biome/impl.js +272 -0
  6. package/dist/cmds/build/cmd.js +18 -10
  7. package/dist/cmds/clean/cmd.js +6 -6
  8. package/dist/cmds/clean/impl.js +16 -12
  9. package/dist/cmds/clean/presets.js +2 -2
  10. package/dist/cmds/publish/cmd.js +7 -7
  11. package/dist/cmds/senv/cmd.js +13 -15
  12. package/dist/cmds/tsc/cache.js +1 -1
  13. package/dist/cmds/tsc/cmd.js +11 -8
  14. package/dist/cmds/tsc/impl.js +132 -17
  15. package/dist/cmds/update/cmd.js +11 -10
  16. package/dist/cmds/update/impl.d.ts +4 -4
  17. package/dist/cmds/update/impl.js +10 -11
  18. package/dist/cmds/update/utils.d.ts +23 -4
  19. package/dist/cmds/update/utils.js +22 -16
  20. package/package.json +16 -13
  21. package/dist/cmds/perf/analysis/bundle.d.ts +0 -20
  22. package/dist/cmds/perf/analysis/bundle.js +0 -225
  23. package/dist/cmds/perf/analysis/filesystem.d.ts +0 -27
  24. package/dist/cmds/perf/analysis/filesystem.js +0 -245
  25. package/dist/cmds/perf/analysis/monorepo.d.ts +0 -30
  26. package/dist/cmds/perf/analysis/monorepo.js +0 -345
  27. package/dist/cmds/perf/benchmarks/command.d.ts +0 -21
  28. package/dist/cmds/perf/benchmarks/command.js +0 -162
  29. package/dist/cmds/perf/benchmarks/memory.d.ts +0 -41
  30. package/dist/cmds/perf/benchmarks/memory.js +0 -169
  31. package/dist/cmds/perf/benchmarks/runner.d.ts +0 -22
  32. package/dist/cmds/perf/benchmarks/runner.js +0 -157
  33. package/dist/cmds/perf/cmd.js +0 -240
  34. package/dist/cmds/perf/impl.d.ts +0 -24
  35. package/dist/cmds/perf/impl.js +0 -297
  36. package/dist/cmds/perf/reporters/console.d.ts +0 -12
  37. package/dist/cmds/perf/reporters/console.js +0 -257
  38. package/dist/cmds/perf/reporters/html.d.ts +0 -27
  39. package/dist/cmds/perf/reporters/html.js +0 -881
  40. package/dist/cmds/perf/reporters/json.d.ts +0 -9
  41. package/dist/cmds/perf/reporters/json.js +0 -32
  42. package/dist/cmds/perf/types.d.ts +0 -184
  43. package/dist/cmds/perf/types.js +0 -0
  44. package/dist/cmds/perf/utils/cache.d.ts +0 -23
  45. package/dist/cmds/perf/utils/cache.js +0 -172
  46. package/dist/cmds/perf/utils/formatter.d.ts +0 -17
  47. package/dist/cmds/perf/utils/formatter.js +0 -134
  48. package/dist/cmds/perf/utils/stats.d.ts +0 -15
  49. package/dist/cmds/perf/utils/stats.js +0 -101
  50. package/dist/cmds/port/cmd.d.ts +0 -2
  51. package/dist/cmds/port/cmd.js +0 -58
  52. package/dist/cmds/port/impl.d.ts +0 -5
  53. package/dist/cmds/port/impl.js +0 -280
  54. package/dist/cmds/shell/cmd.d.ts +0 -2
  55. package/dist/cmds/shell/cmd.js +0 -46
  56. /package/dist/cmds/{perf → biome}/cmd.d.ts +0 -0
@@ -1,297 +0,0 @@
1
- import { existsSync, statSync } from "node:fs";
2
- import { resolve } from "node:path";
3
- import { logger } from "@reliverse/dler-logger";
4
- import { analyzeBundle } from "./analysis/bundle.js";
5
- import { analyzeFileSystem } from "./analysis/filesystem.js";
6
- import { analyzeMonorepo } from "./analysis/monorepo.js";
7
- import { runBenchmark } from "./benchmarks/runner.js";
8
- import { createPerfCache } from "./utils/cache.js";
9
- import { calculateImprovement, calculateRegression } from "./utils/stats.js";
10
- export class PerfAnalyzer {
11
- options;
12
- cache = createPerfCache();
13
- constructor(options) {
14
- this.options = options;
15
- }
16
- async analyze() {
17
- try {
18
- const startTime = Date.now();
19
- const analysisType = this.options.type ?? await this.detectType();
20
- if (this.options.verbose) {
21
- logger.info(`\u{1F50D} Starting performance analysis (type: ${analysisType})`);
22
- }
23
- let benchmark;
24
- let bundleAnalysis;
25
- let fileSystemAnalysis;
26
- let monorepoAnalysis;
27
- switch (analysisType) {
28
- case "command":
29
- benchmark = await this.runCommandBenchmark();
30
- break;
31
- case "bundle":
32
- bundleAnalysis = await this.runBundleAnalysis();
33
- break;
34
- case "file":
35
- fileSystemAnalysis = await this.runFileSystemAnalysis();
36
- break;
37
- case "monorepo":
38
- monorepoAnalysis = await this.runMonorepoAnalysis();
39
- break;
40
- case "auto":
41
- if (this.options.target) {
42
- const targetType = await this.detectTargetType(this.options.target);
43
- switch (targetType) {
44
- case "command":
45
- benchmark = await this.runCommandBenchmark();
46
- break;
47
- case "bundle":
48
- bundleAnalysis = await this.runBundleAnalysis();
49
- break;
50
- case "file":
51
- fileSystemAnalysis = await this.runFileSystemAnalysis();
52
- break;
53
- }
54
- } else {
55
- monorepoAnalysis = await this.runMonorepoAnalysis();
56
- }
57
- break;
58
- }
59
- const report = {
60
- timestamp: Date.now(),
61
- options: this.options,
62
- benchmark,
63
- bundleAnalysis,
64
- fileSystemAnalysis,
65
- monorepoAnalysis
66
- };
67
- if (this.options.compare) {
68
- const baseline = await this.cache.findBaseline(
69
- this.options.target ?? "unknown",
70
- this.options.type
71
- );
72
- if (baseline) {
73
- report.baseline = this.compareWithBaseline(report, baseline);
74
- }
75
- }
76
- if (this.options.save) {
77
- await this.cache.save(report);
78
- if (this.options.verbose) {
79
- logger.info("\u{1F4BE} Baseline saved");
80
- }
81
- }
82
- const executionTime = Date.now() - startTime;
83
- if (this.options.verbose) {
84
- logger.info(`\u2705 Analysis completed in ${executionTime}ms`);
85
- }
86
- return {
87
- report,
88
- success: true
89
- };
90
- } catch (error) {
91
- const errorMessage = error instanceof Error ? error.message : String(error);
92
- if (this.options.verbose) {
93
- logger.error(`\u274C Analysis failed: ${errorMessage}`);
94
- }
95
- return {
96
- report: {
97
- timestamp: Date.now(),
98
- options: this.options
99
- },
100
- success: false,
101
- error: errorMessage
102
- };
103
- }
104
- }
105
- async detectType() {
106
- if (this.options.target) {
107
- return await this.detectTargetType(this.options.target);
108
- }
109
- return "monorepo";
110
- }
111
- async detectTargetType(target) {
112
- if (this.isCommand(target)) {
113
- return "command";
114
- }
115
- const targetPath = resolve(target);
116
- if (!existsSync(targetPath)) {
117
- throw new Error(`Target not found: ${target}`);
118
- }
119
- const stat = statSync(targetPath);
120
- if (stat.isFile()) {
121
- if (this.isBundleFile(target)) {
122
- return "bundle";
123
- }
124
- return "file";
125
- }
126
- if (stat.isDirectory()) {
127
- if (await this.containsBundleFiles(targetPath)) {
128
- return "bundle";
129
- }
130
- return "file";
131
- }
132
- return "file";
133
- }
134
- isCommand(target) {
135
- return target.includes(" ") || target.startsWith("dler ") || target.startsWith("bun ") || target.startsWith("node ") || target.startsWith("npm ") || target.startsWith("yarn ") || target.startsWith("pnpm ");
136
- }
137
- isBundleFile(target) {
138
- const bundleExtensions = [".js", ".mjs", ".cjs", ".ts", ".jsx", ".tsx"];
139
- const ext = target.split(".").pop()?.toLowerCase();
140
- return ext ? bundleExtensions.includes(`.${ext}`) : false;
141
- }
142
- async containsBundleFiles(dirPath) {
143
- try {
144
- const glob = new Bun.Glob("**/*.{js,mjs,cjs,ts,jsx,tsx}");
145
- const matches = glob.scanSync({ cwd: dirPath, onlyFiles: true });
146
- for (const _ of matches) {
147
- return true;
148
- }
149
- return false;
150
- } catch {
151
- return false;
152
- }
153
- }
154
- async runCommandBenchmark() {
155
- if (!this.options.target) {
156
- throw new Error("Target is required for command benchmarking");
157
- }
158
- const {
159
- target,
160
- runs = 10,
161
- warmup = 2,
162
- concurrency = 1,
163
- cwd,
164
- verbose
165
- } = this.options;
166
- if (verbose) {
167
- logger.info(`\u{1F680} Benchmarking command: ${target}`);
168
- }
169
- return runBenchmark({
170
- command: target,
171
- runs,
172
- warmup,
173
- concurrency,
174
- cwd,
175
- verbose
176
- });
177
- }
178
- async runBundleAnalysis() {
179
- if (!this.options.target) {
180
- throw new Error("Target is required for bundle analysis");
181
- }
182
- const { target, verbose } = this.options;
183
- if (verbose) {
184
- logger.info(`\u{1F4E6} Analyzing bundle: ${target}`);
185
- }
186
- return analyzeBundle({
187
- target,
188
- verbose,
189
- includeSourceMaps: true,
190
- analyzeDependencies: true
191
- });
192
- }
193
- async runFileSystemAnalysis() {
194
- if (!this.options.target) {
195
- throw new Error("Target is required for file system analysis");
196
- }
197
- const { target, verbose } = this.options;
198
- if (verbose) {
199
- logger.info(`\u{1F4C1} Analyzing file system: ${target}`);
200
- }
201
- return analyzeFileSystem({
202
- target,
203
- verbose,
204
- maxDepth: 10,
205
- includeHidden: false,
206
- excludePatterns: ["node_modules", ".git", ".next", "dist", "build"]
207
- });
208
- }
209
- async runMonorepoAnalysis() {
210
- const { cwd, ignore, verbose } = this.options;
211
- if (verbose) {
212
- logger.info("\u{1F3D7}\uFE0F Analyzing monorepo structure");
213
- }
214
- return analyzeMonorepo({
215
- cwd,
216
- ignore,
217
- verbose,
218
- includeDevDependencies: true,
219
- analyzeBuildOrder: true
220
- });
221
- }
222
- compareWithBaseline(current, baseline) {
223
- const changes = {};
224
- if (current.benchmark && baseline.benchmark) {
225
- const currentDuration = current.benchmark.statistics.mean;
226
- const baselineDuration = baseline.benchmark.statistics.mean;
227
- if (currentDuration < baselineDuration) {
228
- changes.duration = calculateImprovement(
229
- baselineDuration,
230
- currentDuration
231
- );
232
- } else {
233
- changes.duration = calculateRegression(
234
- baselineDuration,
235
- currentDuration
236
- );
237
- }
238
- const currentMemory = current.benchmark.memory.average.rss;
239
- const baselineMemory = baseline.benchmark.memory.average.rss;
240
- if (currentMemory < baselineMemory) {
241
- changes.memory = calculateImprovement(baselineMemory, currentMemory);
242
- } else {
243
- changes.memory = calculateRegression(baselineMemory, currentMemory);
244
- }
245
- }
246
- if (current.bundleAnalysis && baseline.bundleAnalysis) {
247
- const currentSize = current.bundleAnalysis.totalSize;
248
- const baselineSize = baseline.bundleAnalysis.totalSize;
249
- if (currentSize < baselineSize) {
250
- changes.size = calculateImprovement(baselineSize, currentSize);
251
- } else {
252
- changes.size = calculateRegression(baselineSize, currentSize);
253
- }
254
- const currentFiles = current.bundleAnalysis.fileCount;
255
- const baselineFiles = baseline.bundleAnalysis.fileCount;
256
- if (currentFiles !== baselineFiles) {
257
- changes.files = calculateRegression(baselineFiles, currentFiles);
258
- }
259
- }
260
- if (current.fileSystemAnalysis && baseline.fileSystemAnalysis) {
261
- const currentSize = current.fileSystemAnalysis.totalSize;
262
- const baselineSize = baseline.fileSystemAnalysis.totalSize;
263
- if (currentSize < baselineSize) {
264
- changes.size = calculateImprovement(baselineSize, currentSize);
265
- } else {
266
- changes.size = calculateRegression(baselineSize, currentSize);
267
- }
268
- const currentFiles = current.fileSystemAnalysis.totalFiles;
269
- const baselineFiles = baseline.fileSystemAnalysis.totalFiles;
270
- if (currentFiles !== baselineFiles) {
271
- changes.files = calculateRegression(baselineFiles, currentFiles);
272
- }
273
- }
274
- let improvement;
275
- let regression;
276
- if (changes.duration !== void 0) {
277
- if (changes.duration > 0) {
278
- improvement = changes.duration;
279
- } else {
280
- regression = Math.abs(changes.duration);
281
- }
282
- }
283
- return {
284
- exists: true,
285
- improvement,
286
- regression,
287
- changes
288
- };
289
- }
290
- }
291
- export const runPerfAnalysis = async (options) => {
292
- const analyzer = new PerfAnalyzer(options);
293
- return analyzer.analyze();
294
- };
295
- export const createPerfAnalyzer = (options) => {
296
- return new PerfAnalyzer(options);
297
- };
@@ -1,12 +0,0 @@
1
- import type { PerfReport } from "../types.js";
2
- export declare class ConsoleReporter {
3
- private verbose;
4
- constructor(verbose?: boolean);
5
- report(report: PerfReport): void;
6
- private reportBenchmark;
7
- private reportBundleAnalysis;
8
- private reportFileSystemAnalysis;
9
- private reportMonorepoAnalysis;
10
- private reportBaselineComparison;
11
- }
12
- export declare const createConsoleReporter: (verbose?: boolean) => ConsoleReporter;
@@ -1,257 +0,0 @@
1
- import { logger } from "@reliverse/dler-logger";
2
- import {
3
- formatBottleneckType,
4
- formatBytes,
5
- formatDuration,
6
- formatNumber,
7
- formatPercentage,
8
- formatRelativeChange,
9
- formatSeverity,
10
- formatTable,
11
- truncatePath
12
- } from "../utils/formatter.js";
13
- export class ConsoleReporter {
14
- verbose;
15
- constructor(verbose = false) {
16
- this.verbose = verbose;
17
- }
18
- report(report) {
19
- logger.log("\u2501".repeat(80));
20
- logger.log("\u{1F4CA} Performance Analysis Report");
21
- logger.log("\u2501".repeat(80));
22
- if (report.benchmark) {
23
- this.reportBenchmark(report.benchmark);
24
- }
25
- if (report.bundleAnalysis) {
26
- this.reportBundleAnalysis(report.bundleAnalysis);
27
- }
28
- if (report.fileSystemAnalysis) {
29
- this.reportFileSystemAnalysis(report.fileSystemAnalysis);
30
- }
31
- if (report.monorepoAnalysis) {
32
- this.reportMonorepoAnalysis(report.monorepoAnalysis);
33
- }
34
- if (report.baseline) {
35
- this.reportBaselineComparison(report.baseline);
36
- }
37
- logger.log("\u2501".repeat(80));
38
- }
39
- reportBenchmark(result) {
40
- logger.log("\n\u{1F680} Command Benchmark Results");
41
- logger.log("\u2500".repeat(40));
42
- logger.log(`Command: ${result.command}`);
43
- logger.log(`Runs: ${result.runs} (${result.warmup} warmup)`);
44
- logger.log(`Concurrency: ${result.concurrency}`);
45
- logger.log(`Success: ${result.success ? "\u2705" : "\u274C"}`);
46
- if (!result.success && result.error) {
47
- logger.error(`Error: ${result.error}`);
48
- }
49
- logger.log("\n\u23F1\uFE0F Timing Statistics:");
50
- logger.log(` Mean: ${formatDuration(result.statistics.mean)}`);
51
- logger.log(` Median: ${formatDuration(result.statistics.median)}`);
52
- logger.log(` Min: ${formatDuration(result.statistics.min)}`);
53
- logger.log(` Max: ${formatDuration(result.statistics.max)}`);
54
- logger.log(` P95: ${formatDuration(result.statistics.p95)}`);
55
- logger.log(` P99: ${formatDuration(result.statistics.p99)}`);
56
- logger.log(
57
- ` Std Dev: ${formatDuration(result.statistics.standardDeviation)}`
58
- );
59
- logger.log(
60
- ` CV: ${(result.statistics.coefficientOfVariation * 100).toFixed(2)}%`
61
- );
62
- logger.log("\n\u{1F4BE} Memory Statistics:");
63
- logger.log(` Peak RSS: ${formatBytes(result.memory.peak.rss)}`);
64
- logger.log(` Avg RSS: ${formatBytes(result.memory.average.rss)}`);
65
- logger.log(` Peak Heap: ${formatBytes(result.memory.peak.heapUsed)}`);
66
- logger.log(` Avg Heap: ${formatBytes(result.memory.average.heapUsed)}`);
67
- logger.log(` Growth: ${formatBytes(result.memory.growth)}`);
68
- if (this.verbose && result.measurements.length > 0) {
69
- logger.log("\n\u{1F4CB} Individual Runs:");
70
- const headers = ["Run", "Duration", "RSS", "Heap", "Status"];
71
- const rows = result.measurements.map((m, i) => [
72
- (i + 1).toString(),
73
- formatDuration(m.duration),
74
- formatBytes(m.memory.rss),
75
- formatBytes(m.memory.heapUsed),
76
- m.success ? "\u2705" : "\u274C"
77
- ]);
78
- logger.log(formatTable(headers, rows));
79
- }
80
- }
81
- reportBundleAnalysis(result) {
82
- logger.log("\n\u{1F4E6} Bundle Analysis Results");
83
- logger.log("\u2500".repeat(40));
84
- logger.log(`Target: ${result.target}`);
85
- logger.log(`Total Size: ${formatBytes(result.totalSize)}`);
86
- logger.log(`File Count: ${formatNumber(result.fileCount)}`);
87
- logger.log(
88
- `Compression Potential: ${result.compressionPotential.toFixed(1)}%`
89
- );
90
- if (result.largestFiles.length > 0) {
91
- logger.log("\n\u{1F4C1} Largest Files:");
92
- const headers = ["File", "Size", "Percentage", "Type"];
93
- const rows = result.largestFiles.map((file) => [
94
- truncatePath(file.path, 50),
95
- formatBytes(file.size),
96
- formatPercentage(file.percentage, 100),
97
- file.type
98
- ]);
99
- logger.log(formatTable(headers, rows));
100
- }
101
- if (result.modules.length > 0) {
102
- logger.log("\n\u{1F517} Top Modules:");
103
- const headers = ["Module", "Size", "Percentage", "Type"];
104
- const rows = result.modules.map((module) => [
105
- truncatePath(module.name, 50),
106
- formatBytes(module.size),
107
- formatPercentage(module.percentage, 100),
108
- module.isExternal ? "External" : "Internal"
109
- ]);
110
- logger.log(formatTable(headers, rows));
111
- }
112
- if (result.duplicates.length > 0) {
113
- logger.log("\n\u{1F504} Duplicate Dependencies:");
114
- const headers = ["Module", "Count", "Total Size", "Locations"];
115
- const rows = result.duplicates.map((dup) => [
116
- truncatePath(dup.name, 30),
117
- dup.count.toString(),
118
- formatBytes(dup.totalSize),
119
- dup.locations.length.toString()
120
- ]);
121
- logger.log(formatTable(headers, rows));
122
- }
123
- }
124
- reportFileSystemAnalysis(result) {
125
- logger.log("\n\u{1F4C1} File System Analysis Results");
126
- logger.log("\u2500".repeat(40));
127
- logger.log(`Target: ${result.target}`);
128
- logger.log(`Total Files: ${formatNumber(result.totalFiles)}`);
129
- logger.log(`Total Size: ${formatBytes(result.totalSize)}`);
130
- logger.log(`Directories: ${formatNumber(result.directoryCount)}`);
131
- logger.log(`Max Depth: ${result.maxDepth}`);
132
- logger.log(
133
- `Compression Potential: ${result.compressionPotential.toFixed(1)}%`
134
- );
135
- if (result.largestFiles.length > 0) {
136
- logger.log("\n\u{1F4C4} Largest Files:");
137
- const headers = ["File", "Size", "Percentage", "Type"];
138
- const rows = result.largestFiles.map((file) => [
139
- truncatePath(file.path, 50),
140
- formatBytes(file.size),
141
- formatPercentage(file.percentage, 100),
142
- file.type
143
- ]);
144
- logger.log(formatTable(headers, rows));
145
- }
146
- if (result.largestDirectories.length > 0) {
147
- logger.log("\n\u{1F4C2} Largest Directories:");
148
- const headers = ["Directory", "Size", "Files", "Depth"];
149
- const rows = result.largestDirectories.map((dir) => [
150
- truncatePath(dir.path, 50),
151
- formatBytes(dir.size),
152
- formatNumber(dir.fileCount),
153
- dir.depth.toString()
154
- ]);
155
- logger.log(formatTable(headers, rows));
156
- }
157
- if (result.fileTypes.length > 0) {
158
- logger.log("\n\u{1F4CA} File Type Distribution:");
159
- const headers = ["Type", "Count", "Size", "Percentage"];
160
- const rows = result.fileTypes.map((type) => [
161
- type.extension || "no-extension",
162
- formatNumber(type.count),
163
- formatBytes(type.totalSize),
164
- formatPercentage(type.percentage, 100)
165
- ]);
166
- logger.log(formatTable(headers, rows));
167
- }
168
- }
169
- reportMonorepoAnalysis(result) {
170
- logger.log("\n\u{1F3D7}\uFE0F Monorepo Analysis Results");
171
- logger.log("\u2500".repeat(40));
172
- logger.log(`Packages: ${formatNumber(result.packages.length)}`);
173
- logger.log(
174
- `Dependencies: ${formatNumber(result.dependencies.edges.length)}`
175
- );
176
- logger.log(`Circular Dependencies: ${result.circularDependencies.length}`);
177
- logger.log(`Suggested Concurrency: ${result.suggestedConcurrency}`);
178
- if (result.buildOrder.length > 0) {
179
- logger.log("\n\u{1F504} Build Order:");
180
- const levels = result.dependencies.levels;
181
- for (let i = 0; i < levels.length; i++) {
182
- const level = levels[i];
183
- logger.log(` Level ${i + 1}: ${level.join(", ")}`);
184
- }
185
- }
186
- if (result.criticalPath.length > 0) {
187
- logger.log("\n\u{1F3AF} Critical Path:");
188
- logger.log(` ${result.criticalPath.slice(0, 10).join(" \u2192 ")}`);
189
- if (result.criticalPath.length > 10) {
190
- logger.log(` ... and ${result.criticalPath.length - 10} more`);
191
- }
192
- }
193
- if (result.circularDependencies.length > 0) {
194
- logger.log("\n\u{1F504} Circular Dependencies:");
195
- for (const circular of result.circularDependencies) {
196
- logger.log(
197
- ` ${formatSeverity(circular.severity)} ${circular.cycle.join(" \u2192 ")}`
198
- );
199
- }
200
- }
201
- if (result.bottlenecks.length > 0) {
202
- logger.log("\n\u26A0\uFE0F Bottlenecks:");
203
- const headers = ["Package", "Type", "Impact", "Suggestion"];
204
- const rows = result.bottlenecks.map((bottleneck) => [
205
- bottleneck.package,
206
- formatBottleneckType(bottleneck.type),
207
- bottleneck.impact.toString(),
208
- bottleneck.suggestion
209
- ]);
210
- logger.log(formatTable(headers, rows));
211
- }
212
- if (this.verbose) {
213
- logger.log("\n\u{1F4E6} Package Details:");
214
- const headers = ["Package", "Dependencies", "Dependents", "Type"];
215
- const rows = result.packages.map((pkg) => [
216
- pkg.name,
217
- pkg.dependencies.length.toString(),
218
- pkg.dependents.length.toString(),
219
- pkg.dependencies.length > 10 ? "Heavy" : "Light"
220
- ]);
221
- logger.log(formatTable(headers, rows));
222
- }
223
- }
224
- reportBaselineComparison(baseline) {
225
- if (!baseline?.exists) return;
226
- logger.log("\n\u{1F4C8} Baseline Comparison");
227
- logger.log("\u2500".repeat(40));
228
- if (baseline.improvement !== void 0) {
229
- logger.log(
230
- `Performance: ${formatRelativeChange(0, baseline.improvement)}`
231
- );
232
- }
233
- if (baseline.regression !== void 0) {
234
- logger.log(
235
- `Performance: ${formatRelativeChange(0, -baseline.regression)}`
236
- );
237
- }
238
- if (baseline.changes) {
239
- const changes = baseline.changes;
240
- if (changes.duration !== void 0) {
241
- logger.log(`Duration: ${formatRelativeChange(0, changes.duration)}`);
242
- }
243
- if (changes.memory !== void 0) {
244
- logger.log(`Memory: ${formatRelativeChange(0, changes.memory)}`);
245
- }
246
- if (changes.size !== void 0) {
247
- logger.log(`Size: ${formatRelativeChange(0, changes.size)}`);
248
- }
249
- if (changes.files !== void 0) {
250
- logger.log(`Files: ${formatRelativeChange(0, changes.files)}`);
251
- }
252
- }
253
- }
254
- }
255
- export const createConsoleReporter = (verbose = false) => {
256
- return new ConsoleReporter(verbose);
257
- };
@@ -1,27 +0,0 @@
1
- import type { PerfReport } from "../types.js";
2
- export declare class HtmlReporter {
3
- private outputPath?;
4
- constructor(outputPath?: string);
5
- report(report: PerfReport): void;
6
- private generateHtml;
7
- private generateBenchmarkSection;
8
- private generateBundleAnalysisSection;
9
- private generateFileSystemAnalysisSection;
10
- private generateMonorepoAnalysisSection;
11
- private generateBaselineComparisonSection;
12
- private generateFileTable;
13
- private generateModuleTable;
14
- private generateDuplicateTable;
15
- private generateDirectoryTable;
16
- private generateFileTypeTable;
17
- private generateBuildOrderSection;
18
- private generateCircularDependenciesSection;
19
- private generateBottlenecksSection;
20
- private generateTimingChart;
21
- private truncatePath;
22
- private getStyles;
23
- private getScripts;
24
- static save(report: PerfReport, outputPath: string): void;
25
- static print(report: PerfReport): void;
26
- }
27
- export declare const createHtmlReporter: (outputPath?: string) => HtmlReporter;