@jjlmoya/utils-developer 1.2.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 (228) hide show
  1. package/package.json +64 -0
  2. package/src/category/i18n/en.ts +34 -0
  3. package/src/category/i18n/es.ts +34 -0
  4. package/src/category/i18n/fr.ts +34 -0
  5. package/src/category/index.ts +31 -0
  6. package/src/category/seo.astro +15 -0
  7. package/src/components/PreviewNavSidebar.astro +116 -0
  8. package/src/components/PreviewToolbar.astro +143 -0
  9. package/src/data.ts +11 -0
  10. package/src/env.d.ts +5 -0
  11. package/src/index.ts +78 -0
  12. package/src/layouts/PreviewLayout.astro +117 -0
  13. package/src/pages/[locale]/[slug].astro +146 -0
  14. package/src/pages/[locale].astro +251 -0
  15. package/src/pages/index.astro +4 -0
  16. package/src/tests/css_specificity_logic.test.ts +39 -0
  17. package/src/tests/faq_count.test.ts +19 -0
  18. package/src/tests/locale_completeness.test.ts +42 -0
  19. package/src/tests/mocks/astro_mock.js +2 -0
  20. package/src/tests/no_h1_in_components.test.ts +48 -0
  21. package/src/tests/schemas_fulfillment.test.ts +23 -0
  22. package/src/tests/seo_length.test.ts +22 -0
  23. package/src/tests/title_quality.test.ts +55 -0
  24. package/src/tests/tool_validation.test.ts +17 -0
  25. package/src/tool/aspectRatio/bibliography.astro +14 -0
  26. package/src/tool/aspectRatio/component.astro +468 -0
  27. package/src/tool/aspectRatio/i18n/en.ts +177 -0
  28. package/src/tool/aspectRatio/i18n/es.ts +177 -0
  29. package/src/tool/aspectRatio/i18n/fr.ts +177 -0
  30. package/src/tool/aspectRatio/index.ts +34 -0
  31. package/src/tool/aspectRatio/seo.astro +14 -0
  32. package/src/tool/aspectRatio/ui.ts +12 -0
  33. package/src/tool/calculadoraTiempoDatos/bibliography.astro +14 -0
  34. package/src/tool/calculadoraTiempoDatos/component.astro +829 -0
  35. package/src/tool/calculadoraTiempoDatos/i18n/en.ts +150 -0
  36. package/src/tool/calculadoraTiempoDatos/i18n/es.ts +163 -0
  37. package/src/tool/calculadoraTiempoDatos/i18n/fr.ts +150 -0
  38. package/src/tool/calculadoraTiempoDatos/index.ts +33 -0
  39. package/src/tool/calculadoraTiempoDatos/seo.astro +14 -0
  40. package/src/tool/calculadoraTiempoDatos/ui.ts +24 -0
  41. package/src/tool/colorConverter/bibliography.astro +14 -0
  42. package/src/tool/colorConverter/component.astro +504 -0
  43. package/src/tool/colorConverter/i18n/en.ts +126 -0
  44. package/src/tool/colorConverter/i18n/es.ts +126 -0
  45. package/src/tool/colorConverter/i18n/fr.ts +126 -0
  46. package/src/tool/colorConverter/index.ts +33 -0
  47. package/src/tool/colorConverter/seo.astro +14 -0
  48. package/src/tool/colorConverter/ui.ts +16 -0
  49. package/src/tool/conversorExcelCsvHtml/bibliography.astro +14 -0
  50. package/src/tool/conversorExcelCsvHtml/component.astro +595 -0
  51. package/src/tool/conversorExcelCsvHtml/i18n/en.ts +129 -0
  52. package/src/tool/conversorExcelCsvHtml/i18n/es.ts +129 -0
  53. package/src/tool/conversorExcelCsvHtml/i18n/fr.ts +129 -0
  54. package/src/tool/conversorExcelCsvHtml/index.ts +33 -0
  55. package/src/tool/conversorExcelCsvHtml/seo.astro +14 -0
  56. package/src/tool/conversorExcelCsvHtml/ui.ts +14 -0
  57. package/src/tool/cronGenerator/bibliography.astro +14 -0
  58. package/src/tool/cronGenerator/component.astro +667 -0
  59. package/src/tool/cronGenerator/i18n/en.ts +191 -0
  60. package/src/tool/cronGenerator/i18n/es.ts +191 -0
  61. package/src/tool/cronGenerator/i18n/fr.ts +191 -0
  62. package/src/tool/cronGenerator/index.ts +34 -0
  63. package/src/tool/cronGenerator/seo.astro +14 -0
  64. package/src/tool/cronGenerator/ui.ts +45 -0
  65. package/src/tool/cssSpecificityCalculator/bibliography.astro +14 -0
  66. package/src/tool/cssSpecificityCalculator/component.astro +292 -0
  67. package/src/tool/cssSpecificityCalculator/i18n/en.ts +168 -0
  68. package/src/tool/cssSpecificityCalculator/i18n/es.ts +168 -0
  69. package/src/tool/cssSpecificityCalculator/i18n/fr.ts +168 -0
  70. package/src/tool/cssSpecificityCalculator/index.ts +34 -0
  71. package/src/tool/cssSpecificityCalculator/logic.ts +100 -0
  72. package/src/tool/cssSpecificityCalculator/seo.astro +14 -0
  73. package/src/tool/cssSpecificityCalculator/ui-controller.ts +57 -0
  74. package/src/tool/cssSpecificityCalculator/ui.ts +11 -0
  75. package/src/tool/cssToInlineConverter/bibliography.astro +14 -0
  76. package/src/tool/cssToInlineConverter/component.astro +308 -0
  77. package/src/tool/cssToInlineConverter/i18n/en.ts +160 -0
  78. package/src/tool/cssToInlineConverter/i18n/es.ts +160 -0
  79. package/src/tool/cssToInlineConverter/i18n/fr.ts +160 -0
  80. package/src/tool/cssToInlineConverter/index.ts +34 -0
  81. package/src/tool/cssToInlineConverter/seo.astro +14 -0
  82. package/src/tool/cssToInlineConverter/ui.ts +12 -0
  83. package/src/tool/duplicateCssRemover/bibliography.astro +14 -0
  84. package/src/tool/duplicateCssRemover/component.astro +353 -0
  85. package/src/tool/duplicateCssRemover/i18n/en.ts +167 -0
  86. package/src/tool/duplicateCssRemover/i18n/es.ts +167 -0
  87. package/src/tool/duplicateCssRemover/i18n/fr.ts +167 -0
  88. package/src/tool/duplicateCssRemover/index.ts +34 -0
  89. package/src/tool/duplicateCssRemover/seo.astro +14 -0
  90. package/src/tool/duplicateCssRemover/ui.ts +12 -0
  91. package/src/tool/generadorSecurityTxt/bibliography.astro +14 -0
  92. package/src/tool/generadorSecurityTxt/component.astro +473 -0
  93. package/src/tool/generadorSecurityTxt/i18n/en.ts +173 -0
  94. package/src/tool/generadorSecurityTxt/i18n/es.ts +173 -0
  95. package/src/tool/generadorSecurityTxt/i18n/fr.ts +173 -0
  96. package/src/tool/generadorSecurityTxt/index.ts +33 -0
  97. package/src/tool/generadorSecurityTxt/seo.astro +14 -0
  98. package/src/tool/generadorSecurityTxt/ui.ts +27 -0
  99. package/src/tool/hashGenerator/bibliography.astro +14 -0
  100. package/src/tool/hashGenerator/component.astro +367 -0
  101. package/src/tool/hashGenerator/i18n/en.ts +118 -0
  102. package/src/tool/hashGenerator/i18n/es.ts +118 -0
  103. package/src/tool/hashGenerator/i18n/fr.ts +118 -0
  104. package/src/tool/hashGenerator/index.ts +33 -0
  105. package/src/tool/hashGenerator/md5.ts +138 -0
  106. package/src/tool/hashGenerator/seo.astro +14 -0
  107. package/src/tool/hashGenerator/ui.ts +11 -0
  108. package/src/tool/inspectorCertificadosSsl/bibliography.astro +14 -0
  109. package/src/tool/inspectorCertificadosSsl/component.astro +580 -0
  110. package/src/tool/inspectorCertificadosSsl/i18n/en.ts +214 -0
  111. package/src/tool/inspectorCertificadosSsl/i18n/es.ts +214 -0
  112. package/src/tool/inspectorCertificadosSsl/i18n/fr.ts +214 -0
  113. package/src/tool/inspectorCertificadosSsl/index.ts +33 -0
  114. package/src/tool/inspectorCertificadosSsl/seo.astro +14 -0
  115. package/src/tool/inspectorCertificadosSsl/ui.ts +29 -0
  116. package/src/tool/jsonFormatter/bibliography.astro +14 -0
  117. package/src/tool/jsonFormatter/component.astro +590 -0
  118. package/src/tool/jsonFormatter/i18n/en.ts +156 -0
  119. package/src/tool/jsonFormatter/i18n/es.ts +156 -0
  120. package/src/tool/jsonFormatter/i18n/fr.ts +156 -0
  121. package/src/tool/jsonFormatter/index.ts +34 -0
  122. package/src/tool/jsonFormatter/seo.astro +14 -0
  123. package/src/tool/jsonFormatter/ui.ts +15 -0
  124. package/src/tool/keycode/bibliography.astro +14 -0
  125. package/src/tool/keycode/component.astro +540 -0
  126. package/src/tool/keycode/i18n/en.ts +160 -0
  127. package/src/tool/keycode/i18n/es.ts +160 -0
  128. package/src/tool/keycode/i18n/fr.ts +160 -0
  129. package/src/tool/keycode/index.ts +34 -0
  130. package/src/tool/keycode/seo.astro +14 -0
  131. package/src/tool/keycode/ui.ts +10 -0
  132. package/src/tool/llmCostCalculator/bibliography.astro +14 -0
  133. package/src/tool/llmCostCalculator/component.astro +488 -0
  134. package/src/tool/llmCostCalculator/data.ts +99 -0
  135. package/src/tool/llmCostCalculator/i18n/en.ts +165 -0
  136. package/src/tool/llmCostCalculator/i18n/es.ts +165 -0
  137. package/src/tool/llmCostCalculator/i18n/fr.ts +165 -0
  138. package/src/tool/llmCostCalculator/index.ts +34 -0
  139. package/src/tool/llmCostCalculator/seo.astro +14 -0
  140. package/src/tool/llmCostCalculator/ui.ts +11 -0
  141. package/src/tool/mobileMockupGenerator/app.ts +614 -0
  142. package/src/tool/mobileMockupGenerator/bibliography.astro +14 -0
  143. package/src/tool/mobileMockupGenerator/component.astro +1044 -0
  144. package/src/tool/mobileMockupGenerator/constants.ts +48 -0
  145. package/src/tool/mobileMockupGenerator/i18n/en.ts +121 -0
  146. package/src/tool/mobileMockupGenerator/i18n/es.ts +121 -0
  147. package/src/tool/mobileMockupGenerator/i18n/fr.ts +121 -0
  148. package/src/tool/mobileMockupGenerator/index.ts +33 -0
  149. package/src/tool/mobileMockupGenerator/rendering.ts +189 -0
  150. package/src/tool/mobileMockupGenerator/seo.astro +14 -0
  151. package/src/tool/mobileMockupGenerator/store.ts +145 -0
  152. package/src/tool/mobileMockupGenerator/types.ts +41 -0
  153. package/src/tool/mobileMockupGenerator/ui.ts +48 -0
  154. package/src/tool/musicalTypography/bibliography.astro +14 -0
  155. package/src/tool/musicalTypography/component.astro +480 -0
  156. package/src/tool/musicalTypography/i18n/en.ts +179 -0
  157. package/src/tool/musicalTypography/i18n/es.ts +179 -0
  158. package/src/tool/musicalTypography/i18n/fr.ts +179 -0
  159. package/src/tool/musicalTypography/index.ts +33 -0
  160. package/src/tool/musicalTypography/seo.astro +14 -0
  161. package/src/tool/musicalTypography/ui.ts +25 -0
  162. package/src/tool/placeholderGenerator/bibliography.astro +14 -0
  163. package/src/tool/placeholderGenerator/component.astro +499 -0
  164. package/src/tool/placeholderGenerator/i18n/en.ts +176 -0
  165. package/src/tool/placeholderGenerator/i18n/es.ts +176 -0
  166. package/src/tool/placeholderGenerator/i18n/fr.ts +176 -0
  167. package/src/tool/placeholderGenerator/index.ts +34 -0
  168. package/src/tool/placeholderGenerator/seo.astro +14 -0
  169. package/src/tool/placeholderGenerator/ui.ts +14 -0
  170. package/src/tool/promptLibrary/bibliography.astro +14 -0
  171. package/src/tool/promptLibrary/component.astro +1131 -0
  172. package/src/tool/promptLibrary/controller.ts +49 -0
  173. package/src/tool/promptLibrary/i18n/en.ts +131 -0
  174. package/src/tool/promptLibrary/i18n/es.ts +131 -0
  175. package/src/tool/promptLibrary/i18n/fr.ts +126 -0
  176. package/src/tool/promptLibrary/index.ts +33 -0
  177. package/src/tool/promptLibrary/seo.astro +14 -0
  178. package/src/tool/promptLibrary/ui.ts +29 -0
  179. package/src/tool/readabilityCalculator/bibliography.astro +14 -0
  180. package/src/tool/readabilityCalculator/component.astro +534 -0
  181. package/src/tool/readabilityCalculator/i18n/en.ts +133 -0
  182. package/src/tool/readabilityCalculator/i18n/es.ts +133 -0
  183. package/src/tool/readabilityCalculator/i18n/fr.ts +133 -0
  184. package/src/tool/readabilityCalculator/index.ts +33 -0
  185. package/src/tool/readabilityCalculator/seo.astro +14 -0
  186. package/src/tool/readabilityCalculator/ui.ts +27 -0
  187. package/src/tool/svgSanitizer/bibliography.astro +14 -0
  188. package/src/tool/svgSanitizer/component.astro +554 -0
  189. package/src/tool/svgSanitizer/i18n/en.ts +125 -0
  190. package/src/tool/svgSanitizer/i18n/es.ts +125 -0
  191. package/src/tool/svgSanitizer/i18n/fr.ts +125 -0
  192. package/src/tool/svgSanitizer/index.ts +33 -0
  193. package/src/tool/svgSanitizer/seo.astro +14 -0
  194. package/src/tool/svgSanitizer/ui.ts +18 -0
  195. package/src/tool/svgToCss/bibliography.astro +14 -0
  196. package/src/tool/svgToCss/component.astro +381 -0
  197. package/src/tool/svgToCss/i18n/en.ts +174 -0
  198. package/src/tool/svgToCss/i18n/es.ts +174 -0
  199. package/src/tool/svgToCss/i18n/fr.ts +174 -0
  200. package/src/tool/svgToCss/index.ts +34 -0
  201. package/src/tool/svgToCss/seo.astro +14 -0
  202. package/src/tool/svgToCss/ui.ts +13 -0
  203. package/src/tool/urlCleaner/bibliography.astro +14 -0
  204. package/src/tool/urlCleaner/component.astro +458 -0
  205. package/src/tool/urlCleaner/i18n/en.ts +116 -0
  206. package/src/tool/urlCleaner/i18n/es.ts +116 -0
  207. package/src/tool/urlCleaner/i18n/fr.ts +116 -0
  208. package/src/tool/urlCleaner/index.ts +33 -0
  209. package/src/tool/urlCleaner/seo.astro +14 -0
  210. package/src/tool/urlCleaner/ui.ts +12 -0
  211. package/src/tool/urlEncoderDecoder/bibliography.astro +14 -0
  212. package/src/tool/urlEncoderDecoder/component.astro +291 -0
  213. package/src/tool/urlEncoderDecoder/i18n/en.ts +162 -0
  214. package/src/tool/urlEncoderDecoder/i18n/es.ts +162 -0
  215. package/src/tool/urlEncoderDecoder/i18n/fr.ts +162 -0
  216. package/src/tool/urlEncoderDecoder/index.ts +34 -0
  217. package/src/tool/urlEncoderDecoder/seo.astro +14 -0
  218. package/src/tool/urlEncoderDecoder/ui.ts +11 -0
  219. package/src/tool/utmGenerator/bibliography.astro +14 -0
  220. package/src/tool/utmGenerator/component.astro +270 -0
  221. package/src/tool/utmGenerator/i18n/en.ts +117 -0
  222. package/src/tool/utmGenerator/i18n/es.ts +117 -0
  223. package/src/tool/utmGenerator/i18n/fr.ts +117 -0
  224. package/src/tool/utmGenerator/index.ts +33 -0
  225. package/src/tool/utmGenerator/seo.astro +14 -0
  226. package/src/tool/utmGenerator/ui.ts +13 -0
  227. package/src/tools.ts +27 -0
  228. package/src/types.ts +72 -0
@@ -0,0 +1,156 @@
1
+ import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { JsonFormatterUI } from '../ui';
4
+
5
+ const slug = 'json-formatter';
6
+ const title = 'Free Online JSON Formatter and Validator';
7
+ const description =
8
+ 'Free online tool to format, validate and repair JSON code. Beautify and format JSON. Detects syntax errors and improves code readability.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: 'Is my data safe when using this formatter?',
13
+ answer:
14
+ 'Absolutely. All processing happens 100% in your browser (Client-Side). Your JSON data is never sent to any server, ensuring complete privacy for your data structures.',
15
+ },
16
+ {
17
+ question: "What causes an 'Invalid JSON' error?",
18
+ answer:
19
+ 'It is usually caused by trailing commas at the end of an object, missing double quotes around keys, or invisible characters. Our tool highlights the exact line of the error so you can fix it.',
20
+ },
21
+ {
22
+ question: 'Can it repair broken JSON?',
23
+ answer:
24
+ 'Our tool automatically tries to correct common errors such as unnecessary trailing commas or malformed character escapes, so the JSON becomes valid according to the RFC 8259 standard.',
25
+ },
26
+ {
27
+ question: 'Does it support very large JSON files?',
28
+ answer:
29
+ 'Yes, the processing engine is optimised to handle complex data structures and large files without blocking the browser interface.',
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: 'Paste your code',
36
+ text: 'Paste your unformatted or minified JSON into the main text area.',
37
+ },
38
+ {
39
+ name: 'Validate and Format',
40
+ text: 'The system will automatically analyse the code, highlighting syntax errors and applying indentation to improve readability.',
41
+ },
42
+ {
43
+ name: 'Choose a style',
44
+ text: 'Choose between an expanded (beautify) or compressed (minify) format depending on whether you need readability or space saving.',
45
+ },
46
+ {
47
+ name: 'Copy the result',
48
+ text: 'Click the copy button to take the perfectly validated JSON to your clipboard.',
49
+ },
50
+ ];
51
+
52
+ const faqSchema: WithContext<FAQPage> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'FAQPage',
55
+ mainEntity: faqData.map((item) => ({
56
+ '@type': 'Question',
57
+ name: item.question,
58
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
59
+ })),
60
+ };
61
+
62
+ const howToSchema: WithContext<HowToThing> = {
63
+ '@context': 'https://schema.org',
64
+ '@type': 'HowTo',
65
+ name: title,
66
+ description,
67
+ step: howToData.map((step, i) => ({
68
+ '@type': 'HowToStep',
69
+ position: i + 1,
70
+ name: step.name,
71
+ text: step.text,
72
+ })),
73
+ };
74
+
75
+ const appSchema: WithContext<SoftwareApplication> = {
76
+ '@context': 'https://schema.org',
77
+ '@type': 'SoftwareApplication',
78
+ name: title,
79
+ description,
80
+ applicationCategory: 'UtilityApplication',
81
+ operatingSystem: 'All',
82
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
83
+ inLanguage: 'en',
84
+ };
85
+
86
+ const ui: JsonFormatterUI = {
87
+ labelInput: 'Input (JSON)',
88
+ labelOutput: 'Output',
89
+ btnMinify: 'Minify',
90
+ btnBeautify: 'Beautify',
91
+ btnFix: 'Try to Fix',
92
+ btnCopy: 'Copy',
93
+ statusWaiting: 'Waiting for input...',
94
+ statusValid: 'Valid JSON',
95
+ statusInvalid: 'Invalid JSON',
96
+ toastCopied: 'Copied!',
97
+ toastFixed: 'JSON repaired (Preview)',
98
+ toastFixFailed: 'Could not repair automatically',
99
+ placeholder: 'Paste your JSON here...',
100
+ };
101
+
102
+ export const content: ToolLocaleContent<JsonFormatterUI> = {
103
+ slug,
104
+ title,
105
+ description,
106
+ ui,
107
+ faqTitle: 'Frequently Asked Questions',
108
+ faq: faqData,
109
+ bibliographyTitle: 'References and Standards',
110
+ bibliography: [
111
+ {
112
+ name: 'RFC 8259 – The JavaScript Object Notation (JSON) Data Interchange Format (IETF)',
113
+ url: 'https://datatracker.ietf.org/doc/html/rfc8259',
114
+ },
115
+ {
116
+ name: 'ECMA-404 – The JSON Data Interchange Syntax (Ecma International)',
117
+ url: 'https://www.ecma-international.org/publications-and-standards/standards/ecma-404/',
118
+ },
119
+ {
120
+ name: 'JSON.org – Introducing JSON',
121
+ url: 'https://www.json.org/json-en.html',
122
+ },
123
+ {
124
+ name: 'MDN Web Docs – JSON',
125
+ url: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON',
126
+ },
127
+ ],
128
+ howTo: howToData,
129
+ schemas: [faqSchema, howToSchema, appSchema],
130
+ seo: [
131
+ {
132
+ type: 'title',
133
+ text: 'JSON Validation and Formatting',
134
+ level: 2,
135
+ },
136
+ {
137
+ type: 'paragraph',
138
+ html: 'JSON (JavaScript Object Notation) is the de facto standard for data exchange on the web. However, its strict syntax makes it prone to human errors when edited manually.',
139
+ },
140
+ {
141
+ type: 'paragraph',
142
+ html: 'This tool allows you to validate the structure, format the code to improve its readability, and automatically repair common syntax errors.',
143
+ },
144
+ { type: 'grid', columns: 2 },
145
+ {
146
+ type: 'card',
147
+ title: 'Common Errors it Repairs',
148
+ html: "<ul><li><strong>Single Quotes:</strong> The JSON standard requires double quotes. The tool converts <code>'key': 'value'</code> to <code>\"key\": \"value\"</code>.</li><li><strong>Unquoted Keys:</strong> Detects JavaScript-style object keys and adds the necessary quotes.</li><li><strong>Trailing Commas:</strong> Removes commas at the end of objects or arrays (trailing commas) that break the strict parser.</li></ul>",
149
+ },
150
+ {
151
+ type: 'card',
152
+ title: 'Features',
153
+ html: '<ul><li><strong>Syntax Highlighting:</strong> Colours keys, strings, numbers and booleans to facilitate quick reading.</li><li><strong>Real-Time Validation:</strong> Instantly indicates whether the JSON is valid or shows the specific parsing error.</li><li><strong>Total Privacy:</strong> Processing happens 100% in your browser. No data is sent to external servers.</li></ul>',
154
+ },
155
+ ],
156
+ };
@@ -0,0 +1,156 @@
1
+ import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { JsonFormatterUI } from '../ui';
4
+
5
+ const slug = 'json-formatter';
6
+ const title = 'Formateador y Validador JSON Online Gratuito';
7
+ const description =
8
+ 'Herramienta online gratuita para formatear, validar y reparar código JSON. Formatea y embellece JSON. Detecta errores de sintaxis y mejora la lectura del código';
9
+
10
+ const faqData = [
11
+ {
12
+ question: '¿Son seguros mis datos al usar este formateador?',
13
+ answer:
14
+ 'Totalmente. El procesamiento se realiza 100% en tu navegador (Client-Side). Tus datos JSON nunca se envían a ningún servidor, garantizando privacidad total para tus estructuras de datos.',
15
+ },
16
+ {
17
+ question: "¿Qué causa el error 'Invalid JSON'?",
18
+ answer:
19
+ 'Suele deberse a comas sobrantes al final de un objeto, falta de comillas dobles en las llaves (keys) o caracteres invisibles. Nuestra herramienta resalta la línea exacta del error para que puedas corregirlo.',
20
+ },
21
+ {
22
+ question: '¿Puede reparar JSON dañado?',
23
+ answer:
24
+ 'Nuestra herramienta intenta corregir errores comunes automáticamente, como comas finales innecesarias o escapes de caracteres mal formados, para que el JSON sea válido según el estándar RFC 8259.',
25
+ },
26
+ {
27
+ question: '¿Soporta archivos JSON muy grandes?',
28
+ answer:
29
+ 'Sí, el motor de procesado está optimizado para manejar estructuras de datos complejas y archivos extensos sin bloquear la interfaz del navegador.',
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: 'Pegar el código',
36
+ text: 'Pega tu JSON desordenado o comprimido en el área de texto principal.',
37
+ },
38
+ {
39
+ name: 'Validar y Formatear',
40
+ text: 'El sistema analizará el código automáticamente, resaltando errores de sintaxis y aplicando sangrías para mejorar la lectura.',
41
+ },
42
+ {
43
+ name: 'Elegir estilo',
44
+ text: 'Puedes elegir entre un formato expandido (beautify) o comprimido (minify) según necesites legibilidad o ahorro de espacio.',
45
+ },
46
+ {
47
+ name: 'Copiar resultado',
48
+ text: 'Haz clic en el botón de copiar para llevarte el JSON perfectamente validado a tu portapapeles.',
49
+ },
50
+ ];
51
+
52
+ const faqSchema: WithContext<FAQPage> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'FAQPage',
55
+ mainEntity: faqData.map((item) => ({
56
+ '@type': 'Question',
57
+ name: item.question,
58
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
59
+ })),
60
+ };
61
+
62
+ const howToSchema: WithContext<HowToThing> = {
63
+ '@context': 'https://schema.org',
64
+ '@type': 'HowTo',
65
+ name: title,
66
+ description,
67
+ step: howToData.map((step, i) => ({
68
+ '@type': 'HowToStep',
69
+ position: i + 1,
70
+ name: step.name,
71
+ text: step.text,
72
+ })),
73
+ };
74
+
75
+ const appSchema: WithContext<SoftwareApplication> = {
76
+ '@context': 'https://schema.org',
77
+ '@type': 'SoftwareApplication',
78
+ name: title,
79
+ description,
80
+ applicationCategory: 'UtilityApplication',
81
+ operatingSystem: 'All',
82
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
83
+ inLanguage: 'es',
84
+ };
85
+
86
+ const ui: JsonFormatterUI = {
87
+ labelInput: 'Entrada (JSON)',
88
+ labelOutput: 'Resultado',
89
+ btnMinify: 'Minificar',
90
+ btnBeautify: 'Embellecer',
91
+ btnFix: 'Intentar Arreglar',
92
+ btnCopy: 'Copiar',
93
+ statusWaiting: 'Esperando entrada...',
94
+ statusValid: 'JSON Válido',
95
+ statusInvalid: 'JSON Inválido',
96
+ toastCopied: '¡Copiado!',
97
+ toastFixed: 'JSON reparado (Visualización)',
98
+ toastFixFailed: 'No se pudo reparar automáticamente',
99
+ placeholder: 'Pega tu JSON aquí...',
100
+ };
101
+
102
+ export const content: ToolLocaleContent<JsonFormatterUI> = {
103
+ slug,
104
+ title,
105
+ description,
106
+ ui,
107
+ faqTitle: 'Preguntas Frecuentes',
108
+ faq: faqData,
109
+ bibliographyTitle: 'Referencias y Estándares',
110
+ bibliography: [
111
+ {
112
+ name: 'RFC 8259 – The JavaScript Object Notation (JSON) Data Interchange Format (IETF)',
113
+ url: 'https://datatracker.ietf.org/doc/html/rfc8259',
114
+ },
115
+ {
116
+ name: 'ECMA-404 – The JSON Data Interchange Syntax (Ecma International)',
117
+ url: 'https://www.ecma-international.org/publications-and-standards/standards/ecma-404/',
118
+ },
119
+ {
120
+ name: 'JSON.org – Introducing JSON',
121
+ url: 'https://www.json.org/json-en.html',
122
+ },
123
+ {
124
+ name: 'MDN Web Docs – JSON',
125
+ url: 'https://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/JSON',
126
+ },
127
+ ],
128
+ howTo: howToData,
129
+ schemas: [faqSchema, howToSchema, appSchema],
130
+ seo: [
131
+ {
132
+ type: 'title',
133
+ text: 'Validación y Formato de JSON',
134
+ level: 2,
135
+ },
136
+ {
137
+ type: 'paragraph',
138
+ html: 'JSON (JavaScript Object Notation) es el estándar de facto para el intercambio de datos en la web. Sin embargo, su sintaxis estricta lo hace propenso a errores humanos cuando se edita manualmente.',
139
+ },
140
+ {
141
+ type: 'paragraph',
142
+ html: 'Esta herramienta permite validar la estructura, formatear el código para mejorar su legibilidad y reparar errores sintácticos comunes automáticamente.',
143
+ },
144
+ { type: 'grid', columns: 2 },
145
+ {
146
+ type: 'card',
147
+ title: 'Errores Comunes que Repara',
148
+ html: '<ul><li><strong>Comillas Simples:</strong> El estándar JSON exige comillas dobles. La herramienta convierte <code>\'clave\': \'valor\'</code> a <code>"clave": "valor"</code>.</li><li><strong>Claves sin Comillas:</strong> Detecta claves de objetos estilo JavaScript y les añade las comillas necesarias.</li><li><strong>Comas Sobrantes:</strong> Elimina las comas al final de objetos o arrays (trailing commas) que rompen el parser estricto.</li></ul>',
149
+ },
150
+ {
151
+ type: 'card',
152
+ title: 'Características',
153
+ html: '<ul><li><strong>Resaltado de Sintaxis:</strong> Colorea claves, cadenas, números y booleanos para facilitar la lectura rápida.</li><li><strong>Validación en Tiempo Real:</strong> Indica instantáneamente si el JSON es válido o muestra el error específico de análisis.</li><li><strong>Privacidad Total:</strong> El procesamiento se realiza 100% en tu navegador. Ningún dato se envía a servidores externos.</li></ul>',
154
+ },
155
+ ],
156
+ };
@@ -0,0 +1,156 @@
1
+ import type { WithContext, FAQPage, HowToThing, SoftwareApplication } from 'schema-dts';
2
+ import type { ToolLocaleContent } from '../../../types';
3
+ import type { JsonFormatterUI } from '../ui';
4
+
5
+ const slug = 'json-formatter';
6
+ const title = 'Formateur et Validateur JSON Gratuit en Ligne';
7
+ const description =
8
+ 'Outil en ligne gratuit pour formater, valider et réparer du code JSON. Embellissez et formatez du JSON. Détecte les erreurs de syntaxe et améliore la lisibilité du code.';
9
+
10
+ const faqData = [
11
+ {
12
+ question: 'Mes données sont-elles sécurisées avec ce formateur ?',
13
+ answer:
14
+ "Absolument. Tout le traitement s'effectue à 100% dans votre navigateur (côté client). Vos données JSON ne sont jamais envoyées à un serveur, garantissant une confidentialité totale.",
15
+ },
16
+ {
17
+ question: "Qu'est-ce qui provoque une erreur 'Invalid JSON' ?",
18
+ answer:
19
+ "Elle est généralement causée par des virgules en fin d'objet, l'absence de guillemets doubles autour des clés, ou des caractères invisibles. Notre outil met en évidence la ligne exacte de l'erreur pour que vous puissiez la corriger.",
20
+ },
21
+ {
22
+ question: 'Peut-il réparer du JSON endommagé ?',
23
+ answer:
24
+ "Notre outil tente de corriger automatiquement les erreurs courantes telles que les virgules finales inutiles ou les échappements de caractères mal formés, afin que le JSON soit valide selon la norme RFC 8259.",
25
+ },
26
+ {
27
+ question: 'Prend-il en charge les fichiers JSON très volumineux ?',
28
+ answer:
29
+ "Oui, le moteur de traitement est optimisé pour gérer des structures de données complexes et des fichiers volumineux sans bloquer l'interface du navigateur.",
30
+ },
31
+ ];
32
+
33
+ const howToData = [
34
+ {
35
+ name: 'Coller le code',
36
+ text: 'Collez votre JSON désordonné ou compressé dans la zone de texte principale.',
37
+ },
38
+ {
39
+ name: 'Valider et Formater',
40
+ text: "Le système analysera automatiquement le code, mettra en évidence les erreurs de syntaxe et appliquera l'indentation pour améliorer la lisibilité.",
41
+ },
42
+ {
43
+ name: 'Choisir un style',
44
+ text: "Choisissez entre un format développé (embellir) ou compressé (minifier) selon que vous avez besoin de lisibilité ou d'économie d'espace.",
45
+ },
46
+ {
47
+ name: 'Copier le résultat',
48
+ text: 'Cliquez sur le bouton Copier pour récupérer le JSON parfaitement validé dans votre presse-papiers.',
49
+ },
50
+ ];
51
+
52
+ const faqSchema: WithContext<FAQPage> = {
53
+ '@context': 'https://schema.org',
54
+ '@type': 'FAQPage',
55
+ mainEntity: faqData.map((item) => ({
56
+ '@type': 'Question',
57
+ name: item.question,
58
+ acceptedAnswer: { '@type': 'Answer', text: item.answer },
59
+ })),
60
+ };
61
+
62
+ const howToSchema: WithContext<HowToThing> = {
63
+ '@context': 'https://schema.org',
64
+ '@type': 'HowTo',
65
+ name: title,
66
+ description,
67
+ step: howToData.map((step, i) => ({
68
+ '@type': 'HowToStep',
69
+ position: i + 1,
70
+ name: step.name,
71
+ text: step.text,
72
+ })),
73
+ };
74
+
75
+ const appSchema: WithContext<SoftwareApplication> = {
76
+ '@context': 'https://schema.org',
77
+ '@type': 'SoftwareApplication',
78
+ name: title,
79
+ description,
80
+ applicationCategory: 'UtilityApplication',
81
+ operatingSystem: 'All',
82
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
83
+ inLanguage: 'fr',
84
+ };
85
+
86
+ const ui: JsonFormatterUI = {
87
+ labelInput: 'Entrée (JSON)',
88
+ labelOutput: 'Résultat',
89
+ btnMinify: 'Minifier',
90
+ btnBeautify: 'Embellir',
91
+ btnFix: 'Essayer de Réparer',
92
+ btnCopy: 'Copier',
93
+ statusWaiting: "En attente d'entrée...",
94
+ statusValid: 'JSON Valide',
95
+ statusInvalid: 'JSON Invalide',
96
+ toastCopied: 'Copié !',
97
+ toastFixed: 'JSON réparé (Aperçu)',
98
+ toastFixFailed: 'Impossible de réparer automatiquement',
99
+ placeholder: 'Collez votre JSON ici...',
100
+ };
101
+
102
+ export const content: ToolLocaleContent<JsonFormatterUI> = {
103
+ slug,
104
+ title,
105
+ description,
106
+ ui,
107
+ faqTitle: 'Questions Fréquentes',
108
+ faq: faqData,
109
+ bibliographyTitle: 'Références et Normes',
110
+ bibliography: [
111
+ {
112
+ name: 'RFC 8259 – The JavaScript Object Notation (JSON) Data Interchange Format (IETF)',
113
+ url: 'https://datatracker.ietf.org/doc/html/rfc8259',
114
+ },
115
+ {
116
+ name: 'ECMA-404 – The JSON Data Interchange Syntax (Ecma International)',
117
+ url: 'https://www.ecma-international.org/publications-and-standards/standards/ecma-404/',
118
+ },
119
+ {
120
+ name: 'JSON.org – Introducing JSON',
121
+ url: 'https://www.json.org/json-en.html',
122
+ },
123
+ {
124
+ name: 'MDN Web Docs – JSON',
125
+ url: 'https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/JSON',
126
+ },
127
+ ],
128
+ howTo: howToData,
129
+ schemas: [faqSchema, howToSchema, appSchema],
130
+ seo: [
131
+ {
132
+ type: 'title',
133
+ text: 'Validation et Formatage de JSON',
134
+ level: 2,
135
+ },
136
+ {
137
+ type: 'paragraph',
138
+ html: "JSON (JavaScript Object Notation) est le standard de facto pour l'échange de données sur le web. Cependant, sa syntaxe stricte le rend sujet aux erreurs humaines lors d'une édition manuelle.",
139
+ },
140
+ {
141
+ type: 'paragraph',
142
+ html: "Cet outil vous permet de valider la structure, de formater le code pour améliorer sa lisibilité et de réparer automatiquement les erreurs de syntaxe courantes.",
143
+ },
144
+ { type: 'grid', columns: 2 },
145
+ {
146
+ type: 'card',
147
+ title: 'Erreurs Courantes Réparées',
148
+ html: "<ul><li><strong>Guillemets simples :</strong> La norme JSON exige des guillemets doubles. L'outil convertit <code>'clé': 'valeur'</code> en <code>\"clé\": \"valeur\"</code>.</li><li><strong>Clés sans guillemets :</strong> Détecte les clés d'objets de style JavaScript et ajoute les guillemets nécessaires.</li><li><strong>Virgules en trop :</strong> Supprime les virgules en fin d'objets ou de tableaux (trailing commas) qui cassent le parseur strict.</li></ul>",
149
+ },
150
+ {
151
+ type: 'card',
152
+ title: 'Fonctionnalités',
153
+ html: '<ul><li><strong>Coloration Syntaxique :</strong> Colorise les clés, chaînes, nombres et booléens pour faciliter la lecture rapide.</li><li><strong>Validation en Temps Réel :</strong> Indique instantanément si le JSON est valide ou affiche l\'erreur d\'analyse spécifique.</li><li><strong>Confidentialité Totale :</strong> Le traitement s\'effectue à 100% dans votre navigateur. Aucune donnée n\'est envoyée à des serveurs externes.</li></ul>',
154
+ },
155
+ ],
156
+ };
@@ -0,0 +1,34 @@
1
+ import type { DeveloperToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
+ import JsonFormatterComponent from './component.astro';
3
+ import JsonFormatterSEO from './seo.astro';
4
+ import JsonFormatterBibliography from './bibliography.astro';
5
+
6
+ import type { JsonFormatterUI } from './ui';
7
+
8
+ export type JsonFormatterLocaleContent = ToolLocaleContent<JsonFormatterUI>;
9
+
10
+ import { content as es } from './i18n/es';
11
+ import { content as en } from './i18n/en';
12
+ import { content as fr } from './i18n/fr';
13
+
14
+ export const jsonFormatter: DeveloperToolEntry<JsonFormatterUI> = {
15
+ id: 'json-formatter',
16
+ icons: {
17
+ bg: 'mdi:code-json',
18
+ fg: 'mdi:code-braces',
19
+ },
20
+ i18n: {
21
+ es: async () => es,
22
+ en: async () => en,
23
+ fr: async () => fr,
24
+ },
25
+ };
26
+
27
+ export { JsonFormatterComponent, JsonFormatterSEO, JsonFormatterBibliography };
28
+
29
+ export const JSON_FORMATTER_TOOL: ToolDefinition = {
30
+ entry: jsonFormatter,
31
+ Component: JsonFormatterComponent,
32
+ SEOComponent: JsonFormatterSEO,
33
+ BibliographyComponent: JsonFormatterBibliography,
34
+ };
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { SEORenderer } from '@jjlmoya/utils-shared';
3
+ import { jsonFormatter } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await jsonFormatter.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SEORenderer content={{ locale, sections: content.seo }} />}
@@ -0,0 +1,15 @@
1
+ export interface JsonFormatterUI extends Record<string, string> {
2
+ labelInput: string;
3
+ labelOutput: string;
4
+ btnMinify: string;
5
+ btnBeautify: string;
6
+ btnFix: string;
7
+ btnCopy: string;
8
+ statusWaiting: string;
9
+ statusValid: string;
10
+ statusInvalid: string;
11
+ toastCopied: string;
12
+ toastFixed: string;
13
+ toastFixFailed: string;
14
+ placeholder: string;
15
+ }
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
3
+ import { keycode } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await keycode.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SharedBibliography links={content.bibliography} />}