Skip to content

Commit 99ee851

Browse files
authored
Fix line ending bug (#49)
1 parent 7b46d70 commit 99ee851

10 files changed

Lines changed: 558 additions & 554 deletions

.changeset/gold-onions-behave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'lighthouse-parade': minor
3+
---
4+
5+
Fix line ending bug

examples/exampleAggregatedMobileReport.csv

Lines changed: 320 additions & 320 deletions
Large diffs are not rendered by default.

lighthouse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ export const runLighthouseReport = async (url: string) => {
2121
throw new Error(`Lighthouse report failed for: ${url}`);
2222
}
2323

24-
return stdout;
24+
return String(stdout).replace(/\r\n/g, '\n');
2525
};

report-to-row.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export const reportToRow = (csvFileContents: string) => {
2525
const reportRows: LighthouseCSVReportRow[] | undefined = csvParse(
2626
csvFileContents,
2727
{
28+
// https://csv.js.org/parse/options/
2829
columns: true,
2930
skip_empty_lines: true,
3031
ltrim: true,
31-
relax: true, // https://csv.js.org/parse/options/
3232
}
3333
);
3434
// Sometimes reports come out half-baked...

scan-task.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const scan = (
7777
}
7878

7979
emit('info', 'Aggregating reports...');
80+
// TODO: Make aggregateCSVReports work without filesystem, for testing
8081
const aggregatedReportData = aggregateCSVReports(reportsDirPath);
8182
if (!aggregatedReportData) return;
8283

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
Requested URL,Final URL,Performance: Overall Performance Category Score (numeric),Performance: First Contentful Paint (numeric),Performance: Speed Index (numeric),Performance: Largest Contentful Paint (numeric),Performance: Time to Interactive (numeric),Performance: Total Blocking Time (numeric),Performance: Cumulative Layout Shift (numeric),Performance: First CPU Idle (numeric),Performance: Max Potential First Input Delay (numeric),Performance: First Meaningful Paint (numeric),Performance: Estimated Input Latency (numeric),Performance: Eliminate render-blocking resources (numeric),Performance: Properly size images (numeric),Performance: Defer offscreen images (numeric),Performance: Minify CSS (numeric),Performance: Minify JavaScript (numeric),Performance: Remove unused CSS (numeric),Performance: Remove unused JavaScript (numeric),Performance: Efficiently encode images (numeric),Performance: Serve images in next-gen formats (numeric),Performance: Enable text compression (numeric),Performance: Preconnect to required origins (numeric),Performance: Initial server response time was short (binary),Performance: Avoid multiple page redirects (numeric),Performance: Preload key requests (numeric),Performance: Use HTTP/2 (binary),Performance: Use video formats for animated content (numeric),Performance: Remove duplicate modules in JavaScript bundles (numeric),Performance: Avoid serving legacy JavaScript to modern browsers (numeric),Performance: Avoid enormous network payloads (numeric),Performance: Serve static assets with an efficient cache policy (numeric),Performance: Avoids an excessive DOM size (numeric),Performance: Avoid chaining critical requests (informative),Performance: User Timing marks and measures (notApplicable),Performance: JavaScript execution time (numeric),Performance: Minimizes main-thread work (numeric),Performance: Ensure text remains visible during webfont load (binary),Performance: Performance budget (notApplicable),Performance: Timing budget (notApplicable),Performance: Keep request counts low and transfer sizes small (informative),Performance: Minimize third-party usage (binary),Performance: Largest Contentful Paint element (informative),Performance: Avoid large layout shifts (informative),Performance: Uses passive listeners to improve scrolling performance (binary),Performance: Avoids `document.write()` (binary),Performance: Avoid long main-thread tasks (informative),Performance: Avoid non-composited animations (notApplicable),Performance: Image elements do not have explicit `width` and `height` (binary),Performance: Avoids large JavaScript libraries with smaller alternatives (binary),Performance: Network Requests (informative),Performance: Network Round Trip Times (informative),Performance: Server Backend Latencies (informative),Performance: Tasks (informative),Performance: Diagnostics (informative),Performance: Metrics (informative),Performance: Screenshot Thumbnails (informative),Performance: Final Screenshot (informative)
2-
https://lombardstreettattoo.com/,https://lombardstreettattoo.com/,1,1,1,0.98,1,1,1,1,0.27,1,1,0.78,0,1,0.87,1,0.87,1,1,0,1,1,1,1,0.66,1,1,1,1,0.28,0.14,1,-1,-1,1,1,0,-1,-1,-1,1,-1,-1,1,1,-1,-1,0,1,-1,-1,-1,-1,-1,-1,-1,"""-1""
3-
"
4-
https://lombardstreettattoo.com/cdn-cgi/l/email-protection,https://lombardstreettattoo.com/cdn-cgi/l/email-protection,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,-1,-1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,"""-1""
5-
"
2+
https://lombardstreettattoo.com/,https://lombardstreettattoo.com/,1,1,1,0.98,1,1,1,1,0.27,1,1,0.78,0,1,0.87,1,0.87,1,1,0,1,1,1,1,0.66,1,1,1,1,0.28,0.14,1,-1,-1,1,1,0,-1,-1,-1,1,-1,-1,1,1,-1,-1,0,1,-1,-1,-1,-1,-1,-1,-1,-1
3+
https://lombardstreettattoo.com/cdn-cgi/l/email-protection,https://lombardstreettattoo.com/cdn-cgi/l/email-protection,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,-1,-1,1,1,1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1

0 commit comments

Comments
 (0)