@intlayer/chokidar 6.1.6 → 7.0.0-canary.1

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 (464) hide show
  1. package/dist/{cjs → assets}/getContentDeclarationFileTemplate/cjsTemplate.txt +3 -2
  2. package/dist/{cjs → assets}/getContentDeclarationFileTemplate/esmTemplate.txt +2 -1
  3. package/dist/{cjs → assets}/getContentDeclarationFileTemplate/jsonTemplate.txt +2 -1
  4. package/dist/{cjs → assets}/getContentDeclarationFileTemplate/tsTemplate.txt +2 -1
  5. package/dist/cjs/_virtual/_utils_asset.cjs +104 -0
  6. package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
  7. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +42 -80
  8. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
  9. package/dist/cjs/buildIntlayerDictionary/index.cjs +5 -25
  10. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +21 -42
  11. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
  12. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +79 -116
  13. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
  14. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +62 -86
  15. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
  16. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +48 -69
  17. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
  18. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +42 -52
  19. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
  20. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +60 -82
  21. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
  22. package/dist/cjs/cleanOutputDir.cjs +20 -60
  23. package/dist/cjs/cleanOutputDir.cjs.map +1 -1
  24. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +64 -103
  25. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
  26. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +41 -73
  27. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
  28. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +19 -49
  29. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
  30. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +20 -50
  31. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
  32. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +20 -50
  33. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
  34. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +19 -49
  35. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
  36. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +19 -49
  37. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
  38. package/dist/cjs/createDictionaryEntryPoint/index.cjs +15 -35
  39. package/dist/cjs/createType/createModuleAugmentation.cjs +56 -108
  40. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
  41. package/dist/cjs/createType/createType.cjs +29 -58
  42. package/dist/cjs/createType/createType.cjs.map +1 -1
  43. package/dist/cjs/createType/index.cjs +7 -25
  44. package/dist/cjs/fetchDistantDictionaries.cjs +49 -77
  45. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  46. package/dist/cjs/filterInvalidDictionaries.cjs +26 -59
  47. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
  48. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +32 -68
  49. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
  50. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +32 -51
  51. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
  52. package/dist/cjs/handleContentDeclarationFileChange.cjs +35 -56
  53. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
  54. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +36 -0
  55. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -0
  56. package/dist/cjs/index.cjs +103 -156
  57. package/dist/cjs/listDictionariesPath.cjs +27 -59
  58. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  59. package/dist/cjs/listGitFiles.cjs +93 -162
  60. package/dist/cjs/listGitFiles.cjs.map +1 -1
  61. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +70 -0
  62. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -0
  63. package/dist/cjs/loadDictionaries/index.cjs +11 -29
  64. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +68 -90
  65. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  66. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +111 -166
  67. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  68. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +27 -53
  69. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
  70. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +60 -102
  71. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
  72. package/dist/cjs/loadDictionaries/log.cjs +107 -182
  73. package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
  74. package/dist/cjs/prepareIntlayer.cjs +73 -130
  75. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  76. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +27 -61
  77. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
  78. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +10 -32
  79. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
  80. package/dist/cjs/utils/chunkJSON.cjs +329 -0
  81. package/dist/cjs/utils/chunkJSON.cjs.map +1 -0
  82. package/dist/cjs/utils/extractErrorMessage.cjs +92 -135
  83. package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -1
  84. package/dist/cjs/utils/formatter.cjs +19 -49
  85. package/dist/cjs/utils/formatter.cjs.map +1 -1
  86. package/dist/cjs/utils/getChunk.cjs +34 -0
  87. package/dist/cjs/utils/getChunk.cjs.map +1 -0
  88. package/dist/cjs/utils/getFileHash.cjs +9 -40
  89. package/dist/cjs/utils/getFileHash.cjs.map +1 -1
  90. package/dist/cjs/utils/getFormatFromExtension.cjs +23 -54
  91. package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
  92. package/dist/cjs/utils/kebabCaseToCamelCase.cjs +11 -36
  93. package/dist/cjs/utils/kebabCaseToCamelCase.cjs.map +1 -1
  94. package/dist/cjs/utils/pLimit.cjs +128 -0
  95. package/dist/cjs/utils/pLimit.cjs.map +1 -0
  96. package/dist/cjs/utils/parallelize.cjs +10 -169
  97. package/dist/cjs/utils/parallelize.cjs.map +1 -1
  98. package/dist/cjs/utils/parallelizeGlobal.cjs +29 -0
  99. package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -0
  100. package/dist/cjs/utils/reduceObjectFormat.cjs +31 -0
  101. package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -0
  102. package/dist/cjs/utils/resolveObjectPromises.cjs +18 -48
  103. package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
  104. package/dist/cjs/utils/runOnce.cjs +80 -57
  105. package/dist/cjs/utils/runOnce.cjs.map +1 -1
  106. package/dist/cjs/utils/runParallel.cjs +163 -74
  107. package/dist/cjs/utils/runParallel.cjs.map +1 -1
  108. package/dist/cjs/utils/sortAlphabetically.cjs +5 -27
  109. package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
  110. package/dist/cjs/utils/splitTextByLine.cjs +11 -0
  111. package/dist/cjs/utils/splitTextByLine.cjs.map +1 -0
  112. package/dist/cjs/utils/verifyIdenticObjectFormat copy.cjs +54 -0
  113. package/dist/cjs/utils/verifyIdenticObjectFormat copy.cjs.map +1 -0
  114. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +60 -0
  115. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -0
  116. package/dist/cjs/watcher.cjs +61 -83
  117. package/dist/cjs/watcher.cjs.map +1 -1
  118. package/dist/cjs/writeConfiguration/index.cjs +15 -35
  119. package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
  120. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +25 -51
  121. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
  122. package/dist/cjs/writeContentDeclaration/dictionaryStatus.cjs +0 -17
  123. package/dist/cjs/writeContentDeclaration/index.cjs +9 -33
  124. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +77 -0
  125. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -0
  126. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +1731 -755
  127. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
  128. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +113 -112
  129. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  130. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +56 -66
  131. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  132. package/dist/cjs/writeFileIfChanged.cjs +10 -43
  133. package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
  134. package/dist/cjs/writeJsonIfChanged.cjs +14 -31
  135. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
  136. package/dist/esm/_virtual/_utils_asset.mjs +100 -0
  137. package/dist/esm/_virtual/rolldown_runtime.mjs +8 -0
  138. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +35 -54
  139. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
  140. package/dist/esm/buildIntlayerDictionary/index.mjs +4 -3
  141. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +18 -17
  142. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
  143. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +69 -91
  144. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
  145. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +53 -61
  146. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
  147. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +40 -42
  148. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
  149. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +35 -25
  150. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
  151. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +53 -56
  152. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
  153. package/dist/esm/cleanOutputDir.mjs +17 -36
  154. package/dist/esm/cleanOutputDir.mjs.map +1 -1
  155. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +51 -70
  156. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
  157. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +36 -47
  158. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
  159. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +14 -14
  160. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
  161. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +15 -15
  162. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
  163. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +15 -15
  164. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
  165. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +14 -14
  166. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
  167. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +14 -14
  168. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
  169. package/dist/esm/createDictionaryEntryPoint/index.mjs +9 -8
  170. package/dist/esm/createType/createModuleAugmentation.mjs +48 -71
  171. package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
  172. package/dist/esm/createType/createType.mjs +24 -35
  173. package/dist/esm/createType/createType.mjs.map +1 -1
  174. package/dist/esm/createType/index.mjs +4 -3
  175. package/dist/esm/fetchDistantDictionaries.mjs +45 -52
  176. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
  177. package/dist/esm/filterInvalidDictionaries.mjs +22 -37
  178. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
  179. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +31 -42
  180. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
  181. package/dist/esm/handleAdditionalContentDeclarationFile.mjs +27 -24
  182. package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
  183. package/dist/esm/handleContentDeclarationFileChange.mjs +30 -29
  184. package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
  185. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +34 -0
  186. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -0
  187. package/dist/esm/index.mjs +39 -99
  188. package/dist/esm/listDictionariesPath.mjs +24 -24
  189. package/dist/esm/listDictionariesPath.mjs.map +1 -1
  190. package/dist/esm/listGitFiles.mjs +83 -124
  191. package/dist/esm/listGitFiles.mjs.map +1 -1
  192. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +66 -0
  193. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -0
  194. package/dist/esm/loadDictionaries/index.mjs +6 -5
  195. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +61 -70
  196. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  197. package/dist/esm/loadDictionaries/loadDictionaries.mjs +105 -146
  198. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  199. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +23 -31
  200. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
  201. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +52 -74
  202. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
  203. package/dist/esm/loadDictionaries/log.mjs +105 -165
  204. package/dist/esm/loadDictionaries/log.mjs.map +1 -1
  205. package/dist/esm/prepareIntlayer.mjs +64 -97
  206. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  207. package/dist/esm/reduceDictionaryContent/applyMask.mjs +26 -37
  208. package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
  209. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +7 -7
  210. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
  211. package/dist/esm/utils/chunkJSON.mjs +327 -0
  212. package/dist/esm/utils/chunkJSON.mjs.map +1 -0
  213. package/dist/esm/utils/extractErrorMessage.mjs +91 -111
  214. package/dist/esm/utils/extractErrorMessage.mjs.map +1 -1
  215. package/dist/esm/utils/formatter.mjs +10 -12
  216. package/dist/esm/utils/formatter.mjs.map +1 -1
  217. package/dist/esm/utils/getChunk.mjs +34 -0
  218. package/dist/esm/utils/getChunk.mjs.map +1 -0
  219. package/dist/esm/utils/getFileHash.mjs +6 -5
  220. package/dist/esm/utils/getFileHash.mjs.map +1 -1
  221. package/dist/esm/utils/getFormatFromExtension.mjs +21 -29
  222. package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
  223. package/dist/esm/utils/kebabCaseToCamelCase.mjs +10 -12
  224. package/dist/esm/utils/kebabCaseToCamelCase.mjs.map +1 -1
  225. package/dist/esm/utils/pLimit.mjs +126 -0
  226. package/dist/esm/utils/pLimit.mjs.map +1 -0
  227. package/dist/esm/utils/parallelize.mjs +10 -144
  228. package/dist/esm/utils/parallelize.mjs.map +1 -1
  229. package/dist/esm/utils/parallelizeGlobal.mjs +27 -0
  230. package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -0
  231. package/dist/esm/utils/reduceObjectFormat.mjs +30 -0
  232. package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -0
  233. package/dist/esm/utils/resolveObjectPromises.mjs +17 -24
  234. package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
  235. package/dist/esm/utils/runOnce.mjs +76 -33
  236. package/dist/esm/utils/runOnce.mjs.map +1 -1
  237. package/dist/esm/utils/runParallel.mjs +160 -40
  238. package/dist/esm/utils/runParallel.mjs.map +1 -1
  239. package/dist/esm/utils/sortAlphabetically.mjs +4 -3
  240. package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
  241. package/dist/esm/utils/splitTextByLine.mjs +10 -0
  242. package/dist/esm/utils/splitTextByLine.mjs.map +1 -0
  243. package/dist/esm/utils/verifyIdenticObjectFormat copy.mjs +53 -0
  244. package/dist/esm/utils/verifyIdenticObjectFormat copy.mjs.map +1 -0
  245. package/dist/esm/utils/verifyIdenticObjectFormat.mjs +59 -0
  246. package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -0
  247. package/dist/esm/watcher.mjs +53 -58
  248. package/dist/esm/watcher.mjs.map +1 -1
  249. package/dist/esm/writeConfiguration/index.mjs +11 -10
  250. package/dist/esm/writeConfiguration/index.mjs.map +1 -1
  251. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +24 -27
  252. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
  253. package/dist/esm/writeContentDeclaration/dictionaryStatus.mjs +0 -1
  254. package/dist/esm/writeContentDeclaration/index.mjs +6 -7
  255. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +71 -0
  256. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -0
  257. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +1726 -735
  258. package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
  259. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +105 -76
  260. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  261. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +48 -46
  262. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
  263. package/dist/esm/writeFileIfChanged.mjs +7 -18
  264. package/dist/esm/writeFileIfChanged.mjs.map +1 -1
  265. package/dist/esm/writeJsonIfChanged.mjs +14 -7
  266. package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
  267. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +14 -7
  268. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -1
  269. package/dist/types/buildIntlayerDictionary/index.d.ts +3 -3
  270. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +7 -2
  271. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -1
  272. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +14 -10
  273. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -1
  274. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +8 -3
  275. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
  276. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +12 -7
  277. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -1
  278. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts +8 -2
  279. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -1
  280. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +10 -6
  281. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -1
  282. package/dist/types/cleanOutputDir.d.ts +6 -1
  283. package/dist/types/cleanOutputDir.d.ts.map +1 -1
  284. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +6 -1
  285. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -1
  286. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +6 -1
  287. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -1
  288. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +7 -1
  289. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -1
  290. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +7 -1
  291. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -1
  292. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +7 -1
  293. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -1
  294. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +7 -1
  295. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -1
  296. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +7 -1
  297. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -1
  298. package/dist/types/createDictionaryEntryPoint/index.d.ts +8 -8
  299. package/dist/types/createType/createModuleAugmentation.d.ts +8 -5
  300. package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -1
  301. package/dist/types/createType/createType.d.ts +7 -4
  302. package/dist/types/createType/createType.d.ts.map +1 -1
  303. package/dist/types/createType/index.d.ts +3 -3
  304. package/dist/types/fetchDistantDictionaries.d.ts +10 -7
  305. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
  306. package/dist/types/filterInvalidDictionaries.d.ts +7 -4
  307. package/dist/types/filterInvalidDictionaries.d.ts.map +1 -1
  308. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +6 -2
  309. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -1
  310. package/dist/types/handleAdditionalContentDeclarationFile.d.ts +6 -2
  311. package/dist/types/handleAdditionalContentDeclarationFile.d.ts.map +1 -1
  312. package/dist/types/handleContentDeclarationFileChange.d.ts +6 -2
  313. package/dist/types/handleContentDeclarationFileChange.d.ts.map +1 -1
  314. package/dist/types/handleUnlinkedContentDeclarationFile.d.ts +7 -0
  315. package/dist/types/handleUnlinkedContentDeclarationFile.d.ts.map +1 -0
  316. package/dist/types/index.d.ts +49 -33
  317. package/dist/types/listDictionariesPath.d.ts +7 -2
  318. package/dist/types/listDictionariesPath.d.ts.map +1 -1
  319. package/dist/types/listGitFiles.d.ts +24 -12
  320. package/dist/types/listGitFiles.d.ts.map +1 -1
  321. package/dist/types/loadDictionaries/getIntlayerBundle.d.ts +11 -0
  322. package/dist/types/loadDictionaries/getIntlayerBundle.d.ts.map +1 -0
  323. package/dist/types/loadDictionaries/index.d.ts +5 -5
  324. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +8 -5
  325. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
  326. package/dist/types/loadDictionaries/loadDictionaries.d.ts +18 -14
  327. package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -1
  328. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +6 -3
  329. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -1
  330. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +13 -8
  331. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -1
  332. package/dist/types/loadDictionaries/log.d.ts +28 -24
  333. package/dist/types/loadDictionaries/log.d.ts.map +1 -1
  334. package/dist/types/prepareIntlayer.d.ts +12 -2
  335. package/dist/types/prepareIntlayer.d.ts.map +1 -1
  336. package/dist/types/reduceDictionaryContent/applyMask.d.ts +6 -2
  337. package/dist/types/reduceDictionaryContent/applyMask.d.ts.map +1 -1
  338. package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts +6 -2
  339. package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts.map +1 -1
  340. package/dist/types/utils/chunkJSON.d.ts +56 -0
  341. package/dist/types/utils/chunkJSON.d.ts.map +1 -0
  342. package/dist/types/utils/extractErrorMessage.d.ts +4 -1
  343. package/dist/types/utils/extractErrorMessage.d.ts.map +1 -1
  344. package/dist/types/utils/formatter.d.ts +8 -3
  345. package/dist/types/utils/formatter.d.ts.map +1 -1
  346. package/dist/types/utils/getChunk.d.ts +11 -0
  347. package/dist/types/utils/getChunk.d.ts.map +1 -0
  348. package/dist/types/utils/getFileHash.d.ts +4 -1
  349. package/dist/types/utils/getFileHash.d.ts.map +1 -1
  350. package/dist/types/utils/getFormatFromExtension.d.ts +7 -4
  351. package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -1
  352. package/dist/types/utils/kebabCaseToCamelCase.d.ts +4 -1
  353. package/dist/types/utils/kebabCaseToCamelCase.d.ts.map +1 -1
  354. package/dist/types/utils/pLimit.d.ts +16 -0
  355. package/dist/types/utils/pLimit.d.ts.map +1 -0
  356. package/dist/types/utils/parallelize.d.ts +4 -13
  357. package/dist/types/utils/parallelize.d.ts.map +1 -1
  358. package/dist/types/utils/parallelizeGlobal.d.ts +22 -0
  359. package/dist/types/utils/parallelizeGlobal.d.ts.map +1 -0
  360. package/dist/types/utils/reduceObjectFormat.d.ts +17 -0
  361. package/dist/types/utils/reduceObjectFormat.d.ts.map +1 -0
  362. package/dist/types/utils/resolveObjectPromises.d.ts +4 -1
  363. package/dist/types/utils/resolveObjectPromises.d.ts.map +1 -1
  364. package/dist/types/utils/runOnce.d.ts +23 -2
  365. package/dist/types/utils/runOnce.d.ts.map +1 -1
  366. package/dist/types/utils/runParallel.d.ts +9 -6
  367. package/dist/types/utils/runParallel.d.ts.map +1 -1
  368. package/dist/types/utils/sortAlphabetically.d.ts +4 -1
  369. package/dist/types/utils/sortAlphabetically.d.ts.map +1 -1
  370. package/dist/types/utils/splitTextByLine.d.ts +5 -0
  371. package/dist/types/utils/splitTextByLine.d.ts.map +1 -0
  372. package/dist/types/utils/verifyIdenticObjectFormat copy.d.ts +23 -0
  373. package/dist/types/utils/verifyIdenticObjectFormat copy.d.ts.map +1 -0
  374. package/dist/types/utils/verifyIdenticObjectFormat.d.ts +23 -0
  375. package/dist/types/utils/verifyIdenticObjectFormat.d.ts.map +1 -0
  376. package/dist/types/watcher.d.ts +13 -9
  377. package/dist/types/watcher.d.ts.map +1 -1
  378. package/dist/types/writeConfiguration/index.d.ts +6 -2
  379. package/dist/types/writeConfiguration/index.d.ts.map +1 -1
  380. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts +4 -1
  381. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts.map +1 -1
  382. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +4 -1
  383. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -1
  384. package/dist/types/writeContentDeclaration/index.d.ts +6 -7
  385. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts +7 -0
  386. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -0
  387. package/dist/types/writeContentDeclaration/transformJSFile.d.ts +33 -6
  388. package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -1
  389. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +14 -6
  390. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
  391. package/dist/types/writeContentDeclaration/writeJSFile.d.ts +7 -3
  392. package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -1
  393. package/dist/types/writeFileIfChanged.d.ts +7 -2
  394. package/dist/types/writeFileIfChanged.d.ts.map +1 -1
  395. package/dist/types/writeJsonIfChanged.d.ts +7 -2
  396. package/dist/types/writeJsonIfChanged.d.ts.map +1 -1
  397. package/package.json +48 -54
  398. package/LICENSE +0 -202
  399. package/dist/cjs/buildIntlayerDictionary/index.cjs.map +0 -1
  400. package/dist/cjs/createDictionaryEntryPoint/index.cjs.map +0 -1
  401. package/dist/cjs/createType/index.cjs.map +0 -1
  402. package/dist/cjs/handleUnlikedContentDeclarationFile.cjs +0 -57
  403. package/dist/cjs/handleUnlikedContentDeclarationFile.cjs.map +0 -1
  404. package/dist/cjs/index.cjs.map +0 -1
  405. package/dist/cjs/loadDictionaries/index.cjs.map +0 -1
  406. package/dist/cjs/mergeDictionaries.cjs +0 -143
  407. package/dist/cjs/mergeDictionaries.cjs.map +0 -1
  408. package/dist/cjs/orderDictionaries.cjs +0 -71
  409. package/dist/cjs/orderDictionaries.cjs.map +0 -1
  410. package/dist/cjs/prepareContentDeclaration.cjs +0 -93
  411. package/dist/cjs/prepareContentDeclaration.cjs.map +0 -1
  412. package/dist/cjs/processPerLocaleDictionary.cjs +0 -49
  413. package/dist/cjs/processPerLocaleDictionary.cjs.map +0 -1
  414. package/dist/cjs/utils/getExtention.cjs +0 -37
  415. package/dist/cjs/utils/getExtention.cjs.map +0 -1
  416. package/dist/cjs/writeContentDeclaration/dictionaryStatus.cjs.map +0 -1
  417. package/dist/cjs/writeContentDeclaration/formatCode.cjs +0 -78
  418. package/dist/cjs/writeContentDeclaration/formatCode.cjs.map +0 -1
  419. package/dist/cjs/writeContentDeclaration/index.cjs.map +0 -1
  420. package/dist/esm/buildIntlayerDictionary/index.mjs.map +0 -1
  421. package/dist/esm/createDictionaryEntryPoint/index.mjs.map +0 -1
  422. package/dist/esm/createType/index.mjs.map +0 -1
  423. package/dist/esm/getContentDeclarationFileTemplate/cjsTemplate.txt +0 -9
  424. package/dist/esm/getContentDeclarationFileTemplate/esmTemplate.txt +0 -9
  425. package/dist/esm/getContentDeclarationFileTemplate/jsonTemplate.txt +0 -5
  426. package/dist/esm/getContentDeclarationFileTemplate/tsTemplate.txt +0 -8
  427. package/dist/esm/handleUnlikedContentDeclarationFile.mjs +0 -33
  428. package/dist/esm/handleUnlikedContentDeclarationFile.mjs.map +0 -1
  429. package/dist/esm/index.mjs.map +0 -1
  430. package/dist/esm/loadDictionaries/index.mjs.map +0 -1
  431. package/dist/esm/mergeDictionaries.mjs +0 -109
  432. package/dist/esm/mergeDictionaries.mjs.map +0 -1
  433. package/dist/esm/orderDictionaries.mjs +0 -37
  434. package/dist/esm/orderDictionaries.mjs.map +0 -1
  435. package/dist/esm/prepareContentDeclaration.mjs +0 -72
  436. package/dist/esm/prepareContentDeclaration.mjs.map +0 -1
  437. package/dist/esm/processPerLocaleDictionary.mjs +0 -25
  438. package/dist/esm/processPerLocaleDictionary.mjs.map +0 -1
  439. package/dist/esm/utils/getExtention.mjs +0 -13
  440. package/dist/esm/utils/getExtention.mjs.map +0 -1
  441. package/dist/esm/writeContentDeclaration/dictionaryStatus.mjs.map +0 -1
  442. package/dist/esm/writeContentDeclaration/formatCode.mjs +0 -44
  443. package/dist/esm/writeContentDeclaration/formatCode.mjs.map +0 -1
  444. package/dist/esm/writeContentDeclaration/index.mjs.map +0 -1
  445. package/dist/types/buildIntlayerDictionary/index.d.ts.map +0 -1
  446. package/dist/types/createDictionaryEntryPoint/index.d.ts.map +0 -1
  447. package/dist/types/createType/index.d.ts.map +0 -1
  448. package/dist/types/handleUnlikedContentDeclarationFile.d.ts +0 -3
  449. package/dist/types/handleUnlikedContentDeclarationFile.d.ts.map +0 -1
  450. package/dist/types/index.d.ts.map +0 -1
  451. package/dist/types/loadDictionaries/index.d.ts.map +0 -1
  452. package/dist/types/mergeDictionaries.d.ts +0 -3
  453. package/dist/types/mergeDictionaries.d.ts.map +0 -1
  454. package/dist/types/orderDictionaries.d.ts +0 -10
  455. package/dist/types/orderDictionaries.d.ts.map +0 -1
  456. package/dist/types/prepareContentDeclaration.d.ts +0 -3
  457. package/dist/types/prepareContentDeclaration.d.ts.map +0 -1
  458. package/dist/types/processPerLocaleDictionary.d.ts +0 -32
  459. package/dist/types/processPerLocaleDictionary.d.ts.map +0 -1
  460. package/dist/types/utils/getExtention.d.ts +0 -3
  461. package/dist/types/utils/getExtention.d.ts.map +0 -1
  462. package/dist/types/writeContentDeclaration/formatCode.d.ts +0 -2
  463. package/dist/types/writeContentDeclaration/formatCode.d.ts.map +0 -1
  464. package/dist/types/writeContentDeclaration/index.d.ts.map +0 -1
@@ -1,77 +1,166 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var runParallel_exports = {};
30
- __export(runParallel_exports, {
31
- runParallel: () => runParallel
32
- });
33
- module.exports = __toCommonJS(runParallel_exports);
34
- var import_concurrently = __toESM(require("concurrently"));
1
+ const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
+ let node_path = require("node:path");
3
+ node_path = require_rolldown_runtime.__toESM(node_path);
4
+ let node_child_process = require("node:child_process");
5
+ node_child_process = require_rolldown_runtime.__toESM(node_child_process);
6
+
7
+ //#region src/utils/runParallel.ts
8
+ /**
9
+ * Start a cross-platform parallel process without external deps.
10
+ * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).
11
+ */
35
12
  const runParallel = (proc) => {
36
- if (!proc || Array.isArray(proc) && proc.length === 0) return null;
37
- const commandText = Array.isArray(proc) ? proc.join(" ") : proc;
38
- const { result, commands } = (0, import_concurrently.default)(
39
- [
40
- {
41
- command: commandText,
42
- name: "parallel",
43
- cwd: process.cwd()
44
- }
45
- ],
46
- {
47
- prefix: "none",
48
- killOthersOn: [],
49
- restartTries: 0,
50
- raw: true
51
- }
52
- );
53
- result.catch(() => {
54
- });
55
- const kill = () => {
56
- try {
57
- commands.forEach((cmd) => cmd.kill("SIGTERM"));
58
- } catch {
59
- }
60
- setTimeout(() => {
61
- try {
62
- commands.forEach((cmd) => cmd.kill("SIGKILL"));
63
- } catch {
64
- }
65
- }, 5e3);
66
- };
67
- const cleanup = () => kill();
68
- process.on("SIGINT", cleanup);
69
- process.on("SIGTERM", cleanup);
70
- process.on("exit", cleanup);
71
- return { kill, result, commandText };
13
+ if (!proc || Array.isArray(proc) && proc.length === 0) throw new Error("Invalid command");
14
+ const commandText = Array.isArray(proc) ? proc.join(" ") : proc;
15
+ const isArray = Array.isArray(proc);
16
+ const command = isArray ? proc[0] : commandText;
17
+ const args = isArray ? proc.slice(1) : [];
18
+ const cwdBin = (0, node_path.join)(process.cwd(), "node_modules", ".bin");
19
+ const PATH_KEY = Object.keys(process.env).find((k) => k.toLowerCase() === "path") ?? "PATH";
20
+ const extendedPath = [cwdBin, process.env[PATH_KEY] ?? ""].filter(Boolean).join(node_path.delimiter);
21
+ const childEnv = {
22
+ ...process.env,
23
+ [PATH_KEY]: extendedPath
24
+ };
25
+ const isWin = process.platform === "win32";
26
+ const child = isArray ? args.length === 0 && /\s/.test(command) ? isWin ? (0, node_child_process.spawn)(process.env.ComSpec ?? "cmd.exe", [
27
+ "/d",
28
+ "/s",
29
+ "/c",
30
+ command
31
+ ], {
32
+ cwd: process.cwd(),
33
+ stdio: "inherit",
34
+ shell: false,
35
+ detached: false,
36
+ env: childEnv
37
+ }) : (0, node_child_process.spawn)(process.env.SHELL ?? "/bin/bash", ["-lc", command], {
38
+ cwd: process.cwd(),
39
+ stdio: "inherit",
40
+ shell: false,
41
+ detached: false,
42
+ env: childEnv
43
+ }) : (0, node_child_process.spawn)(command, args, {
44
+ cwd: process.cwd(),
45
+ stdio: "inherit",
46
+ shell: false,
47
+ detached: false,
48
+ env: childEnv
49
+ }) : isWin ? (0, node_child_process.spawn)(process.env.ComSpec ?? "cmd.exe", [
50
+ "/d",
51
+ "/s",
52
+ "/c",
53
+ commandText
54
+ ], {
55
+ cwd: process.cwd(),
56
+ stdio: "inherit",
57
+ shell: false,
58
+ detached: false,
59
+ env: childEnv
60
+ }) : (0, node_child_process.spawn)(process.env.SHELL ?? "/bin/bash", ["-lc", commandText], {
61
+ cwd: process.cwd(),
62
+ stdio: "inherit",
63
+ shell: false,
64
+ detached: false,
65
+ env: childEnv
66
+ });
67
+ let terminated = false;
68
+ const terminateTree = (signal = "SIGTERM") => {
69
+ if (terminated) return;
70
+ terminated = true;
71
+ try {
72
+ if (process.platform === "win32") (0, node_child_process.spawn)("taskkill", [
73
+ "/PID",
74
+ String(child.pid),
75
+ "/T",
76
+ "/F"
77
+ ]);
78
+ else if (child.pid) try {
79
+ process.kill(child.pid, signal);
80
+ } catch {}
81
+ } catch {}
82
+ setTimeout(() => {
83
+ try {
84
+ if (process.platform === "win32") (0, node_child_process.spawn)("taskkill", [
85
+ "/PID",
86
+ String(child.pid),
87
+ "/T",
88
+ "/F"
89
+ ]);
90
+ else if (child.pid) try {
91
+ process.kill(child.pid, "SIGKILL");
92
+ } catch {}
93
+ } catch {}
94
+ }, 5e3);
95
+ };
96
+ const result = new Promise((resolve, reject) => {
97
+ child.on("error", (err) => {
98
+ try {
99
+ console.error(`[runParallel] Failed to start: ${err?.message ?? String(err)}`);
100
+ } catch {}
101
+ reject(err);
102
+ });
103
+ child.on("exit", (code, signal) => {
104
+ signalHandlers.forEach(({ event, handler }) => {
105
+ process.off(event, handler);
106
+ });
107
+ if (code === 0) resolve();
108
+ else reject(Object.assign(/* @__PURE__ */ new Error("Parallel process failed"), {
109
+ code,
110
+ signal
111
+ }));
112
+ });
113
+ });
114
+ const cleanup = () => terminateTree("SIGTERM");
115
+ const signalHandlers = [
116
+ {
117
+ event: "SIGINT",
118
+ handler: cleanup
119
+ },
120
+ {
121
+ event: "SIGTERM",
122
+ handler: cleanup
123
+ },
124
+ {
125
+ event: "SIGQUIT",
126
+ handler: cleanup
127
+ },
128
+ {
129
+ event: "SIGHUP",
130
+ handler: cleanup
131
+ },
132
+ {
133
+ event: "beforeExit",
134
+ handler: cleanup
135
+ },
136
+ {
137
+ event: "exit",
138
+ handler: cleanup
139
+ },
140
+ {
141
+ event: "uncaughtException",
142
+ handler: () => {
143
+ cleanup();
144
+ }
145
+ },
146
+ {
147
+ event: "unhandledRejection",
148
+ handler: () => {
149
+ cleanup();
150
+ }
151
+ }
152
+ ];
153
+ signalHandlers.forEach(({ event, handler }) => {
154
+ process.on(event, handler);
155
+ });
156
+ const kill = () => terminateTree("SIGTERM");
157
+ return {
158
+ kill,
159
+ result,
160
+ commandText
161
+ };
72
162
  };
73
- // Annotate the CommonJS export names for ESM import in node:
74
- 0 && (module.exports = {
75
- runParallel
76
- });
163
+
164
+ //#endregion
165
+ exports.runParallel = runParallel;
77
166
  //# sourceMappingURL=runParallel.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/runParallel.ts"],"sourcesContent":["import concurrently from 'concurrently';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process using `concurrently`.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (\n proc?: string | string[]\n): ParallelHandle | null => {\n if (!proc || (Array.isArray(proc) && proc.length === 0)) return null;\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const { result, commands } = concurrently(\n [\n {\n command: commandText,\n name: 'parallel',\n cwd: process.cwd(),\n },\n ],\n {\n prefix: 'none',\n killOthersOn: [],\n restartTries: 0,\n raw: true,\n }\n );\n\n result.catch(() => {\n // Error already printed by concurrently; keep logging minimal\n });\n\n const kill = () => {\n try {\n commands.forEach((cmd) => cmd.kill('SIGTERM'));\n } catch {}\n setTimeout(() => {\n try {\n commands.forEach((cmd) => cmd.kill('SIGKILL' as any));\n } catch {}\n }, 5000);\n };\n\n // Ensure cleanup on exit\n const cleanup = () => kill();\n process.on('SIGINT', cleanup);\n process.on('SIGTERM', cleanup);\n process.on('exit', cleanup);\n\n return { kill, result, commandText };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAyB;AAYlB,MAAM,cAAc,CACzB,SAC0B;AAC1B,MAAI,CAAC,QAAS,MAAM,QAAQ,IAAI,KAAK,KAAK,WAAW,EAAI,QAAO;AAEhE,QAAM,cAAc,MAAM,QAAQ,IAAI,IAAI,KAAK,KAAK,GAAG,IAAI;AAE3D,QAAM,EAAE,QAAQ,SAAS,QAAI,oBAAAA;AAAA,IAC3B;AAAA,MACE;AAAA,QACE,SAAS;AAAA,QACT,MAAM;AAAA,QACN,KAAK,QAAQ,IAAI;AAAA,MACnB;AAAA,IACF;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,cAAc,CAAC;AAAA,MACf,cAAc;AAAA,MACd,KAAK;AAAA,IACP;AAAA,EACF;AAEA,SAAO,MAAM,MAAM;AAAA,EAEnB,CAAC;AAED,QAAM,OAAO,MAAM;AACjB,QAAI;AACF,eAAS,QAAQ,CAAC,QAAQ,IAAI,KAAK,SAAS,CAAC;AAAA,IAC/C,QAAQ;AAAA,IAAC;AACT,eAAW,MAAM;AACf,UAAI;AACF,iBAAS,QAAQ,CAAC,QAAQ,IAAI,KAAK,SAAgB,CAAC;AAAA,MACtD,QAAQ;AAAA,MAAC;AAAA,IACX,GAAG,GAAI;AAAA,EACT;AAGA,QAAM,UAAU,MAAM,KAAK;AAC3B,UAAQ,GAAG,UAAU,OAAO;AAC5B,UAAQ,GAAG,WAAW,OAAO;AAC7B,UAAQ,GAAG,QAAQ,OAAO;AAE1B,SAAO,EAAE,MAAM,QAAQ,YAAY;AACrC;","names":["concurrently"]}
1
+ {"version":3,"file":"runParallel.cjs","names":["delimiter","signalHandlers: { event: string; handler: (...args: any[]) => void }[]"],"sources":["../../../src/utils/runParallel.ts"],"sourcesContent":["import { spawn } from 'node:child_process';\nimport { delimiter, join } from 'node:path';\n\nexport type ParallelHandle = {\n kill: () => void;\n result: Promise<any>;\n commandText: string;\n};\n\n/**\n * Start a cross-platform parallel process without external deps.\n * Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).\n */\nexport const runParallel = (proc?: string | string[]): ParallelHandle => {\n if (!proc || (Array.isArray(proc) && proc.length === 0))\n throw new Error('Invalid command');\n\n const commandText = Array.isArray(proc) ? proc.join(' ') : proc;\n\n const isArray = Array.isArray(proc);\n const command = isArray ? (proc as string[])[0] : commandText;\n const args = isArray ? (proc as string[]).slice(1) : [];\n\n // Ensure local binaries (node_modules/.bin) are resolvable\n const cwdBin = join(process.cwd(), 'node_modules', '.bin');\n const PATH_KEY =\n Object.keys(process.env).find((k) => k.toLowerCase() === 'path') ?? 'PATH';\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n\n // Prefer explicit shell invocation for string commands for Bun/mac compatibility\n const child = isArray\n ? // If provided as a single string element that includes spaces, treat it like a shell command\n args.length === 0 && /\\s/.test(command)\n ? isWin\n ? spawn(process.env.ComSpec ?? 'cmd.exe', ['/d', '/s', '/c', command], {\n cwd: process.cwd(),\n stdio: 'inherit',\n shell: false,\n detached: false,\n env: childEnv,\n })\n : spawn(process.env.SHELL ?? '/bin/bash', ['-lc', command], {\n cwd: process.cwd(),\n stdio: 'inherit',\n shell: false,\n detached: false,\n env: childEnv,\n })\n : spawn(command, args, {\n cwd: process.cwd(),\n stdio: 'inherit',\n shell: false,\n detached: false,\n env: childEnv,\n })\n : isWin\n ? spawn(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', commandText],\n {\n cwd: process.cwd(),\n stdio: 'inherit',\n shell: false,\n detached: false,\n env: childEnv,\n }\n )\n : spawn(process.env.SHELL ?? '/bin/bash', ['-lc', commandText], {\n cwd: process.cwd(),\n stdio: 'inherit',\n shell: false,\n detached: false,\n env: childEnv,\n });\n\n let terminated = false;\n\n const terminateTree = (signal: NodeJS.Signals = 'SIGTERM') => {\n if (terminated) return;\n terminated = true;\n\n try {\n if (process.platform === 'win32') {\n // Kill the whole tree on Windows\n spawn('taskkill', ['/PID', String(child.pid), '/T', '/F']);\n } else {\n // Send signal to child; shell should forward to its children\n if (child.pid)\n try {\n process.kill(child.pid, signal);\n } catch {}\n }\n } catch {}\n\n // Escalate after grace period if still alive\n setTimeout(() => {\n try {\n if (process.platform === 'win32') {\n spawn('taskkill', ['/PID', String(child.pid), '/T', '/F']);\n } else if (child.pid) {\n try {\n process.kill(child.pid, 'SIGKILL');\n } catch {}\n }\n } catch {}\n }, 5000);\n };\n\n const result = new Promise<void>((resolve, reject) => {\n child.on('error', (err) => {\n try {\n console.error(\n `[runParallel] Failed to start: ${err?.message ?? String(err)}`\n );\n } catch {}\n reject(err);\n });\n child.on('exit', (code, signal) => {\n // Clean up listeners upon child exit\n signalHandlers.forEach(({ event, handler }) => {\n process.off(event as any, handler as any);\n });\n if (code === 0) resolve();\n else\n reject(\n Object.assign(new Error('Parallel process failed'), { code, signal })\n );\n });\n });\n\n const cleanup = () => terminateTree('SIGTERM');\n\n const signalHandlers: { event: string; handler: (...args: any[]) => void }[] =\n [\n { event: 'SIGINT', handler: cleanup },\n { event: 'SIGTERM', handler: cleanup },\n { event: 'SIGQUIT', handler: cleanup },\n { event: 'SIGHUP', handler: cleanup },\n { event: 'beforeExit', handler: cleanup },\n { event: 'exit', handler: cleanup },\n {\n event: 'uncaughtException',\n handler: () => {\n cleanup();\n },\n },\n {\n event: 'unhandledRejection',\n handler: () => {\n cleanup();\n },\n },\n ];\n\n signalHandlers.forEach(({ event, handler }) => {\n process.on(event as any, handler as any);\n });\n\n const kill = () => terminateTree('SIGTERM');\n\n return { kill, result, commandText };\n};\n"],"mappings":";;;;;;;;;;;AAaA,MAAa,eAAe,SAA6C;AACvE,KAAI,CAAC,QAAS,MAAM,QAAQ,KAAK,IAAI,KAAK,WAAW,EACnD,OAAM,IAAI,MAAM,kBAAkB;CAEpC,MAAM,cAAc,MAAM,QAAQ,KAAK,GAAG,KAAK,KAAK,IAAI,GAAG;CAE3D,MAAM,UAAU,MAAM,QAAQ,KAAK;CACnC,MAAM,UAAU,UAAW,KAAkB,KAAK;CAClD,MAAM,OAAO,UAAW,KAAkB,MAAM,EAAE,GAAG,EAAE;CAGvD,MAAM,6BAAc,QAAQ,KAAK,EAAE,gBAAgB,OAAO;CAC1D,MAAM,WACJ,OAAO,KAAK,QAAQ,IAAI,CAAC,MAAM,MAAM,EAAE,aAAa,KAAK,OAAO,IAAI;CACtE,MAAM,eAAe,CAAC,QAAQ,QAAQ,IAAI,aAAa,GAAG,CACvD,OAAO,QAAQ,CACf,KAAKA,oBAAU;CAClB,MAAM,WAAW;EACf,GAAG,QAAQ;GACV,WAAW;EACb;CAED,MAAM,QAAQ,QAAQ,aAAa;CAGnC,MAAM,QAAQ,UAEV,KAAK,WAAW,KAAK,KAAK,KAAK,QAAQ,GACrC,sCACQ,QAAQ,IAAI,WAAW,WAAW;EAAC;EAAM;EAAM;EAAM;EAAQ,EAAE;EACnE,KAAK,QAAQ,KAAK;EAClB,OAAO;EACP,OAAO;EACP,UAAU;EACV,KAAK;EACN,CAAC,iCACI,QAAQ,IAAI,SAAS,aAAa,CAAC,OAAO,QAAQ,EAAE;EACxD,KAAK,QAAQ,KAAK;EAClB,OAAO;EACP,OAAO;EACP,UAAU;EACV,KAAK;EACN,CAAC,iCACE,SAAS,MAAM;EACnB,KAAK,QAAQ,KAAK;EAClB,OAAO;EACP,OAAO;EACP,UAAU;EACV,KAAK;EACN,CAAC,GACJ,sCAEI,QAAQ,IAAI,WAAW,WACvB;EAAC;EAAM;EAAM;EAAM;EAAY,EAC/B;EACE,KAAK,QAAQ,KAAK;EAClB,OAAO;EACP,OAAO;EACP,UAAU;EACV,KAAK;EACN,CACF,iCACK,QAAQ,IAAI,SAAS,aAAa,CAAC,OAAO,YAAY,EAAE;EAC5D,KAAK,QAAQ,KAAK;EAClB,OAAO;EACP,OAAO;EACP,UAAU;EACV,KAAK;EACN,CAAC;CAER,IAAI,aAAa;CAEjB,MAAM,iBAAiB,SAAyB,cAAc;AAC5D,MAAI,WAAY;AAChB,eAAa;AAEb,MAAI;AACF,OAAI,QAAQ,aAAa,QAEvB,+BAAM,YAAY;IAAC;IAAQ,OAAO,MAAM,IAAI;IAAE;IAAM;IAAK,CAAC;YAGtD,MAAM,IACR,KAAI;AACF,YAAQ,KAAK,MAAM,KAAK,OAAO;WACzB;UAEN;AAGR,mBAAiB;AACf,OAAI;AACF,QAAI,QAAQ,aAAa,QACvB,+BAAM,YAAY;KAAC;KAAQ,OAAO,MAAM,IAAI;KAAE;KAAM;KAAK,CAAC;aACjD,MAAM,IACf,KAAI;AACF,aAAQ,KAAK,MAAM,KAAK,UAAU;YAC5B;WAEJ;KACP,IAAK;;CAGV,MAAM,SAAS,IAAI,SAAe,SAAS,WAAW;AACpD,QAAM,GAAG,UAAU,QAAQ;AACzB,OAAI;AACF,YAAQ,MACN,kCAAkC,KAAK,WAAW,OAAO,IAAI,GAC9D;WACK;AACR,UAAO,IAAI;IACX;AACF,QAAM,GAAG,SAAS,MAAM,WAAW;AAEjC,kBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,YAAQ,IAAI,OAAc,QAAe;KACzC;AACF,OAAI,SAAS,EAAG,UAAS;OAEvB,QACE,OAAO,uBAAO,IAAI,MAAM,0BAA0B,EAAE;IAAE;IAAM;IAAQ,CAAC,CACtE;IACH;GACF;CAEF,MAAM,gBAAgB,cAAc,UAAU;CAE9C,MAAMC,iBACJ;EACE;GAAE,OAAO;GAAU,SAAS;GAAS;EACrC;GAAE,OAAO;GAAW,SAAS;GAAS;EACtC;GAAE,OAAO;GAAW,SAAS;GAAS;EACtC;GAAE,OAAO;GAAU,SAAS;GAAS;EACrC;GAAE,OAAO;GAAc,SAAS;GAAS;EACzC;GAAE,OAAO;GAAQ,SAAS;GAAS;EACnC;GACE,OAAO;GACP,eAAe;AACb,aAAS;;GAEZ;EACD;GACE,OAAO;GACP,eAAe;AACb,aAAS;;GAEZ;EACF;AAEH,gBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,UAAQ,GAAG,OAAc,QAAe;GACxC;CAEF,MAAM,aAAa,cAAc,UAAU;AAE3C,QAAO;EAAE;EAAM;EAAQ;EAAa"}
@@ -1,29 +1,7 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var sortAlphabetically_exports = {};
20
- __export(sortAlphabetically_exports, {
21
- sortAlphabetically: () => sortAlphabetically
22
- });
23
- module.exports = __toCommonJS(sortAlphabetically_exports);
1
+
2
+ //#region src/utils/sortAlphabetically.ts
24
3
  const sortAlphabetically = (a, b) => a.localeCompare(b);
25
- // Annotate the CommonJS export names for ESM import in node:
26
- 0 && (module.exports = {
27
- sortAlphabetically
28
- });
4
+
5
+ //#endregion
6
+ exports.sortAlphabetically = sortAlphabetically;
29
7
  //# sourceMappingURL=sortAlphabetically.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/sortAlphabetically.ts"],"sourcesContent":["export const sortAlphabetically = (a: string, b: string) => a.localeCompare(b);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,qBAAqB,CAAC,GAAW,MAAc,EAAE,cAAc,CAAC;","names":[]}
1
+ {"version":3,"file":"sortAlphabetically.cjs","names":[],"sources":["../../../src/utils/sortAlphabetically.ts"],"sourcesContent":["export const sortAlphabetically = (a: string, b: string) => a.localeCompare(b);\n"],"mappings":";;AAAA,MAAa,sBAAsB,GAAW,MAAc,EAAE,cAAc,EAAE"}
@@ -0,0 +1,11 @@
1
+
2
+ //#region src/utils/splitTextByLine.ts
3
+ const splitTextByLines = (text) => {
4
+ const splittedText = text.match(/[^\n]*\n|[^\n]*$/g) ?? [];
5
+ if (splittedText.length > 0 && splittedText.at(-1) === "") splittedText.pop();
6
+ return splittedText;
7
+ };
8
+
9
+ //#endregion
10
+ exports.splitTextByLines = splitTextByLines;
11
+ //# sourceMappingURL=splitTextByLine.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splitTextByLine.cjs","names":[],"sources":["../../../src/utils/splitTextByLine.ts"],"sourcesContent":["export const splitTextByLines = (text: string): string[] => {\n const splittedText = text.match(/[^\\n]*\\n|[^\\n]*$/g) ?? [];\n\n if (splittedText.length > 0 && splittedText.at(-1) === '') {\n splittedText.pop();\n }\n\n return splittedText;\n};\n"],"mappings":";;AAAA,MAAa,oBAAoB,SAA2B;CAC1D,MAAM,eAAe,KAAK,MAAM,oBAAoB,IAAI,EAAE;AAE1D,KAAI,aAAa,SAAS,KAAK,aAAa,GAAG,GAAG,KAAK,GACrD,cAAa,KAAK;AAGpB,QAAO"}
@@ -0,0 +1,54 @@
1
+
2
+ //#region src/utils/verifyIdenticObjectFormat copy.ts
3
+ /**
4
+ * Verifies that two objects have identical structure (same keys, array lengths, and types)
5
+ * but not necessarily the same values.
6
+ * Useful for validating translations maintain the same format as the original.
7
+ *
8
+ * @param object - The object to verify
9
+ * @param expectedFormat - The expected format to compare against
10
+ * @param path - Current path in the object tree (for error messages)
11
+ * @returns true if structures match, throws error with details if they don't
12
+ */
13
+ const verifyIdenticObjectFormat = (object, expectedFormat, path = "root") => {
14
+ if (expectedFormat === null || expectedFormat === void 0) {
15
+ if (expectedFormat !== object) return {
16
+ isIdentic: false,
17
+ error: `Type mismatch at ${path}: expected ${expectedFormat === null ? "null" : "undefined"}, got ${object === null ? "null" : typeof object}`
18
+ };
19
+ return { isIdentic: true };
20
+ }
21
+ const expectedType = Array.isArray(expectedFormat) ? "array" : typeof expectedFormat;
22
+ const objectType = Array.isArray(object) ? "array" : typeof object;
23
+ if (expectedType !== objectType) return {
24
+ isIdentic: false,
25
+ error: `Type mismatch at ${path}: expected ${expectedType}, got ${objectType}`
26
+ };
27
+ if (Array.isArray(expectedFormat) && Array.isArray(object)) {
28
+ if (expectedFormat.length !== object.length) return {
29
+ isIdentic: false,
30
+ error: `Array length mismatch at ${path}: expected ${expectedFormat.length} elements, got ${object.length}`
31
+ };
32
+ for (let i = 0; i < expectedFormat.length; i++) verifyIdenticObjectFormat(object[i], expectedFormat[i], `${path}[${i}]`);
33
+ return { isIdentic: true };
34
+ }
35
+ if (typeof expectedFormat === "object" && typeof object === "object" && expectedFormat !== null && object !== null) {
36
+ const expectedKeys = Object.keys(expectedFormat);
37
+ const objectKeys = Object.keys(object);
38
+ if (expectedKeys.length !== objectKeys.length) return {
39
+ isIdentic: false,
40
+ error: `Object keys count mismatch at ${path}: expected ${expectedKeys.length} keys, got ${objectKeys.length}`
41
+ };
42
+ for (let i = 0; i < expectedKeys.length; i++) if (expectedKeys[i] !== objectKeys[i]) return {
43
+ isIdentic: false,
44
+ error: `Object keys mismatch at ${path}: expected key "${expectedKeys[i]}" at position ${i}, got "${objectKeys[i]}"`
45
+ };
46
+ for (const key of expectedKeys) verifyIdenticObjectFormat(object[key], expectedFormat[key], `${path}.${key}`);
47
+ return { isIdentic: true };
48
+ }
49
+ return { isIdentic: true };
50
+ };
51
+
52
+ //#endregion
53
+ exports.verifyIdenticObjectFormat = verifyIdenticObjectFormat;
54
+ //# sourceMappingURL=verifyIdenticObjectFormat copy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyIdenticObjectFormat copy.cjs","names":[],"sources":["../../../src/utils/verifyIdenticObjectFormat copy.ts"],"sourcesContent":["type FlatType = string | number | boolean | object | null | undefined;\n\ntype RecursiveType =\n | FlatType\n | { [key: string]: RecursiveType }\n | Array<RecursiveType>;\n\ntype VerifyIdenticObjectFormatResult = {\n isIdentic: boolean;\n error?: string;\n};\n\n/**\n * Verifies that two objects have identical structure (same keys, array lengths, and types)\n * but not necessarily the same values.\n * Useful for validating translations maintain the same format as the original.\n *\n * @param object - The object to verify\n * @param expectedFormat - The expected format to compare against\n * @param path - Current path in the object tree (for error messages)\n * @returns true if structures match, throws error with details if they don't\n */\nexport const verifyIdenticObjectFormat = (\n object: RecursiveType,\n expectedFormat: RecursiveType,\n path: string = 'root'\n): VerifyIdenticObjectFormatResult => {\n // Check if both are null or undefined\n if (expectedFormat === null || expectedFormat === undefined) {\n if (expectedFormat !== object) {\n return {\n isIdentic: false,\n error: `Type mismatch at ${path}: expected ${expectedFormat === null ? 'null' : 'undefined'}, got ${object === null ? 'null' : typeof object}`,\n };\n }\n return {\n isIdentic: true,\n };\n }\n\n // Get the type of both values\n const expectedType = Array.isArray(expectedFormat)\n ? 'array'\n : typeof expectedFormat;\n const objectType = Array.isArray(object) ? 'array' : typeof object;\n\n // Check if types match\n if (expectedType !== objectType) {\n return {\n isIdentic: false,\n error: `Type mismatch at ${path}: expected ${expectedType}, got ${objectType}`,\n };\n }\n\n // Handle arrays\n if (Array.isArray(expectedFormat) && Array.isArray(object)) {\n if (expectedFormat.length !== object.length) {\n return {\n isIdentic: false,\n error: `Array length mismatch at ${path}: expected ${expectedFormat.length} elements, got ${object.length}`,\n };\n }\n\n // Recursively check each element\n for (let i = 0; i < expectedFormat.length; i++) {\n verifyIdenticObjectFormat(object[i], expectedFormat[i], `${path}[${i}]`);\n }\n\n return {\n isIdentic: true,\n };\n }\n\n // Handle objects (excluding null and arrays)\n if (\n typeof expectedFormat === 'object' &&\n typeof object === 'object' &&\n expectedFormat !== null &&\n object !== null\n ) {\n const expectedKeys = Object.keys(expectedFormat);\n const objectKeys = Object.keys(object);\n\n // Check if number of keys match\n if (expectedKeys.length !== objectKeys.length) {\n return {\n isIdentic: false,\n error: `Object keys count mismatch at ${path}: expected ${expectedKeys.length} keys, got ${objectKeys.length}`,\n };\n }\n\n // Check if keys match and are in the same order\n for (let i = 0; i < expectedKeys.length; i++) {\n if (expectedKeys[i] !== objectKeys[i]) {\n return {\n isIdentic: false,\n error: `Object keys mismatch at ${path}: expected key \"${expectedKeys[i]}\" at position ${i}, got \"${objectKeys[i]}\"`,\n };\n }\n }\n\n // Recursively check each property\n for (const key of expectedKeys) {\n verifyIdenticObjectFormat(\n (object as Record<string, RecursiveType>)[key],\n (expectedFormat as Record<string, RecursiveType>)[key],\n `${path}.${key}`\n );\n }\n\n return {\n isIdentic: true,\n };\n }\n\n // For primitive types (string, number, boolean), just verify they're the same type\n // We don't check the actual values as per requirements\n return {\n isIdentic: true,\n };\n};\n"],"mappings":";;;;;;;;;;;;AAsBA,MAAa,6BACX,QACA,gBACA,OAAe,WACqB;AAEpC,KAAI,mBAAmB,QAAQ,mBAAmB,QAAW;AAC3D,MAAI,mBAAmB,OACrB,QAAO;GACL,WAAW;GACX,OAAO,oBAAoB,KAAK,aAAa,mBAAmB,OAAO,SAAS,YAAY,QAAQ,WAAW,OAAO,SAAS,OAAO;GACvI;AAEH,SAAO,EACL,WAAW,MACZ;;CAIH,MAAM,eAAe,MAAM,QAAQ,eAAe,GAC9C,UACA,OAAO;CACX,MAAM,aAAa,MAAM,QAAQ,OAAO,GAAG,UAAU,OAAO;AAG5D,KAAI,iBAAiB,WACnB,QAAO;EACL,WAAW;EACX,OAAO,oBAAoB,KAAK,aAAa,aAAa,QAAQ;EACnE;AAIH,KAAI,MAAM,QAAQ,eAAe,IAAI,MAAM,QAAQ,OAAO,EAAE;AAC1D,MAAI,eAAe,WAAW,OAAO,OACnC,QAAO;GACL,WAAW;GACX,OAAO,4BAA4B,KAAK,aAAa,eAAe,OAAO,iBAAiB,OAAO;GACpG;AAIH,OAAK,IAAI,IAAI,GAAG,IAAI,eAAe,QAAQ,IACzC,2BAA0B,OAAO,IAAI,eAAe,IAAI,GAAG,KAAK,GAAG,EAAE,GAAG;AAG1E,SAAO,EACL,WAAW,MACZ;;AAIH,KACE,OAAO,mBAAmB,YAC1B,OAAO,WAAW,YAClB,mBAAmB,QACnB,WAAW,MACX;EACA,MAAM,eAAe,OAAO,KAAK,eAAe;EAChD,MAAM,aAAa,OAAO,KAAK,OAAO;AAGtC,MAAI,aAAa,WAAW,WAAW,OACrC,QAAO;GACL,WAAW;GACX,OAAO,iCAAiC,KAAK,aAAa,aAAa,OAAO,aAAa,WAAW;GACvG;AAIH,OAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,IACvC,KAAI,aAAa,OAAO,WAAW,GACjC,QAAO;GACL,WAAW;GACX,OAAO,2BAA2B,KAAK,kBAAkB,aAAa,GAAG,gBAAgB,EAAE,SAAS,WAAW,GAAG;GACnH;AAKL,OAAK,MAAM,OAAO,aAChB,2BACG,OAAyC,MACzC,eAAiD,MAClD,GAAG,KAAK,GAAG,MACZ;AAGH,SAAO,EACL,WAAW,MACZ;;AAKH,QAAO,EACL,WAAW,MACZ"}
@@ -0,0 +1,60 @@
1
+
2
+ //#region src/utils/verifyIdenticObjectFormat.ts
3
+ /**
4
+ * Verifies that two objects have identical structure (same keys, array lengths, and types)
5
+ * but not necessarily the same values.
6
+ * Useful for validating translations maintain the same format as the original.
7
+ *
8
+ * @param object - The object to verify
9
+ * @param expectedFormat - The expected format to compare against
10
+ * @param path - Current path in the object tree (for error messages)
11
+ * @returns true if structures match, throws error with details if they don't
12
+ */
13
+ const verifyIdenticObjectFormat = (object, expectedFormat, path = "root") => {
14
+ if (expectedFormat === null || expectedFormat === void 0) {
15
+ if (expectedFormat !== object) return {
16
+ isIdentic: false,
17
+ error: `Type mismatch at ${path}: expected ${expectedFormat === null ? "null" : "undefined"}, got ${object === null ? "null" : typeof object}`
18
+ };
19
+ return { isIdentic: true };
20
+ }
21
+ const expectedType = Array.isArray(expectedFormat) ? "array" : typeof expectedFormat;
22
+ const objectType = Array.isArray(object) ? "array" : typeof object;
23
+ if (expectedType !== objectType) return {
24
+ isIdentic: false,
25
+ error: `Type mismatch at ${path}: expected ${expectedType}, got ${objectType}`
26
+ };
27
+ if (Array.isArray(expectedFormat) && Array.isArray(object)) {
28
+ if (expectedFormat.length !== object.length) return {
29
+ isIdentic: false,
30
+ error: `Array length mismatch at ${path}: expected ${expectedFormat.length} elements, got ${object.length}`
31
+ };
32
+ for (let i = 0; i < expectedFormat.length; i++) {
33
+ const result = verifyIdenticObjectFormat(object[i], expectedFormat[i], `${path}[${i}]`);
34
+ if (!result.isIdentic) return result;
35
+ }
36
+ return { isIdentic: true };
37
+ }
38
+ if (typeof expectedFormat === "object" && typeof object === "object" && expectedFormat !== null && object !== null) {
39
+ const expectedKeys = Object.keys(expectedFormat);
40
+ const objectKeys = Object.keys(object);
41
+ if (expectedKeys.length !== objectKeys.length) return {
42
+ isIdentic: false,
43
+ error: `Object keys count mismatch at ${path}: expected ${expectedKeys.length} keys, got ${objectKeys.length}`
44
+ };
45
+ for (let i = 0; i < expectedKeys.length; i++) if (expectedKeys[i] !== objectKeys[i]) return {
46
+ isIdentic: false,
47
+ error: `Object keys mismatch at ${path}: expected key "${expectedKeys[i]}" at position ${i}, got "${objectKeys[i]}"`
48
+ };
49
+ for (const key of expectedKeys) {
50
+ const result = verifyIdenticObjectFormat(object[key], expectedFormat[key], `${path}.${key}`);
51
+ if (!result.isIdentic) return result;
52
+ }
53
+ return { isIdentic: true };
54
+ }
55
+ return { isIdentic: true };
56
+ };
57
+
58
+ //#endregion
59
+ exports.verifyIdenticObjectFormat = verifyIdenticObjectFormat;
60
+ //# sourceMappingURL=verifyIdenticObjectFormat.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verifyIdenticObjectFormat.cjs","names":[],"sources":["../../../src/utils/verifyIdenticObjectFormat.ts"],"sourcesContent":["type FlatType = string | number | boolean | object | null | undefined;\n\ntype RecursiveType =\n | FlatType\n | { [key: string]: RecursiveType }\n | Array<RecursiveType>;\n\ntype VerifyIdenticObjectFormatResult = {\n isIdentic: boolean;\n error?: string;\n};\n\n/**\n * Verifies that two objects have identical structure (same keys, array lengths, and types)\n * but not necessarily the same values.\n * Useful for validating translations maintain the same format as the original.\n *\n * @param object - The object to verify\n * @param expectedFormat - The expected format to compare against\n * @param path - Current path in the object tree (for error messages)\n * @returns true if structures match, throws error with details if they don't\n */\nexport const verifyIdenticObjectFormat = (\n object: RecursiveType,\n expectedFormat: RecursiveType,\n path: string = 'root'\n): VerifyIdenticObjectFormatResult => {\n // Check if both are null or undefined\n if (expectedFormat === null || expectedFormat === undefined) {\n if (expectedFormat !== object) {\n return {\n isIdentic: false,\n error: `Type mismatch at ${path}: expected ${expectedFormat === null ? 'null' : 'undefined'}, got ${object === null ? 'null' : typeof object}`,\n };\n }\n return {\n isIdentic: true,\n };\n }\n\n // Get the type of both values\n const expectedType = Array.isArray(expectedFormat)\n ? 'array'\n : typeof expectedFormat;\n const objectType = Array.isArray(object) ? 'array' : typeof object;\n\n // Check if types match\n if (expectedType !== objectType) {\n return {\n isIdentic: false,\n error: `Type mismatch at ${path}: expected ${expectedType}, got ${objectType}`,\n };\n }\n\n // Handle arrays\n if (Array.isArray(expectedFormat) && Array.isArray(object)) {\n if (expectedFormat.length !== object.length) {\n return {\n isIdentic: false,\n error: `Array length mismatch at ${path}: expected ${expectedFormat.length} elements, got ${object.length}`,\n };\n }\n\n // Recursively check each element\n for (let i = 0; i < expectedFormat.length; i++) {\n const result = verifyIdenticObjectFormat(\n object[i],\n expectedFormat[i],\n `${path}[${i}]`\n );\n if (!result.isIdentic) {\n return result;\n }\n }\n\n return {\n isIdentic: true,\n };\n }\n\n // Handle objects (excluding null and arrays)\n if (\n typeof expectedFormat === 'object' &&\n typeof object === 'object' &&\n expectedFormat !== null &&\n object !== null\n ) {\n const expectedKeys = Object.keys(expectedFormat);\n const objectKeys = Object.keys(object);\n\n // Check if number of keys match\n if (expectedKeys.length !== objectKeys.length) {\n return {\n isIdentic: false,\n error: `Object keys count mismatch at ${path}: expected ${expectedKeys.length} keys, got ${objectKeys.length}`,\n };\n }\n\n // Check if keys match and are in the same order\n for (let i = 0; i < expectedKeys.length; i++) {\n if (expectedKeys[i] !== objectKeys[i]) {\n return {\n isIdentic: false,\n error: `Object keys mismatch at ${path}: expected key \"${expectedKeys[i]}\" at position ${i}, got \"${objectKeys[i]}\"`,\n };\n }\n }\n\n // Recursively check each property\n for (const key of expectedKeys) {\n const result = verifyIdenticObjectFormat(\n (object as Record<string, RecursiveType>)[key],\n (expectedFormat as Record<string, RecursiveType>)[key],\n `${path}.${key}`\n );\n if (!result.isIdentic) {\n return result;\n }\n }\n\n return {\n isIdentic: true,\n };\n }\n\n // For primitive types (string, number, boolean), just verify they're the same type\n // We don't check the actual values as per requirements\n return {\n isIdentic: true,\n };\n};\n"],"mappings":";;;;;;;;;;;;AAsBA,MAAa,6BACX,QACA,gBACA,OAAe,WACqB;AAEpC,KAAI,mBAAmB,QAAQ,mBAAmB,QAAW;AAC3D,MAAI,mBAAmB,OACrB,QAAO;GACL,WAAW;GACX,OAAO,oBAAoB,KAAK,aAAa,mBAAmB,OAAO,SAAS,YAAY,QAAQ,WAAW,OAAO,SAAS,OAAO;GACvI;AAEH,SAAO,EACL,WAAW,MACZ;;CAIH,MAAM,eAAe,MAAM,QAAQ,eAAe,GAC9C,UACA,OAAO;CACX,MAAM,aAAa,MAAM,QAAQ,OAAO,GAAG,UAAU,OAAO;AAG5D,KAAI,iBAAiB,WACnB,QAAO;EACL,WAAW;EACX,OAAO,oBAAoB,KAAK,aAAa,aAAa,QAAQ;EACnE;AAIH,KAAI,MAAM,QAAQ,eAAe,IAAI,MAAM,QAAQ,OAAO,EAAE;AAC1D,MAAI,eAAe,WAAW,OAAO,OACnC,QAAO;GACL,WAAW;GACX,OAAO,4BAA4B,KAAK,aAAa,eAAe,OAAO,iBAAiB,OAAO;GACpG;AAIH,OAAK,IAAI,IAAI,GAAG,IAAI,eAAe,QAAQ,KAAK;GAC9C,MAAM,SAAS,0BACb,OAAO,IACP,eAAe,IACf,GAAG,KAAK,GAAG,EAAE,GACd;AACD,OAAI,CAAC,OAAO,UACV,QAAO;;AAIX,SAAO,EACL,WAAW,MACZ;;AAIH,KACE,OAAO,mBAAmB,YAC1B,OAAO,WAAW,YAClB,mBAAmB,QACnB,WAAW,MACX;EACA,MAAM,eAAe,OAAO,KAAK,eAAe;EAChD,MAAM,aAAa,OAAO,KAAK,OAAO;AAGtC,MAAI,aAAa,WAAW,WAAW,OACrC,QAAO;GACL,WAAW;GACX,OAAO,iCAAiC,KAAK,aAAa,aAAa,OAAO,aAAa,WAAW;GACvG;AAIH,OAAK,IAAI,IAAI,GAAG,IAAI,aAAa,QAAQ,IACvC,KAAI,aAAa,OAAO,WAAW,GACjC,QAAO;GACL,WAAW;GACX,OAAO,2BAA2B,KAAK,kBAAkB,aAAa,GAAG,gBAAgB,EAAE,SAAS,WAAW,GAAG;GACnH;AAKL,OAAK,MAAM,OAAO,cAAc;GAC9B,MAAM,SAAS,0BACZ,OAAyC,MACzC,eAAiD,MAClD,GAAG,KAAK,GAAG,MACZ;AACD,OAAI,CAAC,OAAO,UACV,QAAO;;AAIX,SAAO,EACL,WAAW,MACZ;;AAKH,QAAO,EACL,WAAW,MACZ"}
@@ -1,89 +1,67 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var watcher_exports = {};
20
- __export(watcher_exports, {
21
- buildAndWatchIntlayer: () => buildAndWatchIntlayer,
22
- watch: () => watch
23
- });
24
- module.exports = __toCommonJS(watcher_exports);
25
- var import_config = require("@intlayer/config");
26
- var import_chokidar = require("chokidar");
27
- var import_path = require("path");
28
- var import_handleAdditionalContentDeclarationFile = require('./handleAdditionalContentDeclarationFile.cjs');
29
- var import_handleContentDeclarationFileChange = require('./handleContentDeclarationFileChange.cjs');
30
- var import_handleUnlikedContentDeclarationFile = require('./handleUnlikedContentDeclarationFile.cjs');
31
- var import_prepareIntlayer = require('./prepareIntlayer.cjs');
1
+ const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
2
+ const require_handleAdditionalContentDeclarationFile = require('./handleAdditionalContentDeclarationFile.cjs');
3
+ const require_handleContentDeclarationFileChange = require('./handleContentDeclarationFileChange.cjs');
4
+ const require_handleUnlinkedContentDeclarationFile = require('./handleUnlinkedContentDeclarationFile.cjs');
5
+ const require_prepareIntlayer = require('./prepareIntlayer.cjs');
6
+ let __intlayer_config = require("@intlayer/config");
7
+ __intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
8
+ let node_path = require("node:path");
9
+ node_path = require_rolldown_runtime.__toESM(node_path);
10
+ let chokidar = require("chokidar");
11
+ chokidar = require_rolldown_runtime.__toESM(chokidar);
12
+
13
+ //#region src/watcher.ts
32
14
  const recentlyAddedFiles = /* @__PURE__ */ new Set();
33
15
  const watch = (options) => {
34
- const configuration = options?.configuration ?? (0, import_config.getConfiguration)(options?.configOptions);
35
- const appLogger = (0, import_config.getAppLogger)(configuration);
36
- const { watch: isWatchMode, watchedFilesPatternWithPath } = configuration.content;
37
- return (0, import_chokidar.watch)(watchedFilesPatternWithPath, {
38
- persistent: isWatchMode,
39
- // Make the watcher persistent
40
- ignoreInitial: true,
41
- // Process existing files
42
- awaitWriteFinish: {
43
- stabilityThreshold: 1e3,
44
- pollInterval: 100
45
- },
46
- ...options
47
- }).on("add", async (filePath) => {
48
- const fileName = (0, import_path.basename)(filePath);
49
- recentlyAddedFiles.add(fileName);
50
- console.log("add", filePath);
51
- await (0, import_handleAdditionalContentDeclarationFile.handleAdditionalContentDeclarationFile)(filePath, configuration);
52
- setTimeout(() => recentlyAddedFiles.delete(fileName), 1e3);
53
- }).on(
54
- "change",
55
- async (filePath) => await (0, import_handleContentDeclarationFileChange.handleContentDeclarationFileChange)(filePath, configuration)
56
- ).on("unlink", async (filePath) => {
57
- setTimeout(async () => {
58
- const fileName = (0, import_path.basename)(filePath);
59
- if (recentlyAddedFiles.has(fileName)) {
60
- return;
61
- }
62
- await (0, import_handleUnlikedContentDeclarationFile.handleUnlikedContentDeclarationFile)(filePath, configuration);
63
- }, 300);
64
- }).on("error", async (error) => {
65
- appLogger("Watcher error: " + error, {
66
- level: "error"
67
- });
68
- appLogger("Restarting watcher");
69
- await (0, import_prepareIntlayer.prepareIntlayer)(configuration);
70
- });
16
+ const configuration = options?.configuration ?? (0, __intlayer_config.getConfiguration)(options?.configOptions);
17
+ const appLogger = (0, __intlayer_config.getAppLogger)(configuration);
18
+ const { watch: isWatchMode, watchedFilesPatternWithPath } = configuration.content;
19
+ /** @ts-ignore remove error Expected 0-1 arguments, but got 2. */
20
+ return (0, chokidar.watch)(watchedFilesPatternWithPath, {
21
+ persistent: isWatchMode,
22
+ ignoreInitial: true,
23
+ awaitWriteFinish: {
24
+ stabilityThreshold: 1e3,
25
+ pollInterval: 100
26
+ },
27
+ ignored: [
28
+ "**/node_modules/**",
29
+ "**/dist/**",
30
+ "**/build/**",
31
+ "**/.intlayer/**"
32
+ ],
33
+ ...options
34
+ }).on("add", async (filePath) => {
35
+ const fileName = (0, node_path.basename)(filePath);
36
+ recentlyAddedFiles.add(fileName);
37
+ await require_handleAdditionalContentDeclarationFile.handleAdditionalContentDeclarationFile(filePath, configuration);
38
+ setTimeout(() => recentlyAddedFiles.delete(fileName), 1e3);
39
+ }).on("change", async (filePath) => await require_handleContentDeclarationFileChange.handleContentDeclarationFileChange(filePath, configuration)).on("unlink", async (filePath) => {
40
+ setTimeout(async () => {
41
+ const fileName = (0, node_path.basename)(filePath);
42
+ if (recentlyAddedFiles.has(fileName)) return;
43
+ await require_handleUnlinkedContentDeclarationFile.handleUnlinkedContentDeclarationFile(filePath, configuration);
44
+ }, 300);
45
+ }).on("error", async (error) => {
46
+ appLogger(`Watcher error: ${error}`, { level: "error" });
47
+ appLogger("Restarting watcher");
48
+ await require_prepareIntlayer.prepareIntlayer(configuration);
49
+ });
71
50
  };
72
51
  const buildAndWatchIntlayer = async (options) => {
73
- const { skipPrepare, ...rest } = options ?? {};
74
- const configuration = options?.configuration ?? (0, import_config.getConfiguration)(options?.configOptions);
75
- if (!options?.skipPrepare) {
76
- await (0, import_prepareIntlayer.prepareIntlayer)(configuration);
77
- }
78
- if (configuration.content.watch || options?.persistent) {
79
- const appLogger = (0, import_config.getAppLogger)(configuration);
80
- appLogger("Watching Intlayer content declarations");
81
- watch({ ...rest, configuration });
82
- }
52
+ const { skipPrepare,...rest } = options ?? {};
53
+ const configuration = options?.configuration ?? (0, __intlayer_config.getConfiguration)(options?.configOptions);
54
+ if (!options?.skipPrepare) await require_prepareIntlayer.prepareIntlayer(configuration, { forceRun: true });
55
+ if (configuration.content.watch || options?.persistent) {
56
+ (0, __intlayer_config.getAppLogger)(configuration)("Watching Intlayer content declarations");
57
+ watch({
58
+ ...rest,
59
+ configuration
60
+ });
61
+ }
83
62
  };
84
- // Annotate the CommonJS export names for ESM import in node:
85
- 0 && (module.exports = {
86
- buildAndWatchIntlayer,
87
- watch
88
- });
63
+
64
+ //#endregion
65
+ exports.buildAndWatchIntlayer = buildAndWatchIntlayer;
66
+ exports.watch = watch;
89
67
  //# sourceMappingURL=watcher.cjs.map