pagesight 0.5.0 → 0.5.1
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 +1 -1
- package/src/tools/sample-inspect.ts +13 -4
package/package.json
CHANGED
|
@@ -108,6 +108,15 @@ async function inspectSingle(url: string, siteUrl: string): Promise<InspectionSu
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
function humanizeState(state: string): string {
|
|
112
|
+
const map: Record<string, string> = {
|
|
113
|
+
PAGE_FETCH_STATE_UNSPECIFIED: "not yet crawled",
|
|
114
|
+
ROBOTS_TXT_STATE_UNSPECIFIED: "not yet checked",
|
|
115
|
+
INDEXING_STATE_UNSPECIFIED: "not yet determined",
|
|
116
|
+
};
|
|
117
|
+
return map[state] ?? state;
|
|
118
|
+
}
|
|
119
|
+
|
|
111
120
|
function formatResults(siteUrl: string, sitemapUrl: string, totalUrls: number, results: InspectionSummary[]): string {
|
|
112
121
|
const lines: string[] = [
|
|
113
122
|
`=== Sample Inspection: ${siteUrl} ===`,
|
|
@@ -153,7 +162,7 @@ function formatResults(siteUrl: string, sitemapUrl: string, totalUrls: number, r
|
|
|
153
162
|
lines.push("");
|
|
154
163
|
lines.push("Page fetch issues:");
|
|
155
164
|
for (const [state, count] of fetchIssues) {
|
|
156
|
-
lines.push(` ${state}: ${count}`);
|
|
165
|
+
lines.push(` ${humanizeState(state)}: ${count}`);
|
|
157
166
|
}
|
|
158
167
|
}
|
|
159
168
|
|
|
@@ -171,9 +180,9 @@ function formatResults(siteUrl: string, sitemapUrl: string, totalUrls: number, r
|
|
|
171
180
|
} else {
|
|
172
181
|
lines.push(` Verdict: ${r.verdict}`);
|
|
173
182
|
lines.push(` Coverage: ${r.coverageState}`);
|
|
174
|
-
lines.push(` Page fetch: ${r.pageFetchState}`);
|
|
175
|
-
if (r.robotsTxtState !== "ALLOWED") lines.push(` Robots.txt: ${r.robotsTxtState}`);
|
|
176
|
-
if (r.indexingState !== "INDEXING_ALLOWED") lines.push(` Indexing: ${r.indexingState}`);
|
|
183
|
+
lines.push(` Page fetch: ${humanizeState(r.pageFetchState)}`);
|
|
184
|
+
if (r.robotsTxtState !== "ALLOWED") lines.push(` Robots.txt: ${humanizeState(r.robotsTxtState)}`);
|
|
185
|
+
if (r.indexingState !== "INDEXING_ALLOWED") lines.push(` Indexing: ${humanizeState(r.indexingState)}`);
|
|
177
186
|
if (r.lastCrawlTime) lines.push(` Last crawled: ${r.lastCrawlTime}`);
|
|
178
187
|
if (r.googleCanonical && r.googleCanonical !== r.url) {
|
|
179
188
|
lines.push(` Google canonical: ${r.googleCanonical}`);
|