@emulsify/cli 1.5.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/README.md +89 -1
  2. package/dist/handlers/componentInstall.js +9 -5
  3. package/dist/handlers/componentList.js +1 -1
  4. package/dist/handlers/init.js +1 -1
  5. package/dist/handlers/systemInstall.js +27 -11
  6. package/dist/index.js +13 -21
  7. package/dist/node_modules/.package-lock.json +34 -43
  8. package/dist/node_modules/@types/node/LICENSE +0 -0
  9. package/dist/node_modules/@types/node/README.md +3 -3
  10. package/dist/node_modules/@types/node/assert.d.ts +33 -31
  11. package/dist/node_modules/@types/node/async_hooks.d.ts +29 -21
  12. package/dist/node_modules/@types/node/buffer.d.ts +67 -3
  13. package/dist/node_modules/@types/node/child_process.d.ts +230 -62
  14. package/dist/node_modules/@types/node/cluster.d.ts +62 -27
  15. package/dist/node_modules/@types/node/console.d.ts +6 -6
  16. package/dist/node_modules/@types/node/constants.d.ts +12 -11
  17. package/dist/node_modules/@types/node/crypto.d.ts +338 -240
  18. package/dist/node_modules/@types/node/dgram.d.ts +50 -14
  19. package/dist/node_modules/@types/node/dns.d.ts +183 -54
  20. package/dist/node_modules/@types/node/domain.d.ts +4 -4
  21. package/dist/node_modules/@types/node/events.d.ts +4 -4
  22. package/dist/node_modules/@types/node/fs/promises.d.ts +105 -39
  23. package/dist/node_modules/@types/node/fs.d.ts +440 -126
  24. package/dist/node_modules/@types/node/globals.d.ts +176 -24
  25. package/dist/node_modules/@types/node/globals.global.d.ts +0 -0
  26. package/dist/node_modules/@types/node/http.d.ts +309 -218
  27. package/dist/node_modules/@types/node/http2.d.ts +345 -98
  28. package/dist/node_modules/@types/node/https.d.ts +250 -118
  29. package/dist/node_modules/@types/node/index.d.ts +1 -2
  30. package/dist/node_modules/@types/node/inspector.d.ts +2 -3
  31. package/dist/node_modules/@types/node/module.d.ts +4 -4
  32. package/dist/node_modules/@types/node/net.d.ts +42 -14
  33. package/dist/node_modules/@types/node/os.d.ts +5 -4
  34. package/dist/node_modules/@types/node/package.json +10 -8
  35. package/dist/node_modules/@types/node/path.d.ts +35 -24
  36. package/dist/node_modules/@types/node/perf_hooks.d.ts +5 -5
  37. package/dist/node_modules/@types/node/process.d.ts +62 -23
  38. package/dist/node_modules/@types/node/punycode.d.ts +3 -3
  39. package/dist/node_modules/@types/node/querystring.d.ts +15 -5
  40. package/dist/node_modules/@types/node/readline.d.ts +16 -6
  41. package/dist/node_modules/@types/node/repl.d.ts +13 -7
  42. package/dist/node_modules/@types/node/stream.d.ts +190 -31
  43. package/dist/node_modules/@types/node/string_decoder.d.ts +3 -3
  44. package/dist/node_modules/@types/node/timers.d.ts +6 -6
  45. package/dist/node_modules/@types/node/tls.d.ts +113 -30
  46. package/dist/node_modules/@types/node/trace_events.d.ts +3 -3
  47. package/dist/node_modules/@types/node/ts4.8/assert.d.ts +130 -0
  48. package/dist/node_modules/@types/node/ts4.8/async_hooks.d.ts +237 -0
  49. package/dist/node_modules/@types/node/ts4.8/buffer.d.ts +89 -0
  50. package/dist/node_modules/@types/node/ts4.8/child_process.d.ts +682 -0
  51. package/dist/node_modules/@types/node/ts4.8/cluster.d.ts +300 -0
  52. package/dist/node_modules/@types/node/ts4.8/console.d.ts +142 -0
  53. package/dist/node_modules/@types/node/ts4.8/constants.d.ts +19 -0
  54. package/dist/node_modules/@types/node/ts4.8/crypto.d.ts +1287 -0
  55. package/dist/node_modules/@types/node/ts4.8/dgram.d.ts +180 -0
  56. package/dist/node_modules/@types/node/ts4.8/dns.d.ts +516 -0
  57. package/dist/node_modules/@types/node/ts4.8/domain.d.ts +27 -0
  58. package/dist/node_modules/@types/node/ts4.8/events.d.ts +82 -0
  59. package/dist/node_modules/@types/node/ts4.8/fs/promises.d.ts +634 -0
  60. package/dist/node_modules/@types/node/ts4.8/fs.d.ts +2587 -0
  61. package/dist/node_modules/@types/node/ts4.8/globals.d.ts +763 -0
  62. package/dist/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  63. package/dist/node_modules/@types/node/ts4.8/http.d.ts +580 -0
  64. package/dist/node_modules/@types/node/ts4.8/http2.d.ts +1208 -0
  65. package/dist/node_modules/@types/node/ts4.8/https.d.ts +274 -0
  66. package/dist/node_modules/@types/node/ts4.8/index.d.ts +53 -0
  67. package/dist/node_modules/@types/node/ts4.8/inspector.d.ts +3050 -0
  68. package/dist/node_modules/@types/node/ts4.8/module.d.ts +56 -0
  69. package/dist/node_modules/@types/node/ts4.8/net.d.ts +324 -0
  70. package/dist/node_modules/@types/node/ts4.8/os.d.ts +243 -0
  71. package/dist/node_modules/@types/node/ts4.8/path.d.ts +168 -0
  72. package/dist/node_modules/@types/node/ts4.8/perf_hooks.d.ts +274 -0
  73. package/dist/node_modules/@types/node/ts4.8/process.d.ts +452 -0
  74. package/dist/node_modules/@types/node/ts4.8/punycode.d.ts +78 -0
  75. package/dist/node_modules/@types/node/ts4.8/querystring.d.ts +41 -0
  76. package/dist/node_modules/@types/node/ts4.8/readline.d.ts +184 -0
  77. package/dist/node_modules/@types/node/ts4.8/repl.d.ts +404 -0
  78. package/dist/node_modules/@types/node/ts4.8/stream.d.ts +518 -0
  79. package/dist/node_modules/@types/node/ts4.8/string_decoder.d.ts +10 -0
  80. package/dist/node_modules/@types/node/ts4.8/timers.d.ts +19 -0
  81. package/dist/node_modules/@types/node/ts4.8/tls.d.ts +866 -0
  82. package/dist/node_modules/@types/node/ts4.8/trace_events.d.ts +64 -0
  83. package/dist/node_modules/@types/node/ts4.8/tty.d.ts +69 -0
  84. package/dist/node_modules/@types/node/ts4.8/url.d.ts +187 -0
  85. package/dist/node_modules/@types/node/ts4.8/util.d.ts +278 -0
  86. package/dist/node_modules/@types/node/ts4.8/v8.d.ts +189 -0
  87. package/dist/node_modules/@types/node/ts4.8/vm.d.ts +155 -0
  88. package/dist/node_modules/@types/node/ts4.8/wasi.d.ts +88 -0
  89. package/dist/node_modules/@types/node/ts4.8/worker_threads.d.ts +241 -0
  90. package/dist/node_modules/@types/node/ts4.8/zlib.d.ts +364 -0
  91. package/dist/node_modules/@types/node/tty.d.ts +4 -4
  92. package/dist/node_modules/@types/node/url.d.ts +75 -7
  93. package/dist/node_modules/@types/node/util.d.ts +103 -41
  94. package/dist/node_modules/@types/node/v8.d.ts +4 -5
  95. package/dist/node_modules/@types/node/vm.d.ts +7 -7
  96. package/dist/node_modules/@types/node/wasi.d.ts +3 -4
  97. package/dist/node_modules/@types/node/worker_threads.d.ts +8 -8
  98. package/dist/node_modules/@types/node/zlib.d.ts +13 -13
  99. package/dist/node_modules/@types/progress/LICENSE +0 -0
  100. package/dist/node_modules/@types/progress/README.md +2 -3
  101. package/dist/node_modules/@types/progress/index.d.ts +0 -5
  102. package/dist/node_modules/@types/progress/package.json +6 -6
  103. package/dist/node_modules/ajv-formats/node_modules/ajv/README.md +20 -5
  104. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2019.d.ts +3 -1
  105. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2019.js +7 -1
  106. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2019.js.map +1 -1
  107. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2020.d.ts +3 -1
  108. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2020.js +7 -1
  109. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/2020.js.map +1 -1
  110. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.d.ts +3 -1
  111. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js +7 -1
  112. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/ajv.js.map +1 -1
  113. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.d.ts +6 -5
  114. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js +9 -1
  115. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/code.js.map +1 -1
  116. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.d.ts +2 -2
  117. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/index.js.map +1 -1
  118. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.d.ts +5 -5
  119. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js +1 -1
  120. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -1
  121. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js +1 -1
  122. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/errors.js.map +1 -1
  123. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.d.ts +1 -1
  124. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js +9 -10
  125. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/index.js.map +1 -1
  126. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/parse.js +1 -1
  127. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -1
  128. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/serialize.js +19 -8
  129. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -1
  130. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/jtd/types.d.ts +2 -2
  131. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js +6 -6
  132. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/names.js.map +1 -1
  133. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.d.ts +2 -1
  134. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js +3 -3
  135. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/ref_error.js.map +1 -1
  136. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.d.ts +6 -6
  137. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js +16 -14
  138. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/resolve.js.map +1 -1
  139. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/rules.d.ts +2 -2
  140. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.d.ts +2 -2
  141. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js +1 -1
  142. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/util.js.map +1 -1
  143. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -1
  144. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.d.ts +1 -1
  145. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js +2 -1
  146. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -1
  147. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -1
  148. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js +12 -2
  149. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/index.js.map +1 -1
  150. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -1
  151. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.d.ts +1 -1
  152. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -1
  153. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.d.ts +7 -5
  154. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js +22 -18
  155. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/core.js.map +1 -1
  156. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/jtd.d.ts +4 -2
  157. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/jtd.js +7 -1
  158. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/jtd.js.map +1 -1
  159. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/equal.d.ts +1 -1
  160. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/parseJson.js +2 -1
  161. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/parseJson.js.map +1 -1
  162. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/re2.d.ts +1 -1
  163. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -1
  164. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
  165. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js +6 -0
  166. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  167. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/index.js +8 -1
  168. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/standalone/index.js.map +1 -1
  169. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/index.d.ts +25 -19
  170. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/json-schema.d.ts +15 -14
  171. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/types/jtd-schema.d.ts +31 -25
  172. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +1 -1
  173. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -1
  174. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +1 -1
  175. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -1
  176. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +1 -1
  177. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +1 -1
  178. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -1
  179. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +2 -2
  180. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -1
  181. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +1 -1
  182. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -1
  183. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +1 -1
  184. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -1
  185. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +1 -1
  186. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +1 -1
  187. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -1
  188. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +1 -1
  189. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -1
  190. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -1
  191. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -1
  192. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +1 -1
  193. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/code.js.map +1 -1
  194. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js +1 -1
  195. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -1
  196. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +1 -1
  197. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js +10 -3
  198. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -1
  199. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +1 -1
  200. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js +1 -1
  201. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -1
  202. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -1
  203. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/errors.d.ts +1 -1
  204. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.d.ts +1 -1
  205. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -1
  206. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +1 -1
  207. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -1
  208. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +1 -1
  209. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +1 -1
  210. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -1
  211. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +1 -1
  212. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +1 -1
  213. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -1
  214. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -1
  215. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +3 -3
  216. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/properties.js +8 -5
  217. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -1
  218. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/ref.js +3 -2
  219. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -1
  220. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +3 -3
  221. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -1
  222. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +1 -1
  223. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/values.js +10 -7
  224. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -1
  225. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +1 -1
  226. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -1
  227. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +1 -1
  228. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -1
  229. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.d.ts +1 -1
  230. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -1
  231. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +1 -1
  232. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +1 -1
  233. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js +4 -3
  234. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -1
  235. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.d.ts +2 -2
  236. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -1
  237. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +3 -3
  238. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +1 -1
  239. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -1
  240. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +1 -1
  241. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +1 -1
  242. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.d.ts +1 -1
  243. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -1
  244. package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +1 -1
  245. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/2019.ts +4 -1
  246. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/2020.ts +4 -1
  247. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/ajv.ts +4 -1
  248. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/code.ts +8 -0
  249. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/codegen/index.ts +25 -5
  250. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/index.ts +8 -8
  251. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/jtd/parse.ts +1 -1
  252. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/jtd/serialize.ts +21 -15
  253. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/jtd/types.ts +1 -1
  254. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/ref_error.ts +4 -3
  255. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/resolve.ts +18 -15
  256. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/rules.ts +1 -1
  257. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/dataType.ts +1 -0
  258. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/compile/validate/index.ts +11 -2
  259. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/core.ts +13 -2
  260. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/jtd.ts +4 -1
  261. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/parseJson.ts +2 -1
  262. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/runtime/uri.ts +6 -0
  263. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/standalone/index.ts +9 -2
  264. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/index.ts +14 -3
  265. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/json-schema.ts +2 -4
  266. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/types/jtd-schema.ts +25 -16
  267. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/core/ref.ts +1 -1
  268. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/discriminator/index.ts +11 -3
  269. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/properties.ts +13 -6
  270. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/ref.ts +3 -1
  271. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/jtd/values.ts +10 -7
  272. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/enum.ts +5 -3
  273. package/dist/node_modules/ajv-formats/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +1 -1
  274. package/dist/node_modules/ajv-formats/node_modules/ajv/package.json +40 -38
  275. package/dist/node_modules/commander/Readme.md +407 -169
  276. package/dist/node_modules/commander/esm.mjs +13 -1
  277. package/dist/node_modules/commander/index.js +13 -2206
  278. package/dist/node_modules/commander/lib/argument.js +145 -0
  279. package/dist/node_modules/commander/lib/command.js +2299 -0
  280. package/dist/node_modules/commander/lib/error.js +43 -0
  281. package/dist/node_modules/commander/lib/help.js +457 -0
  282. package/dist/node_modules/commander/lib/option.js +327 -0
  283. package/dist/node_modules/commander/lib/suggestSimilar.js +100 -0
  284. package/dist/node_modules/commander/package.json +46 -34
  285. package/dist/node_modules/commander/typings/esm.d.mts +3 -0
  286. package/dist/node_modules/commander/typings/index.d.ts +889 -617
  287. package/dist/node_modules/debug/README.md +3 -0
  288. package/dist/node_modules/debug/package.json +1 -1
  289. package/dist/node_modules/debug/src/common.js +1 -1
  290. package/dist/node_modules/fs-extra/README.md +3 -5
  291. package/dist/node_modules/fs-extra/lib/{copy-sync → copy}/copy-sync.js +11 -8
  292. package/dist/node_modules/fs-extra/lib/copy/copy.js +12 -9
  293. package/dist/node_modules/fs-extra/lib/copy/index.js +2 -1
  294. package/dist/node_modules/fs-extra/lib/empty/index.js +10 -19
  295. package/dist/node_modules/fs-extra/lib/ensure/index.js +15 -15
  296. package/dist/node_modules/fs-extra/lib/ensure/link.js +10 -7
  297. package/dist/node_modules/fs-extra/lib/ensure/symlink.js +34 -15
  298. package/dist/node_modules/fs-extra/lib/fs/index.js +8 -10
  299. package/dist/node_modules/fs-extra/lib/index.js +1 -12
  300. package/dist/node_modules/fs-extra/lib/json/output-json-sync.js +1 -1
  301. package/dist/node_modules/fs-extra/lib/json/output-json.js +1 -1
  302. package/dist/node_modules/fs-extra/lib/mkdirs/make-dir.js +16 -130
  303. package/dist/node_modules/fs-extra/lib/mkdirs/utils.js +21 -0
  304. package/dist/node_modules/fs-extra/lib/move/index.js +2 -1
  305. package/dist/node_modules/fs-extra/lib/{move-sync → move}/move-sync.js +12 -5
  306. package/dist/node_modules/fs-extra/lib/move/move.js +14 -4
  307. package/dist/node_modules/fs-extra/lib/remove/index.js +15 -2
  308. package/dist/node_modules/fs-extra/lib/util/stat.js +60 -45
  309. package/dist/node_modules/fs-extra/package.json +7 -10
  310. package/dist/node_modules/graceful-fs/LICENSE +1 -1
  311. package/dist/node_modules/graceful-fs/graceful-fs.js +23 -4
  312. package/dist/node_modules/graceful-fs/package.json +6 -3
  313. package/dist/node_modules/graceful-fs/polyfills.js +39 -30
  314. package/dist/node_modules/punycode/README.md +29 -3
  315. package/dist/node_modules/punycode/package.json +7 -7
  316. package/dist/node_modules/punycode/punycode.es6.js +25 -22
  317. package/dist/node_modules/punycode/punycode.js +25 -22
  318. package/dist/node_modules/ramda/dist/ramda.js +4 -4
  319. package/dist/node_modules/ramda/dist/ramda.min.js +1 -1
  320. package/dist/node_modules/ramda/es/trim.js +1 -1
  321. package/dist/node_modules/ramda/package.json +1 -1
  322. package/dist/node_modules/ramda/src/trim.js +1 -1
  323. package/dist/node_modules/universalify/README.md +1 -1
  324. package/dist/node_modules/universalify/index.js +6 -6
  325. package/dist/node_modules/universalify/package.json +2 -2
  326. package/dist/package.json +5 -6
  327. package/dist/schemas/variant.json +28 -5
  328. package/dist/util/cache/cloneIntoCache.js +1 -1
  329. package/dist/util/cache/getCachedItemPath.js +4 -2
  330. package/dist/util/cache/getJsonFromCachedFile.js +2 -2
  331. package/dist/util/getGitRepoNameFromUrl.js +1 -1
  332. package/dist/util/getRepositoryLatestTag.js +16 -0
  333. package/dist/util/platform/getInitSuccessMessageForPlatform.js +4 -3
  334. package/dist/util/project/buildComponentDependencyList.js +20 -0
  335. package/package.json +6 -7
  336. package/dist/node_modules/at-least-node/LICENSE +0 -6
  337. package/dist/node_modules/at-least-node/README.md +0 -25
  338. package/dist/node_modules/at-least-node/index.js +0 -5
  339. package/dist/node_modules/at-least-node/package.json +0 -32
  340. package/dist/node_modules/commander/CHANGELOG.md +0 -440
  341. package/dist/node_modules/fs-extra/CHANGELOG.md +0 -902
  342. package/dist/node_modules/fs-extra/lib/copy-sync/index.js +0 -5
  343. package/dist/node_modules/fs-extra/lib/move-sync/index.js +0 -5
  344. /package/dist/node_modules/fs-extra/lib/{output → output-file}/index.js +0 -0
@@ -0,0 +1,43 @@
1
+ /**
2
+ * CommanderError class
3
+ * @class
4
+ */
5
+ class CommanderError extends Error {
6
+ /**
7
+ * Constructs the CommanderError class
8
+ * @param {number} exitCode suggested exit code which could be used with process.exit
9
+ * @param {string} code an id string representing the error
10
+ * @param {string} message human-readable description of the error
11
+ * @constructor
12
+ */
13
+ constructor(exitCode, code, message) {
14
+ super(message);
15
+ // properly capture stack trace in Node.js
16
+ Error.captureStackTrace(this, this.constructor);
17
+ this.name = this.constructor.name;
18
+ this.code = code;
19
+ this.exitCode = exitCode;
20
+ this.nestedError = undefined;
21
+ }
22
+ }
23
+
24
+ /**
25
+ * InvalidArgumentError class
26
+ * @class
27
+ */
28
+ class InvalidArgumentError extends CommanderError {
29
+ /**
30
+ * Constructs the InvalidArgumentError class
31
+ * @param {string} [message] explanation of why argument is invalid
32
+ * @constructor
33
+ */
34
+ constructor(message) {
35
+ super(1, 'commander.invalidArgument', message);
36
+ // properly capture stack trace in Node.js
37
+ Error.captureStackTrace(this, this.constructor);
38
+ this.name = this.constructor.name;
39
+ }
40
+ }
41
+
42
+ exports.CommanderError = CommanderError;
43
+ exports.InvalidArgumentError = InvalidArgumentError;
@@ -0,0 +1,457 @@
1
+ const { humanReadableArgName } = require('./argument.js');
2
+
3
+ /**
4
+ * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`
5
+ * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types
6
+ * @typedef { import("./argument.js").Argument } Argument
7
+ * @typedef { import("./command.js").Command } Command
8
+ * @typedef { import("./option.js").Option } Option
9
+ */
10
+
11
+ // Although this is a class, methods are static in style to allow override using subclass or just functions.
12
+ class Help {
13
+ constructor() {
14
+ this.helpWidth = undefined;
15
+ this.sortSubcommands = false;
16
+ this.sortOptions = false;
17
+ this.showGlobalOptions = false;
18
+ }
19
+
20
+ /**
21
+ * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.
22
+ *
23
+ * @param {Command} cmd
24
+ * @returns {Command[]}
25
+ */
26
+
27
+ visibleCommands(cmd) {
28
+ const visibleCommands = cmd.commands.filter(cmd => !cmd._hidden);
29
+ const helpCommand = cmd._getHelpCommand();
30
+ if (helpCommand && !helpCommand._hidden) {
31
+ visibleCommands.push(helpCommand);
32
+ }
33
+ if (this.sortSubcommands) {
34
+ visibleCommands.sort((a, b) => {
35
+ // @ts-ignore: overloaded return type
36
+ return a.name().localeCompare(b.name());
37
+ });
38
+ }
39
+ return visibleCommands;
40
+ }
41
+
42
+ /**
43
+ * Compare options for sort.
44
+ *
45
+ * @param {Option} a
46
+ * @param {Option} b
47
+ * @returns number
48
+ */
49
+ compareOptions(a, b) {
50
+ const getSortKey = (option) => {
51
+ // WYSIWYG for order displayed in help. Short used for comparison if present. No special handling for negated.
52
+ return option.short ? option.short.replace(/^-/, '') : option.long.replace(/^--/, '');
53
+ };
54
+ return getSortKey(a).localeCompare(getSortKey(b));
55
+ }
56
+
57
+ /**
58
+ * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
59
+ *
60
+ * @param {Command} cmd
61
+ * @returns {Option[]}
62
+ */
63
+
64
+ visibleOptions(cmd) {
65
+ const visibleOptions = cmd.options.filter((option) => !option.hidden);
66
+ // Built-in help option.
67
+ const helpOption = cmd._getHelpOption();
68
+ if (helpOption && !helpOption.hidden) {
69
+ // Automatically hide conflicting flags. Bit dubious but a historical behaviour that is convenient for single-command programs.
70
+ const removeShort = helpOption.short && cmd._findOption(helpOption.short);
71
+ const removeLong = helpOption.long && cmd._findOption(helpOption.long);
72
+ if (!removeShort && !removeLong) {
73
+ visibleOptions.push(helpOption); // no changes needed
74
+ } else if (helpOption.long && !removeLong) {
75
+ visibleOptions.push(cmd.createOption(helpOption.long, helpOption.description));
76
+ } else if (helpOption.short && !removeShort) {
77
+ visibleOptions.push(cmd.createOption(helpOption.short, helpOption.description));
78
+ }
79
+ }
80
+ if (this.sortOptions) {
81
+ visibleOptions.sort(this.compareOptions);
82
+ }
83
+ return visibleOptions;
84
+ }
85
+
86
+ /**
87
+ * Get an array of the visible global options. (Not including help.)
88
+ *
89
+ * @param {Command} cmd
90
+ * @returns {Option[]}
91
+ */
92
+
93
+ visibleGlobalOptions(cmd) {
94
+ if (!this.showGlobalOptions) return [];
95
+
96
+ const globalOptions = [];
97
+ for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) {
98
+ const visibleOptions = ancestorCmd.options.filter((option) => !option.hidden);
99
+ globalOptions.push(...visibleOptions);
100
+ }
101
+ if (this.sortOptions) {
102
+ globalOptions.sort(this.compareOptions);
103
+ }
104
+ return globalOptions;
105
+ }
106
+
107
+ /**
108
+ * Get an array of the arguments if any have a description.
109
+ *
110
+ * @param {Command} cmd
111
+ * @returns {Argument[]}
112
+ */
113
+
114
+ visibleArguments(cmd) {
115
+ // Side effect! Apply the legacy descriptions before the arguments are displayed.
116
+ if (cmd._argsDescription) {
117
+ cmd.registeredArguments.forEach(argument => {
118
+ argument.description = argument.description || cmd._argsDescription[argument.name()] || '';
119
+ });
120
+ }
121
+
122
+ // If there are any arguments with a description then return all the arguments.
123
+ if (cmd.registeredArguments.find(argument => argument.description)) {
124
+ return cmd.registeredArguments;
125
+ }
126
+ return [];
127
+ }
128
+
129
+ /**
130
+ * Get the command term to show in the list of subcommands.
131
+ *
132
+ * @param {Command} cmd
133
+ * @returns {string}
134
+ */
135
+
136
+ subcommandTerm(cmd) {
137
+ // Legacy. Ignores custom usage string, and nested commands.
138
+ const args = cmd.registeredArguments.map(arg => humanReadableArgName(arg)).join(' ');
139
+ return cmd._name +
140
+ (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +
141
+ (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option
142
+ (args ? ' ' + args : '');
143
+ }
144
+
145
+ /**
146
+ * Get the option term to show in the list of options.
147
+ *
148
+ * @param {Option} option
149
+ * @returns {string}
150
+ */
151
+
152
+ optionTerm(option) {
153
+ return option.flags;
154
+ }
155
+
156
+ /**
157
+ * Get the argument term to show in the list of arguments.
158
+ *
159
+ * @param {Argument} argument
160
+ * @returns {string}
161
+ */
162
+
163
+ argumentTerm(argument) {
164
+ return argument.name();
165
+ }
166
+
167
+ /**
168
+ * Get the longest command term length.
169
+ *
170
+ * @param {Command} cmd
171
+ * @param {Help} helper
172
+ * @returns {number}
173
+ */
174
+
175
+ longestSubcommandTermLength(cmd, helper) {
176
+ return helper.visibleCommands(cmd).reduce((max, command) => {
177
+ return Math.max(max, helper.subcommandTerm(command).length);
178
+ }, 0);
179
+ }
180
+
181
+ /**
182
+ * Get the longest option term length.
183
+ *
184
+ * @param {Command} cmd
185
+ * @param {Help} helper
186
+ * @returns {number}
187
+ */
188
+
189
+ longestOptionTermLength(cmd, helper) {
190
+ return helper.visibleOptions(cmd).reduce((max, option) => {
191
+ return Math.max(max, helper.optionTerm(option).length);
192
+ }, 0);
193
+ }
194
+
195
+ /**
196
+ * Get the longest global option term length.
197
+ *
198
+ * @param {Command} cmd
199
+ * @param {Help} helper
200
+ * @returns {number}
201
+ */
202
+
203
+ longestGlobalOptionTermLength(cmd, helper) {
204
+ return helper.visibleGlobalOptions(cmd).reduce((max, option) => {
205
+ return Math.max(max, helper.optionTerm(option).length);
206
+ }, 0);
207
+ }
208
+
209
+ /**
210
+ * Get the longest argument term length.
211
+ *
212
+ * @param {Command} cmd
213
+ * @param {Help} helper
214
+ * @returns {number}
215
+ */
216
+
217
+ longestArgumentTermLength(cmd, helper) {
218
+ return helper.visibleArguments(cmd).reduce((max, argument) => {
219
+ return Math.max(max, helper.argumentTerm(argument).length);
220
+ }, 0);
221
+ }
222
+
223
+ /**
224
+ * Get the command usage to be displayed at the top of the built-in help.
225
+ *
226
+ * @param {Command} cmd
227
+ * @returns {string}
228
+ */
229
+
230
+ commandUsage(cmd) {
231
+ // Usage
232
+ let cmdName = cmd._name;
233
+ if (cmd._aliases[0]) {
234
+ cmdName = cmdName + '|' + cmd._aliases[0];
235
+ }
236
+ let ancestorCmdNames = '';
237
+ for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) {
238
+ ancestorCmdNames = ancestorCmd.name() + ' ' + ancestorCmdNames;
239
+ }
240
+ return ancestorCmdNames + cmdName + ' ' + cmd.usage();
241
+ }
242
+
243
+ /**
244
+ * Get the description for the command.
245
+ *
246
+ * @param {Command} cmd
247
+ * @returns {string}
248
+ */
249
+
250
+ commandDescription(cmd) {
251
+ // @ts-ignore: overloaded return type
252
+ return cmd.description();
253
+ }
254
+
255
+ /**
256
+ * Get the subcommand summary to show in the list of subcommands.
257
+ * (Fallback to description for backwards compatibility.)
258
+ *
259
+ * @param {Command} cmd
260
+ * @returns {string}
261
+ */
262
+
263
+ subcommandDescription(cmd) {
264
+ // @ts-ignore: overloaded return type
265
+ return cmd.summary() || cmd.description();
266
+ }
267
+
268
+ /**
269
+ * Get the option description to show in the list of options.
270
+ *
271
+ * @param {Option} option
272
+ * @return {string}
273
+ */
274
+
275
+ optionDescription(option) {
276
+ const extraInfo = [];
277
+
278
+ if (option.argChoices) {
279
+ extraInfo.push(
280
+ // use stringify to match the display of the default value
281
+ `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);
282
+ }
283
+ if (option.defaultValue !== undefined) {
284
+ // default for boolean and negated more for programmer than end user,
285
+ // but show true/false for boolean option as may be for hand-rolled env or config processing.
286
+ const showDefault = option.required || option.optional ||
287
+ (option.isBoolean() && typeof option.defaultValue === 'boolean');
288
+ if (showDefault) {
289
+ extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`);
290
+ }
291
+ }
292
+ // preset for boolean and negated are more for programmer than end user
293
+ if (option.presetArg !== undefined && option.optional) {
294
+ extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`);
295
+ }
296
+ if (option.envVar !== undefined) {
297
+ extraInfo.push(`env: ${option.envVar}`);
298
+ }
299
+ if (extraInfo.length > 0) {
300
+ return `${option.description} (${extraInfo.join(', ')})`;
301
+ }
302
+
303
+ return option.description;
304
+ }
305
+
306
+ /**
307
+ * Get the argument description to show in the list of arguments.
308
+ *
309
+ * @param {Argument} argument
310
+ * @return {string}
311
+ */
312
+
313
+ argumentDescription(argument) {
314
+ const extraInfo = [];
315
+ if (argument.argChoices) {
316
+ extraInfo.push(
317
+ // use stringify to match the display of the default value
318
+ `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);
319
+ }
320
+ if (argument.defaultValue !== undefined) {
321
+ extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);
322
+ }
323
+ if (extraInfo.length > 0) {
324
+ const extraDescripton = `(${extraInfo.join(', ')})`;
325
+ if (argument.description) {
326
+ return `${argument.description} ${extraDescripton}`;
327
+ }
328
+ return extraDescripton;
329
+ }
330
+ return argument.description;
331
+ }
332
+
333
+ /**
334
+ * Generate the built-in help text.
335
+ *
336
+ * @param {Command} cmd
337
+ * @param {Help} helper
338
+ * @returns {string}
339
+ */
340
+
341
+ formatHelp(cmd, helper) {
342
+ const termWidth = helper.padWidth(cmd, helper);
343
+ const helpWidth = helper.helpWidth || 80;
344
+ const itemIndentWidth = 2;
345
+ const itemSeparatorWidth = 2; // between term and description
346
+ function formatItem(term, description) {
347
+ if (description) {
348
+ const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;
349
+ return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);
350
+ }
351
+ return term;
352
+ }
353
+ function formatList(textArray) {
354
+ return textArray.join('\n').replace(/^/gm, ' '.repeat(itemIndentWidth));
355
+ }
356
+
357
+ // Usage
358
+ let output = [`Usage: ${helper.commandUsage(cmd)}`, ''];
359
+
360
+ // Description
361
+ const commandDescription = helper.commandDescription(cmd);
362
+ if (commandDescription.length > 0) {
363
+ output = output.concat([helper.wrap(commandDescription, helpWidth, 0), '']);
364
+ }
365
+
366
+ // Arguments
367
+ const argumentList = helper.visibleArguments(cmd).map((argument) => {
368
+ return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));
369
+ });
370
+ if (argumentList.length > 0) {
371
+ output = output.concat(['Arguments:', formatList(argumentList), '']);
372
+ }
373
+
374
+ // Options
375
+ const optionList = helper.visibleOptions(cmd).map((option) => {
376
+ return formatItem(helper.optionTerm(option), helper.optionDescription(option));
377
+ });
378
+ if (optionList.length > 0) {
379
+ output = output.concat(['Options:', formatList(optionList), '']);
380
+ }
381
+
382
+ if (this.showGlobalOptions) {
383
+ const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => {
384
+ return formatItem(helper.optionTerm(option), helper.optionDescription(option));
385
+ });
386
+ if (globalOptionList.length > 0) {
387
+ output = output.concat(['Global Options:', formatList(globalOptionList), '']);
388
+ }
389
+ }
390
+
391
+ // Commands
392
+ const commandList = helper.visibleCommands(cmd).map((cmd) => {
393
+ return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd));
394
+ });
395
+ if (commandList.length > 0) {
396
+ output = output.concat(['Commands:', formatList(commandList), '']);
397
+ }
398
+
399
+ return output.join('\n');
400
+ }
401
+
402
+ /**
403
+ * Calculate the pad width from the maximum term length.
404
+ *
405
+ * @param {Command} cmd
406
+ * @param {Help} helper
407
+ * @returns {number}
408
+ */
409
+
410
+ padWidth(cmd, helper) {
411
+ return Math.max(
412
+ helper.longestOptionTermLength(cmd, helper),
413
+ helper.longestGlobalOptionTermLength(cmd, helper),
414
+ helper.longestSubcommandTermLength(cmd, helper),
415
+ helper.longestArgumentTermLength(cmd, helper)
416
+ );
417
+ }
418
+
419
+ /**
420
+ * Wrap the given string to width characters per line, with lines after the first indented.
421
+ * Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.
422
+ *
423
+ * @param {string} str
424
+ * @param {number} width
425
+ * @param {number} indent
426
+ * @param {number} [minColumnWidth=40]
427
+ * @return {string}
428
+ *
429
+ */
430
+
431
+ wrap(str, width, indent, minColumnWidth = 40) {
432
+ // Full \s characters, minus the linefeeds.
433
+ const indents = ' \\f\\t\\v\u00a0\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff';
434
+ // Detect manually wrapped and indented strings by searching for line break followed by spaces.
435
+ const manualIndent = new RegExp(`[\\n][${indents}]+`);
436
+ if (str.match(manualIndent)) return str;
437
+ // Do not wrap if not enough room for a wrapped column of text (as could end up with a word per line).
438
+ const columnWidth = width - indent;
439
+ if (columnWidth < minColumnWidth) return str;
440
+
441
+ const leadingStr = str.slice(0, indent);
442
+ const columnText = str.slice(indent).replace('\r\n', '\n');
443
+ const indentString = ' '.repeat(indent);
444
+ const zeroWidthSpace = '\u200B';
445
+ const breaks = `\\s${zeroWidthSpace}`;
446
+ // Match line end (so empty lines don't collapse),
447
+ // or as much text as will fit in column, or excess text up to first break.
448
+ const regex = new RegExp(`\n|.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`, 'g');
449
+ const lines = columnText.match(regex) || [];
450
+ return leadingStr + lines.map((line, i) => {
451
+ if (line === '\n') return ''; // preserve empty lines
452
+ return ((i > 0) ? indentString : '') + line.trimEnd();
453
+ }).join('\n');
454
+ }
455
+ }
456
+
457
+ exports.Help = Help;