@kubb/cli 5.18.6 → 5.18.8

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 (193) hide show
  1. package/dist/{Telemetry-CZJ2Noi6.cjs → Telemetry-CBzCK4kO.cjs} +5 -5
  2. package/dist/{Telemetry-CZJ2Noi6.cjs.map → Telemetry-CBzCK4kO.cjs.map} +1 -1
  3. package/dist/{Telemetry-DQG_EpcV.js → Telemetry-DUl_hxVn.js} +5 -5
  4. package/dist/{Telemetry-DQG_EpcV.js.map → Telemetry-DUl_hxVn.js.map} +1 -1
  5. package/dist/{background-Z23KW1yA.js → background-CA9lRKAK.js} +4 -4
  6. package/dist/{background-Z23KW1yA.js.map → background-CA9lRKAK.js.map} +1 -1
  7. package/dist/{background-Dsy12RvL.js → background-DK3HLyNk.js} +1 -1
  8. package/dist/{background-DIVc60mm.cjs → background-fhpYDuSs.cjs} +4 -4
  9. package/dist/{background-DIVc60mm.cjs.map → background-fhpYDuSs.cjs.map} +1 -1
  10. package/dist/{banner-BdTTDFkG.js → banner-BMIxunVW.js} +3 -3
  11. package/dist/{banner-BdTTDFkG.js.map → banner-BMIxunVW.js.map} +1 -1
  12. package/dist/{banner-wJFk-L-c.cjs → banner-GwQ2NFNI.cjs} +3 -3
  13. package/dist/{banner-wJFk-L-c.cjs.map → banner-GwQ2NFNI.cjs.map} +1 -1
  14. package/dist/config-BKi_vTvh.js +1 -0
  15. package/dist/{config-CRrmj88c.cjs → config-BU9xeaGq.cjs} +3 -3
  16. package/dist/{config-CRrmj88c.cjs.map → config-BU9xeaGq.cjs.map} +1 -1
  17. package/dist/{config-Uk3rbZfb.js → config-CGcQTdZV.js} +7 -6
  18. package/dist/config-CGcQTdZV.js.map +1 -0
  19. package/dist/{config-BWj9jBVj.cjs → config-CkTrJD0E.cjs} +7 -6
  20. package/dist/config-CkTrJD0E.cjs.map +1 -0
  21. package/dist/{config-CQTxXvIG.js → config-re864UnO.js} +5 -5
  22. package/dist/config-re864UnO.js.map +1 -0
  23. package/dist/{configFile-BPHxtrEM.cjs → configFile-BQ-Pp7i_.cjs} +5 -5
  24. package/dist/{configFile-BPHxtrEM.cjs.map → configFile-BQ-Pp7i_.cjs.map} +1 -1
  25. package/dist/{configFile-L5i7gGUc.js → configFile-CPXDgTC2.js} +5 -5
  26. package/dist/{configFile-L5i7gGUc.js.map → configFile-CPXDgTC2.js.map} +1 -1
  27. package/dist/{credentials-DEsGwcGD.cjs → credentials-Cl3eOa8G.cjs} +3 -7
  28. package/dist/{credentials-DEsGwcGD.cjs.map → credentials-Cl3eOa8G.cjs.map} +1 -1
  29. package/dist/{credentials-B77iJx9H.js → credentials-DznluKkp.js} +1 -1
  30. package/dist/{credentials-osgjujE_.js → credentials-LPHovWZe.js} +2 -2
  31. package/dist/{credentials-osgjujE_.js.map → credentials-LPHovWZe.js.map} +1 -1
  32. package/dist/{env-rv-VgSGN.js → env-BYZIPHqz.js} +3 -3
  33. package/dist/{env-rv-VgSGN.js.map → env-BYZIPHqz.js.map} +1 -1
  34. package/dist/env-BgVegN_u.js +1 -0
  35. package/dist/{env-eu3XyKqJ.cjs → env-Bi4GXVdd.cjs} +4 -7
  36. package/dist/{env-eu3XyKqJ.cjs.map → env-Bi4GXVdd.cjs.map} +1 -1
  37. package/dist/{errors-BponpdjN.cjs → errors-Bewwe8mY.cjs} +2 -2
  38. package/dist/{errors-BponpdjN.cjs.map → errors-Bewwe8mY.cjs.map} +1 -1
  39. package/dist/{errors-wzqmMpMo.js → errors-CEzFbRvL.js} +2 -2
  40. package/dist/{errors-wzqmMpMo.js.map → errors-CEzFbRvL.js.map} +1 -1
  41. package/dist/{fs-Cf1FSRh9.js → fs-CmODfKN-.js} +27 -8
  42. package/dist/fs-CmODfKN-.js.map +1 -0
  43. package/dist/index.cjs +15 -15
  44. package/dist/index.d.cts +1 -2
  45. package/dist/index.d.ts +1 -2
  46. package/dist/index.js +15 -15
  47. package/dist/{installWithSpinner-CnE4dIza.cjs → installWithSpinner-DZDlVp1J.cjs} +6 -6
  48. package/dist/{installWithSpinner-CnE4dIza.cjs.map → installWithSpinner-DZDlVp1J.cjs.map} +1 -1
  49. package/dist/{installWithSpinner-CNDzLZw-.js → installWithSpinner-gv_OWgww.js} +6 -6
  50. package/dist/{installWithSpinner-CNDzLZw-.js.map → installWithSpinner-gv_OWgww.js.map} +1 -1
  51. package/dist/{intro-DRl-pwVs.js → intro-Dun8Eqod.js} +4 -4
  52. package/dist/{intro-DRl-pwVs.js.map → intro-Dun8Eqod.js.map} +1 -1
  53. package/dist/{intro-DuyzJ3Rb.cjs → intro-PFXmY9bD.cjs} +4 -4
  54. package/dist/{intro-DuyzJ3Rb.cjs.map → intro-PFXmY9bD.cjs.map} +1 -1
  55. package/dist/{isCIEnvironment-D6xtAAZ2.js → isCIEnvironment-DAMZSlP2.js} +2 -2
  56. package/dist/{isCIEnvironment-D6xtAAZ2.js.map → isCIEnvironment-DAMZSlP2.js.map} +1 -1
  57. package/dist/{isCIEnvironment-DiVOMI5Q.cjs → isCIEnvironment-jzKqdVwJ.cjs} +2 -2
  58. package/dist/{isCIEnvironment-DiVOMI5Q.cjs.map → isCIEnvironment-jzKqdVwJ.cjs.map} +1 -1
  59. package/dist/{log-B-1vLxF1.js → log-B_uVM704.js} +3 -3
  60. package/dist/{log-B-1vLxF1.js.map → log-B_uVM704.js.map} +1 -1
  61. package/dist/{log-wv1OxLiq.cjs → log-BzmBldY6.cjs} +3 -3
  62. package/dist/{log-wv1OxLiq.cjs.map → log-BzmBldY6.cjs.map} +1 -1
  63. package/dist/{mascot-CC-D4ON2.cjs → mascot-CLw0Qmln.cjs} +14 -10
  64. package/dist/{mascot-CC-D4ON2.cjs.map → mascot-CLw0Qmln.cjs.map} +1 -1
  65. package/dist/{mascot-CmUUHLlx.js → mascot-b4yXsKwl.js} +14 -10
  66. package/dist/mascot-b4yXsKwl.js.map +1 -0
  67. package/dist/{mcp-D60W6v_6.cjs → mcp-BBD4kdKF.cjs} +3 -3
  68. package/dist/{mcp-D60W6v_6.cjs.map → mcp-BBD4kdKF.cjs.map} +1 -1
  69. package/dist/{mcp-D63ugfbT.js → mcp-CQXp9pcW.js} +3 -3
  70. package/dist/{mcp-D63ugfbT.js.map → mcp-CQXp9pcW.js.map} +1 -1
  71. package/dist/package-CdMFA8OG.js +5 -0
  72. package/dist/package-CdMFA8OG.js.map +1 -0
  73. package/dist/{package-B8KmMINL.cjs → package-DXNoJQYa.cjs} +2 -2
  74. package/dist/package-DXNoJQYa.cjs.map +1 -0
  75. package/dist/{registry-Cy48PGdh.js → registry-BBJpMlM9.js} +4 -4
  76. package/dist/{registry-Cy48PGdh.js.map → registry-BBJpMlM9.js.map} +1 -1
  77. package/dist/{registry-Q77p5TZp.cjs → registry-CTVAqQFn.cjs} +4 -4
  78. package/dist/{registry-Q77p5TZp.cjs.map → registry-CTVAqQFn.cjs.map} +1 -1
  79. package/dist/{reporters-DyjE3BzZ.cjs → reporters-CaJ8brYA.cjs} +258 -106
  80. package/dist/reporters-CaJ8brYA.cjs.map +1 -0
  81. package/dist/{reporters-9MqdcKPp.js → reporters-CzxaQ_bD.js} +1 -1
  82. package/dist/{reporters-B_USHwD6.js → reporters-DeruUk9K.js} +260 -108
  83. package/dist/reporters-DeruUk9K.js.map +1 -0
  84. package/dist/{rolldown-runtime-C3-Zg-KD.cjs → rolldown-runtime-BV8xUvPy.cjs} +4 -4
  85. package/dist/{rolldown-runtime-xo6NMXYd.js → rolldown-runtime-BowF1xt-.js} +0 -1
  86. package/dist/{run-Dx8QpT_k.js → run-96_svbr3.js} +31 -21
  87. package/dist/run-96_svbr3.js.map +1 -0
  88. package/dist/{run-DMvX80Mi.cjs → run-BIgV2zvB.cjs} +4 -4
  89. package/dist/{run-DMvX80Mi.cjs.map → run-BIgV2zvB.cjs.map} +1 -1
  90. package/dist/{run-BA5vGtx3.cjs → run-BSA2x4iE.cjs} +14 -14
  91. package/dist/{run-BA5vGtx3.cjs.map → run-BSA2x4iE.cjs.map} +1 -1
  92. package/dist/{run-D_tbKvAc.js → run-Bi8hhAzv.js} +1 -1
  93. package/dist/{run-83Aaa6qM.cjs → run-Bxqg0GuI.cjs} +8 -8
  94. package/dist/{run-83Aaa6qM.cjs.map → run-Bxqg0GuI.cjs.map} +1 -1
  95. package/dist/{run-Ch7Uuu-u.js → run-C4fd98gp.js} +7 -7
  96. package/dist/{run-Ch7Uuu-u.js.map → run-C4fd98gp.js.map} +1 -1
  97. package/dist/{run-9mcw0FWy.cjs → run-CIEKCdM-.cjs} +19 -19
  98. package/dist/run-CIEKCdM-.cjs.map +1 -0
  99. package/dist/{run-5u7cHD85.js → run-CYdKWpyH.js} +43 -23
  100. package/dist/run-CYdKWpyH.js.map +1 -0
  101. package/dist/{run-DHdlUkYt.js → run-CmHjIMpd.js} +19 -19
  102. package/dist/run-CmHjIMpd.js.map +1 -0
  103. package/dist/{run-CgXrvsL9.js → run-CpyFU0RM.js} +16 -16
  104. package/dist/{run-CgXrvsL9.js.map → run-CpyFU0RM.js.map} +1 -1
  105. package/dist/{run-CfumUZCl.cjs → run-D15oxCOd.cjs} +7 -7
  106. package/dist/{run-CfumUZCl.cjs.map → run-D15oxCOd.cjs.map} +1 -1
  107. package/dist/{run-BxNbFsmc.cjs → run-DLRu4z5Z.cjs} +30 -19
  108. package/dist/run-DLRu4z5Z.cjs.map +1 -0
  109. package/dist/run-Df4PGOFX.js +291 -0
  110. package/dist/run-Df4PGOFX.js.map +1 -0
  111. package/dist/{run-D-FHx4uQ.cjs → run-GdctJlXN.cjs} +42 -21
  112. package/dist/run-GdctJlXN.cjs.map +1 -0
  113. package/dist/{run-Do24e475.js → run-ORjkOWFp.js} +4 -4
  114. package/dist/{run-Do24e475.js.map → run-ORjkOWFp.js.map} +1 -1
  115. package/dist/{run-DhlC3it5.cjs → run-OqiJknWr.cjs} +17 -17
  116. package/dist/{run-DhlC3it5.cjs.map → run-OqiJknWr.cjs.map} +1 -1
  117. package/dist/{run-BD6A0HGa.js → run-U2Ze_QP4.js} +17 -17
  118. package/dist/{run-BD6A0HGa.js.map → run-U2Ze_QP4.js.map} +1 -1
  119. package/dist/{run-DKqUfsTv.js → run-ixh050Ip.js} +8 -8
  120. package/dist/{run-DKqUfsTv.js.map → run-ixh050Ip.js.map} +1 -1
  121. package/dist/run-k-LqKkgU.cjs +294 -0
  122. package/dist/run-k-LqKkgU.cjs.map +1 -0
  123. package/dist/{shared-KKRMm1xX.cjs → shared-DoD3p_X8.cjs} +2 -2
  124. package/dist/{shared-KKRMm1xX.cjs.map → shared-DoD3p_X8.cjs.map} +1 -1
  125. package/dist/{shared-DcDHRtZx.js → shared-SrKde4x4.js} +2 -2
  126. package/dist/{shared-DcDHRtZx.js.map → shared-SrKde4x4.js.map} +1 -1
  127. package/dist/{snapshot-C_11eUdT.cjs → snapshot-C-ge8g3_.cjs} +12 -12
  128. package/dist/snapshot-C-ge8g3_.cjs.map +1 -0
  129. package/dist/{snapshot-CbajkXfi.js → snapshot-CSacL1qI.js} +12 -12
  130. package/dist/snapshot-CSacL1qI.js.map +1 -0
  131. package/dist/{spinner-RfMb7fd6.cjs → spinner-D584jFAz.cjs} +27 -9
  132. package/dist/spinner-D584jFAz.cjs.map +1 -0
  133. package/dist/{spinner-DxsAllRI.js → spinner-D5DgYSS5.js} +3 -3
  134. package/dist/{spinner-DxsAllRI.js.map → spinner-D5DgYSS5.js.map} +1 -1
  135. package/dist/{status-CaEQY12V.js → status-Bq-Bjo2n.js} +4 -4
  136. package/dist/{status-CaEQY12V.js.map → status-Bq-Bjo2n.js.map} +1 -1
  137. package/dist/{status-CgVRLP9A.cjs → status-D-Osmkhr.cjs} +4 -4
  138. package/dist/{status-CgVRLP9A.cjs.map → status-D-Osmkhr.cjs.map} +1 -1
  139. package/dist/{studio-1Otb3b_g.js → studio-BBXKjMN-.js} +18 -18
  140. package/dist/{studio-1Otb3b_g.js.map → studio-BBXKjMN-.js.map} +1 -1
  141. package/dist/{studio-CENejJka.cjs → studio-BZ53idqa.cjs} +18 -18
  142. package/dist/{studio-CENejJka.cjs.map → studio-BZ53idqa.cjs.map} +1 -1
  143. package/dist/studioWorker.js +3 -3
  144. package/dist/{summary-BQWHL_Ca.js → summary-BS-iWuye.js} +4 -4
  145. package/dist/{summary-BQWHL_Ca.js.map → summary-BS-iWuye.js.map} +1 -1
  146. package/dist/{summary-B2Apv5KO.cjs → summary-n4osDoch.cjs} +4 -4
  147. package/dist/{summary-B2Apv5KO.cjs.map → summary-n4osDoch.cjs.map} +1 -1
  148. package/dist/{table-CR7iZJGo.js → table-BKkctGHD.js} +2 -2
  149. package/dist/{table-CR7iZJGo.js.map → table-BKkctGHD.js.map} +1 -1
  150. package/dist/{table-BlRe9YTZ.cjs → table-_fOF5WNI.cjs} +2 -2
  151. package/dist/{table-BlRe9YTZ.cjs.map → table-_fOF5WNI.cjs.map} +1 -1
  152. package/dist/{text-DMiX2dcG.cjs → text-CkCtm5VP.cjs} +2 -2
  153. package/dist/{text-DMiX2dcG.cjs.map → text-CkCtm5VP.cjs.map} +1 -1
  154. package/dist/{text-EoYn04SX.js → text-HYWAcipy.js} +2 -2
  155. package/dist/{text-EoYn04SX.js.map → text-HYWAcipy.js.map} +1 -1
  156. package/dist/{time-3BKoci3G.cjs → time-D4xUq6tx.cjs} +2 -2
  157. package/dist/{time-3BKoci3G.cjs.map → time-D4xUq6tx.cjs.map} +1 -1
  158. package/dist/{time-C-wU7VhC.js → time-D7ONPPZf.js} +2 -2
  159. package/dist/{time-C-wU7VhC.js.map → time-D7ONPPZf.js.map} +1 -1
  160. package/dist/{utils-f1C7RiEI.js → utils-BVccq6W0.js} +4 -4
  161. package/dist/{utils-f1C7RiEI.js.map → utils-BVccq6W0.js.map} +1 -1
  162. package/dist/{utils-DeXBGzGJ.cjs → utils-C9fYoqP2.cjs} +5 -5
  163. package/dist/{utils-DeXBGzGJ.cjs.map → utils-C9fYoqP2.cjs.map} +1 -1
  164. package/dist/{validate-cBMe2ndk.js → validate-BuStuH_z.js} +4 -4
  165. package/dist/{validate-cBMe2ndk.js.map → validate-BuStuH_z.js.map} +1 -1
  166. package/dist/{validate-BPYNc8h8.cjs → validate-rr0LpFhN.cjs} +4 -4
  167. package/dist/{validate-BPYNc8h8.cjs.map → validate-rr0LpFhN.cjs.map} +1 -1
  168. package/package.json +8 -8
  169. package/dist/config-BL3HnFhb.js +0 -1
  170. package/dist/config-BWj9jBVj.cjs.map +0 -1
  171. package/dist/config-CQTxXvIG.js.map +0 -1
  172. package/dist/config-Uk3rbZfb.js.map +0 -1
  173. package/dist/env-C3xHRMez.js +0 -1
  174. package/dist/fs-Cf1FSRh9.js.map +0 -1
  175. package/dist/mascot-CmUUHLlx.js.map +0 -1
  176. package/dist/package-B8KmMINL.cjs.map +0 -1
  177. package/dist/package-Cjh6pjp9.js +0 -5
  178. package/dist/package-Cjh6pjp9.js.map +0 -1
  179. package/dist/reporters-B_USHwD6.js.map +0 -1
  180. package/dist/reporters-DyjE3BzZ.cjs.map +0 -1
  181. package/dist/run-5u7cHD85.js.map +0 -1
  182. package/dist/run-9mcw0FWy.cjs.map +0 -1
  183. package/dist/run-BxNbFsmc.cjs.map +0 -1
  184. package/dist/run-CXYwjh9u.cjs +0 -229
  185. package/dist/run-CXYwjh9u.cjs.map +0 -1
  186. package/dist/run-D-FHx4uQ.cjs.map +0 -1
  187. package/dist/run-DHdlUkYt.js.map +0 -1
  188. package/dist/run-Dx8QpT_k.js.map +0 -1
  189. package/dist/run-m5ZAeYLj.js +0 -226
  190. package/dist/run-m5ZAeYLj.js.map +0 -1
  191. package/dist/snapshot-C_11eUdT.cjs.map +0 -1
  192. package/dist/snapshot-CbajkXfi.js.map +0 -1
  193. package/dist/spinner-RfMb7fd6.cjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import "./rolldown-runtime-xo6NMXYd.js";
1
+ import "./rolldown-runtime-BowF1xt-.js";
2
2
  // ../../internals/utils/src/errors.ts
3
3
  /**
4
4
  * Coerces an unknown thrown value to an `Error` instance.
@@ -28,4 +28,4 @@ function getErrorMessage(value) {
28
28
  }
29
29
  export { toError as n, getErrorMessage as t };
30
30
 
31
- //# sourceMappingURL=errors-wzqmMpMo.js.map
31
+ //# sourceMappingURL=errors-CEzFbRvL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-wzqmMpMo.js","names":[],"sources":["../../../internals/utils/src/errors.ts"],"sourcesContent":["/**\n * Coerces an unknown thrown value to an `Error` instance.\n * Returns the value as-is when it is already an `Error`; otherwise wraps it with `String(value)`.\n *\n * @example\n * ```ts\n * try { ... } catch(err) {\n * throw new Error('Build failed', { cause: toError(err) })\n * }\n * ```\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Extracts a human-readable message from any thrown value.\n *\n * @example\n * ```ts\n * getErrorMessage(new Error('oops')) // 'oops'\n * getErrorMessage('plain string') // 'plain string'\n * ```\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Returns `error` followed by every error in its `cause` chain, outermost first. Stops at a\n * non-`Error` cause or a cycle.\n *\n * @example\n * ```ts\n * getErrorChain(new Error('Config failed loading', { cause: new Error('boom') })).map((error) => error.message)\n * // ['Config failed loading', 'boom']\n * ```\n */\nexport function getErrorChain(error: unknown): Array<Error> {\n const chain: Array<Error> = []\n for (let current = error; current instanceof Error && !chain.includes(current); current = current.cause) {\n chain.push(current)\n }\n return chain\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AACjE;;;;;;;;;;AAWA,SAAgB,gBAAgB,OAAwB;CACtD,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D"}
1
+ {"version":3,"file":"errors-CEzFbRvL.js","names":[],"sources":["../../../internals/utils/src/errors.ts"],"sourcesContent":["/**\n * Coerces an unknown thrown value to an `Error` instance.\n * Returns the value as-is when it is already an `Error`; otherwise wraps it with `String(value)`.\n *\n * @example\n * ```ts\n * try { ... } catch(err) {\n * throw new Error('Build failed', { cause: toError(err) })\n * }\n * ```\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Extracts a human-readable message from any thrown value.\n *\n * @example\n * ```ts\n * getErrorMessage(new Error('oops')) // 'oops'\n * getErrorMessage('plain string') // 'plain string'\n * ```\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Returns `error` followed by every error in its `cause` chain, outermost first. Stops at a\n * non-`Error` cause or a cycle.\n *\n * @example\n * ```ts\n * getErrorChain(new Error('Config failed loading', { cause: new Error('boom') })).map((error) => error.message)\n * // ['Config failed loading', 'boom']\n * ```\n */\nexport function getErrorChain(error: unknown): Array<Error> {\n const chain: Array<Error> = []\n for (let current = error; current instanceof Error && !chain.includes(current); current = current.cause) {\n chain.push(current)\n }\n return chain\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AACjE;;;;;;;;;;AAWA,SAAgB,gBAAgB,OAAwB;CACtD,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D"}
@@ -1,6 +1,7 @@
1
- import "./rolldown-runtime-xo6NMXYd.js";
2
- import { r as runtime } from "./time-C-wU7VhC.js";
3
- import { access, mkdir, readFile, writeFile } from "node:fs/promises";
1
+ import "./rolldown-runtime-BowF1xt-.js";
2
+ import { r as runtime } from "./time-D7ONPPZf.js";
3
+ import { existsSync, readFile, readFileSync, writeFile } from "node:fs";
4
+ import { access, mkdir } from "node:fs/promises";
4
5
  import { dirname, isAbsolute, relative, resolve } from "node:path";
5
6
  // ../../internals/utils/src/fs.ts
6
7
  /**
@@ -29,7 +30,25 @@ async function exists(path) {
29
30
  */
30
31
  async function read(path) {
31
32
  if (runtime.isBun) return Bun.file(path).text();
32
- return readFile(path, { encoding: "utf8" });
33
+ return new Promise((resolvePromise, reject) => readFile(path, { encoding: "utf8" }, (error, data) => error ? reject(error) : resolvePromise(data)));
34
+ }
35
+ /**
36
+ * Reads the file at `path` as a UTF-8 string, or `null` when it does not exist or cannot be read.
37
+ * Uses `Bun.file().text()` when running under Bun, `fs.readFileSync` otherwise.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const stored = await readIfExists('./src/gen/Pet.ts') // null on a first run
42
+ * ```
43
+ */
44
+ async function readIfExists(path) {
45
+ if (runtime.isBun) return Bun.file(path).text().catch(() => null);
46
+ if (!existsSync(path)) return null;
47
+ try {
48
+ return readFileSync(path, "utf8");
49
+ } catch (_error) {
50
+ return null;
51
+ }
33
52
  }
34
53
  /**
35
54
  * Whether `stored` already holds `source`, comparing on the trimmed text rather than the exact
@@ -64,7 +83,7 @@ async function write(path, data, options = {}) {
64
83
  const content = `${trimmed}\n`;
65
84
  const resolved = resolve(path);
66
85
  if (matchesStored({
67
- stored: (options.stored === void 0 ? await read(resolved).catch(() => null) : options.stored) ?? "",
86
+ stored: (options.stored === void 0 ? await readIfExists(resolved) : options.stored) ?? "",
68
87
  source: trimmed
69
88
  })) return null;
70
89
  await writeRaw(resolved, content);
@@ -89,11 +108,11 @@ async function writeRaw(path, content) {
89
108
  return;
90
109
  }
91
110
  try {
92
- await writeFile(resolved, content, { encoding: "utf-8" });
111
+ await new Promise((resolvePromise, reject) => writeFile(resolved, content, { encoding: "utf-8" }, (error) => error ? reject(error) : resolvePromise()));
93
112
  } catch (error) {
94
113
  if (error.code !== "ENOENT") throw error;
95
114
  await mkdir(dirname(resolved), { recursive: true });
96
- await writeFile(resolved, content, { encoding: "utf-8" });
115
+ await new Promise((resolvePromise, reject) => writeFile(resolved, content, { encoding: "utf-8" }, (error) => error ? reject(error) : resolvePromise()));
97
116
  }
98
117
  }
99
118
  /**
@@ -136,4 +155,4 @@ function isPathInside(path, parent) {
136
155
  }
137
156
  export { toPosixPath as a, read as i, isPathInside as n, write as o, matchesStored as r, writeRaw as s, exists as t };
138
157
 
139
- //# sourceMappingURL=fs-Cf1FSRh9.js.map
158
+ //# sourceMappingURL=fs-CmODfKN-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs-CmODfKN-.js","names":[],"sources":["../../../internals/utils/src/fs.ts"],"sourcesContent":["import { existsSync, readFile, readFileSync, writeFile } from 'node:fs'\nimport { access, glob as globNode, mkdir } from 'node:fs/promises'\nimport { dirname, isAbsolute, join, relative, resolve } from 'node:path'\nimport { runtime } from './runtime.ts'\n\nexport { existsSync } from 'node:fs'\nexport { mkdir, mkdtemp, rm } from 'node:fs/promises'\n\n/**\n * Resolves to `true` when the file or directory at `path` exists.\n * Uses `Bun.file().exists()` when running under Bun, `fs.access` otherwise.\n *\n * @example\n * ```ts\n * if (await exists('./kubb.config.ts')) {\n * const content = await read('./kubb.config.ts')\n * }\n * ```\n */\nexport async function exists(path: string): Promise<boolean> {\n if (runtime.isBun) {\n return Bun.file(path).exists()\n }\n return access(path).then(\n () => true,\n () => false,\n )\n}\n\n/**\n * Reads the file at `path` as a UTF-8 string.\n * Uses `Bun.file().text()` when running under Bun, `fs.readFile` otherwise.\n *\n * @example\n * ```ts\n * const source = await read('./src/Pet.ts')\n * ```\n */\nexport async function read(path: string): Promise<string> {\n if (runtime.isBun) {\n return Bun.file(path).text()\n }\n // The callback API skips the `FileHandle` every `fs/promises` call opens.\n return new Promise((resolvePromise, reject) => readFile(path, { encoding: 'utf8' }, (error, data) => (error ? reject(error) : resolvePromise(data))))\n}\n\n/**\n * Reads the file at `path` as a UTF-8 string, or `null` when it does not exist or cannot be read.\n * Uses `Bun.file().text()` when running under Bun, `fs.readFileSync` otherwise.\n *\n * @example\n * ```ts\n * const stored = await readIfExists('./src/gen/Pet.ts') // null on a first run\n * ```\n */\nexport async function readIfExists(path: string): Promise<string | null> {\n if (runtime.isBun) {\n return Bun.file(path)\n .text()\n .catch(() => null)\n }\n // A small read is faster on the main thread than a thread-pool round trip, and `existsSync`\n // answers a missing file without building an error.\n if (!existsSync(path)) return null\n try {\n return readFileSync(path, 'utf8')\n } catch (_error) {\n return null\n }\n}\n\ntype WriteOptions = {\n /**\n * Previously read content, or `null` when the file does not exist.\n * Omitting this value reads the file before writing.\n */\n stored?: string | null\n /**\n * When `true`, re-reads the file immediately after writing and throws if the\n * content does not match — useful for catching write failures on unreliable file systems.\n */\n sanity?: boolean\n}\n\n/**\n * Whether `stored` already holds `source`, comparing on the trimmed text rather than the exact\n * bytes. Surrounding whitespace is what a formatter adds and what editors strip, and neither is a\n * reason to rewrite the file.\n *\n * Both sides are trimmed, so a storage that keeps bytes verbatim settles on the same answer as one\n * that normalizes what it stores. Trimming only `stored` would leave a source with leading\n * whitespace rewritten on every build, since the stored copy keeps the whitespace the comparison\n * has already dropped.\n */\nexport function matchesStored({ stored, source }: { stored: string; source: string }): boolean {\n return stored.trim() === source.trim()\n}\n\n/**\n * Writes `data` to `path`, trimming surrounding whitespace and ending the file with a single newline\n * the way prettier, biome, and oxfmt all do.\n * Skips the write when the trimmed content is empty, or when the file already holds that content.\n * Creates any missing parent directories automatically.\n * When `sanity` is `true`, re-reads the file after writing and throws if the content does not match.\n *\n * @example\n * ```ts\n * await write('./src/Pet.ts', source) // writes and returns the trimmed content plus a newline\n * await write('./src/Pet.ts', source) // null — file unchanged\n * await write('./src/Pet.ts', ' ') // null — empty content skipped\n * ```\n */\nexport async function write(path: string, data: string, options: WriteOptions = {}): Promise<string | null> {\n const trimmed = data.trim()\n if (trimmed === '') return null\n\n const content = `${trimmed}\\n`\n const resolved = resolve(path)\n const stored = options.stored === undefined ? await readIfExists(resolved) : options.stored\n if (matchesStored({ stored: stored ?? '', source: trimmed })) return null\n\n await writeRaw(resolved, content)\n\n if (options.sanity) {\n const savedData = await read(resolved)\n if (savedData !== content) {\n throw new Error(`Sanity check failed for ${path}\\n\\nData[${data.length}]:\\n${data}\\n\\nSaved[${savedData.length}]:\\n${savedData}\\n`)\n }\n return savedData\n }\n\n return content\n}\n\n/**\n * Writes UTF-8 content verbatim, including empty files and surrounding whitespace.\n * Uses Bun.write under Bun and creates missing parent directories under either runtime.\n *\n * @example\n * await writeRaw('./cache/output.ts', ' // keep these bytes\\n\\n')\n */\nexport async function writeRaw(path: string, content: string): Promise<void> {\n const resolved = resolve(path)\n if (runtime.isBun) {\n await Bun.write(resolved, content)\n return\n }\n try {\n await new Promise<void>((resolvePromise, reject) =>\n writeFile(resolved, content, { encoding: 'utf-8' }, (error) => (error ? reject(error) : resolvePromise())),\n )\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n await mkdir(dirname(resolved), { recursive: true })\n await new Promise<void>((resolvePromise, reject) =>\n writeFile(resolved, content, { encoding: 'utf-8' }, (error) => (error ? reject(error) : resolvePromise())),\n )\n }\n}\n\n/**\n * Lists non-hidden regular files below `directory` as relative POSIX paths, excluding directories and symlinks.\n * Uses Bun.Glob under Bun because its Node glob compatibility API lacks directory-entry support.\n *\n * @example\n * for await (const path of listFiles('./src')) console.log(path)\n */\nexport async function* listFiles(directory: string): AsyncGenerator<string> {\n const cwd = resolve(directory)\n if (runtime.isBun) {\n yield* new Bun.Glob('**/*').scan({ cwd, dot: false, onlyFiles: true, followSymlinks: false })\n return\n }\n for await (const entry of globNode('**/*', { cwd, withFileTypes: true })) {\n if (entry.isFile()) yield toPosixPath(relative(cwd, join(entry.parentPath, entry.name)))\n }\n}\n\n/**\n * Converts a filesystem path to use POSIX (`/`) separators.\n *\n * Most of the codebase compares and composes paths as strings (prefix matching, joining for\n * import specifiers, splitting on `/`). On POSIX `path.resolve` already returns `/`-separated\n * paths, but on Windows it returns `\\`-separated paths, which breaks every such comparison.\n *\n * Routing every path that crosses a module boundary through `toPosixPath` keeps the rest of the\n * code platform-agnostic. The conversion runs unconditionally so Windows-specific behavior is\n * exercisable from POSIX CI.\n *\n * @example\n * toPosixPath('C:\\\\repo\\\\src\\\\pet.ts') // 'C:/repo/src/pet.ts'\n */\nexport function toPosixPath(filePath: string): string {\n return filePath.replaceAll('\\\\', '/')\n}\n\n/**\n * Resolves to `true` when `path` is `parent` itself or nested inside it. Both sides are resolved\n * to absolute paths first, so relative and `..`-containing inputs compare correctly.\n *\n * Guards a destructive or an out-of-tree operation: before wiping an output directory, check that\n * it does not contain the project root, and before loading a path a caller supplied, check that it\n * did not escape the directory it is allowed to read from.\n *\n * @example\n * isPathInside('./src/gen', '.') // true — nested inside the root\n * isPathInside('.', '.') // true — the same directory counts as inside\n * isPathInside('.', './src/gen') // false — the root is not inside its own output\n * isPathInside('../other', '.') // false — escapes the root\n */\nexport function isPathInside(path: string, parent: string): boolean {\n const resolvedPath = resolve(path)\n const resolvedParent = resolve(parent)\n if (resolvedPath === resolvedParent) {\n return true\n }\n\n const rel = relative(resolvedParent, resolvedPath)\n\n return rel !== '' && !rel.startsWith('..') && !isAbsolute(rel)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,eAAsB,OAAO,MAAgC;CAC3D,IAAI,QAAQ,OACV,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,OAAO;CAE/B,OAAO,OAAO,IAAI,CAAC,CAAC,WACZ,YACA,KACR;AACF;;;;;;;;;;AAWA,eAAsB,KAAK,MAA+B;CACxD,IAAI,QAAQ,OACV,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,KAAK;CAG7B,OAAO,IAAI,SAAS,gBAAgB,WAAW,SAAS,MAAM,EAAE,UAAU,OAAO,IAAI,OAAO,SAAU,QAAQ,OAAO,KAAK,IAAI,eAAe,IAAI,CAAE,CAAC;AACtJ;;;;;;;;;;AAWA,eAAsB,aAAa,MAAsC;CACvE,IAAI,QAAQ,OACV,OAAO,IAAI,KAAK,IAAI,CAAC,CAClB,KAAK,CAAC,CACN,YAAY,IAAI;CAIrB,IAAI,CAAC,WAAW,IAAI,GAAG,OAAO;CAC9B,IAAI;EACF,OAAO,aAAa,MAAM,MAA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,KAAK,IAAI,eAAe,CAAE,CAC3G;CACF;AACF;;;;;;;;;;;;;;;AAkCA,SAAgB,YAAY,UAA0B;CACpD,OAAO,SAAS,WAAW,MAAM,GAAG;AACtC;;;;;;;;;;;;;;;AAgBA,SAAgB,aAAa,MAAc,QAAyB;CAClE,MAAM,eAAe,QAAQ,IAAI;CACjC,MAAM,iBAAiB,QAAQ,MAAM;CACrC,IAAI,iBAAiB,gBACnB,OAAO;CAGT,MAAM,MAAM,SAAS,gBAAgB,YAAY;CAEjD,OAAO,QAAQ,MAAM,CAAC,IAAI,WAAW,IAAI,KAAK,CAAC,WAAW,GAAG;AAC/D"}
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("./rolldown-runtime-C3-Zg-KD.cjs");
3
- const require_package = require("./package-B8KmMINL.cjs");
4
- const require_Telemetry = require("./Telemetry-CZJ2Noi6.cjs");
5
- const require_mascot = require("./mascot-CC-D4ON2.cjs");
6
- const require_shared = require("./shared-KKRMm1xX.cjs");
2
+ const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
3
+ const require_Telemetry = require("./Telemetry-CBzCK4kO.cjs");
4
+ const require_package = require("./package-DXNoJQYa.cjs");
5
+ const require_mascot = require("./mascot-CLw0Qmln.cjs");
6
+ const require_shared = require("./shared-DoD3p_X8.cjs");
7
7
  let node_util = require("node:util");
8
8
  let _gunshi_plugin_dryrun = require("@gunshi/plugin-dryrun");
9
9
  _gunshi_plugin_dryrun = require_rolldown_runtime.__toESM(_gunshi_plugin_dryrun, 1);
@@ -88,7 +88,7 @@ const command = (0, gunshi.defineWithTypes)()({
88
88
  async run(ctx) {
89
89
  const { values } = ctx;
90
90
  const logLevel = resolveLogLevel(values);
91
- const { run } = await Promise.resolve().then(() => require("./run-CXYwjh9u.cjs"));
91
+ const { run } = await Promise.resolve().then(() => require("./run-k-LqKkgU.cjs"));
92
92
  await run({
93
93
  input: values.input,
94
94
  configPath: values.config,
@@ -134,14 +134,14 @@ function resolveDeprecatedFlags(args) {
134
134
  // src/index.ts
135
135
  /** The subcommands besides `generate`, imported only when the run needs them, so `kubb generate` never loads their code. */
136
136
  const commandLoaders = {
137
- init: () => Promise.resolve().then(() => require("./run-BA5vGtx3.cjs")),
138
- validate: () => Promise.resolve().then(() => require("./validate-BPYNc8h8.cjs")),
139
- mcp: () => Promise.resolve().then(() => require("./mcp-D60W6v_6.cjs")),
140
- studio: () => Promise.resolve().then(() => require("./studio-CENejJka.cjs")),
141
- add: () => Promise.resolve().then(() => require("./run-D-FHx4uQ.cjs")),
142
- update: () => Promise.resolve().then(() => require("./run-9mcw0FWy.cjs")),
143
- remove: () => Promise.resolve().then(() => require("./run-BxNbFsmc.cjs")),
144
- list: () => Promise.resolve().then(() => require("./run-CfumUZCl.cjs"))
137
+ init: () => Promise.resolve().then(() => require("./run-BSA2x4iE.cjs")),
138
+ validate: () => Promise.resolve().then(() => require("./validate-rr0LpFhN.cjs")),
139
+ mcp: () => Promise.resolve().then(() => require("./mcp-BBD4kdKF.cjs")),
140
+ studio: () => Promise.resolve().then(() => require("./studio-BZ53idqa.cjs")),
141
+ add: () => Promise.resolve().then(() => require("./run-GdctJlXN.cjs")),
142
+ update: () => Promise.resolve().then(() => require("./run-CIEKCdM-.cjs")),
143
+ remove: () => Promise.resolve().then(() => require("./run-DLRu4z5Z.cjs")),
144
+ list: () => Promise.resolve().then(() => require("./run-D15oxCOd.cjs"))
145
145
  };
146
146
  /** Flags that print the root help, which lists every subcommand. */
147
147
  const HELP_FLAGS = /* @__PURE__ */ new Set(["--help", "-h"]);
@@ -164,7 +164,7 @@ async function run(argv = process.argv.slice(2)) {
164
164
  if (Object.hasOwn(commandLoaders, name)) names = [name];
165
165
  if (!names.length && resolvedArgs.some((arg) => HELP_FLAGS.has(arg))) names = Object.keys(commandLoaders);
166
166
  const modules = Object.fromEntries(await Promise.all(names.map(async (key) => [key, await commandLoaders[key]()])));
167
- const args = name === "studio" ? (await Promise.resolve().then(() => require("./studio-CENejJka.cjs"))).routeStudioFlags(resolvedArgs) : resolvedArgs;
167
+ const args = name === "studio" ? (await Promise.resolve().then(() => require("./studio-BZ53idqa.cjs"))).routeStudioFlags(resolvedArgs) : resolvedArgs;
168
168
  const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg));
169
169
  const isJsonOutput = args.includes("--json") || args.some((arg, index) => /^--reporter=.*\bjson\b/.test(arg) || arg === "--reporter" && /\bjson\b/.test(args[index + 1] ?? ""));
170
170
  if (!require_Telemetry.isDisabled() && !isQuietFlag) console.error(`${(0, node_util.styleText)("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${(0, node_util.styleText)("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
package/dist/index.d.cts CHANGED
@@ -2,5 +2,4 @@
2
2
  * Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a
3
3
  * quiet flag is passed, then runs the given command, or `generate` when none is given.
4
4
  */
5
- export declare function run(argv?: Array<string>): Promise<void>;
6
- //# sourceMappingURL=index.d.cts.map
5
+ export declare function run(argv?: Array<string>): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -2,5 +2,4 @@
2
2
  * Entry point for the `kubb` CLI. Prints the telemetry notice unless telemetry is disabled or a
3
3
  * quiet flag is passed, then runs the given command, or `generate` when none is given.
4
4
  */
5
- export declare function run(argv?: Array<string>): Promise<void>;
6
- //# sourceMappingURL=index.d.ts.map
5
+ export declare function run(argv?: Array<string>): Promise<void>;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import "./rolldown-runtime-xo6NMXYd.js";
2
- import { t as version } from "./package-Cjh6pjp9.js";
3
- import { t as isDisabled } from "./Telemetry-DQG_EpcV.js";
4
- import { r as wantsMascot, t as getBanner } from "./mascot-CmUUHLlx.js";
5
- import { n as dryRunId, r as logLevelArg, t as configArg } from "./shared-DcDHRtZx.js";
1
+ import "./rolldown-runtime-BowF1xt-.js";
2
+ import { t as isDisabled } from "./Telemetry-DUl_hxVn.js";
3
+ import { t as version } from "./package-CdMFA8OG.js";
4
+ import { r as wantsMascot, t as getBanner } from "./mascot-b4yXsKwl.js";
5
+ import { n as dryRunId, r as logLevelArg, t as configArg } from "./shared-SrKde4x4.js";
6
6
  import { styleText } from "node:util";
7
7
  import dryrun from "@gunshi/plugin-dryrun";
8
8
  import { cli, defineWithTypes } from "gunshi";
@@ -86,7 +86,7 @@ const command = defineWithTypes()({
86
86
  async run(ctx) {
87
87
  const { values } = ctx;
88
88
  const logLevel = resolveLogLevel(values);
89
- const { run } = await import("./run-m5ZAeYLj.js");
89
+ const { run } = await import("./run-Df4PGOFX.js");
90
90
  await run({
91
91
  input: values.input,
92
92
  configPath: values.config,
@@ -132,14 +132,14 @@ function resolveDeprecatedFlags(args) {
132
132
  // src/index.ts
133
133
  /** The subcommands besides `generate`, imported only when the run needs them, so `kubb generate` never loads their code. */
134
134
  const commandLoaders = {
135
- init: () => import("./run-CgXrvsL9.js"),
136
- validate: () => import("./validate-cBMe2ndk.js"),
137
- mcp: () => import("./mcp-D63ugfbT.js"),
138
- studio: () => import("./studio-1Otb3b_g.js"),
139
- add: () => import("./run-5u7cHD85.js"),
140
- update: () => import("./run-DHdlUkYt.js"),
141
- remove: () => import("./run-Dx8QpT_k.js"),
142
- list: () => import("./run-Ch7Uuu-u.js")
135
+ init: () => import("./run-CpyFU0RM.js"),
136
+ validate: () => import("./validate-BuStuH_z.js"),
137
+ mcp: () => import("./mcp-CQXp9pcW.js"),
138
+ studio: () => import("./studio-BBXKjMN-.js"),
139
+ add: () => import("./run-CYdKWpyH.js"),
140
+ update: () => import("./run-CmHjIMpd.js"),
141
+ remove: () => import("./run-96_svbr3.js"),
142
+ list: () => import("./run-C4fd98gp.js")
143
143
  };
144
144
  /** Flags that print the root help, which lists every subcommand. */
145
145
  const HELP_FLAGS = /* @__PURE__ */ new Set(["--help", "-h"]);
@@ -162,7 +162,7 @@ async function run(argv = process.argv.slice(2)) {
162
162
  if (Object.hasOwn(commandLoaders, name)) names = [name];
163
163
  if (!names.length && resolvedArgs.some((arg) => HELP_FLAGS.has(arg))) names = Object.keys(commandLoaders);
164
164
  const modules = Object.fromEntries(await Promise.all(names.map(async (key) => [key, await commandLoaders[key]()])));
165
- const args = name === "studio" ? (await import("./studio-1Otb3b_g.js")).routeStudioFlags(resolvedArgs) : resolvedArgs;
165
+ const args = name === "studio" ? (await import("./studio-BBXKjMN-.js")).routeStudioFlags(resolvedArgs) : resolvedArgs;
166
166
  const isQuietFlag = args.some((arg) => QUIET_FLAGS.has(arg));
167
167
  const isJsonOutput = args.includes("--json") || args.some((arg, index) => /^--reporter=.*\bjson\b/.test(arg) || arg === "--reporter" && /\bjson\b/.test(args[index + 1] ?? ""));
168
168
  if (!isDisabled() && !isQuietFlag) console.error(`${styleText("yellow", "Notice:")} Kubb collects anonymous telemetry data to help improve the tool. No personal data or file contents are collected. \nTo disable, set ${styleText("cyan", "KUBB_DISABLE_TELEMETRY=1")}.\n`);
@@ -1,8 +1,8 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-C3-Zg-KD.cjs");
2
- const require_utils = require("./utils-DeXBGzGJ.cjs");
3
- const require_time = require("./time-3BKoci3G.cjs");
4
- const require_spinner = require("./spinner-RfMb7fd6.cjs");
5
- const require_env = require("./env-eu3XyKqJ.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
2
+ const require_time = require("./time-D4xUq6tx.cjs");
3
+ const require_env = require("./env-Bi4GXVdd.cjs");
4
+ const require_spinner = require("./spinner-D584jFAz.cjs");
5
+ const require_utils = require("./utils-C9fYoqP2.cjs");
6
6
  let node_process = require("node:process");
7
7
  node_process = require_rolldown_runtime.__toESM(node_process, 1);
8
8
  let _clack_prompts = require("@clack/prompts");
@@ -53,4 +53,4 @@ Object.defineProperty(exports, "installWithSpinner", {
53
53
  }
54
54
  });
55
55
 
56
- //# sourceMappingURL=installWithSpinner-CnE4dIza.cjs.map
56
+ //# sourceMappingURL=installWithSpinner-DZDlVp1J.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"installWithSpinner-CnE4dIza.cjs","names":["installPackages","process","formatMs","getElapsedMs","isRichOutput","clack","createSpinner"],"sources":["../src/runners/installWithSpinner.ts"],"sourcesContent":["import process from 'node:process'\nimport * as clack from '@clack/prompts'\nimport { formatMs, getElapsedMs } from '@internals/utils'\nimport { isRichOutput } from '../utils/env.ts'\nimport { createSpinner } from '../ui/spinner.ts'\nimport { installPackages, type PackageManagerInfo } from './init/utils.ts'\n\n/** How many package manager lines stay visible under the install title while it runs. */\nconst LOG_LINES = 6\n\n/**\n * Installs `packages` and reports how long it took. A rich terminal shows the package manager's\n * last lines under the title while the install runs and clears them when it succeeds; a plain one\n * prints the start and end lines. A failed install keeps the output, reports the failure and rethrows.\n */\nexport async function installWithSpinner({\n packages,\n names,\n packageManager,\n cwd,\n install = installPackages,\n}: {\n packages: Array<string>\n names: string\n packageManager: PackageManagerInfo\n cwd: string\n /** Runs the install itself, so a dry run can skip it. */\n install?: typeof installPackages\n}): Promise<void> {\n const start = process.hrtime()\n const task = createTask(`Installing ${names} with ${packageManager.name}`)\n try {\n await install(packages, packageManager, cwd, task.message)\n } catch (error) {\n task.error('Install failed')\n throw error\n }\n task.success(`Installed ${names} with ${packageManager.name} in ${formatMs(getElapsedMs(start))}`)\n}\n\ntype Task = { message: (line: string) => void; error: (text: string) => void; success: (text: string) => void }\n\n// clack's taskLog prints nothing at the end outside a TTY, so a plain terminal keeps the spinner writer.\n// The failure keeps no log: the thrown error already carries the last lines.\nfunction createTask(title: string): Task {\n if (isRichOutput()) {\n const log = clack.taskLog({ title, limit: LOG_LINES })\n return { message: (line) => log.message(line), error: (text) => log.error(text, { showLog: false }), success: (text) => log.success(text) }\n }\n const spinner = createSpinner()\n spinner.start(title)\n return { message: () => {}, error: (text) => spinner.error(text), success: (text) => spinner.stop(text) }\n}\n"],"mappings":";;;;;;;;;;;AAQA,MAAM,YAAY;;;;;;AAOlB,eAAsB,mBAAmB,EACvC,UACA,OACA,gBACA,KACA,UAAUA,cAAAA,mBAQM;CAChB,MAAM,QAAQC,aAAAA,QAAQ,OAAO;CAC7B,MAAM,OAAO,WAAW,cAAc,MAAM,QAAQ,eAAe,MAAM;CACzE,IAAI;EACF,MAAM,QAAQ,UAAU,gBAAgB,KAAK,KAAK,OAAO;CAC3D,SAAS,OAAO;EACd,KAAK,MAAM,gBAAgB;EAC3B,MAAM;CACR;CACA,KAAK,QAAQ,aAAa,MAAM,QAAQ,eAAe,KAAK,MAAMC,aAAAA,SAASC,aAAAA,aAAa,KAAK,CAAC,GAAG;AACnG;AAMA,SAAS,WAAW,OAAqB;CACvC,IAAIC,YAAAA,aAAa,GAAG;EAClB,MAAM,MAAMC,eAAM,QAAQ;GAAE;GAAO,OAAO;EAAU,CAAC;EACrD,OAAO;GAAE,UAAU,SAAS,IAAI,QAAQ,IAAI;GAAG,QAAQ,SAAS,IAAI,MAAM,MAAM,EAAE,SAAS,MAAM,CAAC;GAAG,UAAU,SAAS,IAAI,QAAQ,IAAI;EAAE;CAC5I;CACA,MAAM,UAAUC,gBAAAA,cAAc;CAC9B,QAAQ,MAAM,KAAK;CACnB,OAAO;EAAE,eAAe,CAAC;EAAG,QAAQ,SAAS,QAAQ,MAAM,IAAI;EAAG,UAAU,SAAS,QAAQ,KAAK,IAAI;CAAE;AAC1G"}
1
+ {"version":3,"file":"installWithSpinner-DZDlVp1J.cjs","names":["installPackages","process","formatMs","getElapsedMs","isRichOutput","clack","createSpinner"],"sources":["../src/runners/installWithSpinner.ts"],"sourcesContent":["import process from 'node:process'\nimport * as clack from '@clack/prompts'\nimport { formatMs, getElapsedMs } from '@internals/utils'\nimport { isRichOutput } from '../utils/env.ts'\nimport { createSpinner } from '../ui/spinner.ts'\nimport { installPackages, type PackageManagerInfo } from './init/utils.ts'\n\n/** How many package manager lines stay visible under the install title while it runs. */\nconst LOG_LINES = 6\n\n/**\n * Installs `packages` and reports how long it took. A rich terminal shows the package manager's\n * last lines under the title while the install runs and clears them when it succeeds; a plain one\n * prints the start and end lines. A failed install keeps the output, reports the failure and rethrows.\n */\nexport async function installWithSpinner({\n packages,\n names,\n packageManager,\n cwd,\n install = installPackages,\n}: {\n packages: Array<string>\n names: string\n packageManager: PackageManagerInfo\n cwd: string\n /** Runs the install itself, so a dry run can skip it. */\n install?: typeof installPackages\n}): Promise<void> {\n const start = process.hrtime()\n const task = createTask(`Installing ${names} with ${packageManager.name}`)\n try {\n await install(packages, packageManager, cwd, task.message)\n } catch (error) {\n task.error('Install failed')\n throw error\n }\n task.success(`Installed ${names} with ${packageManager.name} in ${formatMs(getElapsedMs(start))}`)\n}\n\ntype Task = { message: (line: string) => void; error: (text: string) => void; success: (text: string) => void }\n\n// clack's taskLog prints nothing at the end outside a TTY, so a plain terminal keeps the spinner writer.\n// The failure keeps no log: the thrown error already carries the last lines.\nfunction createTask(title: string): Task {\n if (isRichOutput()) {\n const log = clack.taskLog({ title, limit: LOG_LINES })\n return { message: (line) => log.message(line), error: (text) => log.error(text, { showLog: false }), success: (text) => log.success(text) }\n }\n const spinner = createSpinner()\n spinner.start(title)\n return { message: () => {}, error: (text) => spinner.error(text), success: (text) => spinner.stop(text) }\n}\n"],"mappings":";;;;;;;;;;;AAQA,MAAM,YAAY;;;;;;AAOlB,eAAsB,mBAAmB,EACvC,UACA,OACA,gBACA,KACA,UAAUA,cAAAA,mBAQM;CAChB,MAAM,QAAQC,aAAAA,QAAQ,OAAO;CAC7B,MAAM,OAAO,WAAW,cAAc,MAAM,QAAQ,eAAe,MAAM;CACzE,IAAI;EACF,MAAM,QAAQ,UAAU,gBAAgB,KAAK,KAAK,OAAO;CAC3D,SAAS,OAAO;EACd,KAAK,MAAM,gBAAgB;EAC3B,MAAM;CACR;CACA,KAAK,QAAQ,aAAa,MAAM,QAAQ,eAAe,KAAK,MAAMC,aAAAA,SAASC,aAAAA,aAAa,KAAK,CAAC,GAAG;AACnG;AAMA,SAAS,WAAW,OAAqB;CACvC,IAAIC,YAAAA,aAAa,GAAG;EAClB,MAAM,MAAMC,eAAM,QAAQ;GAAE;GAAO,OAAO;EAAU,CAAC;EACrD,OAAO;GAAE,UAAU,SAAS,IAAI,QAAQ,IAAI;GAAG,QAAQ,SAAS,IAAI,MAAM,MAAM,EAAE,SAAS,MAAM,CAAC;GAAG,UAAU,SAAS,IAAI,QAAQ,IAAI;EAAE;CAC5I;CACA,MAAM,UAAUC,gBAAAA,cAAc;CAC9B,QAAQ,MAAM,KAAK;CACnB,OAAO;EAAE,eAAe,CAAC;EAAG,QAAQ,SAAS,QAAQ,MAAM,IAAI;EAAG,UAAU,SAAS,QAAQ,KAAK,IAAI;CAAE;AAC1G"}
@@ -1,8 +1,8 @@
1
- import "./rolldown-runtime-xo6NMXYd.js";
2
- import { s as installPackages } from "./utils-f1C7RiEI.js";
3
- import { n as getElapsedMs, t as formatMs } from "./time-C-wU7VhC.js";
4
- import { n as isRichOutput } from "./env-rv-VgSGN.js";
5
- import { t as createSpinner } from "./spinner-DxsAllRI.js";
1
+ import "./rolldown-runtime-BowF1xt-.js";
2
+ import { n as getElapsedMs, t as formatMs } from "./time-D7ONPPZf.js";
3
+ import { n as isRichOutput } from "./env-BYZIPHqz.js";
4
+ import { t as createSpinner } from "./spinner-D5DgYSS5.js";
5
+ import { s as installPackages } from "./utils-BVccq6W0.js";
6
6
  import process from "node:process";
7
7
  import * as clack from "@clack/prompts";
8
8
  // src/runners/installWithSpinner.ts
@@ -46,4 +46,4 @@ function createTask(title) {
46
46
  }
47
47
  export { installWithSpinner as t };
48
48
 
49
- //# sourceMappingURL=installWithSpinner-CNDzLZw-.js.map
49
+ //# sourceMappingURL=installWithSpinner-gv_OWgww.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"installWithSpinner-CNDzLZw-.js","names":[],"sources":["../src/runners/installWithSpinner.ts"],"sourcesContent":["import process from 'node:process'\nimport * as clack from '@clack/prompts'\nimport { formatMs, getElapsedMs } from '@internals/utils'\nimport { isRichOutput } from '../utils/env.ts'\nimport { createSpinner } from '../ui/spinner.ts'\nimport { installPackages, type PackageManagerInfo } from './init/utils.ts'\n\n/** How many package manager lines stay visible under the install title while it runs. */\nconst LOG_LINES = 6\n\n/**\n * Installs `packages` and reports how long it took. A rich terminal shows the package manager's\n * last lines under the title while the install runs and clears them when it succeeds; a plain one\n * prints the start and end lines. A failed install keeps the output, reports the failure and rethrows.\n */\nexport async function installWithSpinner({\n packages,\n names,\n packageManager,\n cwd,\n install = installPackages,\n}: {\n packages: Array<string>\n names: string\n packageManager: PackageManagerInfo\n cwd: string\n /** Runs the install itself, so a dry run can skip it. */\n install?: typeof installPackages\n}): Promise<void> {\n const start = process.hrtime()\n const task = createTask(`Installing ${names} with ${packageManager.name}`)\n try {\n await install(packages, packageManager, cwd, task.message)\n } catch (error) {\n task.error('Install failed')\n throw error\n }\n task.success(`Installed ${names} with ${packageManager.name} in ${formatMs(getElapsedMs(start))}`)\n}\n\ntype Task = { message: (line: string) => void; error: (text: string) => void; success: (text: string) => void }\n\n// clack's taskLog prints nothing at the end outside a TTY, so a plain terminal keeps the spinner writer.\n// The failure keeps no log: the thrown error already carries the last lines.\nfunction createTask(title: string): Task {\n if (isRichOutput()) {\n const log = clack.taskLog({ title, limit: LOG_LINES })\n return { message: (line) => log.message(line), error: (text) => log.error(text, { showLog: false }), success: (text) => log.success(text) }\n }\n const spinner = createSpinner()\n spinner.start(title)\n return { message: () => {}, error: (text) => spinner.error(text), success: (text) => spinner.stop(text) }\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,YAAY;;;;;;AAOlB,eAAsB,mBAAmB,EACvC,UACA,OACA,gBACA,KACA,UAAU,mBAQM;CAChB,MAAM,QAAQ,QAAQ,OAAO;CAC7B,MAAM,OAAO,WAAW,cAAc,MAAM,QAAQ,eAAe,MAAM;CACzE,IAAI;EACF,MAAM,QAAQ,UAAU,gBAAgB,KAAK,KAAK,OAAO;CAC3D,SAAS,OAAO;EACd,KAAK,MAAM,gBAAgB;EAC3B,MAAM;CACR;CACA,KAAK,QAAQ,aAAa,MAAM,QAAQ,eAAe,KAAK,MAAM,SAAS,aAAa,KAAK,CAAC,GAAG;AACnG;AAMA,SAAS,WAAW,OAAqB;CACvC,IAAI,aAAa,GAAG;EAClB,MAAM,MAAM,MAAM,QAAQ;GAAE;GAAO,OAAO;EAAU,CAAC;EACrD,OAAO;GAAE,UAAU,SAAS,IAAI,QAAQ,IAAI;GAAG,QAAQ,SAAS,IAAI,MAAM,MAAM,EAAE,SAAS,MAAM,CAAC;GAAG,UAAU,SAAS,IAAI,QAAQ,IAAI;EAAE;CAC5I;CACA,MAAM,UAAU,cAAc;CAC9B,QAAQ,MAAM,KAAK;CACnB,OAAO;EAAE,eAAe,CAAC;EAAG,QAAQ,SAAS,QAAQ,MAAM,IAAI;EAAG,UAAU,SAAS,QAAQ,KAAK,IAAI;CAAE;AAC1G"}
1
+ {"version":3,"file":"installWithSpinner-gv_OWgww.js","names":[],"sources":["../src/runners/installWithSpinner.ts"],"sourcesContent":["import process from 'node:process'\nimport * as clack from '@clack/prompts'\nimport { formatMs, getElapsedMs } from '@internals/utils'\nimport { isRichOutput } from '../utils/env.ts'\nimport { createSpinner } from '../ui/spinner.ts'\nimport { installPackages, type PackageManagerInfo } from './init/utils.ts'\n\n/** How many package manager lines stay visible under the install title while it runs. */\nconst LOG_LINES = 6\n\n/**\n * Installs `packages` and reports how long it took. A rich terminal shows the package manager's\n * last lines under the title while the install runs and clears them when it succeeds; a plain one\n * prints the start and end lines. A failed install keeps the output, reports the failure and rethrows.\n */\nexport async function installWithSpinner({\n packages,\n names,\n packageManager,\n cwd,\n install = installPackages,\n}: {\n packages: Array<string>\n names: string\n packageManager: PackageManagerInfo\n cwd: string\n /** Runs the install itself, so a dry run can skip it. */\n install?: typeof installPackages\n}): Promise<void> {\n const start = process.hrtime()\n const task = createTask(`Installing ${names} with ${packageManager.name}`)\n try {\n await install(packages, packageManager, cwd, task.message)\n } catch (error) {\n task.error('Install failed')\n throw error\n }\n task.success(`Installed ${names} with ${packageManager.name} in ${formatMs(getElapsedMs(start))}`)\n}\n\ntype Task = { message: (line: string) => void; error: (text: string) => void; success: (text: string) => void }\n\n// clack's taskLog prints nothing at the end outside a TTY, so a plain terminal keeps the spinner writer.\n// The failure keeps no log: the thrown error already carries the last lines.\nfunction createTask(title: string): Task {\n if (isRichOutput()) {\n const log = clack.taskLog({ title, limit: LOG_LINES })\n return { message: (line) => log.message(line), error: (text) => log.error(text, { showLog: false }), success: (text) => log.success(text) }\n }\n const spinner = createSpinner()\n spinner.start(title)\n return { message: () => {}, error: (text) => spinner.error(text), success: (text) => spinner.stop(text) }\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,YAAY;;;;;;AAOlB,eAAsB,mBAAmB,EACvC,UACA,OACA,gBACA,KACA,UAAU,mBAQM;CAChB,MAAM,QAAQ,QAAQ,OAAO;CAC7B,MAAM,OAAO,WAAW,cAAc,MAAM,QAAQ,eAAe,MAAM;CACzE,IAAI;EACF,MAAM,QAAQ,UAAU,gBAAgB,KAAK,KAAK,OAAO;CAC3D,SAAS,OAAO;EACd,KAAK,MAAM,gBAAgB;EAC3B,MAAM;CACR;CACA,KAAK,QAAQ,aAAa,MAAM,QAAQ,eAAe,KAAK,MAAM,SAAS,aAAa,KAAK,CAAC,GAAG;AACnG;AAMA,SAAS,WAAW,OAAqB;CACvC,IAAI,aAAa,GAAG;EAClB,MAAM,MAAM,MAAM,QAAQ;GAAE;GAAO,OAAO;EAAU,CAAC;EACrD,OAAO;GAAE,UAAU,SAAS,IAAI,QAAQ,IAAI;GAAG,QAAQ,SAAS,IAAI,MAAM,MAAM,EAAE,SAAS,MAAM,CAAC;GAAG,UAAU,SAAS,IAAI,QAAQ,IAAI;EAAE;CAC5I;CACA,MAAM,UAAU,cAAc;CAC9B,QAAQ,MAAM,KAAK;CACnB,OAAO;EAAE,eAAe,CAAC;EAAG,QAAQ,SAAS,QAAQ,MAAM,IAAI;EAAG,UAAU,SAAS,QAAQ,KAAK,IAAI;CAAE;AAC1G"}
@@ -1,6 +1,6 @@
1
- import "./rolldown-runtime-xo6NMXYd.js";
2
- import { n as isRichOutput } from "./env-rv-VgSGN.js";
3
- import { o as writer } from "./log-B-1vLxF1.js";
1
+ import "./rolldown-runtime-BowF1xt-.js";
2
+ import { n as isRichOutput } from "./env-BYZIPHqz.js";
3
+ import { o as writer } from "./log-B_uVM704.js";
4
4
  import { styleText } from "node:util";
5
5
  import * as prompts from "@clack/prompts";
6
6
  // src/ui/intro.ts
@@ -69,4 +69,4 @@ function isInteractiveRun({ yes, dryRun }) {
69
69
  }
70
70
  export { logTip as a, logSpacer as i, logIntro as n, logOutro as r, isInteractiveRun as t };
71
71
 
72
- //# sourceMappingURL=intro-DRl-pwVs.js.map
72
+ //# sourceMappingURL=intro-Dun8Eqod.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"intro-DRl-pwVs.js","names":[],"sources":["../src/ui/intro.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { writer } from './log.ts'\n\nconst SPONSOR_TIPS = [\n 'Your sponsorship keeps Kubb codegen, plugins, and docs maintained',\n 'Sponsor faster generators and better Kubb Studio workflows',\n 'Help keep Kubb free for TypeScript teams building APIs',\n 'Support React Query, Zod, Faker, and MSW integrations',\n 'Back open-source tools that turn OpenAPI into TypeScript',\n 'Sponsor fixes, releases, and new plugins for your API workflow',\n 'Help Kubb stay independent and focused on developer tools',\n] as const\n\nconst SPONSOR_LINKS = ['https://github.com/sponsors/stijnvanhulle', 'https://opencollective.com/kubb', 'https://kubb.dev/sponsors'] as const\n\nfunction nextTip(): string {\n const tip = SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]!\n const link = SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]!\n return `${tip}: ${link}`\n}\n\nfunction formatTip(tip: string): string {\n return styleText('magenta', ' Tip ') + styleText('yellow', tip)\n}\n\n/**\n * Prints one random tip outside every group. Rich terminals get the styled variant;\n * plain/CI output gets a stable text-only line so the tip is still visible as final output.\n */\nexport function logTip(): void {\n const tip = nextTip()\n if (!isRichOutput()) {\n console.log(`Tip: ${tip}`)\n return\n }\n\n console.log(`${styleText('magenta', '✦')}${formatTip(tip)}`)\n}\n\ntype IntroOptions = {\n title?: string\n /**\n * Printed under the title, for a command that has a caveat to lead with.\n */\n warning?: string\n /**\n * Whether to open a block a later {@link logOutro} closes. Pass `false` for a command that\n * prints and exits, since nothing would ever close the block.\n *\n * @default true\n */\n block?: boolean\n}\n\n/**\n * Opens a command's output. A command the banner already names passes no title.\n */\nexport function logIntro({ title, warning, block = true }: IntroOptions): void {\n if (block && isRichOutput()) {\n if (title) prompts.intro(title)\n\n if (warning) {\n prompts.log.warn(warning)\n }\n\n return\n }\n\n if (title) {\n console.log(title)\n }\n\n if (warning) {\n console.warn(warning)\n }\n\n if (title || warning) {\n console.log()\n }\n}\n\n/**\n * Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain\n * output prints the text on its own.\n */\nexport function logOutro(text: string): void {\n writer().groupEnd(text)\n}\n\n/**\n * Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a\n * group and a spacer sits outside every one.\n */\nexport function logSpacer(): void {\n console.log('')\n}\n\n/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */\nexport function isInteractiveRun({ yes, dryRun }: { yes?: unknown; dryRun?: unknown }): boolean {\n return !yes && !dryRun && process.stdin.isTTY === true\n}\n"],"mappings":";;;;;;AAKA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAAgB;CAAC;CAA6C;CAAmC;AAA2B;AAElI,SAAS,UAAkB;CAGzB,OAAO,GAFK,aAAa,KAAK,MAAM,KAAK,OAAO,IAAI,aAAa,MAAM,GAEzD,IADD,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,cAAc,MAAM;AAE5E;AAEA,SAAS,UAAU,KAAqB;CACtC,OAAO,UAAU,WAAW,QAAQ,IAAI,UAAU,UAAU,GAAG;AACjE;;;;;AAMA,SAAgB,SAAe;CAC7B,MAAM,MAAM,QAAQ;CACpB,IAAI,CAAC,aAAa,GAAG;EACnB,QAAQ,IAAI,QAAQ,KAAK;EACzB;CACF;CAEA,QAAQ,IAAI,GAAG,UAAU,WAAW,GAAG,IAAI,UAAU,GAAG,GAAG;AAC7D;;;;AAoBA,SAAgB,SAAS,EAAE,OAAO,SAAS,QAAQ,QAA4B;CAC7E,IAAI,SAAS,aAAa,GAAG;EAC3B,IAAI,OAAO,QAAQ,MAAM,KAAK;EAE9B,IAAI,SACF,QAAQ,IAAI,KAAK,OAAO;EAG1B;CACF;CAEA,IAAI,OACF,QAAQ,IAAI,KAAK;CAGnB,IAAI,SACF,QAAQ,KAAK,OAAO;CAGtB,IAAI,SAAS,SACX,QAAQ,IAAI;AAEhB;;;;;AAMA,SAAgB,SAAS,MAAoB;CAC3C,OAAO,CAAC,CAAC,SAAS,IAAI;AACxB;;;;;AAMA,SAAgB,YAAkB;CAChC,QAAQ,IAAI,EAAE;AAChB;;AAGA,SAAgB,iBAAiB,EAAE,KAAK,UAAwD;CAC9F,OAAO,CAAC,OAAO,CAAC,UAAU,QAAQ,MAAM,UAAU;AACpD"}
1
+ {"version":3,"file":"intro-Dun8Eqod.js","names":[],"sources":["../src/ui/intro.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { writer } from './log.ts'\n\nconst SPONSOR_TIPS = [\n 'Your sponsorship keeps Kubb codegen, plugins, and docs maintained',\n 'Sponsor faster generators and better Kubb Studio workflows',\n 'Help keep Kubb free for TypeScript teams building APIs',\n 'Support React Query, Zod, Faker, and MSW integrations',\n 'Back open-source tools that turn OpenAPI into TypeScript',\n 'Sponsor fixes, releases, and new plugins for your API workflow',\n 'Help Kubb stay independent and focused on developer tools',\n] as const\n\nconst SPONSOR_LINKS = ['https://github.com/sponsors/stijnvanhulle', 'https://opencollective.com/kubb', 'https://kubb.dev/sponsors'] as const\n\nfunction nextTip(): string {\n const tip = SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]!\n const link = SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]!\n return `${tip}: ${link}`\n}\n\nfunction formatTip(tip: string): string {\n return styleText('magenta', ' Tip ') + styleText('yellow', tip)\n}\n\n/**\n * Prints one random tip outside every group. Rich terminals get the styled variant;\n * plain/CI output gets a stable text-only line so the tip is still visible as final output.\n */\nexport function logTip(): void {\n const tip = nextTip()\n if (!isRichOutput()) {\n console.log(`Tip: ${tip}`)\n return\n }\n\n console.log(`${styleText('magenta', '✦')}${formatTip(tip)}`)\n}\n\ntype IntroOptions = {\n title?: string\n /**\n * Printed under the title, for a command that has a caveat to lead with.\n */\n warning?: string\n /**\n * Whether to open a block a later {@link logOutro} closes. Pass `false` for a command that\n * prints and exits, since nothing would ever close the block.\n *\n * @default true\n */\n block?: boolean\n}\n\n/**\n * Opens a command's output. A command the banner already names passes no title.\n */\nexport function logIntro({ title, warning, block = true }: IntroOptions): void {\n if (block && isRichOutput()) {\n if (title) prompts.intro(title)\n\n if (warning) {\n prompts.log.warn(warning)\n }\n\n return\n }\n\n if (title) {\n console.log(title)\n }\n\n if (warning) {\n console.warn(warning)\n }\n\n if (title || warning) {\n console.log()\n }\n}\n\n/**\n * Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain\n * output prints the text on its own.\n */\nexport function logOutro(text: string): void {\n writer().groupEnd(text)\n}\n\n/**\n * Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a\n * group and a spacer sits outside every one.\n */\nexport function logSpacer(): void {\n console.log('')\n}\n\n/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */\nexport function isInteractiveRun({ yes, dryRun }: { yes?: unknown; dryRun?: unknown }): boolean {\n return !yes && !dryRun && process.stdin.isTTY === true\n}\n"],"mappings":";;;;;;AAKA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAAgB;CAAC;CAA6C;CAAmC;AAA2B;AAElI,SAAS,UAAkB;CAGzB,OAAO,GAFK,aAAa,KAAK,MAAM,KAAK,OAAO,IAAI,aAAa,MAAM,GAEzD,IADD,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,cAAc,MAAM;AAE5E;AAEA,SAAS,UAAU,KAAqB;CACtC,OAAO,UAAU,WAAW,QAAQ,IAAI,UAAU,UAAU,GAAG;AACjE;;;;;AAMA,SAAgB,SAAe;CAC7B,MAAM,MAAM,QAAQ;CACpB,IAAI,CAAC,aAAa,GAAG;EACnB,QAAQ,IAAI,QAAQ,KAAK;EACzB;CACF;CAEA,QAAQ,IAAI,GAAG,UAAU,WAAW,GAAG,IAAI,UAAU,GAAG,GAAG;AAC7D;;;;AAoBA,SAAgB,SAAS,EAAE,OAAO,SAAS,QAAQ,QAA4B;CAC7E,IAAI,SAAS,aAAa,GAAG;EAC3B,IAAI,OAAO,QAAQ,MAAM,KAAK;EAE9B,IAAI,SACF,QAAQ,IAAI,KAAK,OAAO;EAG1B;CACF;CAEA,IAAI,OACF,QAAQ,IAAI,KAAK;CAGnB,IAAI,SACF,QAAQ,KAAK,OAAO;CAGtB,IAAI,SAAS,SACX,QAAQ,IAAI;AAEhB;;;;;AAMA,SAAgB,SAAS,MAAoB;CAC3C,OAAO,CAAC,CAAC,SAAS,IAAI;AACxB;;;;;AAMA,SAAgB,YAAkB;CAChC,QAAQ,IAAI,EAAE;AAChB;;AAGA,SAAgB,iBAAiB,EAAE,KAAK,UAAwD;CAC9F,OAAO,CAAC,OAAO,CAAC,UAAU,QAAQ,MAAM,UAAU;AACpD"}
@@ -1,6 +1,6 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-C3-Zg-KD.cjs");
2
- const require_env = require("./env-eu3XyKqJ.cjs");
3
- const require_log = require("./log-wv1OxLiq.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
2
+ const require_env = require("./env-Bi4GXVdd.cjs");
3
+ const require_log = require("./log-BzmBldY6.cjs");
4
4
  let node_util = require("node:util");
5
5
  let _clack_prompts = require("@clack/prompts");
6
6
  _clack_prompts = require_rolldown_runtime.__toESM(_clack_prompts, 1);
@@ -99,4 +99,4 @@ Object.defineProperty(exports, "logTip", {
99
99
  }
100
100
  });
101
101
 
102
- //# sourceMappingURL=intro-DuyzJ3Rb.cjs.map
102
+ //# sourceMappingURL=intro-PFXmY9bD.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"intro-DuyzJ3Rb.cjs","names":["styleText","isRichOutput"],"sources":["../src/ui/intro.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { writer } from './log.ts'\n\nconst SPONSOR_TIPS = [\n 'Your sponsorship keeps Kubb codegen, plugins, and docs maintained',\n 'Sponsor faster generators and better Kubb Studio workflows',\n 'Help keep Kubb free for TypeScript teams building APIs',\n 'Support React Query, Zod, Faker, and MSW integrations',\n 'Back open-source tools that turn OpenAPI into TypeScript',\n 'Sponsor fixes, releases, and new plugins for your API workflow',\n 'Help Kubb stay independent and focused on developer tools',\n] as const\n\nconst SPONSOR_LINKS = ['https://github.com/sponsors/stijnvanhulle', 'https://opencollective.com/kubb', 'https://kubb.dev/sponsors'] as const\n\nfunction nextTip(): string {\n const tip = SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]!\n const link = SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]!\n return `${tip}: ${link}`\n}\n\nfunction formatTip(tip: string): string {\n return styleText('magenta', ' Tip ') + styleText('yellow', tip)\n}\n\n/**\n * Prints one random tip outside every group. Rich terminals get the styled variant;\n * plain/CI output gets a stable text-only line so the tip is still visible as final output.\n */\nexport function logTip(): void {\n const tip = nextTip()\n if (!isRichOutput()) {\n console.log(`Tip: ${tip}`)\n return\n }\n\n console.log(`${styleText('magenta', '✦')}${formatTip(tip)}`)\n}\n\ntype IntroOptions = {\n title?: string\n /**\n * Printed under the title, for a command that has a caveat to lead with.\n */\n warning?: string\n /**\n * Whether to open a block a later {@link logOutro} closes. Pass `false` for a command that\n * prints and exits, since nothing would ever close the block.\n *\n * @default true\n */\n block?: boolean\n}\n\n/**\n * Opens a command's output. A command the banner already names passes no title.\n */\nexport function logIntro({ title, warning, block = true }: IntroOptions): void {\n if (block && isRichOutput()) {\n if (title) prompts.intro(title)\n\n if (warning) {\n prompts.log.warn(warning)\n }\n\n return\n }\n\n if (title) {\n console.log(title)\n }\n\n if (warning) {\n console.warn(warning)\n }\n\n if (title || warning) {\n console.log()\n }\n}\n\n/**\n * Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain\n * output prints the text on its own.\n */\nexport function logOutro(text: string): void {\n writer().groupEnd(text)\n}\n\n/**\n * Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a\n * group and a spacer sits outside every one.\n */\nexport function logSpacer(): void {\n console.log('')\n}\n\n/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */\nexport function isInteractiveRun({ yes, dryRun }: { yes?: unknown; dryRun?: unknown }): boolean {\n return !yes && !dryRun && process.stdin.isTTY === true\n}\n"],"mappings":";;;;;;;AAKA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,gBAAgB;CAAC;CAA6C;CAAmC;AAA2B;AAElI,SAAS,UAAkB;CAGzB,OAAO,GAFK,aAAa,KAAK,MAAM,KAAK,OAAO,IAAI,aAAa,MAAM,GAEzD,IADD,cAAc,KAAK,MAAM,KAAK,OAAO,IAAI,cAAc,MAAM;AAE5E;AAEA,SAAS,UAAU,KAAqB;CACtC,QAAA,GAAOA,UAAAA,UAAAA,CAAU,WAAW,QAAQ,KAAA,GAAIA,UAAAA,UAAAA,CAAU,UAAU,GAAG;AACjE;;;;;AAMA,SAAgB,SAAe;CAC7B,MAAM,MAAM,QAAQ;CACpB,IAAI,CAACC,YAAAA,aAAa,GAAG;EACnB,QAAQ,IAAI,QAAQ,KAAK;EACzB;CACF;CAEA,QAAQ,IAAI,IAAA,GAAGD,UAAAA,UAAAA,CAAU,WAAW,GAAG,IAAI,UAAU,GAAG,GAAG;AAC7D;;;;AAoBA,SAAgB,SAAS,EAAE,OAAO,SAAS,QAAQ,QAA4B;CAC7E,IAAI,SAASC,YAAAA,aAAa,GAAG;EAC3B,IAAI,OAAO,eAAQ,MAAM,KAAK;EAE9B,IAAI,SACF,eAAQ,IAAI,KAAK,OAAO;EAG1B;CACF;CAEA,IAAI,OACF,QAAQ,IAAI,KAAK;CAGnB,IAAI,SACF,QAAQ,KAAK,OAAO;CAGtB,IAAI,SAAS,SACX,QAAQ,IAAI;AAEhB;;;;;AAMA,SAAgB,SAAS,MAAoB;CAC3C,YAAA,OAAO,CAAC,CAAC,SAAS,IAAI;AACxB;;;;;AAMA,SAAgB,YAAkB;CAChC,QAAQ,IAAI,EAAE;AAChB;;AAGA,SAAgB,iBAAiB,EAAE,KAAK,UAAwD;CAC9F,OAAO,CAAC,OAAO,CAAC,UAAU,QAAQ,MAAM,UAAU;AACpD"}
1
+ {"version":3,"file":"intro-PFXmY9bD.cjs","names":["styleText","isRichOutput"],"sources":["../src/ui/intro.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { writer } from './log.ts'\n\nconst SPONSOR_TIPS = [\n 'Your sponsorship keeps Kubb codegen, plugins, and docs maintained',\n 'Sponsor faster generators and better Kubb Studio workflows',\n 'Help keep Kubb free for TypeScript teams building APIs',\n 'Support React Query, Zod, Faker, and MSW integrations',\n 'Back open-source tools that turn OpenAPI into TypeScript',\n 'Sponsor fixes, releases, and new plugins for your API workflow',\n 'Help Kubb stay independent and focused on developer tools',\n] as const\n\nconst SPONSOR_LINKS = ['https://github.com/sponsors/stijnvanhulle', 'https://opencollective.com/kubb', 'https://kubb.dev/sponsors'] as const\n\nfunction nextTip(): string {\n const tip = SPONSOR_TIPS[Math.floor(Math.random() * SPONSOR_TIPS.length)]!\n const link = SPONSOR_LINKS[Math.floor(Math.random() * SPONSOR_LINKS.length)]!\n return `${tip}: ${link}`\n}\n\nfunction formatTip(tip: string): string {\n return styleText('magenta', ' Tip ') + styleText('yellow', tip)\n}\n\n/**\n * Prints one random tip outside every group. Rich terminals get the styled variant;\n * plain/CI output gets a stable text-only line so the tip is still visible as final output.\n */\nexport function logTip(): void {\n const tip = nextTip()\n if (!isRichOutput()) {\n console.log(`Tip: ${tip}`)\n return\n }\n\n console.log(`${styleText('magenta', '✦')}${formatTip(tip)}`)\n}\n\ntype IntroOptions = {\n title?: string\n /**\n * Printed under the title, for a command that has a caveat to lead with.\n */\n warning?: string\n /**\n * Whether to open a block a later {@link logOutro} closes. Pass `false` for a command that\n * prints and exits, since nothing would ever close the block.\n *\n * @default true\n */\n block?: boolean\n}\n\n/**\n * Opens a command's output. A command the banner already names passes no title.\n */\nexport function logIntro({ title, warning, block = true }: IntroOptions): void {\n if (block && isRichOutput()) {\n if (title) prompts.intro(title)\n\n if (warning) {\n prompts.log.warn(warning)\n }\n\n return\n }\n\n if (title) {\n console.log(title)\n }\n\n if (warning) {\n console.warn(warning)\n }\n\n if (title || warning) {\n console.log()\n }\n}\n\n/**\n * Closes the block {@link logIntro} opened. The closing gutter is not a written line, so plain\n * output prints the text on its own.\n */\nexport function logOutro(text: string): void {\n writer().groupEnd(text)\n}\n\n/**\n * Prints one empty line between two groups, without clack's gutter bar, since the bar belongs to a\n * group and a spacer sits outside every one.\n */\nexport function logSpacer(): void {\n console.log('')\n}\n\n/** Whether a run stops to ask something: no `--yes`, no `--dry-run`, and a person at a terminal. */\nexport function isInteractiveR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AAU,QAAQ,MAAM,UAAU;AACpD"}
@@ -1,4 +1,4 @@
1
- import "./rolldown-runtime-xo6NMXYd.js";
1
+ import "./rolldown-runtime-BowF1xt-.js";
2
2
  import process from "node:process";
3
3
  // ../../internals/utils/src/isCIEnvironment.ts
4
4
  /**
@@ -11,4 +11,4 @@ function isCIEnvironment() {
11
11
  }
12
12
  export { isCIEnvironment as t };
13
13
 
14
- //# sourceMappingURL=isCIEnvironment-D6xtAAZ2.js.map
14
+ //# sourceMappingURL=isCIEnvironment-DAMZSlP2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isCIEnvironment-D6xtAAZ2.js","names":[],"sources":["../../../internals/utils/src/isCIEnvironment.ts"],"sourcesContent":["import process from 'node:process'\n\n/**\n * Returns `true` when a known CI provider has set its environment variable.\n * `CI=false` and `CI=0` count as not CI, so a user can opt out locally.\n */\nexport function isCIEnvironment(): boolean {\n const ci = process.env.CI\n return !!(\n (ci && ci !== 'false' && ci !== '0') ||\n process.env.GITHUB_ACTIONS ||\n process.env.GITLAB_CI ||\n process.env.BITBUCKET_BUILD_NUMBER ||\n process.env.JENKINS_URL ||\n process.env.CIRCLECI ||\n process.env.TRAVIS ||\n process.env.TEAMCITY_VERSION ||\n process.env.BUILDKITE ||\n process.env.TF_BUILD\n )\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,kBAA2B;CACzC,MAAM,KAAK,QAAQ,IAAI;CACvB,OAAO,CAAC,EACL,MAAM,OAAO,WAAW,OAAO,OAChC,QAAQ,IAAI,kBACZ,QAAQ,IAAI,aACZ,QAAQ,IAAI,0BACZ,QAAQ,IAAI,eACZ,QAAQ,IAAI,YACZ,QAAQ,IAAI,UACZ,QAAQ,IAAI,oBACZ,QAAQ,IAAI,aACZ,QAAQ,IAAI;AAEhB"}
1
+ {"version":3,"file":"isCIEnvironment-DAMZSlP2.js","names":[],"sources":["../../../internals/utils/src/isCIEnvironment.ts"],"sourcesContent":["import process from 'node:process'\n\n/**\n * Returns `true` when a known CI provider has set its environment variable.\n * `CI=false` and `CI=0` count as not CI, so a user can opt out locally.\n */\nexport function isCIEnvironment(): boolean {\n const ci = process.env.CI\n return !!(\n (ci && ci !== 'false' && ci !== '0') ||\n process.env.GITHUB_ACTIONS ||\n process.env.GITLAB_CI ||\n process.env.BITBUCKET_BUILD_NUMBER ||\n process.env.JENKINS_URL ||\n process.env.CIRCLECI ||\n process.env.TRAVIS ||\n process.env.TEAMCITY_VERSION ||\n process.env.BUILDKITE ||\n process.env.TF_BUILD\n )\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,kBAA2B;CACzC,MAAM,KAAK,QAAQ,IAAI;CACvB,OAAO,CAAC,EACL,MAAM,OAAO,WAAW,OAAO,OAChC,QAAQ,IAAI,kBACZ,QAAQ,IAAI,aACZ,QAAQ,IAAI,0BACZ,QAAQ,IAAI,eACZ,QAAQ,IAAI,YACZ,QAAQ,IAAI,UACZ,QAAQ,IAAI,oBACZ,QAAQ,IAAI,aACZ,QAAQ,IAAI;AAEhB"}
@@ -1,4 +1,4 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-C3-Zg-KD.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
2
2
  let node_process = require("node:process");
3
3
  node_process = require_rolldown_runtime.__toESM(node_process, 1);
4
4
  // ../../internals/utils/src/isCIEnvironment.ts
@@ -17,4 +17,4 @@ Object.defineProperty(exports, "isCIEnvironment", {
17
17
  }
18
18
  });
19
19
 
20
- //# sourceMappingURL=isCIEnvironment-DiVOMI5Q.cjs.map
20
+ //# sourceMappingURL=isCIEnvironment-jzKqdVwJ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"isCIEnvironment-DiVOMI5Q.cjs","names":["process"],"sources":["../../../internals/utils/src/isCIEnvironment.ts"],"sourcesContent":["import process from 'node:process'\n\n/**\n * Returns `true` when a known CI provider has set its environment variable.\n * `CI=false` and `CI=0` count as not CI, so a user can opt out locally.\n */\nexport function isCIEnvironment(): boolean {\n const ci = process.env.CI\n return !!(\n (ci && ci !== 'false' && ci !== '0') ||\n process.env.GITHUB_ACTIONS ||\n process.env.GITLAB_CI ||\n process.env.BITBUCKET_BUILD_NUMBER ||\n process.env.JENKINS_URL ||\n process.env.CIRCLECI ||\n process.env.TRAVIS ||\n process.env.TEAMCITY_VERSION ||\n process.env.BUILDKITE ||\n process.env.TF_BUILD\n )\n}\n"],"mappings":";;;;;;;;AAMA,SAAgB,kBAA2B;CACzC,MAAM,KAAKA,aAAAA,QAAQ,IAAI;CACvB,OAAO,CAAC,EACL,MAAM,OAAO,WAAW,OAAO,OAChCA,aAAAA,QAAQ,IAAI,kBACZA,aAAAA,QAAQ,IAAI,aACZA,aAAAA,QAAQ,IAAI,0BACZA,aAAAA,QAAQ,IAAI,eACZA,aAAAA,QAAQ,IAAI,YACZA,aAAAA,QAAQ,IAAI,UACZA,aAAAA,QAAQ,IAAI,oBACZA,aAAAA,QAAQ,IAAI,aACZA,aAAAA,QAAQ,IAAI;AAEhB"}
1
+ {"version":3,"file":"isCIEnvironment-jzKqdVwJ.cjs","names":["process"],"sources":["../../../internals/utils/src/isCIEnvironment.ts"],"sourcesContent":["import process from 'node:process'\n\n/**\n * Returns `true` when a known CI provider has set its environment variable.\n * `CI=false` and `CI=0` count as not CI, so a user can opt out locally.\n */\nexport function isCIEnvironment(): boolean {\n const ci = process.env.CI\n return !!(\n (ci && ci !== 'false' && ci !== '0') ||\n process.env.GITHUB_ACTIONS ||\n process.env.GITLAB_CI ||\n process.env.BITBUCKET_BUILD_NUMBER ||\n process.env.JENKINS_URL ||\n process.env.CIRCLECI ||\n process.env.TRAVIS ||\n process.env.TEAMCITY_VERSION ||\n process.env.BUILDKITE ||\n process.env.TF_BUILD\n )\n}\n"],"mappings":";;;;;;;;AAMA,SAAgB,kBAA2B;CACzC,MAAM,KAAKA,aAAAA,QAAQ,IAAI;CACvB,OAAO,CAAC,EACL,MAAM,OAAO,WAAW,OAAO,OAChCA,aAAAA,QAAQ,IAAI,kBACZA,aAAAA,QAAQ,IAAI,aACZA,aAAAA,QAAQ,IAAI,0BACZA,aAAAA,QAAQ,IAAI,eACZA,aAAAA,QAAQ,IAAI,YACZA,aAAAA,QAAQ,IAAI,UACZA,aAAAA,QAAQ,IAAI,oBACZA,aAAAA,QAAQ,IAAI,aACZA,aAAAA,QAAQ,IAAI;AAEhB"}
@@ -1,5 +1,5 @@
1
- import "./rolldown-runtime-xo6NMXYd.js";
2
- import { n as isRichOutput } from "./env-rv-VgSGN.js";
1
+ import "./rolldown-runtime-BowF1xt-.js";
2
+ import { n as isRichOutput } from "./env-BYZIPHqz.js";
3
3
  import { styleText } from "node:util";
4
4
  import * as clack from "@clack/prompts";
5
5
  // src/loggers/clackWriter.ts
@@ -128,4 +128,4 @@ function logStep(message) {
128
128
  }
129
129
  export { logWarn as a, plainWriter as c, logStep as i, logError as n, writer as o, logInfo as r, createPlainWriter as s, logBlock as t };
130
130
 
131
- //# sourceMappingURL=log-B-1vLxF1.js.map
131
+ //# sourceMappingURL=log-B_uVM704.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"log-B-1vLxF1.js","names":[],"sources":["../src/loggers/clackWriter.ts","../src/loggers/plainWriter.ts","../src/ui/log.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport type { LoggerWriter } from './types.ts'\n\n/**\n * Draws with clack for local development: a gutter bar per group, animated steps, and a progress\n * bar for the writes.\n */\nexport const clackWriter: LoggerWriter = {\n audience: 'human',\n group: (title) => clack.intro(title),\n groupEnd: (text) => clack.outro(text),\n step: (text) => clack.log.step(text, { spacing: 0 }),\n info: (text) => clack.log.info(text),\n success: (text) => clack.log.success(text),\n warn: (text) => clack.log.warn(text),\n error: (text) => clack.log.error(text),\n block: (lines) => clack.log.message(lines, { spacing: 0 }),\n // A subprocess's output is not Kubb's tree, so it goes out past clack and its gutter bar. The\n // step above it is already stopped by the time this runs.\n raw: (lines) => console.log(styleText('dim', lines.join('\\n'))),\n // The diagnostic carries its own code and indented rows, so clear clack's gutter and bar and let\n // the block stand on its own.\n diagnostic: (lines) => clack.log.message(lines, { symbol: '', secondarySymbol: '' }),\n update: (lines, title) =>\n clack.box(lines.join('\\n'), title, {\n width: 'auto',\n formatBorder: (border: string) => styleText('yellow', border),\n rounded: true,\n withGuide: false,\n contentAlign: 'center',\n titleAlign: 'center',\n }),\n spinner: () => clack.spinner(),\n progress(max) {\n const bar = clack.progress({ style: 'block', max, size: 30 })\n\n return {\n start: (text) => bar.start(text),\n advance: (text) => bar.advance(1, text),\n stop: (text) => bar.stop(text),\n }\n },\n}\n","import type { LoggerWriter } from './types.ts'\n\n/**\n * Prefixes that stand in for the symbols clack draws, so plain output reads the same way.\n */\nexport const SYMBOLS = { info: 'ℹ', warn: '⚠', error: '✗', step: '◇' } as const\n\n/**\n * Draws with one `write` call per line, e.g. `console.error` so stdout carries only JSON. Nothing\n * animates, so a step prints at start and end.\n */\nexport function createPlainWriter(write: (line: string) => void): LoggerWriter {\n return {\n audience: 'agent',\n group: write,\n groupEnd: write,\n step: (text) => write(`${SYMBOLS.step} ${text}`),\n info: write,\n success: write,\n warn: write,\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n block: (lines) => write(lines.join('\\n')),\n raw: (lines) => write(lines.join('\\n')),\n diagnostic: (lines) => write(lines.join('\\n')),\n update: (lines, title) => write([title, ...lines].join('\\n')),\n spinner: () => ({\n start: write,\n message: write,\n clear: () => {},\n stop: (text) => text && write(text),\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n }),\n progress: () => ({\n start: write,\n advance: write,\n stop: (text) => text && write(text),\n }),\n }\n}\n\n/**\n * Draws on the console, for non-TTY environments and for an AI coding agent reading the output.\n * Reports the same run in the same order as `clackWriter`, without the animation.\n */\nexport const plainWriter = createPlainWriter((line) => console.log(line))\n","import * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { clackWriter } from '../loggers/clackWriter.ts'\nimport { plainWriter, SYMBOLS } from '../loggers/plainWriter.ts'\nimport type { LoggerWriter } from '../loggers/types.ts'\n\n/** The writer the loggers draw with on this terminal, so a command's own lines look like its run. */\nexport function writer(): LoggerWriter {\n return isRichOutput() ? clackWriter : plainWriter\n}\n\ntype Level = keyof typeof SYMBOLS\n\n// Not through the writers: in plain output a command's own info and warning carry their symbol, and clack's step keeps its spacing.\nfunction write(level: Level, message: string): void {\n if (isRichOutput()) {\n prompts.log[level](message)\n\n return\n }\n\n console.log(`${SYMBOLS[level]} ${message}`)\n}\n\n/** Prints lines as one block, without a symbol in front of them. Not the writer's block, which drops clack's spacing around it. */\nexport function logBlock(lines: string | Array<string>): void {\n if (isRichOutput()) {\n prompts.log.message(lines)\n\n return\n }\n\n console.log([lines].flat().join('\\n'))\n}\n\nexport function logInfo(message: string): void {\n write('info', message)\n}\n\nexport function logWarn(message: string): void {\n write('warn', message)\n}\n\nexport function logError(message: string): void {\n write('error', message)\n}\n\n/**\n * Reports a step the command is taking, rather than something it found.\n */\nexport function logStep(message: string): void {\n write('step', message)\n}\n"],"mappings":";;;;;;;;;AAQA,MAAa,cAA4B;CACvC,UAAU;CACV,QAAQ,UAAU,MAAM,MAAM,KAAK;CACnC,WAAW,SAAS,MAAM,MAAM,IAAI;CACpC,OAAO,SAAS,MAAM,IAAI,KAAK,MAAM,EAAE,SAAS,EAAE,CAAC;CACnD,OAAO,SAAS,MAAM,IAAI,KAAK,IAAI;CACnC,UAAU,SAAS,MAAM,IAAI,QAAQ,IAAI;CACzC,OAAO,SAAS,MAAM,IAAI,KAAK,IAAI;CACnC,QAAQ,SAAS,MAAM,IAAI,MAAM,IAAI;CACrC,QAAQ,UAAU,MAAM,IAAI,QAAQ,OAAO,EAAE,SAAS,EAAE,CAAC;CAGzD,MAAM,UAAU,QAAQ,IAAI,UAAU,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC;CAG9D,aAAa,UAAU,MAAM,IAAI,QAAQ,OAAO;EAAE,QAAQ;EAAI,iBAAiB;CAAG,CAA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BAAmB,SAAS,QAAQ,IAAI,IAAI,CAAC;;;ACrCxE,SAAgB,SAAuB;CACrC,OAAO,aAAa,IAAI,cAAc;AACxC;AAKA,SAAS,MAAM,OAAc,SAAuB;CAClD,IAAI,aAAa,GAAG;EAClB,MAAQ,IAAI,MAAM,CAAC,OAAO;EAE1B;CACF;CAEA,QAAQ,IAAI,GAAG,QAAQ,OAAO,GAAG,SAAS;AAC5C;;AAGA,SAAgB,SAAS,OAAqC;CAC5D,IAAI,aAAa,GAAG;EAClB,MAAQ,IAAI,QAAQ,KAAK;EAEzB;CACF;CAEA,QAAQ,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC;AACvC;AAEA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB;AAEA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB;AAEA,SAAgB,SAAS,SAAuB;CAC9C,MAAM,SAAS,OAAO;AACxB;;;;AAKA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB"}
1
+ {"version":3,"file":"log-B_uVM704.js","names":[],"sources":["../src/loggers/clackWriter.ts","../src/loggers/plainWriter.ts","../src/ui/log.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport type { LoggerWriter } from './types.ts'\n\n/**\n * Draws with clack for local development: a gutter bar per group, animated steps, and a progress\n * bar for the writes.\n */\nexport const clackWriter: LoggerWriter = {\n audience: 'human',\n group: (title) => clack.intro(title),\n groupEnd: (text) => clack.outro(text),\n step: (text) => clack.log.step(text, { spacing: 0 }),\n info: (text) => clack.log.info(text),\n success: (text) => clack.log.success(text),\n warn: (text) => clack.log.warn(text),\n error: (text) => clack.log.error(text),\n block: (lines) => clack.log.message(lines, { spacing: 0 }),\n // A subprocess's output is not Kubb's tree, so it goes out past clack and its gutter bar. The\n // step above it is already stopped by the time this runs.\n raw: (lines) => console.log(styleText('dim', lines.join('\\n'))),\n // The diagnostic carries its own code and indented rows, so clear clack's gutter and bar and let\n // the block stand on its own.\n diagnostic: (lines) => clack.log.message(lines, { symbol: '', secondarySymbol: '' }),\n update: (lines, title) =>\n clack.box(lines.join('\\n'), title, {\n width: 'auto',\n formatBorder: (border: string) => styleText('yellow', border),\n rounded: true,\n withGuide: false,\n contentAlign: 'center',\n titleAlign: 'center',\n }),\n spinner: () => clack.spinner(),\n progress(max) {\n const bar = clack.progress({ style: 'block', max, size: 30 })\n\n return {\n start: (text) => bar.start(text),\n advance: (text) => bar.advance(1, text),\n stop: (text) => bar.stop(text),\n }\n },\n}\n","import type { LoggerWriter } from './types.ts'\n\n/**\n * Prefixes that stand in for the symbols clack draws, so plain output reads the same way.\n */\nexport const SYMBOLS = { info: 'ℹ', warn: '⚠', error: '✗', step: '◇' } as const\n\n/**\n * Draws with one `write` call per line, e.g. `console.error` so stdout carries only JSON. Nothing\n * animates, so a step prints at start and end.\n */\nexport function createPlainWriter(write: (line: string) => void): LoggerWriter {\n return {\n audience: 'agent',\n group: write,\n groupEnd: write,\n step: (text) => write(`${SYMBOLS.step} ${text}`),\n info: write,\n success: write,\n warn: write,\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n block: (lines) => write(lines.join('\\n')),\n raw: (lines) => write(lines.join('\\n')),\n diagnostic: (lines) => write(lines.join('\\n')),\n update: (lines, title) => write([title, ...lines].join('\\n')),\n spinner: () => ({\n start: write,\n message: write,\n clear: () => {},\n stop: (text) => text && write(text),\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n }),\n progress: () => ({\n start: write,\n advance: write,\n stop: (text) => text && write(text),\n }),\n }\n}\n\n/**\n * Draws on the console, for non-TTY environments and for an AI coding agent reading the output.\n * Reports the same run in the same order as `clackWriter`, without the animation.\n */\nexport const plainWriter = createPlainWriter((line) => console.log(line))\n","import * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { clackWriter } from '../loggers/clackWriter.ts'\nimport { plainWriter, SYMBOLS } from '../loggers/plainWriter.ts'\nimport type { LoggerWriter } from '../loggers/types.ts'\n\n/** The writer the loggers draw with on this terminal, so a command's own lines look like its run. */\nexport function writer(): LoggerWriter {\n return isRichOutput() ? clackWriter : plainWriter\n}\n\ntype Level = keyof typeof SYMBOLS\n\n// Not through the writers: in plain output a command's own info and warning carry their symbol, and clack's step keeps its spacing.\nfunction write(level: Level, message: string): void {\n if (isRichOutput()) {\n prompts.log[level](message)\n\n return\n }\n\n console.log(`${SYMBOLS[level]} ${message}`)\n}\n\n/** Prints lines as one block, without a symbol in front of them. Not the writer's block, which drops clack's spacing around it. */\nexport function logBlock(lines: string | Array<string>): void {\n if (isRichOutput()) {\n prompts.log.message(lines)\n\n return\n }\n\n console.log([lines].flat().join('\\n'))\n}\n\nexport function logInfo(message: string): void {\n write('info', message)\n}\n\nexport function logWarn(message: string): void {\n write('warn', message)\n}\n\nexport function logError(message: string): void {\n write('error', message)\n}\n\n/**\n * Reports a step the command is taking, rather than something it found.\n */\nexport function logStep(message: string): void {\n write('step', message)\n}\n"],"mappings":";;;;;;;;;AAQA,MAAa,cAA4B;CACvC,UAAU;CACV,QAAQ,UAAU,MAAM,MAAM,KAAK;CACnC,WAAW,SAAS,MAAM,MAAM,IAAI;CACpC,OAAO,SAAS,MAAM,IAAI,KAAK,MAAM,EAAE,SAAS,EAAE,CAAC;CACnD,OAAO,SAAS,MAAM,IAAI,KAAK,IAAI;CACnC,UAAU,SAAS,MAAM,IAAI,QAAQ,IAAI;CACzC,OAAO,SAAS,MAAM,IAAI,KAAK,IAAI;CACnC,QAAQ,SAAS,MAAM,IAAI,MAAM,IAAI;CACrC,QAAQ,UAAU,MAAM,IAAI,QAAQ,OAAO,EAAE,SAAS,EAAE,CAAC;CAGzD,MAAM,UAAU,QAAQ,IAAI,UAAU,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC;CAG9D,aAAa,UAAU,MAAM,IAAI,QAAQ,OAAO;EAAE,QAAQ;EA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;;AAMA,MAAa,cAAc,mBAAmB,SAAS,QAAQ,IAAI,IAAI,CAAC;;;ACrCxE,SAAgB,SAAuB;CACrC,OAAO,aAAa,IAAI,cAAc;AACxC;AAKA,SAAS,MAAM,OAAc,SAAuB;CAClD,IAAI,aAAa,GAAG;EAClB,MAAQ,IAAI,MAAM,CAAC,OAAO;EAE1B;CACF;CAEA,QAAQ,IAAI,GAAG,QAAQ,OAAO,GAAG,SAAS;AAC5C;;AAGA,SAAgB,SAAS,OAAqC;CAC5D,IAAI,aAAa,GAAG;EAClB,MAAQ,IAAI,QAAQ,KAAK;EAEzB;CACF;CAEA,QAAQ,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC;AACvC;AAEA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB;AAEA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB;AAEA,SAAgB,SAAS,SAAuB;CAC9C,MAAM,SAAS,OAAO;AACxB;;;;AAKA,SAAgB,QAAQ,SAAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB"}
@@ -1,5 +1,5 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-C3-Zg-KD.cjs");
2
- const require_env = require("./env-eu3XyKqJ.cjs");
1
+ const require_rolldown_runtime = require("./rolldown-runtime-BV8xUvPy.cjs");
2
+ const require_env = require("./env-Bi4GXVdd.cjs");
3
3
  let node_util = require("node:util");
4
4
  let _clack_prompts = require("@clack/prompts");
5
5
  _clack_prompts = require_rolldown_runtime.__toESM(_clack_prompts, 1);
@@ -176,4 +176,4 @@ Object.defineProperty(exports, "writer", {
176
176
  }
177
177
  });
178
178
 
179
- //# sourceMappingURL=log-wv1OxLiq.cjs.map
179
+ //# sourceMappingURL=log-BzmBldY6.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"log-wv1OxLiq.cjs","names":["clack","styleText","isRichOutput"],"sources":["../src/loggers/clackWriter.ts","../src/loggers/plainWriter.ts","../src/ui/log.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport type { LoggerWriter } from './types.ts'\n\n/**\n * Draws with clack for local development: a gutter bar per group, animated steps, and a progress\n * bar for the writes.\n */\nexport const clackWriter: LoggerWriter = {\n audience: 'human',\n group: (title) => clack.intro(title),\n groupEnd: (text) => clack.outro(text),\n step: (text) => clack.log.step(text, { spacing: 0 }),\n info: (text) => clack.log.info(text),\n success: (text) => clack.log.success(text),\n warn: (text) => clack.log.warn(text),\n error: (text) => clack.log.error(text),\n block: (lines) => clack.log.message(lines, { spacing: 0 }),\n // A subprocess's output is not Kubb's tree, so it goes out past clack and its gutter bar. The\n // step above it is already stopped by the time this runs.\n raw: (lines) => console.log(styleText('dim', lines.join('\\n'))),\n // The diagnostic carries its own code and indented rows, so clear clack's gutter and bar and let\n // the block stand on its own.\n diagnostic: (lines) => clack.log.message(lines, { symbol: '', secondarySymbol: '' }),\n update: (lines, title) =>\n clack.box(lines.join('\\n'), title, {\n width: 'auto',\n formatBorder: (border: string) => styleText('yellow', border),\n rounded: true,\n withGuide: false,\n contentAlign: 'center',\n titleAlign: 'center',\n }),\n spinner: () => clack.spinner(),\n progress(max) {\n const bar = clack.progress({ style: 'block', max, size: 30 })\n\n return {\n start: (text) => bar.start(text),\n advance: (text) => bar.advance(1, text),\n stop: (text) => bar.stop(text),\n }\n },\n}\n","import type { LoggerWriter } from './types.ts'\n\n/**\n * Prefixes that stand in for the symbols clack draws, so plain output reads the same way.\n */\nexport const SYMBOLS = { info: 'ℹ', warn: '⚠', error: '✗', step: '◇' } as const\n\n/**\n * Draws with one `write` call per line, e.g. `console.error` so stdout carries only JSON. Nothing\n * animates, so a step prints at start and end.\n */\nexport function createPlainWriter(write: (line: string) => void): LoggerWriter {\n return {\n audience: 'agent',\n group: write,\n groupEnd: write,\n step: (text) => write(`${SYMBOLS.step} ${text}`),\n info: write,\n success: write,\n warn: write,\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n block: (lines) => write(lines.join('\\n')),\n raw: (lines) => write(lines.join('\\n')),\n diagnostic: (lines) => write(lines.join('\\n')),\n update: (lines, title) => write([title, ...lines].join('\\n')),\n spinner: () => ({\n start: write,\n message: write,\n clear: () => {},\n stop: (text) => text && write(text),\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n }),\n progress: () => ({\n start: write,\n advance: write,\n stop: (text) => text && write(text),\n }),\n }\n}\n\n/**\n * Draws on the console, for non-TTY environments and for an AI coding agent reading the output.\n * Reports the same run in the same order as `clackWriter`, without the animation.\n */\nexport const plainWriter = createPlainWriter((line) => console.log(line))\n","import * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { clackWriter } from '../loggers/clackWriter.ts'\nimport { plainWriter, SYMBOLS } from '../loggers/plainWriter.ts'\nimport type { LoggerWriter } from '../loggers/types.ts'\n\n/** The writer the loggers draw with on this terminal, so a command's own lines look like its run. */\nexport function writer(): LoggerWriter {\n return isRichOutput() ? clackWriter : plainWriter\n}\n\ntype Level = keyof typeof SYMBOLS\n\n// Not through the writers: in plain output a command's own info and warning carry their symbol, and clack's step keeps its spacing.\nfunction write(level: Level, message: string): void {\n if (isRichOutput()) {\n prompts.log[level](message)\n\n return\n }\n\n console.log(`${SYMBOLS[level]} ${message}`)\n}\n\n/** Prints lines as one block, without a symbol in front of them. Not the writer's block, which drops clack's spacing around it. */\nexport function logBlock(lines: string | Array<string>): void {\n if (isRichOutput()) {\n prompts.log.message(lines)\n\n return\n }\n\n console.log([lines].flat().join('\\n'))\n}\n\nexport function logInfo(message: string): void {\n write('info', message)\n}\n\nexport function logWarn(message: string): void {\n write('warn', message)\n}\n\nexport function logError(message: string): void {\n write('error', message)\n}\n\n/**\n * Reports a step the command is taking, rather than something it found.\n */\nexport function logStep(message: string): void {\n write('step', message)\n}\n"],"mappings":";;;;;;;;;;AAQA,MAAa,cAA4B;CACvC,UAAU;CACV,QAAQ,UAAUA,eAAM,M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AAuB;CAC7C,MAAM,QAAQ,OAAO;AACvB"}
1
+ {"version":3,"file":"log-BzmBldY6.cjs","names":["clack","styleText","isRichOutput"],"sources":["../src/loggers/clackWriter.ts","../src/loggers/plainWriter.ts","../src/ui/log.ts"],"sourcesContent":["import { styleText } from 'node:util'\nimport * as clack from '@clack/prompts'\nimport type { LoggerWriter } from './types.ts'\n\n/**\n * Draws with clack for local development: a gutter bar per group, animated steps, and a progress\n * bar for the writes.\n */\nexport const clackWriter: LoggerWriter = {\n audience: 'human',\n group: (title) => clack.intro(title),\n groupEnd: (text) => clack.outro(text),\n step: (text) => clack.log.step(text, { spacing: 0 }),\n info: (text) => clack.log.info(text),\n success: (text) => clack.log.success(text),\n warn: (text) => clack.log.warn(text),\n error: (text) => clack.log.error(text),\n block: (lines) => clack.log.message(lines, { spacing: 0 }),\n // A subprocess's output is not Kubb's tree, so it goes out past clack and its gutter bar. The\n // step above it is already stopped by the time this runs.\n raw: (lines) => console.log(styleText('dim', lines.join('\\n'))),\n // The diagnostic carries its own code and indented rows, so clear clack's gutter and bar and let\n // the block stand on its own.\n diagnostic: (lines) => clack.log.message(lines, { symbol: '', secondarySymbol: '' }),\n update: (lines, title) =>\n clack.box(lines.join('\\n'), title, {\n width: 'auto',\n formatBorder: (border: string) => styleText('yellow', border),\n rounded: true,\n withGuide: false,\n contentAlign: 'center',\n titleAlign: 'center',\n }),\n spinner: () => clack.spinner(),\n progress(max) {\n const bar = clack.progress({ style: 'block', max, size: 30 })\n\n return {\n start: (text) => bar.start(text),\n advance: (text) => bar.advance(1, text),\n stop: (text) => bar.stop(text),\n }\n },\n}\n","import type { LoggerWriter } from './types.ts'\n\n/**\n * Prefixes that stand in for the symbols clack draws, so plain output reads the same way.\n */\nexport const SYMBOLS = { info: 'ℹ', warn: '⚠', error: '✗', step: '◇' } as const\n\n/**\n * Draws with one `write` call per line, e.g. `console.error` so stdout carries only JSON. Nothing\n * animates, so a step prints at start and end.\n */\nexport function createPlainWriter(write: (line: string) => void): LoggerWriter {\n return {\n audience: 'agent',\n group: write,\n groupEnd: write,\n step: (text) => write(`${SYMBOLS.step} ${text}`),\n info: write,\n success: write,\n warn: write,\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n block: (lines) => write(lines.join('\\n')),\n raw: (lines) => write(lines.join('\\n')),\n diagnostic: (lines) => write(lines.join('\\n')),\n update: (lines, title) => write([title, ...lines].join('\\n')),\n spinner: () => ({\n start: write,\n message: write,\n clear: () => {},\n stop: (text) => text && write(text),\n error: (text) => write(`${SYMBOLS.error} ${text}`),\n }),\n progress: () => ({\n start: write,\n advance: write,\n stop: (text) => text && write(text),\n }),\n }\n}\n\n/**\n * Draws on the console, for non-TTY environments and for an AI coding agent reading the output.\n * Reports the same run in the same order as `clackWriter`, without the animation.\n */\nexport const plainWriter = createPlainWriter((line) => console.log(line))\n","import * as prompts from '@clack/prompts'\nimport { isRichOutput } from '../utils/env.ts'\nimport { clackWriter } from '../loggers/clackWriter.ts'\nimport { plainWriter, SYMBOLS } from '../loggers/plainWriter.ts'\nimport type { LoggerWriter } from '../loggers/types.ts'\n\n/** The writer the loggers draw with on this terminal, so a command's own lines look like its run. */\nexport function writer(): LoggerWriter {\n return isRichOutput() ? clackWriter : plainWriter\n}\n\ntype Level = keyof typeof SYMBOLS\n\n// Not through the writers: in plain output a command's own info and warning carry their symbol, and clack's step keeps its spacing.\nfunction write(level: Level, message: string): void {\n if (isRichOutput()) {\n prompts.log[level](message)\n\n return\n }\n\n console.log(`${SYMBOLS[level]} ${message}`)\n}\n\n/** Prints lines as one block, without a symbol in front of them. Not the writer's block, which drops clack's spacing around it. */\nexport function logBlock(lines: string | Array<string>): void {\n if (isRichOutput()) {\n prompts.log.message(lines)\n\n return\n }\n\n console.log([lines].flat().join('\\n'))\n}\n\nexport function logInfo(message: string): void {\n write('info', message)\n}\n\nexport function logWarn(message: string): void {\n write('warn', message)\n}\n\nexport function logError(message: string): void {\n write('error', message)\n}\n\n/**\n * Reports a step the command is taking, rather than something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