@intlayer/chokidar 8.0.4 → 8.0.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 (231) hide show
  1. package/dist/assets/installSkills/skills/angular.md +40 -0
  2. package/dist/assets/installSkills/skills/astro.md +13 -0
  3. package/dist/assets/installSkills/skills/config.md +5 -0
  4. package/dist/assets/installSkills/skills/content.md +127 -0
  5. package/dist/assets/installSkills/skills/extra_action.md +6 -0
  6. package/dist/assets/installSkills/skills/next_js.md +35 -0
  7. package/dist/assets/installSkills/skills/react.md +18 -0
  8. package/dist/assets/installSkills/skills/remote_content.md +6 -0
  9. package/dist/assets/installSkills/skills/setup.md +25 -0
  10. package/dist/assets/installSkills/skills/svelte.md +17 -0
  11. package/dist/assets/installSkills/skills/usage.md +103 -0
  12. package/dist/assets/installSkills/skills/vue.md +27 -0
  13. package/dist/cjs/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -1
  14. package/dist/cjs/_virtual/_utils_asset.cjs +1 -1
  15. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +2 -1
  16. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
  17. package/dist/cjs/buildIntlayerDictionary/index.cjs +1 -0
  18. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +2 -1
  19. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
  20. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +2 -1
  21. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
  22. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +2 -1
  23. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
  24. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +2 -1
  25. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
  26. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +2 -1
  27. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
  28. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +3 -2
  29. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
  30. package/dist/cjs/cleanOutputDir.cjs +2 -1
  31. package/dist/cjs/cleanOutputDir.cjs.map +1 -1
  32. package/dist/cjs/cleanRemovedContentDeclaration.cjs +3 -2
  33. package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
  34. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +2 -1
  35. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
  36. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +2 -1
  37. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
  38. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +3 -2
  39. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
  40. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +3 -2
  41. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
  42. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +3 -2
  43. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
  44. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +3 -2
  45. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
  46. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +3 -2
  47. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
  48. package/dist/cjs/createDictionaryEntryPoint/index.cjs +1 -0
  49. package/dist/cjs/createType/createModuleAugmentation.cjs +3 -2
  50. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
  51. package/dist/cjs/createType/createType.cjs +2 -1
  52. package/dist/cjs/createType/createType.cjs.map +1 -1
  53. package/dist/cjs/createType/index.cjs +1 -0
  54. package/dist/cjs/fetchDistantDictionaries.cjs +2 -1
  55. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  56. package/dist/cjs/filterInvalidDictionaries.cjs +2 -1
  57. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
  58. package/dist/cjs/formatDictionary.cjs +2 -1
  59. package/dist/cjs/formatDictionary.cjs.map +1 -1
  60. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +2 -1
  61. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
  62. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +2 -1
  63. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
  64. package/dist/cjs/handleContentDeclarationFileChange.cjs +2 -1
  65. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
  66. package/dist/cjs/handleContentDeclarationFileMoved.cjs +2 -1
  67. package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
  68. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +2 -1
  69. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
  70. package/dist/cjs/index.cjs +5 -0
  71. package/dist/cjs/init/index.cjs +75 -9
  72. package/dist/cjs/init/index.cjs.map +1 -1
  73. package/dist/cjs/init/utils/configManipulation.cjs +165 -0
  74. package/dist/cjs/init/utils/configManipulation.cjs.map +1 -0
  75. package/dist/cjs/init/utils/fileSystem.cjs +2 -1
  76. package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
  77. package/dist/cjs/init/utils/index.cjs +4 -0
  78. package/dist/cjs/init/utils/jsonParser.cjs +1 -0
  79. package/dist/cjs/init/utils/jsonParser.cjs.map +1 -1
  80. package/dist/cjs/init/utils/tsConfig.cjs +2 -1
  81. package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
  82. package/dist/cjs/initConfig/index.cjs +2 -1
  83. package/dist/cjs/initConfig/index.cjs.map +1 -1
  84. package/dist/cjs/installSkills/index.cjs +65 -0
  85. package/dist/cjs/installSkills/index.cjs.map +1 -0
  86. package/dist/cjs/listDictionariesPath.cjs +3 -2
  87. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  88. package/dist/cjs/listGitFiles.cjs +4 -3
  89. package/dist/cjs/listGitFiles.cjs.map +1 -1
  90. package/dist/cjs/listProjects.cjs +4 -3
  91. package/dist/cjs/listProjects.cjs.map +1 -1
  92. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +2 -1
  93. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
  94. package/dist/cjs/loadDictionaries/index.cjs +1 -0
  95. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +2 -1
  96. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  97. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +2 -1
  98. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  99. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +2 -1
  100. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
  101. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +2 -1
  102. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
  103. package/dist/cjs/loadDictionaries/log.cjs +3 -2
  104. package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
  105. package/dist/cjs/prepareIntlayer.cjs +3 -2
  106. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  107. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +1 -0
  108. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
  109. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +2 -1
  110. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
  111. package/dist/cjs/transformFiles/extractDictionaryKey.cjs +2 -1
  112. package/dist/cjs/transformFiles/extractDictionaryKey.cjs.map +1 -1
  113. package/dist/cjs/transformFiles/index.cjs +1 -0
  114. package/dist/cjs/transformFiles/transformFiles.cjs +4 -3
  115. package/dist/cjs/transformFiles/transformFiles.cjs.map +1 -1
  116. package/dist/cjs/utils/autoDecorateContent.cjs +2 -1
  117. package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
  118. package/dist/cjs/utils/buildFilesList.cjs +3 -2
  119. package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
  120. package/dist/cjs/utils/chunkJSON.cjs +1 -0
  121. package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
  122. package/dist/cjs/utils/formatter.cjs +3 -2
  123. package/dist/cjs/utils/formatter.cjs.map +1 -1
  124. package/dist/cjs/utils/getChunk.cjs +1 -0
  125. package/dist/cjs/utils/getChunk.cjs.map +1 -1
  126. package/dist/cjs/utils/getComponentTransformPattern.cjs +6 -6
  127. package/dist/cjs/utils/getComponentTransformPattern.cjs.map +1 -1
  128. package/dist/cjs/utils/getFileHash.cjs +3 -2
  129. package/dist/cjs/utils/getFileHash.cjs.map +1 -1
  130. package/dist/cjs/utils/getFormatFromExtension.cjs +1 -0
  131. package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
  132. package/dist/cjs/utils/pLimit.cjs +1 -0
  133. package/dist/cjs/utils/pLimit.cjs.map +1 -1
  134. package/dist/cjs/utils/parallelize.cjs +1 -0
  135. package/dist/cjs/utils/parallelize.cjs.map +1 -1
  136. package/dist/cjs/utils/parallelizeGlobal.cjs +1 -0
  137. package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -1
  138. package/dist/cjs/utils/reduceObjectFormat.cjs +1 -0
  139. package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -1
  140. package/dist/cjs/utils/resolveObjectPromises.cjs +1 -0
  141. package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
  142. package/dist/cjs/utils/runOnce.cjs +3 -2
  143. package/dist/cjs/utils/runOnce.cjs.map +1 -1
  144. package/dist/cjs/utils/runParallel/bin.cjs +2 -1
  145. package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
  146. package/dist/cjs/utils/runParallel/bootstrap.cjs +1 -0
  147. package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -1
  148. package/dist/cjs/utils/runParallel/index.cjs +2 -1
  149. package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
  150. package/dist/cjs/utils/runParallel/pidTree.cjs +3 -2
  151. package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
  152. package/dist/cjs/utils/runParallel/ps.cjs +3 -2
  153. package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
  154. package/dist/cjs/utils/runParallel/runTask.cjs +2 -1
  155. package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
  156. package/dist/cjs/utils/runParallel/spawnPosix.cjs +2 -1
  157. package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
  158. package/dist/cjs/utils/runParallel/spawnWin32.cjs +2 -1
  159. package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
  160. package/dist/cjs/utils/runParallel/wmic.cjs +3 -2
  161. package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
  162. package/dist/cjs/utils/sortAlphabetically.cjs +1 -0
  163. package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
  164. package/dist/cjs/utils/splitTextByLine.cjs +1 -0
  165. package/dist/cjs/utils/splitTextByLine.cjs.map +1 -1
  166. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +1 -0
  167. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -1
  168. package/dist/cjs/watcher.cjs +2 -1
  169. package/dist/cjs/watcher.cjs.map +1 -1
  170. package/dist/cjs/writeConfiguration/index.cjs +2 -1
  171. package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
  172. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +1 -0
  173. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
  174. package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs +2 -1
  175. package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs.map +1 -1
  176. package/dist/cjs/writeContentDeclaration/index.cjs +1 -0
  177. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +2 -1
  178. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
  179. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +2 -1
  180. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
  181. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +2 -1
  182. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
  183. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +2 -1
  184. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  185. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +2 -1
  186. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  187. package/dist/cjs/writeFileIfChanged.cjs +2 -1
  188. package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
  189. package/dist/cjs/writeJsonIfChanged.cjs +1 -0
  190. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
  191. package/dist/esm/_virtual/{rolldown_runtime.mjs → _rolldown/runtime.mjs} +1 -1
  192. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +1 -1
  193. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
  194. package/dist/esm/index.mjs +2 -1
  195. package/dist/esm/init/index.mjs +74 -9
  196. package/dist/esm/init/index.mjs.map +1 -1
  197. package/dist/esm/init/utils/configManipulation.mjs +162 -0
  198. package/dist/esm/init/utils/configManipulation.mjs.map +1 -0
  199. package/dist/esm/init/utils/index.mjs +2 -1
  200. package/dist/esm/installSkills/index.mjs +60 -0
  201. package/dist/esm/installSkills/index.mjs.map +1 -0
  202. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +1 -1
  203. package/dist/esm/transformFiles/transformFiles.mjs +1 -1
  204. package/dist/esm/utils/getComponentTransformPattern.mjs +4 -4
  205. package/dist/esm/utils/getComponentTransformPattern.mjs.map +1 -1
  206. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +2 -2
  207. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
  208. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +3 -3
  209. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -1
  210. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +3 -3
  211. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
  212. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +2 -2
  213. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -1
  214. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts +2 -2
  215. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -1
  216. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +2 -2
  217. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -1
  218. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +2 -2
  219. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -1
  220. package/dist/types/index.d.ts +2 -1
  221. package/dist/types/init/index.d.ts.map +1 -1
  222. package/dist/types/init/utils/configManipulation.d.ts +18 -0
  223. package/dist/types/init/utils/configManipulation.d.ts.map +1 -0
  224. package/dist/types/init/utils/index.d.ts +2 -1
  225. package/dist/types/installSkills/index.d.ts +21 -0
  226. package/dist/types/installSkills/index.d.ts.map +1 -0
  227. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +2 -2
  228. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -1
  229. package/dist/types/watcher.d.ts +2 -2
  230. package/dist/types/watcher.d.ts.map +1 -1
  231. package/package.json +12 -12
@@ -1 +1 @@
1
- {"version":3,"file":"pLimit.cjs","names":["#head","#tail","#size"],"sources":["../../../src/utils/pLimit.ts"],"sourcesContent":["/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node<T> {\n value: T;\n next: Node<T> | undefined;\n\n constructor(value: T) {\n this.value = value;\n }\n}\n\nexport class Queue<T> {\n #head: Node<T> | undefined;\n #tail: Node<T> | undefined;\n #size!: number;\n\n constructor() {\n this.clear();\n }\n\n enqueue(value: T): void {\n const node = new Node(value);\n\n if (this.#head) {\n this.#tail!.next = node;\n this.#tail = node;\n } else {\n this.#head = node;\n this.#tail = node;\n }\n\n this.#size++;\n }\n\n dequeue(): T | undefined {\n const current = this.#head;\n if (!current) {\n return;\n }\n\n this.#head = current.next;\n this.#size--;\n return current.value;\n }\n\n peek(): T | undefined {\n if (!this.#head) {\n return;\n }\n\n return this.#head.value;\n\n // TODO: Node.js 18.\n // return this.#head?.value;\n }\n\n clear(): void {\n this.#head = undefined;\n this.#tail = undefined;\n this.#size = 0;\n }\n\n get size(): number {\n return this.#size;\n }\n\n *[Symbol.iterator](): Generator<T, void, unknown> {\n let current = this.#head;\n\n while (current) {\n yield current.value;\n current = current.next;\n }\n }\n\n *drain(): Generator<T | undefined, void, unknown> {\n while (this.#head) {\n yield this.dequeue();\n }\n }\n}\n\nexport const pLimit = (concurrency: number) => {\n validateConcurrency(concurrency);\n\n const queue = new Queue<() => void>();\n let activeCount = 0;\n\n const idleWaiters: Array<() => void> = [];\n const notifyIdleIfNeeded = (): void => {\n if (activeCount === 0 && queue.size === 0) {\n while (idleWaiters.length) idleWaiters.pop()?.();\n }\n };\n\n const resumeNext = (): void => {\n // Process the next queued function if we're under the concurrency limit\n if (activeCount < concurrency && queue.size > 0) {\n activeCount++;\n queue.dequeue()?.();\n }\n };\n\n const next = (): void => {\n activeCount--;\n resumeNext();\n };\n\n const run = async (\n fn: (...args: any[]) => Promise<any>,\n resolve: (value: Promise<any>) => void,\n arguments_: any[]\n ): Promise<void> => {\n // Execute the function and capture the result promise\n const result = (async () => fn(...arguments_))();\n\n // Resolve immediately with the promise (don't wait for completion)\n resolve(result);\n\n // Wait for the function to complete (success or failure)\n // We catch errors here to prevent unhandled rejections,\n // but the original promise rejection is preserved for the caller\n try {\n await result;\n } catch {}\n\n // Decrement active count and process next queued function\n next();\n };\n\n const enqueue = (\n fn: (...args: any[]) => Promise<any>,\n resolve: (value: Promise<any>) => void,\n arguments_: any[]\n ): void => {\n // Queue the internal resolve function instead of the run function\n // to preserve the asynchronous execution context.\n new Promise<void>((internalResolve) => {\n queue.enqueue(internalResolve);\n }).then(run.bind(undefined, fn, resolve, arguments_));\n\n // Start processing immediately if we haven't reached the concurrency limit\n if (activeCount < concurrency) {\n resumeNext();\n }\n };\n\n const generator = (\n fn: (...args: any[]) => Promise<any>,\n ...arguments_: any[]\n ): Promise<any> =>\n new Promise<any>((resolve) => {\n enqueue(fn, resolve, arguments_);\n });\n\n Object.defineProperties(generator, {\n activeCount: {\n get: () => activeCount,\n },\n pendingCount: {\n get: () => queue.size,\n },\n clearQueue: {\n value() {\n queue.clear();\n notifyIdleIfNeeded();\n },\n },\n concurrency: {\n get: () => concurrency,\n\n set(newConcurrency: number) {\n validateConcurrency(newConcurrency);\n concurrency = newConcurrency;\n\n queueMicrotask(() => {\n while (activeCount < concurrency && queue.size > 0) {\n resumeNext();\n }\n });\n },\n },\n map: {\n async value<T, R>(\n array: T[],\n fn: (value: T, index: number) => Promise<R>\n ): Promise<R[]> {\n const promises = array.map((value, index) => this(fn, value, index));\n return Promise.all(promises);\n },\n },\n onIdle: {\n /**\n * Resolves when `activeCount === 0` and the queue is empty.\n * Use this to wait for completion without holding a list of Promises.\n */\n value(): Promise<void> {\n if (activeCount === 0 && queue.size === 0) return Promise.resolve();\n return new Promise<void>((resolve) => idleWaiters.push(resolve));\n },\n },\n });\n\n return generator;\n};\n\nconst validateConcurrency = (concurrency: number): void => {\n if (\n !(\n (Number.isInteger(concurrency) ||\n concurrency === Number.POSITIVE_INFINITY) &&\n concurrency > 0\n )\n ) {\n throw new TypeError('Expected `concurrency` to be a number from 1 and up');\n }\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"pLimit.cjs","names":["#head","#tail","#size"],"sources":["../../../src/utils/pLimit.ts"],"sourcesContent":["/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node<T> {\n value: T;\n next: Node<T> | undefined;\n\n constructor(value: T) {\n this.value = value;\n }\n}\n\nexport class Queue<T> {\n #head: Node<T> | undefined;\n #tail: Node<T> | undefined;\n #size!: number;\n\n constructor() {\n this.clear();\n }\n\n enqueue(value: T): void {\n const node = new Node(value);\n\n if (this.#head) {\n this.#tail!.next = node;\n this.#tail = node;\n } else {\n this.#head = node;\n this.#tail = node;\n }\n\n this.#size++;\n }\n\n dequeue(): T | undefined {\n const current = this.#head;\n if (!current) {\n return;\n }\n\n this.#head = current.next;\n this.#size--;\n return current.value;\n }\n\n peek(): T | undefined {\n if (!this.#head) {\n return;\n }\n\n return this.#head.value;\n\n // TODO: Node.js 18.\n // return this.#head?.value;\n }\n\n clear(): void {\n this.#head = undefined;\n this.#tail = undefined;\n this.#size = 0;\n }\n\n get size(): number {\n return this.#size;\n }\n\n *[Symbol.iterator](): Generator<T, void, unknown> {\n let current = this.#head;\n\n while (current) {\n yield current.value;\n current = current.next;\n }\n }\n\n *drain(): Generator<T | undefined, void, unknown> {\n while (this.#head) {\n yield this.dequeue();\n }\n }\n}\n\nexport const pLimit = (concurrency: number) => {\n validateConcurrency(concurrency);\n\n const queue = new Queue<() => void>();\n let activeCount = 0;\n\n const idleWaiters: Array<() => void> = [];\n const notifyIdleIfNeeded = (): void => {\n if (activeCount === 0 && queue.size === 0) {\n while (idleWaiters.length) idleWaiters.pop()?.();\n }\n };\n\n const resumeNext = (): void => {\n // Process the next queued function if we're under the concurrency limit\n if (activeCount < concurrency && queue.size > 0) {\n activeCount++;\n queue.dequeue()?.();\n }\n };\n\n const next = (): void => {\n activeCount--;\n resumeNext();\n };\n\n const run = async (\n fn: (...args: any[]) => Promise<any>,\n resolve: (value: Promise<any>) => void,\n arguments_: any[]\n ): Promise<void> => {\n // Execute the function and capture the result promise\n const result = (async () => fn(...arguments_))();\n\n // Resolve immediately with the promise (don't wait for completion)\n resolve(result);\n\n // Wait for the function to complete (success or failure)\n // We catch errors here to prevent unhandled rejections,\n // but the original promise rejection is preserved for the caller\n try {\n await result;\n } catch {}\n\n // Decrement active count and process next queued function\n next();\n };\n\n const enqueue = (\n fn: (...args: any[]) => Promise<any>,\n resolve: (value: Promise<any>) => void,\n arguments_: any[]\n ): void => {\n // Queue the internal resolve function instead of the run function\n // to preserve the asynchronous execution context.\n new Promise<void>((internalResolve) => {\n queue.enqueue(internalResolve);\n }).then(run.bind(undefined, fn, resolve, arguments_));\n\n // Start processing immediately if we haven't reached the concurrency limit\n if (activeCount < concurrency) {\n resumeNext();\n }\n };\n\n const generator = (\n fn: (...args: any[]) => Promise<any>,\n ...arguments_: any[]\n ): Promise<any> =>\n new Promise<any>((resolve) => {\n enqueue(fn, resolve, arguments_);\n });\n\n Object.defineProperties(generator, {\n activeCount: {\n get: () => activeCount,\n },\n pendingCount: {\n get: () => queue.size,\n },\n clearQueue: {\n value() {\n queue.clear();\n notifyIdleIfNeeded();\n },\n },\n concurrency: {\n get: () => concurrency,\n\n set(newConcurrency: number) {\n validateConcurrency(newConcurrency);\n concurrency = newConcurrency;\n\n queueMicrotask(() => {\n while (activeCount < concurrency && queue.size > 0) {\n resumeNext();\n }\n });\n },\n },\n map: {\n async value<T, R>(\n array: T[],\n fn: (value: T, index: number) => Promise<R>\n ): Promise<R[]> {\n const promises = array.map((value, index) => this(fn, value, index));\n return Promise.all(promises);\n },\n },\n onIdle: {\n /**\n * Resolves when `activeCount === 0` and the queue is empty.\n * Use this to wait for completion without holding a list of Promises.\n */\n value(): Promise<void> {\n if (activeCount === 0 && queue.size === 0) return Promise.resolve();\n return new Promise<void>((resolve) => idleWaiters.push(resolve));\n },\n },\n });\n\n return generator;\n};\n\nconst validateConcurrency = (concurrency: number): void => {\n if (\n !(\n (Number.isInteger(concurrency) ||\n concurrency === Number.POSITIVE_INFINITY) &&\n concurrency > 0\n )\n ) {\n throw new TypeError('Expected `concurrency` to be a number from 1 and up');\n }\n};\n"],"mappings":"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"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  const require_utils_pLimit = require('./pLimit.cjs');
2
3
 
3
4
  //#region src/utils/parallelize.ts
@@ -1 +1 @@
1
- {"version":3,"file":"parallelize.cjs","names":["pLimit"],"sources":["../../../src/utils/parallelize.ts"],"sourcesContent":["import { pLimit } from './pLimit';\n\nexport const parallelize = async <T, R>(\n items: T[],\n callback: (item: T) => Promise<R> = async (item) =>\n item as unknown as Promise<R>,\n parallelLimit: number = 10\n): Promise<R[]> => {\n const limit = pLimit(parallelLimit);\n return Promise.all(items.map((item) => limit(() => callback(item))));\n};\n"],"mappings":";;;AAEA,MAAa,cAAc,OACzB,OACA,WAAoC,OAAO,SACzC,MACF,gBAAwB,OACP;CACjB,MAAM,QAAQA,4BAAO,cAAc;AACnC,QAAO,QAAQ,IAAI,MAAM,KAAK,SAAS,YAAY,SAAS,KAAK,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"parallelize.cjs","names":["pLimit"],"sources":["../../../src/utils/parallelize.ts"],"sourcesContent":["import { pLimit } from './pLimit';\n\nexport const parallelize = async <T, R>(\n items: T[],\n callback: (item: T) => Promise<R> = async (item) =>\n item as unknown as Promise<R>,\n parallelLimit: number = 10\n): Promise<R[]> => {\n const limit = pLimit(parallelLimit);\n return Promise.all(items.map((item) => limit(() => callback(item))));\n};\n"],"mappings":";;;;AAEA,MAAa,cAAc,OACzB,OACA,WAAoC,OAAO,SACzC,MACF,gBAAwB,OACP;CACjB,MAAM,QAAQA,4BAAO,cAAc;AACnC,QAAO,QAAQ,IAAI,MAAM,KAAK,SAAS,YAAY,SAAS,KAAK,CAAC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
  const require_utils_pLimit = require('./pLimit.cjs');
2
3
 
3
4
  //#region src/utils/parallelizeGlobal.ts
@@ -1 +1 @@
1
- {"version":3,"file":"parallelizeGlobal.cjs","names":["pLimit"],"sources":["../../../src/utils/parallelizeGlobal.ts"],"sourcesContent":["// === keep your Queue, Node, pLimit, validateConcurrency exactly as-is ===\n\nimport { pLimit } from './pLimit';\n\n// --- NEW: single, shared limiter for the whole process ---\nlet _globalLimiter: ReturnType<typeof pLimit> | null = null;\n\n/** Get (and optionally configure) the single, shared limiter. */\nexport const getGlobalLimiter = (concurrency?: number) => {\n if (!_globalLimiter) {\n _globalLimiter = pLimit(concurrency ?? 10);\n } else if (typeof concurrency === 'number') {\n (_globalLimiter as any).concurrency = concurrency;\n }\n return _globalLimiter!;\n};\n\n// --- NEW: task limiter for gating task starts ---\nlet _taskLimiter: ReturnType<typeof pLimit> | null = null;\n\n/** Limits how many *tasks* run concurrently (independent from AI calls). */\nexport const getTaskLimiter = (concurrency?: number) => {\n if (!_taskLimiter) {\n _taskLimiter = pLimit(concurrency ?? 5);\n } else if (typeof concurrency === 'number') {\n (_taskLimiter as any).concurrency = concurrency;\n }\n return _taskLimiter!;\n};\n\n// --- REPLACE your existing `parallelize` with this version ---\nexport const parallelizeGlobal = async <T, R>(\n items: T[],\n callback: (item: T, index: number) => Promise<R> = async (item) =>\n item as unknown as Promise<R>,\n options?: {\n /** Share a single limiter across the app. If omitted, uses global limiter. */\n limiter?: ReturnType<typeof pLimit>;\n /** If provided and no limiter is passed, configure the global limiter. */\n concurrency?: number;\n /**\n * Whether to wrap *each* callback run in the limiter.\n * - For orchestration (outer loops): set `false` (don't burn limiter slots).\n * - For atomic work (AI calls, writes): leave `true` (default).\n */\n wrapInLimiter?: boolean;\n }\n): Promise<R[]> => {\n const limiter = options?.limiter ?? getGlobalLimiter(options?.concurrency);\n const wrap = options?.wrapInLimiter ?? true;\n\n const run = wrap\n ? <U>(fn: () => Promise<U>) => limiter(fn)\n : <U>(fn: () => Promise<U>) => fn();\n\n const promises = items.map((item, index) => run(() => callback(item, index)));\n return Promise.all(promises);\n};\n"],"mappings":";;;AAKA,IAAI,iBAAmD;;AAGvD,MAAa,oBAAoB,gBAAyB;AACxD,KAAI,CAAC,eACH,kBAAiBA,4BAAO,eAAe,GAAG;UACjC,OAAO,gBAAgB,SAChC,CAAC,eAAuB,cAAc;AAExC,QAAO;;AAIT,IAAI,eAAiD;;AAGrD,MAAa,kBAAkB,gBAAyB;AACtD,KAAI,CAAC,aACH,gBAAeA,4BAAO,eAAe,EAAE;UAC9B,OAAO,gBAAgB,SAChC,CAAC,aAAqB,cAAc;AAEtC,QAAO;;AAIT,MAAa,oBAAoB,OAC/B,OACA,WAAmD,OAAO,SACxD,MACF,YAYiB;CACjB,MAAM,UAAU,SAAS,WAAW,iBAAiB,SAAS,YAAY;CAG1E,MAAM,MAFO,SAAS,iBAAiB,QAG/B,OAAyB,QAAQ,GAAG,IACpC,OAAyB,IAAI;CAErC,MAAM,WAAW,MAAM,KAAK,MAAM,UAAU,UAAU,SAAS,MAAM,MAAM,CAAC,CAAC;AAC7E,QAAO,QAAQ,IAAI,SAAS"}
1
+ {"version":3,"file":"parallelizeGlobal.cjs","names":["pLimit"],"sources":["../../../src/utils/parallelizeGlobal.ts"],"sourcesContent":["// === keep your Queue, Node, pLimit, validateConcurrency exactly as-is ===\n\nimport { pLimit } from './pLimit';\n\n// --- NEW: single, shared limiter for the whole process ---\nlet _globalLimiter: ReturnType<typeof pLimit> | null = null;\n\n/** Get (and optionally configure) the single, shared limiter. */\nexport const getGlobalLimiter = (concurrency?: number) => {\n if (!_globalLimiter) {\n _globalLimiter = pLimit(concurrency ?? 10);\n } else if (typeof concurrency === 'number') {\n (_globalLimiter as any).concurrency = concurrency;\n }\n return _globalLimiter!;\n};\n\n// --- NEW: task limiter for gating task starts ---\nlet _taskLimiter: ReturnType<typeof pLimit> | null = null;\n\n/** Limits how many *tasks* run concurrently (independent from AI calls). */\nexport const getTaskLimiter = (concurrency?: number) => {\n if (!_taskLimiter) {\n _taskLimiter = pLimit(concurrency ?? 5);\n } else if (typeof concurrency === 'number') {\n (_taskLimiter as any).concurrency = concurrency;\n }\n return _taskLimiter!;\n};\n\n// --- REPLACE your existing `parallelize` with this version ---\nexport const parallelizeGlobal = async <T, R>(\n items: T[],\n callback: (item: T, index: number) => Promise<R> = async (item) =>\n item as unknown as Promise<R>,\n options?: {\n /** Share a single limiter across the app. If omitted, uses global limiter. */\n limiter?: ReturnType<typeof pLimit>;\n /** If provided and no limiter is passed, configure the global limiter. */\n concurrency?: number;\n /**\n * Whether to wrap *each* callback run in the limiter.\n * - For orchestration (outer loops): set `false` (don't burn limiter slots).\n * - For atomic work (AI calls, writes): leave `true` (default).\n */\n wrapInLimiter?: boolean;\n }\n): Promise<R[]> => {\n const limiter = options?.limiter ?? getGlobalLimiter(options?.concurrency);\n const wrap = options?.wrapInLimiter ?? true;\n\n const run = wrap\n ? <U>(fn: () => Promise<U>) => limiter(fn)\n : <U>(fn: () => Promise<U>) => fn();\n\n const promises = items.map((item, index) => run(() => callback(item, index)));\n return Promise.all(promises);\n};\n"],"mappings":";;;;AAKA,IAAI,iBAAmD;;AAGvD,MAAa,oBAAoB,gBAAyB;AACxD,KAAI,CAAC,eACH,kBAAiBA,4BAAO,eAAe,GAAG;UACjC,OAAO,gBAAgB,SAChC,CAAC,eAAuB,cAAc;AAExC,QAAO;;AAIT,IAAI,eAAiD;;AAGrD,MAAa,kBAAkB,gBAAyB;AACtD,KAAI,CAAC,aACH,gBAAeA,4BAAO,eAAe,EAAE;UAC9B,OAAO,gBAAgB,SAChC,CAAC,aAAqB,cAAc;AAEtC,QAAO;;AAIT,MAAa,oBAAoB,OAC/B,OACA,WAAmD,OAAO,SACxD,MACF,YAYiB;CACjB,MAAM,UAAU,SAAS,WAAW,iBAAiB,SAAS,YAAY;CAG1E,MAAM,MAFO,SAAS,iBAAiB,QAG/B,OAAyB,QAAQ,GAAG,IACpC,OAAyB,IAAI;CAErC,MAAM,WAAW,MAAM,KAAK,MAAM,UAAU,UAAU,SAAS,MAAM,MAAM,CAAC,CAAC;AAC7E,QAAO,QAAQ,IAAI,SAAS"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/utils/reduceObjectFormat.ts
3
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"reduceObjectFormat.cjs","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"sourcesContent":["type Primitive = string | number | boolean | null | undefined;\n\ntype Recursive = Primitive | { [key: string]: Recursive } | Array<Recursive>;\n\n/**\n * Reduce an object to only the shape provided by a format object.\n * Values are always taken from the source object; the format is used only for structure.\n *\n * Examples:\n * reduceObjectFormat({ a: 1, b: 2 }, { a: 0 }) => { a: 1 }\n * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }\n */\nexport const reduceObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive => {\n // If the format is an array, reduce each element by its counterpart in source\n if (Array.isArray(format)) {\n const sourceArray = Array.isArray(source) ? source : [];\n return format.map((formatItem, index) =>\n reduceObjectFormat(sourceArray[index], formatItem)\n );\n }\n\n // If the format is an object (and not null), pick matching keys and recurse\n if (typeof format === 'object' && format !== null) {\n const result: Record<string, Recursive> = {};\n const sourceObject =\n typeof source === 'object' && source !== null && !Array.isArray(source)\n ? (source as Record<string, Recursive>)\n : ({} as Record<string, Recursive>);\n\n for (const key of Object.keys(format)) {\n const nextSource = sourceObject[key];\n const nextFormat = (format as Record<string, Recursive>)[key];\n result[key] = reduceObjectFormat(nextSource, nextFormat);\n }\n return result;\n }\n\n // For primitives in the format, simply return the source value (can be undefined)\n return source as Primitive;\n};\n"],"mappings":";;;;;;;;;;AAYA,MAAa,sBACX,QACA,WACc;AAEd,KAAI,MAAM,QAAQ,OAAO,EAAE;EACzB,MAAM,cAAc,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE;AACvD,SAAO,OAAO,KAAK,YAAY,UAC7B,mBAAmB,YAAY,QAAQ,WAAW,CACnD;;AAIH,KAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,MAAM,SAAoC,EAAE;EAC5C,MAAM,eACJ,OAAO,WAAW,YAAY,WAAW,QAAQ,CAAC,MAAM,QAAQ,OAAO,GAClE,SACA,EAAE;AAET,OAAK,MAAM,OAAO,OAAO,KAAK,OAAO,EAAE;GACrC,MAAM,aAAa,aAAa;GAChC,MAAM,aAAc,OAAqC;AACzD,UAAO,OAAO,mBAAmB,YAAY,WAAW;;AAE1D,SAAO;;AAIT,QAAO"}
1
+ {"version":3,"file":"reduceObjectFormat.cjs","names":[],"sources":["../../../src/utils/reduceObjectFormat.ts"],"sourcesContent":["type Primitive = string | number | boolean | null | undefined;\n\ntype Recursive = Primitive | { [key: string]: Recursive } | Array<Recursive>;\n\n/**\n * Reduce an object to only the shape provided by a format object.\n * Values are always taken from the source object; the format is used only for structure.\n *\n * Examples:\n * reduceObjectFormat({ a: 1, b: 2 }, { a: 0 }) => { a: 1 }\n * reduceObjectFormat({ a: { x: 1, y: 2 } }, { a: { x: 0 } }) => { a: { x: 1 } }\n */\nexport const reduceObjectFormat = (\n source: Recursive,\n format: Recursive\n): Recursive => {\n // If the format is an array, reduce each element by its counterpart in source\n if (Array.isArray(format)) {\n const sourceArray = Array.isArray(source) ? source : [];\n return format.map((formatItem, index) =>\n reduceObjectFormat(sourceArray[index], formatItem)\n );\n }\n\n // If the format is an object (and not null), pick matching keys and recurse\n if (typeof format === 'object' && format !== null) {\n const result: Record<string, Recursive> = {};\n const sourceObject =\n typeof source === 'object' && source !== null && !Array.isArray(source)\n ? (source as Record<string, Recursive>)\n : ({} as Record<string, Recursive>);\n\n for (const key of Object.keys(format)) {\n const nextSource = sourceObject[key];\n const nextFormat = (format as Record<string, Recursive>)[key];\n result[key] = reduceObjectFormat(nextSource, nextFormat);\n }\n return result;\n }\n\n // For primitives in the format, simply return the source value (can be undefined)\n return source as Primitive;\n};\n"],"mappings":";;;;;;;;;;;AAYA,MAAa,sBACX,QACA,WACc;AAEd,KAAI,MAAM,QAAQ,OAAO,EAAE;EACzB,MAAM,cAAc,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE;AACvD,SAAO,OAAO,KAAK,YAAY,UAC7B,mBAAmB,YAAY,QAAQ,WAAW,CACnD;;AAIH,KAAI,OAAO,WAAW,YAAY,WAAW,MAAM;EACjD,MAAM,SAAoC,EAAE;EAC5C,MAAM,eACJ,OAAO,WAAW,YAAY,WAAW,QAAQ,CAAC,MAAM,QAAQ,OAAO,GAClE,SACA,EAAE;AAET,OAAK,MAAM,OAAO,OAAO,KAAK,OAAO,EAAE;GACrC,MAAM,aAAa,aAAa;GAChC,MAAM,aAAc,OAAqC;AACzD,UAAO,OAAO,mBAAmB,YAAY,WAAW;;AAE1D,SAAO;;AAIT,QAAO"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/utils/resolveObjectPromises.ts
3
4
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"resolveObjectPromises.cjs","names":[],"sources":["../../../src/utils/resolveObjectPromises.ts"],"sourcesContent":["/**\n * A more \"unified\" approach where each type (function, array, object, primitive)\n * is handled inside the main recursive body.\n */\nexport const resolveObjectPromises = async <T = unknown>(\n entry: any\n): Promise<T> => {\n // Check if entry is a Promise (Thenable)\n if (entry && typeof entry.then === 'function') {\n const awaited = await entry;\n return resolveObjectPromises(awaited);\n }\n\n // If entry is a function, invoke it and process the result\n if (typeof entry === 'function') {\n const result = entry();\n return resolveObjectPromises(result);\n }\n\n if (Array.isArray(entry)) {\n return Promise.all(\n entry.map(async (item) => resolveObjectPromises(item))\n ) as unknown as T;\n }\n\n // Handle plain objects (but not arrays)\n if (entry && typeof entry === 'object') {\n // Arrays are handled in the `Array.isArray` branch above, so we know `entry` is a plain object here.\n\n const result: Record<string, any> = {};\n\n // Iterate over keys **sequentially** to make sure the insertion order of the\n // resulting object matches the original key order. Using `Promise.all` here\n // could lead to out-of-order insertions when asynchronous resolutions\n // finish at different times.\n for (const key of Object.keys(entry)) {\n result[key] = await resolveObjectPromises(entry[key]);\n }\n\n return result as T;\n }\n\n return entry as T;\n};\n"],"mappings":";;;;;;AAIA,MAAa,wBAAwB,OACnC,UACe;AAEf,KAAI,SAAS,OAAO,MAAM,SAAS,WAEjC,QAAO,sBADS,MAAM,MACe;AAIvC,KAAI,OAAO,UAAU,WAEnB,QAAO,sBADQ,OAAO,CACc;AAGtC,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,QAAQ,IACb,MAAM,IAAI,OAAO,SAAS,sBAAsB,KAAK,CAAC,CACvD;AAIH,KAAI,SAAS,OAAO,UAAU,UAAU;EAGtC,MAAM,SAA8B,EAAE;AAMtC,OAAK,MAAM,OAAO,OAAO,KAAK,MAAM,CAClC,QAAO,OAAO,MAAM,sBAAsB,MAAM,KAAK;AAGvD,SAAO;;AAGT,QAAO"}
1
+ {"version":3,"file":"resolveObjectPromises.cjs","names":[],"sources":["../../../src/utils/resolveObjectPromises.ts"],"sourcesContent":["/**\n * A more \"unified\" approach where each type (function, array, object, primitive)\n * is handled inside the main recursive body.\n */\nexport const resolveObjectPromises = async <T = unknown>(\n entry: any\n): Promise<T> => {\n // Check if entry is a Promise (Thenable)\n if (entry && typeof entry.then === 'function') {\n const awaited = await entry;\n return resolveObjectPromises(awaited);\n }\n\n // If entry is a function, invoke it and process the result\n if (typeof entry === 'function') {\n const result = entry();\n return resolveObjectPromises(result);\n }\n\n if (Array.isArray(entry)) {\n return Promise.all(\n entry.map(async (item) => resolveObjectPromises(item))\n ) as unknown as T;\n }\n\n // Handle plain objects (but not arrays)\n if (entry && typeof entry === 'object') {\n // Arrays are handled in the `Array.isArray` branch above, so we know `entry` is a plain object here.\n\n const result: Record<string, any> = {};\n\n // Iterate over keys **sequentially** to make sure the insertion order of the\n // resulting object matches the original key order. Using `Promise.all` here\n // could lead to out-of-order insertions when asynchronous resolutions\n // finish at different times.\n for (const key of Object.keys(entry)) {\n result[key] = await resolveObjectPromises(entry[key]);\n }\n\n return result as T;\n }\n\n return entry as T;\n};\n"],"mappings":";;;;;;;AAIA,MAAa,wBAAwB,OACnC,UACe;AAEf,KAAI,SAAS,OAAO,MAAM,SAAS,WAEjC,QAAO,sBADS,MAAM,MACe;AAIvC,KAAI,OAAO,UAAU,WAEnB,QAAO,sBADQ,OAAO,CACc;AAGtC,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,QAAQ,IACb,MAAM,IAAI,OAAO,SAAS,sBAAsB,KAAK,CAAC,CACvD;AAIH,KAAI,SAAS,OAAO,UAAU,UAAU;EAGtC,MAAM,SAA8B,EAAE;AAMtC,OAAK,MAAM,OAAO,OAAO,KAAK,MAAM,CAClC,QAAO,OAAO,MAAM,sBAAsB,MAAM,KAAK;AAGvD,SAAO;;AAGT,QAAO"}
@@ -1,8 +1,9 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
2
3
  let node_fs_promises = require("node:fs/promises");
3
4
  let node_path = require("node:path");
4
5
  let _intlayer_core_package_json = require("@intlayer/core/package.json");
5
- _intlayer_core_package_json = require_rolldown_runtime.__toESM(_intlayer_core_package_json);
6
+ _intlayer_core_package_json = require_runtime.__toESM(_intlayer_core_package_json);
6
7
 
7
8
  //#region src/utils/runOnce.ts
8
9
  const DEFAULT_RUN_ONCE_OPTIONS = { cacheTimeoutMs: 60 * 1e3 };
@@ -1 +1 @@
1
- {"version":3,"file":"runOnce.cjs","names":["packageJson"],"sources":["../../../src/utils/runOnce.ts"],"sourcesContent":["import { mkdir, readFile, stat, unlink, writeFile } from 'node:fs/promises';\nimport { dirname } from 'node:path';\nimport packageJson from '@intlayer/core/package.json' with { type: 'json' };\n\ntype RunOnceOptions = {\n /**\n * The function to execute when the sentinel is not found or is older than the cache timeout.\n */\n onIsCached?: () => void | Promise<void>;\n /**\n * The time window in milliseconds during which the sentinel is considered valid.\n *\n * @default 60000 = 1 minute\n */\n cacheTimeoutMs?: number;\n /**\n * If true, the callback will always run. If undefined, the callback will run only if the sentinel is older than the cache timeout.\n *\n * @default false\n */\n forceRun?: boolean;\n};\n\nconst DEFAULT_RUN_ONCE_OPTIONS = {\n cacheTimeoutMs: 60 * 1000, // 1 minute in milliseconds,\n} satisfies RunOnceOptions;\n\ntype SentinelData = {\n version: string;\n timestamp: number;\n};\n\nconst writeSentinelFile = async (\n sentinelFilePath: string,\n currentTimestamp: number\n) => {\n // O_EXCL ensures only the *first* process can create the file\n const data: SentinelData = {\n version: packageJson.version,\n timestamp: currentTimestamp,\n };\n\n try {\n // Ensure the directory exists before writing the file\n await mkdir(dirname(sentinelFilePath), { recursive: true });\n\n await writeFile(sentinelFilePath, JSON.stringify(data), { flag: 'wx' });\n } catch (err: any) {\n if (err.code === 'EEXIST') {\n // Another process already created it → we're done\n return;\n }\n // Optimization: If ENOENT occurs on write despite mkdir (race condition with external deletion), retry once.\n if (err.code === 'ENOENT') {\n try {\n await mkdir(dirname(sentinelFilePath), { recursive: true });\n await writeFile(sentinelFilePath, JSON.stringify(data), { flag: 'wx' });\n return;\n } catch (retryErr: any) {\n if (retryErr.code === 'EEXIST') return;\n }\n }\n throw err; // unexpected FS error\n }\n};\n\n/**\n * Ensures a callback function runs only once within a specified time window across multiple processes.\n * Uses a sentinel file to coordinate execution and prevent duplicate work.\n *\n * @param sentinelFilePath - Path to the sentinel file used for coordination\n * @param callback - The function to execute (should be async)\n * @param options - The options for the runOnce function\n *\n * @example\n * ```typescript\n * await runPrepareIntlayerOnce(\n * '/tmp/intlayer-sentinel',\n * async () => {\n * // Your initialization logic here\n * await prepareIntlayer();\n * },\n * 30 * 1000 // 30 seconds cache\n * );\n * ```\n *\n * @throws {Error} When there are unexpected filesystem errors\n */\nexport const runOnce = async (\n sentinelFilePath: string,\n callback: () => void | Promise<void>,\n options?: RunOnceOptions\n) => {\n const { onIsCached, cacheTimeoutMs, forceRun } = {\n ...DEFAULT_RUN_ONCE_OPTIONS,\n ...(options ?? {}),\n };\n const currentTimestamp = Date.now();\n\n try {\n // Check if sentinel file exists and get its stats\n const sentinelStats = await stat(sentinelFilePath);\n const sentinelAge = currentTimestamp - sentinelStats.mtime.getTime();\n\n // Determine if we should rebuild based on cache age, force flag, or version mismatch\n let shouldRebuild = Boolean(forceRun) || sentinelAge > cacheTimeoutMs!;\n\n if (!shouldRebuild) {\n try {\n const raw = await readFile(sentinelFilePath, 'utf8');\n let cachedVersion: string | undefined;\n try {\n const parsed = JSON.parse(raw) as Partial<SentinelData>;\n cachedVersion = parsed.version;\n } catch {\n // Legacy format (timestamp only). Force a rebuild once to write versioned sentinel.\n cachedVersion = undefined;\n }\n\n if (!cachedVersion || cachedVersion !== packageJson.version) {\n shouldRebuild = true;\n }\n } catch {\n // If we cannot read the file, err on the safe side and rebuild\n shouldRebuild = true;\n }\n }\n\n if (shouldRebuild) {\n try {\n await unlink(sentinelFilePath);\n } catch {}\n // Fall through to create new sentinel and rebuild\n } else {\n await onIsCached?.();\n // Sentinel is recent and versions match, no need to rebuild\n return;\n }\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n // File doesn't exist, continue to create it\n } else {\n throw err; // unexpected FS error\n }\n }\n\n // Write sentinel file before to block parallel processes\n // Added await here\n await writeSentinelFile(sentinelFilePath, currentTimestamp);\n\n try {\n await callback();\n\n // Write sentinel file after to ensure the first one has not been removed with cleanOutputDir\n // Added await here\n await writeSentinelFile(sentinelFilePath, currentTimestamp);\n } catch {\n try {\n await unlink(sentinelFilePath); // Remove sentinel file if an error occurs\n } catch {}\n }\n};\n"],"mappings":";;;;;;;AAuBA,MAAM,2BAA2B,EAC/B,gBAAgB,KAAK,KACtB;AAOD,MAAM,oBAAoB,OACxB,kBACA,qBACG;CAEH,MAAM,OAAqB;EACzB,SAASA,oCAAY;EACrB,WAAW;EACZ;AAED,KAAI;AAEF,2DAAoB,iBAAiB,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,wCAAgB,kBAAkB,KAAK,UAAU,KAAK,EAAE,EAAE,MAAM,MAAM,CAAC;UAChE,KAAU;AACjB,MAAI,IAAI,SAAS,SAEf;AAGF,MAAI,IAAI,SAAS,SACf,KAAI;AACF,4DAAoB,iBAAiB,EAAE,EAAE,WAAW,MAAM,CAAC;AAC3D,yCAAgB,kBAAkB,KAAK,UAAU,KAAK,EAAE,EAAE,MAAM,MAAM,CAAC;AACvE;WACO,UAAe;AACtB,OAAI,SAAS,SAAS,SAAU;;AAGpC,QAAM;;;;;;;;;;;;;;;;;;;;;;;;;AA0BV,MAAa,UAAU,OACrB,kBACA,UACA,YACG;CACH,MAAM,EAAE,YAAY,gBAAgB,aAAa;EAC/C,GAAG;EACH,GAAI,WAAW,EAAE;EAClB;CACD,MAAM,mBAAmB,KAAK,KAAK;AAEnC,KAAI;EAGF,MAAM,cAAc,oBADE,iCAAW,iBAAiB,EACG,MAAM,SAAS;EAGpE,IAAI,gBAAgB,QAAQ,SAAS,IAAI,cAAc;AAEvD,MAAI,CAAC,cACH,KAAI;GACF,MAAM,MAAM,qCAAe,kBAAkB,OAAO;GACpD,IAAI;AACJ,OAAI;AAEF,oBADe,KAAK,MAAM,IAAI,CACP;WACjB;AAEN,oBAAgB;;AAGlB,OAAI,CAAC,iBAAiB,kBAAkBA,oCAAY,QAClD,iBAAgB;UAEZ;AAEN,mBAAgB;;AAIpB,MAAI,cACF,KAAI;AACF,sCAAa,iBAAiB;UACxB;OAEH;AACL,SAAM,cAAc;AAEpB;;UAEK,KAAU;AACjB,MAAI,IAAI,SAAS,UAAU,OAGzB,OAAM;;AAMV,OAAM,kBAAkB,kBAAkB,iBAAiB;AAE3D,KAAI;AACF,QAAM,UAAU;AAIhB,QAAM,kBAAkB,kBAAkB,iBAAiB;SACrD;AACN,MAAI;AACF,sCAAa,iBAAiB;UACxB"}
1
+ {"version":3,"file":"runOnce.cjs","names":["packageJson"],"sources":["../../../src/utils/runOnce.ts"],"sourcesContent":["import { mkdir, readFile, stat, unlink, writeFile } from 'node:fs/promises';\nimport { dirname } from 'node:path';\nimport packageJson from '@intlayer/core/package.json' with { type: 'json' };\n\ntype RunOnceOptions = {\n /**\n * The function to execute when the sentinel is not found or is older than the cache timeout.\n */\n onIsCached?: () => void | Promise<void>;\n /**\n * The time window in milliseconds during which the sentinel is considered valid.\n *\n * @default 60000 = 1 minute\n */\n cacheTimeoutMs?: number;\n /**\n * If true, the callback will always run. If undefined, the callback will run only if the sentinel is older than the cache timeout.\n *\n * @default false\n */\n forceRun?: boolean;\n};\n\nconst DEFAULT_RUN_ONCE_OPTIONS = {\n cacheTimeoutMs: 60 * 1000, // 1 minute in milliseconds,\n} satisfies RunOnceOptions;\n\ntype SentinelData = {\n version: string;\n timestamp: number;\n};\n\nconst writeSentinelFile = async (\n sentinelFilePath: string,\n currentTimestamp: number\n) => {\n // O_EXCL ensures only the *first* process can create the file\n const data: SentinelData = {\n version: packageJson.version,\n timestamp: currentTimestamp,\n };\n\n try {\n // Ensure the directory exists before writing the file\n await mkdir(dirname(sentinelFilePath), { recursive: true });\n\n await writeFile(sentinelFilePath, JSON.stringify(data), { flag: 'wx' });\n } catch (err: any) {\n if (err.code === 'EEXIST') {\n // Another process already created it → we're done\n return;\n }\n // Optimization: If ENOENT occurs on write despite mkdir (race condition with external deletion), retry once.\n if (err.code === 'ENOENT') {\n try {\n await mkdir(dirname(sentinelFilePath), { recursive: true });\n await writeFile(sentinelFilePath, JSON.stringify(data), { flag: 'wx' });\n return;\n } catch (retryErr: any) {\n if (retryErr.code === 'EEXIST') return;\n }\n }\n throw err; // unexpected FS error\n }\n};\n\n/**\n * Ensures a callback function runs only once within a specified time window across multiple processes.\n * Uses a sentinel file to coordinate execution and prevent duplicate work.\n *\n * @param sentinelFilePath - Path to the sentinel file used for coordination\n * @param callback - The function to execute (should be async)\n * @param options - The options for the runOnce function\n *\n * @example\n * ```typescript\n * await runPrepareIntlayerOnce(\n * '/tmp/intlayer-sentinel',\n * async () => {\n * // Your initialization logic here\n * await prepareIntlayer();\n * },\n * 30 * 1000 // 30 seconds cache\n * );\n * ```\n *\n * @throws {Error} When there are unexpected filesystem errors\n */\nexport const runOnce = async (\n sentinelFilePath: string,\n callback: () => void | Promise<void>,\n options?: RunOnceOptions\n) => {\n const { onIsCached, cacheTimeoutMs, forceRun } = {\n ...DEFAULT_RUN_ONCE_OPTIONS,\n ...(options ?? {}),\n };\n const currentTimestamp = Date.now();\n\n try {\n // Check if sentinel file exists and get its stats\n const sentinelStats = await stat(sentinelFilePath);\n const sentinelAge = currentTimestamp - sentinelStats.mtime.getTime();\n\n // Determine if we should rebuild based on cache age, force flag, or version mismatch\n let shouldRebuild = Boolean(forceRun) || sentinelAge > cacheTimeoutMs!;\n\n if (!shouldRebuild) {\n try {\n const raw = await readFile(sentinelFilePath, 'utf8');\n let cachedVersion: string | undefined;\n try {\n const parsed = JSON.parse(raw) as Partial<SentinelData>;\n cachedVersion = parsed.version;\n } catch {\n // Legacy format (timestamp only). Force a rebuild once to write versioned sentinel.\n cachedVersion = undefined;\n }\n\n if (!cachedVersion || cachedVersion !== packageJson.version) {\n shouldRebuild = true;\n }\n } catch {\n // If we cannot read the file, err on the safe side and rebuild\n shouldRebuild = true;\n }\n }\n\n if (shouldRebuild) {\n try {\n await unlink(sentinelFilePath);\n } catch {}\n // Fall through to create new sentinel and rebuild\n } else {\n await onIsCached?.();\n // Sentinel is recent and versions match, no need to rebuild\n return;\n }\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n // File doesn't exist, continue to create it\n } else {\n throw err; // unexpected FS error\n }\n }\n\n // Write sentinel file before to block parallel processes\n // Added await here\n await writeSentinelFile(sentinelFilePath, currentTimestamp);\n\n try {\n await callback();\n\n // Write sentinel file after to ensure the first one has not been removed with cleanOutputDir\n // Added await here\n await writeSentinelFile(sentinelFilePath, currentTimestamp);\n } catch {\n try {\n await unlink(sentinelFilePath); // Remove sentinel file if an error occurs\n } catch {}\n }\n};\n"],"mappings":";;;;;;;;AAuBA,MAAM,2BAA2B,EAC/B,gBAAgB,KAAK,KACtB;AAOD,MAAM,oBAAoB,OACxB,kBACA,qBACG;CAEH,MAAM,OAAqB;EACzB,SAASA,oCAAY;EACrB,WAAW;EACZ;AAED,KAAI;AAEF,2DAAoB,iBAAiB,EAAE,EAAE,WAAW,MAAM,CAAC;AAE3D,wCAAgB,kBAAkB,KAAK,UAAU,KAAK,EAAE,EAAE,MAAM,MAAM,CAAC;UAChE,KAAU;AACjB,MAAI,IAAI,SAAS,SAEf;AAGF,MAAI,IAAI,SAAS,SACf,KAAI;AACF,4DAAoB,iBAAiB,EAAE,EAAE,WAAW,MAAM,CAAC;AAC3D,yCAAgB,kBAAkB,KAAK,UAAU,KAAK,EAAE,EAAE,MAAM,MAAM,CAAC;AACvE;WACO,UAAe;AACtB,OAAI,SAAS,SAAS,SAAU;;AAGpC,QAAM;;;;;;;;;;;;;;;;;;;;;;;;;AA0BV,MAAa,UAAU,OACrB,kBACA,UACA,YACG;CACH,MAAM,EAAE,YAAY,gBAAgB,aAAa;EAC/C,GAAG;EACH,GAAI,WAAW,EAAE;EAClB;CACD,MAAM,mBAAmB,KAAK,KAAK;AAEnC,KAAI;EAGF,MAAM,cAAc,oBADE,iCAAW,iBAAiB,EACG,MAAM,SAAS;EAGpE,IAAI,gBAAgB,QAAQ,SAAS,IAAI,cAAc;AAEvD,MAAI,CAAC,cACH,KAAI;GACF,MAAM,MAAM,qCAAe,kBAAkB,OAAO;GACpD,IAAI;AACJ,OAAI;AAEF,oBADe,KAAK,MAAM,IAAI,CACP;WACjB;AAEN,oBAAgB;;AAGlB,OAAI,CAAC,iBAAiB,kBAAkBA,oCAAY,QAClD,iBAAgB;UAEZ;AAEN,mBAAgB;;AAIpB,MAAI,cACF,KAAI;AACF,sCAAa,iBAAiB;UACxB;OAEH;AACL,SAAM,cAAc;AAEpB;;UAEK,KAAU;AACjB,MAAI,IAAI,SAAS,UAAU,OAGzB,OAAM;;AAMV,OAAM,kBAAkB,kBAAkB,iBAAiB;AAE3D,KAAI;AACF,QAAM,UAAU;AAIhB,QAAM,kBAAkB,kBAAkB,iBAAiB;SACrD;AACN,MAAI;AACF,sCAAa,iBAAiB;UACxB"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
3
  let node_child_process = require("node:child_process");
3
4
 
4
5
  //#region src/utils/runParallel/bin.ts
@@ -1 +1 @@
1
- {"version":3,"file":"bin.cjs","names":[],"sources":["../../../../src/utils/runParallel/bin.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport { type SpawnOptions, spawn } from 'node:child_process';\n\ntype BinCallback = (err: Error | null, stdout?: string, code?: number) => void;\n\nconst stripStderr = (stderr: string | undefined): string | undefined => {\n if (!stderr) return;\n let cleaned = stderr.trim();\n // Strip bogus screen size error.\n // See https://github.com/microsoft/vscode/issues/98590\n const regex = /your \\d+x\\d+ screen size is bogus\\. expect trouble/gi;\n cleaned = cleaned.replace(regex, '');\n\n return cleaned.trim() || undefined;\n};\n\n/**\n * Spawn a binary and read its stdout.\n * @param cmd The name of the binary to spawn.\n * @param args The arguments for the binary.\n * @param options Optional option for the spawn function.\n * @param done Callback function.\n */\nexport const run = (\n cmd: string,\n args: string[],\n options: SpawnOptions | BinCallback | undefined,\n done?: BinCallback\n): void => {\n let normalizedOptions: SpawnOptions | undefined;\n let normalizedDone: BinCallback;\n\n if (typeof options === 'function') {\n normalizedDone = options;\n normalizedOptions = undefined;\n } else {\n normalizedDone = done!;\n normalizedOptions = options;\n }\n\n let executed = false;\n const ch: ChildProcess = spawn(cmd, args, normalizedOptions ?? {});\n let stdout = '';\n let stderr = '';\n\n if (ch.stdout) {\n ch.stdout.on('data', (d: Buffer) => {\n stdout += d.toString();\n });\n }\n\n if (ch.stderr) {\n ch.stderr.on('data', (d: Buffer) => {\n stderr += d.toString();\n });\n }\n\n ch.on('error', (err: Error) => {\n if (executed) return;\n executed = true;\n normalizedDone(new Error(String(err)));\n });\n\n ch.on('close', (code: number | null) => {\n if (executed) return;\n executed = true;\n\n const cleanedStderr = stripStderr(stderr);\n if (cleanedStderr) {\n return normalizedDone(new Error(cleanedStderr));\n }\n\n normalizedDone(null, stdout, code ?? undefined);\n });\n};\n"],"mappings":";;;;AAKA,MAAM,eAAe,WAAmD;AACtE,KAAI,CAAC,OAAQ;CACb,IAAI,UAAU,OAAO,MAAM;AAI3B,WAAU,QAAQ,QADJ,wDACmB,GAAG;AAEpC,QAAO,QAAQ,MAAM,IAAI;;;;;;;;;AAU3B,MAAa,OACX,KACA,MACA,SACA,SACS;CACT,IAAI;CACJ,IAAI;AAEJ,KAAI,OAAO,YAAY,YAAY;AACjC,mBAAiB;AACjB,sBAAoB;QACf;AACL,mBAAiB;AACjB,sBAAoB;;CAGtB,IAAI,WAAW;CACf,MAAM,mCAAyB,KAAK,MAAM,qBAAqB,EAAE,CAAC;CAClE,IAAI,SAAS;CACb,IAAI,SAAS;AAEb,KAAI,GAAG,OACL,IAAG,OAAO,GAAG,SAAS,MAAc;AAClC,YAAU,EAAE,UAAU;GACtB;AAGJ,KAAI,GAAG,OACL,IAAG,OAAO,GAAG,SAAS,MAAc;AAClC,YAAU,EAAE,UAAU;GACtB;AAGJ,IAAG,GAAG,UAAU,QAAe;AAC7B,MAAI,SAAU;AACd,aAAW;AACX,iBAAe,IAAI,MAAM,OAAO,IAAI,CAAC,CAAC;GACtC;AAEF,IAAG,GAAG,UAAU,SAAwB;AACtC,MAAI,SAAU;AACd,aAAW;EAEX,MAAM,gBAAgB,YAAY,OAAO;AACzC,MAAI,cACF,QAAO,eAAe,IAAI,MAAM,cAAc,CAAC;AAGjD,iBAAe,MAAM,QAAQ,QAAQ,OAAU;GAC/C"}
1
+ {"version":3,"file":"bin.cjs","names":[],"sources":["../../../../src/utils/runParallel/bin.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport { type SpawnOptions, spawn } from 'node:child_process';\n\ntype BinCallback = (err: Error | null, stdout?: string, code?: number) => void;\n\nconst stripStderr = (stderr: string | undefined): string | undefined => {\n if (!stderr) return;\n let cleaned = stderr.trim();\n // Strip bogus screen size error.\n // See https://github.com/microsoft/vscode/issues/98590\n const regex = /your \\d+x\\d+ screen size is bogus\\. expect trouble/gi;\n cleaned = cleaned.replace(regex, '');\n\n return cleaned.trim() || undefined;\n};\n\n/**\n * Spawn a binary and read its stdout.\n * @param cmd The name of the binary to spawn.\n * @param args The arguments for the binary.\n * @param options Optional option for the spawn function.\n * @param done Callback function.\n */\nexport const run = (\n cmd: string,\n args: string[],\n options: SpawnOptions | BinCallback | undefined,\n done?: BinCallback\n): void => {\n let normalizedOptions: SpawnOptions | undefined;\n let normalizedDone: BinCallback;\n\n if (typeof options === 'function') {\n normalizedDone = options;\n normalizedOptions = undefined;\n } else {\n normalizedDone = done!;\n normalizedOptions = options;\n }\n\n let executed = false;\n const ch: ChildProcess = spawn(cmd, args, normalizedOptions ?? {});\n let stdout = '';\n let stderr = '';\n\n if (ch.stdout) {\n ch.stdout.on('data', (d: Buffer) => {\n stdout += d.toString();\n });\n }\n\n if (ch.stderr) {\n ch.stderr.on('data', (d: Buffer) => {\n stderr += d.toString();\n });\n }\n\n ch.on('error', (err: Error) => {\n if (executed) return;\n executed = true;\n normalizedDone(new Error(String(err)));\n });\n\n ch.on('close', (code: number | null) => {\n if (executed) return;\n executed = true;\n\n const cleanedStderr = stripStderr(stderr);\n if (cleanedStderr) {\n return normalizedDone(new Error(cleanedStderr));\n }\n\n normalizedDone(null, stdout, code ?? undefined);\n });\n};\n"],"mappings":";;;;;AAKA,MAAM,eAAe,WAAmD;AACtE,KAAI,CAAC,OAAQ;CACb,IAAI,UAAU,OAAO,MAAM;AAI3B,WAAU,QAAQ,QADJ,wDACmB,GAAG;AAEpC,QAAO,QAAQ,MAAM,IAAI;;;;;;;;;AAU3B,MAAa,OACX,KACA,MACA,SACA,SACS;CACT,IAAI;CACJ,IAAI;AAEJ,KAAI,OAAO,YAAY,YAAY;AACjC,mBAAiB;AACjB,sBAAoB;QACf;AACL,mBAAiB;AACjB,sBAAoB;;CAGtB,IAAI,WAAW;CACf,MAAM,mCAAyB,KAAK,MAAM,qBAAqB,EAAE,CAAC;CAClE,IAAI,SAAS;CACb,IAAI,SAAS;AAEb,KAAI,GAAG,OACL,IAAG,OAAO,GAAG,SAAS,MAAc;AAClC,YAAU,EAAE,UAAU;GACtB;AAGJ,KAAI,GAAG,OACL,IAAG,OAAO,GAAG,SAAS,MAAc;AAClC,YAAU,EAAE,UAAU;GACtB;AAGJ,IAAG,GAAG,UAAU,QAAe;AAC7B,MAAI,SAAU;AACd,aAAW;AACX,iBAAe,IAAI,MAAM,OAAO,IAAI,CAAC,CAAC;GACtC;AAEF,IAAG,GAAG,UAAU,SAAwB;AACtC,MAAI,SAAU;AACd,aAAW;EAEX,MAAM,gBAAgB,YAAY,OAAO;AACzC,MAAI,cACF,QAAO,eAAe,IAAI,MAAM,cAAc,CAAC;AAGjD,iBAAe,MAAM,QAAQ,QAAQ,OAAU;GAC/C"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/utils/runParallel/bootstrap.ts
3
4
  const bootstrap = (_name) => {
@@ -1 +1 @@
1
- {"version":3,"file":"bootstrap.cjs","names":[],"sources":["../../../../src/utils/runParallel/bootstrap.ts"],"sourcesContent":["//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport const bootstrap = (_name: string): void | Promise<void> => {\n const argv = process.argv.slice(2);\n\n switch (argv[0]) {\n case undefined:\n case '-h':\n case '--help':\n // Not needed for our use case\n console.log('Help not implemented');\n return;\n\n case '-v':\n case '--version':\n // Not needed for our use case\n console.log('Version not implemented');\n return;\n\n default:\n // https://github.com/mysticatea/npm-run-all/issues/105\n // Avoid MaxListenersExceededWarnings.\n process.stdout.setMaxListeners(0);\n process.stderr.setMaxListeners(0);\n process.stdin.setMaxListeners(0);\n return;\n }\n};\n"],"mappings":";;AAIA,MAAa,aAAa,UAAwC;AAGhE,SAFa,QAAQ,KAAK,MAAM,EAAE,CAErB,IAAb;EACE,KAAK;EACL,KAAK;EACL,KAAK;AAEH,WAAQ,IAAI,uBAAuB;AACnC;EAEF,KAAK;EACL,KAAK;AAEH,WAAQ,IAAI,0BAA0B;AACtC;EAEF;AAGE,WAAQ,OAAO,gBAAgB,EAAE;AACjC,WAAQ,OAAO,gBAAgB,EAAE;AACjC,WAAQ,MAAM,gBAAgB,EAAE;AAChC"}
1
+ {"version":3,"file":"bootstrap.cjs","names":[],"sources":["../../../../src/utils/runParallel/bootstrap.ts"],"sourcesContent":["//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\nexport const bootstrap = (_name: string): void | Promise<void> => {\n const argv = process.argv.slice(2);\n\n switch (argv[0]) {\n case undefined:\n case '-h':\n case '--help':\n // Not needed for our use case\n console.log('Help not implemented');\n return;\n\n case '-v':\n case '--version':\n // Not needed for our use case\n console.log('Version not implemented');\n return;\n\n default:\n // https://github.com/mysticatea/npm-run-all/issues/105\n // Avoid MaxListenersExceededWarnings.\n process.stdout.setMaxListeners(0);\n process.stderr.setMaxListeners(0);\n process.stdin.setMaxListeners(0);\n return;\n }\n};\n"],"mappings":";;;AAIA,MAAa,aAAa,UAAwC;AAGhE,SAFa,QAAQ,KAAK,MAAM,EAAE,CAErB,IAAb;EACE,KAAK;EACL,KAAK;EACL,KAAK;AAEH,WAAQ,IAAI,uBAAuB;AACnC;EAEF,KAAK;EACL,KAAK;AAEH,WAAQ,IAAI,0BAA0B;AACtC;EAEF;AAGE,WAAQ,OAAO,gBAAgB,EAAE;AACjC,WAAQ,OAAO,gBAAgB,EAAE;AACjC,WAAQ,MAAM,gBAAgB,EAAE;AAChC"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
3
  const require_utils_runParallel_spawnPosix = require('./spawnPosix.cjs');
3
4
  const require_utils_runParallel_spawnWin32 = require('./spawnWin32.cjs');
4
5
  let node_path = require("node:path");
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["delimiter","spawnWin32","spawnPosix"],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\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 npm-run-all approach.\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((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell: isWin,\n };\n\n // Spawn the child process\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 ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', command],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', command],\n spawnOptions\n )\n : spawnFunc(command, args, spawnOptions)\n : isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', commandText],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', commandText],\n spawnOptions\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 cleanupHandlers();\n reject(err);\n });\n\n child.on('exit', (code, signal) => {\n cleanupHandlers();\n\n // Treat common termination signals as graceful exits, not failures\n const gracefulSignals = ['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP'];\n if (code === 0 || (signal && gracefulSignals.includes(signal))) {\n resolve();\n } else {\n reject(\n Object.assign(new Error('Parallel process failed'), { code, signal })\n );\n }\n });\n });\n\n const cleanup = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\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 ];\n\n // Register signal handlers\n signalHandlers.forEach(({ event, handler }) => {\n process.on(event as any, handler as any);\n });\n\n const cleanupHandlers = () => {\n signalHandlers.forEach(({ event, handler }) => {\n process.off(event as any, handler as any);\n });\n };\n\n const kill = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n return { kill, result, commandText };\n};\n"],"mappings":";;;;;;;;;;AAcA,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,QAAQ,IAAI,aAAa,KAAK,OAAO,IACpE;CAEF,MAAM,eAAe,CAAC,QAAQ,QAAQ,IAAI,aAAa,GAAG,CACvD,OAAO,QAAQ,CACf,KAAKA,oBAAU;CAElB,MAAM,WAAW;EACf,GAAG,QAAQ;GACV,WAAW;EACb;CAED,MAAM,QAAQ,QAAQ,aAAa;CACnC,MAAM,YAAY,QAAQC,kDAAaC;CAGvC,MAAM,eAAe;EACnB,KAAK,QAAQ,KAAK;EAClB,OAAO;EACP,KAAK;EACL,OAAO;EACR;CAGD,MAAM,QAAQ,UAEV,KAAK,WAAW,KAAK,KAAK,KAAK,QAAQ,GACrC,QACE,UACE,QAAQ,IAAI,WAAW,WACvB;EAAC;EAAM;EAAM;EAAM;EAAQ,EAC3B,aACD,GACD,UACE,QAAQ,IAAI,SAAS,WACrB,CAAC,MAAM,QAAQ,EACf,aACD,GACH,UAAU,SAAS,MAAM,aAAa,GACxC,QACE,UACE,QAAQ,IAAI,WAAW,WACvB;EAAC;EAAM;EAAM;EAAM;EAAY,EAC/B,aACD,GACD,UACE,QAAQ,IAAI,SAAS,WACrB,CAAC,MAAM,YAAY,EACnB,aACD;CAEP,MAAM,SAAS,IAAI,SAAe,SAAS,WAAW;AACpD,QAAM,GAAG,UAAU,QAAQ;AACzB,OAAI;AACF,YAAQ,MACN,kCAAkC,KAAK,WAAW,OAAO,IAAI,GAC9D;WACK;AACR,oBAAiB;AACjB,UAAO,IAAI;IACX;AAEF,QAAM,GAAG,SAAS,MAAM,WAAW;AACjC,oBAAiB;AAIjB,OAAI,SAAS,KAAM,UADK;IAAC;IAAU;IAAW;IAAW;IAAS,CACrB,SAAS,OAAO,CAC3D,UAAS;OAET,QACE,OAAO,uBAAO,IAAI,MAAM,0BAA0B,EAAE;IAAE;IAAM;IAAQ,CAAC,CACtE;IAEH;GACF;CAEF,MAAM,gBAAgB;AACpB,MAAI;AACF,SAAM,KAAK,UAAU;UACf;;CAKV,MAAM,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;EACtC;AAGH,gBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,UAAQ,GAAG,OAAc,QAAe;GACxC;CAEF,MAAM,wBAAwB;AAC5B,iBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,WAAQ,IAAI,OAAc,QAAe;IACzC;;CAGJ,MAAM,aAAa;AACjB,MAAI;AACF,SAAM,KAAK,UAAU;UACf;;AAKV,QAAO;EAAE;EAAM;EAAQ;EAAa"}
1
+ {"version":3,"file":"index.cjs","names":["delimiter","spawnWin32","spawnPosix"],"sources":["../../../../src/utils/runParallel/index.ts"],"sourcesContent":["import { delimiter, join } from 'node:path';\nimport { spawnPosix } from './spawnPosix';\nimport { spawnWin32 } from './spawnWin32';\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 npm-run-all approach.\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((key) => key.toLowerCase() === 'path') ??\n 'PATH';\n\n const extendedPath = [cwdBin, process.env[PATH_KEY] ?? '']\n .filter(Boolean)\n .join(delimiter);\n\n const childEnv = {\n ...process.env,\n [PATH_KEY]: extendedPath,\n } as NodeJS.ProcessEnv;\n\n const isWin = process.platform === 'win32';\n const spawnFunc = isWin ? spawnWin32 : spawnPosix;\n\n // Spawn options\n const spawnOptions = {\n cwd: process.cwd(),\n stdio: 'inherit' as const,\n env: childEnv,\n shell: isWin,\n };\n\n // Spawn the child process\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 ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', command],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', command],\n spawnOptions\n )\n : spawnFunc(command, args, spawnOptions)\n : isWin\n ? spawnFunc(\n process.env.ComSpec ?? 'cmd.exe',\n ['/d', '/s', '/c', commandText],\n spawnOptions\n )\n : spawnFunc(\n process.env.SHELL ?? '/bin/sh',\n ['-c', commandText],\n spawnOptions\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 cleanupHandlers();\n reject(err);\n });\n\n child.on('exit', (code, signal) => {\n cleanupHandlers();\n\n // Treat common termination signals as graceful exits, not failures\n const gracefulSignals = ['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP'];\n if (code === 0 || (signal && gracefulSignals.includes(signal))) {\n resolve();\n } else {\n reject(\n Object.assign(new Error('Parallel process failed'), { code, signal })\n );\n }\n });\n });\n\n const cleanup = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\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 ];\n\n // Register signal handlers\n signalHandlers.forEach(({ event, handler }) => {\n process.on(event as any, handler as any);\n });\n\n const cleanupHandlers = () => {\n signalHandlers.forEach(({ event, handler }) => {\n process.off(event as any, handler as any);\n });\n };\n\n const kill = () => {\n try {\n child.kill('SIGTERM');\n } catch {\n // Best effort\n }\n };\n\n return { kill, result, commandText };\n};\n"],"mappings":";;;;;;;;;;;AAcA,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,QAAQ,IAAI,aAAa,KAAK,OAAO,IACpE;CAEF,MAAM,eAAe,CAAC,QAAQ,QAAQ,IAAI,aAAa,GAAG,CACvD,OAAO,QAAQ,CACf,KAAKA,oBAAU;CAElB,MAAM,WAAW;EACf,GAAG,QAAQ;GACV,WAAW;EACb;CAED,MAAM,QAAQ,QAAQ,aAAa;CACnC,MAAM,YAAY,QAAQC,kDAAaC;CAGvC,MAAM,eAAe;EACnB,KAAK,QAAQ,KAAK;EAClB,OAAO;EACP,KAAK;EACL,OAAO;EACR;CAGD,MAAM,QAAQ,UAEV,KAAK,WAAW,KAAK,KAAK,KAAK,QAAQ,GACrC,QACE,UACE,QAAQ,IAAI,WAAW,WACvB;EAAC;EAAM;EAAM;EAAM;EAAQ,EAC3B,aACD,GACD,UACE,QAAQ,IAAI,SAAS,WACrB,CAAC,MAAM,QAAQ,EACf,aACD,GACH,UAAU,SAAS,MAAM,aAAa,GACxC,QACE,UACE,QAAQ,IAAI,WAAW,WACvB;EAAC;EAAM;EAAM;EAAM;EAAY,EAC/B,aACD,GACD,UACE,QAAQ,IAAI,SAAS,WACrB,CAAC,MAAM,YAAY,EACnB,aACD;CAEP,MAAM,SAAS,IAAI,SAAe,SAAS,WAAW;AACpD,QAAM,GAAG,UAAU,QAAQ;AACzB,OAAI;AACF,YAAQ,MACN,kCAAkC,KAAK,WAAW,OAAO,IAAI,GAC9D;WACK;AACR,oBAAiB;AACjB,UAAO,IAAI;IACX;AAEF,QAAM,GAAG,SAAS,MAAM,WAAW;AACjC,oBAAiB;AAIjB,OAAI,SAAS,KAAM,UADK;IAAC;IAAU;IAAW;IAAW;IAAS,CACrB,SAAS,OAAO,CAC3D,UAAS;OAET,QACE,OAAO,uBAAO,IAAI,MAAM,0BAA0B,EAAE;IAAE;IAAM;IAAQ,CAAC,CACtE;IAEH;GACF;CAEF,MAAM,gBAAgB;AACpB,MAAI;AACF,SAAM,KAAK,UAAU;UACf;;CAKV,MAAM,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;EACtC;AAGH,gBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,UAAQ,GAAG,OAAc,QAAe;GACxC;CAEF,MAAM,wBAAwB;AAC5B,iBAAe,SAAS,EAAE,OAAO,cAAc;AAC7C,WAAQ,IAAI,OAAc,QAAe;IACzC;;CAGJ,MAAM,aAAa;AACjB,MAAI;AACF,SAAM,KAAK,UAAU;UACf;;AAKV,QAAO;EAAE;EAAM;EAAQ;EAAa"}
@@ -1,8 +1,9 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
3
  const require_utils_runParallel_ps = require('./ps.cjs');
3
4
  const require_utils_runParallel_wmic = require('./wmic.cjs');
4
5
  let node_os = require("node:os");
5
- node_os = require_rolldown_runtime.__toESM(node_os);
6
+ node_os = require_runtime.__toESM(node_os);
6
7
 
7
8
  //#region src/utils/runParallel/pidTree.ts
8
9
  const platformToMethod = {
@@ -1 +1 @@
1
- {"version":3,"file":"pidTree.cjs","names":["os"],"sources":["../../../../src/utils/runParallel/pidTree.ts"],"sourcesContent":["import * as os from 'node:os';\nimport { ps } from './ps';\nimport { wmic } from './wmic';\n\ntype Platform =\n | 'darwin'\n | 'sunos'\n | 'freebsd'\n | 'netbsd'\n | 'win'\n | 'linux'\n | 'aix';\ntype Method = 'ps' | 'wmic';\n\ntype ProcessList = [number, number][]; // [PPID, PID][]\n\ninterface ListOptions {\n root?: boolean;\n advanced?: boolean;\n}\n\ntype ProcessInfo = { pid: number; ppid?: number };\ntype ResultType<T extends ListOptions | undefined> = T extends {\n advanced: true;\n}\n ? ProcessInfo[]\n : number[];\n\ntype ProcessListCallback = (err: Error | null, list?: ProcessList) => void;\ntype ListCallback<T extends ListOptions | undefined> = (\n err: Error | null,\n list?: ResultType<T>\n) => void;\n\ntype ProcessListFn = (callback: ProcessListCallback) => void;\n\nconst platformToMethod: Record<Platform, Method> = {\n darwin: 'ps',\n sunos: 'ps',\n freebsd: 'ps',\n netbsd: 'ps',\n win: 'wmic',\n linux: 'ps',\n aix: 'ps',\n};\n\nconst methodToFn: Record<Method, ProcessListFn> = {\n ps,\n wmic,\n};\n\nlet platform: string = os.platform();\nif (platform.startsWith('win')) {\n platform = 'win';\n}\n\nconst method: Method | undefined = platformToMethod[platform as Platform];\n\n/**\n * Gets the list of all the pids of the system.\n */\nconst getAll = (callback: ProcessListCallback): void => {\n if (method === undefined) {\n callback(\n new Error(\n os.platform() +\n ' is not supported yet, please open an issue (https://github.com/simonepri/pidtree)'\n ),\n undefined\n );\n return;\n }\n\n const listFn = methodToFn[method];\n listFn(callback);\n};\n\n/**\n * Get the list of children and grandchildren pids of the given PID.\n * @param PID A PID. If -1 will return all the pids.\n * @param options Optional options object.\n * @param callback Called when the list is ready.\n */\nconst pidtree = <T extends ListOptions | undefined>(\n PID: number | string,\n options: T | ListCallback<T> | undefined,\n callback?: ListCallback<T>\n): void => {\n let normalizedOptions: ListOptions;\n let normalizedCallback: ListCallback<T>;\n\n if (typeof options === 'function') {\n normalizedCallback = options;\n normalizedOptions = {};\n } else {\n normalizedCallback = callback!;\n normalizedOptions = typeof options === 'object' ? options : {};\n }\n\n const parsedPID = parseInt(String(PID), 10);\n if (Number.isNaN(parsedPID) || parsedPID < -1) {\n normalizedCallback(\n new TypeError('The pid provided is invalid') as Error,\n undefined\n );\n return;\n }\n\n getAll((err, processList) => {\n if (err) {\n normalizedCallback(err, undefined);\n return;\n }\n\n if (!processList) {\n normalizedCallback(new Error('Failed to get process list'), undefined);\n return;\n }\n\n // If the user wants the whole list just return it\n if (parsedPID === -1) {\n const result = processList.map(([ppid, pid]) =>\n normalizedOptions.advanced ? { ppid, pid } : pid\n ) as ResultType<T>;\n\n normalizedCallback(null, result);\n return;\n }\n\n let root: ProcessInfo | number | undefined;\n for (let l = 0; l < processList.length; l++) {\n if (processList[l][1] === parsedPID) {\n root = normalizedOptions.advanced\n ? { ppid: processList[l][0], pid: parsedPID }\n : parsedPID;\n break;\n }\n\n if (processList[l][0] === parsedPID) {\n root = normalizedOptions.advanced ? { pid: parsedPID } : parsedPID; // Special pids like 0 on *nix\n }\n }\n\n if (root === undefined) {\n normalizedCallback(new Error('No matching pid found'), undefined);\n return;\n }\n\n // Build the adjacency Hash Map (pid -> [children of pid])\n const tree: Record<number, number[]> = {};\n const listCopy = [...processList];\n while (listCopy.length > 0) {\n const element = listCopy.pop()!;\n if (tree[element[0]]) {\n tree[element[0]].push(element[1]);\n } else {\n tree[element[0]] = [element[1]];\n }\n }\n\n // Starting by the PID provided by the user, traverse the tree using the\n // adjacency Hash Map until the whole subtree is visited.\n // Each pid encountered while visiting is added to the pids array.\n let idx = 0;\n const pids: (ProcessInfo | number)[] = [root];\n while (idx < pids.length) {\n const curpid = normalizedOptions.advanced\n ? (pids[idx++] as ProcessInfo).pid\n : (pids[idx++] as number);\n if (!tree[curpid]) continue;\n const length = tree[curpid].length;\n for (let j = 0; j < length; j++) {\n pids.push(\n normalizedOptions.advanced\n ? { ppid: curpid, pid: tree[curpid][j] }\n : tree[curpid][j]\n );\n }\n\n delete tree[curpid];\n }\n\n if (!normalizedOptions.root) {\n pids.shift(); // Remove root\n }\n\n normalizedCallback(null, pids as ResultType<T>);\n });\n};\n\nconst pify = <T extends ListOptions | undefined>(\n fn: typeof pidtree,\n arg1: number | string,\n arg2: T | undefined\n): Promise<ResultType<T>> => {\n return new Promise((resolve, reject) => {\n fn(arg1, arg2, (err, data) => {\n if (err) return reject(err);\n if (data === undefined) {\n return reject(new Error('No data returned'));\n }\n resolve(data);\n });\n });\n};\n\n// Node versions prior to 4.0.0 do not define have `startsWith`.\n/* istanbul ignore if */\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function (suffix: string): boolean {\n return this.substring(0, suffix.length) === suffix;\n };\n}\n\n/**\n * Get the list of children pids of the given pid.\n * @param pid A PID. If -1 will return all the pids.\n * @param options Optional options object.\n * @param callback Called when the list is ready. If not provided a promise is returned instead.\n * @returns Only when the callback is not provided.\n */\nexport const list = <T extends ListOptions | undefined>(\n pid: number | string,\n options?: T | ListCallback<T>,\n callback?: ListCallback<T>\n): Promise<ResultType<T>> | undefined => {\n if (typeof options === 'function') {\n pidtree(pid, undefined, options);\n return;\n }\n\n if (typeof callback === 'function') {\n pidtree(pid, options, callback);\n return;\n }\n\n return pify(pidtree, pid, options);\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"pidTree.cjs","names":["os"],"sources":["../../../../src/utils/runParallel/pidTree.ts"],"sourcesContent":["import * as os from 'node:os';\nimport { ps } from './ps';\nimport { wmic } from './wmic';\n\ntype Platform =\n | 'darwin'\n | 'sunos'\n | 'freebsd'\n | 'netbsd'\n | 'win'\n | 'linux'\n | 'aix';\ntype Method = 'ps' | 'wmic';\n\ntype ProcessList = [number, number][]; // [PPID, PID][]\n\ninterface ListOptions {\n root?: boolean;\n advanced?: boolean;\n}\n\ntype ProcessInfo = { pid: number; ppid?: number };\ntype ResultType<T extends ListOptions | undefined> = T extends {\n advanced: true;\n}\n ? ProcessInfo[]\n : number[];\n\ntype ProcessListCallback = (err: Error | null, list?: ProcessList) => void;\ntype ListCallback<T extends ListOptions | undefined> = (\n err: Error | null,\n list?: ResultType<T>\n) => void;\n\ntype ProcessListFn = (callback: ProcessListCallback) => void;\n\nconst platformToMethod: Record<Platform, Method> = {\n darwin: 'ps',\n sunos: 'ps',\n freebsd: 'ps',\n netbsd: 'ps',\n win: 'wmic',\n linux: 'ps',\n aix: 'ps',\n};\n\nconst methodToFn: Record<Method, ProcessListFn> = {\n ps,\n wmic,\n};\n\nlet platform: string = os.platform();\nif (platform.startsWith('win')) {\n platform = 'win';\n}\n\nconst method: Method | undefined = platformToMethod[platform as Platform];\n\n/**\n * Gets the list of all the pids of the system.\n */\nconst getAll = (callback: ProcessListCallback): void => {\n if (method === undefined) {\n callback(\n new Error(\n os.platform() +\n ' is not supported yet, please open an issue (https://github.com/simonepri/pidtree)'\n ),\n undefined\n );\n return;\n }\n\n const listFn = methodToFn[method];\n listFn(callback);\n};\n\n/**\n * Get the list of children and grandchildren pids of the given PID.\n * @param PID A PID. If -1 will return all the pids.\n * @param options Optional options object.\n * @param callback Called when the list is ready.\n */\nconst pidtree = <T extends ListOptions | undefined>(\n PID: number | string,\n options: T | ListCallback<T> | undefined,\n callback?: ListCallback<T>\n): void => {\n let normalizedOptions: ListOptions;\n let normalizedCallback: ListCallback<T>;\n\n if (typeof options === 'function') {\n normalizedCallback = options;\n normalizedOptions = {};\n } else {\n normalizedCallback = callback!;\n normalizedOptions = typeof options === 'object' ? options : {};\n }\n\n const parsedPID = parseInt(String(PID), 10);\n if (Number.isNaN(parsedPID) || parsedPID < -1) {\n normalizedCallback(\n new TypeError('The pid provided is invalid') as Error,\n undefined\n );\n return;\n }\n\n getAll((err, processList) => {\n if (err) {\n normalizedCallback(err, undefined);\n return;\n }\n\n if (!processList) {\n normalizedCallback(new Error('Failed to get process list'), undefined);\n return;\n }\n\n // If the user wants the whole list just return it\n if (parsedPID === -1) {\n const result = processList.map(([ppid, pid]) =>\n normalizedOptions.advanced ? { ppid, pid } : pid\n ) as ResultType<T>;\n\n normalizedCallback(null, result);\n return;\n }\n\n let root: ProcessInfo | number | undefined;\n for (let l = 0; l < processList.length; l++) {\n if (processList[l][1] === parsedPID) {\n root = normalizedOptions.advanced\n ? { ppid: processList[l][0], pid: parsedPID }\n : parsedPID;\n break;\n }\n\n if (processList[l][0] === parsedPID) {\n root = normalizedOptions.advanced ? { pid: parsedPID } : parsedPID; // Special pids like 0 on *nix\n }\n }\n\n if (root === undefined) {\n normalizedCallback(new Error('No matching pid found'), undefined);\n return;\n }\n\n // Build the adjacency Hash Map (pid -> [children of pid])\n const tree: Record<number, number[]> = {};\n const listCopy = [...processList];\n while (listCopy.length > 0) {\n const element = listCopy.pop()!;\n if (tree[element[0]]) {\n tree[element[0]].push(element[1]);\n } else {\n tree[element[0]] = [element[1]];\n }\n }\n\n // Starting by the PID provided by the user, traverse the tree using the\n // adjacency Hash Map until the whole subtree is visited.\n // Each pid encountered while visiting is added to the pids array.\n let idx = 0;\n const pids: (ProcessInfo | number)[] = [root];\n while (idx < pids.length) {\n const curpid = normalizedOptions.advanced\n ? (pids[idx++] as ProcessInfo).pid\n : (pids[idx++] as number);\n if (!tree[curpid]) continue;\n const length = tree[curpid].length;\n for (let j = 0; j < length; j++) {\n pids.push(\n normalizedOptions.advanced\n ? { ppid: curpid, pid: tree[curpid][j] }\n : tree[curpid][j]\n );\n }\n\n delete tree[curpid];\n }\n\n if (!normalizedOptions.root) {\n pids.shift(); // Remove root\n }\n\n normalizedCallback(null, pids as ResultType<T>);\n });\n};\n\nconst pify = <T extends ListOptions | undefined>(\n fn: typeof pidtree,\n arg1: number | string,\n arg2: T | undefined\n): Promise<ResultType<T>> => {\n return new Promise((resolve, reject) => {\n fn(arg1, arg2, (err, data) => {\n if (err) return reject(err);\n if (data === undefined) {\n return reject(new Error('No data returned'));\n }\n resolve(data);\n });\n });\n};\n\n// Node versions prior to 4.0.0 do not define have `startsWith`.\n/* istanbul ignore if */\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function (suffix: string): boolean {\n return this.substring(0, suffix.length) === suffix;\n };\n}\n\n/**\n * Get the list of children pids of the given pid.\n * @param pid A PID. If -1 will return all the pids.\n * @param options Optional options object.\n * @param callback Called when the list is ready. If not provided a promise is returned instead.\n * @returns Only when the callback is not provided.\n */\nexport const list = <T extends ListOptions | undefined>(\n pid: number | string,\n options?: T | ListCallback<T>,\n callback?: ListCallback<T>\n): Promise<ResultType<T>> | undefined => {\n if (typeof options === 'function') {\n pidtree(pid, undefined, options);\n return;\n }\n\n if (typeof callback === 'function') {\n pidtree(pid, options, callback);\n return;\n }\n\n return pify(pidtree, pid, options);\n};\n"],"mappings":"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"}
@@ -1,7 +1,8 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
3
  const require_utils_runParallel_bin = require('./bin.cjs');
3
4
  let node_os = require("node:os");
4
- node_os = require_rolldown_runtime.__toESM(node_os);
5
+ node_os = require_runtime.__toESM(node_os);
5
6
 
6
7
  //#region src/utils/runParallel/ps.ts
7
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ps.cjs","names":["os"],"sources":["../../../../src/utils/runParallel/ps.ts"],"sourcesContent":["import * as os from 'node:os';\nimport { run } from './bin';\n\ntype ProcessList = [number, number][]; // [PPID, PID][]\ntype ProcessListCallback = (err: Error | null, list?: ProcessList) => void;\n\n/**\n * Gets the list of all the pids of the system through the ps command.\n * @param callback Callback function with error and process list.\n */\nexport const ps = (callback: ProcessListCallback): void => {\n const args = ['-A', '-o', 'ppid,pid'];\n\n run('ps', args, (err, stdout, code) => {\n if (err) {\n callback(err);\n return;\n }\n if (code !== 0) {\n callback(new Error(`pidtree ps command exited with code ${code}`));\n return;\n }\n\n // Example of stdout\n //\n // PPID PID\n // 1 430\n // 430 432\n // 1 727\n // 1 7166\n\n if (!stdout) {\n callback(new Error('No stdout received from ps command'));\n return;\n }\n\n try {\n const lines = stdout.split(os.EOL);\n\n const list: ProcessList = [];\n for (let i = 1; i < lines.length; i++) {\n const trimmed = lines[i].trim();\n if (!trimmed) continue;\n const parts = trimmed.split(/\\s+/);\n const ppid = parseInt(parts[0], 10); // PPID\n const pid = parseInt(parts[1], 10); // PID\n if (!Number.isNaN(ppid) && !Number.isNaN(pid)) {\n list.push([ppid, pid]);\n }\n }\n\n callback(null, list);\n } catch (error) {\n callback(error instanceof Error ? error : new Error(String(error)));\n }\n });\n};\n"],"mappings":";;;;;;;;;;AAUA,MAAa,MAAM,aAAwC;AAGzD,mCAAI,MAFS;EAAC;EAAM;EAAM;EAAW,GAEpB,KAAK,QAAQ,SAAS;AACrC,MAAI,KAAK;AACP,YAAS,IAAI;AACb;;AAEF,MAAI,SAAS,GAAG;AACd,4BAAS,IAAI,MAAM,uCAAuC,OAAO,CAAC;AAClE;;AAWF,MAAI,CAAC,QAAQ;AACX,4BAAS,IAAI,MAAM,qCAAqC,CAAC;AACzD;;AAGF,MAAI;GACF,MAAM,QAAQ,OAAO,MAAMA,QAAG,IAAI;GAElC,MAAM,OAAoB,EAAE;AAC5B,QAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;IACrC,MAAM,UAAU,MAAM,GAAG,MAAM;AAC/B,QAAI,CAAC,QAAS;IACd,MAAM,QAAQ,QAAQ,MAAM,MAAM;IAClC,MAAM,OAAO,SAAS,MAAM,IAAI,GAAG;IACnC,MAAM,MAAM,SAAS,MAAM,IAAI,GAAG;AAClC,QAAI,CAAC,OAAO,MAAM,KAAK,IAAI,CAAC,OAAO,MAAM,IAAI,CAC3C,MAAK,KAAK,CAAC,MAAM,IAAI,CAAC;;AAI1B,YAAS,MAAM,KAAK;WACb,OAAO;AACd,YAAS,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC,CAAC;;GAErE"}
1
+ {"version":3,"file":"ps.cjs","names":["os"],"sources":["../../../../src/utils/runParallel/ps.ts"],"sourcesContent":["import * as os from 'node:os';\nimport { run } from './bin';\n\ntype ProcessList = [number, number][]; // [PPID, PID][]\ntype ProcessListCallback = (err: Error | null, list?: ProcessList) => void;\n\n/**\n * Gets the list of all the pids of the system through the ps command.\n * @param callback Callback function with error and process list.\n */\nexport const ps = (callback: ProcessListCallback): void => {\n const args = ['-A', '-o', 'ppid,pid'];\n\n run('ps', args, (err, stdout, code) => {\n if (err) {\n callback(err);\n return;\n }\n if (code !== 0) {\n callback(new Error(`pidtree ps command exited with code ${code}`));\n return;\n }\n\n // Example of stdout\n //\n // PPID PID\n // 1 430\n // 430 432\n // 1 727\n // 1 7166\n\n if (!stdout) {\n callback(new Error('No stdout received from ps command'));\n return;\n }\n\n try {\n const lines = stdout.split(os.EOL);\n\n const list: ProcessList = [];\n for (let i = 1; i < lines.length; i++) {\n const trimmed = lines[i].trim();\n if (!trimmed) continue;\n const parts = trimmed.split(/\\s+/);\n const ppid = parseInt(parts[0], 10); // PPID\n const pid = parseInt(parts[1], 10); // PID\n if (!Number.isNaN(ppid) && !Number.isNaN(pid)) {\n list.push([ppid, pid]);\n }\n }\n\n callback(null, list);\n } catch (error) {\n callback(error instanceof Error ? error : new Error(String(error)));\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,MAAM,aAAwC;AAGzD,mCAAI,MAFS;EAAC;EAAM;EAAM;EAAW,GAEpB,KAAK,QAAQ,SAAS;AACrC,MAAI,KAAK;AACP,YAAS,IAAI;AACb;;AAEF,MAAI,SAAS,GAAG;AACd,4BAAS,IAAI,MAAM,uCAAuC,OAAO,CAAC;AAClE;;AAWF,MAAI,CAAC,QAAQ;AACX,4BAAS,IAAI,MAAM,qCAAqC,CAAC;AACzD;;AAGF,MAAI;GACF,MAAM,QAAQ,OAAO,MAAMA,QAAG,IAAI;GAElC,MAAM,OAAoB,EAAE;AAC5B,QAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;IACrC,MAAM,UAAU,MAAM,GAAG,MAAM;AAC/B,QAAI,CAAC,QAAS;IACd,MAAM,QAAQ,QAAQ,MAAM,MAAM;IAClC,MAAM,OAAO,SAAS,MAAM,IAAI,GAAG;IACnC,MAAM,MAAM,SAAS,MAAM,IAAI,GAAG;AAClC,QAAI,CAAC,OAAO,MAAM,KAAK,IAAI,CAAC,OAAO,MAAM,IAAI,CAC3C,MAAK,KAAK,CAAC,MAAM,IAAI,CAAC;;AAI1B,YAAS,MAAM,KAAK;WACb,OAAO;AACd,YAAS,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC,CAAC;;GAErE"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
3
  let node_stream = require("node:stream");
3
4
 
4
5
  //#region src/utils/runParallel/runTask.ts
@@ -1 +1 @@
1
- {"version":3,"file":"runTask.cjs","names":["Writable"],"sources":["../../../../src/utils/runParallel/runTask.ts"],"sourcesContent":["//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport { Writable } from 'node:stream';\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Remove the given value from the array.\n */\nconst remove = <T>(array: T[], x: T): void => {\n const index = array.indexOf(x);\n if (index !== -1) {\n array.splice(index, 1);\n }\n};\n\nconst signals: Record<string, number> = {\n // Signal name mappings to their respective standard numeric codes.\n // See: https://man7.org/linux/man-pages/man7/signal.7.html\n\n SIGABRT: 6, // Abort signal from abort(3)\n SIGALRM: 14, // Timer signal from alarm(2)\n SIGBUS: 10, // Bus error (bad memory access)\n SIGCHLD: 20, // Child stopped or terminated\n SIGCONT: 19, // Continue if stopped\n SIGFPE: 8, // Floating point exception\n SIGHUP: 1, // Hangup detected on controlling terminal or death of controlling process\n SIGILL: 4, // Illegal Instruction\n SIGINT: 2, // Interrupt from keyboard (Ctrl+C)\n SIGKILL: 9, // Kill signal (cannot be caught or ignored)\n SIGPIPE: 13, // Broken pipe: write to pipe with no readers\n SIGQUIT: 3, // Quit from keyboard (Ctrl+\\)\n SIGSEGV: 11, // Invalid memory reference (segmentation fault)\n SIGSTOP: 17, // Stop process (cannot be caught or ignored)\n SIGTERM: 15, // Termination signal\n SIGTRAP: 5, // Trace/breakpoint trap\n SIGTSTP: 18, // Stop typed at tty (Ctrl+Z)\n SIGTTIN: 21, // tty input for background process\n SIGTTOU: 22, // tty output for background process\n SIGUSR1: 30, // User-defined signal 1\n SIGUSR2: 31, // User-defined signal 2\n};\n\n/**\n * Converts a signal name to a number.\n */\nconst convert = (signal: string): number => {\n return signals[signal] || 0;\n};\n\n/**\n * Simple in-memory writable stream\n */\nclass MemoryStream extends Writable {\n private chunks: Buffer[] = [];\n\n _write(\n chunk: Buffer,\n _encoding: string,\n callback: (error?: Error | null) => void\n ): void {\n this.chunks.push(chunk);\n callback();\n }\n\n toString(): string {\n return Buffer.concat(this.chunks).toString('utf8');\n }\n}\n\n//------------------------------------------------------------------------------\n// Types\n//------------------------------------------------------------------------------\n\ninterface TaskResult {\n name: string;\n code: number | null;\n signal?: string | null;\n}\n\ninterface TaskQueueItem {\n name: string;\n index: number;\n}\n\ninterface RunTaskOptions {\n stdout: NodeJS.WritableStream;\n stderr?: NodeJS.WritableStream;\n aggregateOutput?: boolean;\n continueOnError?: boolean;\n race?: boolean;\n maxParallel?: number;\n}\n\ninterface TaskPromise extends Promise<TaskResult> {\n abort?: () => void;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Run npm-scripts of given names in parallel.\n *\n * If a npm-script exited with a non-zero code, this aborts other all npm-scripts.\n *\n * Note: This is a simplified version for our use case.\n * The full implementation would require the actual runTask function from npm-run-all.\n */\nexport const runTasks = (\n tasks: string[],\n options: RunTaskOptions\n): Promise<TaskResult[]> => {\n return new Promise((resolve, reject) => {\n if (tasks.length === 0) {\n resolve([]);\n return;\n }\n\n const results: TaskResult[] = tasks.map((task) => ({\n name: task,\n code: undefined as any,\n }));\n const queue: TaskQueueItem[] = tasks.map((task, index) => ({\n name: task,\n index,\n }));\n const promises: TaskPromise[] = [];\n let error: Error | null = null;\n let aborted = false;\n\n /**\n * Done.\n */\n const done = (): void => {\n if (error == null) {\n resolve(results);\n } else {\n reject(error);\n }\n };\n\n /**\n * Aborts all tasks.\n */\n const abort = (): void => {\n if (aborted) {\n return;\n }\n aborted = true;\n\n if (promises.length === 0) {\n done();\n } else {\n for (const p of promises) {\n p.abort?.();\n }\n Promise.all(promises).then(done, reject);\n }\n };\n\n /**\n * Runs a next task.\n */\n const next = (): void => {\n if (aborted) {\n return;\n }\n if (queue.length === 0) {\n if (promises.length === 0) {\n done();\n }\n return;\n }\n\n const originalOutputStream = options.stdout;\n const optionsClone = { ...options };\n const writer = new MemoryStream();\n\n if (options.aggregateOutput) {\n optionsClone.stdout = writer as any;\n }\n\n const task = queue.shift()!;\n\n // Note: This requires the actual runTask implementation from npm-run-all\n // For now, this is a placeholder that would need to be implemented\n const promise = Promise.resolve({\n name: task.name,\n code: 0,\n signal: null,\n }) as TaskPromise;\n\n promises.push(promise);\n promise.then(\n (result) => {\n remove(promises, promise);\n if (aborted) {\n return;\n }\n\n if (options.aggregateOutput) {\n originalOutputStream.write(writer.toString());\n }\n\n // Check if the task failed as a result of a signal, and\n // amend the exit code as a result.\n if (\n result.code === null &&\n result.signal !== null &&\n result.signal !== undefined\n ) {\n // An exit caused by a signal must return a status code\n // of 128 plus the value of the signal code.\n // Ref: https://nodejs.org/api/process.html#process_exit_codes\n result.code = 128 + convert(result.signal);\n }\n\n // Save the result.\n results[task.index].code = result.code;\n\n // Aborts all tasks if it's an error.\n if (result.code) {\n error = new Error(\n `Task ${result.name} failed with code ${result.code}`\n );\n if (!options.continueOnError) {\n abort();\n return;\n }\n }\n\n // Aborts all tasks if options.race is true.\n if (options.race && !result.code) {\n abort();\n return;\n }\n\n // Call the next task.\n next();\n },\n (thisError: Error) => {\n remove(promises, promise);\n if (!options.continueOnError || options.race) {\n error = thisError;\n abort();\n return;\n }\n next();\n }\n );\n };\n\n const max = options.maxParallel;\n const end =\n typeof max === 'number' && max > 0\n ? Math.min(tasks.length, max)\n : tasks.length;\n for (let i = 0; i < end; ++i) {\n next();\n }\n });\n};\n"],"mappings":"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"}
1
+ {"version":3,"file":"runTask.cjs","names":["Writable"],"sources":["../../../../src/utils/runParallel/runTask.ts"],"sourcesContent":["//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport { Writable } from 'node:stream';\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Remove the given value from the array.\n */\nconst remove = <T>(array: T[], x: T): void => {\n const index = array.indexOf(x);\n if (index !== -1) {\n array.splice(index, 1);\n }\n};\n\nconst signals: Record<string, number> = {\n // Signal name mappings to their respective standard numeric codes.\n // See: https://man7.org/linux/man-pages/man7/signal.7.html\n\n SIGABRT: 6, // Abort signal from abort(3)\n SIGALRM: 14, // Timer signal from alarm(2)\n SIGBUS: 10, // Bus error (bad memory access)\n SIGCHLD: 20, // Child stopped or terminated\n SIGCONT: 19, // Continue if stopped\n SIGFPE: 8, // Floating point exception\n SIGHUP: 1, // Hangup detected on controlling terminal or death of controlling process\n SIGILL: 4, // Illegal Instruction\n SIGINT: 2, // Interrupt from keyboard (Ctrl+C)\n SIGKILL: 9, // Kill signal (cannot be caught or ignored)\n SIGPIPE: 13, // Broken pipe: write to pipe with no readers\n SIGQUIT: 3, // Quit from keyboard (Ctrl+\\)\n SIGSEGV: 11, // Invalid memory reference (segmentation fault)\n SIGSTOP: 17, // Stop process (cannot be caught or ignored)\n SIGTERM: 15, // Termination signal\n SIGTRAP: 5, // Trace/breakpoint trap\n SIGTSTP: 18, // Stop typed at tty (Ctrl+Z)\n SIGTTIN: 21, // tty input for background process\n SIGTTOU: 22, // tty output for background process\n SIGUSR1: 30, // User-defined signal 1\n SIGUSR2: 31, // User-defined signal 2\n};\n\n/**\n * Converts a signal name to a number.\n */\nconst convert = (signal: string): number => {\n return signals[signal] || 0;\n};\n\n/**\n * Simple in-memory writable stream\n */\nclass MemoryStream extends Writable {\n private chunks: Buffer[] = [];\n\n _write(\n chunk: Buffer,\n _encoding: string,\n callback: (error?: Error | null) => void\n ): void {\n this.chunks.push(chunk);\n callback();\n }\n\n toString(): string {\n return Buffer.concat(this.chunks).toString('utf8');\n }\n}\n\n//------------------------------------------------------------------------------\n// Types\n//------------------------------------------------------------------------------\n\ninterface TaskResult {\n name: string;\n code: number | null;\n signal?: string | null;\n}\n\ninterface TaskQueueItem {\n name: string;\n index: number;\n}\n\ninterface RunTaskOptions {\n stdout: NodeJS.WritableStream;\n stderr?: NodeJS.WritableStream;\n aggregateOutput?: boolean;\n continueOnError?: boolean;\n race?: boolean;\n maxParallel?: number;\n}\n\ninterface TaskPromise extends Promise<TaskResult> {\n abort?: () => void;\n}\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Run npm-scripts of given names in parallel.\n *\n * If a npm-script exited with a non-zero code, this aborts other all npm-scripts.\n *\n * Note: This is a simplified version for our use case.\n * The full implementation would require the actual runTask function from npm-run-all.\n */\nexport const runTasks = (\n tasks: string[],\n options: RunTaskOptions\n): Promise<TaskResult[]> => {\n return new Promise((resolve, reject) => {\n if (tasks.length === 0) {\n resolve([]);\n return;\n }\n\n const results: TaskResult[] = tasks.map((task) => ({\n name: task,\n code: undefined as any,\n }));\n const queue: TaskQueueItem[] = tasks.map((task, index) => ({\n name: task,\n index,\n }));\n const promises: TaskPromise[] = [];\n let error: Error | null = null;\n let aborted = false;\n\n /**\n * Done.\n */\n const done = (): void => {\n if (error == null) {\n resolve(results);\n } else {\n reject(error);\n }\n };\n\n /**\n * Aborts all tasks.\n */\n const abort = (): void => {\n if (aborted) {\n return;\n }\n aborted = true;\n\n if (promises.length === 0) {\n done();\n } else {\n for (const p of promises) {\n p.abort?.();\n }\n Promise.all(promises).then(done, reject);\n }\n };\n\n /**\n * Runs a next task.\n */\n const next = (): void => {\n if (aborted) {\n return;\n }\n if (queue.length === 0) {\n if (promises.length === 0) {\n done();\n }\n return;\n }\n\n const originalOutputStream = options.stdout;\n const optionsClone = { ...options };\n const writer = new MemoryStream();\n\n if (options.aggregateOutput) {\n optionsClone.stdout = writer as any;\n }\n\n const task = queue.shift()!;\n\n // Note: This requires the actual runTask implementation from npm-run-all\n // For now, this is a placeholder that would need to be implemented\n const promise = Promise.resolve({\n name: task.name,\n code: 0,\n signal: null,\n }) as TaskPromise;\n\n promises.push(promise);\n promise.then(\n (result) => {\n remove(promises, promise);\n if (aborted) {\n return;\n }\n\n if (options.aggregateOutput) {\n originalOutputStream.write(writer.toString());\n }\n\n // Check if the task failed as a result of a signal, and\n // amend the exit code as a result.\n if (\n result.code === null &&\n result.signal !== null &&\n result.signal !== undefined\n ) {\n // An exit caused by a signal must return a status code\n // of 128 plus the value of the signal code.\n // Ref: https://nodejs.org/api/process.html#process_exit_codes\n result.code = 128 + convert(result.signal);\n }\n\n // Save the result.\n results[task.index].code = result.code;\n\n // Aborts all tasks if it's an error.\n if (result.code) {\n error = new Error(\n `Task ${result.name} failed with code ${result.code}`\n );\n if (!options.continueOnError) {\n abort();\n return;\n }\n }\n\n // Aborts all tasks if options.race is true.\n if (options.race && !result.code) {\n abort();\n return;\n }\n\n // Call the next task.\n next();\n },\n (thisError: Error) => {\n remove(promises, promise);\n if (!options.continueOnError || options.race) {\n error = thisError;\n abort();\n return;\n }\n next();\n }\n );\n };\n\n const max = options.maxParallel;\n const end =\n typeof max === 'number' && max > 0\n ? Math.min(tasks.length, max)\n : tasks.length;\n for (let i = 0; i < end; ++i) {\n next();\n }\n });\n};\n"],"mappings":"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"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
3
  const require_utils_runParallel_pidTree = require('./pidTree.cjs');
3
4
  let node_child_process = require("node:child_process");
4
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"spawnPosix.cjs","names":[],"sources":["../../../../src/utils/runParallel/spawnPosix.ts"],"sourcesContent":["//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport type { SpawnOptions } from 'node:child_process';\nimport { type ChildProcess, spawn as nodeSpawn } from 'node:child_process';\nimport { list } from './pidTree';\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Kills the new process and its sub processes.\n */\nconst createKillHandler = (\n child: ChildProcess\n): ((signal?: NodeJS.Signals | number) => boolean) => {\n return (signal?: NodeJS.Signals | number): boolean => {\n if (!child.pid) return false;\n\n // Try using list if available\n try {\n list(child.pid, { root: true }, (err: Error | null, pids?: number[]) => {\n if (err) {\n // Fallback to process group kill\n try {\n process.kill(-child.pid!, signal ?? 'SIGTERM');\n } catch {\n // ignore\n }\n return;\n }\n\n if (!pids) {\n // Fallback to process group kill if no pids returned\n try {\n process.kill(-child.pid!, signal ?? 'SIGTERM');\n } catch {\n // ignore\n }\n return;\n }\n\n for (const pid of pids) {\n try {\n process.kill(pid, signal ?? 'SIGTERM');\n } catch (_err) {\n // ignore.\n }\n }\n });\n } catch {\n // pidtree not available, use process group kill\n try {\n process.kill(-child.pid, signal ?? 'SIGTERM');\n } catch {\n // ignore\n }\n }\n\n return true;\n };\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Launches a new process with the given command.\n * This is almost same as `child_process.spawn`.\n *\n * This returns a `ChildProcess` instance.\n * `kill` method of the instance kills the new process and its sub processes.\n *\n * @param command - The command to run.\n * @param args - List of string arguments.\n * @param options - Options.\n * @returns A ChildProcess instance of new process.\n * @private\n */\nexport const spawnPosix = (\n command: string,\n args: string[],\n options: SpawnOptions\n): ChildProcess => {\n const child = nodeSpawn(command, args, options);\n child.kill = createKillHandler(child);\n\n return child;\n};\n"],"mappings":";;;;;;;;AAeA,MAAM,qBACJ,UACoD;AACpD,SAAQ,WAA8C;AACpD,MAAI,CAAC,MAAM,IAAK,QAAO;AAGvB,MAAI;AACF,0CAAK,MAAM,KAAK,EAAE,MAAM,MAAM,GAAG,KAAmB,SAAoB;AACtE,QAAI,KAAK;AAEP,SAAI;AACF,cAAQ,KAAK,CAAC,MAAM,KAAM,UAAU,UAAU;aACxC;AAGR;;AAGF,QAAI,CAAC,MAAM;AAET,SAAI;AACF,cAAQ,KAAK,CAAC,MAAM,KAAM,UAAU,UAAU;aACxC;AAGR;;AAGF,SAAK,MAAM,OAAO,KAChB,KAAI;AACF,aAAQ,KAAK,KAAK,UAAU,UAAU;aAC/B,MAAM;KAIjB;UACI;AAEN,OAAI;AACF,YAAQ,KAAK,CAAC,MAAM,KAAK,UAAU,UAAU;WACvC;;AAKV,SAAO;;;;;;;;;;;;;;;;AAqBX,MAAa,cACX,SACA,MACA,YACiB;CACjB,MAAM,sCAAkB,SAAS,MAAM,QAAQ;AAC/C,OAAM,OAAO,kBAAkB,MAAM;AAErC,QAAO"}
1
+ {"version":3,"file":"spawnPosix.cjs","names":[],"sources":["../../../../src/utils/runParallel/spawnPosix.ts"],"sourcesContent":["//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport type { SpawnOptions } from 'node:child_process';\nimport { type ChildProcess, spawn as nodeSpawn } from 'node:child_process';\nimport { list } from './pidTree';\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Kills the new process and its sub processes.\n */\nconst createKillHandler = (\n child: ChildProcess\n): ((signal?: NodeJS.Signals | number) => boolean) => {\n return (signal?: NodeJS.Signals | number): boolean => {\n if (!child.pid) return false;\n\n // Try using list if available\n try {\n list(child.pid, { root: true }, (err: Error | null, pids?: number[]) => {\n if (err) {\n // Fallback to process group kill\n try {\n process.kill(-child.pid!, signal ?? 'SIGTERM');\n } catch {\n // ignore\n }\n return;\n }\n\n if (!pids) {\n // Fallback to process group kill if no pids returned\n try {\n process.kill(-child.pid!, signal ?? 'SIGTERM');\n } catch {\n // ignore\n }\n return;\n }\n\n for (const pid of pids) {\n try {\n process.kill(pid, signal ?? 'SIGTERM');\n } catch (_err) {\n // ignore.\n }\n }\n });\n } catch {\n // pidtree not available, use process group kill\n try {\n process.kill(-child.pid, signal ?? 'SIGTERM');\n } catch {\n // ignore\n }\n }\n\n return true;\n };\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Launches a new process with the given command.\n * This is almost same as `child_process.spawn`.\n *\n * This returns a `ChildProcess` instance.\n * `kill` method of the instance kills the new process and its sub processes.\n *\n * @param command - The command to run.\n * @param args - List of string arguments.\n * @param options - Options.\n * @returns A ChildProcess instance of new process.\n * @private\n */\nexport const spawnPosix = (\n command: string,\n args: string[],\n options: SpawnOptions\n): ChildProcess => {\n const child = nodeSpawn(command, args, options);\n child.kill = createKillHandler(child);\n\n return child;\n};\n"],"mappings":";;;;;;;;;AAeA,MAAM,qBACJ,UACoD;AACpD,SAAQ,WAA8C;AACpD,MAAI,CAAC,MAAM,IAAK,QAAO;AAGvB,MAAI;AACF,0CAAK,MAAM,KAAK,EAAE,MAAM,MAAM,GAAG,KAAmB,SAAoB;AACtE,QAAI,KAAK;AAEP,SAAI;AACF,cAAQ,KAAK,CAAC,MAAM,KAAM,UAAU,UAAU;aACxC;AAGR;;AAGF,QAAI,CAAC,MAAM;AAET,SAAI;AACF,cAAQ,KAAK,CAAC,MAAM,KAAM,UAAU,UAAU;aACxC;AAGR;;AAGF,SAAK,MAAM,OAAO,KAChB,KAAI;AACF,aAAQ,KAAK,KAAK,UAAU,UAAU;aAC/B,MAAM;KAIjB;UACI;AAEN,OAAI;AACF,YAAQ,KAAK,CAAC,MAAM,KAAK,UAAU,UAAU;WACvC;;AAKV,SAAO;;;;;;;;;;;;;;;;AAqBX,MAAa,cACX,SACA,MACA,YACiB;CACjB,MAAM,sCAAkB,SAAS,MAAM,QAAQ;AAC/C,OAAM,OAAO,kBAAkB,MAAM;AAErC,QAAO"}
@@ -1,4 +1,5 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
3
  let node_child_process = require("node:child_process");
3
4
 
4
5
  //#region src/utils/runParallel/spawnWin32.ts
@@ -1 +1 @@
1
- {"version":3,"file":"spawnWin32.cjs","names":[],"sources":["../../../../src/utils/runParallel/spawnWin32.ts"],"sourcesContent":["//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport type { SpawnOptions } from 'node:child_process';\nimport { type ChildProcess, spawn as nodeSpawn } from 'node:child_process';\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Kills the new process and its sub processes forcibly.\n */\nconst createKillHandler = (child: ChildProcess) => {\n return (): boolean => {\n if (!child.pid) return false;\n\n try {\n nodeSpawn('taskkill', ['/F', '/T', '/PID', String(child.pid)], {\n stdio: 'ignore',\n });\n } catch {\n // ignore\n }\n\n return true;\n };\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Launches a new process with the given command.\n * This is almost same as `child_process.spawn`.\n *\n * This returns a `ChildProcess` instance.\n * `kill` method of the instance kills the new process and its sub processes forcibly.\n *\n * @param command - The command to run.\n * @param args - List of string arguments.\n * @param options - Options.\n * @returns A ChildProcess instance of new process.\n * @private\n */\nexport const spawnWin32 = (\n command: string,\n args: string[],\n options: SpawnOptions\n): ChildProcess => {\n const child = nodeSpawn(command, args, options);\n child.kill = createKillHandler(child);\n\n return child;\n};\n"],"mappings":";;;;;;;AAcA,MAAM,qBAAqB,UAAwB;AACjD,cAAsB;AACpB,MAAI,CAAC,MAAM,IAAK,QAAO;AAEvB,MAAI;AACF,iCAAU,YAAY;IAAC;IAAM;IAAM;IAAQ,OAAO,MAAM,IAAI;IAAC,EAAE,EAC7D,OAAO,UACR,CAAC;UACI;AAIR,SAAO;;;;;;;;;;;;;;;;AAqBX,MAAa,cACX,SACA,MACA,YACiB;CACjB,MAAM,sCAAkB,SAAS,MAAM,QAAQ;AAC/C,OAAM,OAAO,kBAAkB,MAAM;AAErC,QAAO"}
1
+ {"version":3,"file":"spawnWin32.cjs","names":[],"sources":["../../../../src/utils/runParallel/spawnWin32.ts"],"sourcesContent":["//------------------------------------------------------------------------------\n// Requirements\n//------------------------------------------------------------------------------\n\nimport type { SpawnOptions } from 'node:child_process';\nimport { type ChildProcess, spawn as nodeSpawn } from 'node:child_process';\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\n/**\n * Kills the new process and its sub processes forcibly.\n */\nconst createKillHandler = (child: ChildProcess) => {\n return (): boolean => {\n if (!child.pid) return false;\n\n try {\n nodeSpawn('taskkill', ['/F', '/T', '/PID', String(child.pid)], {\n stdio: 'ignore',\n });\n } catch {\n // ignore\n }\n\n return true;\n };\n};\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * Launches a new process with the given command.\n * This is almost same as `child_process.spawn`.\n *\n * This returns a `ChildProcess` instance.\n * `kill` method of the instance kills the new process and its sub processes forcibly.\n *\n * @param command - The command to run.\n * @param args - List of string arguments.\n * @param options - Options.\n * @returns A ChildProcess instance of new process.\n * @private\n */\nexport const spawnWin32 = (\n command: string,\n args: string[],\n options: SpawnOptions\n): ChildProcess => {\n const child = nodeSpawn(command, args, options);\n child.kill = createKillHandler(child);\n\n return child;\n};\n"],"mappings":";;;;;;;;AAcA,MAAM,qBAAqB,UAAwB;AACjD,cAAsB;AACpB,MAAI,CAAC,MAAM,IAAK,QAAO;AAEvB,MAAI;AACF,iCAAU,YAAY;IAAC;IAAM;IAAM;IAAQ,OAAO,MAAM,IAAI;IAAC,EAAE,EAC7D,OAAO,UACR,CAAC;UACI;AAIR,SAAO;;;;;;;;;;;;;;;;AAqBX,MAAa,cACX,SACA,MACA,YACiB;CACjB,MAAM,sCAAkB,SAAS,MAAM,QAAQ;AAC/C,OAAM,OAAO,kBAAkB,MAAM;AAErC,QAAO"}
@@ -1,7 +1,8 @@
1
- const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
2
3
  const require_utils_runParallel_bin = require('./bin.cjs');
3
4
  let node_os = require("node:os");
4
- node_os = require_rolldown_runtime.__toESM(node_os);
5
+ node_os = require_runtime.__toESM(node_os);
5
6
 
6
7
  //#region src/utils/runParallel/wmic.ts
7
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"wmic.cjs","names":["os"],"sources":["../../../../src/utils/runParallel/wmic.ts"],"sourcesContent":["import type { SpawnOptions } from 'node:child_process';\nimport * as os from 'node:os';\nimport { run } from './bin';\n\ntype ProcessList = [number, number][]; // [PPID, PID][]\ntype ProcessListCallback = (err: Error | null, list?: ProcessList) => void;\n\n/**\n * Gets the list of all the pids of the system through the wmic command.\n * @param callback Callback function with error and process list.\n */\nexport const wmic = (callback: ProcessListCallback): void => {\n const args = ['PROCESS', 'get', 'ParentProcessId,ProcessId'];\n const options: SpawnOptions = {\n windowsHide: true,\n windowsVerbatimArguments: true,\n };\n run('wmic', args, options, (err, stdout, code) => {\n if (err) {\n callback(err);\n return;\n }\n\n if (code !== 0) {\n callback(new Error(`pidtree wmic command exited with code ${code}`));\n return;\n }\n\n // Example of stdout\n //\n // ParentProcessId ProcessId\n // 0 777\n\n if (!stdout) {\n callback(new Error('No stdout received from wmic command'));\n return;\n }\n\n try {\n const lines = stdout.split(os.EOL);\n\n const list: ProcessList = [];\n for (let i = 1; i < lines.length; i++) {\n const trimmed = lines[i].trim();\n if (!trimmed) continue;\n const parts = trimmed.split(/\\s+/);\n const ppid = parseInt(parts[0], 10); // PPID\n const pid = parseInt(parts[1], 10); // PID\n if (!Number.isNaN(ppid) && !Number.isNaN(pid)) {\n list.push([ppid, pid]);\n }\n }\n\n callback(null, list);\n } catch (error) {\n callback(error instanceof Error ? error : new Error(String(error)));\n }\n });\n};\n"],"mappings":";;;;;;;;;;AAWA,MAAa,QAAQ,aAAwC;AAM3D,mCAAI,QALS;EAAC;EAAW;EAAO;EAA4B,EAC9B;EAC5B,aAAa;EACb,0BAA0B;EAC3B,GAC2B,KAAK,QAAQ,SAAS;AAChD,MAAI,KAAK;AACP,YAAS,IAAI;AACb;;AAGF,MAAI,SAAS,GAAG;AACd,4BAAS,IAAI,MAAM,yCAAyC,OAAO,CAAC;AACpE;;AAQF,MAAI,CAAC,QAAQ;AACX,4BAAS,IAAI,MAAM,uCAAuC,CAAC;AAC3D;;AAGF,MAAI;GACF,MAAM,QAAQ,OAAO,MAAMA,QAAG,IAAI;GAElC,MAAM,OAAoB,EAAE;AAC5B,QAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;IACrC,MAAM,UAAU,MAAM,GAAG,MAAM;AAC/B,QAAI,CAAC,QAAS;IACd,MAAM,QAAQ,QAAQ,MAAM,MAAM;IAClC,MAAM,OAAO,SAAS,MAAM,IAAI,GAAG;IACnC,MAAM,MAAM,SAAS,MAAM,IAAI,GAAG;AAClC,QAAI,CAAC,OAAO,MAAM,KAAK,IAAI,CAAC,OAAO,MAAM,IAAI,CAC3C,MAAK,KAAK,CAAC,MAAM,IAAI,CAAC;;AAI1B,YAAS,MAAM,KAAK;WACb,OAAO;AACd,YAAS,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC,CAAC;;GAErE"}
1
+ {"version":3,"file":"wmic.cjs","names":["os"],"sources":["../../../../src/utils/runParallel/wmic.ts"],"sourcesContent":["import type { SpawnOptions } from 'node:child_process';\nimport * as os from 'node:os';\nimport { run } from './bin';\n\ntype ProcessList = [number, number][]; // [PPID, PID][]\ntype ProcessListCallback = (err: Error | null, list?: ProcessList) => void;\n\n/**\n * Gets the list of all the pids of the system through the wmic command.\n * @param callback Callback function with error and process list.\n */\nexport const wmic = (callback: ProcessListCallback): void => {\n const args = ['PROCESS', 'get', 'ParentProcessId,ProcessId'];\n const options: SpawnOptions = {\n windowsHide: true,\n windowsVerbatimArguments: true,\n };\n run('wmic', args, options, (err, stdout, code) => {\n if (err) {\n callback(err);\n return;\n }\n\n if (code !== 0) {\n callback(new Error(`pidtree wmic command exited with code ${code}`));\n return;\n }\n\n // Example of stdout\n //\n // ParentProcessId ProcessId\n // 0 777\n\n if (!stdout) {\n callback(new Error('No stdout received from wmic command'));\n return;\n }\n\n try {\n const lines = stdout.split(os.EOL);\n\n const list: ProcessList = [];\n for (let i = 1; i < lines.length; i++) {\n const trimmed = lines[i].trim();\n if (!trimmed) continue;\n const parts = trimmed.split(/\\s+/);\n const ppid = parseInt(parts[0], 10); // PPID\n const pid = parseInt(parts[1], 10); // PID\n if (!Number.isNaN(ppid) && !Number.isNaN(pid)) {\n list.push([ppid, pid]);\n }\n }\n\n callback(null, list);\n } catch (error) {\n callback(error instanceof Error ? error : new Error(String(error)));\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,QAAQ,aAAwC;AAM3D,mCAAI,QALS;EAAC;EAAW;EAAO;EAA4B,EAC9B;EAC5B,aAAa;EACb,0BAA0B;EAC3B,GAC2B,KAAK,QAAQ,SAAS;AAChD,MAAI,KAAK;AACP,YAAS,IAAI;AACb;;AAGF,MAAI,SAAS,GAAG;AACd,4BAAS,IAAI,MAAM,yCAAyC,OAAO,CAAC;AACpE;;AAQF,MAAI,CAAC,QAAQ;AACX,4BAAS,IAAI,MAAM,uCAAuC,CAAC;AAC3D;;AAGF,MAAI;GACF,MAAM,QAAQ,OAAO,MAAMA,QAAG,IAAI;GAElC,MAAM,OAAoB,EAAE;AAC5B,QAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;IACrC,MAAM,UAAU,MAAM,GAAG,MAAM;AAC/B,QAAI,CAAC,QAAS;IACd,MAAM,QAAQ,QAAQ,MAAM,MAAM;IAClC,MAAM,OAAO,SAAS,MAAM,IAAI,GAAG;IACnC,MAAM,MAAM,SAAS,MAAM,IAAI,GAAG;AAClC,QAAI,CAAC,OAAO,MAAM,KAAK,IAAI,CAAC,OAAO,MAAM,IAAI,CAC3C,MAAK,KAAK,CAAC,MAAM,IAAI,CAAC;;AAI1B,YAAS,MAAM,KAAK;WACb,OAAO;AACd,YAAS,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC,CAAC;;GAErE"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/utils/sortAlphabetically.ts
3
4
  const sortAlphabetically = (a, b) => a.localeCompare(b);
@@ -1 +1 @@
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"}
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"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/utils/splitTextByLine.ts
3
4
  const splitTextByLines = (text) => {
@@ -1 +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"}
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"}
@@ -1,3 +1,4 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1
2
 
2
3
  //#region src/utils/verifyIdenticObjectFormat.ts
3
4
  /**
@@ -1 +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
+ {"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,4 +1,5 @@
1
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
3
  const require_handleAdditionalContentDeclarationFile = require('./handleAdditionalContentDeclarationFile.cjs');
3
4
  const require_handleContentDeclarationFileChange = require('./handleContentDeclarationFileChange.cjs');
4
5
  const require_handleContentDeclarationFileMoved = require('./handleContentDeclarationFileMoved.cjs');