sanity-plugin-seofields 1.6.3 → 1.6.5

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.
Files changed (45) hide show
  1. package/dist/{SeoPreview-XVAZYHCL.js → SeoPreview-KEGGQSPJ.js} +5 -4
  2. package/dist/{SeoPreview-PYYVZMY3.cjs.map → SeoPreview-KEGGQSPJ.js.map} +1 -1
  3. package/dist/{SeoPreview-PYYVZMY3.cjs → SeoPreview-WYH7NYNM.cjs} +6 -5
  4. package/dist/SeoPreview-WYH7NYNM.cjs.map +1 -0
  5. package/dist/{chunk-XXQURVNE.cjs → chunk-BCTPOWXA.cjs} +111 -111
  6. package/dist/{chunk-XXQURVNE.cjs.map → chunk-BCTPOWXA.cjs.map} +1 -1
  7. package/dist/{chunk-25JLWVEU.js → chunk-HDZZQCH7.js} +14 -8
  8. package/dist/chunk-HDZZQCH7.js.map +1 -0
  9. package/dist/{chunk-IQG5JWVT.js → chunk-KTL6NYNG.js} +4 -2
  10. package/dist/chunk-KTL6NYNG.js.map +1 -0
  11. package/dist/{chunk-ULFY5STC.js → chunk-XXA6WCWS.js} +3 -3
  12. package/dist/{chunk-ULFY5STC.js.map → chunk-XXA6WCWS.js.map} +1 -1
  13. package/dist/{chunk-YM3ZZ2HU.cjs → chunk-YHXUWGNA.cjs} +4 -2
  14. package/dist/chunk-YHXUWGNA.cjs.map +1 -0
  15. package/dist/{chunk-IFDLKZET.cjs → chunk-ZBHLMQTS.cjs} +14 -8
  16. package/dist/chunk-ZBHLMQTS.cjs.map +1 -0
  17. package/dist/cli.js +1 -1
  18. package/dist/{component-DS-Ve_nw.d.cts → component-CIE6Sy4F.d.cts} +1 -1
  19. package/dist/{component-CWZ0tlsq.d.ts → component-H52blyfc.d.ts} +1 -1
  20. package/dist/index.cjs +40 -15
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.js +32 -7
  23. package/dist/index.js.map +1 -1
  24. package/dist/next.cjs +77 -77
  25. package/dist/next.d.cts +2 -2
  26. package/dist/next.d.ts +2 -2
  27. package/dist/next.js +2 -2
  28. package/dist/schema/next.cjs +80 -80
  29. package/dist/schema/next.d.cts +3 -3
  30. package/dist/schema/next.d.ts +3 -3
  31. package/dist/schema/next.js +3 -3
  32. package/dist/schema.cjs +153 -153
  33. package/dist/schema.d.cts +4 -4
  34. package/dist/schema.d.ts +4 -4
  35. package/dist/schema.js +2 -2
  36. package/dist/{types-BdaGoGQE.d.cts → types-BxcJinOf.d.cts} +8 -8
  37. package/dist/{types-Dy7r5det.d.ts → types-CbYb4MsN.d.ts} +1 -1
  38. package/dist/{types-BjVpmBAX.d.cts → types-CyRdIF-3.d.cts} +1 -1
  39. package/dist/{types-BwmZmt9I.d.ts → types-Dp9Pfnt9.d.ts} +8 -8
  40. package/package.json +1 -1
  41. package/dist/SeoPreview-XVAZYHCL.js.map +0 -1
  42. package/dist/chunk-25JLWVEU.js.map +0 -1
  43. package/dist/chunk-IFDLKZET.cjs.map +0 -1
  44. package/dist/chunk-IQG5JWVT.js.map +0 -1
  45. package/dist/chunk-YM3ZZ2HU.cjs.map +0 -1
@@ -23,26 +23,32 @@ var startsWithStopWord = (title) => {
23
23
  };
24
24
  var truncate = (text, maxLength) => text.length > maxLength ? `${text.slice(0, maxLength)}\u2026` : text;
25
25
  var hasExcessivePunctuation = (title) => /[!@#$%^&*]{2,}/.test(title);
26
- var getMetaTitleValidationMessages = (title, keywords, isParentseoField) => {
26
+ var getMetaTitleValidationMessages = (title, keywords, isParentseoField, suffixLength = 0) => {
27
27
  const feedback = [];
28
28
  const minChar = 50;
29
29
  const maxChar = 60;
30
30
  const charCount = (title == null ? void 0 : title.length) || 0;
31
+ const combinedLength = charCount + suffixLength;
32
+ const suffixMessage = suffixLength > 0 ? ` Suffix value is included (${suffixLength} chars).` : "";
31
33
  if (!(title == null ? void 0 : title.trim())) {
32
34
  feedback.push({ text: "Meta Title is empty. Add content to improve SEO.", color: "red" });
33
35
  return feedback;
34
36
  }
35
- if (charCount < minChar)
37
+ if (combinedLength < minChar)
36
38
  feedback.push({
37
- text: `Title is ${charCount} characters \u2014 below recommended ${minChar}.`,
39
+ text: `Title is ${combinedLength} characters \u2014 below recommended ${minChar}.${suffixMessage}`,
38
40
  color: "orange"
39
41
  });
40
- else if (charCount > maxChar)
42
+ else if (combinedLength > maxChar)
41
43
  feedback.push({
42
- text: `Title is ${charCount} characters \u2014 exceeds recommended ${maxChar}.`,
44
+ text: `Title is ${combinedLength} characters \u2014 exceeds recommended ${maxChar}.${suffixMessage}`,
43
45
  color: "red"
44
46
  });
45
- else feedback.push({ text: `Title length (${charCount}) looks good for SEO.`, color: "green" });
47
+ else
48
+ feedback.push({
49
+ text: `Title length (${combinedLength}) looks good for SEO.${suffixMessage}`,
50
+ color: "green"
51
+ });
46
52
  if (isParentseoField) {
47
53
  if (keywords.length > 0) {
48
54
  const hasKeyword = hasMatchingKeyword(title, keywords);
@@ -481,5 +487,5 @@ exports.getTwitterImageUrlValidation = getTwitterImageUrlValidation;
481
487
  exports.getTwitterImageValidation = getTwitterImageValidation;
482
488
  exports.getTwitterTitleValidation = getTwitterTitleValidation;
483
489
  exports.truncate = truncate;
484
- //# sourceMappingURL=chunk-IFDLKZET.cjs.map
485
- //# sourceMappingURL=chunk-IFDLKZET.cjs.map
490
+ //# sourceMappingURL=chunk-ZBHLMQTS.cjs.map
491
+ //# sourceMappingURL=chunk-ZBHLMQTS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/seoUtils.ts"],"names":[],"mappings":";;;AAEO,IAAM,YAAY,CAAC,KAAA,EAAO,KAAK,IAAA,EAAM,KAAA,EAAO,MAAM,KAAK,CAAA;AAEvD,IAAM,kBAAA,GAAqB,CAAC,KAAA,EAAe,WAAA,KAAmC;AACnF,EAAA,IAAI,CAAC,KAAA,IAAS,WAAA,CAAY,MAAA,KAAW,GAAG,OAAO,KAAA;AAC/C,EAAA,MAAM,UAAA,GAAa,MAAM,WAAA,EAAY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,kEAAA;AAAA,QACN,KAAA,EAAO;AAAA,OACR,CAAA;AAAA,EACL;AAEA,EAAA,OAAO,QAAA;AACT;AAEO,IAAM,4BAAA,GAA+B,CAC1C,QAAA,EACA,SAAA,KACmB;AACnB,EAAA,MAAM,WAA2B,EAAC;AAElC,EAAA,IAAI,EAAC,qCAAU,IAAA,EAAA,CAAA,EAAQ;AACrB,IAAA,QAAA,CAAS,IAAA,CAAK;AAAA,MACZ,IAAA,EAAM,+DAAA;AAAA,MACN,KAAA,EAAO;AAAA,KACR,CAAA;AACD,IAAA,OAAO,QAAA;AAAA,EACT;AAEA,EAAA,QAAA,CAAS,KAAK,EAAC,IAAA,EAAM,qDAAA,EAAkD,KAAA,EAAO,SAAQ,CAAA;AAEtF,EAAA,MAAM,OAAA,GAAU,eAAe,SAAS,CAAA;AACxC,EAAA,MAAM,KAAA,GAAQ,aAAA,CAAc,SAAA,IAAA,IAAA,GAAA,MAAA,GAAA,SAAA,CAAW,SAAgD,CAAA;AAEvF,EAAA,IAAI,WAAW,KAAA,EAAO;AACpB,IAAA,QAAA,CAAS,KAAK,EAAC,IAAA,EAAM,0DAAA,EAAuD,KAAA,EAAO,SAAQ,CAAA;AAAA,EAC7F,CAAA,MAAO;AACL,IAAA,IAAI,CAAC,OAAA;AACH,MAAA,QAAA,CAAS,IAAA,CAAK;AAAA,QACZ,IAAA,EAAM,gEAAA;AAAA,QACN,KAAA,EAAO;AAAA,OACR,CAAA;AACH,IAAA,IAAI,CAAC,KAAA;AACH,MAAA,QAAA,CAAS,IAAA,CAAK;AAAA,QACZ,IAAA,EAAM,kEAAA;AAAA,QACN,KAAA,EAAO;AAAA,OACR,CAAA;AAAA,EACL;AAEA,EAAA,OAAO,QAAA;AACT","file":"chunk-ZBHLMQTS.cjs","sourcesContent":["import {FeedbackType} from '../types'\n\nexport const stopWords = ['the', 'a', 'an', 'and', 'or', 'but']\n\nexport const hasMatchingKeyword = (title: string, keywordList: string[]): boolean => {\n if (!title || keywordList.length === 0) return false\n const lowerTitle = title.toLowerCase()\n return keywordList.some((keyword) => keyword && lowerTitle.includes(keyword.toLowerCase()))\n}\n\nexport const hasKeywordOveruse = (\n title: string,\n keywordList: string[],\n maxOccurrences = 3,\n): boolean => {\n if (!title || keywordList.length === 0) return false\n const lowerTitle = title.toLowerCase()\n return keywordList.some((keyword) => {\n if (!keyword) return false\n const matches = lowerTitle.match(new RegExp(keyword.toLowerCase(), 'g'))\n return matches ? matches.length > maxOccurrences : false\n })\n}\n\nexport const startsWithStopWord = (title: string): boolean => {\n if (!title) return false\n const firstWord = title.trim().split(' ')[0].toLowerCase()\n return stopWords.includes(firstWord)\n}\n\nexport const primaryKeywordAtStart = (title: string, keywords: string[]): boolean => {\n if (!title || keywords.length === 0) return true\n return title.toLowerCase().startsWith(keywords[0].toLowerCase())\n}\n\nexport const truncate = (text: string, maxLength: number): string =>\n text.length > maxLength ? `${text.slice(0, maxLength)}…` : text\n\nexport const hasExcessivePunctuation = (title: string): boolean => /[!@#$%^&*]{2,}/.test(title)\n\nexport const getMetaTitleValidationMessages = (\n title: string,\n keywords: string[],\n isParentseoField: boolean,\n suffixLength = 0,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n\n const minChar = 50\n const maxChar = 60\n const charCount = title?.length || 0\n const combinedLength = charCount + suffixLength\n const suffixMessage = suffixLength > 0 ? ` Suffix value is included (${suffixLength} chars).` : ''\n\n // Empty check\n if (!title?.trim()) {\n feedback.push({text: 'Meta Title is empty. Add content to improve SEO.', color: 'red'})\n return feedback\n }\n\n // Length check (evaluated against combined title + suffix length)\n if (combinedLength < minChar)\n feedback.push({\n text: `Title is ${combinedLength} characters — below recommended ${minChar}.${suffixMessage}`,\n color: 'orange',\n })\n else if (combinedLength > maxChar)\n feedback.push({\n text: `Title is ${combinedLength} characters — exceeds recommended ${maxChar}.${suffixMessage}`,\n color: 'red',\n })\n else\n feedback.push({\n text: `Title length (${combinedLength}) looks good for SEO.${suffixMessage}`,\n color: 'green',\n })\n\n // Keyword checks\n if (isParentseoField) {\n if (keywords.length > 0) {\n const hasKeyword = hasMatchingKeyword(title, keywords)\n feedback.push({\n text: hasKeyword\n ? 'Keyword found in title — good job!'\n : 'Keywords defined but missing in title.',\n color: hasKeyword ? 'green' : 'red',\n })\n\n if (hasKeywordOveruse(title, keywords)) {\n feedback.push({\n text: 'Keyword appears too many times — avoid keyword stuffing.',\n color: 'orange',\n })\n }\n } else {\n feedback.push({\n text: 'No keywords defined. Consider adding relevant keywords.',\n color: 'orange',\n })\n }\n }\n\n // Stop word check\n if (startsWithStopWord(title))\n feedback.push({text: 'Title starts with a stop word — consider rephrasing.', color: 'orange'})\n\n // Punctuation check\n if (hasExcessivePunctuation(title))\n feedback.push({text: 'Title contains excessive punctuation — simplify it.', color: 'orange'})\n\n return feedback\n}\n\nexport const getMetaDescriptionValidationMessages = (\n description: string,\n keywords: string[],\n isParentseoField: boolean,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n\n const minChar = 120\n const maxChar = 160\n const charCount = description?.length || 0\n\n if (!description?.trim()) {\n feedback.push({text: 'Meta description is empty. Add content to improve SEO.', color: 'red'})\n return feedback\n }\n\n // Length check\n if (charCount < minChar)\n feedback.push({\n text: `Description is ${charCount} chars — below recommended ${minChar}.`,\n color: 'orange',\n })\n else if (charCount > maxChar)\n feedback.push({\n text: `Description is ${charCount} chars — exceeds recommended ${maxChar}.`,\n color: 'red',\n })\n else\n feedback.push({text: `Description length (${charCount}) looks good for SEO.`, color: 'green'})\n\n // Keyword checks\n if (isParentseoField) {\n if (keywords.length > 0) {\n const hasKeyword = hasMatchingKeyword(description, keywords)\n feedback.push({\n text: hasKeyword\n ? 'Keyword found in description — good job!'\n : 'Keywords defined but missing in description.',\n color: hasKeyword ? 'green' : 'red',\n })\n\n if (hasKeywordOveruse(description, keywords)) {\n feedback.push({\n text: 'Keyword appears too many times — avoid keyword stuffing.',\n color: 'orange',\n })\n }\n } else {\n feedback.push({\n text: 'No keywords defined. Consider adding relevant keywords.',\n color: 'orange',\n })\n }\n }\n\n // Stop word / filler check\n if (startsWithStopWord(description))\n feedback.push({\n text: 'Description starts with a stop word — consider rephrasing.',\n color: 'orange',\n })\n\n // Punctuation / special characters\n if (hasExcessivePunctuation(description))\n feedback.push({\n text: 'Description contains excessive punctuation — simplify it.',\n color: 'orange',\n })\n\n return feedback\n}\n\nexport const getOgTitleValidation = (\n title: string,\n keywords: string[] = [],\n isParentseoField: boolean,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n const min = 40\n const max = 60\n const count = title?.length || 0\n\n // Empty check\n if (!title?.trim()) {\n feedback.push({text: 'OG Title is empty. Add content for better social preview.', color: 'red'})\n return feedback\n }\n\n // Length check\n if (count < min)\n feedback.push({\n text: `OG Title is ${count} chars — shorter than recommended ${min}.`,\n color: 'orange',\n })\n else if (count > max)\n feedback.push({text: `OG Title is ${count} chars — exceeds recommended ${max}.`, color: 'red'})\n else feedback.push({text: `OG Title length (${count}) looks good.`, color: 'green'})\n\n if (isParentseoField) {\n // Keyword checks\n if (keywords.length > 0) {\n const hasKeyword = hasMatchingKeyword(title, keywords)\n feedback.push({\n text: hasKeyword\n ? 'Keyword found in OG title — good job!'\n : 'Keywords defined but missing in OG title.',\n color: hasKeyword ? 'green' : 'red',\n })\n\n if (hasKeywordOveruse(title, keywords)) {\n feedback.push({\n text: 'Keyword appears too many times in OG title — avoid keyword stuffing.',\n color: 'orange',\n })\n }\n } else {\n feedback.push({\n text: 'No keywords defined. Consider adding relevant keywords.',\n color: 'orange',\n })\n }\n }\n\n // Additional OG-specific checks\n if (startsWithStopWord(title))\n feedback.push({\n text: 'OG Title starts with a stop word — consider rephrasing.',\n color: 'orange',\n })\n\n if (hasExcessivePunctuation(title))\n feedback.push({text: 'OG Title contains excessive punctuation — simplify it.', color: 'orange'})\n\n return feedback\n}\n\nexport const getOgDescriptionValidation = (\n desc: string,\n keywords: string[] = [],\n isParentseoField: boolean,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n const min = 90\n const max = 120\n const count = desc?.length || 0\n\n // Empty check\n if (!desc?.trim()) {\n feedback.push({\n text: 'OG Description is empty. Add content for better social preview.',\n color: 'red',\n })\n return feedback\n }\n\n // Length check\n if (count < min)\n feedback.push({\n text: `OG Description is ${count} chars — shorter than recommended ${min}.`,\n color: 'orange',\n })\n else if (count > max)\n feedback.push({\n text: `OG Description is ${count} chars — exceeds recommended ${max}.`,\n color: 'red',\n })\n else feedback.push({text: `OG Description length (${count}) looks good.`, color: 'green'})\n\n // Keyword checks\n if (isParentseoField) {\n if (keywords.length > 0) {\n const hasKeyword = hasMatchingKeyword(desc, keywords)\n feedback.push({\n text: hasKeyword\n ? 'Keyword found in OG description — good job!'\n : 'Keywords defined but missing in OG description.',\n color: hasKeyword ? 'green' : 'red',\n })\n\n if (hasKeywordOveruse(desc, keywords)) {\n feedback.push({\n text: 'Keyword appears too many times in OG description — avoid keyword stuffing.',\n color: 'orange',\n })\n }\n } else {\n feedback.push({\n text: 'No keywords defined. Consider adding relevant keywords.',\n color: 'orange',\n })\n }\n }\n\n // Additional OG-specific checks\n if (startsWithStopWord(desc))\n feedback.push({\n text: 'OG Description starts with a stop word — consider rephrasing.',\n color: 'orange',\n })\n\n if (hasExcessivePunctuation(desc))\n feedback.push({\n text: 'OG Description contains excessive punctuation — simplify it.',\n color: 'orange',\n })\n\n return feedback\n}\n\nexport const getTwitterTitleValidation = (\n title: string,\n keywords: string[] = [],\n isParentseoField: boolean,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n const min = 30\n const max = 70\n const count = title?.length || 0\n\n if (!title?.trim()) {\n feedback.push({text: 'X Title is empty. Add content for better SEO.', color: 'red'})\n return feedback\n }\n\n // Length check\n if (count < min)\n feedback.push({\n text: `X Title is ${count} chars — shorter than recommended ${min}.`,\n color: 'orange',\n })\n else if (count > max)\n feedback.push({\n text: `X Title is ${count} chars — exceeds recommended ${max}.`,\n color: 'red',\n })\n else feedback.push({text: `X Title length (${count}) looks good.`, color: 'green'})\n\n if (isParentseoField) {\n // Keyword checks\n if (keywords.length > 0) {\n const hasKeyword = hasMatchingKeyword(title, keywords)\n feedback.push({\n text: hasKeyword\n ? 'Keyword found in X title — good job!'\n : 'Keywords defined but missing in X title.',\n color: hasKeyword ? 'green' : 'red',\n })\n } else {\n feedback.push({\n text: 'No keywords defined. Consider adding relevant keywords.',\n color: 'orange',\n })\n }\n }\n\n // Punctuation check\n if (/[!@#$%^&*]{2,}/.test(title))\n feedback.push({text: 'X Title has excessive punctuation — simplify it.', color: 'orange'})\n\n return feedback\n}\n\nexport const getTwitterDescriptionValidation = (\n desc: string,\n keywords: string[] = [],\n isParentseoField: boolean,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n const min = 50\n const max = 200\n const count = desc?.length || 0\n\n if (!desc?.trim()) {\n feedback.push({text: 'X Description is empty. Add content for better SEO.', color: 'red'})\n return feedback\n }\n\n // Length check\n if (count < min)\n feedback.push({\n text: `X Description is ${count} chars — shorter than recommended ${min}.`,\n color: 'orange',\n })\n else if (count > max)\n feedback.push({\n text: `X Description is ${count} chars — exceeds recommended ${max}.`,\n color: 'red',\n })\n else feedback.push({text: `X Description length (${count}) looks good.`, color: 'green'})\n\n if (isParentseoField) {\n // Keyword checks\n if (keywords.length > 0) {\n const hasKeyword = hasMatchingKeyword(desc, keywords)\n feedback.push({\n text: hasKeyword\n ? 'Keyword found in X description — good job!'\n : 'Keywords defined but missing in X description.',\n color: hasKeyword ? 'green' : 'red',\n })\n } else {\n feedback.push({\n text: 'No keywords defined. Consider adding relevant keywords.',\n color: 'orange',\n })\n }\n }\n\n // Punctuation check\n if (/[!@#$%^&*]{2,}/.test(desc))\n feedback.push({\n text: 'X Description has excessive punctuation — simplify it.',\n color: 'orange',\n })\n\n return feedback\n}\n\n// ── Image Validation Helpers ──\n\n/** Check if an image is set in an OG/Twitter sub-object (handles upload vs URL) */\nexport const isSubImageSet = (subObj: Record<string, unknown> | null | undefined): boolean => {\n if (!subObj) return false\n if (subObj.imageType === 'url') return !!(subObj.imageUrl as string)?.trim()\n const img = subObj.image as Record<string, unknown> | undefined\n return !!img?.asset\n}\n\n/** Check if metaImage asset is set */\nconst isMetaImageSet = (seoParent: Record<string, unknown> | null | undefined): boolean => {\n if (!seoParent) return false\n const metaImage = seoParent.metaImage as Record<string, unknown> | undefined\n return !!metaImage?.asset\n}\n\nexport const getMetaImageValidation = (\n hasImage: boolean,\n seoParent: Record<string, unknown> | null | undefined,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n\n if (!hasImage) {\n feedback.push({\n text: 'No meta image provided. Adding an image improves click-through rates.',\n color: 'red',\n })\n return feedback\n }\n\n feedback.push({text: 'Meta image is set — great for SEO and social sharing.', color: 'green'})\n\n const ogSet = isSubImageSet(seoParent?.openGraph as Record<string, unknown> | undefined)\n const twSet = isSubImageSet(seoParent?.twitter as Record<string, unknown> | undefined)\n\n if (!ogSet && !twSet) {\n feedback.push({\n text: 'OG and Twitter images are missing — add them for full social coverage.',\n color: 'orange',\n })\n } else if (!ogSet) {\n feedback.push({\n text: 'OG image is missing — add it for better Facebook/LinkedIn previews.',\n color: 'orange',\n })\n } else if (twSet) {\n feedback.push({text: 'All images set (Meta, OG, Twitter) — full coverage!', color: 'green'})\n } else {\n feedback.push({\n text: 'Twitter image is missing — add it for better X (Twitter) cards.',\n color: 'orange',\n })\n }\n\n return feedback\n}\n\nexport const getOgImageValidation = (\n hasImage: boolean,\n altText: string | undefined,\n seoParent: Record<string, unknown> | null | undefined,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n\n if (!hasImage) {\n feedback.push({\n text: 'No OG image provided. Social shares will lack a visual preview.',\n color: 'red',\n })\n return feedback\n }\n\n feedback.push({text: 'OG image is set — good for social sharing.', color: 'green'})\n\n if (altText?.trim()) {\n feedback.push({text: 'Alt text is set — good for accessibility.', color: 'green'})\n } else {\n feedback.push({text: 'Consider adding alt text for better accessibility.', color: 'orange'})\n }\n\n const metaSet = isMetaImageSet(seoParent)\n const twSet = isSubImageSet(seoParent?.twitter as Record<string, unknown> | undefined)\n\n if (metaSet && twSet) {\n feedback.push({text: 'All images set (Meta, OG, Twitter) — full coverage!', color: 'green'})\n } else {\n if (!metaSet)\n feedback.push({\n text: 'Meta image is missing — add it for search engine results.',\n color: 'orange',\n })\n if (!twSet)\n feedback.push({\n text: 'Twitter image is missing — add it for X (Twitter) cards.',\n color: 'orange',\n })\n }\n\n return feedback\n}\n\nexport const getOgImageUrlValidation = (\n imageUrl: string | undefined,\n seoParent: Record<string, unknown> | null | undefined,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n\n if (!imageUrl?.trim()) {\n feedback.push({\n text: 'No OG image URL provided. Social shares will lack a visual preview.',\n color: 'red',\n })\n return feedback\n }\n\n feedback.push({text: 'OG image URL is set — good for social sharing.', color: 'green'})\n\n const metaSet = isMetaImageSet(seoParent)\n const twSet = isSubImageSet(seoParent?.twitter as Record<string, unknown> | undefined)\n\n if (metaSet && twSet) {\n feedback.push({text: 'All images set (Meta, OG, Twitter) — full coverage!', color: 'green'})\n } else {\n if (!metaSet)\n feedback.push({\n text: 'Meta image is missing — add it for search engine results.',\n color: 'orange',\n })\n if (!twSet)\n feedback.push({\n text: 'Twitter image is missing — add it for X (Twitter) cards.',\n color: 'orange',\n })\n }\n\n return feedback\n}\n\nexport const getTwitterImageValidation = (\n hasImage: boolean,\n altText: string | undefined,\n seoParent: Record<string, unknown> | null | undefined,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n\n if (!hasImage) {\n feedback.push({\n text: 'No Twitter image provided. Posts on X will lack a visual.',\n color: 'red',\n })\n return feedback\n }\n\n feedback.push({text: 'Twitter image is set — good for X sharing.', color: 'green'})\n\n if (altText?.trim()) {\n feedback.push({text: 'Alt text is set — good for accessibility.', color: 'green'})\n } else {\n feedback.push({text: 'Consider adding alt text for better accessibility.', color: 'orange'})\n }\n\n const metaSet = isMetaImageSet(seoParent)\n const ogSet = isSubImageSet(seoParent?.openGraph as Record<string, unknown> | undefined)\n\n if (metaSet && ogSet) {\n feedback.push({text: 'All images set (Meta, OG, Twitter) — full coverage!', color: 'green'})\n } else {\n if (!metaSet)\n feedback.push({\n text: 'Meta image is missing — add it for search engine results.',\n color: 'orange',\n })\n if (!ogSet)\n feedback.push({\n text: 'OG image is missing — add it for Facebook/LinkedIn sharing.',\n color: 'orange',\n })\n }\n\n return feedback\n}\n\nexport const getTwitterImageUrlValidation = (\n imageUrl: string | undefined,\n seoParent: Record<string, unknown> | null | undefined,\n): FeedbackType[] => {\n const feedback: FeedbackType[] = []\n\n if (!imageUrl?.trim()) {\n feedback.push({\n text: 'No Twitter image URL provided. Posts on X will lack a visual.',\n color: 'red',\n })\n return feedback\n }\n\n feedback.push({text: 'Twitter image URL is set — good for X sharing.', color: 'green'})\n\n const metaSet = isMetaImageSet(seoParent)\n const ogSet = isSubImageSet(seoParent?.openGraph as Record<string, unknown> | undefined)\n\n if (metaSet && ogSet) {\n feedback.push({text: 'All images set (Meta, OG, Twitter) — full coverage!', color: 'green'})\n } else {\n if (!metaSet)\n feedback.push({\n text: 'Meta image is missing — add it for search engine results.',\n color: 'orange',\n })\n if (!ogSet)\n feedback.push({\n text: 'OG image is missing — add it for Facebook/LinkedIn sharing.',\n color: 'orange',\n })\n }\n\n return feedback\n}\n"]}
package/dist/cli.js CHANGED
@@ -61,7 +61,7 @@ ${e}`}function ft(e,t,n,o){a.success(`Updated ${e}`),a.dim(""),a.dim(" What was
61
61
  title,
62
62
  slug,
63
63
  seo
64
- } | order(_updatedAt desc)`;o.text="Fetching documents...";let c;try{c=await s.fetch(d);}catch(g){o.fail(`Failed to fetch: ${g.message}`),process.exit(1);}if(o.succeed(`Analysed ${c.length} document(s)`),c.length===0){a.warn("No documents with SEO fields found."),n&&Se(i);return}let u=c.map(g=>({doc:g,health:K(g)}));await gt(u,c,e),n&&Se(i);}async function gt(e,t,n){let o={excellent:0,good:0,fair:0,poor:0,missing:0},s=0;for(let{health:c}of e)o[c.status]=(o[c.status]||0)+1,s+=c.score;let i=Math.round(s/e.length);if(pt(t,i,o),n.format==="summary")return;n.format!=="table"&&(a.info(""),a.warn(`Unknown format "${n.format}", defaulting to table output.`)),St(e);let r={};for(let{health:c}of e)for(let u of c.issues)r[u]=(r[u]||0)+1;let d=Object.entries(r).sort(([,c],[,u])=>u-c).slice(0,10);d.length>0&&$t(d,t.length),a.info("");}function pt(e,t,n){a.heading("\u{1F4CA} Summary"),a.info(""),a.info(` Total documents: ${l.bold(String(e.length))}`),a.info(` Average score: ${l.bold(we(t))}%`),a.info(""),a.info(` ${A.excellent} Excellent (80+): ${n.excellent}`),a.info(` ${A.good} Good (60-79): ${n.good}`),a.info(` ${A.fair} Fair (40-59): ${n.fair}`),a.info(` ${A.poor} Poor (1-39): ${n.poor}`),a.info(` ${A.missing} Missing (0): ${n.missing}`);}var mt={excellent:"Excellent",good:"Good",fair:"Fair",poor:"Poor",missing:"Missing"},ht={excellent:l.green,good:l.blue,fair:l.yellow,poor:l.red,missing:l.dim};function yt(e,t=11){var s,i;let n=((s=mt[e])!=null?s:e).padEnd(t);return ((i=ht[e])!=null?i:(r=>r))(n)}function St(e){a.heading("\u{1F4CB} Documents"),a.info("");let t=Math.min(44,Math.max(5,...e.map(({doc:r})=>(r.title||r._id).length))),n=11,o=14,s=5,i=l.dim("\u2500".repeat(s+2+n+2+o+2+t));a.info(` ${l.dim("Score".padEnd(s))} ${l.dim("Status".padEnd(n))} ${l.dim("Type".padEnd(o))} ${l.dim("Title")}`),a.info(` ${i}`);for(let{doc:r,health:d}of e){let c=$e(r.title||r._id,t),u=String(d.score).padStart(s),f=yt(d.status,n),g=l.dim($e(r._type,o).padEnd(o));a.info(` ${we(d.score,u)} ${f} ${g} ${c}`);}}function $t(e,t){a.heading("\u{1F50D} Top Issues"),a.info("");for(let[n,o]of e){let s=Math.round(o/t*100);a.info(` ${l.red(String(o).padStart(4))} docs (${s}%) ${n}`);}}function Se(e){a.info(""),a.info(` ${l.dim("\u2500".repeat(52))}`),a.info(` ${l.dim("Connection info")}`),a.info(` ${l.dim("Project ID:")} ${l.white(e.projectId)} ${l.dim(`\u2190 ${e.sources.projectId}`)}`),a.info(` ${l.dim("Dataset: ")} ${l.white(e.dataset)} ${l.dim(`\u2190 ${e.sources.dataset}`)}`),a.info(` ${l.dim("Token: ")} ${l.dim(e.sources.token)}`),a.info("");}function we(e,t){let n=t!=null?t:String(e);return e>=80?l.green(n):e>=60?l.blue(n):e>=40?l.yellow(n):e>0?l.red(n):l.dim(n)}function $e(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}H();var Z="1.6.3",ve=[l.cyan,e=>l.bold(l.blue(e)),l.blue,l.magenta,l.red,l.yellow],w=ve[Math.floor(Math.random()*ve.length)],Ce=["Run `seofields doctor` first to verify your setup is correct.","Use `seofields report --format summary` for a quick overview.","Export your SEO data before making bulk changes: `seofields export -o backup.json`.","Add `seoFields` type to every document schema to track SEO health.","A meta title between 50\u201360 characters gets the best click-through rate.","Meta descriptions should be 140\u2013160 characters for optimal display.","Open Graph images should be 1200\xD7630px for best social sharing.","Use `seofields config --baseUrl=https://yoursite.com` to enable canonical URLs.","Twitter Card images require a separate `twitterImage` field for best results.","Schema.org markup helps search engines understand your content structure.","Use `seofields report --types post,page` to filter by document type.","The `healthDashboard` tool gives a live view of SEO scores inside Sanity Studio.","Keywords should appear naturally \u2014 avoid keyword stuffing.","Every page needs a unique meta title. Duplicates hurt rankings.","Use `seofields export --format csv` to open SEO data in a spreadsheet.","Set `noIndex: true` on internal or draft pages to prevent indexing.","OG title and meta title can differ \u2014 OG is optimised for social, meta for search.","Run `seofields report` after content migrations to catch regressions.","Use `seofields init --schema-org` to add structured data support.","Structured data (Schema.org) can unlock rich results in Google Search.","A score of 80+ is excellent. Aim to get all key pages there.","The `seoPreview` option shows a live Google-style preview inside the editor.","Use `seofields report` in CI to catch SEO regressions before they ship.","Use `--dataset staging` to run reports against your staging dataset.","Keep your license key private \u2014 never commit it to version control.","Use `seofields config --healthDashboard.showDocumentId=true` for easier debugging.","Use `seofields export --format json --output report.json` to save SEO data to a file.","Alt text on images improves both accessibility and image search ranking.","Canonical URLs prevent duplicate content penalties from search engines.","A missing OG image means social shares show a blank card \u2014 always add one.","Use descriptive slugs: `/blog/seo-tips` ranks better than `/blog/post-123`.","Re-run `seofields report` monthly to track your SEO health over time.","The `types` filter helps you focus reports on high-priority content.","Use `seofields export` to back up SEO data before schema migrations.","Short meta titles (under 30 chars) waste valuable search result space.","Long meta descriptions get truncated \u2014 stay under 160 characters.","Twitter Cards need `twitter:card`, `twitter:title`, and `twitter:image` at minimum.","Use `seofields doctor` after upgrading the plugin to catch breaking changes.","JSON export includes health scores \u2014 pipe it into your analytics pipeline.","Set a `defaultHiddenFields` list to keep the SEO panel focused.","Internal links pass authority \u2014 make sure important pages are well-linked.","Page speed is a ranking factor \u2014 optimise images referenced in SEO fields.","Use consistent brand phrasing in meta titles across your site.","Structured data errors can be tested at schema.org/validator.","Focus first on pages with the most traffic, not just the lowest scores.","Add SEO review to your content publishing checklist.","Use `seofields config --healthDashboard.licenseKey=KEY` to unlock premium features.","The CSV export makes it easy to share SEO audits with non-technical stakeholders.","Every image on your page should have descriptive alt text.","Avoid duplicate meta descriptions \u2014 each page needs its own."];function bt(){return Ce[Math.floor(Math.random()*Ce.length)]}var wt=62,V=wt-2;function vt(e,t){let n=e.split(" "),o=[],s="";for(let i of n)s.length+(s?1:0)+i.length>t?(s&&o.push(s),s=i):s=s?`${s} ${i}`:i;return s&&o.push(s),o}function F(e,t){let n=V-3,o=" ".repeat(Math.max(0,n-t));return ` ${w("\u2502")} ${e}${o} ${w("\u2502")}`}function M(){return F("",0)}function xe(){let e="\u2500".repeat(V),t=bt(),n=V-3-5,o=vt(t,n);console.log(),console.log(` ${w(`\u256D${e}\u256E`)}`),console.log(M()),console.log(F(`${l.bold(l.green("seofields"))}${l.dim(` v${Z}`)}`,`seofields v${Z}`.length)),console.log(F(l.dim("SEO tooling for Sanity CMS \u2014 manage from your terminal"),54)),console.log(M());for(let i=0;i<o.length;i++){let r=i===0?`${l.dim("Tip: ")}${l.white(o[i])}`:` ${l.white(o[i])}`,d=5+o[i].length;console.log(F(r,d));}console.log(M()),console.log(` ${w(`\u2570${e}\u256F`)}`),console.log(),console.log(` ${l.bold("Commands")}`),console.log();let s=[["init ","Add seofields() to sanity.config"],["config ","Update plugin configuration options"],["create-config ","Create seofields.cli.ts / .js interactively"],["report ","SEO health report across all documents"],["export ","Export SEO fields as JSON or CSV"],["doctor ","Check setup, deps & config"]];for(let[i,r]of s)console.log(` ${w(i)} ${l.dim(r)}`);console.log(),console.log(` ${l.dim("Run ")}${l.white("seofields <command> --help")}${l.dim(" for details")}`),console.log();}function P(e,t){let n="\u2500".repeat(V),o=`seofields \u203A ${e}`;return ["",` ${w(`\u256D${n}\u256E`)}`,M(),F(`${l.bold(l.green("seofields"))}${w(" \u203A ")}${l.bold(w(e))}`,o.length),F(l.dim(t),t.length),M(),` ${w(`\u2570${n}\u256F`)}`].join(`
64
+ } | order(_updatedAt desc)`;o.text="Fetching documents...";let c;try{c=await s.fetch(d);}catch(g){o.fail(`Failed to fetch: ${g.message}`),process.exit(1);}if(o.succeed(`Analysed ${c.length} document(s)`),c.length===0){a.warn("No documents with SEO fields found."),n&&Se(i);return}let u=c.map(g=>({doc:g,health:K(g)}));await gt(u,c,e),n&&Se(i);}async function gt(e,t,n){let o={excellent:0,good:0,fair:0,poor:0,missing:0},s=0;for(let{health:c}of e)o[c.status]=(o[c.status]||0)+1,s+=c.score;let i=Math.round(s/e.length);if(pt(t,i,o),n.format==="summary")return;n.format!=="table"&&(a.info(""),a.warn(`Unknown format "${n.format}", defaulting to table output.`)),St(e);let r={};for(let{health:c}of e)for(let u of c.issues)r[u]=(r[u]||0)+1;let d=Object.entries(r).sort(([,c],[,u])=>u-c).slice(0,10);d.length>0&&$t(d,t.length),a.info("");}function pt(e,t,n){a.heading("\u{1F4CA} Summary"),a.info(""),a.info(` Total documents: ${l.bold(String(e.length))}`),a.info(` Average score: ${l.bold(we(t))}%`),a.info(""),a.info(` ${A.excellent} Excellent (80+): ${n.excellent}`),a.info(` ${A.good} Good (60-79): ${n.good}`),a.info(` ${A.fair} Fair (40-59): ${n.fair}`),a.info(` ${A.poor} Poor (1-39): ${n.poor}`),a.info(` ${A.missing} Missing (0): ${n.missing}`);}var mt={excellent:"Excellent",good:"Good",fair:"Fair",poor:"Poor",missing:"Missing"},ht={excellent:l.green,good:l.blue,fair:l.yellow,poor:l.red,missing:l.dim};function yt(e,t=11){var s,i;let n=((s=mt[e])!=null?s:e).padEnd(t);return ((i=ht[e])!=null?i:(r=>r))(n)}function St(e){a.heading("\u{1F4CB} Documents"),a.info("");let t=Math.min(44,Math.max(5,...e.map(({doc:r})=>(r.title||r._id).length))),n=11,o=14,s=5,i=l.dim("\u2500".repeat(s+2+n+2+o+2+t));a.info(` ${l.dim("Score".padEnd(s))} ${l.dim("Status".padEnd(n))} ${l.dim("Type".padEnd(o))} ${l.dim("Title")}`),a.info(` ${i}`);for(let{doc:r,health:d}of e){let c=$e(r.title||r._id,t),u=String(d.score).padStart(s),f=yt(d.status,n),g=l.dim($e(r._type,o).padEnd(o));a.info(` ${we(d.score,u)} ${f} ${g} ${c}`);}}function $t(e,t){a.heading("\u{1F50D} Top Issues"),a.info("");for(let[n,o]of e){let s=Math.round(o/t*100);a.info(` ${l.red(String(o).padStart(4))} docs (${s}%) ${n}`);}}function Se(e){a.info(""),a.info(` ${l.dim("\u2500".repeat(52))}`),a.info(` ${l.dim("Connection info")}`),a.info(` ${l.dim("Project ID:")} ${l.white(e.projectId)} ${l.dim(`\u2190 ${e.sources.projectId}`)}`),a.info(` ${l.dim("Dataset: ")} ${l.white(e.dataset)} ${l.dim(`\u2190 ${e.sources.dataset}`)}`),a.info(` ${l.dim("Token: ")} ${l.dim(e.sources.token)}`),a.info("");}function we(e,t){let n=t!=null?t:String(e);return e>=80?l.green(n):e>=60?l.blue(n):e>=40?l.yellow(n):e>0?l.red(n):l.dim(n)}function $e(e,t){return e.length>t?`${e.slice(0,t-1)}\u2026`:e}H();var Z="1.6.5",ve=[l.cyan,e=>l.bold(l.blue(e)),l.blue,l.magenta,l.red,l.yellow],w=ve[Math.floor(Math.random()*ve.length)],Ce=["Run `seofields doctor` first to verify your setup is correct.","Use `seofields report --format summary` for a quick overview.","Export your SEO data before making bulk changes: `seofields export -o backup.json`.","Add `seoFields` type to every document schema to track SEO health.","A meta title between 50\u201360 characters gets the best click-through rate.","Meta descriptions should be 140\u2013160 characters for optimal display.","Open Graph images should be 1200\xD7630px for best social sharing.","Use `seofields config --baseUrl=https://yoursite.com` to enable canonical URLs.","Twitter Card images require a separate `twitterImage` field for best results.","Schema.org markup helps search engines understand your content structure.","Use `seofields report --types post,page` to filter by document type.","The `healthDashboard` tool gives a live view of SEO scores inside Sanity Studio.","Keywords should appear naturally \u2014 avoid keyword stuffing.","Every page needs a unique meta title. Duplicates hurt rankings.","Use `seofields export --format csv` to open SEO data in a spreadsheet.","Set `noIndex: true` on internal or draft pages to prevent indexing.","OG title and meta title can differ \u2014 OG is optimised for social, meta for search.","Run `seofields report` after content migrations to catch regressions.","Use `seofields init --schema-org` to add structured data support.","Structured data (Schema.org) can unlock rich results in Google Search.","A score of 80+ is excellent. Aim to get all key pages there.","The `seoPreview` option shows a live Google-style preview inside the editor.","Use `seofields report` in CI to catch SEO regressions before they ship.","Use `--dataset staging` to run reports against your staging dataset.","Keep your license key private \u2014 never commit it to version control.","Use `seofields config --healthDashboard.showDocumentId=true` for easier debugging.","Use `seofields export --format json --output report.json` to save SEO data to a file.","Alt text on images improves both accessibility and image search ranking.","Canonical URLs prevent duplicate content penalties from search engines.","A missing OG image means social shares show a blank card \u2014 always add one.","Use descriptive slugs: `/blog/seo-tips` ranks better than `/blog/post-123`.","Re-run `seofields report` monthly to track your SEO health over time.","The `types` filter helps you focus reports on high-priority content.","Use `seofields export` to back up SEO data before schema migrations.","Short meta titles (under 30 chars) waste valuable search result space.","Long meta descriptions get truncated \u2014 stay under 160 characters.","Twitter Cards need `twitter:card`, `twitter:title`, and `twitter:image` at minimum.","Use `seofields doctor` after upgrading the plugin to catch breaking changes.","JSON export includes health scores \u2014 pipe it into your analytics pipeline.","Set a `defaultHiddenFields` list to keep the SEO panel focused.","Internal links pass authority \u2014 make sure important pages are well-linked.","Page speed is a ranking factor \u2014 optimise images referenced in SEO fields.","Use consistent brand phrasing in meta titles across your site.","Structured data errors can be tested at schema.org/validator.","Focus first on pages with the most traffic, not just the lowest scores.","Add SEO review to your content publishing checklist.","Use `seofields config --healthDashboard.licenseKey=KEY` to unlock premium features.","The CSV export makes it easy to share SEO audits with non-technical stakeholders.","Every image on your page should have descriptive alt text.","Avoid duplicate meta descriptions \u2014 each page needs its own."];function bt(){return Ce[Math.floor(Math.random()*Ce.length)]}var wt=62,V=wt-2;function vt(e,t){let n=e.split(" "),o=[],s="";for(let i of n)s.length+(s?1:0)+i.length>t?(s&&o.push(s),s=i):s=s?`${s} ${i}`:i;return s&&o.push(s),o}function F(e,t){let n=V-3,o=" ".repeat(Math.max(0,n-t));return ` ${w("\u2502")} ${e}${o} ${w("\u2502")}`}function M(){return F("",0)}function xe(){let e="\u2500".repeat(V),t=bt(),n=V-3-5,o=vt(t,n);console.log(),console.log(` ${w(`\u256D${e}\u256E`)}`),console.log(M()),console.log(F(`${l.bold(l.green("seofields"))}${l.dim(` v${Z}`)}`,`seofields v${Z}`.length)),console.log(F(l.dim("SEO tooling for Sanity CMS \u2014 manage from your terminal"),54)),console.log(M());for(let i=0;i<o.length;i++){let r=i===0?`${l.dim("Tip: ")}${l.white(o[i])}`:` ${l.white(o[i])}`,d=5+o[i].length;console.log(F(r,d));}console.log(M()),console.log(` ${w(`\u2570${e}\u256F`)}`),console.log(),console.log(` ${l.bold("Commands")}`),console.log();let s=[["init ","Add seofields() to sanity.config"],["config ","Update plugin configuration options"],["create-config ","Create seofields.cli.ts / .js interactively"],["report ","SEO health report across all documents"],["export ","Export SEO fields as JSON or CSV"],["doctor ","Check setup, deps & config"]];for(let[i,r]of s)console.log(` ${w(i)} ${l.dim(r)}`);console.log(),console.log(` ${l.dim("Run ")}${l.white("seofields <command> --help")}${l.dim(" for details")}`),console.log();}function P(e,t){let n="\u2500".repeat(V),o=`seofields \u203A ${e}`;return ["",` ${w(`\u256D${n}\u256E`)}`,M(),F(`${l.bold(l.green("seofields"))}${w(" \u203A ")}${l.bold(w(e))}`,o.length),F(l.dim(t),t.length),M(),` ${w(`\u2570${n}\u256F`)}`].join(`
65
65
  `)}program.name("seofields").description("CLI for sanity-plugin-seofields \u2014 manage SEO from your terminal").version(Z).action(xe);program.command("config",{isDefault:false}).description("Update seofields() configuration in your sanity.config file").addHelpText("before",P("config","Update seofields() configuration in your sanity.config file")).allowUnknownOption().allowExcessArguments().helpOption("-h, --help","Show help and all available options").addHelpText("after",["",` ${l.bold("Usage")}`,` ${l.dim("Pass any option as")} ${l.white("--key=value")}${l.dim(". Nested keys use dot notation.")}`,"",` ${l.bold("Top-level options")}`,` ${w("--baseUrl")}${l.dim("=<url>").padEnd(38)} ${l.dim("Canonical base URL")}`,` ${w("--seoPreview")}${l.dim("=<bool>").padEnd(36)} ${l.dim("Enable live Google-style preview")}`,` ${w("--defaultHiddenFields")}${l.dim("=<f1,f2>").padEnd(28)} ${l.dim("Comma-separated fields to hide")}`,` ${w("--types")}${l.dim("=<t1,t2>").padEnd(40)} ${l.dim("Document types that have SEO fields")}`,"",` ${l.bold("healthDashboard options")} ${l.dim("(prefix: --healthDashboard.<key>)")}`,` ${w("--healthDashboard.licenseKey")}${l.dim("=<key>").padEnd(22)} ${l.dim("License key for premium features")}`,` ${w("--healthDashboard.toolTitle")}${l.dim("=<str>").padEnd(23)} ${l.dim("Custom title shown in Studio")}`,` ${w("--healthDashboard.showDocumentId")}${l.dim("=<bool>").padEnd(17)} ${l.dim("Show document _id in dashboard")}`,` ${w("--healthDashboard.showHealthScore")}${l.dim("=<bool>").padEnd(16)} ${l.dim("Show score badge per document")}`,` ${w("--healthDashboard.query.types")}${l.dim("=<t1,t2>").padEnd(21)} ${l.dim("Filter dashboard by document types")}`,"",` ${l.bold("Examples")}`,` ${l.white("seofields config --baseUrl=https://mysite.com")}`,` ${l.white("seofields config --healthDashboard.licenseKey=SEOF-1234")}`,` ${l.white("seofields config --healthDashboard.showDocumentId=true --seoPreview=true")}`,` ${l.white("seofields config --healthDashboard.query.types=post,page")}`,` ${l.white("seofields config --defaultHiddenFields=metaImage,openGraphUrl")}`,""].join(`
66
66
  `)).action(()=>{let e=process.argv.indexOf("config"),t=e>=0?process.argv.slice(e+1):[];de(t);});program.command("create-config").description("Interactively create a seofields.cli.ts / .js config file").addHelpText("before",P("create-config","Interactively create a seofields.cli.ts / .js config file")).action(ue);program.command("init").description("Add seofields() plugin to your sanity.config file").addHelpText("before",P("init","Add seofields() plugin to your sanity.config file")).option("--preview","Enable SEO preview in the plugin config").option("--dashboard","Explicitly enable the SEO Health Dashboard").option("--no-dashboard","Disable the SEO Health Dashboard").option("--schema-org","Also add schemaOrg() plugin registration").addHelpText("after",["",` ${l.dim("Note: ")}${l.yellow("--preview")}${l.dim(", ")}${l.yellow("--dashboard")}${l.dim(", and ")}${l.yellow("--no-dashboard")}${l.dim(" only apply during initial setup.")}`,` ${l.dim(" If seofields() is already in your config, use:")}`,"",` ${l.dim(" ")}${l.white("seofields config --healthDashboard=true --seoPreview=true")}`,""].join(`
67
67
  `)).action(ye);program.command("export").description("Export all documents with SEO fields as JSON or CSV").addHelpText("before",P("export","Export all documents with SEO fields as JSON or CSV")).option("-p, --project-id <id>","Sanity project ID").option("-d, --dataset <name>","Sanity dataset name").option("-t, --token <token>","Sanity API token").option("--types <types>","Comma-separated document types to export (e.g. post,page)").option("-f, --format <format>","Output format: json or csv","json").option("-o, --output <path>","Output file path (defaults to stdout)").action(me);program.command("report").description("Generate an SEO health report for all documents").addHelpText("before",P("report","Generate an SEO health report for all documents")).option("-p, --project-id <id>","Sanity project ID").option("-d, --dataset <name>","Sanity dataset name").option("-t, --token <token>","Sanity API token").option("--types <types>","Comma-separated document types to include").option("--format <format>",'Output format: table or summary (default: "table")',"table").action(be);program.command("doctor").description("Check plugin configuration, dependencies, and setup").addHelpText("before",P("doctor","Check plugin configuration, dependencies, and setup")).option("--cwd <path>","Working directory to check",process.cwd()).action(ge);var _=process.argv.slice(2);_.length===1&&(_[0]==="--help"||_[0]==="-h")&&(xe(),process.exit(0));if(_.length>=2&&_[_.length-1]==="help"){let e=program.commands.find(t=>t.name()===_[0]);e&&(e.help(),process.exit(0));}program.parse();
@@ -1,5 +1,5 @@
1
1
  import { JSX } from 'react';
2
- import { L as SchemaOrgAggregateRatingData, N as SchemaOrgArticleData, P as SchemaOrgBlogPostingData, Q as SchemaOrgBookData, R as SchemaOrgBrandData, T as SchemaOrgBreadcrumbListData, U as SchemaOrgContactPointData, X as SchemaOrgCountryData, Y as SchemaOrgCourseData, _ as SchemaOrgEventData, $ as SchemaOrgFAQPageData, a0 as SchemaOrgHowToData, a2 as SchemaOrgImageObjectData, a3 as SchemaOrgItemListData, a4 as SchemaOrgJobPostingData, a5 as SchemaOrgLegalServiceData, a6 as SchemaOrgLocalBusinessData, a7 as SchemaOrgMovieData, a8 as SchemaOrgMusicAlbumData, a9 as SchemaOrgMusicRecordingData, aa as SchemaOrgNewsArticleData, ab as SchemaOrgOfferData, ac as SchemaOrgOrganizationData, ae as SchemaOrgPersonData, ag as SchemaOrgPlaceData, ah as SchemaOrgPostalAddressData, ai as SchemaOrgProductData, aj as SchemaOrgProfilePageData, ak as SchemaOrgRecipeData, al as SchemaOrgRestaurantData, am as SchemaOrgReviewData, an as SchemaOrgServiceData, ao as SchemaOrgSoftwareApplicationData, ar as SchemaOrgVideoObjectData, as as SchemaOrgWebApplicationData, at as SchemaOrgWebPageData, au as SchemaOrgWebsiteData } from './types-BdaGoGQE.cjs';
2
+ import { L as SchemaOrgAggregateRatingData, N as SchemaOrgArticleData, P as SchemaOrgBlogPostingData, Q as SchemaOrgBookData, R as SchemaOrgBrandData, T as SchemaOrgBreadcrumbListData, U as SchemaOrgContactPointData, X as SchemaOrgCountryData, Y as SchemaOrgCourseData, _ as SchemaOrgEventData, $ as SchemaOrgFAQPageData, a0 as SchemaOrgHowToData, a2 as SchemaOrgImageObjectData, a3 as SchemaOrgItemListData, a4 as SchemaOrgJobPostingData, a5 as SchemaOrgLegalServiceData, a6 as SchemaOrgLocalBusinessData, a7 as SchemaOrgMovieData, a8 as SchemaOrgMusicAlbumData, a9 as SchemaOrgMusicRecordingData, aa as SchemaOrgNewsArticleData, ab as SchemaOrgOfferData, ac as SchemaOrgOrganizationData, ae as SchemaOrgPersonData, ag as SchemaOrgPlaceData, ah as SchemaOrgPostalAddressData, ai as SchemaOrgProductData, aj as SchemaOrgProfilePageData, ak as SchemaOrgRecipeData, al as SchemaOrgRestaurantData, am as SchemaOrgReviewData, an as SchemaOrgServiceData, ao as SchemaOrgSoftwareApplicationData, ar as SchemaOrgVideoObjectData, as as SchemaOrgWebApplicationData, at as SchemaOrgWebPageData, au as SchemaOrgWebsiteData } from './types-BxcJinOf.cjs';
3
3
  import { c as SanityImage } from './types-BtSRRG6C.cjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { JSX } from 'react';
2
- import { L as SchemaOrgAggregateRatingData, N as SchemaOrgArticleData, P as SchemaOrgBlogPostingData, Q as SchemaOrgBookData, R as SchemaOrgBrandData, T as SchemaOrgBreadcrumbListData, U as SchemaOrgContactPointData, X as SchemaOrgCountryData, Y as SchemaOrgCourseData, _ as SchemaOrgEventData, $ as SchemaOrgFAQPageData, a0 as SchemaOrgHowToData, a2 as SchemaOrgImageObjectData, a3 as SchemaOrgItemListData, a4 as SchemaOrgJobPostingData, a5 as SchemaOrgLegalServiceData, a6 as SchemaOrgLocalBusinessData, a7 as SchemaOrgMovieData, a8 as SchemaOrgMusicAlbumData, a9 as SchemaOrgMusicRecordingData, aa as SchemaOrgNewsArticleData, ab as SchemaOrgOfferData, ac as SchemaOrgOrganizationData, ae as SchemaOrgPersonData, ag as SchemaOrgPlaceData, ah as SchemaOrgPostalAddressData, ai as SchemaOrgProductData, aj as SchemaOrgProfilePageData, ak as SchemaOrgRecipeData, al as SchemaOrgRestaurantData, am as SchemaOrgReviewData, an as SchemaOrgServiceData, ao as SchemaOrgSoftwareApplicationData, ar as SchemaOrgVideoObjectData, as as SchemaOrgWebApplicationData, at as SchemaOrgWebPageData, au as SchemaOrgWebsiteData } from './types-BwmZmt9I.js';
2
+ import { L as SchemaOrgAggregateRatingData, N as SchemaOrgArticleData, P as SchemaOrgBlogPostingData, Q as SchemaOrgBookData, R as SchemaOrgBrandData, T as SchemaOrgBreadcrumbListData, U as SchemaOrgContactPointData, X as SchemaOrgCountryData, Y as SchemaOrgCourseData, _ as SchemaOrgEventData, $ as SchemaOrgFAQPageData, a0 as SchemaOrgHowToData, a2 as SchemaOrgImageObjectData, a3 as SchemaOrgItemListData, a4 as SchemaOrgJobPostingData, a5 as SchemaOrgLegalServiceData, a6 as SchemaOrgLocalBusinessData, a7 as SchemaOrgMovieData, a8 as SchemaOrgMusicAlbumData, a9 as SchemaOrgMusicRecordingData, aa as SchemaOrgNewsArticleData, ab as SchemaOrgOfferData, ac as SchemaOrgOrganizationData, ae as SchemaOrgPersonData, ag as SchemaOrgPlaceData, ah as SchemaOrgPostalAddressData, ai as SchemaOrgProductData, aj as SchemaOrgProfilePageData, ak as SchemaOrgRecipeData, al as SchemaOrgRestaurantData, am as SchemaOrgReviewData, an as SchemaOrgServiceData, ao as SchemaOrgSoftwareApplicationData, ar as SchemaOrgVideoObjectData, as as SchemaOrgWebApplicationData, at as SchemaOrgWebPageData, au as SchemaOrgWebsiteData } from './types-Dp9Pfnt9.js';
3
3
  import { c as SanityImage } from './types-BtSRRG6C.js';
4
4
 
5
5
  /**
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkIFDLKZET_cjs = require('./chunk-IFDLKZET.cjs');
5
+ var chunkZBHLMQTS_cjs = require('./chunk-ZBHLMQTS.cjs');
6
6
  var chunkS367Y35J_cjs = require('./chunk-S367Y35J.cjs');
7
7
  var react = require('react');
8
8
  var sanity = require('sanity');
@@ -15,7 +15,7 @@ var MetaDescription = (props) => {
15
15
  const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
16
16
  const keywords = react.useMemo(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
17
17
  const feedbackItems = react.useMemo(
18
- () => chunkIFDLKZET_cjs.getMetaDescriptionValidationMessages(value || "", keywords, isParentseoField),
18
+ () => chunkZBHLMQTS_cjs.getMetaDescriptionValidationMessages(value || "", keywords, isParentseoField),
19
19
  [value, keywords, isParentseoField]
20
20
  );
21
21
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
@@ -37,7 +37,7 @@ var MetaImage = (props) => {
37
37
  const seoParent = sanity.useFormValue([path[0]]);
38
38
  const hasImage = !!(value == null ? void 0 : value.asset);
39
39
  const feedbackItems = react.useMemo(
40
- () => chunkIFDLKZET_cjs.getMetaImageValidation(hasImage, seoParent),
40
+ () => chunkZBHLMQTS_cjs.getMetaImageValidation(hasImage, seoParent),
41
41
  [hasImage, seoParent]
42
42
  );
43
43
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
@@ -60,13 +60,37 @@ var MetaImage = (props) => {
60
60
  };
61
61
  var MetaImage_default = MetaImage;
62
62
  var MetaTitle = (props) => {
63
- const { value, renderDefault, path } = props;
63
+ var _a, _b;
64
+ const { value, renderDefault, path, schemaType } = props;
65
+ const { options } = schemaType;
64
66
  const parent = sanity.useFormValue([path[0]]);
65
67
  const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
66
68
  const keywords = react.useMemo(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
69
+ const rootDoc = (_a = sanity.useFormValue([])) != null ? _a : {};
70
+ const client = sanity.useClient({ apiVersion: (_b = options == null ? void 0 : options.apiVersion) != null ? _b : "2024-01-01" });
71
+ const [groqTitleSuffix, setGroqTitleSuffix] = react.useState("");
72
+ const titleSuffixQuery = options == null ? void 0 : options.titleSuffixQuery;
73
+ const titleSuffixOption = options == null ? void 0 : options.titleSuffix;
74
+ react.useEffect(() => {
75
+ if (!titleSuffixQuery) return;
76
+ client.fetch(titleSuffixQuery).then((result) => {
77
+ setGroqTitleSuffix(result === null || result === void 0 ? "" : String(result));
78
+ }).catch(() => {
79
+ setGroqTitleSuffix("");
80
+ });
81
+ }, [titleSuffixQuery, client]);
82
+ const resolvedSuffix = react.useMemo(() => {
83
+ if (titleSuffixQuery) return groqTitleSuffix;
84
+ if (!titleSuffixOption) return "";
85
+ if (typeof titleSuffixOption === "function") {
86
+ return titleSuffixOption(rootDoc);
87
+ }
88
+ return titleSuffixOption;
89
+ }, [titleSuffixQuery, groqTitleSuffix, titleSuffixOption, rootDoc]);
90
+ const suffixLength = resolvedSuffix ? resolvedSuffix.length + 3 : 0;
67
91
  const feedbackItems = react.useMemo(
68
- () => chunkIFDLKZET_cjs.getMetaTitleValidationMessages(value || "", keywords, isParentseoField),
69
- [value, keywords, isParentseoField]
92
+ () => chunkZBHLMQTS_cjs.getMetaTitleValidationMessages(value || "", keywords, isParentseoField, suffixLength),
93
+ [value, keywords, isParentseoField, suffixLength]
70
94
  );
71
95
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
72
96
  renderDefault(props),
@@ -216,7 +240,7 @@ var OgDescription = (props) => {
216
240
  const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
217
241
  const keywords = react.useMemo(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
218
242
  const feedbackItems = react.useMemo(
219
- () => chunkIFDLKZET_cjs.getOgDescriptionValidation(value || "", keywords, isParentseoField),
243
+ () => chunkZBHLMQTS_cjs.getOgDescriptionValidation(value || "", keywords, isParentseoField),
220
244
  [value, keywords, isParentseoField]
221
245
  );
222
246
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
@@ -245,7 +269,7 @@ var OgImage = (props) => {
245
269
  const hasImage = !!(imgValue == null ? void 0 : imgValue.asset);
246
270
  const altText = imgValue == null ? void 0 : imgValue.alt;
247
271
  const feedbackItems = react.useMemo(
248
- () => chunkIFDLKZET_cjs.getOgImageValidation(hasImage, altText, seoParent),
272
+ () => chunkZBHLMQTS_cjs.getOgImageValidation(hasImage, altText, seoParent),
249
273
  [hasImage, altText, seoParent]
250
274
  );
251
275
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
@@ -270,7 +294,7 @@ var OgImage_default = OgImage;
270
294
  var OgImageUrl = (props) => {
271
295
  const { value, renderDefault, path } = props;
272
296
  const seoParent = sanity.useFormValue([path[0]]);
273
- const feedbackItems = react.useMemo(() => chunkIFDLKZET_cjs.getOgImageUrlValidation(value, seoParent), [value, seoParent]);
297
+ const feedbackItems = react.useMemo(() => chunkZBHLMQTS_cjs.getOgImageUrlValidation(value, seoParent), [value, seoParent]);
274
298
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
275
299
  renderDefault(props),
276
300
  /* @__PURE__ */ jsxRuntime.jsx(ui.Stack, { space: 2, children: feedbackItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 7 }, children: [
@@ -296,7 +320,7 @@ var OgTitle = (props) => {
296
320
  const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
297
321
  const keywords = react.useMemo(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
298
322
  const feedbackItems = react.useMemo(
299
- () => chunkIFDLKZET_cjs.getOgTitleValidation(value || "", keywords, isParentseoField),
323
+ () => chunkZBHLMQTS_cjs.getOgTitleValidation(value || "", keywords, isParentseoField),
300
324
  [value, keywords, isParentseoField]
301
325
  );
302
326
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
@@ -440,7 +464,7 @@ var TwitterDescription = (props) => {
440
464
  const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
441
465
  const keywords = react.useMemo(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
442
466
  const feedbackItems = react.useMemo(
443
- () => chunkIFDLKZET_cjs.getTwitterDescriptionValidation(value || "", keywords, isParentseoField),
467
+ () => chunkZBHLMQTS_cjs.getTwitterDescriptionValidation(value || "", keywords, isParentseoField),
444
468
  [value, keywords, isParentseoField]
445
469
  );
446
470
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
@@ -469,7 +493,7 @@ var TwitterImage = (props) => {
469
493
  const hasImage = !!(imgValue == null ? void 0 : imgValue.asset);
470
494
  const altText = imgValue == null ? void 0 : imgValue.alt;
471
495
  const feedbackItems = react.useMemo(
472
- () => chunkIFDLKZET_cjs.getTwitterImageValidation(hasImage, altText, seoParent),
496
+ () => chunkZBHLMQTS_cjs.getTwitterImageValidation(hasImage, altText, seoParent),
473
497
  [hasImage, altText, seoParent]
474
498
  );
475
499
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
@@ -495,7 +519,7 @@ var TwitterImageUrl = (props) => {
495
519
  const { value, renderDefault, path } = props;
496
520
  const seoParent = sanity.useFormValue([path[0]]);
497
521
  const feedbackItems = react.useMemo(
498
- () => chunkIFDLKZET_cjs.getTwitterImageUrlValidation(value, seoParent),
522
+ () => chunkZBHLMQTS_cjs.getTwitterImageUrlValidation(value, seoParent),
499
523
  [value, seoParent]
500
524
  );
501
525
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
@@ -523,7 +547,7 @@ var TwitterTitle = (props) => {
523
547
  const isParentseoField = parent && (parent == null ? void 0 : parent._type) === "seoFields";
524
548
  const keywords = react.useMemo(() => (parent == null ? void 0 : parent.keywords) || [], [parent == null ? void 0 : parent.keywords]);
525
549
  const feedbackItems = react.useMemo(
526
- () => chunkIFDLKZET_cjs.getTwitterTitleValidation(value || "", keywords, isParentseoField),
550
+ () => chunkZBHLMQTS_cjs.getTwitterTitleValidation(value || "", keywords, isParentseoField),
527
551
  [value, keywords, isParentseoField]
528
552
  );
529
553
  return /* @__PURE__ */ jsxRuntime.jsxs(ui.Stack, { space: 3, children: [
@@ -657,7 +681,7 @@ function twitter(config = {}) {
657
681
  }
658
682
 
659
683
  // src/schemas/index.ts
660
- var LazySeoPreview = react.lazy(() => import('./SeoPreview-PYYVZMY3.cjs'));
684
+ var LazySeoPreview = react.lazy(() => import('./SeoPreview-WYH7NYNM.cjs'));
661
685
  var SeoPreviewWrapper = (props) => react.createElement(react.Suspense, { fallback: null }, react.createElement(LazySeoPreview, props));
662
686
  function buildFieldGroupMap(groups) {
663
687
  const map = /* @__PURE__ */ new Map();
@@ -736,6 +760,7 @@ function seoFieldsSchema(config = {}) {
736
760
  components: {
737
761
  input: MetaTitle_default
738
762
  },
763
+ options: chunkS367Y35J_cjs.__spreadValues(chunkS367Y35J_cjs.__spreadValues(chunkS367Y35J_cjs.__spreadValues({}, config.apiVersion ? { apiVersion: config.apiVersion } : {}), typeof config.seoPreview === "object" && config.seoPreview && config.seoPreview.titleSuffix ? { titleSuffix: config.seoPreview.titleSuffix } : {}), typeof config.seoPreview === "object" && config.seoPreview && config.seoPreview.titleSuffixQuery ? { titleSuffixQuery: config.seoPreview.titleSuffixQuery } : {}),
739
764
  hidden: getFieldHiddenFunction("title", config)
740
765
  })),
741
766
  fieldGroupMap