@shopify/cli-kit 3.69.4 → 3.71.0

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 (571) hide show
  1. package/{assets/cli-ruby/LICENSE → LICENSE} +0 -2
  2. package/dist/cli/api/graphql/admin/generated/get_theme_file_bodies.d.ts +41 -0
  3. package/dist/cli/api/graphql/admin/generated/get_theme_file_bodies.js +165 -0
  4. package/dist/cli/api/graphql/admin/generated/get_theme_file_bodies.js.map +1 -0
  5. package/dist/cli/api/graphql/admin/generated/get_theme_file_checksums.d.ts +29 -0
  6. package/dist/cli/api/graphql/admin/generated/get_theme_file_checksums.js +100 -0
  7. package/dist/cli/api/graphql/admin/generated/get_theme_file_checksums.js.map +1 -0
  8. package/dist/cli/api/graphql/admin/generated/theme_delete.d.ts +17 -0
  9. package/dist/cli/api/graphql/admin/generated/theme_delete.js +53 -0
  10. package/dist/cli/api/graphql/admin/generated/theme_delete.js.map +1 -0
  11. package/dist/cli/api/graphql/admin/generated/theme_files_upsert.d.ts +21 -0
  12. package/dist/cli/api/graphql/admin/generated/theme_files_upsert.js +82 -0
  13. package/dist/cli/api/graphql/admin/generated/theme_files_upsert.js.map +1 -0
  14. package/dist/cli/api/graphql/admin/generated/theme_publish.d.ts +21 -0
  15. package/dist/cli/api/graphql/admin/generated/theme_publish.js +65 -0
  16. package/dist/cli/api/graphql/admin/generated/theme_publish.js.map +1 -0
  17. package/dist/cli/api/graphql/admin/generated/theme_update.d.ts +23 -0
  18. package/dist/cli/api/graphql/admin/generated/theme_update.js +75 -0
  19. package/dist/cli/api/graphql/admin/generated/theme_update.js.map +1 -0
  20. package/dist/private/node/api/graphql.d.ts +2 -2
  21. package/dist/private/node/api/graphql.js +4 -4
  22. package/dist/private/node/api/graphql.js.map +1 -1
  23. package/dist/private/node/api/headers.js +1 -1
  24. package/dist/private/node/api/headers.js.map +1 -1
  25. package/dist/private/node/api/rest.d.ts +1 -2
  26. package/dist/private/node/api/rest.js +2 -3
  27. package/dist/private/node/api/rest.js.map +1 -1
  28. package/dist/private/node/api.d.ts +1 -1
  29. package/dist/private/node/api.js +41 -2
  30. package/dist/private/node/api.js.map +1 -1
  31. package/dist/private/node/conf-store.d.ts +9 -4
  32. package/dist/private/node/conf-store.js +8 -6
  33. package/dist/private/node/conf-store.js.map +1 -1
  34. package/dist/private/node/constants.d.ts +3 -0
  35. package/dist/private/node/constants.js +3 -0
  36. package/dist/private/node/constants.js.map +1 -1
  37. package/dist/private/node/session/exchange.js +2 -2
  38. package/dist/private/node/session/exchange.js.map +1 -1
  39. package/dist/private/node/session/schema.d.ts +40 -40
  40. package/dist/private/node/session/scopes.js +3 -5
  41. package/dist/private/node/session/scopes.js.map +1 -1
  42. package/dist/private/node/session.js +2 -3
  43. package/dist/private/node/session.js.map +1 -1
  44. package/dist/private/node/ui/alert.js +1 -3
  45. package/dist/private/node/ui/alert.js.map +1 -1
  46. package/dist/private/node/ui/components/ConcurrentOutput.d.ts +1 -0
  47. package/dist/private/node/ui/components/ConcurrentOutput.js +4 -4
  48. package/dist/private/node/ui/components/ConcurrentOutput.js.map +1 -1
  49. package/dist/private/node/ui/components/Link.js +3 -0
  50. package/dist/private/node/ui/components/Link.js.map +1 -1
  51. package/dist/private/node/ui/components/Link.test.js +23 -0
  52. package/dist/private/node/ui/components/Link.test.js.map +1 -1
  53. package/dist/private/node/ui.js +1 -1
  54. package/dist/private/node/ui.js.map +1 -1
  55. package/dist/public/common/version.d.ts +1 -1
  56. package/dist/public/common/version.js +1 -1
  57. package/dist/public/common/version.js.map +1 -1
  58. package/dist/public/node/analytics.js +1 -2
  59. package/dist/public/node/analytics.js.map +1 -1
  60. package/dist/public/node/api/admin.d.ts +2 -1
  61. package/dist/public/node/api/admin.js +36 -10
  62. package/dist/public/node/api/admin.js.map +1 -1
  63. package/dist/public/node/api/graphql.d.ts +2 -0
  64. package/dist/public/node/api/graphql.js +3 -3
  65. package/dist/public/node/api/graphql.js.map +1 -1
  66. package/dist/public/node/api/webhooks.d.ts +13 -0
  67. package/dist/public/node/api/webhooks.js +34 -0
  68. package/dist/public/node/api/webhooks.js.map +1 -0
  69. package/dist/public/node/base-command.js +4 -0
  70. package/dist/public/node/base-command.js.map +1 -1
  71. package/dist/public/node/cli-launcher.d.ts +12 -0
  72. package/dist/public/node/cli-launcher.js +29 -0
  73. package/dist/public/node/cli-launcher.js.map +1 -0
  74. package/dist/public/node/cli.d.ts +16 -10
  75. package/dist/public/node/cli.js +45 -101
  76. package/dist/public/node/cli.js.map +1 -1
  77. package/dist/public/node/context/fqdn.js +11 -7
  78. package/dist/public/node/context/fqdn.js.map +1 -1
  79. package/dist/public/node/context/local.d.ts +7 -0
  80. package/dist/public/node/context/local.js +16 -0
  81. package/dist/public/node/context/local.js.map +1 -1
  82. package/dist/public/node/environment.d.ts +7 -0
  83. package/dist/public/node/environment.js +11 -0
  84. package/dist/public/node/environment.js.map +1 -1
  85. package/dist/public/node/error-handler.js +2 -4
  86. package/dist/public/node/error-handler.js.map +1 -1
  87. package/dist/public/node/error.js +4 -13
  88. package/dist/public/node/error.js.map +1 -1
  89. package/dist/public/node/global-context.d.ts +15 -0
  90. package/dist/public/node/global-context.js +29 -0
  91. package/dist/public/node/global-context.js.map +1 -0
  92. package/dist/public/node/hooks/prerun.js +0 -2
  93. package/dist/public/node/hooks/prerun.js.map +1 -1
  94. package/dist/public/node/is-global.js +2 -1
  95. package/dist/public/node/is-global.js.map +1 -1
  96. package/dist/public/node/json-schema.d.ts +2 -1
  97. package/dist/public/node/json-schema.js +8 -3
  98. package/dist/public/node/json-schema.js.map +1 -1
  99. package/dist/public/node/node-package-manager.js +1 -1
  100. package/dist/public/node/node-package-manager.js.map +1 -1
  101. package/dist/public/node/notifications-system.d.ts +193 -0
  102. package/dist/public/node/notifications-system.js +242 -0
  103. package/dist/public/node/notifications-system.js.map +1 -0
  104. package/dist/public/node/output.d.ts +1 -6
  105. package/dist/public/node/output.js +1 -5
  106. package/dist/public/node/output.js.map +1 -1
  107. package/dist/public/node/path.d.ts +3 -3
  108. package/dist/public/node/path.js +4 -5
  109. package/dist/public/node/path.js.map +1 -1
  110. package/dist/public/node/system.js +14 -2
  111. package/dist/public/node/system.js.map +1 -1
  112. package/dist/public/node/themes/api.d.ts +4 -12
  113. package/dist/public/node/themes/api.js +225 -36
  114. package/dist/public/node/themes/api.js.map +1 -1
  115. package/dist/public/node/themes/factories.d.ts +1 -3
  116. package/dist/public/node/themes/factories.js +0 -16
  117. package/dist/public/node/themes/factories.js.map +1 -1
  118. package/dist/public/node/themes/types.d.ts +1 -0
  119. package/dist/public/node/themes/types.js.map +1 -1
  120. package/dist/public/node/themes/utils.d.ts +2 -0
  121. package/dist/public/node/themes/utils.js +11 -0
  122. package/dist/public/node/themes/utils.js.map +1 -1
  123. package/dist/public/node/tree-kill.js +0 -2
  124. package/dist/public/node/tree-kill.js.map +1 -1
  125. package/dist/public/node/ui.js +30 -80
  126. package/dist/public/node/ui.js.map +1 -1
  127. package/dist/public/node/vendor/dev_server/DevServer.d.ts +19 -0
  128. package/dist/public/node/vendor/dev_server/DevServer.js +170 -0
  129. package/dist/public/node/vendor/dev_server/DevServer.js.map +1 -0
  130. package/dist/public/node/version.d.ts +13 -0
  131. package/dist/public/node/version.js +38 -0
  132. package/dist/public/node/version.js.map +1 -0
  133. package/dist/tsconfig.tsbuildinfo +1 -1
  134. package/package.json +9 -7
  135. package/assets/cli-ruby/.devcontainer.json +0 -5
  136. package/assets/cli-ruby/.rubocop.yml +0 -102
  137. package/assets/cli-ruby/.rubocop_todo.yml +0 -24
  138. package/assets/cli-ruby/CHANGELOG.md +0 -634
  139. package/assets/cli-ruby/CONTRIBUTING.md +0 -3
  140. package/assets/cli-ruby/Codespace.dockerfile +0 -35
  141. package/assets/cli-ruby/Gemfile +0 -32
  142. package/assets/cli-ruby/README.md +0 -30
  143. package/assets/cli-ruby/Rakefile +0 -167
  144. package/assets/cli-ruby/SECURITY.md +0 -59
  145. package/assets/cli-ruby/Tests.dockerfile +0 -35
  146. package/assets/cli-ruby/assets/logo.png +0 -0
  147. package/assets/cli-ruby/bin/console +0 -11
  148. package/assets/cli-ruby/bin/load_shopify.rb +0 -22
  149. package/assets/cli-ruby/bin/shopify +0 -67
  150. package/assets/cli-ruby/bin/shopify.bat +0 -3
  151. package/assets/cli-ruby/dev.yml +0 -29
  152. package/assets/cli-ruby/docs/README.md +0 -13
  153. package/assets/cli-ruby/docs/contributors/testing.md +0 -27
  154. package/assets/cli-ruby/docs/users/installation.md +0 -3
  155. package/assets/cli-ruby/docs/users/migrate-from-themekit.md +0 -18
  156. package/assets/cli-ruby/ext/javy/hashes/javy-arm-macos-v0.1.0.gz.sha256 +0 -1
  157. package/assets/cli-ruby/ext/javy/hashes/javy-arm-macos-v0.2.0.gz.sha256 +0 -1
  158. package/assets/cli-ruby/ext/javy/hashes/javy-arm-macos-v0.2.1.gz.sha256 +0 -1
  159. package/assets/cli-ruby/ext/javy/hashes/javy-arm-macos-v0.3.0.gz.sha256 +0 -1
  160. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-linux-v0.1.0.gz.sha256 +0 -1
  161. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-linux-v0.2.0.gz.sha256 +0 -1
  162. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-linux-v0.2.1.gz.sha256 +0 -1
  163. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-linux-v0.3.0.gz.sha256 +0 -1
  164. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-macos-v0.1.0.gz.sha256 +0 -1
  165. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-macos-v0.2.0.gz.sha256 +0 -1
  166. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-macos-v0.2.1.gz.sha256 +0 -1
  167. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-macos-v0.3.0.gz.sha256 +0 -1
  168. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-windows-v0.1.0.gz.sha256 +0 -1
  169. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-windows-v0.2.0.gz.sha256 +0 -1
  170. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-windows-v0.2.1.gz.sha256 +0 -1
  171. package/assets/cli-ruby/ext/javy/hashes/javy-x86_64-windows-v0.3.0.gz.sha256 +0 -1
  172. package/assets/cli-ruby/ext/javy/javy.rb +0 -204
  173. package/assets/cli-ruby/ext/javy/version +0 -1
  174. package/assets/cli-ruby/ext/shopify-extensions/extconf.rb +0 -21
  175. package/assets/cli-ruby/ext/shopify-extensions/shopify_extensions.rb +0 -152
  176. package/assets/cli-ruby/ext/shopify-extensions/version +0 -1
  177. package/assets/cli-ruby/features/support/assertions.rb +0 -17
  178. package/assets/cli-ruby/features/support/cli.rb +0 -7
  179. package/assets/cli-ruby/features/support/process.rb +0 -27
  180. package/assets/cli-ruby/features/support/requires.rb +0 -3
  181. package/assets/cli-ruby/lib/docgen/class_template.md.erb +0 -81
  182. package/assets/cli-ruby/lib/docgen/index_template.md.erb +0 -5
  183. package/assets/cli-ruby/lib/docgen/markdown.rb +0 -101
  184. package/assets/cli-ruby/lib/graphql/admin_introspection.graphql +0 -87
  185. package/assets/cli-ruby/lib/graphql/all_organizations.graphql +0 -19
  186. package/assets/cli-ruby/lib/graphql/all_orgs_with_apps.graphql +0 -30
  187. package/assets/cli-ruby/lib/graphql/api_versions.graphql +0 -6
  188. package/assets/cli-ruby/lib/graphql/convert_dev_to_test_store.graphql +0 -10
  189. package/assets/cli-ruby/lib/graphql/create_app.graphql +0 -20
  190. package/assets/cli-ruby/lib/graphql/create_customer.graphql +0 -9
  191. package/assets/cli-ruby/lib/graphql/create_draft_order.graphql +0 -8
  192. package/assets/cli-ruby/lib/graphql/create_product.graphql +0 -9
  193. package/assets/cli-ruby/lib/graphql/extension_create.graphql +0 -37
  194. package/assets/cli-ruby/lib/graphql/extension_update_draft.graphql +0 -19
  195. package/assets/cli-ruby/lib/graphql/fetch_specifications.graphql +0 -14
  196. package/assets/cli-ruby/lib/graphql/find_organization.graphql +0 -18
  197. package/assets/cli-ruby/lib/graphql/find_organization_with_apps.graphql +0 -20
  198. package/assets/cli-ruby/lib/graphql/get_app_by_api_key.graphql +0 -9
  199. package/assets/cli-ruby/lib/graphql/get_app_urls.graphql +0 -6
  200. package/assets/cli-ruby/lib/graphql/get_extension_registrations.graphql +0 -28
  201. package/assets/cli-ruby/lib/graphql/get_variant_id.graphql +0 -16
  202. package/assets/cli-ruby/lib/graphql/update_dashboard_urls.graphql +0 -8
  203. package/assets/cli-ruby/lib/project_types/extension/cli.rb +0 -75
  204. package/assets/cli-ruby/lib/project_types/extension/commands/extension_command.rb +0 -29
  205. package/assets/cli-ruby/lib/project_types/extension/commands/serve.rb +0 -164
  206. package/assets/cli-ruby/lib/project_types/extension/errors.rb +0 -9
  207. package/assets/cli-ruby/lib/project_types/extension/extension_project.rb +0 -151
  208. package/assets/cli-ruby/lib/project_types/extension/extension_project_keys.rb +0 -12
  209. package/assets/cli-ruby/lib/project_types/extension/features/argo.rb +0 -50
  210. package/assets/cli-ruby/lib/project_types/extension/features/argo_config.rb +0 -59
  211. package/assets/cli-ruby/lib/project_types/extension/features/argo_dependencies.rb +0 -28
  212. package/assets/cli-ruby/lib/project_types/extension/features/argo_runtime.rb +0 -15
  213. package/assets/cli-ruby/lib/project_types/extension/features/argo_serve.rb +0 -115
  214. package/assets/cli-ruby/lib/project_types/extension/features/argo_setup.rb +0 -54
  215. package/assets/cli-ruby/lib/project_types/extension/features/argo_setup_step.rb +0 -31
  216. package/assets/cli-ruby/lib/project_types/extension/features/argo_setup_steps.rb +0 -51
  217. package/assets/cli-ruby/lib/project_types/extension/features/runtimes/admin.rb +0 -29
  218. package/assets/cli-ruby/lib/project_types/extension/features/runtimes/base.rb +0 -19
  219. package/assets/cli-ruby/lib/project_types/extension/features/runtimes/checkout_post_purchase.rb +0 -23
  220. package/assets/cli-ruby/lib/project_types/extension/features/runtimes/checkout_ui_extension.rb +0 -29
  221. package/assets/cli-ruby/lib/project_types/extension/loaders/project.rb +0 -50
  222. package/assets/cli-ruby/lib/project_types/extension/loaders/specification_handler.rb +0 -22
  223. package/assets/cli-ruby/lib/project_types/extension/messages/message_loading.rb +0 -34
  224. package/assets/cli-ruby/lib/project_types/extension/messages/messages.rb +0 -320
  225. package/assets/cli-ruby/lib/project_types/extension/models/app.rb +0 -14
  226. package/assets/cli-ruby/lib/project_types/extension/models/lazy_specification_handler.rb +0 -12
  227. package/assets/cli-ruby/lib/project_types/extension/models/specification.rb +0 -41
  228. package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/default.rb +0 -145
  229. package/assets/cli-ruby/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +0 -134
  230. package/assets/cli-ruby/lib/project_types/extension/models/specifications.rb +0 -91
  231. package/assets/cli-ruby/lib/project_types/extension/models/validation_error.rb +0 -17
  232. package/assets/cli-ruby/lib/project_types/extension/models/version.rb +0 -15
  233. package/assets/cli-ruby/lib/project_types/extension/tasks/configure_features.rb +0 -73
  234. package/assets/cli-ruby/lib/project_types/extension/tasks/configure_options.rb +0 -21
  235. package/assets/cli-ruby/lib/project_types/extension/tasks/converters/validation_error_converter.rb +0 -25
  236. package/assets/cli-ruby/lib/project_types/extension/tasks/converters/version_converter.rb +0 -28
  237. package/assets/cli-ruby/lib/project_types/extension/tasks/fetch_specifications.rb +0 -21
  238. package/assets/cli-ruby/lib/project_types/node/cli.rb +0 -12
  239. package/assets/cli-ruby/lib/project_types/node/forms/create.rb +0 -45
  240. package/assets/cli-ruby/lib/project_types/node/messages/messages.rb +0 -33
  241. package/assets/cli-ruby/lib/project_types/php/cli.rb +0 -16
  242. package/assets/cli-ruby/lib/project_types/php/forms/create.rb +0 -44
  243. package/assets/cli-ruby/lib/project_types/php/messages/messages.rb +0 -29
  244. package/assets/cli-ruby/lib/project_types/rails/cli.rb +0 -15
  245. package/assets/cli-ruby/lib/project_types/rails/forms/create.rb +0 -75
  246. package/assets/cli-ruby/lib/project_types/rails/gem.rb +0 -110
  247. package/assets/cli-ruby/lib/project_types/rails/messages/messages.rb +0 -101
  248. package/assets/cli-ruby/lib/project_types/script/cli.rb +0 -27
  249. package/assets/cli-ruby/lib/project_types/script/commands/connect.rb +0 -16
  250. package/assets/cli-ruby/lib/project_types/script/commands/create.rb +0 -24
  251. package/assets/cli-ruby/lib/project_types/script/commands/javy.rb +0 -24
  252. package/assets/cli-ruby/lib/project_types/script/commands/push.rb +0 -26
  253. package/assets/cli-ruby/lib/project_types/script/loaders/project.rb +0 -46
  254. package/assets/cli-ruby/lib/project_types/script/loaders/specification_handler.rb +0 -22
  255. package/assets/cli-ruby/lib/project_types/script/messages/messages.rb +0 -11
  256. package/assets/cli-ruby/lib/project_types/theme/cli.rb +0 -33
  257. package/assets/cli-ruby/lib/project_types/theme/commands/common/root_helper.rb +0 -94
  258. package/assets/cli-ruby/lib/project_types/theme/commands/common/shop_helper.rb +0 -13
  259. package/assets/cli-ruby/lib/project_types/theme/commands/console.rb +0 -23
  260. package/assets/cli-ruby/lib/project_types/theme/commands/delete.rb +0 -70
  261. package/assets/cli-ruby/lib/project_types/theme/commands/init.rb +0 -46
  262. package/assets/cli-ruby/lib/project_types/theme/commands/list.rb +0 -33
  263. package/assets/cli-ruby/lib/project_types/theme/commands/open.rb +0 -73
  264. package/assets/cli-ruby/lib/project_types/theme/commands/package.rb +0 -73
  265. package/assets/cli-ruby/lib/project_types/theme/commands/publish.rb +0 -49
  266. package/assets/cli-ruby/lib/project_types/theme/commands/pull.rb +0 -118
  267. package/assets/cli-ruby/lib/project_types/theme/commands/push.rb +0 -160
  268. package/assets/cli-ruby/lib/project_types/theme/commands/serve.rb +0 -91
  269. package/assets/cli-ruby/lib/project_types/theme/commands/share.rb +0 -62
  270. package/assets/cli-ruby/lib/project_types/theme/commands/token.rb +0 -22
  271. package/assets/cli-ruby/lib/project_types/theme/conversions/base_glob.rb +0 -65
  272. package/assets/cli-ruby/lib/project_types/theme/conversions/ignore_glob.rb +0 -15
  273. package/assets/cli-ruby/lib/project_types/theme/conversions/include_glob.rb +0 -15
  274. package/assets/cli-ruby/lib/project_types/theme/forms/confirm_store.rb +0 -15
  275. package/assets/cli-ruby/lib/project_types/theme/forms/select.rb +0 -34
  276. package/assets/cli-ruby/lib/project_types/theme/messages/messages.rb +0 -429
  277. package/assets/cli-ruby/lib/project_types/theme/models/specification_handlers/theme.rb +0 -19
  278. package/assets/cli-ruby/lib/project_types/theme/presenters/theme_presenter.rb +0 -48
  279. package/assets/cli-ruby/lib/project_types/theme/presenters/themes_presenter.rb +0 -29
  280. package/assets/cli-ruby/lib/project_types/theme/ui/sync_progress_bar.rb +0 -20
  281. package/assets/cli-ruby/lib/rubygems_plugin.rb +0 -26
  282. package/assets/cli-ruby/lib/shopify_cli/admin_api.rb +0 -160
  283. package/assets/cli-ruby/lib/shopify_cli/api.rb +0 -130
  284. package/assets/cli-ruby/lib/shopify_cli/command/project_command.rb +0 -31
  285. package/assets/cli-ruby/lib/shopify_cli/command/sub_command.rb +0 -20
  286. package/assets/cli-ruby/lib/shopify_cli/command.rb +0 -166
  287. package/assets/cli-ruby/lib/shopify_cli/commands.rb +0 -21
  288. package/assets/cli-ruby/lib/shopify_cli/constants.rb +0 -101
  289. package/assets/cli-ruby/lib/shopify_cli/context.rb +0 -709
  290. package/assets/cli-ruby/lib/shopify_cli/core/cli_version.rb +0 -20
  291. package/assets/cli-ruby/lib/shopify_cli/core/entry_point.rb +0 -64
  292. package/assets/cli-ruby/lib/shopify_cli/core/executor.rb +0 -23
  293. package/assets/cli-ruby/lib/shopify_cli/core/finalize.rb +0 -13
  294. package/assets/cli-ruby/lib/shopify_cli/core/monorail.rb +0 -122
  295. package/assets/cli-ruby/lib/shopify_cli/core.rb +0 -8
  296. package/assets/cli-ruby/lib/shopify_cli/db.rb +0 -114
  297. package/assets/cli-ruby/lib/shopify_cli/environment.rb +0 -217
  298. package/assets/cli-ruby/lib/shopify_cli/exception_reporter.rb +0 -80
  299. package/assets/cli-ruby/lib/shopify_cli/feature.rb +0 -95
  300. package/assets/cli-ruby/lib/shopify_cli/file_system_listener.rb +0 -30
  301. package/assets/cli-ruby/lib/shopify_cli/form.rb +0 -42
  302. package/assets/cli-ruby/lib/shopify_cli/git.rb +0 -320
  303. package/assets/cli-ruby/lib/shopify_cli/github/issue_url_generator.rb +0 -30
  304. package/assets/cli-ruby/lib/shopify_cli/github.rb +0 -5
  305. package/assets/cli-ruby/lib/shopify_cli/helpers/haikunator.rb +0 -92
  306. package/assets/cli-ruby/lib/shopify_cli/helpers.rb +0 -5
  307. package/assets/cli-ruby/lib/shopify_cli/http_request.rb +0 -43
  308. package/assets/cli-ruby/lib/shopify_cli/identity_auth/env_auth_token.rb +0 -34
  309. package/assets/cli-ruby/lib/shopify_cli/identity_auth.rb +0 -332
  310. package/assets/cli-ruby/lib/shopify_cli/js_system.rb +0 -115
  311. package/assets/cli-ruby/lib/shopify_cli/lazy_delegator.rb +0 -55
  312. package/assets/cli-ruby/lib/shopify_cli/messages/messages.rb +0 -863
  313. package/assets/cli-ruby/lib/shopify_cli/method_object.rb +0 -123
  314. package/assets/cli-ruby/lib/shopify_cli/migrator/migration.rb +0 -27
  315. package/assets/cli-ruby/lib/shopify_cli/migrator/migrations/1631709766_noop.rb +0 -13
  316. package/assets/cli-ruby/lib/shopify_cli/migrator/migrations/1633691650_merge_reporting_configuration.rb +0 -41
  317. package/assets/cli-ruby/lib/shopify_cli/migrator.rb +0 -46
  318. package/assets/cli-ruby/lib/shopify_cli/options.rb +0 -40
  319. package/assets/cli-ruby/lib/shopify_cli/partners_api/app_extensions/job.rb +0 -36
  320. package/assets/cli-ruby/lib/shopify_cli/partners_api/app_extensions.rb +0 -46
  321. package/assets/cli-ruby/lib/shopify_cli/partners_api/organizations.rb +0 -45
  322. package/assets/cli-ruby/lib/shopify_cli/partners_api.rb +0 -91
  323. package/assets/cli-ruby/lib/shopify_cli/project.rb +0 -199
  324. package/assets/cli-ruby/lib/shopify_cli/project_type.rb +0 -66
  325. package/assets/cli-ruby/lib/shopify_cli/reporting_configuration_controller.rb +0 -29
  326. package/assets/cli-ruby/lib/shopify_cli/resolve_constant.rb +0 -25
  327. package/assets/cli-ruby/lib/shopify_cli/resources/env_file.rb +0 -108
  328. package/assets/cli-ruby/lib/shopify_cli/resources.rb +0 -5
  329. package/assets/cli-ruby/lib/shopify_cli/result.rb +0 -448
  330. package/assets/cli-ruby/lib/shopify_cli/shopifolk.rb +0 -82
  331. package/assets/cli-ruby/lib/shopify_cli/task.rb +0 -20
  332. package/assets/cli-ruby/lib/shopify_cli/tasks/confirm_store.rb +0 -18
  333. package/assets/cli-ruby/lib/shopify_cli/tasks/create_api_client.rb +0 -40
  334. package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_authenticated.rb +0 -19
  335. package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_dev_store.rb +0 -41
  336. package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_env.rb +0 -90
  337. package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_git_dependency.rb +0 -14
  338. package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_loopback_url.rb +0 -20
  339. package/assets/cli-ruby/lib/shopify_cli/tasks/ensure_project_type.rb +0 -14
  340. package/assets/cli-ruby/lib/shopify_cli/tasks/select_org_and_shop.rb +0 -81
  341. package/assets/cli-ruby/lib/shopify_cli/tasks/update_dashboard_urls.rb +0 -57
  342. package/assets/cli-ruby/lib/shopify_cli/tasks.rb +0 -44
  343. package/assets/cli-ruby/lib/shopify_cli/theme/backoff_helper.rb +0 -47
  344. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/cdn_fonts.rb +0 -82
  345. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/certificate_manager.rb +0 -79
  346. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/errors.rb +0 -9
  347. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/header_hash.rb +0 -98
  348. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hooks/file_change_hook.rb +0 -77
  349. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/remote_file_deleter.rb +0 -62
  350. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb +0 -63
  351. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/hot-reload-no-script.html +0 -27
  352. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/hot_reload.js +0 -48
  353. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/sse_client.js +0 -43
  354. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/theme.js +0 -114
  355. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/resources/theme_extension.js +0 -121
  356. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/script_injector.rb +0 -57
  357. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload/sections_index.rb +0 -50
  358. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/hot_reload.rb +0 -75
  359. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/local_assets.rb +0 -101
  360. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/proxy.rb +0 -313
  361. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/proxy_param_builder.rb +0 -84
  362. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/reload_mode.rb +0 -34
  363. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/remote_watcher/json_files_update_job.rb +0 -35
  364. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/remote_watcher.rb +0 -44
  365. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/sse.rb +0 -75
  366. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/watcher.rb +0 -64
  367. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server/web_server.rb +0 -140
  368. package/assets/cli-ruby/lib/shopify_cli/theme/dev_server.rb +0 -332
  369. package/assets/cli-ruby/lib/shopify_cli/theme/development_theme.rb +0 -101
  370. package/assets/cli-ruby/lib/shopify_cli/theme/extension/app_extension.rb +0 -40
  371. package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/hooks/file_change_hook.rb +0 -76
  372. package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/hot_reload/script_injector.rb +0 -30
  373. package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/hot_reload.rb +0 -13
  374. package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/local_assets.rb +0 -31
  375. package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/proxy_param_builder.rb +0 -94
  376. package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server/watcher.rb +0 -49
  377. package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server.rb +0 -175
  378. package/assets/cli-ruby/lib/shopify_cli/theme/extension/host_theme.rb +0 -109
  379. package/assets/cli-ruby/lib/shopify_cli/theme/extension/ignore_helper.rb +0 -35
  380. package/assets/cli-ruby/lib/shopify_cli/theme/extension/syncer/extension_serve_job.rb +0 -120
  381. package/assets/cli-ruby/lib/shopify_cli/theme/extension/syncer/operation.rb +0 -25
  382. package/assets/cli-ruby/lib/shopify_cli/theme/extension/syncer.rb +0 -100
  383. package/assets/cli-ruby/lib/shopify_cli/theme/extension/ui/host_theme_progress_bar.rb +0 -35
  384. package/assets/cli-ruby/lib/shopify_cli/theme/extension/ui/host_theme_raw_progress_bar.rb +0 -40
  385. package/assets/cli-ruby/lib/shopify_cli/theme/file.rb +0 -133
  386. package/assets/cli-ruby/lib/shopify_cli/theme/filter/path_matcher.rb +0 -38
  387. package/assets/cli-ruby/lib/shopify_cli/theme/ignore_filter.rb +0 -112
  388. package/assets/cli-ruby/lib/shopify_cli/theme/ignore_helper.rb +0 -37
  389. package/assets/cli-ruby/lib/shopify_cli/theme/include_filter.rb +0 -67
  390. package/assets/cli-ruby/lib/shopify_cli/theme/mime_type.rb +0 -34
  391. package/assets/cli-ruby/lib/shopify_cli/theme/notifier.rb +0 -52
  392. package/assets/cli-ruby/lib/shopify_cli/theme/repl/api.rb +0 -109
  393. package/assets/cli-ruby/lib/shopify_cli/theme/repl/auth_dev_server.rb +0 -93
  394. package/assets/cli-ruby/lib/shopify_cli/theme/repl/auth_middleware.rb +0 -97
  395. package/assets/cli-ruby/lib/shopify_cli/theme/repl/remote_evaluator.rb +0 -166
  396. package/assets/cli-ruby/lib/shopify_cli/theme/repl/resources/success.html +0 -78
  397. package/assets/cli-ruby/lib/shopify_cli/theme/repl/resources/template.liquid +0 -15
  398. package/assets/cli-ruby/lib/shopify_cli/theme/repl/snippet.rb +0 -81
  399. package/assets/cli-ruby/lib/shopify_cli/theme/repl.rb +0 -88
  400. package/assets/cli-ruby/lib/shopify_cli/theme/root.rb +0 -62
  401. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/checksums.rb +0 -66
  402. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/downloader.rb +0 -63
  403. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/error_reporter.rb +0 -45
  404. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/merger.rb +0 -53
  405. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/operation.rb +0 -49
  406. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/standard_reporter.rb +0 -32
  407. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/unsupported_script_warning.rb +0 -90
  408. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/bulk.rb +0 -133
  409. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/bulk_item.rb +0 -64
  410. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/bulk_job.rb +0 -139
  411. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/bulk_request.rb +0 -30
  412. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all.rb +0 -41
  413. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/apply_to_all_form.rb +0 -37
  414. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/base_strategy_form.rb +0 -64
  415. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/select_delete_strategy.rb +0 -29
  416. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/forms/select_update_strategy.rb +0 -30
  417. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/json_delete_handler.rb +0 -49
  418. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader/json_update_handler.rb +0 -71
  419. package/assets/cli-ruby/lib/shopify_cli/theme/syncer/uploader.rb +0 -231
  420. package/assets/cli-ruby/lib/shopify_cli/theme/syncer.rb +0 -391
  421. package/assets/cli-ruby/lib/shopify_cli/theme/theme.rb +0 -212
  422. package/assets/cli-ruby/lib/shopify_cli/theme/theme_access_api.rb +0 -89
  423. package/assets/cli-ruby/lib/shopify_cli/theme/theme_admin_api.rb +0 -101
  424. package/assets/cli-ruby/lib/shopify_cli/thread_pool/job.rb +0 -35
  425. package/assets/cli-ruby/lib/shopify_cli/thread_pool.rb +0 -49
  426. package/assets/cli-ruby/lib/shopify_cli/transform_data_structure.rb +0 -87
  427. package/assets/cli-ruby/lib/shopify_cli/utilities.rb +0 -21
  428. package/assets/cli-ruby/lib/shopify_cli/version.rb +0 -3
  429. package/assets/cli-ruby/lib/shopify_cli.rb +0 -182
  430. package/assets/cli-ruby/shipit.rubygems.yml +0 -3
  431. package/assets/cli-ruby/shopify-cli.gemspec +0 -46
  432. package/assets/cli-ruby/shopify-dev +0 -16
  433. package/assets/cli-ruby/test/minitest_ext.rb +0 -115
  434. package/assets/cli-ruby/test/project_types/extension/extension_test_helpers.rb +0 -70
  435. package/assets/cli-ruby/test/shopify-cli/migrator/migrations/migration_helper.rb +0 -20
  436. package/assets/cli-ruby/test/test_helpers.rb +0 -16
  437. package/assets/cli-ruby/utilities/constants.rb +0 -7
  438. package/assets/cli-ruby/utilities/docker/container.rb +0 -104
  439. package/assets/cli-ruby/utilities/docker.rb +0 -89
  440. package/assets/cli-ruby/utilities/utilities.rb +0 -6
  441. package/assets/cli-ruby/vendor/deps/cli-kit/REVISION +0 -1
  442. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/autocall.rb +0 -21
  443. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/base_command.rb +0 -49
  444. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/command_registry.rb +0 -94
  445. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/config.rb +0 -133
  446. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb +0 -123
  447. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/executor.rb +0 -79
  448. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/ini.rb +0 -102
  449. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/levenshtein.rb +0 -82
  450. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/logger.rb +0 -82
  451. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/resolver.rb +0 -60
  452. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/ruby_backports/enumerable.rb +0 -6
  453. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/support/test_helper.rb +0 -244
  454. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/support.rb +0 -9
  455. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/system.rb +0 -243
  456. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/util.rb +0 -193
  457. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit/version.rb +0 -5
  458. package/assets/cli-ruby/vendor/deps/cli-kit/lib/cli/kit.rb +0 -60
  459. package/assets/cli-ruby/vendor/deps/cli-ui/REVISION +0 -1
  460. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/ansi.rb +0 -157
  461. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/color.rb +0 -84
  462. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/formatter.rb +0 -193
  463. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame/frame_stack.rb +0 -98
  464. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/box.rb +0 -166
  465. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style/bracket.rb +0 -139
  466. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame/frame_style.rb +0 -120
  467. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/frame.rb +0 -269
  468. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/glyph.rb +0 -84
  469. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/os.rb +0 -73
  470. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/printer.rb +0 -59
  471. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/progress.rb +0 -90
  472. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/progress_plain.rb +0 -50
  473. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +0 -484
  474. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt/options_handler.rb +0 -29
  475. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/prompt.rb +0 -282
  476. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/spinner/async.rb +0 -40
  477. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/spinner/spin_group.rb +0 -263
  478. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/spinner.rb +0 -66
  479. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/stdout_router.rb +0 -232
  480. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/terminal.rb +0 -46
  481. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/truncater.rb +0 -102
  482. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/version.rb +0 -5
  483. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/widgets/base.rb +0 -27
  484. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/widgets/status.rb +0 -61
  485. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/widgets.rb +0 -77
  486. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui/wrap.rb +0 -56
  487. package/assets/cli-ruby/vendor/deps/cli-ui/lib/cli/ui.rb +0 -234
  488. package/assets/cli-ruby/vendor/deps/ruby2_keywords/LICENSE +0 -22
  489. package/assets/cli-ruby/vendor/deps/ruby2_keywords/README.md +0 -67
  490. package/assets/cli-ruby/vendor/deps/ruby2_keywords/Rakefile +0 -54
  491. package/assets/cli-ruby/vendor/deps/ruby2_keywords/lib/ruby2_keywords.rb +0 -57
  492. package/assets/cli-ruby/vendor/deps/ruby2_keywords/ruby2_keywords.gemspec +0 -18
  493. package/assets/cli-ruby/vendor/deps/ruby2_keywords/test/test_keyword.rb +0 -41
  494. package/assets/cli-ruby/vendor/deps/smart_properties/REVISION +0 -1
  495. package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/errors.rb +0 -114
  496. package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/property.rb +0 -168
  497. package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/property_collection.rb +0 -83
  498. package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/validations/ancestor.rb +0 -27
  499. package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/validations.rb +0 -8
  500. package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties/version.rb +0 -3
  501. package/assets/cli-ruby/vendor/deps/smart_properties/lib/smart_properties.rb +0 -174
  502. package/assets/cli-ruby/vendor/deps/webrick/Gemfile +0 -3
  503. package/assets/cli-ruby/vendor/deps/webrick/LICENSE.txt +0 -22
  504. package/assets/cli-ruby/vendor/deps/webrick/README.md +0 -61
  505. package/assets/cli-ruby/vendor/deps/webrick/Rakefile +0 -10
  506. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/accesslog.rb +0 -157
  507. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/cgi.rb +0 -313
  508. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/compat.rb +0 -36
  509. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/config.rb +0 -158
  510. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/cookie.rb +0 -172
  511. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/htmlutils.rb +0 -30
  512. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/authenticator.rb +0 -117
  513. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/basicauth.rb +0 -116
  514. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/digestauth.rb +0 -395
  515. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/htdigest.rb +0 -132
  516. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/htgroup.rb +0 -97
  517. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/htpasswd.rb +0 -158
  518. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth/userdb.rb +0 -53
  519. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpauth.rb +0 -96
  520. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpproxy.rb +0 -354
  521. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httprequest.rb +0 -636
  522. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpresponse.rb +0 -564
  523. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/https.rb +0 -152
  524. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpserver.rb +0 -294
  525. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/abstract.rb +0 -152
  526. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/cgi_runner.rb +0 -47
  527. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/cgihandler.rb +0 -126
  528. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/erbhandler.rb +0 -88
  529. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/filehandler.rb +0 -552
  530. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet/prochandler.rb +0 -47
  531. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpservlet.rb +0 -23
  532. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpstatus.rb +0 -194
  533. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httputils.rb +0 -512
  534. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/httpversion.rb +0 -76
  535. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/log.rb +0 -156
  536. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/server.rb +0 -381
  537. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/ssl.rb +0 -215
  538. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/utils.rb +0 -265
  539. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick/version.rb +0 -18
  540. package/assets/cli-ruby/vendor/deps/webrick/lib/webrick.rb +0 -232
  541. package/assets/cli-ruby/vendor/deps/webrick/webrick.gemspec +0 -74
  542. package/assets/cli-ruby/vendor/gen/lib/gen/commands/help.rb +0 -20
  543. package/assets/cli-ruby/vendor/gen/lib/gen/commands/new.rb +0 -21
  544. package/assets/cli-ruby/vendor/gen/lib/gen/commands.rb +0 -18
  545. package/assets/cli-ruby/vendor/gen/lib/gen/entry_point.rb +0 -10
  546. package/assets/cli-ruby/vendor/gen/lib/gen/generator.rb +0 -165
  547. package/assets/cli-ruby/vendor/gen/lib/gen.rb +0 -39
  548. package/assets/cli-ruby/vendor/gen/template/Gemfile +0 -10
  549. package/assets/cli-ruby/vendor/gen/template/README.md +0 -1
  550. package/assets/cli-ruby/vendor/gen/template/bin/testunit +0 -23
  551. package/assets/cli-ruby/vendor/gen/template/bin/update-deps +0 -97
  552. package/assets/cli-ruby/vendor/gen/template/dev-gems.yml +0 -3
  553. package/assets/cli-ruby/vendor/gen/template/dev-vendor.yml +0 -4
  554. package/assets/cli-ruby/vendor/gen/template/exe/__app__-gems +0 -17
  555. package/assets/cli-ruby/vendor/gen/template/exe/__app__-vendor +0 -18
  556. package/assets/cli-ruby/vendor/gen/template/lib/__app__/commands/example.rb +0 -19
  557. package/assets/cli-ruby/vendor/gen/template/lib/__app__/commands/help.rb +0 -21
  558. package/assets/cli-ruby/vendor/gen/template/lib/__app__/commands.rb +0 -18
  559. package/assets/cli-ruby/vendor/gen/template/lib/__app__/entry_point.rb +0 -10
  560. package/assets/cli-ruby/vendor/gen/template/lib/__app__.rb +0 -33
  561. package/assets/cli-ruby/vendor/gen/template/test/example_test.rb +0 -17
  562. package/assets/cli-ruby/vendor/gen/template/test/test_helper.rb +0 -22
  563. package/assets/cli-ruby/vendor/lib/semantic/LICENSE +0 -20
  564. package/assets/cli-ruby/vendor/lib/semantic/semantic.rb +0 -4
  565. package/assets/cli-ruby/vendor/lib/semantic/version.rb +0 -179
  566. package/dist/private/node/demo-recorder.d.ts +0 -17
  567. package/dist/private/node/demo-recorder.js +0 -121
  568. package/dist/private/node/demo-recorder.js.map +0 -1
  569. package/dist/public/node/ruby.d.ts +0 -38
  570. package/dist/public/node/ruby.js +0 -327
  571. package/dist/public/node/ruby.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/public/node/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,qCAAqC,C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AAI,aAAa,GAAG,EAAE,CAAA;IACtB,IAAI,eAAe,GAAgB,EAAE,CAAA;IACrC,IAAI;QACF,aAAa,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAA;QACpF,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAC3C,qDAAqD;KACtD;IAAC,OAAO,GAAG,EAAE;QACZ,OAAM;KACP;IACD,MAAM,gBAAgB,GAAG;QACvB,GAAG,eAAe,CAAC,gBAAgB;QACnC,GAAG,eAAe,CAAC,eAAe;QAClC,GAAG,eAAe,CAAC,YAAY;KAChC,CAAA;IACD,OAAO,gBAAgB,CAAC,cAAc,CAAC,CAAA;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC;QACxB,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,uBAAuB;QACpC,GAAG,EAAE,uBAAuB;KAC7B,CAAC;IACF,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;QACrB,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,uCAAuC;QACpD,GAAG,EAAE,sBAAsB;KAC5B,CAAC;CACH,CAAA","sourcesContent":["import {isTruthy} from './context/utilities.js'\nimport {printEventsJson} from '../../private/node/demo-recorder.js'\nimport {Flags} from '@oclif/core'\n// eslint-disable-next-line @shopify/cli/specific-imports-in-bootstrap-code\nimport {fileURLToPath} from 'url'\n\n/**\n * IMPORTANT NOTE: Imports in this module are dynamic to ensure that \"setupEnvironmentVariables\" can dynamically\n * set the DEBUG environment variable before the 'debug' package sets up its configuration when modules\n * are loaded statically.\n */\ninterface RunCLIOptions {\n /** The value of import.meta.url of the CLI executable module */\n moduleURL: string\n development: boolean\n}\n\nasync function warnIfOldNodeVersion() {\n const nodeVersion = process.versions.node\n const nodeMajorVersion = Number(nodeVersion.split('.')[0])\n\n const currentSupportedNodeVersion = 18\n if (nodeMajorVersion < currentSupportedNodeVersion) {\n const {renderWarning} = await import('./ui.js')\n renderWarning({\n headline: 'Upgrade to a supported Node version now.',\n body: [\n `Node ${nodeMajorVersion} has reached end-of-life and poses security risks. When you upgrade to a`,\n {\n link: {\n url: 'https://nodejs.dev/en/about/previous-releases',\n label: 'supported version',\n },\n },\n {char: ','},\n \"you'll be able to use Shopify CLI without interruption.\",\n ],\n })\n }\n}\n\nfunction setupEnvironmentVariables(options: Pick<RunCLIOptions, 'development'>) {\n /**\n * By setting DEBUG=* when --verbose is passed we are increasing the\n * verbosity of oclif. Oclif uses debug (https://www.npmjs.com/package/debug)\n * for logging, and it's configured through the DEBUG= environment variable.\n */\n if (process.argv.includes('--verbose')) {\n process.env.DEBUG = process.env.DEBUG ?? '*'\n }\n if (options.development) {\n process.env.SHOPIFY_CLI_ENV = process.env.SHOPIFY_CLI_ENV ?? 'development'\n }\n}\n\nfunction forceNoColor() {\n if (\n process.argv.includes('--no-color') ||\n isTruthy(process.env.NO_COLOR) ||\n isTruthy(process.env.SHOPIFY_FLAG_NO_COLOR) ||\n process.env.TERM === 'dumb'\n ) {\n process.env.FORCE_COLOR = '0'\n }\n}\n\n/**\n * A function that abstracts away setting up the environment and running\n * a CLI\n * @param options - Options.\n */\nexport async function runCLI(options: RunCLIOptions): Promise<void> {\n setupEnvironmentVariables(options)\n forceNoColor()\n await warnIfOldNodeVersion()\n /**\n * These imports need to be dynamic because if they are static\n * they are loaded before we set the DEBUG=* environment variable\n * and therefore it has no effect.\n */\n const {errorHandler} = await import('./error-handler.js')\n const {isDevelopment} = await import('./context/local.js')\n const oclif = await import('@oclif/core')\n const {ShopifyConfig} = await import('./custom-oclif-loader.js')\n\n if (isDevelopment()) {\n oclif.default.settings.debug = true\n }\n\n try {\n // Use a custom OCLIF config to customize the behavior of the CLI\n const config = new ShopifyConfig({root: fileURLToPath(options.moduleURL)})\n await config.load()\n\n await oclif.default.run(undefined, config)\n await oclif.default.flush()\n printEventsJson()\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (error) {\n await errorHandler(error as Error)\n return oclif.default.Errors.handle(error as Error)\n }\n}\n\n/**\n * A function for create-x CLIs that automatically runs the \"init\" command.\n */\nexport async function runCreateCLI(options: RunCLIOptions): Promise<void> {\n setupEnvironmentVariables(options)\n\n const {findUpAndReadPackageJson} = await import('./node-package-manager.js')\n const {moduleDirectory} = await import('./path.js')\n\n const packageJson = await findUpAndReadPackageJson(moduleDirectory(options.moduleURL))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const packageName = (packageJson.content as any).name as string\n const name = packageName.replace('@shopify/create-', '')\n const initIndex = process.argv.findIndex((arg) => arg.includes('init'))\n if (initIndex === -1) {\n const initIndex =\n process.argv.findIndex((arg) => arg.match(new RegExp(`bin(\\\\/|\\\\\\\\)+(create-${name}|dev|run)`))) + 1\n process.argv.splice(initIndex, 0, 'init')\n }\n await runCLI(options)\n}\n\nexport async function useLocalCLIIfDetected(filepath: string): Promise<boolean> {\n const {environmentVariables} = await import('../../private/node/constants.js')\n const {joinPath: join} = await import('./path.js')\n const {exec} = await import('./system.js')\n\n // Temporary flag while we test out this feature and ensure it won't break anything!\n if (!isTruthy(process.env[environmentVariables.enableCliRedirect])) return false\n\n // Setting an env variable in the child process prevents accidental recursion.\n if (isTruthy(process.env[environmentVariables.skipCliRedirect])) return false\n\n // If already running via package manager, we can assume it's running correctly already.\n if (process.env.npm_config_user_agent) return false\n\n const cliPackage = await localCliPackage()\n if (!cliPackage) return false\n\n const correctExecutablePath = join(cliPackage.path, cliPackage.bin.shopify)\n if (correctExecutablePath === filepath) return false\n try {\n await exec(correctExecutablePath, process.argv.slice(2, process.argv.length), {\n stdio: 'inherit',\n env: {[environmentVariables.skipCliRedirect]: '1'},\n })\n // eslint-disable-next-line no-catch-all/no-catch-all, @typescript-eslint/no-explicit-any\n } catch (processError: any) {\n process.exit(processError.exitCode)\n }\n return true\n}\n\ninterface CliPackageInfo {\n path: string\n bin: {shopify: string}\n}\n\ninterface PackageJSON {\n dependencies?: {[packageName: string]: CliPackageInfo}\n devDependencies?: {[packageName: string]: CliPackageInfo}\n peerDependencies?: {[packageName: string]: CliPackageInfo}\n}\n\nexport async function localCliPackage(): Promise<CliPackageInfo | undefined> {\n const {captureOutput} = await import('./system.js')\n\n let npmListOutput = ''\n let localShopifyCLI: PackageJSON = {}\n try {\n npmListOutput = await captureOutput('npm', ['list', '@shopify/cli', '--json', '-l'])\n localShopifyCLI = JSON.parse(npmListOutput)\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (err) {\n return\n }\n const dependenciesList = {\n ...localShopifyCLI.peerDependencies,\n ...localShopifyCLI.devDependencies,\n ...localShopifyCLI.dependencies,\n }\n return dependenciesList['@shopify/cli']\n}\n\n/**\n * An object that contains the flags that\n * are shared across all the commands.\n */\nexport const globalFlags = {\n 'no-color': Flags.boolean({\n hidden: false,\n description: 'Disable color output.',\n env: 'SHOPIFY_FLAG_NO_COLOR',\n }),\n verbose: Flags.boolean({\n hidden: false,\n description: 'Increase the verbosity of the output.',\n env: 'SHOPIFY_FLAG_VERBOSE',\n }),\n}\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/public/node/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,kCAAkC,CAAA;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAajC,KAAK,UAAU,oBAAoB,CAAC,WAAmC,OAAO,CAAC,QAAQ;IACrF,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAA;IACjC,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAE1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AI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;KAClC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAAsB,EACtB,SAA0D,EAC1D,OAAiB,OAAO,CAAC,IAAI,EAC7B,MAAyB,OAAO,CAAC,GAAG,EACpC,WAAmC,OAAO,CAAC,QAAQ;IAEnD,OAAO,MAAM,CAAC,EAAC,GAAG,OAAO,EAAE,eAAe,EAAE,IAAI,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;AACpF,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC;QACxB,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,uBAAuB;QACpC,GAAG,EAAE,uBAAuB;KAC7B,CAAC;IACF,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;QACrB,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,uCAAuC;QACpD,GAAG,EAAE,sBAAsB;KAC5B,CAAC;CACH,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC;QAClB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,4BAA4B;QACzC,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,KAAK;QACd,GAAG,EAAE,oBAAoB,CAAC,IAAI;KAC/B,CAAC;CACH,CAAA;AAED;;GAEG;AACH,MAAM,UAAU,UAAU;IACxB,UAAU,EAAE,CAAA;AACd,CAAC","sourcesContent":["import {isTruthy} from './context/utilities.js'\nimport {cacheClear} from '../../private/node/conf-store.js'\nimport {environmentVariables} from '../../private/node/constants.js'\nimport {Flags} from '@oclif/core'\n\n/**\n * IMPORTANT NOTE: Imports in this module are dynamic to ensure that \"setupEnvironmentVariables\" can dynamically\n * set the DEBUG environment variable before the 'debug' package sets up its configuration when modules\n * are loaded statically.\n */\ninterface RunCLIOptions {\n /** The value of import.meta.url of the CLI executable module */\n moduleURL: string\n development: boolean\n}\n\nasync function warnIfOldNodeVersion(versions: NodeJS.ProcessVersions = process.versions) {\n const nodeVersion = versions.node\n const nodeMajorVersion = Number(nodeVersion.split('.')[0])\n\n const currentSupportedNodeVersion = 18\n if (nodeMajorVersion < currentSupportedNodeVersion) {\n const {renderWarning} = await import('./ui.js')\n renderWarning({\n headline: 'Upgrade to a supported Node version now.',\n body: [\n `Node ${nodeMajorVersion} has reached end-of-life and poses security risks. When you upgrade to a`,\n {\n link: {\n url: 'https://nodejs.dev/en/about/previous-releases',\n label: 'supported version',\n },\n },\n {char: ','},\n \"you'll be able to use Shopify CLI without interruption.\",\n ],\n })\n }\n}\n\nfunction setupEnvironmentVariables(\n options: Pick<RunCLIOptions, 'development'>,\n argv: string[] = process.argv,\n env: NodeJS.ProcessEnv = process.env,\n) {\n /**\n * By setting DEBUG=* when --verbose is passed we are increasing the\n * verbosity of oclif. Oclif uses debug (https://www.npmjs.com/package/debug)\n * for logging, and it's configured through the DEBUG= environment variable.\n */\n if (argv.includes('--verbose')) {\n env.DEBUG = env.DEBUG ?? '*'\n }\n if (options.development) {\n env.SHOPIFY_CLI_ENV = env.SHOPIFY_CLI_ENV ?? 'development'\n }\n}\n\nfunction forceNoColor(argv: string[] = process.argv, env: NodeJS.ProcessEnv = process.env) {\n if (\n argv.includes('--no-color') ||\n isTruthy(env.NO_COLOR) ||\n isTruthy(env.SHOPIFY_FLAG_NO_COLOR) ||\n env.TERM === 'dumb'\n ) {\n env.FORCE_COLOR = '0'\n }\n}\n\n/**\n * A function that abstracts away setting up the environment and running\n * a CLI\n * @param options - Options.\n */\nexport async function runCLI(\n options: RunCLIOptions & {runInCreateMode?: boolean},\n launchCLI: (options: {moduleURL: string}) => Promise<void>,\n argv: string[] = process.argv,\n env: NodeJS.ProcessEnv = process.env,\n versions: NodeJS.ProcessVersions = process.versions,\n): Promise<void> {\n setupEnvironmentVariables(options, argv, env)\n if (options.runInCreateMode) {\n await addInitToArgvWhenRunningCreateCLI(options, argv)\n }\n forceNoColor(argv, env)\n await warnIfOldNodeVersion(versions)\n return launchCLI({moduleURL: options.moduleURL})\n}\n\nasync function addInitToArgvWhenRunningCreateCLI(\n options: Pick<RunCLIOptions, 'moduleURL'>,\n argv: string[] = process.argv,\n): Promise<void> {\n const {findUpAndReadPackageJson} = await import('./node-package-manager.js')\n const {moduleDirectory} = await import('./path.js')\n\n const packageJson = await findUpAndReadPackageJson(moduleDirectory(options.moduleURL))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const packageName = (packageJson.content as any).name as string\n const name = packageName.replace('@shopify/create-', '')\n const initIndex = argv.findIndex((arg) => arg.includes('init'))\n if (initIndex === -1) {\n const initIndex = argv.findIndex((arg) => arg.match(new RegExp(`bin(\\\\/|\\\\\\\\)+(create-${name}|dev|run)`))) + 1\n argv.splice(initIndex, 0, 'init')\n }\n}\n\n/**\n * A function for create-x CLIs that automatically runs the \"init\" command.\n */\nexport async function runCreateCLI(\n options: RunCLIOptions,\n launchCLI: (options: {moduleURL: string}) => Promise<void>,\n argv: string[] = process.argv,\n env: NodeJS.ProcessEnv = process.env,\n versions: NodeJS.ProcessVersions = process.versions,\n): Promise<void> {\n return runCLI({...options, runInCreateMode: true}, launchCLI, argv, env, versions)\n}\n\n/**\n * An object that contains the flags that\n * are shared across all the commands.\n */\nexport const globalFlags = {\n 'no-color': Flags.boolean({\n hidden: false,\n description: 'Disable color output.',\n env: 'SHOPIFY_FLAG_NO_COLOR',\n }),\n verbose: Flags.boolean({\n hidden: false,\n description: 'Increase the verbosity of the output.',\n env: 'SHOPIFY_FLAG_VERBOSE',\n }),\n}\n\nexport const jsonFlag = {\n json: Flags.boolean({\n char: 'j',\n description: 'Output the result as JSON.',\n hidden: false,\n default: false,\n env: environmentVariables.json,\n }),\n}\n\n/**\n * Clear the CLI cache, used to store some API responses and handle notifications status\n */\nexport function clearCache(): void {\n cacheClear()\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  import { spinFqdn } from './spin.js';
2
2
  import { AbortError } from '../error.js';
3
3
  import { serviceEnvironment } from '../../../private/node/context/service.js';
4
+ import { DevServer, DevServerCore } from '../vendor/dev_server/DevServer.js';
4
5
  export const CouldntObtainPartnersSpinFQDNError = new AbortError("Couldn't obtain the Spin FQDN for Partners when the CLI is not running from a Spin environment.");
5
6
  export const CouldntObtainIdentitySpinFQDNError = new AbortError("Couldn't obtain the Spin FQDN for Identity when the CLI is not running from a Spin environment.");
6
7
  export const CouldntObtainShopifySpinFQDNError = new AbortError("Couldn't obtain the Spin FQDN for Shopify when the CLI is not running from a Spin environment.");
@@ -15,7 +16,7 @@ export async function partnersFqdn() {
15
16
  const productionFqdn = 'partners.shopify.com';
16
17
  switch (environment) {
17
18
  case 'local':
18
- return 'partners.myshopify.io';
19
+ return new DevServer('partners').host();
19
20
  case 'spin':
20
21
  return `partners.${await spinFqdn()}`;
21
22
  default:
@@ -32,7 +33,7 @@ export async function appManagementFqdn() {
32
33
  const productionFqdn = 'app.shopify.com';
33
34
  switch (environment) {
34
35
  case 'local':
35
- return 'app.shopify.myshopify.io';
36
+ return new DevServerCore().host('app');
36
37
  case 'spin':
37
38
  return `app.shopify.${await spinFqdn()}`;
38
39
  default:
@@ -49,7 +50,7 @@ export async function developerDashboardFqdn() {
49
50
  const productionFqdn = 'dev.shopify.com';
50
51
  switch (environment) {
51
52
  case 'local':
52
- return 'dev.shopify.myshopify.io';
53
+ return new DevServerCore().host('dev');
53
54
  case 'spin':
54
55
  return `dev.shopify.${await spinFqdn()}`;
55
56
  default:
@@ -66,7 +67,7 @@ export async function businessPlatformFqdn() {
66
67
  const productionFqdn = 'destinations.shopifysvc.com';
67
68
  switch (environment) {
68
69
  case 'local':
69
- return 'business-platform.myshopify.io';
70
+ return new DevServer('business-platform').host();
70
71
  case 'spin':
71
72
  return `business-platform.${await spinFqdn()}`;
72
73
  default:
@@ -83,7 +84,7 @@ export async function identityFqdn() {
83
84
  const productionFqdn = 'accounts.shopify.com';
84
85
  switch (environment) {
85
86
  case 'local':
86
- return 'identity.myshopify.io';
87
+ return new DevServer('identity').host();
87
88
  case 'spin':
88
89
  return `identity.${await spinFqdn()}`;
89
90
  default:
@@ -103,14 +104,17 @@ export async function normalizeStoreFqdn(store) {
103
104
  const addDomain = async (storeFqdn) => {
104
105
  switch (serviceEnvironment()) {
105
106
  case 'local':
106
- return `${storeFqdn}.myshopify.io`;
107
+ return new DevServerCore().host(storeFqdn);
107
108
  case 'spin':
108
109
  return `${storeFqdn}.shopify.${await spinFqdn()}`;
109
110
  default:
110
111
  return `${storeFqdn}.myshopify.com`;
111
112
  }
112
113
  };
113
- const containDomain = (storeFqdn) => storeFqdn.includes('.myshopify.com') || storeFqdn.includes('spin.dev') || storeFqdn.includes('shopify.io');
114
+ const containDomain = (storeFqdn) => storeFqdn.includes('.myshopify.com') ||
115
+ storeFqdn.includes('spin.dev') ||
116
+ storeFqdn.includes('shopify.io') ||
117
+ storeFqdn.includes('.shop.dev');
114
118
  return containDomain(storeFqdn) ? storeFqdn : addDomain(storeFqdn);
115
119
  }
116
120
  //# sourceMappingURL=fqdn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fqdn.js","sourceRoot":"","sources":["../../../../src/public/node/context/fqdn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAClC,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAA;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,0CAA0C,CAAA;AAE3E,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,UAAU,CAC9D,iGAAiG,CAClG,CAAA;AACD,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAAI,UAAU,CAC9D,iGAAiG,CAClG,CAAA;AACD,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,UAAU,CAC7D,gGAAgG,CACjG,CAAA;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n} from './spin.js'\nimport {AbortError} from '../error.js'\nimport {serviceEnvironment} from '../../../private/node/context/service.js'\n\nexport const CouldntObtainPartnersSpinFQDNError = new AbortError(\n \"Couldn't obtain the Spin FQDN for Partners when the CLI is not running from a Spin environment.\",\n)\nexport const CouldntObtainIdentitySpinFQDNError = new AbortError(\n \"Couldn't obtain the Spin FQDN for Identity when the CLI is not running from a Spin environment.\",\n)\nexport const CouldntObtainShopifySpinFQDNError = new AbortError(\n \"Couldn't obtain the Spin FQDN for Shopify when the CLI is not running from a Spin environment.\",\n)\nexport const NotProvidedStoreFQDNError = new AbortError(\n \"Couldn't obtain the Shopify FQDN because the store FQDN was not provided.\",\n)\n\n/**\n * It returns the Partners' API service we should interact with.\n *\n * @returns Fully-qualified domain of the partners service we should interact with.\n */\nexport async function partnersFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'partners.shopify.com'\n switch (environment) {\n case 'local':\n return 'partners.myshopify.io'\n case 'spin':\n return `partners.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * It returns the App Management API service we should interact with.\n *\n * @returns Fully-qualified domain of the App Management service we should interact with.\n */\nexport async function appManagementFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'app.shopify.com'\n switch (environment) {\n case 'local':\n return 'app.shopify.myshopify.io'\n case 'spin':\n return `app.shopify.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * It returns the Developer Dashboard domain we should interact with.\n *\n * @returns Fully-qualified domain of the Developer Dashboard we should interact with.\n */\nexport async function developerDashboardFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'dev.shopify.com'\n switch (environment) {\n case 'local':\n return 'dev.shopify.myshopify.io'\n case 'spin':\n return `dev.shopify.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * It returns the BusinessPlatform' API service we should interact with.\n *\n * @returns Fully-qualified domain of the partners service we should interact with.\n */\nexport async function businessPlatformFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'destinations.shopifysvc.com'\n switch (environment) {\n case 'local':\n return 'business-platform.myshopify.io'\n case 'spin':\n return `business-platform.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * It returns the Identity service we should interact with.\n *\n * @returns Fully-qualified domain of the Identity service we should interact with.\n */\nexport async function identityFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'accounts.shopify.com'\n switch (environment) {\n case 'local':\n return 'identity.myshopify.io'\n case 'spin':\n return `identity.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * Normalize the store name to be used in the CLI.\n * It will add the .myshopify.com domain if it's not present.\n * It will add the spin domain if it's not present and we're in a Spin environment.\n *\n * @param store - Store name.\n * @returns Normalized store name.\n */\nexport async function normalizeStoreFqdn(store: string): Promise<string> {\n const storeFqdn = store.replace(/^https?:\\/\\//, '').replace(/\\/$/, '')\n const addDomain = async (storeFqdn: string) => {\n switch (serviceEnvironment()) {\n case 'local':\n return `${storeFqdn}.myshopify.io`\n case 'spin':\n return `${storeFqdn}.shopify.${await spinFqdn()}`\n default:\n return `${storeFqdn}.myshopify.com`\n }\n }\n const containDomain = (storeFqdn: string) =>\n storeFqdn.includes('.myshopify.com') || storeFqdn.includes('spin.dev') || storeFqdn.includes('shopify.io')\n return containDomain(storeFqdn) ? storeFqdn : addDomain(storeFqdn)\n}\n"]}
1
+ {"version":3,"file":"fqdn.js","sourceRoot":"","sources":["../../../../src/public/node/context/fqdn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAClC,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAA;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,0CAA0C,CAAA;AAC3E,OAAO,EAAC,SAAS,EAAE,aAAa,EAAC,MAAM,mCAAmC,CAAA;AAE1E,MAAM,CAAC,MAAM,kCAAkC,GAAG,IAA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M,QAAQ,EAAE,EAAE,CAAA;YACnD;gBACE,OAAO,GAAG,SAAS,gBAAgB,CAAA;SACtC;IACH,CAAC,CAAA;IACD,MAAM,aAAa,GAAG,CAAC,SAAiB,EAAE,EAAE,CAC1C,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC;QACpC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC9B,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC;QAChC,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAA;IACjC,OAAO,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;AACpE,CAAC","sourcesContent":["import {spinFqdn} from './spin.js'\nimport {AbortError} from '../error.js'\nimport {serviceEnvironment} from '../../../private/node/context/service.js'\nimport {DevServer, DevServerCore} from '../vendor/dev_server/DevServer.js'\n\nexport const CouldntObtainPartnersSpinFQDNError = new AbortError(\n \"Couldn't obtain the Spin FQDN for Partners when the CLI is not running from a Spin environment.\",\n)\nexport const CouldntObtainIdentitySpinFQDNError = new AbortError(\n \"Couldn't obtain the Spin FQDN for Identity when the CLI is not running from a Spin environment.\",\n)\nexport const CouldntObtainShopifySpinFQDNError = new AbortError(\n \"Couldn't obtain the Spin FQDN for Shopify when the CLI is not running from a Spin environment.\",\n)\nexport const NotProvidedStoreFQDNError = new AbortError(\n \"Couldn't obtain the Shopify FQDN because the store FQDN was not provided.\",\n)\n\n/**\n * It returns the Partners' API service we should interact with.\n *\n * @returns Fully-qualified domain of the partners service we should interact with.\n */\nexport async function partnersFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'partners.shopify.com'\n switch (environment) {\n case 'local':\n return new DevServer('partners').host()\n case 'spin':\n return `partners.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * It returns the App Management API service we should interact with.\n *\n * @returns Fully-qualified domain of the App Management service we should interact with.\n */\nexport async function appManagementFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'app.shopify.com'\n switch (environment) {\n case 'local':\n return new DevServerCore().host('app')\n case 'spin':\n return `app.shopify.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * It returns the Developer Dashboard domain we should interact with.\n *\n * @returns Fully-qualified domain of the Developer Dashboard we should interact with.\n */\nexport async function developerDashboardFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'dev.shopify.com'\n switch (environment) {\n case 'local':\n return new DevServerCore().host('dev')\n case 'spin':\n return `dev.shopify.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * It returns the BusinessPlatform' API service we should interact with.\n *\n * @returns Fully-qualified domain of the partners service we should interact with.\n */\nexport async function businessPlatformFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'destinations.shopifysvc.com'\n switch (environment) {\n case 'local':\n return new DevServer('business-platform').host()\n case 'spin':\n return `business-platform.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * It returns the Identity service we should interact with.\n *\n * @returns Fully-qualified domain of the Identity service we should interact with.\n */\nexport async function identityFqdn(): Promise<string> {\n const environment = serviceEnvironment()\n const productionFqdn = 'accounts.shopify.com'\n switch (environment) {\n case 'local':\n return new DevServer('identity').host()\n case 'spin':\n return `identity.${await spinFqdn()}`\n default:\n return productionFqdn\n }\n}\n\n/**\n * Normalize the store name to be used in the CLI.\n * It will add the .myshopify.com domain if it's not present.\n * It will add the spin domain if it's not present and we're in a Spin environment.\n *\n * @param store - Store name.\n * @returns Normalized store name.\n */\nexport async function normalizeStoreFqdn(store: string): Promise<string> {\n const storeFqdn = store.replace(/^https?:\\/\\//, '').replace(/\\/$/, '')\n const addDomain = async (storeFqdn: string) => {\n switch (serviceEnvironment()) {\n case 'local':\n return new DevServerCore().host(storeFqdn)\n case 'spin':\n return `${storeFqdn}.shopify.${await spinFqdn()}`\n default:\n return `${storeFqdn}.myshopify.com`\n }\n }\n const containDomain = (storeFqdn: string) =>\n storeFqdn.includes('.myshopify.com') ||\n storeFqdn.includes('spin.dev') ||\n storeFqdn.includes('shopify.io') ||\n storeFqdn.includes('.shop.dev')\n return containDomain(storeFqdn) ? storeFqdn : addDomain(storeFqdn)\n}\n"]}
@@ -26,6 +26,13 @@ export declare function isDevelopment(env?: NodeJS.ProcessEnv): boolean;
26
26
  * @returns True if SHOPIFY_FLAG_VERBOSE is truthy or the flag --verbose has been passed.
27
27
  */
28
28
  export declare function isVerbose(env?: NodeJS.ProcessEnv): boolean;
29
+ /**
30
+ * It returns true if the App Management API is available.
31
+ *
32
+ * @param env - The environment variables from the environment of the current process.
33
+ * @returns True if the App Management API is available.
34
+ */
35
+ export declare function isAppManagementEnabled(env?: NodeJS.ProcessEnv): boolean;
29
36
  /**
30
37
  * Returns true if the environment in which the CLI is running is either
31
38
  * a local environment (where dev is present) or a cloud environment (spin).
@@ -41,6 +41,15 @@ export function isDevelopment(env = process.env) {
41
41
  export function isVerbose(env = process.env) {
42
42
  return isTruthy(env[environmentVariables.verbose]) || process.argv.includes('--verbose');
43
43
  }
44
+ /**
45
+ * It returns true if the App Management API is available.
46
+ *
47
+ * @param env - The environment variables from the environment of the current process.
48
+ * @returns True if the App Management API is available.
49
+ */
50
+ export function isAppManagementEnabled(env = process.env) {
51
+ return isTruthy(env[environmentVariables.useAppManagement]);
52
+ }
44
53
  /**
45
54
  * Returns true if the environment in which the CLI is running is either
46
55
  * a local environment (where dev is present) or a cloud environment (spin).
@@ -235,6 +244,13 @@ export function ciPlatform(env = process.env) {
235
244
  metadata: getCIMetadata(name, env),
236
245
  };
237
246
  }
247
+ else if (isTruthy(env.TF_BUILD)) {
248
+ return {
249
+ isCI: true,
250
+ name: 'azure',
251
+ metadata: getCIMetadata('azure', env),
252
+ };
253
+ }
238
254
  return {
239
255
  isCI: false,
240
256
  };
@@ -1 +1 @@
1
- {"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../src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AG,CAAC,SAAS,CAAC,EAAE;YAC/B,IAAI,GAAG,WAAW,CAAA;SACnB;QAED,OAAO;YACL,IAAI,EAAE,IAAI;YACV,IAAI;YACJ,QAAQ,EAAE,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC;SACnC,CAAA;KACF;IACD,OAAO;QACL,IAAI,EAAE,KAAK;KACZ,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,UAAU,CAAC,GAAG,EAAE,CAAA;AACzB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;IACnD,IAAI,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE;QAC5C,OAAO,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;KACzC;IACD,OAAO,iDAAiD,CAAA;AAC1D,CAAC","sourcesContent":["import {isSpin} from './spin.js'\nimport {isTruthy} from './utilities.js'\nimport {getCIMetadata, isSet, Metadata} from '../../../private/node/context/utilities.js'\nimport {environmentVariables, pathConstants} from '../../../private/node/constants.js'\nimport {fileExists} from '../fs.js'\nimport {exec} from '../system.js'\nimport isInteractive from 'is-interactive'\nimport macaddress from 'macaddress'\nimport {homedir} from 'os'\n\n/**\n * It returns true if the terminal is interactive.\n *\n * @returns True if the terminal is interactive.\n */\nexport function isTerminalInteractive(): boolean {\n return isInteractive()\n}\n\n/**\n * Returns the path to the user's home directory.\n *\n * @returns The path to the user's home directory.\n */\nexport function homeDirectory(): string {\n return homedir()\n}\n\n/**\n * Returns true if the CLI is running in debug mode.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_ENV is development.\n */\nexport function isDevelopment(env = process.env): boolean {\n return env[environmentVariables.env] === 'development'\n}\n\n/**\n * Returns true if the CLI is running in verbose mode.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_FLAG_VERBOSE is truthy or the flag --verbose has been passed.\n */\nexport function isVerbose(env = process.env): boolean {\n return isTruthy(env[environmentVariables.verbose]) || process.argv.includes('--verbose')\n}\n\n/**\n * Returns true if the environment in which the CLI is running is either\n * a local environment (where dev is present) or a cloud environment (spin).\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the CLI is used in a Shopify environment.\n */\nexport async function isShopify(env = process.env): Promise<boolean> {\n if (Object.prototype.hasOwnProperty.call(env, environmentVariables.runAsUser)) {\n return !isTruthy(env[environmentVariables.runAsUser])\n }\n const devInstalled = await fileExists(pathConstants.executables.dev)\n return devInstalled || isSpin(env)\n}\n\n/**\n * This variable is used when running unit tests to indicate that the CLI's business logic\n * is run as a subject of a unit test. We can use this variable to disable output through\n * the standard streams.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the SHOPIFY_UNIT_TEST environment variable is truthy.\n */\nexport function isUnitTest(env = process.env): boolean {\n return isTruthy(env[environmentVariables.unitTest])\n}\n\n/**\n * Returns true if reporting analytics is enabled.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True unless SHOPIFY_CLI_NO_ANALYTICS is truthy or debug mode is enabled.\n */\nexport function analyticsDisabled(env = process.env): boolean {\n return isTruthy(env[environmentVariables.noAnalytics]) || isDevelopment(env)\n}\n\n/**\n * Returns true if reporting analytics should always happen, regardless of DEBUG mode etc.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_ALWAYS_LOG_ANALYTICS is truthy.\n */\nexport function alwaysLogAnalytics(env = process.env): boolean {\n return isTruthy(env[environmentVariables.alwaysLogAnalytics])\n}\n\n/**\n * Returns true if reporting metrics should always happen, regardless of DEBUG mode etc.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_ALWAYS_LOG_METRICS is truthy.\n */\nexport function alwaysLogMetrics(env = process.env): boolean {\n return isTruthy(env[environmentVariables.alwaysLogMetrics])\n}\n\n/**\n * Returns true if the CLI User is 1P.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_1P is truthy.\n */\nexport function firstPartyDev(env = process.env): boolean {\n return isTruthy(env[environmentVariables.firstPartyDev])\n}\n\n/**\n * Returns true if the CLI should use theme bundling.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns False if SHOPIFY_CLI_NO_THEME_BUNDLING is truthy.\n */\nexport function useThemebundling(env = process.env): boolean {\n return !isTruthy(env[environmentVariables.noThemeBundling])\n}\n\n/**\n * Returns true if the embedded CLI will be used for theme commands.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns False if SHOPIFY_CLI_BUNDLED_THEME_CLI is truthy.\n */\nexport function useEmbeddedThemeCLI(env = process.env): boolean {\n return !isTruthy(env[environmentVariables.bundledThemeCLI])\n}\n\n/**\n * Return gitpodURL if we are running in gitpod.\n * Https://www.gitpod.io/docs/environment-variables#default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The gitpod URL.\n */\nexport function gitpodURL(env = process.env): string | undefined {\n return env[environmentVariables.gitpod]\n}\n\n/**\n * Return codespaceURL if we are running in codespaces.\n * Https://docs.github.com/en/codespaces/developing-in-codespaces/default-environment-variables-for-your-codespace#list-of-default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The codespace URL.\n */\nexport function codespaceURL(env = process.env): string | undefined {\n return env[environmentVariables.codespaceName]\n}\n\n/**\n * Return codespacePortForwardingDomain if we are running in codespaces.\n * Https://docs.github.com/en/codespaces/developing-in-codespaces/default-environment-variables-for-your-codespace#list-of-default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The codespace port forwarding domain.\n */\nexport function codespacePortForwardingDomain(env = process.env): string | undefined {\n return env[environmentVariables.codespacePortForwardingDomain]\n}\n\n/**\n * Checks if the CLI is run from a cloud environment.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns True in case the CLI is run from a cloud environment.\n */\nexport function isCloudEnvironment(env: NodeJS.ProcessEnv = process.env): boolean {\n return cloudEnvironment(env).platform !== 'localhost'\n}\n\n/**\n * The token used to run a theme command with a custom password.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns A string with the token.\n */\nexport function themeToken(env = process.env): string | undefined {\n return env[environmentVariables.themeToken]\n}\n\n/**\n * Returns the cloud environment platform name and if the platform support online IDE in case the CLI is run from one of\n * them. Platform name 'localhost' is returned otherwise.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns Cloud platform information.\n */\nexport function cloudEnvironment(env: NodeJS.ProcessEnv = process.env): {\n platform: 'spin' | 'codespaces' | 'gitpod' | 'cloudShell' | 'localhost'\n editor: boolean\n} {\n if (isSet(env[environmentVariables.codespaces])) {\n return {platform: 'codespaces', editor: true}\n }\n if (isSet(env[environmentVariables.gitpod])) {\n return {platform: 'gitpod', editor: true}\n }\n if (isSet(env[environmentVariables.cloudShell])) {\n return {platform: 'cloudShell', editor: true}\n }\n if (isSpin(env)) {\n return {platform: 'spin', editor: false}\n }\n return {platform: 'localhost', editor: false}\n}\n\n/**\n * Returns whether the environment has Git available.\n *\n * @returns A promise that resolves with the value.\n */\nexport async function hasGit(): Promise<boolean> {\n try {\n await exec('git', ['--version'])\n return true\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch {\n return false\n }\n}\n\n/**\n * Gets info on the CI platform the CLI is running on, if applicable.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The CI platform info.\n */\nexport function ciPlatform(\n env = process.env,\n): {isCI: true; name: string; metadata: Metadata} | {isCI: false; name?: undefined; metadata?: undefined} {\n if (isTruthy(env.CI)) {\n let name = 'unknown'\n if (isSet(env.BITBUCKET_BUILD_NUMBER)) {\n name = 'bitbucket'\n } else if (isTruthy(env.CIRCLECI)) {\n name = 'circleci'\n } else if (isSet(env.GITHUB_ACTION)) {\n name = 'github'\n } else if (isTruthy(env.GITLAB_CI)) {\n name = 'gitlab'\n } else if (isSet(env.BUILDKITE)) {\n name = 'buildkite'\n }\n\n return {\n isCI: true,\n name,\n metadata: getCIMetadata(name, env),\n }\n }\n return {\n isCI: false,\n }\n}\n\n/**\n * Returns the first mac address found.\n *\n * @returns Mac address.\n */\nexport function macAddress(): Promise<string> {\n return macaddress.one()\n}\n\n/**\n * Get the domain to send OTEL metrics to.\n *\n * It can be overridden via the SHOPIFY_CLI_OTEL_EXPORTER_OTLP_ENDPOINT environment variable.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The domain to send OTEL metrics to.\n */\nexport function opentelemetryDomain(env = process.env): string | undefined {\n if (isSet(env[environmentVariables.otelURL])) {\n return env[environmentVariables.otelURL]\n }\n return 'https://otlp-http-production-cli.shopifysvc.com'\n}\n\nexport type CIMetadata = Metadata\n"]}
1
+ {"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../src/public/node/context/local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAA;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAC,aAAa,EAAE,KAAK,EAAW,MAAM,4CAA4C,CAAA;AACzF,OAAO,EAAC,oBAAoB,EAAE,aAAa,EAAC,MAAM,oCAAoC,CAAA;AACtF,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAA;AACnC,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAA;AACjC,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAC1C,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAC,OAAO,EAAC,MAAM,IAAI,CAAA;AAE1B;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,aAAa,EAAE,CAAA;AACxB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,EAAE,CAAA;AAClB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;IAC7C,OAAO,GAAG,CAAC,oBAAoB,CAAC,GAAG,C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IACnD,IAAI,KAAK,CAAC,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAAE;QAC5C,OAAO,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;KACzC;IACD,OAAO,iDAAiD,CAAA;AAC1D,CAAC","sourcesContent":["import {isSpin} from './spin.js'\nimport {isTruthy} from './utilities.js'\nimport {getCIMetadata, isSet, Metadata} from '../../../private/node/context/utilities.js'\nimport {environmentVariables, pathConstants} from '../../../private/node/constants.js'\nimport {fileExists} from '../fs.js'\nimport {exec} from '../system.js'\nimport isInteractive from 'is-interactive'\nimport macaddress from 'macaddress'\nimport {homedir} from 'os'\n\n/**\n * It returns true if the terminal is interactive.\n *\n * @returns True if the terminal is interactive.\n */\nexport function isTerminalInteractive(): boolean {\n return isInteractive()\n}\n\n/**\n * Returns the path to the user's home directory.\n *\n * @returns The path to the user's home directory.\n */\nexport function homeDirectory(): string {\n return homedir()\n}\n\n/**\n * Returns true if the CLI is running in debug mode.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_ENV is development.\n */\nexport function isDevelopment(env = process.env): boolean {\n return env[environmentVariables.env] === 'development'\n}\n\n/**\n * Returns true if the CLI is running in verbose mode.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_FLAG_VERBOSE is truthy or the flag --verbose has been passed.\n */\nexport function isVerbose(env = process.env): boolean {\n return isTruthy(env[environmentVariables.verbose]) || process.argv.includes('--verbose')\n}\n\n/**\n * It returns true if the App Management API is available.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the App Management API is available.\n */\nexport function isAppManagementEnabled(env = process.env): boolean {\n return isTruthy(env[environmentVariables.useAppManagement])\n}\n\n/**\n * Returns true if the environment in which the CLI is running is either\n * a local environment (where dev is present) or a cloud environment (spin).\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the CLI is used in a Shopify environment.\n */\nexport async function isShopify(env = process.env): Promise<boolean> {\n if (Object.prototype.hasOwnProperty.call(env, environmentVariables.runAsUser)) {\n return !isTruthy(env[environmentVariables.runAsUser])\n }\n const devInstalled = await fileExists(pathConstants.executables.dev)\n return devInstalled || isSpin(env)\n}\n\n/**\n * This variable is used when running unit tests to indicate that the CLI's business logic\n * is run as a subject of a unit test. We can use this variable to disable output through\n * the standard streams.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the SHOPIFY_UNIT_TEST environment variable is truthy.\n */\nexport function isUnitTest(env = process.env): boolean {\n return isTruthy(env[environmentVariables.unitTest])\n}\n\n/**\n * Returns true if reporting analytics is enabled.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True unless SHOPIFY_CLI_NO_ANALYTICS is truthy or debug mode is enabled.\n */\nexport function analyticsDisabled(env = process.env): boolean {\n return isTruthy(env[environmentVariables.noAnalytics]) || isDevelopment(env)\n}\n\n/**\n * Returns true if reporting analytics should always happen, regardless of DEBUG mode etc.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_ALWAYS_LOG_ANALYTICS is truthy.\n */\nexport function alwaysLogAnalytics(env = process.env): boolean {\n return isTruthy(env[environmentVariables.alwaysLogAnalytics])\n}\n\n/**\n * Returns true if reporting metrics should always happen, regardless of DEBUG mode etc.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_ALWAYS_LOG_METRICS is truthy.\n */\nexport function alwaysLogMetrics(env = process.env): boolean {\n return isTruthy(env[environmentVariables.alwaysLogMetrics])\n}\n\n/**\n * Returns true if the CLI User is 1P.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_1P is truthy.\n */\nexport function firstPartyDev(env = process.env): boolean {\n return isTruthy(env[environmentVariables.firstPartyDev])\n}\n\n/**\n * Returns true if the CLI should use theme bundling.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns False if SHOPIFY_CLI_NO_THEME_BUNDLING is truthy.\n */\nexport function useThemebundling(env = process.env): boolean {\n return !isTruthy(env[environmentVariables.noThemeBundling])\n}\n\n/**\n * Returns true if the embedded CLI will be used for theme commands.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns False if SHOPIFY_CLI_BUNDLED_THEME_CLI is truthy.\n */\nexport function useEmbeddedThemeCLI(env = process.env): boolean {\n return !isTruthy(env[environmentVariables.bundledThemeCLI])\n}\n\n/**\n * Return gitpodURL if we are running in gitpod.\n * Https://www.gitpod.io/docs/environment-variables#default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The gitpod URL.\n */\nexport function gitpodURL(env = process.env): string | undefined {\n return env[environmentVariables.gitpod]\n}\n\n/**\n * Return codespaceURL if we are running in codespaces.\n * Https://docs.github.com/en/codespaces/developing-in-codespaces/default-environment-variables-for-your-codespace#list-of-default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The codespace URL.\n */\nexport function codespaceURL(env = process.env): string | undefined {\n return env[environmentVariables.codespaceName]\n}\n\n/**\n * Return codespacePortForwardingDomain if we are running in codespaces.\n * Https://docs.github.com/en/codespaces/developing-in-codespaces/default-environment-variables-for-your-codespace#list-of-default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The codespace port forwarding domain.\n */\nexport function codespacePortForwardingDomain(env = process.env): string | undefined {\n return env[environmentVariables.codespacePortForwardingDomain]\n}\n\n/**\n * Checks if the CLI is run from a cloud environment.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns True in case the CLI is run from a cloud environment.\n */\nexport function isCloudEnvironment(env: NodeJS.ProcessEnv = process.env): boolean {\n return cloudEnvironment(env).platform !== 'localhost'\n}\n\n/**\n * The token used to run a theme command with a custom password.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns A string with the token.\n */\nexport function themeToken(env = process.env): string | undefined {\n return env[environmentVariables.themeToken]\n}\n\n/**\n * Returns the cloud environment platform name and if the platform support online IDE in case the CLI is run from one of\n * them. Platform name 'localhost' is returned otherwise.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns Cloud platform information.\n */\nexport function cloudEnvironment(env: NodeJS.ProcessEnv = process.env): {\n platform: 'spin' | 'codespaces' | 'gitpod' | 'cloudShell' | 'localhost'\n editor: boolean\n} {\n if (isSet(env[environmentVariables.codespaces])) {\n return {platform: 'codespaces', editor: true}\n }\n if (isSet(env[environmentVariables.gitpod])) {\n return {platform: 'gitpod', editor: true}\n }\n if (isSet(env[environmentVariables.cloudShell])) {\n return {platform: 'cloudShell', editor: true}\n }\n if (isSpin(env)) {\n return {platform: 'spin', editor: false}\n }\n return {platform: 'localhost', editor: false}\n}\n\n/**\n * Returns whether the environment has Git available.\n *\n * @returns A promise that resolves with the value.\n */\nexport async function hasGit(): Promise<boolean> {\n try {\n await exec('git', ['--version'])\n return true\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch {\n return false\n }\n}\n\n/**\n * Gets info on the CI platform the CLI is running on, if applicable.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The CI platform info.\n */\nexport function ciPlatform(\n env = process.env,\n): {isCI: true; name: string; metadata: Metadata} | {isCI: false; name?: undefined; metadata?: undefined} {\n if (isTruthy(env.CI)) {\n let name = 'unknown'\n if (isSet(env.BITBUCKET_BUILD_NUMBER)) {\n name = 'bitbucket'\n } else if (isTruthy(env.CIRCLECI)) {\n name = 'circleci'\n } else if (isSet(env.GITHUB_ACTION)) {\n name = 'github'\n } else if (isTruthy(env.GITLAB_CI)) {\n name = 'gitlab'\n } else if (isSet(env.BUILDKITE)) {\n name = 'buildkite'\n }\n\n return {\n isCI: true,\n name,\n metadata: getCIMetadata(name, env),\n }\n } else if (isTruthy(env.TF_BUILD)) {\n return {\n isCI: true,\n name: 'azure',\n metadata: getCIMetadata('azure', env),\n }\n }\n return {\n isCI: false,\n }\n}\n\n/**\n * Returns the first mac address found.\n *\n * @returns Mac address.\n */\nexport function macAddress(): Promise<string> {\n return macaddress.one()\n}\n\n/**\n * Get the domain to send OTEL metrics to.\n *\n * It can be overridden via the SHOPIFY_CLI_OTEL_EXPORTER_OTLP_ENDPOINT environment variable.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The domain to send OTEL metrics to.\n */\nexport function opentelemetryDomain(env = process.env): string | undefined {\n if (isSet(env[environmentVariables.otelURL])) {\n return env[environmentVariables.otelURL]\n }\n return 'https://otlp-http-production-cli.shopifysvc.com'\n}\n\nexport type CIMetadata = Metadata\n"]}
@@ -44,3 +44,10 @@ export declare function getIdentityTokenInformation(): {
44
44
  refreshToken: string;
45
45
  userId: string;
46
46
  } | undefined;
47
+ /**
48
+ * Checks if the JSON output is enabled via flag (--json or -j) or environment variable (SHOPIFY_FLAG_JSON).
49
+ *
50
+ * @param environment - Process environment variables.
51
+ * @returns True if the JSON output is enabled, false otherwise.
52
+ */
53
+ export declare function jsonOutputEnabled(environment?: NodeJS.ProcessEnv): boolean;
@@ -1,4 +1,6 @@
1
1
  import { nonRandomUUID } from './crypto.js';
2
+ import { isTruthy } from './context/utilities.js';
3
+ import { sniffForJson } from './path.js';
2
4
  import { environmentVariables, systemEnvironmentVariables } from '../../private/node/constants.js';
3
5
  /**
4
6
  * It returns the environment variables of the environment
@@ -65,4 +67,13 @@ export function getIdentityTokenInformation() {
65
67
  userId: nonRandomUUID(identityToken),
66
68
  };
67
69
  }
70
+ /**
71
+ * Checks if the JSON output is enabled via flag (--json or -j) or environment variable (SHOPIFY_FLAG_JSON).
72
+ *
73
+ * @param environment - Process environment variables.
74
+ * @returns True if the JSON output is enabled, false otherwise.
75
+ */
76
+ export function jsonOutputEnabled(environment = getEnvironmentVariables()) {
77
+ return sniffForJson() || isTruthy(environment[environmentVariables.json]);
78
+ }
68
79
  //# sourceMappingURL=environment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/public/node/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAA;AACzC,OAAO,EAAC,oBAAoB,EAAE,0BAA0B,EAAC,MAAM,iCAAiC,CAAA;AAEhG;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,OAAO,CAAC,GAAG,CAAA;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,uBAAuB,EAAE,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAA;AACtE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,gBAAgB,EAAE,KAAK,SAAS,CAAA;AACzC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,uBAAuB,EAAE,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAA;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,WAAW,GAAG,uBAAuB,EAAE,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAA;IACrF,IAAI,WAAW,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE;QAC9C,OAAO,MAAM,CAAC,WAAW,CAAC,CAAA;KAC3B;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,2BAA2B;IACzC,MAAM,aAAa,GAAG,uBAAuB,EAAE,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAA;IACnF,MAAM,YAAY,GAAG,uBAAuB,EAAE,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAA;IACjF,IAAI,CAAC,aAAa,IAAI,CAAC,YAAY;QAAE,OAAO,SAAS,CAAA;IACrD,OAAO;QACL,WAAW,EAAE,aAAa;QAC1B,YAAY;QACZ,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC;KACrC,CAAA;AACH,CAAC","sourcesContent":["import {nonRandomUUID} from './crypto.js'\nimport {environmentVariables, systemEnvironmentVariables} from '../../private/node/constants.js'\n\n/**\n * It returns the environment variables of the environment\n * where the Node process is running.\n *\n * This function exists to prevent the access of the process\n * global variable which is discouraged via the no-process-env\n * ESLint rule.\n *\n * @returns Current process environment variables.\n */\nexport function getEnvironmentVariables(): NodeJS.ProcessEnv {\n return process.env\n}\n\n/**\n * Returns the value of the SHOPIFY_CLI_PARTNERS_TOKEN environment variable.\n *\n * @returns Current process environment variables.\n */\nexport function getPartnersToken(): string | undefined {\n return getEnvironmentVariables()[environmentVariables.partnersToken]\n}\n\n/**\n * Check if the current proccess is running using the partners token.\n *\n * @returns True if the current proccess is running using the partners token.\n */\nexport function usePartnersToken(): boolean {\n return getPartnersToken() !== undefined\n}\n\n/**\n * Returns the value of the organization id from the environment variables.\n *\n * @returns True if the current proccess is running using the partners token.\n */\nexport function getOrganization(): string | undefined {\n return getEnvironmentVariables()[environmentVariables.organization]\n}\n\n/**\n * Return the backend port value.\n *\n * @returns The port as a number. Undefined otherwise.\n */\nexport function getBackendPort(): number | undefined {\n const backendPort = getEnvironmentVariables()[systemEnvironmentVariables.backendPort]\n if (backendPort && !isNaN(Number(backendPort))) {\n return Number(backendPort)\n }\n return undefined\n}\n\n/**\n * Returns the information of the identity & refresh tokens, provided by environment variables.\n *\n * @returns The identity token information in case it exists.\n */\nexport function getIdentityTokenInformation(): {accessToken: string; refreshToken: string; userId: string} | undefined {\n const identityToken = getEnvironmentVariables()[environmentVariables.identityToken]\n const refreshToken = getEnvironmentVariables()[environmentVariables.refreshToken]\n if (!identityToken || !refreshToken) return undefined\n return {\n accessToken: identityToken,\n refreshToken,\n userId: nonRandomUUID(identityToken),\n }\n}\n"]}
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/public/node/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAA;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAA;AACtC,OAAO,EAAC,oBAAoB,EAAE,0BAA0B,EAAC,MAAM,iCAAiC,CAAA;AAEhG;;;;;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;AAC3E,CAAC","sourcesContent":["import {nonRandomUUID} from './crypto.js'\nimport {isTruthy} from './context/utilities.js'\nimport {sniffForJson} from './path.js'\nimport {environmentVariables, systemEnvironmentVariables} from '../../private/node/constants.js'\n\n/**\n * It returns the environment variables of the environment\n * where the Node process is running.\n *\n * This function exists to prevent the access of the process\n * global variable which is discouraged via the no-process-env\n * ESLint rule.\n *\n * @returns Current process environment variables.\n */\nexport function getEnvironmentVariables(): NodeJS.ProcessEnv {\n return process.env\n}\n\n/**\n * Returns the value of the SHOPIFY_CLI_PARTNERS_TOKEN environment variable.\n *\n * @returns Current process environment variables.\n */\nexport function getPartnersToken(): string | undefined {\n return getEnvironmentVariables()[environmentVariables.partnersToken]\n}\n\n/**\n * Check if the current proccess is running using the partners token.\n *\n * @returns True if the current proccess is running using the partners token.\n */\nexport function usePartnersToken(): boolean {\n return getPartnersToken() !== undefined\n}\n\n/**\n * Returns the value of the organization id from the environment variables.\n *\n * @returns True if the current proccess is running using the partners token.\n */\nexport function getOrganization(): string | undefined {\n return getEnvironmentVariables()[environmentVariables.organization]\n}\n\n/**\n * Return the backend port value.\n *\n * @returns The port as a number. Undefined otherwise.\n */\nexport function getBackendPort(): number | undefined {\n const backendPort = getEnvironmentVariables()[systemEnvironmentVariables.backendPort]\n if (backendPort && !isNaN(Number(backendPort))) {\n return Number(backendPort)\n }\n return undefined\n}\n\n/**\n * Returns the information of the identity & refresh tokens, provided by environment variables.\n *\n * @returns The identity token information in case it exists.\n */\nexport function getIdentityTokenInformation(): {accessToken: string; refreshToken: string; userId: string} | undefined {\n const identityToken = getEnvironmentVariables()[environmentVariables.identityToken]\n const refreshToken = getEnvironmentVariables()[environmentVariables.refreshToken]\n if (!identityToken || !refreshToken) return undefined\n return {\n accessToken: identityToken,\n refreshToken,\n userId: nonRandomUUID(identityToken),\n }\n}\n\n/**\n * Checks if the JSON output is enabled via flag (--json or -j) or environment variable (SHOPIFY_FLAG_JSON).\n *\n * @param environment - Process environment variables.\n * @returns True if the JSON output is enabled, false otherwise.\n */\nexport function jsonOutputEnabled(environment = getEnvironmentVariables()): boolean {\n return sniffForJson() || isTruthy(environment[environmentVariables.json])\n}\n"]}
@@ -6,7 +6,6 @@ import { AbortSilentError, CancelExecution, errorMapper, shouldReportErrorAsUnex
6
6
  import { getEnvironmentData } from '../../private/node/analytics.js';
7
7
  import { outputDebug, outputInfo } from '../../public/node/output.js';
8
8
  import { bugsnagApiKey, reportingRateLimit } from '../../private/node/constants.js';
9
- import { printEventsJson } from '../../private/node/demo-recorder.js';
10
9
  import { CLI_KIT_VERSION } from '../common/version.js';
11
10
  import { runWithRateLimit } from '../../private/node/conf-store.js';
12
11
  import { settings } from '@oclif/core';
@@ -20,7 +19,7 @@ export async function errorHandler(error, config) {
20
19
  }
21
20
  }
22
21
  else if (error instanceof AbortSilentError) {
23
- printEventsJson();
22
+ /* empty */
24
23
  }
25
24
  else {
26
25
  return errorMapper(error)
@@ -28,7 +27,6 @@ export async function errorHandler(error, config) {
28
27
  return handler(error);
29
28
  })
30
29
  .then((mappedError) => {
31
- printEventsJson();
32
30
  return reportError(mappedError, config);
33
31
  });
34
32
  }
@@ -194,7 +192,7 @@ export async function addBugsnagMetadata(event, config) {
194
192
  const miscData = {};
195
193
  const appKeys = ['api_key', 'partner_id', 'project_type'];
196
194
  const commandKeys = ['command'];
197
- const environmentKeys = ['cli_version', 'node_version', 'ruby_version', 'uname'];
195
+ const environmentKeys = ['cli_version', 'node_version', 'uname'];
198
196
  Object.entries(allMetadata).forEach(([key, value]) => {
199
197
  if (key.startsWith('app_') || appKeys.includes(key)) {
200
198
  appData[key] = value;
@@ -1 +1 @@
1
- {"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../../src/public/node/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,oBAAoB,EAAC,MAAM,gBAAgB,CAAA;AACpE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,C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js'\nimport * as path from './path.js'\nimport {fanoutHooks} from './plugins.js'\nimport * as metadata from './metadata.js'\nimport {\n AbortSilentError,\n CancelExecution,\n errorMapper,\n shouldReportErrorAsUnexpected,\n handler,\n cleanSingleStackTracePath,\n} from './error.js'\nimport {getEnvironmentData} from '../../private/node/analytics.js'\nimport {outputDebug, outputInfo} from '../../public/node/output.js'\nimport {bugsnagApiKey, reportingRateLimit} from '../../private/node/constants.js'\nimport {printEventsJson} from '../../private/node/demo-recorder.js'\nimport {CLI_KIT_VERSION} from '../common/version.js'\nimport {runWithRateLimit} from '../../private/node/conf-store.js'\nimport {settings, Interfaces} from '@oclif/core'\nimport StackTracey from 'stacktracey'\nimport Bugsnag, {Event} from '@bugsnag/js'\nimport {realpath} from 'fs/promises'\n\nexport async function errorHandler(\n error: Error & {exitCode?: number | undefined},\n config?: Interfaces.Config,\n): Promise<void> {\n if (error instanceof CancelExecution) {\n if (error.message && error.message !== '') {\n outputInfo(`✨ ${error.message}`)\n }\n } else if (error instanceof AbortSilentError) {\n printEventsJson()\n } else {\n return errorMapper(error)\n .then((error) => {\n return handler(error)\n })\n .then((mappedError) => {\n printEventsJson()\n return reportError(mappedError, config)\n })\n }\n}\n\nconst reportError = async (error: unknown, config?: Interfaces.Config): Promise<void> => {\n // categorise the error first\n let exitMode: CommandExitMode = 'expected_error'\n if (shouldReportErrorAsUnexpected(error)) exitMode = 'unexpected_error'\n\n if (config !== undefined) {\n // Log an analytics event when there's an error\n await reportAnalyticsEvent({config, errorMessage: error instanceof Error ? error.message : undefined, exitMode})\n }\n await sendErrorToBugsnag(error, exitMode)\n}\n\n/**\n * Sends an error to Bugsnag. This is configured automatically for uncaught errors from CLI commands, but can also be used to manually record an error.\n *\n * @returns the reported error (this may have been tweaked for better reporting), and a bool to indicate if the error was actually submitted or not\n */\nexport async function sendErrorToBugsnag(\n error: unknown,\n exitMode: Omit<CommandExitMode, 'ok'>,\n): Promise<{reported: false; error: unknown; unhandled: unknown} | {error: Error; reported: true; unhandled: boolean}> {\n if (settings.debug) {\n outputDebug(`Skipping Bugsnag report`)\n return {reported: false, error, unhandled: undefined}\n }\n\n // If the error was unexpected, we flag it as \"unhandled\" in Bugsnag. This is a helpful distinction.\n const unhandled = exitMode === 'unexpected_error'\n\n let reportableError: Error\n let stacktrace: string | undefined\n let report = false\n\n if (error instanceof Error) {\n report = true\n reportableError = new Error(error.message)\n stacktrace = error.stack\n\n /**\n * Some errors that reach this point have an empty string. For example:\n * https://app.bugsnag.com/shopify/cli/errors/62cd5d31fd5040000814086c?filters[event.since]=30d&filters[error.status]=new&filters[release.seen_in]=3.1.0\n *\n * Because at this point we have neither the error message nor a stack trace reporting them\n * to Bugsnag is pointless and adds noise.\n */\n } else if (typeof error === 'string' && error.trim().length !== 0) {\n report = true\n reportableError = new Error(error)\n stacktrace = reportableError.stack\n } else {\n report = false\n reportableError = new Error('Unknown error')\n }\n\n const formattedStacktrace = new StackTracey(stacktrace ?? '')\n .clean()\n .items.map((item) => {\n const filePath = cleanSingleStackTracePath(item.file)\n return ` at ${item.callee} (${filePath}:${item.line}:${item.column})`\n })\n .join('\\n')\n reportableError.stack = `Error: ${reportableError.message}\\n${formattedStacktrace}`\n\n let withinRateLimit = false\n await runWithRateLimit({\n key: 'send-error-to-bugsnag',\n ...reportingRateLimit,\n task: async () => {\n withinRateLimit = true\n },\n })\n if (!withinRateLimit) {\n outputDebug(`Skipping Bugsnag report due to rate limiting`)\n report = false\n }\n\n if (report) {\n initializeBugsnag()\n await new Promise((resolve, reject) => {\n outputDebug(`Reporting ${unhandled ? 'unhandled' : 'handled'} error to Bugsnag: ${reportableError.message}`)\n const eventHandler = (event: Event) => {\n event.severity = 'error'\n event.unhandled = unhandled\n }\n const errorHandler = (error: unknown) => {\n if (error) {\n reject(error)\n } else {\n resolve(reportableError)\n }\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n Bugsnag.notify(reportableError, eventHandler, errorHandler)\n })\n }\n return {error: reportableError, reported: report, unhandled}\n}\n\n/**\n * If the given file path is within a node_modules folder, remove prefix up\n * to and including the node_modules folder.\n *\n * This gives us very consistent paths for errors generated by the CLI.\n */\nexport function cleanStackFrameFilePath({\n currentFilePath,\n projectRoot,\n pluginLocations,\n}: {\n currentFilePath: string\n projectRoot: string\n pluginLocations: {name: string; pluginPath: string}[]\n}): string {\n const fullLocation = path.isAbsolutePath(currentFilePath)\n ? currentFilePath\n : path.joinPath(projectRoot, currentFilePath)\n\n const matchingPluginPath = pluginLocations.filter(({pluginPath}) => fullLocation.startsWith(pluginPath))[0]\n\n if (matchingPluginPath !== undefined) {\n // the plugin name (e.g. @shopify/cli-kit), plus the relative path of the error line from within the plugin's code (e.g. dist/something.js )\n return path.joinPath(matchingPluginPath.name, path.relativePath(matchingPluginPath.pluginPath, fullLocation))\n }\n\n // strip prefix up to node_modules folder, so we can normalize error reporting\n return currentFilePath.replace(/.*node_modules\\//, '')\n}\n\n/**\n * Register a Bugsnag error listener to clean up stack traces for errors within plugin code.\n *\n */\nexport async function registerCleanBugsnagErrorsFromWithinPlugins(config: Interfaces.Config): Promise<void> {\n // Bugsnag have their own plug-ins that use this private field\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const bugsnagConfigProjectRoot: string = (Bugsnag as any)?._client?._config?.projectRoot ?? path.cwd()\n const projectRoot = path.normalizePath(bugsnagConfigProjectRoot)\n const pluginLocations = await Promise.all(\n [...config.plugins].map(async ([_, plugin]) => {\n const followSymlinks = await realpath(plugin.root)\n return {name: plugin.name, pluginPath: path.normalizePath(followSymlinks)}\n }),\n )\n initializeBugsnag()\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n Bugsnag.addOnError(async (event) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n event.errors.forEach((error: any) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n error.stacktrace.forEach((stackFrame: any) => {\n stackFrame.file = cleanStackFrameFilePath({currentFilePath: stackFrame.file, projectRoot, pluginLocations})\n })\n })\n try {\n await addBugsnagMetadata(event, config)\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (metadataError) {\n outputDebug(`There was an error adding metadata to the Bugsnag report; Ignoring and carrying on ${metadataError}`)\n }\n })\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nexport async function addBugsnagMetadata(event: any, config: Interfaces.Config): Promise<void> {\n const publicData = metadata.getAllPublicMetadata()\n const {commandStartOptions} = metadata.getAllSensitiveMetadata()\n const {startCommand} = commandStartOptions ?? {}\n\n const {'@shopify/app': appPublic, ...otherPluginsPublic} = await fanoutHooks(config, 'public_command_metadata', {})\n\n const environment = await getEnvironmentData(config)\n\n const allMetadata = {\n command: startCommand,\n ...appPublic,\n ...publicData,\n ...environment,\n pluginData: otherPluginsPublic,\n }\n\n const appData = {} as {[key: string]: unknown}\n const commandData = {} as {[key: string]: unknown}\n const environmentData = {} as {[key: string]: unknown}\n const miscData = {} as {[key: string]: unknown}\n const appKeys = ['api_key', 'partner_id', 'project_type']\n const commandKeys = ['command']\n const environmentKeys = ['cli_version', 'node_version', 'ruby_version', 'uname']\n\n Object.entries(allMetadata).forEach(([key, value]) => {\n if (key.startsWith('app_') || appKeys.includes(key)) {\n appData[key] = value\n } else if (key.startsWith('cmd_') || commandKeys.includes(key)) {\n commandData[key] = value\n } else if (key.startsWith('env_') || environmentKeys) {\n environmentData[key] = value\n } else {\n miscData[key] = value\n }\n })\n\n // app, command, environment, misc\n const bugsnagMetadata = {\n 'Shopify App': appData,\n Command: commandData,\n Environment: environmentData,\n Misc: miscData,\n }\n Object.entries(bugsnagMetadata).forEach(([section, values]) => {\n event.addMetadata(section, values)\n })\n}\n\nfunction initializeBugsnag() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (Bugsnag.isStarted()) {\n return\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n Bugsnag.start({\n appType: 'node',\n apiKey: bugsnagApiKey,\n logger: null,\n appVersion: CLI_KIT_VERSION,\n autoTrackSessions: false,\n autoDetectErrors: false,\n enabledReleaseStages: ['production'],\n })\n}\n"]}
1
+ {"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../../src/public/node/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,oBAAoB,EAAC,MAAM,gBAAgB,CAAA;AACpE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAA;AACxC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,6BAA6B,EAC7B,OAAO,EACP,yBAAyB,GAC1B,MAAM,YAAY,CAAA;AACnB,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAA;AAClE,OAAO,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACnE,OAAO,EAAC,aAAa,EAAE,kBAAkB,EAAC,MAAM,iCAAiC,CAAA;AACjF,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAA;AACjE,OAAO,EAAC,QAAQ,EAAa,MAAM,aAAa,CAAA;AAChD,OAAO,WAAW,MAAM,aAAa,CAAA;AACrC,OAAO,OAAgB,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAEpC,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,KAA8C,EAC9C,MAA0B;IAE1B,IAAI,KAAK,YAAY,eAAe,EAAE;QACpC,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,KAAK,EAAE,EAAE;YACzC,UAAU,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;SAClC;KACF;SAAM,IAAI,KAAK,YAAY,gBAA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AM;QACf,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,eAAe;QAC3B,iBAAiB,EAAE,KAAK;QACxB,gBAAgB,EAAE,KAAK;QACvB,oBAAoB,EAAE,CAAC,YAAY,CAAC;KACrC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import {CommandExitMode, reportAnalyticsEvent} from './analytics.js'\nimport * as path from './path.js'\nimport {fanoutHooks} from './plugins.js'\nimport * as metadata from './metadata.js'\nimport {\n AbortSilentError,\n CancelExecution,\n errorMapper,\n shouldReportErrorAsUnexpected,\n handler,\n cleanSingleStackTracePath,\n} from './error.js'\nimport {getEnvironmentData} from '../../private/node/analytics.js'\nimport {outputDebug, outputInfo} from '../../public/node/output.js'\nimport {bugsnagApiKey, reportingRateLimit} from '../../private/node/constants.js'\nimport {CLI_KIT_VERSION} from '../common/version.js'\nimport {runWithRateLimit} from '../../private/node/conf-store.js'\nimport {settings, Interfaces} from '@oclif/core'\nimport StackTracey from 'stacktracey'\nimport Bugsnag, {Event} from '@bugsnag/js'\nimport {realpath} from 'fs/promises'\n\nexport async function errorHandler(\n error: Error & {exitCode?: number | undefined},\n config?: Interfaces.Config,\n): Promise<void> {\n if (error instanceof CancelExecution) {\n if (error.message && error.message !== '') {\n outputInfo(`✨ ${error.message}`)\n }\n } else if (error instanceof AbortSilentError) {\n /* empty */\n } else {\n return errorMapper(error)\n .then((error) => {\n return handler(error)\n })\n .then((mappedError) => {\n return reportError(mappedError, config)\n })\n }\n}\n\nconst reportError = async (error: unknown, config?: Interfaces.Config): Promise<void> => {\n // categorise the error first\n let exitMode: CommandExitMode = 'expected_error'\n if (shouldReportErrorAsUnexpected(error)) exitMode = 'unexpected_error'\n\n if (config !== undefined) {\n // Log an analytics event when there's an error\n await reportAnalyticsEvent({config, errorMessage: error instanceof Error ? error.message : undefined, exitMode})\n }\n await sendErrorToBugsnag(error, exitMode)\n}\n\n/**\n * Sends an error to Bugsnag. This is configured automatically for uncaught errors from CLI commands, but can also be used to manually record an error.\n *\n * @returns the reported error (this may have been tweaked for better reporting), and a bool to indicate if the error was actually submitted or not\n */\nexport async function sendErrorToBugsnag(\n error: unknown,\n exitMode: Omit<CommandExitMode, 'ok'>,\n): Promise<{reported: false; error: unknown; unhandled: unknown} | {error: Error; reported: true; unhandled: boolean}> {\n if (settings.debug) {\n outputDebug(`Skipping Bugsnag report`)\n return {reported: false, error, unhandled: undefined}\n }\n\n // If the error was unexpected, we flag it as \"unhandled\" in Bugsnag. This is a helpful distinction.\n const unhandled = exitMode === 'unexpected_error'\n\n let reportableError: Error\n let stacktrace: string | undefined\n let report = false\n\n if (error instanceof Error) {\n report = true\n reportableError = new Error(error.message)\n stacktrace = error.stack\n\n /**\n * Some errors that reach this point have an empty string. For example:\n * https://app.bugsnag.com/shopify/cli/errors/62cd5d31fd5040000814086c?filters[event.since]=30d&filters[error.status]=new&filters[release.seen_in]=3.1.0\n *\n * Because at this point we have neither the error message nor a stack trace reporting them\n * to Bugsnag is pointless and adds noise.\n */\n } else if (typeof error === 'string' && error.trim().length !== 0) {\n report = true\n reportableError = new Error(error)\n stacktrace = reportableError.stack\n } else {\n report = false\n reportableError = new Error('Unknown error')\n }\n\n const formattedStacktrace = new StackTracey(stacktrace ?? '')\n .clean()\n .items.map((item) => {\n const filePath = cleanSingleStackTracePath(item.file)\n return ` at ${item.callee} (${filePath}:${item.line}:${item.column})`\n })\n .join('\\n')\n reportableError.stack = `Error: ${reportableError.message}\\n${formattedStacktrace}`\n\n let withinRateLimit = false\n await runWithRateLimit({\n key: 'send-error-to-bugsnag',\n ...reportingRateLimit,\n task: async () => {\n withinRateLimit = true\n },\n })\n if (!withinRateLimit) {\n outputDebug(`Skipping Bugsnag report due to rate limiting`)\n report = false\n }\n\n if (report) {\n initializeBugsnag()\n await new Promise((resolve, reject) => {\n outputDebug(`Reporting ${unhandled ? 'unhandled' : 'handled'} error to Bugsnag: ${reportableError.message}`)\n const eventHandler = (event: Event) => {\n event.severity = 'error'\n event.unhandled = unhandled\n }\n const errorHandler = (error: unknown) => {\n if (error) {\n reject(error)\n } else {\n resolve(reportableError)\n }\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n Bugsnag.notify(reportableError, eventHandler, errorHandler)\n })\n }\n return {error: reportableError, reported: report, unhandled}\n}\n\n/**\n * If the given file path is within a node_modules folder, remove prefix up\n * to and including the node_modules folder.\n *\n * This gives us very consistent paths for errors generated by the CLI.\n */\nexport function cleanStackFrameFilePath({\n currentFilePath,\n projectRoot,\n pluginLocations,\n}: {\n currentFilePath: string\n projectRoot: string\n pluginLocations: {name: string; pluginPath: string}[]\n}): string {\n const fullLocation = path.isAbsolutePath(currentFilePath)\n ? currentFilePath\n : path.joinPath(projectRoot, currentFilePath)\n\n const matchingPluginPath = pluginLocations.filter(({pluginPath}) => fullLocation.startsWith(pluginPath))[0]\n\n if (matchingPluginPath !== undefined) {\n // the plugin name (e.g. @shopify/cli-kit), plus the relative path of the error line from within the plugin's code (e.g. dist/something.js )\n return path.joinPath(matchingPluginPath.name, path.relativePath(matchingPluginPath.pluginPath, fullLocation))\n }\n\n // strip prefix up to node_modules folder, so we can normalize error reporting\n return currentFilePath.replace(/.*node_modules\\//, '')\n}\n\n/**\n * Register a Bugsnag error listener to clean up stack traces for errors within plugin code.\n *\n */\nexport async function registerCleanBugsnagErrorsFromWithinPlugins(config: Interfaces.Config): Promise<void> {\n // Bugsnag have their own plug-ins that use this private field\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const bugsnagConfigProjectRoot: string = (Bugsnag as any)?._client?._config?.projectRoot ?? path.cwd()\n const projectRoot = path.normalizePath(bugsnagConfigProjectRoot)\n const pluginLocations = await Promise.all(\n [...config.plugins].map(async ([_, plugin]) => {\n const followSymlinks = await realpath(plugin.root)\n return {name: plugin.name, pluginPath: path.normalizePath(followSymlinks)}\n }),\n )\n initializeBugsnag()\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n Bugsnag.addOnError(async (event) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n event.errors.forEach((error: any) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n error.stacktrace.forEach((stackFrame: any) => {\n stackFrame.file = cleanStackFrameFilePath({currentFilePath: stackFrame.file, projectRoot, pluginLocations})\n })\n })\n try {\n await addBugsnagMetadata(event, config)\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (metadataError) {\n outputDebug(`There was an error adding metadata to the Bugsnag report; Ignoring and carrying on ${metadataError}`)\n }\n })\n}\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nexport async function addBugsnagMetadata(event: any, config: Interfaces.Config): Promise<void> {\n const publicData = metadata.getAllPublicMetadata()\n const {commandStartOptions} = metadata.getAllSensitiveMetadata()\n const {startCommand} = commandStartOptions ?? {}\n\n const {'@shopify/app': appPublic, ...otherPluginsPublic} = await fanoutHooks(config, 'public_command_metadata', {})\n\n const environment = await getEnvironmentData(config)\n\n const allMetadata = {\n command: startCommand,\n ...appPublic,\n ...publicData,\n ...environment,\n pluginData: otherPluginsPublic,\n }\n\n const appData = {} as {[key: string]: unknown}\n const commandData = {} as {[key: string]: unknown}\n const environmentData = {} as {[key: string]: unknown}\n const miscData = {} as {[key: string]: unknown}\n const appKeys = ['api_key', 'partner_id', 'project_type']\n const commandKeys = ['command']\n const environmentKeys = ['cli_version', 'node_version', 'uname']\n\n Object.entries(allMetadata).forEach(([key, value]) => {\n if (key.startsWith('app_') || appKeys.includes(key)) {\n appData[key] = value\n } else if (key.startsWith('cmd_') || commandKeys.includes(key)) {\n commandData[key] = value\n } else if (key.startsWith('env_') || environmentKeys) {\n environmentData[key] = value\n } else {\n miscData[key] = value\n }\n })\n\n // app, command, environment, misc\n const bugsnagMetadata = {\n 'Shopify App': appData,\n Command: commandData,\n Environment: environmentData,\n Misc: miscData,\n }\n Object.entries(bugsnagMetadata).forEach(([section, values]) => {\n event.addMetadata(section, values)\n })\n}\n\nfunction initializeBugsnag() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (Bugsnag.isStarted()) {\n return\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n Bugsnag.start({\n appType: 'node',\n apiKey: bugsnagApiKey,\n logger: null,\n appVersion: CLI_KIT_VERSION,\n autoTrackSessions: false,\n autoDetectErrors: false,\n enabledReleaseStages: ['production'],\n })\n}\n"]}
@@ -156,7 +156,7 @@ export function shouldReportErrorAsUnexpected(error) {
156
156
  // this means its not one of the CLI wrapped errors
157
157
  if (error instanceof Error) {
158
158
  const message = error.message;
159
- return !errorMessageImpliesEnvironmentIssue(message, error.stack ?? '');
159
+ return !errorMessageImpliesEnvironmentIssue(message);
160
160
  }
161
161
  return true;
162
162
  }
@@ -180,30 +180,21 @@ export function cleanSingleStackTracePath(filePath) {
180
180
  * There are certain errors that we know are not due to a CLI bug, but are environmental/user error.
181
181
  *
182
182
  * @param message - The error message to check.
183
- * @param stack - The stack trace to check.
184
183
  * @returns A boolean indicating if the error message implies an environment issue.
185
184
  */
186
- function errorMessageImpliesEnvironmentIssue(message, stack) {
185
+ function errorMessageImpliesEnvironmentIssue(message) {
187
186
  const environmentIssueMessages = [
188
187
  'EPERM: operation not permitted, scandir',
189
188
  'EACCES: permission denied',
190
189
  'EPERM: operation not permitted, symlink',
191
190
  'This version of npm supports the following node versions',
192
- 'EBUSY: resource busy or locked',
191
+ 'EBUSY: resource busy or locked, rmdir',
193
192
  'getaddrinfo ENOTFOUND',
194
193
  'Client network socket disconnected before secure TLS connection was established',
195
194
  'spawn EPERM',
196
195
  'socket hang up',
197
- 'ENOSPC: no space left on device',
198
- ['Maximum call stack size exceeded', /stubborn-fs.*retryify/],
199
196
  ];
200
- const anyMatches = environmentIssueMessages.some((issueMessage) => {
201
- if (typeof issueMessage === 'string') {
202
- return message.includes(issueMessage);
203
- }
204
- const [messageCheck, stackCheck] = issueMessage;
205
- return message.includes(messageCheck) && stackCheck.test(stack);
206
- });
197
+ const anyMatches = environmentIssueMessages.some((issueMessage) => message.includes(issueMessage));
207
198
  return anyMatches;
208
199
  }
209
200
  //# sourceMappingURL=error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/public/node/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,gBAAgB,EAAC,MAAM,SAAS,CAAA;AAC5D,OAAO,EAAgB,gBAAgB,EAAE,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAC5F,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAyB,iBAAiB,EAAC,MAAM,mDAAmD,CAAA;AAC3G,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAA;AAElC,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;AAExC,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qDAAK,CAAA;IACL,iEAAW,CAAA;IACX,iDAAG,CAAA;AACL,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,OAAO,eAAgB,SAAQ,KAAK;CAAG;AAE7C;;;GAGG;AACH,MAAM,OAAgB,UAAW,SAAQ,KAAK;IAO5C;;;;;;;;;;OAUG;IACH,YACE,OAAkC,EAClC,IAAoB,EACpB,aAA+C,IAAI,EACnD,SAAoC,EACpC,cAAqC;QAErC,MAAM,sBAAsB,GAAG,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,OAAO,CAAA;QAChF,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAA;QAEtF,IAAI,UAAU,EAAE;YACd,IAAI,UAAU,YAAY,eAAe,EAAE;gBACzC,IAAI,CAAC,UAAU,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAA;aAC/C;iBA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AAY,EAAE,UAAU,CAAC,GAAG,YAAY,CAAA;QAC/C,OAAO,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;IACF,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import {AlertCustomSection, renderFatalError} from './ui.js'\nimport {OutputMessage, stringifyMessage, TokenizedString} from '../../public/node/output.js'\nimport {normalizePath} from '../../public/node/path.js'\nimport {InlineToken, TokenItem, tokenItemToString} from '../../private/node/ui/components/TokenizedText.js'\nimport {Errors} from '@oclif/core'\n\nexport {ExtendableError} from 'ts-error'\n\nexport enum FatalErrorType {\n Abort,\n AbortSilent,\n Bug,\n}\n\nexport class CancelExecution extends Error {}\n\n/**\n * A fatal error represents an error shouldn't be rescued and that causes the execution to terminate.\n * There shouldn't be code that catches fatal errors.\n */\nexport abstract class FatalError extends Error {\n tryMessage: TokenItem | null\n type: FatalErrorType\n nextSteps?: TokenItem<InlineToken>[]\n formattedMessage?: TokenItem\n customSections?: AlertCustomSection[]\n skipOclifErrorHandling: boolean\n /**\n * Creates a new FatalError error.\n *\n * @param message - The error message.\n * @param type - The type of fatal error.\n * @param tryMessage - The message that recommends next steps to the user.\n * You can pass a string a {@link TokenizedString} or a {@link TokenItem}\n * if you need to style the message inside the error Banner component.\n * @param nextSteps - Message to show as \"next steps\" with suggestions to solve the issue.\n * @param customSections - Custom sections to show in the error banner. To be used if nextSteps is not enough.\n */\n constructor(\n message: TokenItem | OutputMessage,\n type: FatalErrorType,\n tryMessage: TokenItem | OutputMessage | null = null,\n nextSteps?: TokenItem<InlineToken>[],\n customSections?: AlertCustomSection[],\n ) {\n const messageIsOutputMessage = typeof message === 'string' || 'value' in message\n super(messageIsOutputMessage ? stringifyMessage(message) : tokenItemToString(message))\n\n if (tryMessage) {\n if (tryMessage instanceof TokenizedString) {\n this.tryMessage = stringifyMessage(tryMessage)\n } else {\n this.tryMessage = tryMessage\n }\n } else {\n this.tryMessage = null\n }\n\n this.type = type\n this.nextSteps = nextSteps\n this.customSections = customSections\n this.skipOclifErrorHandling = true\n\n if (!messageIsOutputMessage) {\n this.formattedMessage = message\n }\n }\n}\n\n/**\n * An abort error is a fatal error that shouldn't be reported as a bug.\n * Those usually represent unexpected scenarios that we can't handle and that usually require some action from the developer.\n */\nexport class AbortError extends FatalError {\n nextSteps?: TokenItem<InlineToken>[]\n customSections?: AlertCustomSection[]\n\n constructor(\n message: TokenItem | OutputMessage,\n tryMessage: TokenItem | OutputMessage | null = null,\n nextSteps?: TokenItem<InlineToken>[],\n customSections?: AlertCustomSection[],\n ) {\n super(message, FatalErrorType.Abort, tryMessage, nextSteps, customSections)\n }\n}\n\n/**\n * An external error is similar to Abort but has extra command and args attributes.\n * This is useful to represent errors coming from external commands, usually executed by execa.\n */\nexport class ExternalError extends FatalError {\n command: string\n args: string[]\n\n constructor(\n message: OutputMessage,\n command: string,\n args: string[],\n tryMessage: TokenItem | OutputMessage | null = null,\n ) {\n super(message, FatalErrorType.Abort, tryMessage)\n this.command = command\n this.args = args\n }\n}\n\nexport class AbortSilentError extends FatalError {\n constructor() {\n super('', FatalErrorType.AbortSilent)\n }\n}\n\n/**\n * A bug error is an error that represents a bug and therefore should be reported.\n */\nexport class BugError extends FatalError {\n constructor(message: TokenItem | OutputMessage, tryMessage: TokenItem | OutputMessage | null = null) {\n super(message, FatalErrorType.Bug, tryMessage)\n }\n}\n\n/**\n * A function that handles errors that blow up in the CLI.\n *\n * @param error - Error to be handled.\n * @returns A promise that resolves with the error passed.\n */\nexport async function handler(error: unknown): Promise<unknown> {\n let fatal: FatalError\n if (isFatal(error)) {\n fatal = error\n } else if (typeof error === 'string') {\n fatal = new BugError(error)\n } else if (error instanceof Error) {\n fatal = new BugError(error.message)\n fatal.stack = error.stack\n } else {\n // errors can come in all shapes and sizes...\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const maybeError = error as any\n fatal = new BugError(maybeError?.message ?? 'Unknown error')\n if (maybeError?.stack) {\n fatal.stack = maybeError?.stack\n }\n }\n\n renderFatalError(fatal)\n return Promise.resolve(error)\n}\n\n/**\n * A function that maps an error to an Abort with the stack trace when coming from the CLI.\n *\n * @param error - Error to be mapped.\n * @returns A promise that resolves with the new error object.\n */\nexport function errorMapper(error: unknown): Promise<unknown> {\n if (error instanceof Errors.CLIError) {\n const mappedError = new AbortError(error.message)\n mappedError.stack = error.stack\n return Promise.resolve(mappedError)\n } else {\n return Promise.resolve(error)\n }\n}\n\n/**\n * A function that checks if an error is a fatal one.\n *\n * @param error - Error to be checked.\n * @returns A boolean indicating if the error is a fatal one.\n */\nfunction isFatal(error: unknown): error is FatalError {\n try {\n return Object.prototype.hasOwnProperty.call(error, 'type')\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch {\n return false\n }\n}\n\n/**\n * A function that checks if an error should be reported as unexpected.\n *\n * @param error - Error to be checked.\n * @returns A boolean indicating if the error should be reported as unexpected.\n */\nexport function shouldReportErrorAsUnexpected(error: unknown): boolean {\n if (!isFatal(error)) {\n // this means its not one of the CLI wrapped errors\n if (error instanceof Error) {\n const message = error.message\n return !errorMessageImpliesEnvironmentIssue(message, error.stack ?? '')\n }\n return true\n }\n if (error.type === FatalErrorType.Bug) {\n return true\n }\n return false\n}\n\n/**\n * Stack traces usually have file:// - we strip that and also remove the Windows drive designation.\n *\n * @param filePath - Path to be cleaned.\n * @returns The cleaned path.\n */\nexport function cleanSingleStackTracePath(filePath: string): string {\n return normalizePath(filePath)\n .replace('file:/', '/')\n .replace(/^\\/?[A-Z]:/, '')\n}\n\n/**\n * There are certain errors that we know are not due to a CLI bug, but are environmental/user error.\n *\n * @param message - The error message to check.\n * @param stack - The stack trace to check.\n * @returns A boolean indicating if the error message implies an environment issue.\n */\nfunction errorMessageImpliesEnvironmentIssue(message: string, stack: string): boolean {\n const environmentIssueMessages = [\n 'EPERM: operation not permitted, scandir',\n 'EACCES: permission denied',\n 'EPERM: operation not permitted, symlink',\n 'This version of npm supports the following node versions',\n 'EBUSY: resource busy or locked',\n 'getaddrinfo ENOTFOUND',\n 'Client network socket disconnected before secure TLS connection was established',\n 'spawn EPERM',\n 'socket hang up',\n 'ENOSPC: no space left on device',\n ['Maximum call stack size exceeded', /stubborn-fs.*retryify/],\n ] as const\n const anyMatches = environmentIssueMessages.some((issueMessage) => {\n if (typeof issueMessage === 'string') {\n return message.includes(issueMessage)\n }\n const [messageCheck, stackCheck] = issueMessage\n return message.includes(messageCheck) && stackCheck.test(stack)\n })\n return anyMatches\n}\n"]}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../../src/public/node/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,gBAAgB,EAAC,MAAM,SAAS,CAAA;AAC5D,OAAO,EAAgB,gBAAgB,EAAE,eAAe,EAAC,MAAM,6BAA6B,CAAA;AAC5F,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAyB,iBAAiB,EAAC,MAAM,mDAAmD,CAAA;AAC3G,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAA;AAElC,OAAO,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;AAExC,MAAM,CAAN,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qDAAK,CAAA;IACL,iEAAW,CAAA;IACX,iDAAG,CAAA;AACL,CAAC,EAJW,cAAc,KAAd,cAAc,QAIzB;AAED,MAAM,OAAO,eAAgB,SAAQ,KAAK;CAAG;AAE7C;;;GAGG;AACH,MAAM,OAAgB,UAAW,SAAQ,KAAK;IAO5C;;;;;;;;;;OAUG;IACH,YACE,OAAkC,EAClC,IAAoB,EACpB,aAA+C,IAAI,EACnD,SAAoC,EACpC,cAAqC;QAErC,MAAM,sBAAsB,GAAG,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,OAAO,CAAA;QAChF,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,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C,YAAY,CAAC,CAAC,CAAA;IAClG,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import {AlertCustomSection, renderFatalError} from './ui.js'\nimport {OutputMessage, stringifyMessage, TokenizedString} from '../../public/node/output.js'\nimport {normalizePath} from '../../public/node/path.js'\nimport {InlineToken, TokenItem, tokenItemToString} from '../../private/node/ui/components/TokenizedText.js'\nimport {Errors} from '@oclif/core'\n\nexport {ExtendableError} from 'ts-error'\n\nexport enum FatalErrorType {\n Abort,\n AbortSilent,\n Bug,\n}\n\nexport class CancelExecution extends Error {}\n\n/**\n * A fatal error represents an error shouldn't be rescued and that causes the execution to terminate.\n * There shouldn't be code that catches fatal errors.\n */\nexport abstract class FatalError extends Error {\n tryMessage: TokenItem | null\n type: FatalErrorType\n nextSteps?: TokenItem<InlineToken>[]\n formattedMessage?: TokenItem\n customSections?: AlertCustomSection[]\n skipOclifErrorHandling: boolean\n /**\n * Creates a new FatalError error.\n *\n * @param message - The error message.\n * @param type - The type of fatal error.\n * @param tryMessage - The message that recommends next steps to the user.\n * You can pass a string a {@link TokenizedString} or a {@link TokenItem}\n * if you need to style the message inside the error Banner component.\n * @param nextSteps - Message to show as \"next steps\" with suggestions to solve the issue.\n * @param customSections - Custom sections to show in the error banner. To be used if nextSteps is not enough.\n */\n constructor(\n message: TokenItem | OutputMessage,\n type: FatalErrorType,\n tryMessage: TokenItem | OutputMessage | null = null,\n nextSteps?: TokenItem<InlineToken>[],\n customSections?: AlertCustomSection[],\n ) {\n const messageIsOutputMessage = typeof message === 'string' || 'value' in message\n super(messageIsOutputMessage ? stringifyMessage(message) : tokenItemToString(message))\n\n if (tryMessage) {\n if (tryMessage instanceof TokenizedString) {\n this.tryMessage = stringifyMessage(tryMessage)\n } else {\n this.tryMessage = tryMessage\n }\n } else {\n this.tryMessage = null\n }\n\n this.type = type\n this.nextSteps = nextSteps\n this.customSections = customSections\n this.skipOclifErrorHandling = true\n\n if (!messageIsOutputMessage) {\n this.formattedMessage = message\n }\n }\n}\n\n/**\n * An abort error is a fatal error that shouldn't be reported as a bug.\n * Those usually represent unexpected scenarios that we can't handle and that usually require some action from the developer.\n */\nexport class AbortError extends FatalError {\n nextSteps?: TokenItem<InlineToken>[]\n customSections?: AlertCustomSection[]\n\n constructor(\n message: TokenItem | OutputMessage,\n tryMessage: TokenItem | OutputMessage | null = null,\n nextSteps?: TokenItem<InlineToken>[],\n customSections?: AlertCustomSection[],\n ) {\n super(message, FatalErrorType.Abort, tryMessage, nextSteps, customSections)\n }\n}\n\n/**\n * An external error is similar to Abort but has extra command and args attributes.\n * This is useful to represent errors coming from external commands, usually executed by execa.\n */\nexport class ExternalError extends FatalError {\n command: string\n args: string[]\n\n constructor(\n message: OutputMessage,\n command: string,\n args: string[],\n tryMessage: TokenItem | OutputMessage | null = null,\n ) {\n super(message, FatalErrorType.Abort, tryMessage)\n this.command = command\n this.args = args\n }\n}\n\nexport class AbortSilentError extends FatalError {\n constructor() {\n super('', FatalErrorType.AbortSilent)\n }\n}\n\n/**\n * A bug error is an error that represents a bug and therefore should be reported.\n */\nexport class BugError extends FatalError {\n constructor(message: TokenItem | OutputMessage, tryMessage: TokenItem | OutputMessage | null = null) {\n super(message, FatalErrorType.Bug, tryMessage)\n }\n}\n\n/**\n * A function that handles errors that blow up in the CLI.\n *\n * @param error - Error to be handled.\n * @returns A promise that resolves with the error passed.\n */\nexport async function handler(error: unknown): Promise<unknown> {\n let fatal: FatalError\n if (isFatal(error)) {\n fatal = error\n } else if (typeof error === 'string') {\n fatal = new BugError(error)\n } else if (error instanceof Error) {\n fatal = new BugError(error.message)\n fatal.stack = error.stack\n } else {\n // errors can come in all shapes and sizes...\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const maybeError = error as any\n fatal = new BugError(maybeError?.message ?? 'Unknown error')\n if (maybeError?.stack) {\n fatal.stack = maybeError?.stack\n }\n }\n\n renderFatalError(fatal)\n return Promise.resolve(error)\n}\n\n/**\n * A function that maps an error to an Abort with the stack trace when coming from the CLI.\n *\n * @param error - Error to be mapped.\n * @returns A promise that resolves with the new error object.\n */\nexport function errorMapper(error: unknown): Promise<unknown> {\n if (error instanceof Errors.CLIError) {\n const mappedError = new AbortError(error.message)\n mappedError.stack = error.stack\n return Promise.resolve(mappedError)\n } else {\n return Promise.resolve(error)\n }\n}\n\n/**\n * A function that checks if an error is a fatal one.\n *\n * @param error - Error to be checked.\n * @returns A boolean indicating if the error is a fatal one.\n */\nfunction isFatal(error: unknown): error is FatalError {\n try {\n return Object.prototype.hasOwnProperty.call(error, 'type')\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch {\n return false\n }\n}\n\n/**\n * A function that checks if an error should be reported as unexpected.\n *\n * @param error - Error to be checked.\n * @returns A boolean indicating if the error should be reported as unexpected.\n */\nexport function shouldReportErrorAsUnexpected(error: unknown): boolean {\n if (!isFatal(error)) {\n // this means its not one of the CLI wrapped errors\n if (error instanceof Error) {\n const message = error.message\n return !errorMessageImpliesEnvironmentIssue(message)\n }\n return true\n }\n if (error.type === FatalErrorType.Bug) {\n return true\n }\n return false\n}\n\n/**\n * Stack traces usually have file:// - we strip that and also remove the Windows drive designation.\n *\n * @param filePath - Path to be cleaned.\n * @returns The cleaned path.\n */\nexport function cleanSingleStackTracePath(filePath: string): string {\n return normalizePath(filePath)\n .replace('file:/', '/')\n .replace(/^\\/?[A-Z]:/, '')\n}\n\n/**\n * There are certain errors that we know are not due to a CLI bug, but are environmental/user error.\n *\n * @param message - The error message to check.\n * @returns A boolean indicating if the error message implies an environment issue.\n */\nfunction errorMessageImpliesEnvironmentIssue(message: string): boolean {\n const environmentIssueMessages = [\n 'EPERM: operation not permitted, scandir',\n 'EACCES: permission denied',\n 'EPERM: operation not permitted, symlink',\n 'This version of npm supports the following node versions',\n 'EBUSY: resource busy or locked, rmdir',\n 'getaddrinfo ENOTFOUND',\n 'Client network socket disconnected before secure TLS connection was established',\n 'spawn EPERM',\n 'socket hang up',\n ]\n const anyMatches = environmentIssueMessages.some((issueMessage) => message.includes(issueMessage))\n return anyMatches\n}\n"]}
@@ -0,0 +1,15 @@
1
+ export interface GlobalContext {
2
+ currentCommandId: string;
3
+ }
4
+ /**
5
+ * Get the current command ID.
6
+ *
7
+ * @returns Current command ID.
8
+ */
9
+ export declare function getCurrentCommandId(): string;
10
+ /**
11
+ * Set the current command ID.
12
+ *
13
+ * @param commandId - Command ID.
14
+ */
15
+ export declare function setCurrentCommandId(commandId: string): void;