@jjlmoya/utils-converters 1.25.0 → 1.26.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.
Files changed (133) hide show
  1. package/package.json +2 -2
  2. package/src/category/i18n/de.ts +1 -1
  3. package/src/category/i18n/en.ts +1 -1
  4. package/src/category/i18n/fr.ts +1 -1
  5. package/src/category/i18n/id.ts +1 -1
  6. package/src/category/i18n/it.ts +1 -1
  7. package/src/category/i18n/nl.ts +1 -1
  8. package/src/category/i18n/pl.ts +1 -1
  9. package/src/category/i18n/pt.ts +1 -1
  10. package/src/category/i18n/sv.ts +1 -1
  11. package/src/tests/bibliography_wellformed_export.test.ts +46 -0
  12. package/src/tests/category_seo_quality.test.ts +74 -0
  13. package/src/tests/faq_count.test.ts +1 -1
  14. package/src/tests/no_h1_in_components.test.ts +1 -1
  15. package/src/tests/seo_parity.test.ts +2 -2
  16. package/src/tests/seo_wellformed_export.test.ts +65 -0
  17. package/src/tests/tool_validation.test.ts +15 -15
  18. package/src/tool/avifAJpg/i18n/en.ts +164 -164
  19. package/src/tool/avifAJpg/i18n/es.ts +164 -164
  20. package/src/tool/avifAJpg/i18n/fr.ts +164 -164
  21. package/src/tool/avifAJpg/i18n/ja.ts +166 -166
  22. package/src/tool/avifAJpg/i18n/ko.ts +166 -166
  23. package/src/tool/avifAJpg/i18n/zh.ts +166 -166
  24. package/src/tool/avifAJpg/seo.astro +15 -15
  25. package/src/tool/avifAPng/i18n/en.ts +164 -164
  26. package/src/tool/avifAPng/i18n/es.ts +164 -164
  27. package/src/tool/avifAPng/i18n/fr.ts +164 -164
  28. package/src/tool/avifAPng/i18n/ja.ts +166 -166
  29. package/src/tool/avifAPng/i18n/ko.ts +166 -166
  30. package/src/tool/avifAPng/i18n/zh.ts +166 -166
  31. package/src/tool/avifAPng/seo.astro +15 -15
  32. package/src/tool/avifAWebp/i18n/en.ts +164 -164
  33. package/src/tool/avifAWebp/i18n/es.ts +164 -164
  34. package/src/tool/avifAWebp/i18n/fr.ts +164 -164
  35. package/src/tool/avifAWebp/i18n/ja.ts +166 -166
  36. package/src/tool/avifAWebp/i18n/ko.ts +166 -166
  37. package/src/tool/avifAWebp/i18n/zh.ts +166 -166
  38. package/src/tool/avifAWebp/seo.astro +15 -15
  39. package/src/tool/bmpAJpg/i18n/en.ts +164 -164
  40. package/src/tool/bmpAJpg/i18n/es.ts +164 -164
  41. package/src/tool/bmpAJpg/i18n/fr.ts +164 -164
  42. package/src/tool/bmpAJpg/i18n/ja.ts +166 -166
  43. package/src/tool/bmpAJpg/i18n/ko.ts +166 -166
  44. package/src/tool/bmpAJpg/i18n/zh.ts +166 -166
  45. package/src/tool/bmpAJpg/seo.astro +15 -15
  46. package/src/tool/bmpAPng/i18n/en.ts +164 -164
  47. package/src/tool/bmpAPng/i18n/es.ts +164 -164
  48. package/src/tool/bmpAPng/i18n/fr.ts +164 -164
  49. package/src/tool/bmpAPng/i18n/ja.ts +165 -165
  50. package/src/tool/bmpAPng/i18n/ko.ts +165 -165
  51. package/src/tool/bmpAPng/i18n/zh.ts +165 -165
  52. package/src/tool/bmpAPng/seo.astro +15 -15
  53. package/src/tool/bmpAWebp/i18n/en.ts +164 -164
  54. package/src/tool/bmpAWebp/i18n/es.ts +164 -164
  55. package/src/tool/bmpAWebp/i18n/fr.ts +164 -164
  56. package/src/tool/bmpAWebp/i18n/ja.ts +166 -166
  57. package/src/tool/bmpAWebp/i18n/ko.ts +166 -166
  58. package/src/tool/bmpAWebp/i18n/zh.ts +166 -166
  59. package/src/tool/bmpAWebp/seo.astro +15 -15
  60. package/src/tool/gifAJpg/i18n/en.ts +164 -164
  61. package/src/tool/gifAJpg/i18n/es.ts +164 -164
  62. package/src/tool/gifAJpg/i18n/fr.ts +164 -164
  63. package/src/tool/gifAJpg/i18n/ja.ts +166 -166
  64. package/src/tool/gifAJpg/i18n/ko.ts +166 -166
  65. package/src/tool/gifAJpg/i18n/zh.ts +166 -166
  66. package/src/tool/gifAJpg/seo.astro +15 -15
  67. package/src/tool/gifAPng/i18n/en.ts +164 -164
  68. package/src/tool/gifAPng/i18n/es.ts +164 -164
  69. package/src/tool/gifAPng/i18n/fr.ts +164 -164
  70. package/src/tool/gifAPng/i18n/ja.ts +166 -166
  71. package/src/tool/gifAPng/i18n/ko.ts +166 -166
  72. package/src/tool/gifAPng/i18n/zh.ts +166 -166
  73. package/src/tool/gifAPng/seo.astro +15 -15
  74. package/src/tool/gifAWebp/i18n/en.ts +164 -164
  75. package/src/tool/gifAWebp/i18n/es.ts +164 -164
  76. package/src/tool/gifAWebp/i18n/fr.ts +164 -164
  77. package/src/tool/gifAWebp/i18n/ja.ts +166 -166
  78. package/src/tool/gifAWebp/i18n/ko.ts +166 -166
  79. package/src/tool/gifAWebp/i18n/zh.ts +166 -166
  80. package/src/tool/gifAWebp/seo.astro +15 -15
  81. package/src/tool/imagenBase64/i18n/en.ts +154 -154
  82. package/src/tool/imagenBase64/i18n/es.ts +154 -154
  83. package/src/tool/imagenBase64/i18n/fr.ts +154 -154
  84. package/src/tool/imagenBase64/seo.astro +15 -15
  85. package/src/tool/jpgAIco/seo.astro +15 -15
  86. package/src/tool/jpgAPng/i18n/en.ts +164 -164
  87. package/src/tool/jpgAPng/i18n/es.ts +164 -164
  88. package/src/tool/jpgAPng/i18n/fr.ts +164 -164
  89. package/src/tool/jpgAPng/i18n/ja.ts +166 -166
  90. package/src/tool/jpgAPng/i18n/ko.ts +166 -166
  91. package/src/tool/jpgAPng/i18n/zh.ts +166 -166
  92. package/src/tool/jpgAPng/seo.astro +15 -15
  93. package/src/tool/jpgAWebp/i18n/en.ts +164 -164
  94. package/src/tool/jpgAWebp/i18n/es.ts +164 -164
  95. package/src/tool/jpgAWebp/i18n/fr.ts +164 -164
  96. package/src/tool/jpgAWebp/seo.astro +15 -15
  97. package/src/tool/pngAIco/seo.astro +15 -15
  98. package/src/tool/pngAJpg/i18n/de.ts +21 -21
  99. package/src/tool/pngAJpg/i18n/es.ts +177 -177
  100. package/src/tool/pngAJpg/i18n/fr.ts +137 -137
  101. package/src/tool/pngAJpg/i18n/id.ts +89 -89
  102. package/src/tool/pngAJpg/i18n/it.ts +89 -89
  103. package/src/tool/pngAJpg/i18n/ko.ts +177 -177
  104. package/src/tool/pngAJpg/i18n/nl.ts +20 -20
  105. package/src/tool/pngAJpg/i18n/pl.ts +89 -89
  106. package/src/tool/pngAJpg/i18n/pt.ts +89 -89
  107. package/src/tool/pngAJpg/i18n/ru.ts +177 -177
  108. package/src/tool/pngAJpg/i18n/sv.ts +89 -89
  109. package/src/tool/pngAJpg/i18n/tr.ts +89 -89
  110. package/src/tool/pngAJpg/seo.astro +15 -15
  111. package/src/tool/pngAWebp/i18n/en.ts +164 -164
  112. package/src/tool/pngAWebp/i18n/es.ts +164 -164
  113. package/src/tool/pngAWebp/i18n/fr.ts +164 -164
  114. package/src/tool/pngAWebp/seo.astro +15 -15
  115. package/src/tool/svgAJpg/i18n/fr.ts +164 -164
  116. package/src/tool/svgAJpg/seo.astro +15 -15
  117. package/src/tool/svgAPng/i18n/fr.ts +164 -164
  118. package/src/tool/svgAPng/seo.astro +15 -15
  119. package/src/tool/webpAIco/seo.astro +15 -15
  120. package/src/tool/webpAJpg/seo.astro +15 -15
  121. package/src/tool/webpAPng/bibliography.ts +13 -13
  122. package/src/tool/webpAPng/i18n/de.ts +166 -166
  123. package/src/tool/webpAPng/i18n/es.ts +171 -171
  124. package/src/tool/webpAPng/i18n/fr.ts +166 -166
  125. package/src/tool/webpAPng/i18n/id.ts +166 -166
  126. package/src/tool/webpAPng/i18n/it.ts +166 -166
  127. package/src/tool/webpAPng/i18n/nl.ts +166 -166
  128. package/src/tool/webpAPng/i18n/pl.ts +166 -166
  129. package/src/tool/webpAPng/i18n/pt.ts +166 -166
  130. package/src/tool/webpAPng/i18n/ru.ts +166 -166
  131. package/src/tool/webpAPng/i18n/sv.ts +166 -166
  132. package/src/tool/webpAPng/i18n/tr.ts +167 -167
  133. package/src/tool/webpAPng/seo.astro +15 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-converters",
3
- "version": "1.25.0",
3
+ "version": "1.26.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -27,7 +27,7 @@
27
27
  "lint": "eslint src/ --max-warnings 0 && stylelint \"src/**/*.{css,astro}\"",
28
28
  "check": "astro check",
29
29
  "type-check": "astro check",
30
- "test": "vitest run",
30
+ "test": "vitest run --reporter=verbose --testTimeout=30000",
31
31
  "preversion": "npm run lint && npm run test && npm run build",
32
32
  "postversion": "git push && git push --tags",
33
33
  "patch": "npm version patch",
@@ -3,7 +3,7 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'bild-konverter',
5
5
  title: 'Online Bild Konverter',
6
- description: 'Kostenlose Tools zur Konvertierung von Bildern zwischen den Formaten PNG, JPG, WebP, SVG, AVIF, GIF, BMP und ICO. Die Verarbeitung erfolgt vollständig lokal in Ihrem Browser, ohne Upload ins Internet.',
6
+ description: 'Kostenlose Bildkonverter für PNG, JPG, WebP, SVG, AVIF, GIF, BMP und ICO. Die Verarbeitung läuft lokal im Browser, ohne Upload ins Internet.',
7
7
  seo: [
8
8
  {
9
9
  type: 'summary',
@@ -3,7 +3,7 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'image-converters',
5
5
  title: 'Online Image Converters',
6
- description: 'Free tools to convert images between PNG, JPG, WebP, SVG, AVIF, GIF, BMP and ICO formats. Everything is processed locally in your browser without uploading anything to the internet.',
6
+ description: 'Free image converters for PNG, JPG, WebP, SVG, AVIF, GIF, BMP and ICO. Processing runs locally in your browser without uploading files to the internet.',
7
7
  seo: [
8
8
  {
9
9
  type: 'summary',
@@ -3,7 +3,7 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'convertisseurs-image',
5
5
  title: 'Convertisseurs d\'Image en Ligne',
6
- description: 'Outils gratuits pour convertir des images entre les formats PNG, JPG, WebP, SVG, AVIF, GIF, BMP et ICO. Tout est traité localement dans votre navigateur sans rien télécharger sur internet.',
6
+ description: "Convertisseurs d'images gratuits pour PNG, JPG, WebP, SVG, AVIF, GIF, BMP et ICO. Le traitement reste local dans votre navigateur, sans envoyer de fichiers sur Internet.",
7
7
  seo: [
8
8
  {
9
9
  type: 'summary',
@@ -3,7 +3,7 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'pengonversi-gambar',
5
5
  title: 'Pengonversi Gambar Online',
6
- description: 'Alat gratis untuk mengonversi gambar antara format PNG, JPG, WebP, SVG, AVIF, GIF, BMP, dan ICO. Semuanya diproses secara lokal di browser Anda tanpa mengunggah apa pun ke internet.',
6
+ description: 'Konverter gambar gratis untuk PNG, JPG, WebP, SVG, AVIF, GIF, BMP, dan ICO. Pemrosesan berjalan secara lokal di browser tanpa mengunggah file ke internet.',
7
7
  seo: [
8
8
  {
9
9
  type: 'summary',
@@ -3,7 +3,7 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'convertitori-di-immagini',
5
5
  title: 'Convertitori di Immagini Online',
6
- description: 'Strumenti gratuiti per convertire immagini tra i formati PNG, JPG, WebP, SVG, AVIF, GIF, BMP e ICO. Tutto viene elaborato localmente nel tuo browser senza caricare nulla su Internet.',
6
+ description: "Convertitori di immagini gratuiti per PNG, JPG, WebP, SVG, AVIF, GIF, BMP e ICO. L'elaborazione avviene localmente nel browser senza caricare file su Internet.",
7
7
  seo: [
8
8
  {
9
9
  type: 'summary',
@@ -3,7 +3,7 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'afbeelding-converters',
5
5
  title: 'Online Afbeelding Converters',
6
- description: 'Gratis tools om afbeeldingen te converteren tussen PNG, JPG, WebP, SVG, AVIF, GIF, BMP en ICO formaten. Alles wordt lokaal in je browser verwerkt zonder iets naar het internet te uploaden.',
6
+ description: 'Gratis beeldconverters voor PNG, JPG, WebP, SVG, AVIF, GIF, BMP en ICO. De verwerking gebeurt lokaal in je browser zonder bestanden naar internet te uploaden.',
7
7
  seo: [
8
8
  {
9
9
  type: 'summary',
@@ -3,7 +3,7 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'konwertery-obrazow',
5
5
  title: 'Konwertery Obrazów Online',
6
- description: 'Darmowe narzędzia do konwersji obrazów między formatami PNG, JPG, WebP, SVG, AVIF, GIF, BMP i ICO. Wszystko jest przetwarzane lokalnie w Twojej przeglądarce, bez przesyłania plików do Internetu.',
6
+ description: 'Darmowe konwertery obrazów PNG, JPG, WebP, SVG, AVIF, GIF, BMP i ICO. Przetwarzanie odbywa się lokalnie w przeglądarce, bez wysyłania plików do Internetu.',
7
7
  seo: [
8
8
  {
9
9
  type: 'summary',
@@ -3,7 +3,7 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'conversores-de-imagem',
5
5
  title: 'Conversores de Imagem Online',
6
- description: 'Ferramentas gratuitas para converter imagens entre os formatos PNG, JPG, WebP, SVG, AVIF, GIF, BMP e ICO. Tudo é processado localmente no seu navegador, sem carregar nada para a internet.',
6
+ description: 'Conversores de imagem gratuitos para PNG, JPG, WebP, SVG, AVIF, GIF, BMP e ICO. O processamento ocorre localmente no navegador, sem enviar ficheiros para a Internet.',
7
7
  seo: [
8
8
  {
9
9
  type: 'summary',
@@ -3,7 +3,7 @@ import type { CategoryLocaleContent } from '../../types';
3
3
  export const content: CategoryLocaleContent = {
4
4
  slug: 'bildkonverterare',
5
5
  title: 'Bildkonverterare Online',
6
- description: 'Gratis verktyg för att konvertera bilder mellan formaten PNG, JPG, WebP, SVG, AVIF, GIF, BMP och ICO. Allt bearbetas lokalt i din webbläsare utan att något laddas upp till internet.',
6
+ description: 'Gratis bildkonverterare för PNG, JPG, WebP, SVG, AVIF, GIF, BMP och ICO. Bearbetningen sker lokalt i webbläsaren utan att filer laddas upp till internet.',
7
7
  seo: [
8
8
  {
9
9
  type: 'summary',
@@ -0,0 +1,46 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { readdirSync, readFileSync, existsSync } from 'fs';
3
+ import { join, relative } from 'path';
4
+
5
+ function findBibliographyAstroFiles(dir: string): string[] {
6
+ const files: string[] = [];
7
+ if (!existsSync(dir)) return files;
8
+ const entries = readdirSync(dir, { withFileTypes: true });
9
+
10
+ for (const entry of entries) {
11
+ const fullPath = join(dir, entry.name);
12
+ if (entry.isDirectory()) {
13
+ files.push(...findBibliographyAstroFiles(fullPath));
14
+ } else if (entry.isFile() && entry.name === 'bibliography.astro') {
15
+ files.push(fullPath);
16
+ }
17
+ }
18
+
19
+ return files;
20
+ }
21
+
22
+ const toolDir = join(process.cwd(), 'src', 'tool');
23
+ const bibliographyFiles = findBibliographyAstroFiles(toolDir);
24
+
25
+ describe('Bibliography Component Wellformed Export', () => {
26
+ it('found tool bibliography.astro components', () => {
27
+ expect(bibliographyFiles.length).toBeGreaterThan(0);
28
+ });
29
+
30
+ bibliographyFiles.forEach((file) => {
31
+ const relativePath = relative(process.cwd(), file);
32
+
33
+ it(`${relativePath} should use SharedBibliography from @jjlmoya/utils-shared`, () => {
34
+ const content = readFileSync(file, 'utf-8');
35
+
36
+ const usesSharedComponent =
37
+ content.includes('@jjlmoya/utils-shared') &&
38
+ (content.includes('Bibliography') || content.includes('SharedBibliography'));
39
+
40
+ expect(
41
+ usesSharedComponent,
42
+ `File "${relativePath}" does not use the standard Bibliography component from @jjlmoya/utils-shared, resulting in unstyled or raw bibliography output.`,
43
+ ).toBe(true);
44
+ });
45
+ });
46
+ });
@@ -0,0 +1,74 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import type { CategoryLocaleContent } from '../types';
3
+
4
+ const EXPECTED_LOCALES = [
5
+ 'de', 'en', 'es', 'fr', 'id', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'zh',
6
+ ] as const;
7
+ const COMPACT_LOCALES = new Set(['ja', 'ko', 'zh']);
8
+
9
+ const localeModules = import.meta.glob('../category/i18n/*.ts', { eager: true }) as Record<
10
+ string,
11
+ { content: CategoryLocaleContent }
12
+ >;
13
+
14
+ function textFrom(value: unknown): string {
15
+ if (typeof value === 'string') return value.replace(/<[^>]*>/g, ' ');
16
+ if (Array.isArray(value)) return value.map(textFrom).join(' ');
17
+ if (value && typeof value === 'object') return Object.values(value).map(textFrom).join(' ');
18
+ return '';
19
+ }
20
+
21
+ const STRONG_CLAIM = /\b(?:garantiz\w*|guarante\w*|validat(?:ed)|valid(?:ated|ado|ada|ados|adas|ée|ées)|actualizad\w*)\b/iu;
22
+
23
+ function getContents(): Map<string, CategoryLocaleContent> {
24
+ return new Map(
25
+ Object.entries(localeModules).map(([file, module]) => [file.match(/\/([a-z]{2})\.ts$/u)?.[1] ?? file, module.content]),
26
+ );
27
+ }
28
+
29
+ function validateContent(locale: string, content: CategoryLocaleContent): string[] {
30
+ const failures: string[] = [];
31
+ const check = (condition: boolean, message: string) => { if (!condition) failures.push(`${locale}: ${message}`); };
32
+ const minimumTitleLength = COMPACT_LOCALES.has(locale) ? 4 : 12;
33
+ const minimumDescriptionLength = COMPACT_LOCALES.has(locale) ? 20 : 60;
34
+ check(content.title.trim().length >= minimumTitleLength && content.title.trim().length <= 70, 'title must use a useful 4/12–70 character length');
35
+ check(content.description.trim().length >= minimumDescriptionLength && content.description.trim().length <= 180, 'description must use a useful 20/60–180 character length');
36
+ check(content.seo.length >= 2, 'SEO needs at least two sections');
37
+ check(content.seo.some((section) => section.type === 'paragraph'), 'SEO needs visible explanatory copy');
38
+
39
+ const seoText = textFrom(content.seo).replace(/\s+/g, ' ').trim();
40
+ const minimumSeoLength = COMPACT_LOCALES.has(locale) ? 120 : 240;
41
+ check(seoText.length >= minimumSeoLength, 'SEO copy must contain the minimum visible copy for its script');
42
+ check(content.seo.filter((section) => section.type === 'title').length >= 1, 'SEO needs a section heading');
43
+ check(!/[�]/u.test(seoText), 'SEO contains replacement characters');
44
+ check(!/ {2,}/u.test(seoText), 'SEO contains duplicated whitespace');
45
+ check(!STRONG_CLAIM.test(seoText), 'SEO contains an unsupported strong claim');
46
+
47
+ check(content.slug.trim().length > 0 && /^[a-z0-9-]+$/u.test(content.slug), 'slug must be a non-empty URL-safe value');
48
+ return failures;
49
+ }
50
+
51
+ describe('Category SEO quality contract', () => {
52
+ it('has one content file for every configured locale', () => {
53
+ const contents = getContents();
54
+ expect([...contents.keys()].sort()).toEqual([...EXPECTED_LOCALES].sort());
55
+ });
56
+
57
+ it('keeps metadata, SEO structure and copy quality above the minimum in every locale', () => {
58
+ const contents = getContents();
59
+ const english = contents.get('en');
60
+ expect(english, 'English category content is required as the structural reference').toBeDefined();
61
+
62
+ const failures = EXPECTED_LOCALES.flatMap((locale) => {
63
+ const content = contents.get(locale);
64
+ return content ? validateContent(locale, content) : [];
65
+ });
66
+
67
+ for (const locale of EXPECTED_LOCALES) {
68
+ const content = contents.get(locale);
69
+ if (!content) failures.push(`${locale}: category content is missing`);
70
+ }
71
+
72
+ expect(failures, 'category SEO quality failures').toEqual([]);
73
+ }, 30000);
74
+ });
@@ -16,4 +16,4 @@ describe('FAQ Content Validation', () => {
16
16
  expect(TOOLS.length).toBe(0);
17
17
  });
18
18
  });
19
-
19
+
@@ -45,4 +45,4 @@ describe('No H1 in Components', () => {
45
45
  });
46
46
  });
47
47
  });
48
-
48
+
@@ -27,7 +27,7 @@ async function verifyLocaleParity(
27
27
  expect(
28
28
  locSeoCount,
29
29
  `Locale ${loc} SEO sections count (${locSeoCount}) must match EN (${expected.seo})`,
30
- ).toBe(expected.seo);
30
+ ).toBeGreaterThanOrEqual(expected.seo);
31
31
  expect(
32
32
  locFaqCount,
33
33
  `Locale ${loc} FAQ items count (${locFaqCount}) must match EN (${expected.faq})`,
@@ -41,7 +41,7 @@ async function verifyLocaleParity(
41
41
  describe('SEO & i18n Structural Parity Suite', () => {
42
42
  ALL_ENTRIES.forEach((entry) => {
43
43
  describe(`Tool: ${entry.id}`, () => {
44
- it('all 15 locales should have identical SEO section counts and types as English', async () => {
44
+ it('all 15 locales should provide at least the complete English SEO section set', async () => {
45
45
  const enContent = await entry.i18n.en?.();
46
46
  expect(enContent).toBeDefined();
47
47
  const expected: ExpectedCounts = {
@@ -0,0 +1,65 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { readdirSync, readFileSync, existsSync } from 'fs';
3
+ import { join, relative } from 'path';
4
+
5
+ function findSeoAstroFiles(dir: string): string[] {
6
+ const files: string[] = [];
7
+ if (!existsSync(dir)) return files;
8
+ const entries = readdirSync(dir, { withFileTypes: true });
9
+
10
+ for (const entry of entries) {
11
+ const fullPath = join(dir, entry.name);
12
+ if (entry.isDirectory()) {
13
+ files.push(...findSeoAstroFiles(fullPath));
14
+ } else if (entry.isFile() && entry.name === 'seo.astro') {
15
+ files.push(fullPath);
16
+ }
17
+ }
18
+
19
+ return files;
20
+ }
21
+
22
+ const toolDir = join(process.cwd(), 'src', 'tool');
23
+ const seoFiles = findSeoAstroFiles(toolDir);
24
+
25
+ describe('SEO Component Wellformed Export', () => {
26
+ it('found tool seo.astro components', () => {
27
+ expect(seoFiles.length).toBeGreaterThan(0);
28
+ });
29
+
30
+ seoFiles.forEach((file) => {
31
+ const relativePath = relative(process.cwd(), file);
32
+
33
+ it(`${relativePath} should dynamically load SEO sections and use SEORenderer`, () => {
34
+ const content = readFileSync(file, 'utf-8');
35
+
36
+ const usesSeoRenderer =
37
+ content.includes('@jjlmoya/utils-shared') &&
38
+ (content.includes('SEORenderer') || content.includes('SEOArticle'));
39
+
40
+ const acquiresDynamicContent =
41
+ content.includes('.i18n') ||
42
+ content.includes('loader') ||
43
+ content.includes('await loader') ||
44
+ content.includes('.seo');
45
+
46
+ const isBrokenPattern =
47
+ /sections\s*=\s*\[\s*\]/.test(content) && !acquiresDynamicContent;
48
+
49
+ expect(
50
+ usesSeoRenderer,
51
+ `File "${relativePath}" does not import or use SEORenderer from @jjlmoya/utils-shared.`,
52
+ ).toBe(true);
53
+
54
+ expect(
55
+ isBrokenPattern,
56
+ `File "${relativePath}" relies on a static sections=[] prop default without fetching content from entry.i18n, resulting in empty SEO text on consumers.`,
57
+ ).toBe(false);
58
+
59
+ expect(
60
+ acquiresDynamicContent,
61
+ `File "${relativePath}" does not fetch dynamic i18n content for SEO rendering.`,
62
+ ).toBe(true);
63
+ });
64
+ });
65
+ });
@@ -1,17 +1,17 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { ALL_TOOLS } from '../tools';
3
- import { convertersCategory } from '../data';
4
-
5
- describe('Tool Validation Suite', () => {
6
- describe('Library Registration', () => {
1
+ import { describe, it, expect } from 'vitest';
2
+ import { ALL_TOOLS } from '../tools';
3
+ import { convertersCategory } from '../data';
4
+
5
+ describe('Tool Validation Suite', () => {
6
+ describe('Library Registration', () => {
7
7
  it('should have 24 tools in ALL_TOOLS', () => {
8
8
  expect(ALL_TOOLS.length).toBe(24);
9
- });
10
-
11
- it('convertersCategory should be defined', () => {
12
- expect(convertersCategory).toBeDefined();
13
- expect(convertersCategory.i18n).toBeDefined();
14
- });
15
- });
16
- });
17
-
9
+ });
10
+
11
+ it('convertersCategory should be defined', () => {
12
+ expect(convertersCategory).toBeDefined();
13
+ expect(convertersCategory.i18n).toBeDefined();
14
+ });
15
+ });
16
+ });
17
+