@se-studio/site-check 2.25.3 → 2.25.6
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/CHANGELOG.md +26 -0
- package/develop-published-gate.mjs +19 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.25.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2eda093]
|
|
8
|
+
- @se-studio/core-ui@1.50.0
|
|
9
|
+
|
|
10
|
+
## 2.25.5
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [1b8c130]
|
|
15
|
+
- @se-studio/core-data-types@2.3.0
|
|
16
|
+
- @se-studio/core-ui@1.49.0
|
|
17
|
+
- @se-studio/contentful-rest-api@2.9.5
|
|
18
|
+
|
|
19
|
+
## 2.25.4
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- c82e3a6: Follow-up to the dotted From path fix. In 2.9.3, a From path with a dot is kept unless it ends in a static-asset extension, so `/.env`, `/.git`, `/wp-login.php`, `/backup.tar.gz` and `/feed.rss` were also kept; now they are rejected. `hasStaticAssetExtension` (core-data-types, re-exported by core-ui) also treats `.php`, `.gz` and `.rss` as files; the impossible-slug guard's own exemption list is unchanged, so a `.php` sitemap URL is still flagged. New `hasDotfileSegment` rejects any dotfile path segment except `/.well-known`. The site proxy template's trailing-slash helper now uses both, so `/blog/st.-louis` gets its 308 to `/blog/st.-louis/` while `/feed.xml` and `/.env` do not. site-check's sitemap parity stage now recognises a sitemap by its root element only (a prolog, comment, stylesheet or namespace prefix is fine; an HTML page that mentions `<urlset>` is not).
|
|
24
|
+
- Updated dependencies [c82e3a6]
|
|
25
|
+
- @se-studio/contentful-rest-api@2.9.4
|
|
26
|
+
- @se-studio/core-data-types@2.2.2
|
|
27
|
+
- @se-studio/core-ui@1.48.8
|
|
28
|
+
|
|
3
29
|
## 2.25.3
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -293,6 +293,21 @@ export function extractLocs(xml) {
|
|
|
293
293
|
.filter(Boolean);
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* What a sitemap body is, judged from its root element only: `'index'` (sitemapindex), `'urlset'`, or `null`
|
|
298
|
+
* (not a sitemap). The XML prolog (BOM, `<?xml ...?>`, processing instructions such as a stylesheet), comments
|
|
299
|
+
* and a DOCTYPE may come first; a namespace prefix is allowed and a self-closing root counts. A tag named
|
|
300
|
+
* inside a comment, an HTML page that mentions `<urlset>`, or `<urlsetx>` do not.
|
|
301
|
+
*/
|
|
302
|
+
export function sitemapRootKind(text) {
|
|
303
|
+
const body = String(text)
|
|
304
|
+
.replace(/^\uFEFF/, '')
|
|
305
|
+
.replace(/^(?:\s+|<\?[\s\S]*?\?>|<!--[\s\S]*?-->|<!DOCTYPE[^>]*>)+/i, '');
|
|
306
|
+
const m = /^<(?:[A-Za-z_][\w.-]*:)?(sitemapindex|urlset)(?=[\s/>])/.exec(body);
|
|
307
|
+
if (!m) return null;
|
|
308
|
+
return m[1] === 'sitemapindex' ? 'index' : 'urlset';
|
|
309
|
+
}
|
|
310
|
+
|
|
296
311
|
const STATIC_EXT_RE =
|
|
297
312
|
/\.(?:png|jpe?g|gif|svg|webp|avif|ico|pdf|css|js|map|xml|txt|json|zip|mp4|webm|woff2?|ttf)$/i;
|
|
298
313
|
|
|
@@ -325,7 +340,8 @@ export async function collectRootPageUrls(
|
|
|
325
340
|
const res = await fetchText(root);
|
|
326
341
|
if (res.status < 200 || res.status >= 300)
|
|
327
342
|
throw new Error(`sitemap root ${root} returned HTTP ${res.status}`);
|
|
328
|
-
const
|
|
343
|
+
const rootKind = sitemapRootKind(res.text);
|
|
344
|
+
const isIndex = rootKind === 'index';
|
|
329
345
|
const locs = extractLocs(res.text);
|
|
330
346
|
const rootPages = [];
|
|
331
347
|
if (!isIndex) {
|
|
@@ -339,13 +355,13 @@ export async function collectRootPageUrls(
|
|
|
339
355
|
const c = await fetchText(child);
|
|
340
356
|
if (c.status < 200 || c.status >= 300)
|
|
341
357
|
throw new Error(`child sitemap ${child} of ${root} returned HTTP ${c.status}`);
|
|
342
|
-
if (
|
|
358
|
+
if (sitemapRootKind(c.text) === 'index')
|
|
343
359
|
throw new Error(`child sitemap ${child} of ${root} is itself an index`);
|
|
344
360
|
rootPages.push(...extractLocs(c.text));
|
|
345
361
|
}
|
|
346
362
|
}
|
|
347
363
|
if (rootPages.length === 0) {
|
|
348
|
-
const isSitemap =
|
|
364
|
+
const isSitemap = rootKind !== null;
|
|
349
365
|
if (!allowEmpty) throw new Error(`sitemap root ${root} lists no URLs`);
|
|
350
366
|
if (!isSitemap) throw new Error(`sitemap root ${root} is not a sitemap`);
|
|
351
367
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@se-studio/site-check",
|
|
3
|
-
"version": "2.25.
|
|
3
|
+
"version": "2.25.6",
|
|
4
4
|
"description": "Validate SE marketing sites (sitemap, llms.txt) and download markdown files preserving structure",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -110,9 +110,9 @@
|
|
|
110
110
|
"url": "https://github.com/Something-Else-Studio/se-core-product/issues"
|
|
111
111
|
},
|
|
112
112
|
"dependencies": {
|
|
113
|
-
"@se-studio/contentful-rest-api": "2.9.
|
|
114
|
-
"@se-studio/core-data-types": "2.
|
|
115
|
-
"@se-studio/core-ui": "1.
|
|
113
|
+
"@se-studio/contentful-rest-api": "2.9.5",
|
|
114
|
+
"@se-studio/core-data-types": "2.3.0",
|
|
115
|
+
"@se-studio/core-ui": "1.50.0"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
118
|
"@biomejs/biome": "^2.6.8",
|