svelte-vitals 0.11.0 → 0.12.0

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/bin.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  knownRuleIds,
7
7
  readPackageVersion,
8
8
  run
9
- } from "./chunk-QI6NLWDD.js";
9
+ } from "./chunk-NBNJRN52.js";
10
10
 
11
11
  // src/bin.ts
12
12
  import mri from "mri";
@@ -95,13 +95,28 @@ async function detectAppHtmlLang(rt, cwd) {
95
95
  if (!await rt.exists(appHtmlPath)) return { presence: "none", value: "absent" };
96
96
  return detectHtmlLang(await rt.readFile(appHtmlPath));
97
97
  }
98
+ async function robotsRefsSitemap(rt, cwd) {
99
+ const p = rt.join(cwd, "static/robots.txt");
100
+ if (!await rt.exists(p)) return void 0;
101
+ try {
102
+ return /^\s*sitemap:/im.test(await rt.readFile(p));
103
+ } catch {
104
+ return void 0;
105
+ }
106
+ }
98
107
  async function collectProjectFacts(rt, cwd) {
99
108
  const [hasRobotsTxt, hasSitemap, htmlLang] = await Promise.all([
100
109
  existsAny(rt, cwd, ROBOTS_SOURCE_PATHS),
101
110
  existsAny(rt, cwd, SITEMAP_SOURCE_PATHS),
102
111
  detectAppHtmlLang(rt, cwd)
103
112
  ]);
104
- return { hasRobotsTxt, hasSitemap, htmlLang };
113
+ const robotsReferencesSitemap = await robotsRefsSitemap(rt, cwd);
114
+ return {
115
+ hasRobotsTxt,
116
+ hasSitemap,
117
+ htmlLang,
118
+ ...robotsReferencesSitemap !== void 0 ? { robotsReferencesSitemap } : {}
119
+ };
105
120
  }
106
121
 
107
122
  // src/providers/source/parse.ts
@@ -202,11 +217,14 @@ function tagsFromHead(head) {
202
217
  if (node.name === "meta") {
203
218
  const name = attrText(node.attributes, "name");
204
219
  const property = attrText(node.attributes, "property");
220
+ const content = name === "robots" ? attrText(node.attributes, "content") : void 0;
221
+ const noindex = content !== void 0 && /(^|[\s,])(noindex|none)([\s,]|$)/i.test(content);
205
222
  tags.push({
206
223
  kind: "meta",
207
224
  ...name ? { name } : {},
208
225
  ...property ? { property } : {},
209
- value: attrValue(node.attributes, "content")
226
+ value: attrValue(node.attributes, "content"),
227
+ ...noindex ? { noindex: true } : {}
210
228
  });
211
229
  } else if (node.name === "link") {
212
230
  const rel = attrText(node.attributes, "rel");
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  knownRuleIds,
7
7
  routeMatcher,
8
8
  run
9
- } from "./chunk-QI6NLWDD.js";
9
+ } from "./chunk-NBNJRN52.js";
10
10
  export {
11
11
  ProjectError,
12
12
  analyzeProject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-vitals",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "A SvelteKit SEO checker — not a runtime Web Vitals reporter. Static analysis of your routes' head metadata.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -42,7 +42,7 @@
42
42
  "mri": "^1.2.0",
43
43
  "svelte": "^5.56.3",
44
44
  "tinyglobby": "^0.2.17",
45
- "@svelte-vitals/core": "0.12.0"
45
+ "@svelte-vitals/core": "0.13.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/node": "^24.7.0"