@shopify/cli-kit 0.0.0-nightly-20230110194301

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 (488) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +63 -0
  3. package/assets/auth-error.html +23 -0
  4. package/assets/empty-url.html +23 -0
  5. package/assets/favicon.svg +26 -0
  6. package/assets/missing-code.html +23 -0
  7. package/assets/missing-state.html +23 -0
  8. package/assets/style.css +58 -0
  9. package/assets/success.html +20 -0
  10. package/dist/api/admin.d.ts +3 -0
  11. package/dist/api/admin.js +56 -0
  12. package/dist/api/admin.js.map +1 -0
  13. package/dist/api/common.d.ts +21 -0
  14. package/dist/api/common.js +87 -0
  15. package/dist/api/common.js.map +1 -0
  16. package/dist/api/graphql/all_app_extension_registrations.d.ts +20 -0
  17. package/dist/api/graphql/all_app_extension_registrations.js +20 -0
  18. package/dist/api/graphql/all_app_extension_registrations.js.map +1 -0
  19. package/dist/api/graphql/all_dev_stores_by_org.d.ts +18 -0
  20. package/dist/api/graphql/all_dev_stores_by_org.js +21 -0
  21. package/dist/api/graphql/all_dev_stores_by_org.js.map +1 -0
  22. package/dist/api/graphql/all_orgs.d.ts +12 -0
  23. package/dist/api/graphql/all_orgs.js +14 -0
  24. package/dist/api/graphql/all_orgs.js.map +1 -0
  25. package/dist/api/graphql/convert_dev_to_test_store.d.ts +16 -0
  26. package/dist/api/graphql/convert_dev_to_test_store.js +13 -0
  27. package/dist/api/graphql/convert_dev_to_test_store.js.map +1 -0
  28. package/dist/api/graphql/create_app.d.ts +29 -0
  29. package/dist/api/graphql/create_app.js +33 -0
  30. package/dist/api/graphql/create_app.js.map +1 -0
  31. package/dist/api/graphql/create_deployment.d.ts +33 -0
  32. package/dist/api/graphql/create_deployment.js +25 -0
  33. package/dist/api/graphql/create_deployment.js.map +1 -0
  34. package/dist/api/graphql/extension_create.d.ts +30 -0
  35. package/dist/api/graphql/extension_create.js +26 -0
  36. package/dist/api/graphql/extension_create.js.map +1 -0
  37. package/dist/api/graphql/extension_specifications.d.ts +27 -0
  38. package/dist/api/graphql/extension_specifications.js +22 -0
  39. package/dist/api/graphql/extension_specifications.js.map +1 -0
  40. package/dist/api/graphql/find_app.d.ts +14 -0
  41. package/dist/api/graphql/find_app.js +17 -0
  42. package/dist/api/graphql/find_app.js.map +1 -0
  43. package/dist/api/graphql/find_org.d.ts +18 -0
  44. package/dist/api/graphql/find_org.js +21 -0
  45. package/dist/api/graphql/find_org.js.map +1 -0
  46. package/dist/api/graphql/find_org_basic.d.ts +11 -0
  47. package/dist/api/graphql/find_org_basic.js +14 -0
  48. package/dist/api/graphql/find_org_basic.js.map +1 -0
  49. package/dist/api/graphql/find_store_by_domain.d.ts +21 -0
  50. package/dist/api/graphql/find_store_by_domain.js +24 -0
  51. package/dist/api/graphql/find_store_by_domain.js.map +1 -0
  52. package/dist/api/graphql/functions/api_schema_definition.d.ts +9 -0
  53. package/dist/api/graphql/functions/api_schema_definition.js +7 -0
  54. package/dist/api/graphql/functions/api_schema_definition.js.map +1 -0
  55. package/dist/api/graphql/functions/app_function_set.d.ts +30 -0
  56. package/dist/api/graphql/functions/app_function_set.js +38 -0
  57. package/dist/api/graphql/functions/app_function_set.js.map +1 -0
  58. package/dist/api/graphql/functions/function_service_proxy.d.ts +4 -0
  59. package/dist/api/graphql/functions/function_service_proxy.js +7 -0
  60. package/dist/api/graphql/functions/function_service_proxy.js.map +1 -0
  61. package/dist/api/graphql/functions/upload_url_generate.d.ts +12 -0
  62. package/dist/api/graphql/functions/upload_url_generate.js +11 -0
  63. package/dist/api/graphql/functions/upload_url_generate.js.map +1 -0
  64. package/dist/api/graphql/generate_signed_upload_url.d.ts +15 -0
  65. package/dist/api/graphql/generate_signed_upload_url.js +15 -0
  66. package/dist/api/graphql/generate_signed_upload_url.js.map +1 -0
  67. package/dist/api/graphql/get_urls.d.ts +10 -0
  68. package/dist/api/graphql/get_urls.js +10 -0
  69. package/dist/api/graphql/get_urls.js.map +1 -0
  70. package/dist/api/graphql/get_variant_id.d.ts +17 -0
  71. package/dist/api/graphql/get_variant_id.js +20 -0
  72. package/dist/api/graphql/get_variant_id.js.map +1 -0
  73. package/dist/api/graphql/index.d.ts +21 -0
  74. package/dist/api/graphql/index.js +22 -0
  75. package/dist/api/graphql/index.js.map +1 -0
  76. package/dist/api/graphql/update_draft.d.ts +33 -0
  77. package/dist/api/graphql/update_draft.js +24 -0
  78. package/dist/api/graphql/update_draft.js.map +1 -0
  79. package/dist/api/graphql/update_urls.d.ts +14 -0
  80. package/dist/api/graphql/update_urls.js +12 -0
  81. package/dist/api/graphql/update_urls.js.map +1 -0
  82. package/dist/api/identity.d.ts +1 -0
  83. package/dist/api/identity.js +41 -0
  84. package/dist/api/identity.js.map +1 -0
  85. package/dist/api/oxygen.d.ts +5 -0
  86. package/dist/api/oxygen.js +30 -0
  87. package/dist/api/oxygen.js.map +1 -0
  88. package/dist/api/partners.d.ts +14 -0
  89. package/dist/api/partners.js +44 -0
  90. package/dist/api/partners.js.map +1 -0
  91. package/dist/api.d.ts +6 -0
  92. package/dist/api.js +7 -0
  93. package/dist/api.js.map +1 -0
  94. package/dist/cli.d.ts +8 -0
  95. package/dist/cli.js +18 -0
  96. package/dist/cli.js.map +1 -0
  97. package/dist/constants.d.ts +52 -0
  98. package/dist/constants.js +71 -0
  99. package/dist/constants.js.map +1 -0
  100. package/dist/content-tokens.d.ts +44 -0
  101. package/dist/content-tokens.js +105 -0
  102. package/dist/content-tokens.js.map +1 -0
  103. package/dist/environment/fqdn.d.ts +29 -0
  104. package/dist/environment/fqdn.js +72 -0
  105. package/dist/environment/fqdn.js.map +1 -0
  106. package/dist/environment/local.d.ts +92 -0
  107. package/dist/environment/local.js +169 -0
  108. package/dist/environment/local.js.map +1 -0
  109. package/dist/environment/service.d.ts +4 -0
  110. package/dist/environment/service.js +19 -0
  111. package/dist/environment/service.js.map +1 -0
  112. package/dist/environment/spin-cache.d.ts +2 -0
  113. package/dist/environment/spin-cache.js +8 -0
  114. package/dist/environment/spin-cache.js.map +1 -0
  115. package/dist/environment/spin.d.ts +50 -0
  116. package/dist/environment/spin.js +99 -0
  117. package/dist/environment/spin.js.map +1 -0
  118. package/dist/environment/utilities.d.ts +8 -0
  119. package/dist/environment/utilities.js +19 -0
  120. package/dist/environment/utilities.js.map +1 -0
  121. package/dist/environment.d.ts +7 -0
  122. package/dist/environment.js +8 -0
  123. package/dist/environment.js.map +1 -0
  124. package/dist/error.d.ts +68 -0
  125. package/dist/error.js +143 -0
  126. package/dist/error.js.map +1 -0
  127. package/dist/file.d.ts +98 -0
  128. package/dist/file.js +216 -0
  129. package/dist/file.js.map +1 -0
  130. package/dist/git.d.ts +36 -0
  131. package/dist/git.js +133 -0
  132. package/dist/git.js.map +1 -0
  133. package/dist/http/fetch.d.ts +22 -0
  134. package/dist/http/fetch.js +44 -0
  135. package/dist/http/fetch.js.map +1 -0
  136. package/dist/http/formdata.d.ts +3 -0
  137. package/dist/http/formdata.js +6 -0
  138. package/dist/http/formdata.js.map +1 -0
  139. package/dist/http/graphql.d.ts +13 -0
  140. package/dist/http/graphql.js +12 -0
  141. package/dist/http/graphql.js.map +1 -0
  142. package/dist/http.d.ts +27 -0
  143. package/dist/http.js +32 -0
  144. package/dist/http.js.map +1 -0
  145. package/dist/index.d.ts +24 -0
  146. package/dist/index.js +25 -0
  147. package/dist/index.js.map +1 -0
  148. package/dist/metadata.d.ts +53 -0
  149. package/dist/metadata.js +62 -0
  150. package/dist/metadata.js.map +1 -0
  151. package/dist/monorail.d.ts +100 -0
  152. package/dist/monorail.js +39 -0
  153. package/dist/monorail.js.map +1 -0
  154. package/dist/network/api.d.ts +2 -0
  155. package/dist/network/api.js +2 -0
  156. package/dist/network/api.js.map +1 -0
  157. package/dist/network/service.d.ts +14 -0
  158. package/dist/network/service.js +11 -0
  159. package/dist/network/service.js.map +1 -0
  160. package/dist/npm.d.ts +27 -0
  161. package/dist/npm.js +20 -0
  162. package/dist/npm.js.map +1 -0
  163. package/dist/output.d.ts +129 -0
  164. package/dist/output.js +310 -0
  165. package/dist/output.js.map +1 -0
  166. package/dist/path.d.ts +25 -0
  167. package/dist/path.js +48 -0
  168. package/dist/path.js.map +1 -0
  169. package/dist/plugins.d.ts +73 -0
  170. package/dist/plugins.js +49 -0
  171. package/dist/plugins.js.map +1 -0
  172. package/dist/private/common/json.d.ts +6 -0
  173. package/dist/private/common/json.js +2 -0
  174. package/dist/private/common/json.js.map +1 -0
  175. package/dist/private/common/lodash.d.ts +47 -0
  176. package/dist/private/common/lodash.js +2 -0
  177. package/dist/private/common/lodash.js.map +1 -0
  178. package/dist/private/node/analytics.d.ts +27 -0
  179. package/dist/private/node/analytics.js +57 -0
  180. package/dist/private/node/analytics.js.map +1 -0
  181. package/dist/private/node/ui/alert.d.ts +2 -0
  182. package/dist/private/node/ui/alert.js +18 -0
  183. package/dist/private/node/ui/alert.js.map +1 -0
  184. package/dist/private/node/ui/components/Alert.d.ts +17 -0
  185. package/dist/private/node/ui/components/Alert.js +21 -0
  186. package/dist/private/node/ui/components/Alert.js.map +1 -0
  187. package/dist/private/node/ui/components/Alert.test.d.ts +1 -0
  188. package/dist/private/node/ui/components/Alert.test.js +95 -0
  189. package/dist/private/node/ui/components/Alert.test.js.map +1 -0
  190. package/dist/private/node/ui/components/Banner.d.ts +8 -0
  191. package/dist/private/node/ui/components/Banner.js +41 -0
  192. package/dist/private/node/ui/components/Banner.js.map +1 -0
  193. package/dist/private/node/ui/components/Banner.test.d.ts +1 -0
  194. package/dist/private/node/ui/components/Banner.test.js +52 -0
  195. package/dist/private/node/ui/components/Banner.test.js.map +1 -0
  196. package/dist/private/node/ui/components/Command.d.ts +9 -0
  197. package/dist/private/node/ui/components/Command.js +13 -0
  198. package/dist/private/node/ui/components/Command.js.map +1 -0
  199. package/dist/private/node/ui/components/Command.test.d.ts +1 -0
  200. package/dist/private/node/ui/components/Command.test.js +11 -0
  201. package/dist/private/node/ui/components/Command.test.js.map +1 -0
  202. package/dist/private/node/ui/components/ConcurrentOutput.d.ts +47 -0
  203. package/dist/private/node/ui/components/ConcurrentOutput.js +86 -0
  204. package/dist/private/node/ui/components/ConcurrentOutput.js.map +1 -0
  205. package/dist/private/node/ui/components/ConcurrentOutput.test.d.ts +1 -0
  206. package/dist/private/node/ui/components/ConcurrentOutput.test.js +54 -0
  207. package/dist/private/node/ui/components/ConcurrentOutput.test.js.map +1 -0
  208. package/dist/private/node/ui/components/FatalError.d.ts +7 -0
  209. package/dist/private/node/ui/components/FatalError.js +54 -0
  210. package/dist/private/node/ui/components/FatalError.js.map +1 -0
  211. package/dist/private/node/ui/components/FatalError.test.d.ts +1 -0
  212. package/dist/private/node/ui/components/FatalError.test.js +119 -0
  213. package/dist/private/node/ui/components/FatalError.test.js.map +1 -0
  214. package/dist/private/node/ui/components/FilePath.d.ts +9 -0
  215. package/dist/private/node/ui/components/FilePath.js +13 -0
  216. package/dist/private/node/ui/components/FilePath.js.map +1 -0
  217. package/dist/private/node/ui/components/FilePath.test.d.ts +1 -0
  218. package/dist/private/node/ui/components/FilePath.test.js +11 -0
  219. package/dist/private/node/ui/components/FilePath.test.js.map +1 -0
  220. package/dist/private/node/ui/components/FullScreen.d.ts +8 -0
  221. package/dist/private/node/ui/components/FullScreen.js +32 -0
  222. package/dist/private/node/ui/components/FullScreen.js.map +1 -0
  223. package/dist/private/node/ui/components/Link.d.ts +10 -0
  224. package/dist/private/node/ui/components/Link.js +15 -0
  225. package/dist/private/node/ui/components/Link.js.map +1 -0
  226. package/dist/private/node/ui/components/Link.test.d.ts +1 -0
  227. package/dist/private/node/ui/components/Link.test.js +22 -0
  228. package/dist/private/node/ui/components/Link.test.js.map +1 -0
  229. package/dist/private/node/ui/components/List.d.ts +13 -0
  230. package/dist/private/node/ui/components/List.js +19 -0
  231. package/dist/private/node/ui/components/List.js.map +1 -0
  232. package/dist/private/node/ui/components/List.test.d.ts +1 -0
  233. package/dist/private/node/ui/components/List.test.js +34 -0
  234. package/dist/private/node/ui/components/List.test.js.map +1 -0
  235. package/dist/private/node/ui/components/SelectInput.d.ts +12 -0
  236. package/dist/private/node/ui/components/SelectInput.js +87 -0
  237. package/dist/private/node/ui/components/SelectInput.js.map +1 -0
  238. package/dist/private/node/ui/components/SelectInput.test.d.ts +1 -0
  239. package/dist/private/node/ui/components/SelectInput.test.js +230 -0
  240. package/dist/private/node/ui/components/SelectInput.test.js.map +1 -0
  241. package/dist/private/node/ui/components/SelectPrompt.d.ts +11 -0
  242. package/dist/private/node/ui/components/SelectPrompt.js +34 -0
  243. package/dist/private/node/ui/components/SelectPrompt.js.map +1 -0
  244. package/dist/private/node/ui/components/SelectPrompt.test.d.ts +1 -0
  245. package/dist/private/node/ui/components/SelectPrompt.test.js +74 -0
  246. package/dist/private/node/ui/components/SelectPrompt.test.js.map +1 -0
  247. package/dist/private/node/ui/components/Table.d.ts +8 -0
  248. package/dist/private/node/ui/components/Table.js +17 -0
  249. package/dist/private/node/ui/components/Table.js.map +1 -0
  250. package/dist/private/node/ui/components/Tasks.d.ts +10 -0
  251. package/dist/private/node/ui/components/Tasks.js +27 -0
  252. package/dist/private/node/ui/components/Tasks.js.map +1 -0
  253. package/dist/private/node/ui/components/Tasks.test.d.ts +1 -0
  254. package/dist/private/node/ui/components/Tasks.test.js +50 -0
  255. package/dist/private/node/ui/components/Tasks.test.js.map +1 -0
  256. package/dist/private/node/ui/components/TextAnimation.d.ts +9 -0
  257. package/dist/private/node/ui/components/TextAnimation.js +35 -0
  258. package/dist/private/node/ui/components/TextAnimation.js.map +1 -0
  259. package/dist/private/node/ui/components/TextInput.d.ts +9 -0
  260. package/dist/private/node/ui/components/TextInput.js +74 -0
  261. package/dist/private/node/ui/components/TextInput.js.map +1 -0
  262. package/dist/private/node/ui/components/TextInput.test.d.ts +1 -0
  263. package/dist/private/node/ui/components/TextInput.test.js +139 -0
  264. package/dist/private/node/ui/components/TextInput.test.js.map +1 -0
  265. package/dist/private/node/ui/components/TextPrompt.d.ts +8 -0
  266. package/dist/private/node/ui/components/TextPrompt.js +52 -0
  267. package/dist/private/node/ui/components/TextPrompt.js.map +1 -0
  268. package/dist/private/node/ui/components/TextPrompt.test.d.ts +1 -0
  269. package/dist/private/node/ui/components/TextPrompt.test.js +68 -0
  270. package/dist/private/node/ui/components/TextPrompt.test.js.map +1 -0
  271. package/dist/private/node/ui/components/TokenizedText.d.ts +36 -0
  272. package/dist/private/node/ui/components/TokenizedText.js +70 -0
  273. package/dist/private/node/ui/components/TokenizedText.js.map +1 -0
  274. package/dist/private/node/ui/components/TokenizedText.test.d.ts +1 -0
  275. package/dist/private/node/ui/components/TokenizedText.test.js +44 -0
  276. package/dist/private/node/ui/components/TokenizedText.test.js.map +1 -0
  277. package/dist/private/node/ui/components/UserInput.d.ts +10 -0
  278. package/dist/private/node/ui/components/UserInput.js +11 -0
  279. package/dist/private/node/ui/components/UserInput.js.map +1 -0
  280. package/dist/private/node/ui/components/UserInput.test.d.ts +1 -0
  281. package/dist/private/node/ui/components/UserInput.test.js +11 -0
  282. package/dist/private/node/ui/components/UserInput.test.js.map +1 -0
  283. package/dist/private/node/ui/hooks/use-async-and-unmount.d.ts +6 -0
  284. package/dist/private/node/ui/hooks/use-async-and-unmount.js +17 -0
  285. package/dist/private/node/ui/hooks/use-async-and-unmount.js.map +1 -0
  286. package/dist/private/node/ui/hooks/use-layout.d.ts +6 -0
  287. package/dist/private/node/ui/hooks/use-layout.js +30 -0
  288. package/dist/private/node/ui/hooks/use-layout.js.map +1 -0
  289. package/dist/private/node/ui.d.ts +23 -0
  290. package/dist/private/node/ui.js +53 -0
  291. package/dist/private/node/ui.js.map +1 -0
  292. package/dist/public/common/array.d.ts +37 -0
  293. package/dist/public/common/array.js +51 -0
  294. package/dist/public/common/array.js.map +1 -0
  295. package/dist/public/common/collection.d.ts +23 -0
  296. package/dist/public/common/collection.js +29 -0
  297. package/dist/public/common/collection.js.map +1 -0
  298. package/dist/public/common/function.d.ts +30 -0
  299. package/dist/public/common/function.js +40 -0
  300. package/dist/public/common/function.js.map +1 -0
  301. package/dist/public/common/lang.d.ts +16 -0
  302. package/dist/public/common/lang.js +22 -0
  303. package/dist/public/common/lang.js.map +1 -0
  304. package/dist/public/common/object.d.ts +32 -0
  305. package/dist/public/common/object.js +45 -0
  306. package/dist/public/common/object.js.map +1 -0
  307. package/dist/public/common/string.d.ts +6 -0
  308. package/dist/public/common/string.js +109 -0
  309. package/dist/public/common/string.js.map +1 -0
  310. package/dist/public/common/url.d.ts +7 -0
  311. package/dist/public/common/url.js +17 -0
  312. package/dist/public/common/url.js.map +1 -0
  313. package/dist/public/node/abort.d.ts +16 -0
  314. package/dist/public/node/abort.js +17 -0
  315. package/dist/public/node/abort.js.map +1 -0
  316. package/dist/public/node/analytics.d.ts +13 -0
  317. package/dist/public/node/analytics.js +82 -0
  318. package/dist/public/node/analytics.js.map +1 -0
  319. package/dist/public/node/archiver.d.ts +9 -0
  320. package/dist/public/node/archiver.js +34 -0
  321. package/dist/public/node/archiver.js.map +1 -0
  322. package/dist/public/node/base-command.d.ts +26 -0
  323. package/dist/public/node/base-command.js +172 -0
  324. package/dist/public/node/base-command.js.map +1 -0
  325. package/dist/public/node/checksum.d.ts +20 -0
  326. package/dist/public/node/checksum.js +32 -0
  327. package/dist/public/node/checksum.js.map +1 -0
  328. package/dist/public/node/cli.d.ts +29 -0
  329. package/dist/public/node/cli.js +106 -0
  330. package/dist/public/node/cli.js.map +1 -0
  331. package/dist/public/node/colors.d.ts +2 -0
  332. package/dist/public/node/colors.js +3 -0
  333. package/dist/public/node/colors.js.map +1 -0
  334. package/dist/public/node/dot-env.d.ts +42 -0
  335. package/dist/public/node/dot-env.js +67 -0
  336. package/dist/public/node/dot-env.js.map +1 -0
  337. package/dist/public/node/error-handler.d.ts +41 -0
  338. package/dist/public/node/error-handler.js +198 -0
  339. package/dist/public/node/error-handler.js.map +1 -0
  340. package/dist/public/node/error.d.ts +4 -0
  341. package/dist/public/node/error.js +5 -0
  342. package/dist/public/node/error.js.map +1 -0
  343. package/dist/public/node/framework.d.ts +8 -0
  344. package/dist/public/node/framework.js +135 -0
  345. package/dist/public/node/framework.js.map +1 -0
  346. package/dist/public/node/fs.d.ts +17 -0
  347. package/dist/public/node/fs.js +21 -0
  348. package/dist/public/node/fs.js.map +1 -0
  349. package/dist/public/node/github.d.ts +50 -0
  350. package/dist/public/node/github.js +71 -0
  351. package/dist/public/node/github.js.map +1 -0
  352. package/dist/public/node/hooks/postrun.d.ts +2 -0
  353. package/dist/public/node/hooks/postrun.js +9 -0
  354. package/dist/public/node/hooks/postrun.js.map +1 -0
  355. package/dist/public/node/hooks/prerun.d.ts +12 -0
  356. package/dist/public/node/hooks/prerun.js +66 -0
  357. package/dist/public/node/hooks/prerun.js.map +1 -0
  358. package/dist/public/node/node-package-manager.d.ts +243 -0
  359. package/dist/public/node/node-package-manager.js +369 -0
  360. package/dist/public/node/node-package-manager.js.map +1 -0
  361. package/dist/public/node/os.d.ts +16 -0
  362. package/dist/public/node/os.js +77 -0
  363. package/dist/public/node/os.js.map +1 -0
  364. package/dist/public/node/plugins/tunnel.d.ts +47 -0
  365. package/dist/public/node/plugins/tunnel.js +19 -0
  366. package/dist/public/node/plugins/tunnel.js.map +1 -0
  367. package/dist/public/node/presets.d.ts +8 -0
  368. package/dist/public/node/presets.js +26 -0
  369. package/dist/public/node/presets.js.map +1 -0
  370. package/dist/public/node/result.d.ts +94 -0
  371. package/dist/public/node/result.js +134 -0
  372. package/dist/public/node/result.js.map +1 -0
  373. package/dist/public/node/ruby.d.ts +38 -0
  374. package/dist/public/node/ruby.js +234 -0
  375. package/dist/public/node/ruby.js.map +1 -0
  376. package/dist/public/node/semver.d.ts +3 -0
  377. package/dist/public/node/semver.js +6 -0
  378. package/dist/public/node/semver.js.map +1 -0
  379. package/dist/public/node/tcp.d.ts +5 -0
  380. package/dist/public/node/tcp.js +35 -0
  381. package/dist/public/node/tcp.js.map +1 -0
  382. package/dist/public/node/ui.d.ts +184 -0
  383. package/dist/public/node/ui.js +203 -0
  384. package/dist/public/node/ui.js.map +1 -0
  385. package/dist/schema.d.ts +1 -0
  386. package/dist/schema.js +2 -0
  387. package/dist/schema.js.map +1 -0
  388. package/dist/secure-store.d.ts +19 -0
  389. package/dist/secure-store.js +63 -0
  390. package/dist/secure-store.js.map +1 -0
  391. package/dist/session/authorize.d.ts +7 -0
  392. package/dist/session/authorize.js +52 -0
  393. package/dist/session/authorize.js.map +1 -0
  394. package/dist/session/device-authorization.d.ts +32 -0
  395. package/dist/session/device-authorization.js +92 -0
  396. package/dist/session/device-authorization.js.map +1 -0
  397. package/dist/session/exchange.d.ts +48 -0
  398. package/dist/session/exchange.js +159 -0
  399. package/dist/session/exchange.js.map +1 -0
  400. package/dist/session/identity.d.ts +3 -0
  401. package/dist/session/identity.js +58 -0
  402. package/dist/session/identity.js.map +1 -0
  403. package/dist/session/post-auth.d.ts +13 -0
  404. package/dist/session/post-auth.js +62 -0
  405. package/dist/session/post-auth.js.map +1 -0
  406. package/dist/session/redirect-listener.d.ts +34 -0
  407. package/dist/session/redirect-listener.js +106 -0
  408. package/dist/session/redirect-listener.js.map +1 -0
  409. package/dist/session/schema.d.ts +175 -0
  410. package/dist/session/schema.js +60 -0
  411. package/dist/session/schema.js.map +1 -0
  412. package/dist/session/scopes.d.ts +16 -0
  413. package/dist/session/scopes.js +53 -0
  414. package/dist/session/scopes.js.map +1 -0
  415. package/dist/session/store.d.ts +24 -0
  416. package/dist/session/store.js +89 -0
  417. package/dist/session/store.js.map +1 -0
  418. package/dist/session/token.d.ts +40 -0
  419. package/dist/session/token.js +22 -0
  420. package/dist/session/token.js.map +1 -0
  421. package/dist/session/validate.d.ts +17 -0
  422. package/dist/session/validate.js +65 -0
  423. package/dist/session/validate.js.map +1 -0
  424. package/dist/session.d.ts +96 -0
  425. package/dist/session.js +293 -0
  426. package/dist/session.js.map +1 -0
  427. package/dist/store/schema.d.ts +3 -0
  428. package/dist/store/schema.js +27 -0
  429. package/dist/store/schema.js.map +1 -0
  430. package/dist/store.d.ts +53 -0
  431. package/dist/store.js +134 -0
  432. package/dist/store.js.map +1 -0
  433. package/dist/string.d.ts +28 -0
  434. package/dist/string.js +77 -0
  435. package/dist/string.js.map +1 -0
  436. package/dist/system.d.ts +51 -0
  437. package/dist/system.js +128 -0
  438. package/dist/system.js.map +1 -0
  439. package/dist/template.d.ts +11 -0
  440. package/dist/template.js +50 -0
  441. package/dist/template.js.map +1 -0
  442. package/dist/testing/output.d.ts +10 -0
  443. package/dist/testing/output.js +16 -0
  444. package/dist/testing/output.js.map +1 -0
  445. package/dist/testing/store.d.ts +7 -0
  446. package/dist/testing/store.js +26 -0
  447. package/dist/testing/store.js.map +1 -0
  448. package/dist/testing/ui.d.ts +5 -0
  449. package/dist/testing/ui.js +23 -0
  450. package/dist/testing/ui.js.map +1 -0
  451. package/dist/toml.d.ts +3 -0
  452. package/dist/toml.js +8 -0
  453. package/dist/toml.js.map +1 -0
  454. package/dist/tsconfig.tsbuildinfo +1 -0
  455. package/dist/typing/deep-required.d.ts +12 -0
  456. package/dist/typing/deep-required.js +2 -0
  457. package/dist/typing/deep-required.js.map +1 -0
  458. package/dist/typing/overloaded-parameters.d.ts +6 -0
  459. package/dist/typing/overloaded-parameters.js +2 -0
  460. package/dist/typing/overloaded-parameters.js.map +1 -0
  461. package/dist/typing/pick-by-prefix.d.ts +12 -0
  462. package/dist/typing/pick-by-prefix.js +2 -0
  463. package/dist/typing/pick-by-prefix.js.map +1 -0
  464. package/dist/typing/simple-definitions.d.ts +4 -0
  465. package/dist/typing/simple-definitions.js +2 -0
  466. package/dist/typing/simple-definitions.js.map +1 -0
  467. package/dist/ui/executor.d.ts +14 -0
  468. package/dist/ui/executor.js +90 -0
  469. package/dist/ui/executor.js.map +1 -0
  470. package/dist/ui/inquirer/autocomplete.d.ts +11 -0
  471. package/dist/ui/inquirer/autocomplete.js +110 -0
  472. package/dist/ui/inquirer/autocomplete.js.map +1 -0
  473. package/dist/ui/inquirer/input.d.ts +16 -0
  474. package/dist/ui/inquirer/input.js +45 -0
  475. package/dist/ui/inquirer/input.js.map +1 -0
  476. package/dist/ui/inquirer/password.d.ts +7 -0
  477. package/dist/ui/inquirer/password.js +8 -0
  478. package/dist/ui/inquirer/password.js.map +1 -0
  479. package/dist/ui/inquirer/select.d.ts +14 -0
  480. package/dist/ui/inquirer/select.js +26 -0
  481. package/dist/ui/inquirer/select.js.map +1 -0
  482. package/dist/ui.d.ts +54 -0
  483. package/dist/ui.js +128 -0
  484. package/dist/ui.js.map +1 -0
  485. package/dist/vscode.d.ts +8 -0
  486. package/dist/vscode.js +36 -0
  487. package/dist/vscode.js.map +1 -0
  488. package/package.json +177 -0
package/dist/output.js ADDED
@@ -0,0 +1,310 @@
1
+ /* eslint-disable no-console */
2
+ import { isUnitTest, isVerbose } from './environment/local.js';
3
+ import colors from './public/node/colors.js';
4
+ import { ColorContentToken, CommandContentToken, ErrorContentToken, HeadingContentToken, ItalicContentToken, JsonContentToken, LinesDiffContentToken, LinkContentToken, PathContentToken, RawContentToken, SubHeadingContentToken, } from './content-tokens.js';
5
+ import stripAnsi from 'strip-ansi';
6
+ import { Writable } from 'stream';
7
+ export { default as logUpdate } from 'log-update';
8
+ export class TokenizedString {
9
+ constructor(value) {
10
+ this.value = value;
11
+ }
12
+ }
13
+ export const token = {
14
+ raw: (value) => {
15
+ return new RawContentToken(value);
16
+ },
17
+ genericShellCommand: (value) => {
18
+ return new CommandContentToken(value);
19
+ },
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ json: (value) => {
22
+ return new JsonContentToken(value);
23
+ },
24
+ path: (value) => {
25
+ return new PathContentToken(value);
26
+ },
27
+ link: (value, link) => {
28
+ return new LinkContentToken(value, link);
29
+ },
30
+ heading: (value) => {
31
+ return new HeadingContentToken(value);
32
+ },
33
+ subheading: (value) => {
34
+ return new SubHeadingContentToken(value);
35
+ },
36
+ italic: (value) => {
37
+ return new ItalicContentToken(value);
38
+ },
39
+ errorText: (value) => {
40
+ return new ErrorContentToken(value);
41
+ },
42
+ cyan: (value) => {
43
+ return new ColorContentToken(value, colors.cyan);
44
+ },
45
+ yellow: (value) => {
46
+ return new ColorContentToken(value, colors.yellow);
47
+ },
48
+ magenta: (value) => {
49
+ return new ColorContentToken(value, colors.magenta);
50
+ },
51
+ green: (value) => {
52
+ return new ColorContentToken(value, colors.green);
53
+ },
54
+ packagejsonScript: (packageManager, scriptName, ...scriptArgs) => {
55
+ return new CommandContentToken(formatPackageManagerCommand(packageManager, scriptName, ...scriptArgs));
56
+ },
57
+ successIcon: () => {
58
+ return new ColorContentToken('✔', colors.green);
59
+ },
60
+ failIcon: () => {
61
+ return new ErrorContentToken('✖');
62
+ },
63
+ linesDiff: (value) => {
64
+ return new LinesDiffContentToken(value);
65
+ },
66
+ };
67
+ export function formatPackageManagerCommand(packageManager, scriptName, ...scriptArgs) {
68
+ switch (packageManager) {
69
+ case 'yarn': {
70
+ const pieces = ['yarn', scriptName, ...scriptArgs];
71
+ return pieces.join(' ');
72
+ }
73
+ case 'pnpm':
74
+ case 'npm': {
75
+ const pieces = [packageManager, 'run', scriptName];
76
+ if (scriptArgs.length > 0) {
77
+ pieces.push('--');
78
+ pieces.push(...scriptArgs);
79
+ }
80
+ return pieces.join(' ');
81
+ }
82
+ }
83
+ }
84
+ export function content(strings, ...keys) {
85
+ let output = ``;
86
+ strings.forEach((string, i) => {
87
+ output += string;
88
+ if (i >= keys.length) {
89
+ return;
90
+ }
91
+ const token = keys[i];
92
+ if (typeof token === 'string') {
93
+ output += token;
94
+ }
95
+ else {
96
+ const enumTokenOutput = token.output();
97
+ if (Array.isArray(enumTokenOutput)) {
98
+ enumTokenOutput.forEach((line) => {
99
+ output += line;
100
+ });
101
+ }
102
+ else {
103
+ output += enumTokenOutput;
104
+ }
105
+ }
106
+ });
107
+ return new TokenizedString(output);
108
+ }
109
+ /**
110
+ * It maps a level to a numeric value.
111
+ * @param level - The level for which we'll return its numeric value.
112
+ * @returns The numeric value of the level.
113
+ */
114
+ const logLevelValue = (level) => {
115
+ switch (level) {
116
+ case 'trace':
117
+ return 10;
118
+ case 'debug':
119
+ return 20;
120
+ case 'info':
121
+ return 30;
122
+ case 'warn':
123
+ return 40;
124
+ case 'error':
125
+ return 50;
126
+ case 'fatal':
127
+ return 60;
128
+ default:
129
+ return 30;
130
+ }
131
+ };
132
+ /**
133
+ *
134
+ * @returns It returns the log level set by the user.
135
+ */
136
+ export const currentLogLevel = () => {
137
+ if (isVerbose()) {
138
+ return 'debug';
139
+ }
140
+ else {
141
+ return 'info';
142
+ }
143
+ };
144
+ export const shouldOutput = (logLevel) => {
145
+ if (isUnitTest()) {
146
+ return false;
147
+ }
148
+ const currentLogLevelValue = logLevelValue(currentLogLevel());
149
+ const messageLogLevelValue = logLevelValue(logLevel);
150
+ return messageLogLevelValue >= currentLogLevelValue;
151
+ };
152
+ // eslint-disable-next-line import/no-mutable-exports
153
+ export let collectedLogs = {};
154
+ /**
155
+ * This is only used during UnitTesting.
156
+ * If we are in a testing context, instead of printing the logs to the console,
157
+ * we will store them in a variable that can be accessed from the tests.
158
+ * @param key - The key of the log.
159
+ * @param content - The content of the log.
160
+ */
161
+ export const collectLog = (key, content) => {
162
+ const output = collectedLogs.output ?? [];
163
+ const data = collectedLogs[key] ?? [];
164
+ data.push(stripAnsi(stringifyMessage(content) ?? ''));
165
+ output.push(stripAnsi(stringifyMessage(content) ?? ''));
166
+ collectedLogs[key] = data;
167
+ collectedLogs.output = output;
168
+ };
169
+ export const clearCollectedLogs = () => {
170
+ collectedLogs = {};
171
+ };
172
+ /**
173
+ * Ouputs information to the user.
174
+ * Info messages don't get additional formatting.
175
+ * Note: Info messages are sent through the standard output.
176
+ * @param content - The content to be output to the user.
177
+ * @param logger - The logging function to use to output to the user.
178
+ */
179
+ export const info = (content, logger = consoleLog) => {
180
+ const message = stringifyMessage(content);
181
+ if (isUnitTest())
182
+ collectLog('info', content);
183
+ outputWhereAppropriate('info', logger, message);
184
+ };
185
+ /**
186
+ * Outputs a success message to the user.
187
+ * Success messages receive a special formatting to make them stand out in the console.
188
+ * Note: Success messages are sent through the standard output.
189
+ * @param content - The content to be output to the user.
190
+ * @param logger - The logging function to use to output to the user.
191
+ */
192
+ export const success = (content, logger = consoleLog) => {
193
+ const message = colors.bold(`✅ Success! ${stringifyMessage(content)}.`);
194
+ if (isUnitTest())
195
+ collectLog('success', content);
196
+ outputWhereAppropriate('info', logger, message);
197
+ };
198
+ /**
199
+ * Outputs a completed message to the user.
200
+ * Completed message receive a special formatting to make them stand out in the console.
201
+ * Note: Completed messages are sent through the standard output.
202
+ * @param content - The content to be output to the user.
203
+ * @param logger - The logging function to use to output to the user.
204
+ */
205
+ export const completed = (content, logger = consoleLog) => {
206
+ const message = `${colors.green('✔')} ${stringifyMessage(content)}`;
207
+ if (isUnitTest())
208
+ collectLog('completed', content);
209
+ outputWhereAppropriate('info', logger, message);
210
+ };
211
+ /**
212
+ * Ouputs debug information to the user. By default these output is hidden unless the user calls the CLI with --verbose.
213
+ * Debug messages don't get additional formatting.
214
+ * Note: Debug messages are sent through the standard output.
215
+ * @param content - The content to be output to the user.
216
+ * @param logger - The logging function to use to output to the user.
217
+ */
218
+ export const debug = (content, logger = consoleLog) => {
219
+ if (isUnitTest())
220
+ collectLog('debug', content);
221
+ const message = colors.gray(stringifyMessage(content));
222
+ outputWhereAppropriate('debug', logger, `${new Date().toISOString()}: ${message}`);
223
+ };
224
+ /**
225
+ * Outputs a warning message to the user.
226
+ * Warning messages receive a special formatting to make them stand out in the console.
227
+ * Note: Warning messages are sent through the standard output.
228
+ * @param content - The content to be output to the user.
229
+ * @param logger - The logging function to use to output to the user.
230
+ */
231
+ export const warn = (content, logger = consoleWarn) => {
232
+ if (isUnitTest())
233
+ collectLog('warn', content);
234
+ const message = colors.yellow(stringifyMessage(content));
235
+ outputWhereAppropriate('warn', logger, message);
236
+ };
237
+ /**
238
+ * Prints a new line in the terminal.
239
+ */
240
+ export const newline = () => {
241
+ console.log();
242
+ };
243
+ export function stringifyMessage(message) {
244
+ if (message instanceof TokenizedString) {
245
+ return message.value;
246
+ }
247
+ else {
248
+ return message;
249
+ }
250
+ }
251
+ const message = (content, level = 'info') => {
252
+ const stringifiedMessage = stringifyMessage(content);
253
+ outputWhereAppropriate(level, consoleLog, stringifiedMessage);
254
+ };
255
+ export function consoleLog(message) {
256
+ console.log(withOrWithoutStyle(message));
257
+ }
258
+ export function consoleError(message) {
259
+ console.error(withOrWithoutStyle(message));
260
+ }
261
+ export function consoleWarn(message) {
262
+ console.warn(withOrWithoutStyle(message));
263
+ }
264
+ export function outputWhereAppropriate(logLevel, logger, message) {
265
+ if (shouldOutput(logLevel)) {
266
+ if (logger instanceof Writable) {
267
+ logger.write(message);
268
+ }
269
+ else {
270
+ logger(message);
271
+ }
272
+ }
273
+ }
274
+ function withOrWithoutStyle(message) {
275
+ if (shouldDisplayColors()) {
276
+ return message;
277
+ }
278
+ else {
279
+ return unstyled(message);
280
+ }
281
+ }
282
+ export function unstyled(message) {
283
+ return stripAnsi(message);
284
+ }
285
+ export function shouldDisplayColors() {
286
+ return Boolean(process.stdout.isTTY || process.env.FORCE_COLOR);
287
+ }
288
+ /**
289
+ * @param packageManager - The package manager that is being used.
290
+ * @param version - The version to update to
291
+ */
292
+ export function getOutputUpdateCLIReminder(packageManager, version) {
293
+ const versionMessage = `💡 Version ${version} available!`;
294
+ if (!packageManager || packageManager === 'unknown')
295
+ return versionMessage;
296
+ const updateCommand = token.packagejsonScript(packageManager, 'shopify upgrade');
297
+ return content `${versionMessage} Run ${updateCommand}`.value;
298
+ }
299
+ /**
300
+ * Parse title and body to be a single formatted string
301
+ * @param title - The title of the message. Will be formatted as a heading.
302
+ * @param body - The body of the message. Will respect the original formatting.
303
+ * @returns The formatted message.
304
+ */
305
+ export function section(title, body) {
306
+ const formattedTitle = `${title.toUpperCase()}${' '.repeat(35 - title.length)}`;
307
+ return content `${token.heading(formattedTitle)}\n${body}`.value;
308
+ }
309
+ /* eslint-enable no-console */
310
+ //# sourceMapping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AC,OAAe;IACtC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAA;AAC3B,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;AACjE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CACxC,cAAsD,EACtD,OAAe;IAEf,MAAM,cAAc,GAAG,cAAc,OAAO,aAAa,CAAA;IACzD,IAAI,CAAC,cAAc,IAAI,cAAc,KAAK,SAAS;QAAE,OAAO,cAAc,CAAA;IAE1E,MAAM,aAAa,GAAG,KAAK,CAAC,iBAAiB,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAA;IAChF,OAAO,OAAO,CAAA,GAAG,cAAc,QAAQ,aAAa,EAAE,CAAC,KAAK,CAAA;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,KAAa,EAAE,IAAY;IACjD,MAAM,cAAc,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAA;IAC/E,OAAO,OAAO,CAAA,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAAA;AACjE,CAAC;AAED,8BAA8B","sourcesContent":["/* eslint-disable no-console */\nimport {isUnitTest, isVerbose} from './environment/local.js'\nimport {PackageManager} from './public/node/node-package-manager.js'\nimport colors from './public/node/colors.js'\nimport {\n ColorContentToken,\n CommandContentToken,\n ContentToken,\n ErrorContentToken,\n HeadingContentToken,\n ItalicContentToken,\n JsonContentToken,\n LinesDiffContentToken,\n LinkContentToken,\n PathContentToken,\n RawContentToken,\n SubHeadingContentToken,\n} from './content-tokens.js'\nimport stripAnsi from 'strip-ansi'\nimport {AbortSignal} from '@shopify/cli-kit/node/abort'\nimport {Writable} from 'stream'\nimport type {Change} from 'diff'\n\nexport {default as logUpdate} from 'log-update'\n\nexport type Logger = Writable | ((message: string) => void)\n\nexport class TokenizedString {\n value: string\n constructor(value: string) {\n this.value = value\n }\n}\n\nexport type Message = string | TokenizedString\n\nexport const token = {\n raw: (value: string) => {\n return new RawContentToken(value)\n },\n genericShellCommand: (value: Message) => {\n return new CommandContentToken(value)\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n json: (value: any) => {\n return new JsonContentToken(value)\n },\n path: (value: Message) => {\n return new PathContentToken(value)\n },\n link: (value: Message, link: string) => {\n return new LinkContentToken(value, link)\n },\n heading: (value: Message) => {\n return new HeadingContentToken(value)\n },\n subheading: (value: Message) => {\n return new SubHeadingContentToken(value)\n },\n italic: (value: Message) => {\n return new ItalicContentToken(value)\n },\n errorText: (value: Message) => {\n return new ErrorContentToken(value)\n },\n cyan: (value: Message) => {\n return new ColorContentToken(value, colors.cyan)\n },\n yellow: (value: Message) => {\n return new ColorContentToken(value, colors.yellow)\n },\n magenta: (value: Message) => {\n return new ColorContentToken(value, colors.magenta)\n },\n green: (value: Message) => {\n return new ColorContentToken(value, colors.green)\n },\n packagejsonScript: (packageManager: PackageManager, scriptName: string, ...scriptArgs: string[]) => {\n return new CommandContentToken(formatPackageManagerCommand(packageManager, scriptName, ...scriptArgs))\n },\n successIcon: () => {\n return new ColorContentToken('✔', colors.green)\n },\n failIcon: () => {\n return new ErrorContentToken('✖')\n },\n linesDiff: (value: Change[]) => {\n return new LinesDiffContentToken(value)\n },\n}\n\nexport function formatPackageManagerCommand(\n packageManager: PackageManager,\n scriptName: string,\n ...scriptArgs: string[]\n): string {\n switch (packageManager) {\n case 'yarn': {\n const pieces = ['yarn', scriptName, ...scriptArgs]\n return pieces.join(' ')\n }\n case 'pnpm':\n case 'npm': {\n const pieces = [packageManager, 'run', scriptName]\n if (scriptArgs.length > 0) {\n pieces.push('--')\n pieces.push(...scriptArgs)\n }\n return pieces.join(' ')\n }\n }\n}\n\nexport function content(strings: TemplateStringsArray, ...keys: (ContentToken<unknown> | string)[]): TokenizedString {\n let output = ``\n strings.forEach((string, i) => {\n output += string\n if (i >= keys.length) {\n return\n }\n const token = keys[i]!\n\n if (typeof token === 'string') {\n output += token\n } else {\n const enumTokenOutput = token.output()\n\n if (Array.isArray(enumTokenOutput)) {\n enumTokenOutput.forEach((line: string) => {\n output += line\n })\n } else {\n output += enumTokenOutput\n }\n }\n })\n return new TokenizedString(output)\n}\n\n/** Log levels */\nexport type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent'\n\n/**\n * It maps a level to a numeric value.\n * @param level - The level for which we'll return its numeric value.\n * @returns The numeric value of the level.\n */\nconst logLevelValue = (level: LogLevel): number => {\n switch (level) {\n case 'trace':\n return 10\n case 'debug':\n return 20\n case 'info':\n return 30\n case 'warn':\n return 40\n case 'error':\n return 50\n case 'fatal':\n return 60\n default:\n return 30\n }\n}\n\n/**\n *\n * @returns It returns the log level set by the user.\n */\nexport const currentLogLevel = (): LogLevel => {\n if (isVerbose()) {\n return 'debug'\n } else {\n return 'info'\n }\n}\n\nexport const shouldOutput = (logLevel: LogLevel): boolean => {\n if (isUnitTest()) {\n return false\n }\n const currentLogLevelValue = logLevelValue(currentLogLevel())\n const messageLogLevelValue = logLevelValue(logLevel)\n return messageLogLevelValue >= currentLogLevelValue\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nexport let collectedLogs: {[key: string]: string[]} = {}\n\n/**\n * This is only used during UnitTesting.\n * If we are in a testing context, instead of printing the logs to the console,\n * we will store them in a variable that can be accessed from the tests.\n * @param key - The key of the log.\n * @param content - The content of the log.\n */\nexport const collectLog = (key: string, content: Message) => {\n const output = collectedLogs.output ?? []\n const data = collectedLogs[key] ?? []\n data.push(stripAnsi(stringifyMessage(content) ?? ''))\n output.push(stripAnsi(stringifyMessage(content) ?? ''))\n collectedLogs[key] = data\n collectedLogs.output = output\n}\n\nexport const clearCollectedLogs = () => {\n collectedLogs = {}\n}\n\n/**\n * Ouputs information to the user.\n * Info messages don't get additional formatting.\n * Note: Info messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const info = (content: Message, logger: Logger = consoleLog) => {\n const message = stringifyMessage(content)\n if (isUnitTest()) collectLog('info', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Outputs a success message to the user.\n * Success messages receive a special formatting to make them stand out in the console.\n * Note: Success messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const success = (content: Message, logger: Logger = consoleLog) => {\n const message = colors.bold(`✅ Success! ${stringifyMessage(content)}.`)\n if (isUnitTest()) collectLog('success', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Outputs a completed message to the user.\n * Completed message receive a special formatting to make them stand out in the console.\n * Note: Completed messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const completed = (content: Message, logger: Logger = consoleLog) => {\n const message = `${colors.green('✔')} ${stringifyMessage(content)}`\n if (isUnitTest()) collectLog('completed', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Ouputs debug information to the user. By default these output is hidden unless the user calls the CLI with --verbose.\n * Debug messages don't get additional formatting.\n * Note: Debug messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const debug = (content: Message, logger: Logger = consoleLog) => {\n if (isUnitTest()) collectLog('debug', content)\n const message = colors.gray(stringifyMessage(content))\n outputWhereAppropriate('debug', logger, `${new Date().toISOString()}: ${message}`)\n}\n\n/**\n * Outputs a warning message to the user.\n * Warning messages receive a special formatting to make them stand out in the console.\n * Note: Warning messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const warn = (content: Message, logger: Logger = consoleWarn) => {\n if (isUnitTest()) collectLog('warn', content)\n const message = colors.yellow(stringifyMessage(content))\n outputWhereAppropriate('warn', logger, message)\n}\n\n/**\n * Prints a new line in the terminal.\n */\nexport const newline = () => {\n console.log()\n}\n\nexport function stringifyMessage(message: Message): string {\n if (message instanceof TokenizedString) {\n return message.value\n } else {\n return message\n }\n}\n\nconst message = (content: Message, level: LogLevel = 'info') => {\n const stringifiedMessage = stringifyMessage(content)\n outputWhereAppropriate(level, consoleLog, stringifiedMessage)\n}\n\nexport interface OutputProcess {\n /** The prefix to include in the logs\n * [vite] Output coming from Vite\n */\n prefix: string\n /**\n * A callback to invoke the process. stdout and stderr should be used\n * to send standard output and error data that gets formatted with the\n * right prefix.\n */\n action: (stdout: Writable, stderr: Writable, signal: AbortSignal) => Promise<void>\n}\n\nexport function consoleLog(message: string): void {\n console.log(withOrWithoutStyle(message))\n}\n\nexport function consoleError(message: string): void {\n console.error(withOrWithoutStyle(message))\n}\n\nexport function consoleWarn(message: string): void {\n console.warn(withOrWithoutStyle(message))\n}\n\nexport function outputWhereAppropriate(logLevel: LogLevel, logger: Logger, message: string): void {\n if (shouldOutput(logLevel)) {\n if (logger instanceof Writable) {\n logger.write(message)\n } else {\n logger(message)\n }\n }\n}\n\nfunction withOrWithoutStyle(message: string): string {\n if (shouldDisplayColors()) {\n return message\n } else {\n return unstyled(message)\n }\n}\n\nexport function unstyled(message: string): string {\n return stripAnsi(message)\n}\n\nexport function shouldDisplayColors(): boolean {\n return Boolean(process.stdout.isTTY || process.env.FORCE_COLOR)\n}\n\n/**\n * @param packageManager - The package manager that is being used.\n * @param version - The version to update to\n */\nexport function getOutputUpdateCLIReminder(\n packageManager: PackageManager | 'unknown' | undefined,\n version: string,\n): string {\n const versionMessage = `💡 Version ${version} available!`\n if (!packageManager || packageManager === 'unknown') return versionMessage\n\n const updateCommand = token.packagejsonScript(packageManager, 'shopify upgrade')\n return content`${versionMessage} Run ${updateCommand}`.value\n}\n\n/**\n * Parse title and body to be a single formatted string\n * @param title - The title of the message. Will be formatted as a heading.\n * @param body - The body of the message. Will respect the original formatting.\n * @returns The formatted message.\n */\nexport function section(title: string, body: string): string {\n const formattedTitle = `${title.toUpperCase()}${' '.repeat(35 - title.length)}`\n return content`${token.heading(formattedTitle)}\\n${body}`.value\n}\n\n/* eslint-enable no-console */\n"]}
package/dist/path.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ /// <reference types="node" />
2
+ import { OverloadParameters } from './typing/overloaded-parameters.js';
3
+ import { relative, dirname, join, normalize, resolve, basename, extname, isAbsolute, parse } from 'pathe';
4
+ import { findUp as internalFindUp } from 'find-up';
5
+ import type { URL } from 'url';
6
+ import type { Pattern, Options } from 'fast-glob';
7
+ export { join, relative, dirname, normalize, resolve, basename, extname, isAbsolute, parse };
8
+ export declare function glob(pattern: Pattern | Pattern[], options?: Options): Promise<string[]>;
9
+ export { pathToFileURL } from 'url';
10
+ export declare function findUp(matcher: OverloadParameters<typeof internalFindUp>[0], options: OverloadParameters<typeof internalFindUp>[1]): ReturnType<typeof internalFindUp>;
11
+ /**
12
+ * Given an absolute filesystem path, it makes it relative to
13
+ * the current working directory. This is useful when logging paths
14
+ * to allow the users to click on the file and let the OS open it
15
+ * in the editor of choice.
16
+ * @param path - Path to relativize
17
+ * @returns Relativized path.
18
+ */
19
+ export declare function relativize(path: string): string;
20
+ /**
21
+ * Given a module's import.meta.url it returns the directory containing the module.
22
+ * @param moduleURL - The value of import.meta.url in the context of the caller module.
23
+ * @returns The path to the directory containing the caller module.
24
+ */
25
+ export declare function moduleDirectory(moduleURL: string | URL): string;
package/dist/path.js ADDED
@@ -0,0 +1,48 @@
1
+ import commondir from 'commondir';
2
+ import { relative, dirname, join, normalize, resolve, basename, extname, isAbsolute, parse } from 'pathe';
3
+ import { findUp as internalFindUp } from 'find-up';
4
+ import { fileURLToPath } from 'url';
5
+ export { join, relative, dirname, normalize, resolve, basename, extname, isAbsolute, parse };
6
+ export async function glob(pattern, options) {
7
+ const { default: fastGlob } = await import('fast-glob');
8
+ let overridenOptions = options;
9
+ if (options?.dot == null) {
10
+ overridenOptions = { ...options, dot: true };
11
+ }
12
+ return fastGlob(pattern, overridenOptions);
13
+ }
14
+ export { pathToFileURL } from 'url';
15
+ export async function findUp(matcher, options) {
16
+ // findUp has odd typing
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ const got = await internalFindUp(matcher, options);
19
+ return got ? normalize(got) : undefined;
20
+ }
21
+ /**
22
+ * Given an absolute filesystem path, it makes it relative to
23
+ * the current working directory. This is useful when logging paths
24
+ * to allow the users to click on the file and let the OS open it
25
+ * in the editor of choice.
26
+ * @param path - Path to relativize
27
+ * @returns Relativized path.
28
+ */
29
+ export function relativize(path) {
30
+ const result = commondir([path, process.cwd()]);
31
+ const relativePath = relative(process.cwd(), path);
32
+ const relativeComponents = relativePath.split('/').filter((component) => component === '..').length;
33
+ if (result === '/' || relativePath === '' || relativeComponents > 2) {
34
+ return path;
35
+ }
36
+ else {
37
+ return relativePath;
38
+ }
39
+ }
40
+ /**
41
+ * Given a module's import.meta.url it returns the directory containing the module.
42
+ * @param moduleURL - The value of import.meta.url in the context of the caller module.
43
+ * @returns The path to the directory containing the caller module.
44
+ */
45
+ export function moduleDirectory(moduleURL) {
46
+ return dirname(fileURLToPath(moduleURL));
47
+ }
48
+ //# sourceMappingURL=path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.js","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,OAAO,CAAA;AACvG,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,SAAS,CAAA;AAChD,OAAO,EAAC,aAAa,EAAC,MAAM,KAAK,CAAA;AAKjC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,E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,OAAO,IAAI,CAAA;KACZ;SAAM;QACL,OAAO,YAAY,CAAA;KACpB;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,SAAuB;IACrD,OAAO,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAA;AAC1C,CAAC","sourcesContent":["import {OverloadParameters} from './typing/overloaded-parameters.js'\nimport commondir from 'commondir'\nimport {relative, dirname, join, normalize, resolve, basename, extname, isAbsolute, parse} from 'pathe'\nimport {findUp as internalFindUp} from 'find-up'\nimport {fileURLToPath} from 'url'\n// eslint-disable-next-line node/prefer-global/url\nimport type {URL} from 'url'\nimport type {Pattern, Options} from 'fast-glob'\n\nexport {join, relative, dirname, normalize, resolve, basename, extname, isAbsolute, parse}\n\nexport async function glob(pattern: Pattern | Pattern[], options?: Options): Promise<string[]> {\n const {default: fastGlob} = await import('fast-glob')\n let overridenOptions = options\n if (options?.dot == null) {\n overridenOptions = {...options, dot: true}\n }\n return fastGlob(pattern, overridenOptions)\n}\nexport {pathToFileURL} from 'url'\n\nexport async function findUp(\n matcher: OverloadParameters<typeof internalFindUp>[0],\n options: OverloadParameters<typeof internalFindUp>[1],\n): ReturnType<typeof internalFindUp> {\n // findUp has odd typing\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const got = await internalFindUp(matcher as any, options)\n return got ? normalize(got) : undefined\n}\n\n/**\n * Given an absolute filesystem path, it makes it relative to\n * the current working directory. This is useful when logging paths\n * to allow the users to click on the file and let the OS open it\n * in the editor of choice.\n * @param path - Path to relativize\n * @returns Relativized path.\n */\nexport function relativize(path: string): string {\n const result = commondir([path, process.cwd()])\n const relativePath = relative(process.cwd(), path)\n const relativeComponents = relativePath.split('/').filter((component) => component === '..').length\n if (result === '/' || relativePath === '' || relativeComponents > 2) {\n return path\n } else {\n return relativePath\n }\n}\n\n/**\n * Given a module's import.meta.url it returns the directory containing the module.\n * @param moduleURL - The value of import.meta.url in the context of the caller module.\n * @returns The path to the directory containing the caller module.\n */\nexport function moduleDirectory(moduleURL: string | URL): string {\n return dirname(fileURLToPath(moduleURL))\n}\n"]}
@@ -0,0 +1,73 @@
1
+ import { JsonMap } from './private/common/json.js';
2
+ import { PickByPrefix } from './typing/pick-by-prefix.js';
3
+ import { MonorailEventPublic, MonorailEventSensitive } from './monorail.js';
4
+ import { HookReturnPerTunnelPlugin } from './public/node/plugins/tunnel.js';
5
+ import { Result } from './public/node/result.js';
6
+ import { Config, Interfaces } from '@oclif/core';
7
+ /**
8
+ * Convenience function to trigger a hook, and gather any successful responses. Failures are ignored.
9
+ *
10
+ * Responses are organised into a dictionary, keyed by plug-in name. Only plug-ins that have hooks registered for the given event, and the hooks were run successfully, are included.
11
+ */
12
+ export declare function fanoutHooks<TPluginMap extends HookReturnsPerPlugin, TEvent extends string & keyof TPluginMap>(config: Interfaces.Config, event: TEvent, options: TPluginMap[typeof event]['options'], timeout?: number): Promise<Partial<TPluginMap[typeof event]['pluginReturns']>>;
13
+ declare type AppSpecificMonorailFields = PickByPrefix<MonorailEventPublic, 'app_', 'project_type' | 'api_key' | 'partner_id'> & PickByPrefix<MonorailEventPublic, 'cmd_extensions_'> & PickByPrefix<MonorailEventPublic, 'cmd_scaffold_'>;
14
+ declare type AppSpecificSensitiveMonorailFields = PickByPrefix<MonorailEventSensitive, 'app_'>;
15
+ export interface HookReturnsPerPlugin extends HookReturnPerTunnelPlugin {
16
+ public_command_metadata: {
17
+ options: {
18
+ [key: string]: never;
19
+ };
20
+ pluginReturns: {
21
+ '@shopify/app': Partial<AppSpecificMonorailFields>;
22
+ [pluginName: string]: JsonMap;
23
+ };
24
+ };
25
+ sensitive_command_metadata: {
26
+ options: {
27
+ [key: string]: never;
28
+ };
29
+ pluginReturns: {
30
+ '@shopify/app': Partial<AppSpecificSensitiveMonorailFields>;
31
+ [pluginName: string]: JsonMap;
32
+ };
33
+ };
34
+ [hookName: string]: {
35
+ options: {
36
+ [key: string]: unknown;
37
+ };
38
+ pluginReturns: {
39
+ [key: string]: unknown;
40
+ };
41
+ };
42
+ }
43
+ export declare type PluginReturnsForHook<TEvent extends keyof TPluginMap, TPluginName extends keyof TPluginMap[TEvent]['pluginReturns'], TPluginMap extends HookReturnsPerPlugin = HookReturnsPerPlugin> = TPluginMap[TEvent]['pluginReturns'][TPluginName];
44
+ export declare type FanoutHookFunction<TEvent extends keyof TPluginMap = string, TPluginName extends keyof TPluginMap[TEvent]['pluginReturns'] = string, TPluginMap extends HookReturnsPerPlugin = HookReturnsPerPlugin> = (this: Interfaces.Hook.Context, options: TPluginMap[TEvent]['options'] & {
45
+ config: Interfaces.Config;
46
+ }) => Promise<PluginReturnsForHook<TEvent, TPluginName, TPluginMap>>;
47
+ /**
48
+ * Execute the 'tunnel_provider' hook, and return the list of available tunnel providers.
49
+ * Fail if there are multiple plugins for the same provider
50
+ *
51
+ * @param config - oclif config used to execute hooks
52
+ * @returns list of available tunnel plugins
53
+ */
54
+ export declare function getListOfTunnelPlugins(config: Config): Promise<{
55
+ plugins: string[];
56
+ error?: string;
57
+ }>;
58
+ export interface TunnelPluginError {
59
+ provider: string;
60
+ type: 'multiple-urls' | 'handled-error' | 'unknown' | 'no-provider';
61
+ message?: string;
62
+ }
63
+ /**
64
+ * Execute the 'tunnel_start' hook for the given provider.
65
+ * Fails if there aren't plugins for that provider or if there are more than one.
66
+ *
67
+ * @param config - oclif config used to execute hooks
68
+ * @param port - port where the tunnel will be started
69
+ * @param provider - selected provider, must be unique
70
+ * @returns tunnel URL from the selected provider
71
+ */
72
+ export declare function runTunnelPlugin(config: Config, port: number, provider: string): Promise<Result<string, TunnelPluginError>>;
73
+ export {};
@@ -0,0 +1,49 @@
1
+ import { getArrayContainsDuplicates, getArrayRejectingUndefined } from './public/common/array.js';
2
+ import { err } from './public/node/result.js';
3
+ /**
4
+ * Convenience function to trigger a hook, and gather any successful responses. Failures are ignored.
5
+ *
6
+ * Responses are organised into a dictionary, keyed by plug-in name. Only plug-ins that have hooks registered for the given event, and the hooks were run successfully, are included.
7
+ */
8
+ export async function fanoutHooks(config, event, options, timeout) {
9
+ const res = await config.runHook(event, options, timeout);
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ return Object.fromEntries(res.successes.map(({ result, plugin }) => [plugin.name, result]));
12
+ }
13
+ /**
14
+ * Execute the 'tunnel_provider' hook, and return the list of available tunnel providers.
15
+ * Fail if there are multiple plugins for the same provider
16
+ *
17
+ * @param config - oclif config used to execute hooks
18
+ * @returns list of available tunnel plugins
19
+ */
20
+ export async function getListOfTunnelPlugins(config) {
21
+ const hooks = await fanoutHooks(config, 'tunnel_provider', {});
22
+ const names = getArrayRejectingUndefined(Object.values(hooks).map((key) => key?.name));
23
+ if (getArrayContainsDuplicates(names))
24
+ return { plugins: names, error: 'multiple-plugins-for-provider' };
25
+ return { plugins: names };
26
+ }
27
+ /**
28
+ * Execute the 'tunnel_start' hook for the given provider.
29
+ * Fails if there aren't plugins for that provider or if there are more than one.
30
+ *
31
+ * @param config - oclif config used to execute hooks
32
+ * @param port - port where the tunnel will be started
33
+ * @param provider - selected provider, must be unique
34
+ * @returns tunnel URL from the selected provider
35
+ */
36
+ export async function runTunnelPlugin(config, port, provider) {
37
+ const hooks = await fanoutHooks(config, 'tunnel_start', { port, provider });
38
+ const urlResults = Object.values(hooks).filter((tunnelResponse) => !tunnelResponse?.isErr() || tunnelResponse.error.type !== 'invalid-provider');
39
+ if (urlResults.length > 1)
40
+ return err({ provider, type: 'multiple-urls' });
41
+ if (urlResults.length === 0 || !urlResults[0])
42
+ return err({ provider, type: 'no-provider' });
43
+ return urlResults[0]
44
+ .map((data) => data.url)
45
+ .mapError((error) => error.type === 'unknown'
46
+ ? { provider, type: 'unknown', message: error.message }
47
+ : { provider, type: 'handled-error' });
48
+ }
49
+ //# sourceMappingURL=plugins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugins.js","sourceRoot":"","sources":["../src/plugins.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,0BAA0B,EAAE,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AAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAC5C,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,cAAc,CAAC,KAAK,CAAC,IAAI,KAAK,kBAAkB,CACjG,CAAA;IACD,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAC,CAAC,CAAA;IACxE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,GAAG,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAC,CAAC,CAAA;IAE1F,OAAO,UAAU,CAAC,CAAC,CAAC;SACjB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;SACvB,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAClB,KAAK,CAAC,IAAI,KAAK,SAAS;QACtB,CAAC,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAC;QACrD,CAAC,CAAC,EAAC,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAC,CACtC,CAAA;AACL,CAAC","sourcesContent":["import {JsonMap} from './private/common/json.js'\nimport {PickByPrefix} from './typing/pick-by-prefix.js'\nimport {MonorailEventPublic, MonorailEventSensitive} from './monorail.js'\nimport {HookReturnPerTunnelPlugin} from './public/node/plugins/tunnel.js'\nimport {getArrayContainsDuplicates, getArrayRejectingUndefined} from './public/common/array.js'\nimport {err, Result} from './public/node/result.js'\nimport {Config, Interfaces} from '@oclif/core'\n\n/**\n * Convenience function to trigger a hook, and gather any successful responses. Failures are ignored.\n *\n * Responses are organised into a dictionary, keyed by plug-in name. Only plug-ins that have hooks registered for the given event, and the hooks were run successfully, are included.\n */\nexport async function fanoutHooks<TPluginMap extends HookReturnsPerPlugin, TEvent extends string & keyof TPluginMap>(\n config: Interfaces.Config,\n event: TEvent,\n options: TPluginMap[typeof event]['options'],\n timeout?: number,\n): Promise<Partial<TPluginMap[typeof event]['pluginReturns']>> {\n const res = await config.runHook(event, options, timeout)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return Object.fromEntries(res.successes.map(({result, plugin}) => [plugin.name, result])) as any\n}\n\ntype AppSpecificMonorailFields = PickByPrefix<MonorailEventPublic, 'app_', 'project_type' | 'api_key' | 'partner_id'> &\n PickByPrefix<MonorailEventPublic, 'cmd_extensions_'> &\n PickByPrefix<MonorailEventPublic, 'cmd_scaffold_'>\n\ntype AppSpecificSensitiveMonorailFields = PickByPrefix<MonorailEventSensitive, 'app_'>\n\nexport interface HookReturnsPerPlugin extends HookReturnPerTunnelPlugin {\n public_command_metadata: {\n options: {[key: string]: never}\n pluginReturns: {\n '@shopify/app': Partial<AppSpecificMonorailFields>\n [pluginName: string]: JsonMap\n }\n }\n sensitive_command_metadata: {\n options: {[key: string]: never}\n pluginReturns: {\n '@shopify/app': Partial<AppSpecificSensitiveMonorailFields>\n [pluginName: string]: JsonMap\n }\n }\n [hookName: string]: {\n options: {[key: string]: unknown}\n pluginReturns: {[key: string]: unknown}\n }\n}\n\nexport type PluginReturnsForHook<\n TEvent extends keyof TPluginMap,\n TPluginName extends keyof TPluginMap[TEvent]['pluginReturns'],\n TPluginMap extends HookReturnsPerPlugin = HookReturnsPerPlugin,\n> = TPluginMap[TEvent]['pluginReturns'][TPluginName]\n\nexport type FanoutHookFunction<\n TEvent extends keyof TPluginMap = string,\n TPluginName extends keyof TPluginMap[TEvent]['pluginReturns'] = string,\n TPluginMap extends HookReturnsPerPlugin = HookReturnsPerPlugin,\n> = (\n this: Interfaces.Hook.Context,\n options: TPluginMap[TEvent]['options'] & {config: Interfaces.Config},\n) => Promise<PluginReturnsForHook<TEvent, TPluginName, TPluginMap>>\n\n/**\n * Execute the 'tunnel_provider' hook, and return the list of available tunnel providers.\n * Fail if there are multiple plugins for the same provider\n *\n * @param config - oclif config used to execute hooks\n * @returns list of available tunnel plugins\n */\nexport async function getListOfTunnelPlugins(config: Config): Promise<{plugins: string[]; error?: string}> {\n const hooks = await fanoutHooks(config, 'tunnel_provider', {})\n const names = getArrayRejectingUndefined(Object.values(hooks).map((key) => key?.name))\n if (getArrayContainsDuplicates(names)) return {plugins: names, error: 'multiple-plugins-for-provider'}\n return {plugins: names}\n}\n\nexport interface TunnelPluginError {\n provider: string\n type: 'multiple-urls' | 'handled-error' | 'unknown' | 'no-provider'\n message?: string\n}\n\n/**\n * Execute the 'tunnel_start' hook for the given provider.\n * Fails if there aren't plugins for that provider or if there are more than one.\n *\n * @param config - oclif config used to execute hooks\n * @param port - port where the tunnel will be started\n * @param provider - selected provider, must be unique\n * @returns tunnel URL from the selected provider\n */\nexport async function runTunnelPlugin(\n config: Config,\n port: number,\n provider: string,\n): Promise<Result<string, TunnelPluginError>> {\n const hooks = await fanoutHooks(config, 'tunnel_start', {port, provider})\n const urlResults = Object.values(hooks).filter(\n (tunnelResponse) => !tunnelResponse?.isErr() || tunnelResponse.error.type !== 'invalid-provider',\n )\n if (urlResults.length > 1) return err({provider, type: 'multiple-urls'})\n if (urlResults.length === 0 || !urlResults[0]) return err({provider, type: 'no-provider'})\n\n return urlResults[0]\n .map((data) => data.url)\n .mapError((error) =>\n error.type === 'unknown'\n ? {provider, type: 'unknown', message: error.message}\n : {provider, type: 'handled-error'},\n )\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export interface JsonMap {
2
+ [key: string]: AnyJson;
3
+ }
4
+ declare type JsonArray = undefined[] | null[] | boolean[] | number[] | string[] | JsonMap[] | Date[];
5
+ export declare type AnyJson = undefined | null | boolean | number | string | JsonMap | Date | JsonArray | JsonArray[];
6
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/private/common/json.ts"],"names":[],"mappings":"","sourcesContent":["export interface JsonMap {\n [key: string]: AnyJson\n}\ntype JsonArray = undefined[] | null[] | boolean[] | number[] | string[] | JsonMap[] | Date[]\nexport type AnyJson = undefined | null | boolean | number | string | JsonMap | Date | JsonArray | JsonArray[]\n"]}
@@ -0,0 +1,47 @@
1
+ export declare type PartialShallow<T> = {
2
+ [P in keyof T]?: T[P] extends object ? object : T[P];
3
+ };
4
+ export declare type PropertyName = string | number | symbol;
5
+ export declare type IterateeShorthand<T> = PropertyName | [PropertyName, unknown] | PartialShallow<T>;
6
+ export declare type ValueIteratee<T> = ((value: T) => unknown) | IterateeShorthand<T>;
7
+ export interface Dictionary<T> {
8
+ [index: string]: T;
9
+ }
10
+ export interface DebounceSettings {
11
+ /**
12
+ * @see _.leading
13
+ */
14
+ leading?: boolean | undefined;
15
+ /**
16
+ * @see _.maxWait
17
+ */
18
+ maxWait?: number | undefined;
19
+ /**
20
+ * @see _.trailing
21
+ */
22
+ trailing?: boolean | undefined;
23
+ }
24
+ export interface DebouncedFunc<T extends (...args: unknown[]) => unknown> {
25
+ /**
26
+ * Call the original function, but applying the debounce rules.
27
+ *
28
+ * If the debounced function can be run immediately, this calls it and returns its return
29
+ * value.
30
+ *
31
+ * Otherwise, it returns the return value of the last invocation, or undefined if the debounced
32
+ * function was not invoked yet.
33
+ */
34
+ (...args: Parameters<T>): ReturnType<T> | undefined;
35
+ /**
36
+ * Throw away any pending invocation of the debounced function.
37
+ */
38
+ cancel(): void;
39
+ /**
40
+ * If there is a pending invocation of the debounced function, invoke it immediately and return
41
+ * its return value.
42
+ *
43
+ * Otherwise, return the value from the last invocation, or undefined if the debounced function
44
+ * was never invoked.
45
+ */
46
+ flush(): ReturnType<T> | undefined;
47
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=lodash.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lodash.js","sourceRoot":"","sources":["../../../src/private/common/lodash.ts"],"names":[],"mappings":"","sourcesContent":["export type PartialShallow<T> = {\n [P in keyof T]?: T[P] extends object ? object : T[P]\n}\nexport type PropertyName = string | number | symbol\nexport type IterateeShorthand<T> = PropertyName | [PropertyName, unknown] | PartialShallow<T>\nexport type ValueIteratee<T> = ((value: T) => unknown) | IterateeShorthand<T>\nexport interface Dictionary<T> {\n [index: string]: T\n}\n\nexport interface DebounceSettings {\n /**\n * @see _.leading\n */\n leading?: boolean | undefined\n /**\n * @see _.maxWait\n */\n maxWait?: number | undefined\n /**\n * @see _.trailing\n */\n trailing?: boolean | undefined\n}\n\nexport interface DebouncedFunc<T extends (...args: unknown[]) => unknown> {\n /**\n * Call the original function, but applying the debounce rules.\n *\n * If the debounced function can be run immediately, this calls it and returns its return\n * value.\n *\n * Otherwise, it returns the return value of the last invocation, or undefined if the debounced\n * function was not invoked yet.\n */\n (...args: Parameters<T>): ReturnType<T> | undefined\n\n /**\n * Throw away any pending invocation of the debounced function.\n */\n cancel(): void\n\n /**\n * If there is a pending invocation of the debounced function, invoke it immediately and return\n * its return value.\n *\n * Otherwise, return the value from the last invocation, or undefined if the debounced function\n * was never invoked.\n */\n flush(): ReturnType<T> | undefined\n}\n"]}