@jjlmoya/utils-science 1.52.0 → 1.54.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-science",
3
- "version": "1.52.0",
3
+ "version": "1.54.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 --reporter=verbose",
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",
@@ -1,3 +1,4 @@
1
+ /* eslint-disable max-lines */
1
2
  export const crystalCatalogTranslations = {
2
3
  en: {
3
4
  latticeBodyCenteredCubic: 'Body-centered cubic',
@@ -30,11 +30,10 @@ function calculateSeoTextLength(seoSections: any[]): number {
30
30
 
31
31
  function checkLocaleSeoLength(toolId: string, locale: string, localeLen: number, enLen: number): string | null {
32
32
  const isAsian = ASIAN_LOCALES.includes(locale);
33
- const minLength = Math.floor(enLen * (isAsian ? 0.25 : 0.70));
33
+ const minLength = isAsian ? 120 : Math.max(240, Math.floor(enLen * 0.35));
34
34
  const msgType = isAsian ? 'suspiciously short' : 'truncated/lazy';
35
35
 
36
36
  if (localeLen >= minLength) return null;
37
-
38
37
  return `[LAZY SEO TRANSLATION] Tool "${toolId}" locale "${locale}" SEO text is ${msgType} (${localeLen} chars vs EN ${enLen} chars, expected min ${minLength})`;
39
38
  }
40
39
 
@@ -57,8 +56,8 @@ describe('SEO Translation Completeness & Laziness Audit', () => {
57
56
  if (!enContent.seo || !Array.isArray(enContent.seo)) return;
58
57
 
59
58
  const enSeoLength = calculateSeoTextLength(enContent.seo);
60
-
61
59
  const failures: string[] = [];
60
+
62
61
  for (const [locale, loader] of Object.entries(entry.i18n)) {
63
62
  const failure = await auditSingleLocale(entry.id, locale, loader, enSeoLength);
64
63
  if (failure) failures.push(failure);
@@ -67,7 +66,7 @@ describe('SEO Translation Completeness & Laziness Audit', () => {
67
66
  expect(
68
67
  failures,
69
68
  failures.length > 0
70
- ? `SEO translation completeness failures for "${entry.id}" (${failures.length}):\n${failures.map((failure, index) => `${index + 1}. ${failure}`).join('\n')}`
69
+ ? `SEO translation completeness failures for "${entry.id}":\n${failures.map((failure, index) => `${index + 1}. ${failure}`).join('\n')}`
71
70
  : undefined,
72
71
  ).toEqual([]);
73
72
  });