@intlayer/docs 8.1.1 → 8.1.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 (251) hide show
  1. package/blog/ar/vue-i18n_vs_intlayer.md +1 -1
  2. package/blog/de/per-component_vs_centralized_i18n.md +1 -1
  3. package/blog/de/vue-i18n_vs_intlayer.md +1 -1
  4. package/blog/en/__per-component_vs_centralized_i18n.md +1 -1
  5. package/blog/en/per-component_vs_centralized_i18n.md +1 -1
  6. package/blog/en/vue-i18n_vs_intlayer.md +1 -1
  7. package/blog/en-GB/per-component_vs_centralized_i18n.md +1 -1
  8. package/blog/en-GB/vue-i18n_vs_intlayer.md +1 -1
  9. package/blog/es/per-component_vs_centralized_i18n.md +1 -1
  10. package/blog/es/vue-i18n_vs_intlayer.md +1 -1
  11. package/blog/fr/per-component_vs_centralized_i18n.md +1 -1
  12. package/blog/fr/vue-i18n_vs_intlayer.md +1 -1
  13. package/blog/hi/vue-i18n_vs_intlayer.md +1 -1
  14. package/blog/id/vue-i18n_vs_intlayer.md +1 -1
  15. package/blog/it/vue-i18n_vs_intlayer.md +1 -1
  16. package/blog/ja/vue-i18n_vs_intlayer.md +1 -1
  17. package/blog/ko/vue-i18n_vs_intlayer.md +1 -1
  18. package/blog/pl/vue-i18n_vs_intlayer.md +1 -1
  19. package/blog/pt/per-component_vs_centralized_i18n.md +1 -1
  20. package/blog/pt/vue-i18n_vs_intlayer.md +1 -1
  21. package/blog/ru/vue-i18n_vs_intlayer.md +1 -1
  22. package/blog/tr/vue-i18n_vs_intlayer.md +1 -1
  23. package/blog/uk/vue-i18n_vs_intlayer.md +1 -1
  24. package/blog/vi/vue-i18n_vs_intlayer.md +1 -1
  25. package/blog/zh/vue-i18n_vs_intlayer.md +1 -1
  26. package/dist/cjs/blog.cjs +1 -21
  27. package/dist/cjs/blog.cjs.map +1 -1
  28. package/dist/cjs/common.cjs +1 -77
  29. package/dist/cjs/common.cjs.map +1 -1
  30. package/dist/cjs/doc.cjs +1 -21
  31. package/dist/cjs/doc.cjs.map +1 -1
  32. package/dist/cjs/frequentQuestions.cjs +1 -21
  33. package/dist/cjs/frequentQuestions.cjs.map +1 -1
  34. package/dist/cjs/generated/blog.entry.cjs +1 -551
  35. package/dist/cjs/generated/blog.entry.cjs.map +1 -1
  36. package/dist/cjs/generated/docs.entry.cjs +1 -3071
  37. package/dist/cjs/generated/docs.entry.cjs.map +1 -1
  38. package/dist/cjs/generated/frequentQuestions.entry.cjs +1 -351
  39. package/dist/cjs/generated/frequentQuestions.entry.cjs.map +1 -1
  40. package/dist/cjs/generated/legal.entry.cjs +1 -71
  41. package/dist/cjs/generated/legal.entry.cjs.map +1 -1
  42. package/dist/cjs/index.cjs +1 -34
  43. package/dist/cjs/legal.cjs +1 -21
  44. package/dist/cjs/legal.cjs.map +1 -1
  45. package/dist/esm/blog.mjs +1 -14
  46. package/dist/esm/blog.mjs.map +1 -1
  47. package/dist/esm/common.mjs +1 -66
  48. package/dist/esm/common.mjs.map +1 -1
  49. package/dist/esm/doc.mjs +1 -14
  50. package/dist/esm/doc.mjs.map +1 -1
  51. package/dist/esm/frequentQuestions.mjs +1 -14
  52. package/dist/esm/frequentQuestions.mjs.map +1 -1
  53. package/dist/esm/generated/blog.entry.mjs +1 -550
  54. package/dist/esm/generated/blog.entry.mjs.map +1 -1
  55. package/dist/esm/generated/docs.entry.mjs +1 -3070
  56. package/dist/esm/generated/docs.entry.mjs.map +1 -1
  57. package/dist/esm/generated/frequentQuestions.entry.mjs +1 -350
  58. package/dist/esm/generated/frequentQuestions.entry.mjs.map +1 -1
  59. package/dist/esm/generated/legal.entry.mjs +1 -70
  60. package/dist/esm/generated/legal.entry.mjs.map +1 -1
  61. package/dist/esm/index.mjs +1 -6
  62. package/dist/esm/legal.mjs +1 -14
  63. package/dist/esm/legal.mjs.map +1 -1
  64. package/dist/types/common.d.ts.map +1 -1
  65. package/dist/types/generated/docs.entry.d.ts +0 -5
  66. package/dist/types/generated/docs.entry.d.ts.map +1 -1
  67. package/docs/ar/agent_skills.md +7 -1
  68. package/docs/ar/cli/build.md +8 -0
  69. package/docs/ar/cli/index.md +1 -1
  70. package/docs/ar/compiler.md +1 -1
  71. package/docs/ar/configuration.md +34 -17
  72. package/docs/de/agent_skills.md +7 -1
  73. package/docs/de/cli/build.md +8 -0
  74. package/docs/de/cli/index.md +1 -1
  75. package/docs/de/compiler.md +1 -1
  76. package/docs/de/configuration.md +34 -17
  77. package/docs/en/agent_skills.md +7 -1
  78. package/docs/en/cli/build.md +8 -0
  79. package/docs/en/compiler.md +1 -1
  80. package/docs/en/configuration.md +79 -11
  81. package/docs/en-GB/agent_skills.md +7 -1
  82. package/docs/en-GB/cli/build.md +8 -0
  83. package/docs/en-GB/cli/index.md +1 -1
  84. package/docs/en-GB/compiler.md +1 -1
  85. package/docs/en-GB/configuration.md +34 -17
  86. package/docs/es/agent_skills.md +7 -1
  87. package/docs/es/cli/build.md +8 -0
  88. package/docs/es/cli/index.md +1 -1
  89. package/docs/es/compiler.md +1 -1
  90. package/docs/es/configuration.md +34 -17
  91. package/docs/fr/agent_skills.md +7 -1
  92. package/docs/fr/cli/build.md +8 -0
  93. package/docs/fr/cli/index.md +1 -1
  94. package/docs/fr/compiler.md +1 -1
  95. package/docs/fr/configuration.md +34 -17
  96. package/docs/hi/agent_skills.md +7 -1
  97. package/docs/hi/cli/build.md +8 -0
  98. package/docs/hi/cli/index.md +1 -1
  99. package/docs/hi/compiler.md +1 -1
  100. package/docs/hi/configuration.md +34 -17
  101. package/docs/id/agent_skills.md +7 -1
  102. package/docs/id/cli/build.md +8 -0
  103. package/docs/id/cli/index.md +1 -1
  104. package/docs/id/compiler.md +1 -1
  105. package/docs/id/configuration.md +34 -17
  106. package/docs/it/agent_skills.md +7 -1
  107. package/docs/it/cli/build.md +8 -0
  108. package/docs/it/cli/index.md +1 -1
  109. package/docs/it/compiler.md +1 -1
  110. package/docs/it/configuration.md +34 -17
  111. package/docs/ja/agent_skills.md +7 -1
  112. package/docs/ja/cli/build.md +8 -0
  113. package/docs/ja/cli/index.md +1 -1
  114. package/docs/ja/compiler.md +1 -1
  115. package/docs/ja/configuration.md +34 -17
  116. package/docs/ko/agent_skills.md +7 -1
  117. package/docs/ko/cli/build.md +8 -0
  118. package/docs/ko/cli/index.md +1 -1
  119. package/docs/ko/compiler.md +1 -1
  120. package/docs/ko/configuration.md +34 -17
  121. package/docs/pl/agent_skills.md +7 -1
  122. package/docs/pl/cli/build.md +8 -0
  123. package/docs/pl/cli/index.md +1 -1
  124. package/docs/pl/compiler.md +1 -1
  125. package/docs/pl/configuration.md +34 -17
  126. package/docs/pt/agent_skills.md +7 -1
  127. package/docs/pt/cli/build.md +8 -0
  128. package/docs/pt/cli/index.md +1 -1
  129. package/docs/pt/compiler.md +1 -1
  130. package/docs/pt/configuration.md +34 -17
  131. package/docs/ru/agent_skills.md +7 -1
  132. package/docs/ru/cli/build.md +8 -0
  133. package/docs/ru/cli/index.md +1 -1
  134. package/docs/ru/compiler.md +1 -1
  135. package/docs/ru/configuration.md +34 -17
  136. package/docs/tr/agent_skills.md +7 -1
  137. package/docs/tr/cli/build.md +8 -0
  138. package/docs/tr/cli/index.md +1 -1
  139. package/docs/tr/compiler.md +1 -1
  140. package/docs/tr/configuration.md +34 -17
  141. package/docs/uk/agent_skills.md +7 -1
  142. package/docs/uk/cli/build.md +8 -0
  143. package/docs/uk/cli/index.md +1 -1
  144. package/docs/uk/compiler.md +1 -1
  145. package/docs/uk/configuration.md +52 -6
  146. package/docs/vi/agent_skills.md +7 -1
  147. package/docs/vi/cli/build.md +8 -0
  148. package/docs/vi/cli/index.md +1 -1
  149. package/docs/vi/compiler.md +1 -1
  150. package/docs/vi/configuration.md +34 -17
  151. package/docs/zh/agent_skills.md +7 -1
  152. package/docs/zh/cli/build.md +8 -0
  153. package/docs/zh/cli/index.md +1 -1
  154. package/docs/zh/compiler.md +1 -1
  155. package/docs/zh/configuration.md +34 -17
  156. package/package.json +11 -12
  157. package/src/common.ts +2 -1
  158. package/src/generated/blog.entry.ts +1 -1
  159. package/src/generated/docs.entry.ts +1 -101
  160. package/src/generated/frequentQuestions.entry.ts +1 -1
  161. package/src/generated/legal.entry.ts +1 -1
  162. package/docs/ar/packages/angular-intlayer.md +0 -50
  163. package/docs/ar/packages/astro-intlayer.md +0 -40
  164. package/docs/ar/packages/intlayer-cli.md +0 -46
  165. package/docs/ar/packages/next-intlayer.md +0 -70
  166. package/docs/ar/packages/vue-intlayer.md +0 -59
  167. package/docs/de/packages/angular-intlayer.md +0 -50
  168. package/docs/de/packages/astro-intlayer.md +0 -37
  169. package/docs/de/packages/intlayer-cli.md +0 -46
  170. package/docs/de/packages/next-intlayer.md +0 -70
  171. package/docs/de/packages/vue-intlayer.md +0 -59
  172. package/docs/en/packages/angular-intlayer.md +0 -50
  173. package/docs/en/packages/astro-intlayer.md +0 -37
  174. package/docs/en/packages/intlayer-cli.md +0 -46
  175. package/docs/en/packages/next-intlayer.md +0 -70
  176. package/docs/en/packages/vue-intlayer.md +0 -59
  177. package/docs/en-GB/packages/angular-intlayer.md +0 -50
  178. package/docs/en-GB/packages/astro-intlayer.md +0 -37
  179. package/docs/en-GB/packages/intlayer-cli.md +0 -46
  180. package/docs/en-GB/packages/next-intlayer.md +0 -70
  181. package/docs/en-GB/packages/vue-intlayer.md +0 -59
  182. package/docs/es/packages/angular-intlayer.md +0 -50
  183. package/docs/es/packages/astro-intlayer.md +0 -37
  184. package/docs/es/packages/intlayer-cli.md +0 -46
  185. package/docs/es/packages/next-intlayer.md +0 -70
  186. package/docs/es/packages/vue-intlayer.md +0 -59
  187. package/docs/fr/packages/angular-intlayer.md +0 -50
  188. package/docs/fr/packages/astro-intlayer.md +0 -37
  189. package/docs/fr/packages/intlayer-cli.md +0 -46
  190. package/docs/fr/packages/next-intlayer.md +0 -70
  191. package/docs/fr/packages/vue-intlayer.md +0 -59
  192. package/docs/hi/packages/angular-intlayer.md +0 -50
  193. package/docs/hi/packages/astro-intlayer.md +0 -37
  194. package/docs/hi/packages/intlayer-cli.md +0 -46
  195. package/docs/hi/packages/next-intlayer.md +0 -70
  196. package/docs/hi/packages/vue-intlayer.md +0 -60
  197. package/docs/id/packages/angular-intlayer.md +0 -50
  198. package/docs/id/packages/astro-intlayer.md +0 -37
  199. package/docs/id/packages/intlayer-cli.md +0 -46
  200. package/docs/id/packages/next-intlayer.md +0 -70
  201. package/docs/id/packages/vue-intlayer.md +0 -59
  202. package/docs/it/packages/angular-intlayer.md +0 -50
  203. package/docs/it/packages/astro-intlayer.md +0 -37
  204. package/docs/it/packages/intlayer-cli.md +0 -46
  205. package/docs/it/packages/next-intlayer.md +0 -70
  206. package/docs/it/packages/vue-intlayer.md +0 -59
  207. package/docs/ja/packages/angular-intlayer.md +0 -50
  208. package/docs/ja/packages/astro-intlayer.md +0 -37
  209. package/docs/ja/packages/intlayer-cli.md +0 -46
  210. package/docs/ja/packages/next-intlayer.md +0 -70
  211. package/docs/ja/packages/vue-intlayer.md +0 -59
  212. package/docs/ko/packages/angular-intlayer.md +0 -50
  213. package/docs/ko/packages/astro-intlayer.md +0 -37
  214. package/docs/ko/packages/intlayer-cli.md +0 -46
  215. package/docs/ko/packages/next-intlayer.md +0 -70
  216. package/docs/ko/packages/vue-intlayer.md +0 -59
  217. package/docs/pl/packages/angular-intlayer.md +0 -50
  218. package/docs/pl/packages/astro-intlayer.md +0 -37
  219. package/docs/pl/packages/intlayer-cli.md +0 -46
  220. package/docs/pl/packages/next-intlayer.md +0 -70
  221. package/docs/pl/packages/vue-intlayer.md +0 -59
  222. package/docs/pt/packages/angular-intlayer.md +0 -50
  223. package/docs/pt/packages/astro-intlayer.md +0 -37
  224. package/docs/pt/packages/intlayer-cli.md +0 -46
  225. package/docs/pt/packages/next-intlayer.md +0 -70
  226. package/docs/pt/packages/vue-intlayer.md +0 -59
  227. package/docs/ru/packages/angular-intlayer.md +0 -50
  228. package/docs/ru/packages/astro-intlayer.md +0 -37
  229. package/docs/ru/packages/intlayer-cli.md +0 -46
  230. package/docs/ru/packages/next-intlayer.md +0 -70
  231. package/docs/ru/packages/vue-intlayer.md +0 -59
  232. package/docs/tr/packages/angular-intlayer.md +0 -50
  233. package/docs/tr/packages/astro-intlayer.md +0 -37
  234. package/docs/tr/packages/intlayer-cli.md +0 -46
  235. package/docs/tr/packages/next-intlayer.md +0 -70
  236. package/docs/tr/packages/vue-intlayer.md +0 -59
  237. package/docs/uk/packages/angular-intlayer.md +0 -50
  238. package/docs/uk/packages/astro-intlayer.md +0 -37
  239. package/docs/uk/packages/intlayer-cli.md +0 -46
  240. package/docs/uk/packages/next-intlayer.md +0 -70
  241. package/docs/uk/packages/vue-intlayer.md +0 -59
  242. package/docs/vi/packages/angular-intlayer.md +0 -50
  243. package/docs/vi/packages/astro-intlayer.md +0 -37
  244. package/docs/vi/packages/intlayer-cli.md +0 -46
  245. package/docs/vi/packages/next-intlayer.md +0 -70
  246. package/docs/vi/packages/vue-intlayer.md +0 -59
  247. package/docs/zh/packages/angular-intlayer.md +0 -50
  248. package/docs/zh/packages/astro-intlayer.md +0 -37
  249. package/docs/zh/packages/intlayer-cli.md +0 -46
  250. package/docs/zh/packages/next-intlayer.md +0 -70
  251. package/docs/zh/packages/vue-intlayer.md +0 -59
@@ -182,7 +182,7 @@ slugs:
182
182
 
183
183
  **إعلان المحتوى** (لكل مكون):
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  const componentExampleContent = {
@@ -191,7 +191,7 @@ export const {
191
191
  }
192
192
  ```
193
193
 
194
- **Ersetzung:** Intlayer transformiert Ihre Komponente während des Build-Prozesses der Anwendung.
194
+ **Ersetzung:** intlayer extractiert Ihre Komponente während des Build-Prozesses der Anwendung.
195
195
 
196
196
  **- Statischer Import-Modus:**
197
197
 
@@ -182,7 +182,7 @@ Dies verlangsamt die Entwicklung oft, wenn Anwendungen wachsen:
182
182
 
183
183
  **Inhaltsdeklaration** (pro Komponente):
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  const componentExampleContent = {
@@ -190,7 +190,7 @@ export const {
190
190
  }
191
191
  ```
192
192
 
193
- **Replacement:** Intlayer transforms your component during the application build.
193
+ **Replacement:** intlayer extracts your component during the application build.
194
194
 
195
195
  **- Static Import Mode:**
196
196
 
@@ -191,7 +191,7 @@ export const {
191
191
  }
192
192
  ```
193
193
 
194
- **Replacement:** Intlayer transforms your component during the application build.
194
+ **Replacement:** intlayer extracts your component during the application build.
195
195
 
196
196
  **- Static Import Mode:**
197
197
 
@@ -184,7 +184,7 @@ This often slows development as apps grow:
184
184
 
185
185
  **Content declaration** (per component):
186
186
 
187
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
187
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
188
188
  import { t, type Dictionary } from "intlayer";
189
189
 
190
190
  const componentExampleContent = {
@@ -190,7 +190,7 @@ export const {
190
190
  }
191
191
  ```
192
192
 
193
- **Replacement:** Intlayer transforms your component during the application build.
193
+ **Replacement:** intlayer extracts your component during the application build.
194
194
 
195
195
  **- Static Import Mode:**
196
196
 
@@ -184,7 +184,7 @@ This often slows development as apps grow:
184
184
 
185
185
  **Content declaration** (per component):
186
186
 
187
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
187
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
188
188
  import { t, type Dictionary } from "intlayer";
189
189
 
190
190
  const componentExampleContent = {
@@ -188,7 +188,7 @@ export const {
188
188
  }
189
189
  ```
190
190
 
191
- **Reemplazo:** Intlayer transforma tu componente durante la compilación de la aplicación.
191
+ **Reemplazo:** intlayer extracta tu componente durante la compilación de la aplicación.
192
192
 
193
193
  **- Modo de importación estática:**
194
194
 
@@ -182,7 +182,7 @@ Esto a menudo ralentiza el desarrollo a medida que las aplicaciones crecen:
182
182
 
183
183
  **Declaración de contenido** (por componente):
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  const componentExampleContent = {
@@ -188,7 +188,7 @@ export const {
188
188
  }
189
189
  ```
190
190
 
191
- **Remplacement :** Intlayer transforme votre composant lors du build de l'application.
191
+ **Remplacement :** intlayer extracte votre composant lors du build de l'application.
192
192
 
193
193
  **- Mode d'import statique :**
194
194
 
@@ -182,7 +182,7 @@ Cela ralentit souvent le développement à mesure que les applications grandisse
182
182
 
183
183
  **Déclaration du contenu** (par composant) :
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  // Contenu d'exemple pour le composant
@@ -182,7 +182,7 @@ slugs:
182
182
 
183
183
  **सामग्री घोषणा** (प्रति कॉम्पोनेंट):
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  const componentExampleContent = {
@@ -184,7 +184,7 @@ Ini sering memperlambat pengembangan seiring pertumbuhan aplikasi:
184
184
 
185
185
  **Deklarasi konten** (per komponen):
186
186
 
187
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
187
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
188
188
  import { t, type Dictionary } from "intlayer";
189
189
 
190
190
  const componentExampleContent = {
@@ -184,7 +184,7 @@ Questo spesso rallenta lo sviluppo man mano che le app crescono:
184
184
 
185
185
  **Dichiarazione del contenuto** (per componente):
186
186
 
187
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
187
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
188
188
  import { t, type Dictionary } from "intlayer";
189
189
 
190
190
  const componentExampleContent = {
@@ -182,7 +182,7 @@ slugs:
182
182
 
183
183
  **コンテンツ宣言**(コンポーネント単位):
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  const componentExampleContent = {
@@ -182,7 +182,7 @@ slugs:
182
182
 
183
183
  **콘텐츠 선언** (컴포넌트별):
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  const componentExampleContent = {
@@ -184,7 +184,7 @@ To często spowalnia rozwój w miarę rozrastania się aplikacji:
184
184
 
185
185
  **Deklaracja zawartości** (per komponent):
186
186
 
187
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
187
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
188
188
  import { t, type Dictionary } from "intlayer";
189
189
 
190
190
  const componentExampleContent = {
@@ -188,7 +188,7 @@ export const {
188
188
  }
189
189
  ```
190
190
 
191
- **Substituição:** Intlayer transforma seu componente durante o build da aplicação.
191
+ **Substituição:** intlayer extracta seu componente durante o build da aplicação.
192
192
 
193
193
  **- Modo de Importação Estática:**
194
194
 
@@ -182,7 +182,7 @@ Isso frequentemente desacelera o desenvolvimento conforme os apps crescem:
182
182
 
183
183
  **Declaração de conteúdo** (por componente):
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  const componentExampleContent = {
@@ -182,7 +182,7 @@ slugs:
182
182
 
183
183
  **Объявление контента** (на компонент):
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  const componentExampleContent = {
@@ -184,7 +184,7 @@ Bu, uygulamalar büyüdükçe geliştirmeyi yavaşlatır:
184
184
 
185
185
  **İçerik beyanı** (bileşen başına):
186
186
 
187
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
187
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
188
188
  import { t, type Dictionary } from "intlayer";
189
189
 
190
190
  const componentExampleContent = {
@@ -184,7 +184,7 @@ slugs:
184
184
 
185
185
  **Оголошення контенту** (для кожного компонента):
186
186
 
187
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
187
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
188
188
  import { t, type Dictionary } from "intlayer";
189
189
 
190
190
  const componentExampleContent = {
@@ -184,7 +184,7 @@ Hoặc với các thư mục theo từng locale:
184
184
 
185
185
  **Khai báo nội dung** (theo từng component):
186
186
 
187
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
187
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
188
188
  import { t, type Dictionary } from "intlayer";
189
189
 
190
190
  const componentExampleContent = {
@@ -182,7 +182,7 @@ slugs:
182
182
 
183
183
  **内容声明**(每个组件):
184
184
 
185
- ```ts fileName="./components/MyComponent/MyComponent.content.ts"
185
+ ```ts fileName="./components/MyComponent/myComponent.content.ts"
186
186
  import { t, type Dictionary } from "intlayer";
187
187
 
188
188
  // 组件示例内容声明
package/dist/cjs/blog.cjs CHANGED
@@ -1,22 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_common = require('./common.cjs');
3
- const require_generated_blog_entry = require('./generated/blog.entry.cjs');
4
-
5
- //#region src/blog.ts
6
- const getBlogsKeys = () => require_common.getKeys(require_generated_blog_entry.blogEntry);
7
- const getBlogs = async (locale = require_common.defaultLocale) => await require_common.getFiles(require_generated_blog_entry.blogEntry, locale);
8
- const getBlog = async (docName, locale = require_common.defaultLocale) => await require_common.getFile(require_generated_blog_entry.blogEntry, docName, locale);
9
- const getBlogMetadataRecord = async (locale = require_common.defaultLocale) => await require_common.getFileMetadataRecord(require_generated_blog_entry.blogEntry, locale);
10
- const getBlogMetadata = async (docName, locale = require_common.defaultLocale) => await require_common.getFileMetadata(require_generated_blog_entry.blogEntry, docName, locale);
11
- const getBlogMetadataBySlug = async (slugs, locale = require_common.defaultLocale, strict = false) => await require_common.getFileMetadataBySlug(require_generated_blog_entry.blogEntry, slugs, locale, strict);
12
- const getBlogBySlug = async (slugs, locale = require_common.defaultLocale, strict = false) => await require_common.getFileBySlug(require_generated_blog_entry.blogEntry, slugs, locale, strict);
13
-
14
- //#endregion
15
- exports.getBlog = getBlog;
16
- exports.getBlogBySlug = getBlogBySlug;
17
- exports.getBlogMetadata = getBlogMetadata;
18
- exports.getBlogMetadataBySlug = getBlogMetadataBySlug;
19
- exports.getBlogMetadataRecord = getBlogMetadataRecord;
20
- exports.getBlogs = getBlogs;
21
- exports.getBlogsKeys = getBlogsKeys;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./common.cjs`),t=require(`./generated/blog.entry.cjs`),n=()=>e.getKeys(t.blogEntry),r=async(n=e.defaultLocale)=>await e.getFiles(t.blogEntry,n),i=async(n,r=e.defaultLocale)=>await e.getFile(t.blogEntry,n,r),a=async(n=e.defaultLocale)=>await e.getFileMetadataRecord(t.blogEntry,n),o=async(n,r=e.defaultLocale)=>await e.getFileMetadata(t.blogEntry,n,r),s=async(n,r=e.defaultLocale,i=!1)=>await e.getFileMetadataBySlug(t.blogEntry,n,r,i),c=async(n,r=e.defaultLocale,i=!1)=>await e.getFileBySlug(t.blogEntry,n,r,i);exports.getBlog=i,exports.getBlogBySlug=c,exports.getBlogMetadata=o,exports.getBlogMetadataBySlug=s,exports.getBlogMetadataRecord=a,exports.getBlogs=r,exports.getBlogsKeys=n;
22
2
  //# sourceMappingURL=blog.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"blog.cjs","names":["getKeys","blogEntry","defaultLocale","getFiles","getFile","getFileMetadataRecord","getFileMetadata","getFileMetadataBySlug","getFileBySlug"],"sources":["../../src/blog.ts"],"sourcesContent":["import type { DeclaredLocales, LocalesValues } from '@intlayer/types';\nimport {\n defaultLocale,\n type FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n getKeys,\n} from './common';\nimport { blogEntry } from './generated/blog.entry';\n\nexport type BlogKey = keyof typeof blogEntry;\nexport type Blogs = Record<BlogKey, Record<LocalesValues, Promise<string>>>;\nexport type BlogMetadata = FileMetadata;\n\nexport const getBlogsKeys = (): (keyof typeof blogEntry)[] =>\n getKeys(blogEntry);\n\nexport const getBlogs = async <L extends LocalesValues = DeclaredLocales>(\n locale: L = defaultLocale as L\n): Promise<Record<BlogKey, string>> => await getFiles(blogEntry, locale);\n\nexport const getBlog = async <L extends LocalesValues = DeclaredLocales>(\n docName: BlogKey,\n locale: L = defaultLocale as L\n): Promise<string> => await getFile(blogEntry, docName, locale);\n\nexport const getBlogMetadataRecord = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n locale: L = defaultLocale as L\n): Promise<Record<BlogKey, FileMetadata>> =>\n await getFileMetadataRecord(blogEntry, locale);\n\nexport const getBlogMetadata = async <\n D extends BlogKey,\n L extends LocalesValues = DeclaredLocales,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> => await getFileMetadata(blogEntry, docName, locale);\n\nexport const getBlogMetadataBySlug = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(blogEntry, slugs, locale, strict);\n\nexport const getBlogBySlug = async <L extends LocalesValues = DeclaredLocales>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<string[]> => await getFileBySlug(blogEntry, slugs, locale, strict);\n"],"mappings":";;;;;AAkBA,MAAa,qBACXA,uBAAQC,uCAAU;AAEpB,MAAa,WAAW,OACtB,SAAYC,iCACyB,MAAMC,wBAASF,wCAAW,OAAO;AAExE,MAAa,UAAU,OACrB,SACA,SAAYC,iCACQ,MAAME,uBAAQH,wCAAW,SAAS,OAAO;AAE/D,MAAa,wBAAwB,OAGnC,SAAYC,iCAEZ,MAAMG,qCAAsBJ,wCAAW,OAAO;AAEhD,MAAa,kBAAkB,OAI7B,SACA,SAAYC,iCACc,MAAMI,+BAAgBL,wCAAW,SAAS,OAAO;AAE7E,MAAa,wBAAwB,OAGnC,OACA,SAAYC,8BACZ,SAAS,UAET,MAAMK,qCAAsBN,wCAAW,OAAO,QAAQ,OAAO;AAE/D,MAAa,gBAAgB,OAC3B,OACA,SAAYC,8BACZ,SAAS,UACa,MAAMM,6BAAcP,wCAAW,OAAO,QAAQ,OAAO"}
1
+ {"version":3,"file":"blog.cjs","names":["getKeys","blogEntry","defaultLocale","getFiles","getFile","getFileMetadataRecord","getFileMetadata","getFileMetadataBySlug","getFileBySlug"],"sources":["../../src/blog.ts"],"sourcesContent":["import type { DeclaredLocales, LocalesValues } from '@intlayer/types';\nimport {\n defaultLocale,\n type FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n getKeys,\n} from './common';\nimport { blogEntry } from './generated/blog.entry';\n\nexport type BlogKey = keyof typeof blogEntry;\nexport type Blogs = Record<BlogKey, Record<LocalesValues, Promise<string>>>;\nexport type BlogMetadata = FileMetadata;\n\nexport const getBlogsKeys = (): (keyof typeof blogEntry)[] =>\n getKeys(blogEntry);\n\nexport const getBlogs = async <L extends LocalesValues = DeclaredLocales>(\n locale: L = defaultLocale as L\n): Promise<Record<BlogKey, string>> => await getFiles(blogEntry, locale);\n\nexport const getBlog = async <L extends LocalesValues = DeclaredLocales>(\n docName: BlogKey,\n locale: L = defaultLocale as L\n): Promise<string> => await getFile(blogEntry, docName, locale);\n\nexport const getBlogMetadataRecord = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n locale: L = defaultLocale as L\n): Promise<Record<BlogKey, FileMetadata>> =>\n await getFileMetadataRecord(blogEntry, locale);\n\nexport const getBlogMetadata = async <\n D extends BlogKey,\n L extends LocalesValues = DeclaredLocales,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> => await getFileMetadata(blogEntry, docName, locale);\n\nexport const getBlogMetadataBySlug = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(blogEntry, slugs, locale, strict);\n\nexport const getBlogBySlug = async <L extends LocalesValues = DeclaredLocales>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<string[]> => await getFileBySlug(blogEntry, slugs, locale, strict);\n"],"mappings":"2IAkBa,MACXA,EAAAA,QAAQC,EAAAA,UAAU,CAEP,EAAW,MACtB,EAAYC,EAAAA,gBACyB,MAAMC,EAAAA,SAASF,EAAAA,UAAW,EAAO,CAE3D,EAAU,MACrB,EACA,EAAYC,EAAAA,gBACQ,MAAME,EAAAA,QAAQH,EAAAA,UAAW,EAAS,EAAO,CAElD,EAAwB,MAGnC,EAAYC,EAAAA,gBAEZ,MAAMG,EAAAA,sBAAsBJ,EAAAA,UAAW,EAAO,CAEnC,EAAkB,MAI7B,EACA,EAAYC,EAAAA,gBACc,MAAMI,EAAAA,gBAAgBL,EAAAA,UAAW,EAAS,EAAO,CAEhE,EAAwB,MAGnC,EACA,EAAYC,EAAAA,cACZ,EAAS,KAET,MAAMK,EAAAA,sBAAsBN,EAAAA,UAAW,EAAO,EAAQ,EAAO,CAElD,EAAgB,MAC3B,EACA,EAAYC,EAAAA,cACZ,EAAS,KACa,MAAMM,EAAAA,cAAcP,EAAAA,UAAW,EAAO,EAAQ,EAAO"}
@@ -1,78 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- let node_path = require("node:path");
3
- let _intlayer_core = require("@intlayer/core");
4
- let _intlayer_types = require("@intlayer/types");
5
-
6
- //#region src/common.ts
7
- const defaultLocale = _intlayer_types.Locales.ENGLISH;
8
- const GITHUB_URL_PREFIX = "https://github.com/aymericzip/intlayer/blob/main/docs";
9
- const URL_PREFIX = "https://intlayer.org/";
10
- const getKeys = (obj) => Object.keys(obj);
11
- const getFiles = async (files, lang = defaultLocale) => {
12
- const filesEntries = await Promise.all(Object.entries(files).map(([key, value]) => [key, value[lang]]).map(async ([key, value]) => [key, await value]));
13
- return Object.fromEntries(filesEntries);
14
- };
15
- const getFile = async (files, docKey, locale = defaultLocale) => {
16
- if (!files[docKey]) throw new Error(`File ${docKey} not found`);
17
- const file = await files[docKey]?.[locale];
18
- if (!file) {
19
- const englishFile = await files[docKey][defaultLocale];
20
- if (!englishFile) throw new Error(`File ${docKey} not found`);
21
- return englishFile;
22
- }
23
- return file;
24
- };
25
- const formatMetadata = (docKey, file, locale = defaultLocale) => {
26
- const metadata = (0, _intlayer_core.getMarkdownMetadata)(file);
27
- const slugs = (metadata.slugs ?? []).map(String);
28
- const keywords = (metadata.keywords ?? []).map(String);
29
- const relativeUrl = (0, node_path.join)("/", ...slugs);
30
- const slicedDocKey = docKey.slice(1);
31
- return {
32
- ...metadata,
33
- docKey,
34
- slugs,
35
- keywords,
36
- githubUrl: `${GITHUB_URL_PREFIX}${slicedDocKey}`.replace("/en/", `/${locale}/`),
37
- relativeUrl: (0, _intlayer_core.getLocalizedUrl)(relativeUrl, locale),
38
- url: (0, _intlayer_core.getLocalizedUrl)((0, node_path.join)(URL_PREFIX, relativeUrl), locale)
39
- };
40
- };
41
- const getFileMetadata = async (files, docKey, locale = defaultLocale) => {
42
- return formatMetadata(docKey, await getFile(files, docKey, locale), locale);
43
- };
44
- const getFileMetadataRecord = async (files, locale = defaultLocale) => {
45
- const filesEntries = await Promise.all(Object.entries(files).map(async ([key]) => [key, await getFileMetadata(files, key, locale)]));
46
- return Object.fromEntries(filesEntries);
47
- };
48
- const getFileMetadataBySlug = async (files, slugs, locale = defaultLocale, strict = false) => {
49
- const slugsArray = Array.isArray(slugs) ? slugs : [slugs];
50
- const filesMetadata = await getFileMetadataRecord(files, defaultLocale);
51
- let fileMetadataArray = Object.values(filesMetadata).filter((fileMetadata) => slugsArray.every((slug) => fileMetadata.slugs?.includes(slug)));
52
- if (strict) fileMetadataArray = fileMetadataArray.filter((fileMetadata) => fileMetadata.slugs.length === slugsArray.length);
53
- if (locale !== defaultLocale) return await Promise.all(fileMetadataArray.map(async (fileMetadata) => await getFileMetadata(files, fileMetadata.docKey, locale)));
54
- return fileMetadataArray;
55
- };
56
- const getFileBySlug = async (files, slugs, locale = defaultLocale, strict = false) => {
57
- const slugsArray = Array.isArray(slugs) ? slugs : [slugs];
58
- const filesMetadata = await getFileMetadataRecord(files, defaultLocale);
59
- let fileMetadataArray = Object.values(filesMetadata).filter((fileMetadata) => slugsArray.every((slug) => fileMetadata.slugs?.includes(slug)));
60
- if (strict) fileMetadataArray = fileMetadataArray.filter((fileMetadata) => fileMetadata.slugs.length === slugsArray.length);
61
- return await Promise.all(fileMetadataArray.map(async (fileMetadata) => {
62
- return await getFile(files, fileMetadata.docKey, locale);
63
- }));
64
- };
65
-
66
- //#endregion
67
- exports.GITHUB_URL_PREFIX = GITHUB_URL_PREFIX;
68
- exports.URL_PREFIX = URL_PREFIX;
69
- exports.defaultLocale = defaultLocale;
70
- exports.formatMetadata = formatMetadata;
71
- exports.getFile = getFile;
72
- exports.getFileBySlug = getFileBySlug;
73
- exports.getFileMetadata = getFileMetadata;
74
- exports.getFileMetadataBySlug = getFileMetadataBySlug;
75
- exports.getFileMetadataRecord = getFileMetadataRecord;
76
- exports.getFiles = getFiles;
77
- exports.getKeys = getKeys;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`node:path`),t=require(`@intlayer/core/localization`),n=require(`@intlayer/core/transpiler`);const r=require(`@intlayer/types`).Locales.ENGLISH,i=`https://github.com/aymericzip/intlayer/blob/main/docs`,a=`https://intlayer.org/`,o=e=>Object.keys(e),s=async(e,t=r)=>{let n=await Promise.all(Object.entries(e).map(([e,n])=>[e,n[t]]).map(async([e,t])=>[e,await t]));return Object.fromEntries(n)},c=async(e,t,n=r)=>{if(!e[t])throw Error(`File ${t} not found`);let i=await e[t]?.[n];if(!i){let n=await e[t][r];if(!n)throw Error(`File ${t} not found`);return n}return i},l=(o,s,c=r)=>{let l=(0,n.getMarkdownMetadata)(s),u=(l.slugs??[]).map(String),d=(l.keywords??[]).map(String),f=(0,e.join)(`/`,...u),p=o.slice(1);return{...l,docKey:o,slugs:u,keywords:d,githubUrl:`${i}${p}`.replace(`/en/`,`/${c}/`),relativeUrl:(0,t.getLocalizedUrl)(f,c),url:(0,t.getLocalizedUrl)((0,e.join)(a,f),c)}},u=async(e,t,n=r)=>l(t,await c(e,t,n),n),d=async(e,t=r)=>{let n=await Promise.all(Object.entries(e).map(async([n])=>[n,await u(e,n,t)]));return Object.fromEntries(n)},f=async(e,t,n=r,i=!1)=>{let a=Array.isArray(t)?t:[t],o=await d(e,r),s=Object.values(o).filter(e=>a.every(t=>e.slugs?.includes(t)));return i&&(s=s.filter(e=>e.slugs.length===a.length)),n===r?s:await Promise.all(s.map(async t=>await u(e,t.docKey,n)))},p=async(e,t,n=r,i=!1)=>{let a=Array.isArray(t)?t:[t],o=await d(e,r),s=Object.values(o).filter(e=>a.every(t=>e.slugs?.includes(t)));return i&&(s=s.filter(e=>e.slugs.length===a.length)),await Promise.all(s.map(async t=>await c(e,t.docKey,n)))};exports.GITHUB_URL_PREFIX=i,exports.URL_PREFIX=a,exports.defaultLocale=r,exports.formatMetadata=l,exports.getFile=c,exports.getFileBySlug=p,exports.getFileMetadata=u,exports.getFileMetadataBySlug=f,exports.getFileMetadataRecord=d,exports.getFiles=s,exports.getKeys=o;
78
2
  //# sourceMappingURL=common.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.cjs","names":["Locales"],"sources":["../../src/common.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getLocalizedUrl, getMarkdownMetadata } from '@intlayer/core';\nimport { Locales, type LocalesValues } from '@intlayer/types';\n\nexport const defaultLocale = Locales.ENGLISH;\n\nexport const GITHUB_URL_PREFIX =\n 'https://github.com/aymericzip/intlayer/blob/main/docs';\nexport const URL_PREFIX = 'https://intlayer.org/';\n\nexport const getKeys = <T extends Record<string, any>>(obj: T): (keyof T)[] =>\n Object.keys(obj) as (keyof T)[];\n\nexport const getFiles = async <\n F extends Record<`./${string}`, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n lang: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<string, string>> => {\n const filesEntries = await Promise.all(\n Object.entries(files)\n .map(([key, value]) => [key, value[lang as LocalesValues]])\n .map(async ([key, value]) => [key, await value])\n );\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult;\n};\n\nexport const getFile = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<string> => {\n const fileRecord = files[docKey];\n\n if (!fileRecord) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n const file = await files[docKey]?.[locale];\n\n if (!file) {\n const englishFile = await files[docKey][defaultLocale as LocalesValues];\n\n if (!englishFile) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n return englishFile;\n }\n\n return file;\n};\n\nexport type FileMetadata = {\n docKey: string;\n url: string;\n relativeUrl: string;\n githubUrl: string;\n title: string;\n slugs: string[];\n description: string;\n keywords: string[];\n updatedAt: string;\n createdAt: string;\n author?: string;\n youtubeVideo?: string;\n applicationTemplate?: string;\n history?: {\n version: string;\n date: string;\n changes: string;\n }[];\n};\n\nexport const formatMetadata = (\n docKey: string,\n file: string,\n locale: LocalesValues = defaultLocale as LocalesValues\n): FileMetadata => {\n const metadata = getMarkdownMetadata(file);\n\n const slugs = (metadata.slugs ?? []).map(String);\n const keywords = (metadata.keywords ?? []).map(String);\n\n const relativeUrl = join('/', ...slugs);\n\n const slicedDocKey = docKey.slice(1);\n\n return {\n ...metadata,\n docKey,\n slugs,\n keywords,\n githubUrl: `${GITHUB_URL_PREFIX}${slicedDocKey}`.replace(\n '/en/',\n `/${locale}/`\n ),\n relativeUrl: getLocalizedUrl(relativeUrl, locale),\n url: getLocalizedUrl(join(URL_PREFIX, relativeUrl), locale),\n } as FileMetadata;\n};\n\nexport const getFileMetadata = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n R extends FileMetadata,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<R> => {\n const file = await getFile(files, docKey, locale);\n\n return formatMetadata(docKey as string, file, locale) as R;\n};\n\nexport const getFileMetadataRecord = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<keyof F, FileMetadata>> => {\n const filesEntries = await Promise.all(\n Object.entries(files).map(async ([key]) => [\n key,\n await getFileMetadata(files, key as keyof F, locale),\n ])\n );\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult;\n};\n\nexport const getFileMetadataBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray: FileMetadata[] = Object.values(filesMetadata).filter(\n (fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n if (locale !== defaultLocale) {\n const localizedFileMetadata = await Promise.all(\n fileMetadataArray.map(\n async (fileMetadata) =>\n await getFileMetadata(files, fileMetadata.docKey, locale)\n )\n );\n\n return localizedFileMetadata;\n }\n\n return fileMetadataArray;\n};\n\nexport const getFileBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray = Object.values(filesMetadata).filter((fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n const fileList = await Promise.all(\n fileMetadataArray.map(async (fileMetadata) => {\n const file = await getFile(files, fileMetadata.docKey, locale);\n return file;\n })\n );\n\n return fileList;\n};\n"],"mappings":";;;;;;AAIA,MAAa,gBAAgBA,wBAAQ;AAErC,MAAa,oBACX;AACF,MAAa,aAAa;AAE1B,MAAa,WAA0C,QACrD,OAAO,KAAK,IAAI;AAElB,MAAa,WAAW,OAGtB,OACA,OAAsB,kBACc;CACpC,MAAM,eAAe,MAAM,QAAQ,IACjC,OAAO,QAAQ,MAAM,CAClB,KAAK,CAAC,KAAK,WAAW,CAAC,KAAK,MAAM,MAAuB,CAAC,CAC1D,IAAI,OAAO,CAAC,KAAK,WAAW,CAAC,KAAK,MAAM,MAAM,CAAC,CACnD;AAED,QADoB,OAAO,YAAY,aAAa;;AAItD,MAAa,UAAU,OAGrB,OACA,QACA,SAAwB,kBACJ;AAGpB,KAAI,CAFe,MAAM,QAGvB,OAAM,IAAI,MAAM,QAAQ,OAAiB,YAAY;CAGvD,MAAM,OAAO,MAAM,MAAM,UAAU;AAEnC,KAAI,CAAC,MAAM;EACT,MAAM,cAAc,MAAM,MAAM,QAAQ;AAExC,MAAI,CAAC,YACH,OAAM,IAAI,MAAM,QAAQ,OAAiB,YAAY;AAGvD,SAAO;;AAGT,QAAO;;AAwBT,MAAa,kBACX,QACA,MACA,SAAwB,kBACP;CACjB,MAAM,mDAA+B,KAAK;CAE1C,MAAM,SAAS,SAAS,SAAS,EAAE,EAAE,IAAI,OAAO;CAChD,MAAM,YAAY,SAAS,YAAY,EAAE,EAAE,IAAI,OAAO;CAEtD,MAAM,kCAAmB,KAAK,GAAG,MAAM;CAEvC,MAAM,eAAe,OAAO,MAAM,EAAE;AAEpC,QAAO;EACL,GAAG;EACH;EACA;EACA;EACA,WAAW,GAAG,oBAAoB,eAAe,QAC/C,QACA,IAAI,OAAO,GACZ;EACD,iDAA6B,aAAa,OAAO;EACjD,6DAA0B,YAAY,YAAY,EAAE,OAAO;EAC5D;;AAGH,MAAa,kBAAkB,OAI7B,OACA,QACA,SAAwB,kBACT;AAGf,QAAO,eAAe,QAFT,MAAM,QAAQ,OAAO,QAAQ,OAAO,EAEH,OAAO;;AAGvD,MAAa,wBAAwB,OAGnC,OACA,SAAwB,kBACmB;CAC3C,MAAM,eAAe,MAAM,QAAQ,IACjC,OAAO,QAAQ,MAAM,CAAC,IAAI,OAAO,CAAC,SAAS,CACzC,KACA,MAAM,gBAAgB,OAAO,KAAgB,OAAO,CACrD,CAAC,CACH;AAED,QADoB,OAAO,YAAY,aAAa;;AAItD,MAAa,wBAAwB,OAGnC,OACA,OACA,SAAwB,eACxB,SAAS,UACN;CACH,MAAM,aAAa,MAAM,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM;CACzD,MAAM,gBAAgB,MAAM,sBAC1B,OACA,cACD;CAED,IAAI,oBAAoC,OAAO,OAAO,cAAc,CAAC,QAClE,iBACC,WAAW,OAAO,SAAS,aAAa,OAAO,SAAS,KAAK,CAAC,CACjE;AAED,KAAI,OACF,qBAAoB,kBAAkB,QACnC,iBAAiB,aAAa,MAAM,WAAW,WAAW,OAC5D;AAGH,KAAI,WAAW,cAQb,QAP8B,MAAM,QAAQ,IAC1C,kBAAkB,IAChB,OAAO,iBACL,MAAM,gBAAgB,OAAO,aAAa,QAAQ,OAAO,CAC5D,CACF;AAKH,QAAO;;AAGT,MAAa,gBAAgB,OAG3B,OACA,OACA,SAAwB,eACxB,SAAS,UACN;CACH,MAAM,aAAa,MAAM,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM;CACzD,MAAM,gBAAgB,MAAM,sBAC1B,OACA,cACD;CAED,IAAI,oBAAoB,OAAO,OAAO,cAAc,CAAC,QAAQ,iBAC3D,WAAW,OAAO,SAAS,aAAa,OAAO,SAAS,KAAK,CAAC,CAC/D;AAED,KAAI,OACF,qBAAoB,kBAAkB,QACnC,iBAAiB,aAAa,MAAM,WAAW,WAAW,OAC5D;AAUH,QAPiB,MAAM,QAAQ,IAC7B,kBAAkB,IAAI,OAAO,iBAAiB;AAE5C,SADa,MAAM,QAAQ,OAAO,aAAa,QAAQ,OAAO;GAE9D,CACH"}
1
+ {"version":3,"file":"common.cjs","names":["Locales"],"sources":["../../src/common.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { getLocalizedUrl } from '@intlayer/core/localization';\nimport { getMarkdownMetadata } from '@intlayer/core/transpiler';\nimport { Locales, type LocalesValues } from '@intlayer/types';\n\nexport const defaultLocale = Locales.ENGLISH;\n\nexport const GITHUB_URL_PREFIX =\n 'https://github.com/aymericzip/intlayer/blob/main/docs';\nexport const URL_PREFIX = 'https://intlayer.org/';\n\nexport const getKeys = <T extends Record<string, any>>(obj: T): (keyof T)[] =>\n Object.keys(obj) as (keyof T)[];\n\nexport const getFiles = async <\n F extends Record<`./${string}`, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n lang: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<string, string>> => {\n const filesEntries = await Promise.all(\n Object.entries(files)\n .map(([key, value]) => [key, value[lang as LocalesValues]])\n .map(async ([key, value]) => [key, await value])\n );\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult;\n};\n\nexport const getFile = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<string> => {\n const fileRecord = files[docKey];\n\n if (!fileRecord) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n const file = await files[docKey]?.[locale];\n\n if (!file) {\n const englishFile = await files[docKey][defaultLocale as LocalesValues];\n\n if (!englishFile) {\n throw new Error(`File ${docKey as string} not found`);\n }\n\n return englishFile;\n }\n\n return file;\n};\n\nexport type FileMetadata = {\n docKey: string;\n url: string;\n relativeUrl: string;\n githubUrl: string;\n title: string;\n slugs: string[];\n description: string;\n keywords: string[];\n updatedAt: string;\n createdAt: string;\n author?: string;\n youtubeVideo?: string;\n applicationTemplate?: string;\n history?: {\n version: string;\n date: string;\n changes: string;\n }[];\n};\n\nexport const formatMetadata = (\n docKey: string,\n file: string,\n locale: LocalesValues = defaultLocale as LocalesValues\n): FileMetadata => {\n const metadata = getMarkdownMetadata(file);\n\n const slugs = (metadata.slugs ?? []).map(String);\n const keywords = (metadata.keywords ?? []).map(String);\n\n const relativeUrl = join('/', ...slugs);\n\n const slicedDocKey = docKey.slice(1);\n\n return {\n ...metadata,\n docKey,\n slugs,\n keywords,\n githubUrl: `${GITHUB_URL_PREFIX}${slicedDocKey}`.replace(\n '/en/',\n `/${locale}/`\n ),\n relativeUrl: getLocalizedUrl(relativeUrl, locale),\n url: getLocalizedUrl(join(URL_PREFIX, relativeUrl), locale),\n } as FileMetadata;\n};\n\nexport const getFileMetadata = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n R extends FileMetadata,\n>(\n files: F,\n docKey: keyof F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<R> => {\n const file = await getFile(files, docKey, locale);\n\n return formatMetadata(docKey as string, file, locale) as R;\n};\n\nexport const getFileMetadataRecord = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n locale: LocalesValues = defaultLocale as LocalesValues\n): Promise<Record<keyof F, FileMetadata>> => {\n const filesEntries = await Promise.all(\n Object.entries(files).map(async ([key]) => [\n key,\n await getFileMetadata(files, key as keyof F, locale),\n ])\n );\n const filesResult = Object.fromEntries(filesEntries);\n return filesResult;\n};\n\nexport const getFileMetadataBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray: FileMetadata[] = Object.values(filesMetadata).filter(\n (fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n if (locale !== defaultLocale) {\n const localizedFileMetadata = await Promise.all(\n fileMetadataArray.map(\n async (fileMetadata) =>\n await getFileMetadata(files, fileMetadata.docKey, locale)\n )\n );\n\n return localizedFileMetadata;\n }\n\n return fileMetadataArray;\n};\n\nexport const getFileBySlug = async <\n F extends Record<string, Record<LocalesValues, Promise<string>>>,\n>(\n files: F,\n slugs: string | string[],\n locale: LocalesValues = defaultLocale as LocalesValues,\n strict = false\n) => {\n const slugsArray = Array.isArray(slugs) ? slugs : [slugs];\n const filesMetadata = await getFileMetadataRecord(\n files,\n defaultLocale as LocalesValues\n );\n\n let fileMetadataArray = Object.values(filesMetadata).filter((fileMetadata) =>\n slugsArray.every((slug) => fileMetadata.slugs?.includes(slug))\n );\n\n if (strict) {\n fileMetadataArray = fileMetadataArray.filter(\n (fileMetadata) => fileMetadata.slugs.length === slugsArray.length\n );\n }\n\n const fileList = await Promise.all(\n fileMetadataArray.map(async (fileMetadata) => {\n const file = await getFile(files, fileMetadata.docKey, locale);\n return file;\n })\n );\n\n return fileList;\n};\n"],"mappings":"8KAKA,MAAa,6BAAgBA,QAAQ,QAExB,EACX,wDACW,EAAa,wBAEb,EAA0C,GACrD,OAAO,KAAK,EAAI,CAEL,EAAW,MAGtB,EACA,EAAsB,IACc,CACpC,IAAM,EAAe,MAAM,QAAQ,IACjC,OAAO,QAAQ,EAAM,CAClB,KAAK,CAAC,EAAK,KAAW,CAAC,EAAK,EAAM,GAAuB,CAAC,CAC1D,IAAI,MAAO,CAAC,EAAK,KAAW,CAAC,EAAK,MAAM,EAAM,CAAC,CACnD,CAED,OADoB,OAAO,YAAY,EAAa,EAIzC,EAAU,MAGrB,EACA,EACA,EAAwB,IACJ,CAGpB,GAAI,CAFe,EAAM,GAGvB,MAAU,MAAM,QAAQ,EAAiB,YAAY,CAGvD,IAAM,EAAO,MAAM,EAAM,KAAU,GAEnC,GAAI,CAAC,EAAM,CACT,IAAM,EAAc,MAAM,EAAM,GAAQ,GAExC,GAAI,CAAC,EACH,MAAU,MAAM,QAAQ,EAAiB,YAAY,CAGvD,OAAO,EAGT,OAAO,GAwBI,GACX,EACA,EACA,EAAwB,IACP,CACjB,IAAM,GAAA,EAAA,EAAA,qBAA+B,EAAK,CAEpC,GAAS,EAAS,OAAS,EAAE,EAAE,IAAI,OAAO,CAC1C,GAAY,EAAS,UAAY,EAAE,EAAE,IAAI,OAAO,CAEhD,GAAA,EAAA,EAAA,MAAmB,IAAK,GAAG,EAAM,CAEjC,EAAe,EAAO,MAAM,EAAE,CAEpC,MAAO,CACL,GAAG,EACH,SACA,QACA,WACA,UAAW,GAAG,IAAoB,IAAe,QAC/C,OACA,IAAI,EAAO,GACZ,CACD,aAAA,EAAA,EAAA,iBAA6B,EAAa,EAAO,CACjD,KAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,MAA0B,EAAY,EAAY,CAAE,EAAO,CAC5D,EAGU,EAAkB,MAI7B,EACA,EACA,EAAwB,IAIjB,EAAe,EAFT,MAAM,EAAQ,EAAO,EAAQ,EAAO,CAEH,EAAO,CAG1C,EAAwB,MAGnC,EACA,EAAwB,IACmB,CAC3C,IAAM,EAAe,MAAM,QAAQ,IACjC,OAAO,QAAQ,EAAM,CAAC,IAAI,MAAO,CAAC,KAAS,CACzC,EACA,MAAM,EAAgB,EAAO,EAAgB,EAAO,CACrD,CAAC,CACH,CAED,OADoB,OAAO,YAAY,EAAa,EAIzC,EAAwB,MAGnC,EACA,EACA,EAAwB,EACxB,EAAS,KACN,CACH,IAAM,EAAa,MAAM,QAAQ,EAAM,CAAG,EAAQ,CAAC,EAAM,CACnD,EAAgB,MAAM,EAC1B,EACA,EACD,CAEG,EAAoC,OAAO,OAAO,EAAc,CAAC,OAClE,GACC,EAAW,MAAO,GAAS,EAAa,OAAO,SAAS,EAAK,CAAC,CACjE,CAmBD,OAjBI,IACF,EAAoB,EAAkB,OACnC,GAAiB,EAAa,MAAM,SAAW,EAAW,OAC5D,EAGC,IAAW,EAWR,EAVyB,MAAM,QAAQ,IAC1C,EAAkB,IAChB,KAAO,IACL,MAAM,EAAgB,EAAO,EAAa,OAAQ,EAAO,CAC5D,CACF,EAQQ,EAAgB,MAG3B,EACA,EACA,EAAwB,EACxB,EAAS,KACN,CACH,IAAM,EAAa,MAAM,QAAQ,EAAM,CAAG,EAAQ,CAAC,EAAM,CACnD,EAAgB,MAAM,EAC1B,EACA,EACD,CAEG,EAAoB,OAAO,OAAO,EAAc,CAAC,OAAQ,GAC3D,EAAW,MAAO,GAAS,EAAa,OAAO,SAAS,EAAK,CAAC,CAC/D,CAeD,OAbI,IACF,EAAoB,EAAkB,OACnC,GAAiB,EAAa,MAAM,SAAW,EAAW,OAC5D,EAGc,MAAM,QAAQ,IAC7B,EAAkB,IAAI,KAAO,IACd,MAAM,EAAQ,EAAO,EAAa,OAAQ,EAAO,CAE9D,CACH"}
package/dist/cjs/doc.cjs CHANGED
@@ -1,22 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_common = require('./common.cjs');
3
- const require_generated_docs_entry = require('./generated/docs.entry.cjs');
4
-
5
- //#region src/doc.ts
6
- const getDocsKeys = () => require_common.getKeys(require_generated_docs_entry.docsEntry);
7
- const getDocs = async (locale = require_common.defaultLocale) => await require_common.getFiles(require_generated_docs_entry.docsEntry, locale);
8
- const getDoc = async (docName, locale = require_common.defaultLocale) => await require_common.getFile(require_generated_docs_entry.docsEntry, docName, locale);
9
- const getDocMetadataRecord = async (locale = require_common.defaultLocale) => await require_common.getFileMetadataRecord(require_generated_docs_entry.docsEntry, locale);
10
- const getDocMetadata = async (docName, locale = require_common.defaultLocale) => await require_common.getFileMetadata(require_generated_docs_entry.docsEntry, docName, locale);
11
- const getDocMetadataBySlug = async (slugs, locale = require_common.defaultLocale, strict = false) => await require_common.getFileMetadataBySlug(require_generated_docs_entry.docsEntry, slugs, locale, strict);
12
- const getDocBySlug = async (slugs, locale = require_common.defaultLocale, strict = false) => await require_common.getFileBySlug(require_generated_docs_entry.docsEntry, slugs, locale, strict);
13
-
14
- //#endregion
15
- exports.getDoc = getDoc;
16
- exports.getDocBySlug = getDocBySlug;
17
- exports.getDocMetadata = getDocMetadata;
18
- exports.getDocMetadataBySlug = getDocMetadataBySlug;
19
- exports.getDocMetadataRecord = getDocMetadataRecord;
20
- exports.getDocs = getDocs;
21
- exports.getDocsKeys = getDocsKeys;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./common.cjs`),t=require(`./generated/docs.entry.cjs`),n=()=>e.getKeys(t.docsEntry),r=async(n=e.defaultLocale)=>await e.getFiles(t.docsEntry,n),i=async(n,r=e.defaultLocale)=>await e.getFile(t.docsEntry,n,r),a=async(n=e.defaultLocale)=>await e.getFileMetadataRecord(t.docsEntry,n),o=async(n,r=e.defaultLocale)=>await e.getFileMetadata(t.docsEntry,n,r),s=async(n,r=e.defaultLocale,i=!1)=>await e.getFileMetadataBySlug(t.docsEntry,n,r,i),c=async(n,r=e.defaultLocale,i=!1)=>await e.getFileBySlug(t.docsEntry,n,r,i);exports.getDoc=i,exports.getDocBySlug=c,exports.getDocMetadata=o,exports.getDocMetadataBySlug=s,exports.getDocMetadataRecord=a,exports.getDocs=r,exports.getDocsKeys=n;
22
2
  //# sourceMappingURL=doc.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"doc.cjs","names":["getKeys","docsEntry","defaultLocale","getFiles","getFile","getFileMetadataRecord","getFileMetadata","getFileMetadataBySlug","getFileBySlug"],"sources":["../../src/doc.ts"],"sourcesContent":["import type { DeclaredLocales, LocalesValues } from '@intlayer/types';\nimport {\n defaultLocale,\n type FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n getKeys,\n} from './common';\nimport { docsEntry } from './generated/docs.entry';\n\nexport type DocKey = keyof typeof docsEntry;\nexport type Docs = Record<DocKey, Record<LocalesValues, Promise<string>>>;\nexport type DocMetadata = FileMetadata;\n\nexport const getDocsKeys = (): (keyof typeof docsEntry)[] => getKeys(docsEntry);\n\nexport const getDocs = async <L extends LocalesValues = DeclaredLocales>(\n locale: L = defaultLocale as L\n): Promise<Record<DocKey, string>> => await getFiles(docsEntry, locale);\n\nexport const getDoc = async <L extends LocalesValues = DeclaredLocales>(\n docName: keyof typeof docsEntry,\n locale: L = defaultLocale as L\n): Promise<string> => await getFile(docsEntry, docName, locale);\n\nexport const getDocMetadataRecord = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n locale: L = defaultLocale as L\n): Promise<Record<DocKey, FileMetadata>> =>\n await getFileMetadataRecord(docsEntry, locale);\n\nexport const getDocMetadata = async <\n D extends DocKey,\n L extends LocalesValues = DeclaredLocales,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> => await getFileMetadata(docsEntry, docName, locale);\n\nexport const getDocMetadataBySlug = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(docsEntry, slugs, locale, strict);\n\nexport const getDocBySlug = async <L extends LocalesValues = DeclaredLocales>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<string[]> => await getFileBySlug(docsEntry, slugs, locale, strict);\n"],"mappings":";;;;;AAkBA,MAAa,oBAAgDA,uBAAQC,uCAAU;AAE/E,MAAa,UAAU,OACrB,SAAYC,iCACwB,MAAMC,wBAASF,wCAAW,OAAO;AAEvE,MAAa,SAAS,OACpB,SACA,SAAYC,iCACQ,MAAME,uBAAQH,wCAAW,SAAS,OAAO;AAE/D,MAAa,uBAAuB,OAGlC,SAAYC,iCAEZ,MAAMG,qCAAsBJ,wCAAW,OAAO;AAEhD,MAAa,iBAAiB,OAI5B,SACA,SAAYC,iCACc,MAAMI,+BAAgBL,wCAAW,SAAS,OAAO;AAE7E,MAAa,uBAAuB,OAGlC,OACA,SAAYC,8BACZ,SAAS,UAET,MAAMK,qCAAsBN,wCAAW,OAAO,QAAQ,OAAO;AAE/D,MAAa,eAAe,OAC1B,OACA,SAAYC,8BACZ,SAAS,UACa,MAAMM,6BAAcP,wCAAW,OAAO,QAAQ,OAAO"}
1
+ {"version":3,"file":"doc.cjs","names":["getKeys","docsEntry","defaultLocale","getFiles","getFile","getFileMetadataRecord","getFileMetadata","getFileMetadataBySlug","getFileBySlug"],"sources":["../../src/doc.ts"],"sourcesContent":["import type { DeclaredLocales, LocalesValues } from '@intlayer/types';\nimport {\n defaultLocale,\n type FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n getKeys,\n} from './common';\nimport { docsEntry } from './generated/docs.entry';\n\nexport type DocKey = keyof typeof docsEntry;\nexport type Docs = Record<DocKey, Record<LocalesValues, Promise<string>>>;\nexport type DocMetadata = FileMetadata;\n\nexport const getDocsKeys = (): (keyof typeof docsEntry)[] => getKeys(docsEntry);\n\nexport const getDocs = async <L extends LocalesValues = DeclaredLocales>(\n locale: L = defaultLocale as L\n): Promise<Record<DocKey, string>> => await getFiles(docsEntry, locale);\n\nexport const getDoc = async <L extends LocalesValues = DeclaredLocales>(\n docName: keyof typeof docsEntry,\n locale: L = defaultLocale as L\n): Promise<string> => await getFile(docsEntry, docName, locale);\n\nexport const getDocMetadataRecord = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n locale: L = defaultLocale as L\n): Promise<Record<DocKey, FileMetadata>> =>\n await getFileMetadataRecord(docsEntry, locale);\n\nexport const getDocMetadata = async <\n D extends DocKey,\n L extends LocalesValues = DeclaredLocales,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> => await getFileMetadata(docsEntry, docName, locale);\n\nexport const getDocMetadataBySlug = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(docsEntry, slugs, locale, strict);\n\nexport const getDocBySlug = async <L extends LocalesValues = DeclaredLocales>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<string[]> => await getFileBySlug(docsEntry, slugs, locale, strict);\n"],"mappings":"2IAkBa,MAAgDA,EAAAA,QAAQC,EAAAA,UAAU,CAElE,EAAU,MACrB,EAAYC,EAAAA,gBACwB,MAAMC,EAAAA,SAASF,EAAAA,UAAW,EAAO,CAE1D,EAAS,MACpB,EACA,EAAYC,EAAAA,gBACQ,MAAME,EAAAA,QAAQH,EAAAA,UAAW,EAAS,EAAO,CAElD,EAAuB,MAGlC,EAAYC,EAAAA,gBAEZ,MAAMG,EAAAA,sBAAsBJ,EAAAA,UAAW,EAAO,CAEnC,EAAiB,MAI5B,EACA,EAAYC,EAAAA,gBACc,MAAMI,EAAAA,gBAAgBL,EAAAA,UAAW,EAAS,EAAO,CAEhE,EAAuB,MAGlC,EACA,EAAYC,EAAAA,cACZ,EAAS,KAET,MAAMK,EAAAA,sBAAsBN,EAAAA,UAAW,EAAO,EAAQ,EAAO,CAElD,EAAe,MAC1B,EACA,EAAYC,EAAAA,cACZ,EAAS,KACa,MAAMM,EAAAA,cAAcP,EAAAA,UAAW,EAAO,EAAQ,EAAO"}
@@ -1,22 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_common = require('./common.cjs');
3
- const require_generated_frequentQuestions_entry = require('./generated/frequentQuestions.entry.cjs');
4
-
5
- //#region src/frequentQuestions.ts
6
- const getFrequentQuestionsKeys = () => require_common.getKeys(require_generated_frequentQuestions_entry.frequentQuestionsEntry);
7
- const getFrequentQuestions = async (locale = require_common.defaultLocale) => require_common.getFiles(require_generated_frequentQuestions_entry.frequentQuestionsEntry, locale);
8
- const getFrequentQuestion = async (docName, locale = require_common.defaultLocale) => require_common.getFile(require_generated_frequentQuestions_entry.frequentQuestionsEntry, docName, locale);
9
- const getFrequentQuestionMetadataRecord = async (locale = require_common.defaultLocale) => require_common.getFileMetadataRecord(require_generated_frequentQuestions_entry.frequentQuestionsEntry, locale);
10
- const getFrequentQuestionMetadata = async (docName, locale = require_common.defaultLocale) => require_common.getFileMetadata(require_generated_frequentQuestions_entry.frequentQuestionsEntry, docName, locale);
11
- const getFrequentQuestionMetadataBySlug = async (slugs, locale = require_common.defaultLocale, strict = false) => await require_common.getFileMetadataBySlug(require_generated_frequentQuestions_entry.frequentQuestionsEntry, slugs, locale, strict);
12
- const getFrequentQuestionBySlug = async (slugs, locale = require_common.defaultLocale, strict = false) => await require_common.getFileBySlug(require_generated_frequentQuestions_entry.frequentQuestionsEntry, slugs, locale, strict);
13
-
14
- //#endregion
15
- exports.getFrequentQuestion = getFrequentQuestion;
16
- exports.getFrequentQuestionBySlug = getFrequentQuestionBySlug;
17
- exports.getFrequentQuestionMetadata = getFrequentQuestionMetadata;
18
- exports.getFrequentQuestionMetadataBySlug = getFrequentQuestionMetadataBySlug;
19
- exports.getFrequentQuestionMetadataRecord = getFrequentQuestionMetadataRecord;
20
- exports.getFrequentQuestions = getFrequentQuestions;
21
- exports.getFrequentQuestionsKeys = getFrequentQuestionsKeys;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./common.cjs`),t=require(`./generated/frequentQuestions.entry.cjs`),n=()=>e.getKeys(t.frequentQuestionsEntry),r=async(n=e.defaultLocale)=>e.getFiles(t.frequentQuestionsEntry,n),i=async(n,r=e.defaultLocale)=>e.getFile(t.frequentQuestionsEntry,n,r),a=async(n=e.defaultLocale)=>e.getFileMetadataRecord(t.frequentQuestionsEntry,n),o=async(n,r=e.defaultLocale)=>e.getFileMetadata(t.frequentQuestionsEntry,n,r),s=async(n,r=e.defaultLocale,i=!1)=>await e.getFileMetadataBySlug(t.frequentQuestionsEntry,n,r,i),c=async(n,r=e.defaultLocale,i=!1)=>await e.getFileBySlug(t.frequentQuestionsEntry,n,r,i);exports.getFrequentQuestion=i,exports.getFrequentQuestionBySlug=c,exports.getFrequentQuestionMetadata=o,exports.getFrequentQuestionMetadataBySlug=s,exports.getFrequentQuestionMetadataRecord=a,exports.getFrequentQuestions=r,exports.getFrequentQuestionsKeys=n;
22
2
  //# sourceMappingURL=frequentQuestions.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"frequentQuestions.cjs","names":["getKeys","frequentQuestionsEntry","defaultLocale","getFiles","getFile","getFileMetadataRecord","getFileMetadata","getFileMetadataBySlug","getFileBySlug"],"sources":["../../src/frequentQuestions.ts"],"sourcesContent":["import type { DeclaredLocales, LocalesValues } from '@intlayer/types';\nimport {\n defaultLocale,\n type FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n getKeys,\n} from './common';\nimport { frequentQuestionsEntry } from './generated/frequentQuestions.entry';\n\nexport type FrequentQuestionKey = keyof typeof frequentQuestionsEntry;\nexport type FrequentQuestions = Record<\n FrequentQuestionKey,\n Record<LocalesValues, Promise<string>>\n>;\nexport type FrequentQuestionMetadata = FileMetadata;\n\nexport const getFrequentQuestionsKeys =\n (): (keyof typeof frequentQuestionsEntry)[] =>\n getKeys(frequentQuestionsEntry);\n\nexport const getFrequentQuestions = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n locale: L = defaultLocale as L\n): Promise<Record<FrequentQuestionKey, string>> =>\n getFiles(frequentQuestionsEntry, locale);\n\nexport const getFrequentQuestion = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n docName: FrequentQuestionKey,\n locale: L = defaultLocale as L\n): Promise<string> => getFile(frequentQuestionsEntry, docName, locale);\n\nexport const getFrequentQuestionMetadataRecord = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n locale: L = defaultLocale as L\n): Promise<Record<FrequentQuestionKey, FileMetadata>> =>\n getFileMetadataRecord(frequentQuestionsEntry, locale);\n\nexport const getFrequentQuestionMetadata = async <\n D extends FrequentQuestionKey,\n L extends LocalesValues = DeclaredLocales,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> =>\n getFileMetadata(frequentQuestionsEntry, docName, locale);\n\nexport const getFrequentQuestionMetadataBySlug = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(frequentQuestionsEntry, slugs, locale, strict);\n\nexport const getFrequentQuestionBySlug = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<string[]> =>\n await getFileBySlug(frequentQuestionsEntry, slugs, locale, strict);\n"],"mappings":";;;;;AAqBA,MAAa,iCAETA,uBAAQC,iEAAuB;AAEnC,MAAa,uBAAuB,OAGlC,SAAYC,iCAEZC,wBAASF,kEAAwB,OAAO;AAE1C,MAAa,sBAAsB,OAGjC,SACA,SAAYC,iCACQE,uBAAQH,kEAAwB,SAAS,OAAO;AAEtE,MAAa,oCAAoC,OAG/C,SAAYC,iCAEZG,qCAAsBJ,kEAAwB,OAAO;AAEvD,MAAa,8BAA8B,OAIzC,SACA,SAAYC,iCAEZI,+BAAgBL,kEAAwB,SAAS,OAAO;AAE1D,MAAa,oCAAoC,OAG/C,OACA,SAAYC,8BACZ,SAAS,UAET,MAAMK,qCAAsBN,kEAAwB,OAAO,QAAQ,OAAO;AAE5E,MAAa,4BAA4B,OAGvC,OACA,SAAYC,8BACZ,SAAS,UAET,MAAMM,6BAAcP,kEAAwB,OAAO,QAAQ,OAAO"}
1
+ {"version":3,"file":"frequentQuestions.cjs","names":["getKeys","frequentQuestionsEntry","defaultLocale","getFiles","getFile","getFileMetadataRecord","getFileMetadata","getFileMetadataBySlug","getFileBySlug"],"sources":["../../src/frequentQuestions.ts"],"sourcesContent":["import type { DeclaredLocales, LocalesValues } from '@intlayer/types';\nimport {\n defaultLocale,\n type FileMetadata,\n getFile,\n getFileBySlug,\n getFileMetadata,\n getFileMetadataBySlug,\n getFileMetadataRecord,\n getFiles,\n getKeys,\n} from './common';\nimport { frequentQuestionsEntry } from './generated/frequentQuestions.entry';\n\nexport type FrequentQuestionKey = keyof typeof frequentQuestionsEntry;\nexport type FrequentQuestions = Record<\n FrequentQuestionKey,\n Record<LocalesValues, Promise<string>>\n>;\nexport type FrequentQuestionMetadata = FileMetadata;\n\nexport const getFrequentQuestionsKeys =\n (): (keyof typeof frequentQuestionsEntry)[] =>\n getKeys(frequentQuestionsEntry);\n\nexport const getFrequentQuestions = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n locale: L = defaultLocale as L\n): Promise<Record<FrequentQuestionKey, string>> =>\n getFiles(frequentQuestionsEntry, locale);\n\nexport const getFrequentQuestion = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n docName: FrequentQuestionKey,\n locale: L = defaultLocale as L\n): Promise<string> => getFile(frequentQuestionsEntry, docName, locale);\n\nexport const getFrequentQuestionMetadataRecord = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n locale: L = defaultLocale as L\n): Promise<Record<FrequentQuestionKey, FileMetadata>> =>\n getFileMetadataRecord(frequentQuestionsEntry, locale);\n\nexport const getFrequentQuestionMetadata = async <\n D extends FrequentQuestionKey,\n L extends LocalesValues = DeclaredLocales,\n>(\n docName: D,\n locale: L = defaultLocale as L\n): Promise<FileMetadata> =>\n getFileMetadata(frequentQuestionsEntry, docName, locale);\n\nexport const getFrequentQuestionMetadataBySlug = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<FileMetadata[]> =>\n await getFileMetadataBySlug(frequentQuestionsEntry, slugs, locale, strict);\n\nexport const getFrequentQuestionBySlug = async <\n L extends LocalesValues = DeclaredLocales,\n>(\n slugs: string | string[],\n locale: L = defaultLocale as L,\n strict = false\n): Promise<string[]> =>\n await getFileBySlug(frequentQuestionsEntry, slugs, locale, strict);\n"],"mappings":"wJAqBa,MAETA,EAAAA,QAAQC,EAAAA,uBAAuB,CAEtB,EAAuB,MAGlC,EAAYC,EAAAA,gBAEZC,EAAAA,SAASF,EAAAA,uBAAwB,EAAO,CAE7B,EAAsB,MAGjC,EACA,EAAYC,EAAAA,gBACQE,EAAAA,QAAQH,EAAAA,uBAAwB,EAAS,EAAO,CAEzD,EAAoC,MAG/C,EAAYC,EAAAA,gBAEZG,EAAAA,sBAAsBJ,EAAAA,uBAAwB,EAAO,CAE1C,EAA8B,MAIzC,EACA,EAAYC,EAAAA,gBAEZI,EAAAA,gBAAgBL,EAAAA,uBAAwB,EAAS,EAAO,CAE7C,EAAoC,MAG/C,EACA,EAAYC,EAAAA,cACZ,EAAS,KAET,MAAMK,EAAAA,sBAAsBN,EAAAA,uBAAwB,EAAO,EAAQ,EAAO,CAE/D,EAA4B,MAGvC,EACA,EAAYC,EAAAA,cACZ,EAAS,KAET,MAAMM,EAAAA,cAAcP,EAAAA,uBAAwB,EAAO,EAAQ,EAAO"}