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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pagesight",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "See your site the way search engines and AI see it.",
5
5
  "keywords": [
6
6
  "seo",
@@ -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}`);