aeo-linter 0.1.2 → 0.1.4
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/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview CLI
|
|
2
|
+
* @fileoverview Main CLI entrypoint for aeo-linter
|
|
3
3
|
*/
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import fs from 'node:fs/promises';
|
|
@@ -9,16 +9,16 @@ export async function runCli() {
|
|
|
9
9
|
const program = new Command();
|
|
10
10
|
program
|
|
11
11
|
.name('aeo-linter')
|
|
12
|
-
.description('Answer Engine Optimization (AEO/GEO) Linter -
|
|
13
|
-
.version('0.1.
|
|
14
|
-
.argument('<url>', '
|
|
15
|
-
.option('-j, --json', '
|
|
16
|
-
.option('--html', '
|
|
17
|
-
.option('-o, --output <file>', '
|
|
18
|
-
.option('-c, --categories <categories>', '
|
|
12
|
+
.description('Answer Engine Optimization (AEO/GEO) Linter - Google Lighthouse Architecture')
|
|
13
|
+
.version('0.1.2')
|
|
14
|
+
.argument('<url>', 'Target webpage URL to audit')
|
|
15
|
+
.option('-j, --json', 'Output full report in JSON format')
|
|
16
|
+
.option('--html', 'Generate an interactive visual HTML report dashboard')
|
|
17
|
+
.option('-o, --output <file>', 'File path to save the report (.html or .json)')
|
|
18
|
+
.option('-c, --categories <categories>', 'Comma-separated list of categories to audit')
|
|
19
19
|
.action(async (url, options) => {
|
|
20
20
|
try {
|
|
21
|
-
//
|
|
21
|
+
// Validate URL format
|
|
22
22
|
let validUrl;
|
|
23
23
|
try {
|
|
24
24
|
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
|
@@ -30,10 +30,10 @@ export async function runCli() {
|
|
|
30
30
|
new URL(validUrl);
|
|
31
31
|
}
|
|
32
32
|
catch {
|
|
33
|
-
console.error(`\x1b[31mError: URL
|
|
33
|
+
console.error(`\x1b[31mError: Invalid URL '${url}'\x1b[0m`);
|
|
34
34
|
process.exit(1);
|
|
35
35
|
}
|
|
36
|
-
//
|
|
36
|
+
// Filter categories if specified
|
|
37
37
|
let customConfig = defaultConfig;
|
|
38
38
|
if (options.categories) {
|
|
39
39
|
const selected = options.categories.split(',').map((c) => c.trim().toLowerCase());
|
|
@@ -44,7 +44,7 @@ export async function runCli() {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
if (Object.keys(filteredCategories).length === 0) {
|
|
47
|
-
console.error(`\x1b[31mError:
|
|
47
|
+
console.error(`\x1b[31mError: No valid categories selected. Available: ${Object.keys(defaultConfig.categories).join(', ')}\x1b[0m`);
|
|
48
48
|
process.exit(1);
|
|
49
49
|
}
|
|
50
50
|
customConfig = {
|
|
@@ -54,7 +54,7 @@ export async function runCli() {
|
|
|
54
54
|
}
|
|
55
55
|
const isQuiet = Boolean(options.json && !options.output);
|
|
56
56
|
if (!isQuiet) {
|
|
57
|
-
console.log(`\x1b[36m⚡
|
|
57
|
+
console.log(`\x1b[36m⚡ Starting AEO audit for:\x1b[0m ${validUrl}`);
|
|
58
58
|
}
|
|
59
59
|
const report = await Runner.run(validUrl, {
|
|
60
60
|
config: customConfig,
|
|
@@ -64,7 +64,7 @@ export async function runCli() {
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
});
|
|
67
|
-
//
|
|
67
|
+
// Generate output
|
|
68
68
|
if (options.output) {
|
|
69
69
|
const outPath = path.resolve(process.cwd(), options.output);
|
|
70
70
|
let content = '';
|
|
@@ -75,13 +75,13 @@ export async function runCli() {
|
|
|
75
75
|
content = HtmlReporter.generate(report);
|
|
76
76
|
}
|
|
77
77
|
await fs.writeFile(outPath, content, 'utf-8');
|
|
78
|
-
console.log(`\n\x1b[32m✔
|
|
78
|
+
console.log(`\n\x1b[32m✔ Report successfully saved to:\x1b[0m ${outPath}`);
|
|
79
79
|
}
|
|
80
80
|
else if (options.html) {
|
|
81
81
|
const defaultHtmlPath = path.resolve(process.cwd(), `aeo-report-${Date.now()}.html`);
|
|
82
82
|
const content = HtmlReporter.generate(report);
|
|
83
83
|
await fs.writeFile(defaultHtmlPath, content, 'utf-8');
|
|
84
|
-
console.log(`\n\x1b[32m✔
|
|
84
|
+
console.log(`\n\x1b[32m✔ Interactive HTML report generated at:\x1b[0m ${defaultHtmlPath}`);
|
|
85
85
|
}
|
|
86
86
|
else if (options.json) {
|
|
87
87
|
console.log(JSON.stringify(report, null, 2));
|
|
@@ -91,7 +91,7 @@ export async function runCli() {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
catch (err) {
|
|
94
|
-
console.error(`\x1b[31mError
|
|
94
|
+
console.error(`\x1b[31mError during AEO audit:\x1b[0m`, err instanceof Error ? err.message : err);
|
|
95
95
|
process.exit(1);
|
|
96
96
|
}
|
|
97
97
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aeo-linter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Command-line interface for Answer Engine Optimization (AEO/GEO) Linter",
|
|
5
5
|
"bin": {
|
|
6
6
|
"aeo-linter": "./bin/aeo-linter.js"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"author": "DrowLink",
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@drowlink/aeo-linter-core": "^0.1.
|
|
34
|
+
"@drowlink/aeo-linter-core": "^0.1.4",
|
|
35
35
|
"commander": "^12.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|