@reliverse/dler 2.0.6 ā 2.0.7
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/package.json +16 -12
- package/src/cli.ts +0 -8
- package/src/cmds/build/cmd.ts +0 -568
- package/src/cmds/clean/cmd.ts +0 -166
- package/src/cmds/clean/impl.ts +0 -900
- package/src/cmds/clean/presets.ts +0 -158
- package/src/cmds/clean/types.ts +0 -71
- package/src/cmds/init/cmd.ts +0 -68
- package/src/cmds/init/impl/config.ts +0 -105
- package/src/cmds/init/impl/generators.ts +0 -220
- package/src/cmds/init/impl/prompts.ts +0 -137
- package/src/cmds/init/impl/types.ts +0 -25
- package/src/cmds/init/impl/utils.ts +0 -17
- package/src/cmds/init/impl/validators.ts +0 -55
- package/src/cmds/integrate/cmd.ts +0 -82
- package/src/cmds/integrate/impl.ts +0 -204
- package/src/cmds/integrate/integrations/base.ts +0 -69
- package/src/cmds/integrate/integrations/nextjs.ts +0 -227
- package/src/cmds/integrate/integrations/registry.ts +0 -45
- package/src/cmds/integrate/integrations/ultracite.ts +0 -53
- package/src/cmds/integrate/types.ts +0 -48
- package/src/cmds/integrate/utils/biome.ts +0 -173
- package/src/cmds/integrate/utils/context.ts +0 -148
- package/src/cmds/integrate/utils/temp.ts +0 -47
- package/src/cmds/perf/analysis/bundle.ts +0 -311
- package/src/cmds/perf/analysis/filesystem.ts +0 -324
- package/src/cmds/perf/analysis/monorepo.ts +0 -439
- package/src/cmds/perf/benchmarks/command.ts +0 -230
- package/src/cmds/perf/benchmarks/memory.ts +0 -249
- package/src/cmds/perf/benchmarks/runner.ts +0 -220
- package/src/cmds/perf/cmd.ts +0 -285
- package/src/cmds/perf/impl.ts +0 -411
- package/src/cmds/perf/reporters/console.ts +0 -331
- package/src/cmds/perf/reporters/html.ts +0 -984
- package/src/cmds/perf/reporters/json.ts +0 -42
- package/src/cmds/perf/types.ts +0 -220
- package/src/cmds/perf/utils/cache.ts +0 -234
- package/src/cmds/perf/utils/formatter.ts +0 -190
- package/src/cmds/perf/utils/stats.ts +0 -153
- package/src/cmds/publish/cmd.ts +0 -213
- package/src/cmds/shell/cmd.ts +0 -61
- package/src/cmds/tsc/cache.ts +0 -237
- package/src/cmds/tsc/cmd.ts +0 -139
- package/src/cmds/tsc/impl.ts +0 -855
- package/src/cmds/tsc/types.ts +0 -66
- package/tsconfig.json +0 -9
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
// apps/dler/src/cmds/perf/reporters/console.ts
|
|
2
|
-
|
|
3
|
-
import { logger } from "@reliverse/dler-logger";
|
|
4
|
-
import type {
|
|
5
|
-
BenchmarkResult,
|
|
6
|
-
BundleAnalysisResult,
|
|
7
|
-
FileSystemAnalysisResult,
|
|
8
|
-
MonorepoAnalysisResult,
|
|
9
|
-
PerfReport,
|
|
10
|
-
} from "../types";
|
|
11
|
-
import {
|
|
12
|
-
formatBottleneckType,
|
|
13
|
-
formatBytes,
|
|
14
|
-
formatDuration,
|
|
15
|
-
formatNumber,
|
|
16
|
-
formatPercentage,
|
|
17
|
-
formatRelativeChange,
|
|
18
|
-
formatSeverity,
|
|
19
|
-
formatTable,
|
|
20
|
-
truncatePath,
|
|
21
|
-
} from "../utils/formatter";
|
|
22
|
-
|
|
23
|
-
export class ConsoleReporter {
|
|
24
|
-
private verbose: boolean;
|
|
25
|
-
|
|
26
|
-
constructor(verbose = false) {
|
|
27
|
-
this.verbose = verbose;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
report(report: PerfReport): void {
|
|
31
|
-
logger.log("ā".repeat(80));
|
|
32
|
-
logger.log("š Performance Analysis Report");
|
|
33
|
-
logger.log("ā".repeat(80));
|
|
34
|
-
|
|
35
|
-
if (report.benchmark) {
|
|
36
|
-
this.reportBenchmark(report.benchmark);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (report.bundleAnalysis) {
|
|
40
|
-
this.reportBundleAnalysis(report.bundleAnalysis);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (report.fileSystemAnalysis) {
|
|
44
|
-
this.reportFileSystemAnalysis(report.fileSystemAnalysis);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (report.monorepoAnalysis) {
|
|
48
|
-
this.reportMonorepoAnalysis(report.monorepoAnalysis);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (report.baseline) {
|
|
52
|
-
this.reportBaselineComparison(report.baseline);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
logger.log("ā".repeat(80));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
private reportBenchmark(result: BenchmarkResult): void {
|
|
59
|
-
logger.log("\nš Command Benchmark Results");
|
|
60
|
-
logger.log("ā".repeat(40));
|
|
61
|
-
|
|
62
|
-
// Summary
|
|
63
|
-
logger.log(`Command: ${result.command}`);
|
|
64
|
-
logger.log(`Runs: ${result.runs} (${result.warmup} warmup)`);
|
|
65
|
-
logger.log(`Concurrency: ${result.concurrency}`);
|
|
66
|
-
logger.log(`Success: ${result.success ? "ā
" : "ā"}`);
|
|
67
|
-
|
|
68
|
-
if (!result.success && result.error) {
|
|
69
|
-
logger.error(`Error: ${result.error}`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Timing statistics
|
|
73
|
-
logger.log("\nā±ļø Timing Statistics:");
|
|
74
|
-
logger.log(` Mean: ${formatDuration(result.statistics.mean)}`);
|
|
75
|
-
logger.log(` Median: ${formatDuration(result.statistics.median)}`);
|
|
76
|
-
logger.log(` Min: ${formatDuration(result.statistics.min)}`);
|
|
77
|
-
logger.log(` Max: ${formatDuration(result.statistics.max)}`);
|
|
78
|
-
logger.log(` P95: ${formatDuration(result.statistics.p95)}`);
|
|
79
|
-
logger.log(` P99: ${formatDuration(result.statistics.p99)}`);
|
|
80
|
-
logger.log(
|
|
81
|
-
` Std Dev: ${formatDuration(result.statistics.standardDeviation)}`,
|
|
82
|
-
);
|
|
83
|
-
logger.log(
|
|
84
|
-
` CV: ${(result.statistics.coefficientOfVariation * 100).toFixed(2)}%`,
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
// Memory statistics
|
|
88
|
-
logger.log("\nš¾ Memory Statistics:");
|
|
89
|
-
logger.log(` Peak RSS: ${formatBytes(result.memory.peak.rss)}`);
|
|
90
|
-
logger.log(` Avg RSS: ${formatBytes(result.memory.average.rss)}`);
|
|
91
|
-
logger.log(` Peak Heap: ${formatBytes(result.memory.peak.heapUsed)}`);
|
|
92
|
-
logger.log(` Avg Heap: ${formatBytes(result.memory.average.heapUsed)}`);
|
|
93
|
-
logger.log(` Growth: ${formatBytes(result.memory.growth)}`);
|
|
94
|
-
|
|
95
|
-
// Individual runs (if verbose)
|
|
96
|
-
if (this.verbose && result.measurements.length > 0) {
|
|
97
|
-
logger.log("\nš Individual Runs:");
|
|
98
|
-
const headers = ["Run", "Duration", "RSS", "Heap", "Status"];
|
|
99
|
-
const rows = result.measurements.map((m, i) => [
|
|
100
|
-
(i + 1).toString(),
|
|
101
|
-
formatDuration(m.duration),
|
|
102
|
-
formatBytes(m.memory.rss),
|
|
103
|
-
formatBytes(m.memory.heapUsed),
|
|
104
|
-
m.success ? "ā
" : "ā",
|
|
105
|
-
]);
|
|
106
|
-
|
|
107
|
-
logger.log(formatTable(headers, rows));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
private reportBundleAnalysis(result: BundleAnalysisResult): void {
|
|
112
|
-
logger.log("\nš¦ Bundle Analysis Results");
|
|
113
|
-
logger.log("ā".repeat(40));
|
|
114
|
-
|
|
115
|
-
// Summary
|
|
116
|
-
logger.log(`Target: ${result.target}`);
|
|
117
|
-
logger.log(`Total Size: ${formatBytes(result.totalSize)}`);
|
|
118
|
-
logger.log(`File Count: ${formatNumber(result.fileCount)}`);
|
|
119
|
-
logger.log(
|
|
120
|
-
`Compression Potential: ${result.compressionPotential.toFixed(1)}%`,
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
// Largest files
|
|
124
|
-
if (result.largestFiles.length > 0) {
|
|
125
|
-
logger.log("\nš Largest Files:");
|
|
126
|
-
const headers = ["File", "Size", "Percentage", "Type"];
|
|
127
|
-
const rows = result.largestFiles.map((file) => [
|
|
128
|
-
truncatePath(file.path, 50),
|
|
129
|
-
formatBytes(file.size),
|
|
130
|
-
formatPercentage(file.percentage, 100),
|
|
131
|
-
file.type,
|
|
132
|
-
]);
|
|
133
|
-
|
|
134
|
-
logger.log(formatTable(headers, rows));
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// Modules (if available)
|
|
138
|
-
if (result.modules.length > 0) {
|
|
139
|
-
logger.log("\nš Top Modules:");
|
|
140
|
-
const headers = ["Module", "Size", "Percentage", "Type"];
|
|
141
|
-
const rows = result.modules.map((module) => [
|
|
142
|
-
truncatePath(module.name, 50),
|
|
143
|
-
formatBytes(module.size),
|
|
144
|
-
formatPercentage(module.percentage, 100),
|
|
145
|
-
module.isExternal ? "External" : "Internal",
|
|
146
|
-
]);
|
|
147
|
-
|
|
148
|
-
logger.log(formatTable(headers, rows));
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Duplicates (if available)
|
|
152
|
-
if (result.duplicates.length > 0) {
|
|
153
|
-
logger.log("\nš Duplicate Dependencies:");
|
|
154
|
-
const headers = ["Module", "Count", "Total Size", "Locations"];
|
|
155
|
-
const rows = result.duplicates.map((dup) => [
|
|
156
|
-
truncatePath(dup.name, 30),
|
|
157
|
-
dup.count.toString(),
|
|
158
|
-
formatBytes(dup.totalSize),
|
|
159
|
-
dup.locations.length.toString(),
|
|
160
|
-
]);
|
|
161
|
-
|
|
162
|
-
logger.log(formatTable(headers, rows));
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
private reportFileSystemAnalysis(result: FileSystemAnalysisResult): void {
|
|
167
|
-
logger.log("\nš File System Analysis Results");
|
|
168
|
-
logger.log("ā".repeat(40));
|
|
169
|
-
|
|
170
|
-
// Summary
|
|
171
|
-
logger.log(`Target: ${result.target}`);
|
|
172
|
-
logger.log(`Total Files: ${formatNumber(result.totalFiles)}`);
|
|
173
|
-
logger.log(`Total Size: ${formatBytes(result.totalSize)}`);
|
|
174
|
-
logger.log(`Directories: ${formatNumber(result.directoryCount)}`);
|
|
175
|
-
logger.log(`Max Depth: ${result.maxDepth}`);
|
|
176
|
-
logger.log(
|
|
177
|
-
`Compression Potential: ${result.compressionPotential.toFixed(1)}%`,
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
// Largest files
|
|
181
|
-
if (result.largestFiles.length > 0) {
|
|
182
|
-
logger.log("\nš Largest Files:");
|
|
183
|
-
const headers = ["File", "Size", "Percentage", "Type"];
|
|
184
|
-
const rows = result.largestFiles.map((file) => [
|
|
185
|
-
truncatePath(file.path, 50),
|
|
186
|
-
formatBytes(file.size),
|
|
187
|
-
formatPercentage(file.percentage, 100),
|
|
188
|
-
file.type,
|
|
189
|
-
]);
|
|
190
|
-
|
|
191
|
-
logger.log(formatTable(headers, rows));
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
// Largest directories
|
|
195
|
-
if (result.largestDirectories.length > 0) {
|
|
196
|
-
logger.log("\nš Largest Directories:");
|
|
197
|
-
const headers = ["Directory", "Size", "Files", "Depth"];
|
|
198
|
-
const rows = result.largestDirectories.map((dir) => [
|
|
199
|
-
truncatePath(dir.path, 50),
|
|
200
|
-
formatBytes(dir.size),
|
|
201
|
-
formatNumber(dir.fileCount),
|
|
202
|
-
dir.depth.toString(),
|
|
203
|
-
]);
|
|
204
|
-
|
|
205
|
-
logger.log(formatTable(headers, rows));
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// File types
|
|
209
|
-
if (result.fileTypes.length > 0) {
|
|
210
|
-
logger.log("\nš File Type Distribution:");
|
|
211
|
-
const headers = ["Type", "Count", "Size", "Percentage"];
|
|
212
|
-
const rows = result.fileTypes.map((type) => [
|
|
213
|
-
type.extension || "no-extension",
|
|
214
|
-
formatNumber(type.count),
|
|
215
|
-
formatBytes(type.totalSize),
|
|
216
|
-
formatPercentage(type.percentage, 100),
|
|
217
|
-
]);
|
|
218
|
-
|
|
219
|
-
logger.log(formatTable(headers, rows));
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
private reportMonorepoAnalysis(result: MonorepoAnalysisResult): void {
|
|
224
|
-
logger.log("\nšļø Monorepo Analysis Results");
|
|
225
|
-
logger.log("ā".repeat(40));
|
|
226
|
-
|
|
227
|
-
// Summary
|
|
228
|
-
logger.log(`Packages: ${formatNumber(result.packages.length)}`);
|
|
229
|
-
logger.log(
|
|
230
|
-
`Dependencies: ${formatNumber(result.dependencies.edges.length)}`,
|
|
231
|
-
);
|
|
232
|
-
logger.log(`Circular Dependencies: ${result.circularDependencies.length}`);
|
|
233
|
-
logger.log(`Suggested Concurrency: ${result.suggestedConcurrency}`);
|
|
234
|
-
|
|
235
|
-
// Build order
|
|
236
|
-
if (result.buildOrder.length > 0) {
|
|
237
|
-
logger.log("\nš Build Order:");
|
|
238
|
-
const levels = result.dependencies.levels;
|
|
239
|
-
for (let i = 0; i < levels.length; i++) {
|
|
240
|
-
const level = levels[i]!;
|
|
241
|
-
logger.log(` Level ${i + 1}: ${level.join(", ")}`);
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// Critical path
|
|
246
|
-
if (result.criticalPath.length > 0) {
|
|
247
|
-
logger.log("\nšÆ Critical Path:");
|
|
248
|
-
logger.log(` ${result.criticalPath.slice(0, 10).join(" ā ")}`);
|
|
249
|
-
if (result.criticalPath.length > 10) {
|
|
250
|
-
logger.log(` ... and ${result.criticalPath.length - 10} more`);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// Circular dependencies
|
|
255
|
-
if (result.circularDependencies.length > 0) {
|
|
256
|
-
logger.log("\nš Circular Dependencies:");
|
|
257
|
-
for (const circular of result.circularDependencies) {
|
|
258
|
-
logger.log(
|
|
259
|
-
` ${formatSeverity(circular.severity)} ${circular.cycle.join(" ā ")}`,
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
// Bottlenecks
|
|
265
|
-
if (result.bottlenecks.length > 0) {
|
|
266
|
-
logger.log("\nā ļø Bottlenecks:");
|
|
267
|
-
const headers = ["Package", "Type", "Impact", "Suggestion"];
|
|
268
|
-
const rows = result.bottlenecks.map((bottleneck) => [
|
|
269
|
-
bottleneck.package,
|
|
270
|
-
formatBottleneckType(bottleneck.type),
|
|
271
|
-
bottleneck.impact.toString(),
|
|
272
|
-
bottleneck.suggestion,
|
|
273
|
-
]);
|
|
274
|
-
|
|
275
|
-
logger.log(formatTable(headers, rows));
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// Package details (if verbose)
|
|
279
|
-
if (this.verbose) {
|
|
280
|
-
logger.log("\nš¦ Package Details:");
|
|
281
|
-
const headers = ["Package", "Dependencies", "Dependents", "Type"];
|
|
282
|
-
const rows = result.packages.map((pkg) => [
|
|
283
|
-
pkg.name,
|
|
284
|
-
pkg.dependencies.length.toString(),
|
|
285
|
-
pkg.dependents.length.toString(),
|
|
286
|
-
pkg.dependencies.length > 10 ? "Heavy" : "Light",
|
|
287
|
-
]);
|
|
288
|
-
|
|
289
|
-
logger.log(formatTable(headers, rows));
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
private reportBaselineComparison(baseline: PerfReport["baseline"]): void {
|
|
294
|
-
if (!baseline?.exists) return;
|
|
295
|
-
|
|
296
|
-
logger.log("\nš Baseline Comparison");
|
|
297
|
-
logger.log("ā".repeat(40));
|
|
298
|
-
|
|
299
|
-
if (baseline.improvement !== undefined) {
|
|
300
|
-
logger.log(
|
|
301
|
-
`Performance: ${formatRelativeChange(0, baseline.improvement)}`,
|
|
302
|
-
);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
if (baseline.regression !== undefined) {
|
|
306
|
-
logger.log(
|
|
307
|
-
`Performance: ${formatRelativeChange(0, -baseline.regression)}`,
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
if (baseline.changes) {
|
|
312
|
-
const changes = baseline.changes;
|
|
313
|
-
if (changes.duration !== undefined) {
|
|
314
|
-
logger.log(`Duration: ${formatRelativeChange(0, changes.duration)}`);
|
|
315
|
-
}
|
|
316
|
-
if (changes.memory !== undefined) {
|
|
317
|
-
logger.log(`Memory: ${formatRelativeChange(0, changes.memory)}`);
|
|
318
|
-
}
|
|
319
|
-
if (changes.size !== undefined) {
|
|
320
|
-
logger.log(`Size: ${formatRelativeChange(0, changes.size)}`);
|
|
321
|
-
}
|
|
322
|
-
if (changes.files !== undefined) {
|
|
323
|
-
logger.log(`Files: ${formatRelativeChange(0, changes.files)}`);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
export const createConsoleReporter = (verbose = false): ConsoleReporter => {
|
|
330
|
-
return new ConsoleReporter(verbose);
|
|
331
|
-
};
|