Skip to content

Commit 80224ea

Browse files
committed
Add ingress to our tab
1 parent 21ca852 commit 80224ea

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

lib/harAnalyzer.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { JSDOM } from 'jsdom';
2+
import { readFileSync } from 'node:fs';
23
import path from 'node:path';
34
import { fileURLToPath } from 'node:url';
45
import { ESLint } from 'eslint';
@@ -23,6 +24,10 @@ export class HarAnalyzer {
2324

2425
const libFolder = fileURLToPath(new URL('..', import.meta.url));
2526
this.pluginFolder = path.resolve(libFolder, '..');
27+
const packagePath = path.resolve(libFolder, 'package.json');
28+
this.package = JSON.parse(readFileSync(packagePath, 'utf8'));
29+
this.dependencies = this.package.dependencies;
30+
this.version = this.package.version;
2631
}
2732
transform2SimplifiedData(harData, url) {
2833
const data = {
@@ -225,6 +230,8 @@ export class HarAnalyzer {
225230
this.groups[group]['knowledgeData'].push(knowledgeData);
226231

227232
return {
233+
'version': this.version,
234+
'dependencies': this.dependencies,
228235
'url': url,
229236
'analyzedData': analyzedData,
230237
'knowledgeData': knowledgeData

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"jsdom": "26.0.0",
5454
"eslint": "9.24.0",
5555
"globals": "16.0.0",
56-
"@sitespeed.io/log": "0.2.6",
5756
"@sitespeed.io/plugin": "1.0.0"
5857
},
5958
"scripts": {

pug/index.pug

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
- let pluginData = pageInfo.data['webperf-plugin-javascript'].run ? pageInfo.data['webperf-plugin-javascript'].run : pageInfo.data['webperf-plugin-javascript'].pageSummary
22

3+
h2 Javascript
4+
p This plugin is used to check your Javascript code for errors and enforce coding standards and security. It can help you catch common mistakes, improve code quality, and ensure consistency across your scripts.
5+
br
6+
span Using plugin-javascript v#{pluginData.version}
7+
span with dependencies:
8+
each version, name in pluginData.dependencies
9+
span #{name} v#{version},
10+
311
if pluginData.knowledgeData && pluginData.knowledgeData.issues && Object.keys(pluginData.knowledgeData.issues).length > 0
412
- let issueSets = pluginData.knowledgeData.issues;
513
- let issues = Object.values(issueSets);
@@ -11,7 +19,7 @@ if pluginData.knowledgeData && pluginData.knowledgeData.issues && Object.keys(pl
1119
- return b.subIssues.length - a.subIssues.length;
1220
- });
1321

14-
h1 Issues
22+
h3 Issues
1523
table
1624
thead
1725
tr
@@ -40,7 +48,7 @@ if pluginData.knowledgeData && pluginData.knowledgeData.issues && Object.keys(pl
4048

4149
// Add tables for each rule
4250
each value in sortedIssues
43-
h2(id=`rule-${value.rule}`)= `${value.rule}`
51+
h4(id=`rule-${value.rule}`)= `${value.rule}`
4452
p
4553
strong Category:
4654
= value.category

0 commit comments

Comments
 (0)