diff --git a/plugins/core/package.json b/plugins/core/package.json index 9b16753..f7047d0 100644 --- a/plugins/core/package.json +++ b/plugins/core/package.json @@ -12,7 +12,7 @@ } }, "scripts": { - "build": "tsc", + "build": "tsc && node scripts/copy-assets.js", "test": "vitest run" }, "dependencies": { diff --git a/plugins/core/scripts/copy-assets.js b/plugins/core/scripts/copy-assets.js new file mode 100644 index 0000000..7bdf1dd --- /dev/null +++ b/plugins/core/scripts/copy-assets.js @@ -0,0 +1,10 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const src = path.join(__dirname, '../src/report/sitegraph.html'); +const dest = path.join(__dirname, '../dist/report/sitegraph.html'); + +fs.copyFileSync(src, dest); diff --git a/plugins/core/src/report/sitegraph.html b/plugins/core/src/report/sitegraph.html new file mode 100644 index 0000000..9cb0191 --- /dev/null +++ b/plugins/core/src/report/sitegraph.html @@ -0,0 +1,629 @@ + + + + + + Crawlith Site Graph + + + +
+
Crawlith SiteGraph
+ +
+
-Pages
+
-Max Depth
+
-Efficiency
+
-Orphans
+
+ +
+
+ + +
+
+ + +
+
+
+ +
+
+
+ +
+ +
+
+ + +
+ + + + + + + + + diff --git a/plugins/core/src/report/sitegraph_template.ts b/plugins/core/src/report/sitegraph_template.ts index dae6354..31f1171 100644 --- a/plugins/core/src/report/sitegraph_template.ts +++ b/plugins/core/src/report/sitegraph_template.ts @@ -1,638 +1,9 @@ -export const SITEGRAPH_HTML = ` - - - - - Crawlith Site Graph - - - -
-
Crawlith SiteGraph
- -
-
-Pages
- -
-Max Depth
-
-Efficiency
-
-Orphans
-
- -
-
- - -
-
- - -
-
-
- -
-
-
- -
- -
-
- - -
- - - - - - - - - -`; +export const SITEGRAPH_HTML = fs.readFileSync(templatePath, 'utf-8');