@jjlmoya/utils-social 1.2.0 → 1.3.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 +1 -1
- package/src/index.ts +8 -0
- package/src/tests/title_quality.test.ts +55 -0
- package/src/tool/redditFormatter/i18n/en.ts +1 -1
- package/src/tool/redditFormatter/i18n/es.ts +1 -1
- package/src/tool/redditFormatter/i18n/fr.ts +1 -1
- package/src/tool/socialImageResizer/i18n/en.ts +1 -1
- package/src/tool/socialValueCalculator/i18n/es.ts +1 -1
- package/src/tool/socialValueCalculator/i18n/fr.ts +1 -1
- package/src/tool/youtubeThumbnailPreviewer/i18n/en.ts +1 -1
- package/src/tool/youtubeThumbnailPreviewer/i18n/es.ts +1 -1
- package/src/tool/youtubeThumbnailPreviewer/i18n/fr.ts +2 -2
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -25,3 +25,11 @@ export { SocialImageResizerComponent, SocialImageResizerSEO, SocialImageResizerB
|
|
|
25
25
|
export { TinderPhotoOptimizerComponent, TinderPhotoOptimizerSEO, TinderPhotoOptimizerBibliography } from './tool/tinderPhotoOptimizer';
|
|
26
26
|
export { YoutubeThumbnailPreviewerComponent, YoutubeThumbnailPreviewerSEO, YoutubeThumbnailPreviewerBibliography } from './tool/youtubeThumbnailPreviewer';
|
|
27
27
|
|
|
28
|
+
export { SAFE_ZONES_TOOL } from './tool/safeZones/index';
|
|
29
|
+
export { YOUTUBE_THUMBNAIL_TOOL } from './tool/youtubeThumbnail/index';
|
|
30
|
+
export { SOCIAL_VALUE_CALCULATOR_TOOL } from './tool/socialValueCalculator/index';
|
|
31
|
+
export { REDDIT_FORMATTER_TOOL } from './tool/redditFormatter/index';
|
|
32
|
+
export { SOCIAL_IMAGE_RESIZER_TOOL } from './tool/socialImageResizer/index';
|
|
33
|
+
export { TINDER_PHOTO_OPTIMIZER_TOOL } from './tool/tinderPhotoOptimizer/index';
|
|
34
|
+
export { YOUTUBE_THUMBNAIL_PREVIEWER_TOOL } from './tool/youtubeThumbnailPreviewer/index';
|
|
35
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { describe, it } from 'vitest';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
|
|
5
|
+
function getFiles(dir: string, ext: string[]): string[] {
|
|
6
|
+
const results: string[] = [];
|
|
7
|
+
if (!fs.existsSync(dir)) return results;
|
|
8
|
+
const list = fs.readdirSync(dir);
|
|
9
|
+
for (const file of list) {
|
|
10
|
+
const fullPath = path.join(dir, file);
|
|
11
|
+
const stat = fs.statSync(fullPath);
|
|
12
|
+
if (stat && stat.isDirectory()) {
|
|
13
|
+
results.push(...getFiles(fullPath, ext));
|
|
14
|
+
} else if (ext.some((e) => file.endsWith(e))) {
|
|
15
|
+
results.push(fullPath);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return results;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const SRC_DIR = path.join(process.cwd(), 'src');
|
|
22
|
+
|
|
23
|
+
describe('Project Titles - Separator Validation', () => {
|
|
24
|
+
const files = [
|
|
25
|
+
...getFiles(path.join(SRC_DIR, 'tool'), ['.ts']),
|
|
26
|
+
...getFiles(path.join(SRC_DIR, 'category'), ['.ts']),
|
|
27
|
+
].filter(f => f.includes('i18n'));
|
|
28
|
+
|
|
29
|
+
it.each(files)('Verify that titles in %s do not contain | or -', (filePath) => {
|
|
30
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
31
|
+
const relativePath = path.relative(process.cwd(), filePath);
|
|
32
|
+
|
|
33
|
+
const titlePatterns = [
|
|
34
|
+
/const\s+title\s*=\s*['"]([^'"]+)['"]/g,
|
|
35
|
+
/title\s*:\s*['"]([^'"]+)['"]/g,
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
const findings: string[] = [];
|
|
39
|
+
|
|
40
|
+
for (const pattern of titlePatterns) {
|
|
41
|
+
let match;
|
|
42
|
+
while ((match = pattern.exec(content)) !== null) {
|
|
43
|
+
const title = match[1];
|
|
44
|
+
if (title.includes('|') || title.includes('-')) {
|
|
45
|
+
findings.push(title);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (findings.length > 0) {
|
|
51
|
+
const list = findings.map((f) => ` - "${f}"`).join('\n');
|
|
52
|
+
throw new Error(`Forbidden separators (| or -) found in titles in ${relativePath}:\n${list}`);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -3,7 +3,7 @@ import type { ToolLocaleContent } from '../../../types';
|
|
|
3
3
|
import type { RedditFormatterUI } from '../ui';
|
|
4
4
|
|
|
5
5
|
const slug = 'reddit-text-formatter';
|
|
6
|
-
const title = 'Reddit Text Formatter
|
|
6
|
+
const title = 'Reddit Text Formatter: Cleaner and Markdown Fixer';
|
|
7
7
|
const description =
|
|
8
8
|
'Advanced text cleaner for posting on Reddit. Fixes missing line breaks, removes multiple spaces and hidden characters that break Markdown.';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import type { ToolLocaleContent } from '../../../types';
|
|
|
3
3
|
import type { RedditFormatterUI } from '../ui';
|
|
4
4
|
|
|
5
5
|
const slug = 'formateador-reddit';
|
|
6
|
-
const title = 'Formateador Reddit
|
|
6
|
+
const title = 'Formateador Reddit: Limpiador y Adaptador de Texto';
|
|
7
7
|
const description =
|
|
8
8
|
'Limpiador avanzado de texto para publicar en Reddit. Arregla los saltos de línea perdidos, elimina espacios múltiples y caracteres ocultos que rompen el Markdown.';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import type { ToolLocaleContent } from '../../../types';
|
|
|
3
3
|
import type { RedditFormatterUI } from '../ui';
|
|
4
4
|
|
|
5
5
|
const slug = 'formateur-reddit';
|
|
6
|
-
const title = "Formateur Reddit
|
|
6
|
+
const title = "Formateur Reddit : Nettoyeur et Adaptateur de Texte";
|
|
7
7
|
const description =
|
|
8
8
|
"Nettoyeur avancé de texte pour publier sur Reddit. Corrige les sauts de ligne manquants, supprime les espaces multiples et les caractères cachés qui cassent le Markdown.";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import type { ToolLocaleContent } from '../../../types';
|
|
|
3
3
|
import type { SocialImageResizerUI } from '../ui';
|
|
4
4
|
|
|
5
5
|
const slug = 'social-media-image-resizer';
|
|
6
|
-
const title = 'Social Media Image Resizer
|
|
6
|
+
const title = 'Social Media Image Resizer: Crop & Resize for Every Platform';
|
|
7
7
|
const description =
|
|
8
8
|
'Resize and crop your photos for Instagram, TikTok, YouTube and more. Smart cropping with updated official dimensions for 2026.';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import type { ToolLocaleContent } from '../../../types';
|
|
|
3
3
|
import type { SocialValueCalculatorUI } from '../ui';
|
|
4
4
|
|
|
5
5
|
const slug = 'calculadora-valor-cuenta-redes-sociales';
|
|
6
|
-
const title = 'Calculadora de Valor de Cuenta TikTok & Instagram
|
|
6
|
+
const title = 'Calculadora de Valor de Cuenta TikTok & Instagram : Precios';
|
|
7
7
|
const description =
|
|
8
8
|
'Descubre cuánto cobrar por tus publicaciones patrocinadas. Nuestra calculadora analiza seguidores, engagement y nicho para darte un valor de mercado justo.';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import type { ToolLocaleContent } from '../../../types';
|
|
|
3
3
|
import type { SocialValueCalculatorUI } from '../ui';
|
|
4
4
|
|
|
5
5
|
const slug = 'calculateur-valeur-compte-reseaux-sociaux';
|
|
6
|
-
const title = 'Calculateur de Valeur de Compte TikTok & Instagram
|
|
6
|
+
const title = 'Calculateur de Valeur de Compte TikTok & Instagram : Tarifs';
|
|
7
7
|
const description =
|
|
8
8
|
"Découvrez combien facturer pour vos publications sponsorisées. Notre calculateur analyse les abonnés, l'engagement et le créneau pour vous donner une valeur de marché juste.";
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import type { ToolLocaleContent } from '../../../types';
|
|
|
3
3
|
import type { YoutubeThumbnailPreviewerUI } from '../ui';
|
|
4
4
|
|
|
5
5
|
const slug = 'youtube-thumbnail-previewer';
|
|
6
|
-
const title = 'YouTube Thumbnail Previewer Online
|
|
6
|
+
const title = 'YouTube Thumbnail Previewer Online: Boost Your CTR for Free';
|
|
7
7
|
const description =
|
|
8
8
|
'Upload your thumbnail and see how it looks in the real YouTube feed on mobile and desktop. Dark and light mode simulator to optimize clicks instantly.';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import type { ToolLocaleContent } from '../../../types';
|
|
|
3
3
|
import type { YoutubeThumbnailPreviewerUI } from '../ui';
|
|
4
4
|
|
|
5
5
|
const slug = 'previsualizador-miniaturas-youtube';
|
|
6
|
-
const title = 'Previsualizador de Miniaturas YouTube Online
|
|
6
|
+
const title = 'Previsualizador de Miniaturas YouTube Online: Mejora tu CTR Gratis';
|
|
7
7
|
const description =
|
|
8
8
|
'Sube tu miniatura y visualiza cómo queda en el feed real de YouTube móvil y desktop. Simulador de modo oscuro y claro para optimizar clics instantáneos.';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import type { ToolLocaleContent } from '../../../types';
|
|
|
3
3
|
import type { YoutubeThumbnailPreviewerUI } from '../ui';
|
|
4
4
|
|
|
5
5
|
const slug = 'apercu-miniatures-youtube';
|
|
6
|
-
const title = 'Aperçu des Miniatures YouTube en Ligne
|
|
6
|
+
const title = 'Aperçu des Miniatures YouTube en Ligne : Améliorez votre CTR Gratuitement';
|
|
7
7
|
const description =
|
|
8
8
|
'Téléchargez votre miniature et visualisez comment elle apparaît dans le vrai feed YouTube mobile et desktop. Simulateur mode sombre et clair pour optimiser les clics instantanément.';
|
|
9
9
|
|
|
@@ -231,7 +231,7 @@ export const content: ToolLocaleContent<YoutubeThumbnailPreviewerUI> = {
|
|
|
231
231
|
body: 'Contexte instantané · Utilisez des polices Sans Serif grasses et des couleurs complémentaires.',
|
|
232
232
|
},
|
|
233
233
|
{
|
|
234
|
-
title: '
|
|
234
|
+
title: 'Fond Flou',
|
|
235
235
|
body: 'Séparation des plans · Ajoute de la profondeur pour que le sujet principal "saute" de l\'écran.',
|
|
236
236
|
},
|
|
237
237
|
{
|