@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
@@ -0,0 +1,193 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { zod } from './schema.js';
3
+ declare const NotificationSchema: zod.ZodObject<{
4
+ id: zod.ZodString;
5
+ message: zod.ZodString;
6
+ type: zod.ZodEnum<["info", "warning", "error"]>;
7
+ frequency: zod.ZodEnum<["always", "once", "once_a_day", "once_a_week"]>;
8
+ ownerChannel: zod.ZodString;
9
+ cta: zod.ZodOptional<zod.ZodObject<{
10
+ label: zod.ZodString;
11
+ url: zod.ZodString;
12
+ }, "strip", zod.ZodTypeAny, {
13
+ url: string;
14
+ label: string;
15
+ }, {
16
+ url: string;
17
+ label: string;
18
+ }>>;
19
+ title: zod.ZodOptional<zod.ZodString>;
20
+ minVersion: zod.ZodOptional<zod.ZodString>;
21
+ maxVersion: zod.ZodOptional<zod.ZodString>;
22
+ minDate: zod.ZodOptional<zod.ZodString>;
23
+ maxDate: zod.ZodOptional<zod.ZodString>;
24
+ commands: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
25
+ surface: zod.ZodOptional<zod.ZodString>;
26
+ }, "strip", zod.ZodTypeAny, {
27
+ id: string;
28
+ type: "error" | "info" | "warning";
29
+ message: string;
30
+ frequency: "always" | "once" | "once_a_day" | "once_a_week";
31
+ ownerChannel: string;
32
+ cta?: {
33
+ url: string;
34
+ label: string;
35
+ } | undefined;
36
+ title?: string | undefined;
37
+ minVersion?: string | undefined;
38
+ maxVersion?: string | undefined;
39
+ minDate?: string | undefined;
40
+ maxDate?: string | undefined;
41
+ commands?: string[] | undefined;
42
+ surface?: string | undefined;
43
+ }, {
44
+ id: string;
45
+ type: "error" | "info" | "warning";
46
+ message: string;
47
+ frequency: "always" | "once" | "once_a_day" | "once_a_week";
48
+ ownerChannel: string;
49
+ cta?: {
50
+ url: string;
51
+ label: string;
52
+ } | undefined;
53
+ title?: string | undefined;
54
+ minVersion?: string | undefined;
55
+ maxVersion?: string | undefined;
56
+ minDate?: string | undefined;
57
+ maxDate?: string | undefined;
58
+ commands?: string[] | undefined;
59
+ surface?: string | undefined;
60
+ }>;
61
+ export type Notification = zod.infer<typeof NotificationSchema>;
62
+ declare const NotificationsSchema: zod.ZodObject<{
63
+ notifications: zod.ZodArray<zod.ZodObject<{
64
+ id: zod.ZodString;
65
+ message: zod.ZodString;
66
+ type: zod.ZodEnum<["info", "warning", "error"]>;
67
+ frequency: zod.ZodEnum<["always", "once", "once_a_day", "once_a_week"]>;
68
+ ownerChannel: zod.ZodString;
69
+ cta: zod.ZodOptional<zod.ZodObject<{
70
+ label: zod.ZodString;
71
+ url: zod.ZodString;
72
+ }, "strip", zod.ZodTypeAny, {
73
+ url: string;
74
+ label: string;
75
+ }, {
76
+ url: string;
77
+ label: string;
78
+ }>>;
79
+ title: zod.ZodOptional<zod.ZodString>;
80
+ minVersion: zod.ZodOptional<zod.ZodString>;
81
+ maxVersion: zod.ZodOptional<zod.ZodString>;
82
+ minDate: zod.ZodOptional<zod.ZodString>;
83
+ maxDate: zod.ZodOptional<zod.ZodString>;
84
+ commands: zod.ZodOptional<zod.ZodArray<zod.ZodString, "many">>;
85
+ surface: zod.ZodOptional<zod.ZodString>;
86
+ }, "strip", zod.ZodTypeAny, {
87
+ id: string;
88
+ type: "error" | "info" | "warning";
89
+ message: string;
90
+ frequency: "always" | "once" | "once_a_day" | "once_a_week";
91
+ ownerChannel: string;
92
+ cta?: {
93
+ url: string;
94
+ label: string;
95
+ } | undefined;
96
+ title?: string | undefined;
97
+ minVersion?: string | undefined;
98
+ maxVersion?: string | undefined;
99
+ minDate?: string | undefined;
100
+ maxDate?: string | undefined;
101
+ commands?: string[] | undefined;
102
+ surface?: string | undefined;
103
+ }, {
104
+ id: string;
105
+ type: "error" | "info" | "warning";
106
+ message: string;
107
+ frequency: "always" | "once" | "once_a_day" | "once_a_week";
108
+ ownerChannel: string;
109
+ cta?: {
110
+ url: string;
111
+ label: string;
112
+ } | undefined;
113
+ title?: string | undefined;
114
+ minVersion?: string | undefined;
115
+ maxVersion?: string | undefined;
116
+ minDate?: string | undefined;
117
+ maxDate?: string | undefined;
118
+ commands?: string[] | undefined;
119
+ surface?: string | undefined;
120
+ }>, "many">;
121
+ }, "strip", zod.ZodTypeAny, {
122
+ notifications: {
123
+ id: string;
124
+ type: "error" | "info" | "warning";
125
+ message: string;
126
+ frequency: "always" | "once" | "once_a_day" | "once_a_week";
127
+ ownerChannel: string;
128
+ cta?: {
129
+ url: string;
130
+ label: string;
131
+ } | undefined;
132
+ title?: string | undefined;
133
+ minVersion?: string | undefined;
134
+ maxVersion?: string | undefined;
135
+ minDate?: string | undefined;
136
+ maxDate?: string | undefined;
137
+ commands?: string[] | undefined;
138
+ surface?: string | undefined;
139
+ }[];
140
+ }, {
141
+ notifications: {
142
+ id: string;
143
+ type: "error" | "info" | "warning";
144
+ message: string;
145
+ frequency: "always" | "once" | "once_a_day" | "once_a_week";
146
+ ownerChannel: string;
147
+ cta?: {
148
+ url: string;
149
+ label: string;
150
+ } | undefined;
151
+ title?: string | undefined;
152
+ minVersion?: string | undefined;
153
+ maxVersion?: string | undefined;
154
+ minDate?: string | undefined;
155
+ maxDate?: string | undefined;
156
+ commands?: string[] | undefined;
157
+ surface?: string | undefined;
158
+ }[];
159
+ }>;
160
+ export type Notifications = zod.infer<typeof NotificationsSchema>;
161
+ /**
162
+ * Shows notifications to the user if they meet the criteria specified in the notifications.json file.
163
+ *
164
+ * @param currentSurfaces - The surfaces present in the current project (usually for app extensions).
165
+ * @param environment - Process environment variables.
166
+ * @returns - A promise that resolves when the notifications have been shown.
167
+ */
168
+ export declare function showNotificationsIfNeeded(currentSurfaces?: string[], environment?: NodeJS.ProcessEnv): Promise<void>;
169
+ /**
170
+ * Get notifications list from cache (refreshed every hour) or fetch it if not present.
171
+ *
172
+ * @returns A Notifications object.
173
+ */
174
+ export declare function getNotifications(): Promise<Notifications>;
175
+ /**
176
+ * Filters notifications based on the version of the CLI.
177
+ *
178
+ * @param notifications - The notifications to filter.
179
+ * @param commandId - The command ID to filter by.
180
+ * @param currentSurfaces - The surfaces present in the current project (usually for app extensions).
181
+ * @param today - The current date.
182
+ * @param currentVersion - The current version of the CLI.
183
+ * @returns - The filtered notifications.
184
+ */
185
+ export declare function filterNotifications(notifications: Notification[], commandId: string, currentSurfaces?: string[], today?: Date, currentVersion?: string): Notification[];
186
+ /**
187
+ * Returns a string with the filters from a notification, one by line.
188
+ *
189
+ * @param notification - The notification to get the filters from.
190
+ * @returns A string with human-readable filters from the notification.
191
+ */
192
+ export declare function stringifyFilters(notification: Notification): string;
193
+ export {};
@@ -0,0 +1,242 @@
1
+ import { versionSatisfies } from './node-package-manager.js';
2
+ import { renderError, renderInfo, renderWarning } from './ui.js';
3
+ import { getCurrentCommandId } from './global-context.js';
4
+ import { outputDebug } from './output.js';
5
+ import { zod } from './schema.js';
6
+ import { AbortSilentError } from './error.js';
7
+ import { isTruthy } from './context/utilities.js';
8
+ import { jsonOutputEnabled } from './environment.js';
9
+ import { CLI_KIT_VERSION } from '../common/version.js';
10
+ import { cacheRetrieve, cacheRetrieveOrRepopulate, cacheStore, } from '../../private/node/conf-store.js';
11
+ import { fetch } from '@shopify/cli-kit/node/http';
12
+ const URL = 'https://cdn.shopify.com/static/cli/notifications.json';
13
+ const CACHE_DURATION_IN_MS = 3600 * 1000;
14
+ function url() {
15
+ return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL ?? URL;
16
+ }
17
+ const NotificationSchema = zod.object({
18
+ id: zod.string(),
19
+ message: zod.string(),
20
+ type: zod.enum(['info', 'warning', 'error']),
21
+ frequency: zod.enum(['always', 'once', 'once_a_day', 'once_a_week']),
22
+ ownerChannel: zod.string(),
23
+ cta: zod
24
+ .object({
25
+ label: zod.string(),
26
+ url: zod.string().url(),
27
+ })
28
+ .optional(),
29
+ title: zod.string().optional(),
30
+ minVersion: zod.string().optional(),
31
+ maxVersion: zod.string().optional(),
32
+ minDate: zod.string().optional(),
33
+ maxDate: zod.string().optional(),
34
+ commands: zod.array(zod.string()).optional(),
35
+ surface: zod.string().optional(),
36
+ });
37
+ const NotificationsSchema = zod.object({ notifications: zod.array(NotificationSchema) });
38
+ /**
39
+ * Shows notifications to the user if they meet the criteria specified in the notifications.json file.
40
+ *
41
+ * @param currentSurfaces - The surfaces present in the current project (usually for app extensions).
42
+ * @param environment - Process environment variables.
43
+ * @returns - A promise that resolves when the notifications have been shown.
44
+ */
45
+ export async function showNotificationsIfNeeded(currentSurfaces, environment = process.env) {
46
+ try {
47
+ if (skipNotifications(environment))
48
+ return;
49
+ const notifications = await getNotifications();
50
+ const commandId = getCurrentCommandId();
51
+ const notificationsToShow = filterNotifications(notifications.notifications, commandId, currentSurfaces);
52
+ outputDebug(`Notifications to show: ${notificationsToShow.length}`);
53
+ await renderNotifications(notificationsToShow);
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
+ }
56
+ catch (error) {
57
+ if (error.message === 'abort')
58
+ throw new AbortSilentError();
59
+ const errorMessage = `Error retrieving notifications: ${error.message}`;
60
+ outputDebug(errorMessage);
61
+ // This is very prone to becoming a circular dependency, so we import it dynamically
62
+ const { sendErrorToBugsnag } = await import('./error-handler.js');
63
+ await sendErrorToBugsnag(errorMessage, 'unexpected_error');
64
+ }
65
+ }
66
+ function skipNotifications(environment) {
67
+ return isTruthy(environment.CI) || isTruthy(environment.SHOPIFY_UNIT_TEST) || jsonOutputEnabled(environment);
68
+ }
69
+ /**
70
+ * Renders the first 2 notifications to the user.
71
+ *
72
+ * @param notifications - The notifications to render.
73
+ */
74
+ async function renderNotifications(notifications) {
75
+ notifications.slice(0, 2).forEach((notification) => {
76
+ const content = {
77
+ headline: notification.title,
78
+ body: notification.message.replaceAll('\\n', '\n'),
79
+ link: notification.cta,
80
+ };
81
+ switch (notification.type) {
82
+ case 'info': {
83
+ renderInfo(content);
84
+ break;
85
+ }
86
+ case 'warning': {
87
+ renderWarning(content);
88
+ break;
89
+ }
90
+ case 'error': {
91
+ renderError(content);
92
+ throw new Error('abort');
93
+ }
94
+ }
95
+ cacheStore(`notification-${notification.id}`, new Date().getTime().toString());
96
+ });
97
+ }
98
+ /**
99
+ * Get notifications list from cache (refreshed every hour) or fetch it if not present.
100
+ *
101
+ * @returns A Notifications object.
102
+ */
103
+ export async function getNotifications() {
104
+ const cacheKey = `notifications-${url()}`;
105
+ const rawNotifications = await cacheRetrieveOrRepopulate(cacheKey, fetchNotifications, CACHE_DURATION_IN_MS);
106
+ const notifications = JSON.parse(rawNotifications);
107
+ return NotificationsSchema.parse(notifications);
108
+ }
109
+ /**
110
+ * Fetch notifications from GitHub.
111
+ */
112
+ async function fetchNotifications() {
113
+ outputDebug(`No cached notifications found. Fetching them...`);
114
+ const response = await fetch(url(), { signal: AbortSignal.timeout(3 * 1000) });
115
+ if (response.status !== 200)
116
+ throw new Error(`Failed to fetch notifications: ${response.statusText}`);
117
+ return response.text();
118
+ }
119
+ /**
120
+ * Filters notifications based on the version of the CLI.
121
+ *
122
+ * @param notifications - The notifications to filter.
123
+ * @param commandId - The command ID to filter by.
124
+ * @param currentSurfaces - The surfaces present in the current project (usually for app extensions).
125
+ * @param today - The current date.
126
+ * @param currentVersion - The current version of the CLI.
127
+ * @returns - The filtered notifications.
128
+ */
129
+ export function filterNotifications(notifications, commandId, currentSurfaces, today = new Date(new Date().setUTCHours(0, 0, 0, 0)), currentVersion = CLI_KIT_VERSION) {
130
+ return notifications
131
+ .filter((notification) => filterByVersion(notification, currentVersion))
132
+ .filter((notifications) => filterByDate(notifications, today))
133
+ .filter((notification) => filterByCommand(notification, commandId))
134
+ .filter((notification) => filterBySurface(notification, commandId, currentSurfaces))
135
+ .filter((notification) => filterByFrequency(notification));
136
+ }
137
+ /**
138
+ * Filters notifications based on the version of the CLI.
139
+ *
140
+ * @param notification - The notification to filter.
141
+ * @param currentVersion - The current version of the CLI.
142
+ */
143
+ function filterByVersion(notification, currentVersion) {
144
+ const minVersion = !notification.minVersion || versionSatisfies(currentVersion, `>=${notification.minVersion}`);
145
+ const maxVersion = !notification.maxVersion || versionSatisfies(currentVersion, `<=${notification.maxVersion}`);
146
+ return minVersion && maxVersion;
147
+ }
148
+ /**
149
+ * Filters notifications based on the date.
150
+ *
151
+ * @param notification - The notification to filter.
152
+ * @param today - The current date.
153
+ */
154
+ function filterByDate(notification, today) {
155
+ const minDate = !notification.minDate || new Date(notification.minDate) <= today;
156
+ const maxDate = !notification.maxDate || new Date(notification.maxDate) >= today;
157
+ return minDate && maxDate;
158
+ }
159
+ /**
160
+ * Filters notifications based on the command ID.
161
+ *
162
+ * @param notification - The notification to filter.
163
+ * @param commandId - The command ID to filter by.
164
+ * @returns - A boolean indicating whether the notification should be shown.
165
+ */
166
+ function filterByCommand(notification, commandId) {
167
+ if (commandId === '')
168
+ return true;
169
+ return !notification.commands || notification.commands.includes(commandId);
170
+ }
171
+ /**
172
+ * Filters notifications based on the surface.
173
+ *
174
+ * @param notification - The notification to filter.
175
+ * @param commandId - The command id.
176
+ * @param surfacesFromContext - The surfaces present in the current project (usually for app extensions).
177
+ * @returns - A boolean indicating whether the notification should be shown.
178
+ */
179
+ function filterBySurface(notification, commandId, surfacesFromContext) {
180
+ const surfaceFromCommand = commandId.split(':')[0] ?? 'all';
181
+ const notificationSurface = notification.surface ?? 'all';
182
+ if (surfacesFromContext)
183
+ return surfacesFromContext.includes(notificationSurface);
184
+ return notificationSurface === surfaceFromCommand || notificationSurface === 'all';
185
+ }
186
+ /**
187
+ * Filters notifications based on the frequency.
188
+ *
189
+ * @param notification - The notification to filter.
190
+ * @returns - A boolean indicating whether the notification should be shown.
191
+ */
192
+ function filterByFrequency(notification) {
193
+ if (!notification.frequency)
194
+ return true;
195
+ const cacheKey = `notification-${notification.id}`;
196
+ const lastShown = cacheRetrieve(cacheKey)?.value;
197
+ if (!lastShown)
198
+ return true;
199
+ switch (notification.frequency) {
200
+ case 'always': {
201
+ return true;
202
+ }
203
+ case 'once': {
204
+ return false;
205
+ }
206
+ case 'once_a_day': {
207
+ return new Date().getTime() - Number(lastShown) > 24 * 3600 * 1000;
208
+ }
209
+ case 'once_a_week': {
210
+ return new Date().getTime() - Number(lastShown) > 7 * 24 * 3600 * 1000;
211
+ }
212
+ }
213
+ }
214
+ /**
215
+ * Returns a string with the filters from a notification, one by line.
216
+ *
217
+ * @param notification - The notification to get the filters from.
218
+ * @returns A string with human-readable filters from the notification.
219
+ */
220
+ export function stringifyFilters(notification) {
221
+ const filters = [];
222
+ if (notification.minDate)
223
+ filters.push(`from ${notification.minDate}`);
224
+ if (notification.maxDate)
225
+ filters.push(`to ${notification.maxDate}`);
226
+ if (notification.minVersion)
227
+ filters.push(`from v${notification.minVersion}`);
228
+ if (notification.maxVersion)
229
+ filters.push(`to v${notification.maxVersion}`);
230
+ if (notification.frequency === 'once')
231
+ filters.push('show only once');
232
+ if (notification.frequency === 'once_a_day')
233
+ filters.push('show once a day');
234
+ if (notification.frequency === 'once_a_week')
235
+ filters.push('show once a week');
236
+ if (notification.surface)
237
+ filters.push(`surface = ${notification.surface}`);
238
+ if (notification.commands)
239
+ filters.push(`commands = ${notification.commands.join(', ')}`);
240
+ return filters.join('\n');
241
+ }
242
+ //# sourceMappingURL=notifications-system.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications-system.js","sourceRoot":"","sources":["../../../src/public/node/notifications-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,gBAAgB,EAAC,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAC,WAAW,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAA;AACvC,OAAO,EAAC,GAAG,EAAC,MAAM,aAAa,CAAA;AAC/B,OAAO,EAAC,gBAAgB,EAAC,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAGL,aAAa,EACb,yBAAyB,EACzB,UAAU,GACX,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAC,KAAK,EAAC,MAAM,4BAA4B,CAAA;AAEhD,MAAM,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AK,YAAY;QAAE,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IAC5E,IAAI,YAAY,CAAC,SAAS,KAAK,aAAa;QAAE,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;IAC9E,IAAI,YAAY,CAAC,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,aAAa,YAAY,CAAC,OAAO,EAAE,CAAC,CAAA;IAC3E,IAAI,YAAY,CAAC,QAAQ;QAAE,OAAO,CAAC,IAAI,CAAC,cAAc,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACzF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC3B,CAAC","sourcesContent":["import {versionSatisfies} from './node-package-manager.js'\nimport {renderError, renderInfo, renderWarning} from './ui.js'\nimport {getCurrentCommandId} from './global-context.js'\nimport {outputDebug} from './output.js'\nimport {zod} from './schema.js'\nimport {AbortSilentError} from './error.js'\nimport {isTruthy} from './context/utilities.js'\nimport {jsonOutputEnabled} from './environment.js'\nimport {CLI_KIT_VERSION} from '../common/version.js'\nimport {\n NotificationKey,\n NotificationsKey,\n cacheRetrieve,\n cacheRetrieveOrRepopulate,\n cacheStore,\n} from '../../private/node/conf-store.js'\nimport {fetch} from '@shopify/cli-kit/node/http'\n\nconst URL = 'https://cdn.shopify.com/static/cli/notifications.json'\nconst CACHE_DURATION_IN_MS = 3600 * 1000\n\nfunction url(): string {\n return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL ?? URL\n}\n\nconst NotificationSchema = zod.object({\n id: zod.string(),\n message: zod.string(),\n type: zod.enum(['info', 'warning', 'error']),\n frequency: zod.enum(['always', 'once', 'once_a_day', 'once_a_week']),\n ownerChannel: zod.string(),\n cta: zod\n .object({\n label: zod.string(),\n url: zod.string().url(),\n })\n .optional(),\n title: zod.string().optional(),\n minVersion: zod.string().optional(),\n maxVersion: zod.string().optional(),\n minDate: zod.string().optional(),\n maxDate: zod.string().optional(),\n commands: zod.array(zod.string()).optional(),\n surface: zod.string().optional(),\n})\nexport type Notification = zod.infer<typeof NotificationSchema>\n\nconst NotificationsSchema = zod.object({notifications: zod.array(NotificationSchema)})\nexport type Notifications = zod.infer<typeof NotificationsSchema>\n\n/**\n * Shows notifications to the user if they meet the criteria specified in the notifications.json file.\n *\n * @param currentSurfaces - The surfaces present in the current project (usually for app extensions).\n * @param environment - Process environment variables.\n * @returns - A promise that resolves when the notifications have been shown.\n */\nexport async function showNotificationsIfNeeded(\n currentSurfaces?: string[],\n environment: NodeJS.ProcessEnv = process.env,\n): Promise<void> {\n try {\n if (skipNotifications(environment)) return\n\n const notifications = await getNotifications()\n const commandId = getCurrentCommandId()\n const notificationsToShow = filterNotifications(notifications.notifications, commandId, currentSurfaces)\n outputDebug(`Notifications to show: ${notificationsToShow.length}`)\n await renderNotifications(notificationsToShow)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (error: any) {\n if (error.message === 'abort') throw new AbortSilentError()\n const errorMessage = `Error retrieving notifications: ${error.message}`\n outputDebug(errorMessage)\n // This is very prone to becoming a circular dependency, so we import it dynamically\n const {sendErrorToBugsnag} = await import('./error-handler.js')\n await sendErrorToBugsnag(errorMessage, 'unexpected_error')\n }\n}\n\nfunction skipNotifications(environment: NodeJS.ProcessEnv): boolean {\n return isTruthy(environment.CI) || isTruthy(environment.SHOPIFY_UNIT_TEST) || jsonOutputEnabled(environment)\n}\n\n/**\n * Renders the first 2 notifications to the user.\n *\n * @param notifications - The notifications to render.\n */\nasync function renderNotifications(notifications: Notification[]) {\n notifications.slice(0, 2).forEach((notification) => {\n const content = {\n headline: notification.title,\n body: notification.message.replaceAll('\\\\n', '\\n'),\n link: notification.cta,\n }\n switch (notification.type) {\n case 'info': {\n renderInfo(content)\n break\n }\n case 'warning': {\n renderWarning(content)\n break\n }\n case 'error': {\n renderError(content)\n throw new Error('abort')\n }\n }\n cacheStore(`notification-${notification.id}`, new Date().getTime().toString())\n })\n}\n\n/**\n * Get notifications list from cache (refreshed every hour) or fetch it if not present.\n *\n * @returns A Notifications object.\n */\nexport async function getNotifications(): Promise<Notifications> {\n const cacheKey: NotificationsKey = `notifications-${url()}`\n const rawNotifications = await cacheRetrieveOrRepopulate(cacheKey, fetchNotifications, CACHE_DURATION_IN_MS)\n const notifications: object = JSON.parse(rawNotifications)\n return NotificationsSchema.parse(notifications)\n}\n\n/**\n * Fetch notifications from GitHub.\n */\nasync function fetchNotifications(): Promise<string> {\n outputDebug(`No cached notifications found. Fetching them...`)\n const response = await fetch(url(), {signal: AbortSignal.timeout(3 * 1000)})\n if (response.status !== 200) throw new Error(`Failed to fetch notifications: ${response.statusText}`)\n return response.text() as unknown as string\n}\n\n/**\n * Filters notifications based on the version of the CLI.\n *\n * @param notifications - The notifications to filter.\n * @param commandId - The command ID to filter by.\n * @param currentSurfaces - The surfaces present in the current project (usually for app extensions).\n * @param today - The current date.\n * @param currentVersion - The current version of the CLI.\n * @returns - The filtered notifications.\n */\nexport function filterNotifications(\n notifications: Notification[],\n commandId: string,\n currentSurfaces?: string[],\n today: Date = new Date(new Date().setUTCHours(0, 0, 0, 0)),\n currentVersion: string = CLI_KIT_VERSION,\n): Notification[] {\n return notifications\n .filter((notification) => filterByVersion(notification, currentVersion))\n .filter((notifications) => filterByDate(notifications, today))\n .filter((notification) => filterByCommand(notification, commandId))\n .filter((notification) => filterBySurface(notification, commandId, currentSurfaces))\n .filter((notification) => filterByFrequency(notification))\n}\n\n/**\n * Filters notifications based on the version of the CLI.\n *\n * @param notification - The notification to filter.\n * @param currentVersion - The current version of the CLI.\n */\nfunction filterByVersion(notification: Notification, currentVersion: string) {\n const minVersion = !notification.minVersion || versionSatisfies(currentVersion, `>=${notification.minVersion}`)\n const maxVersion = !notification.maxVersion || versionSatisfies(currentVersion, `<=${notification.maxVersion}`)\n return minVersion && maxVersion\n}\n\n/**\n * Filters notifications based on the date.\n *\n * @param notification - The notification to filter.\n * @param today - The current date.\n */\nfunction filterByDate(notification: Notification, today: Date) {\n const minDate = !notification.minDate || new Date(notification.minDate) <= today\n const maxDate = !notification.maxDate || new Date(notification.maxDate) >= today\n return minDate && maxDate\n}\n\n/**\n * Filters notifications based on the command ID.\n *\n * @param notification - The notification to filter.\n * @param commandId - The command ID to filter by.\n * @returns - A boolean indicating whether the notification should be shown.\n */\nfunction filterByCommand(notification: Notification, commandId: string) {\n if (commandId === '') return true\n return !notification.commands || notification.commands.includes(commandId)\n}\n\n/**\n * Filters notifications based on the surface.\n *\n * @param notification - The notification to filter.\n * @param commandId - The command id.\n * @param surfacesFromContext - The surfaces present in the current project (usually for app extensions).\n * @returns - A boolean indicating whether the notification should be shown.\n */\nfunction filterBySurface(notification: Notification, commandId: string, surfacesFromContext?: string[]) {\n const surfaceFromCommand = commandId.split(':')[0] ?? 'all'\n const notificationSurface = notification.surface ?? 'all'\n\n if (surfacesFromContext) return surfacesFromContext.includes(notificationSurface)\n\n return notificationSurface === surfaceFromCommand || notificationSurface === 'all'\n}\n\n/**\n * Filters notifications based on the frequency.\n *\n * @param notification - The notification to filter.\n * @returns - A boolean indicating whether the notification should be shown.\n */\nfunction filterByFrequency(notification: Notification): boolean {\n if (!notification.frequency) return true\n const cacheKey: NotificationKey = `notification-${notification.id}`\n const lastShown = cacheRetrieve(cacheKey)?.value as unknown as string\n if (!lastShown) return true\n\n switch (notification.frequency) {\n case 'always': {\n return true\n }\n case 'once': {\n return false\n }\n case 'once_a_day': {\n return new Date().getTime() - Number(lastShown) > 24 * 3600 * 1000\n }\n case 'once_a_week': {\n return new Date().getTime() - Number(lastShown) > 7 * 24 * 3600 * 1000\n }\n }\n}\n\n/**\n * Returns a string with the filters from a notification, one by line.\n *\n * @param notification - The notification to get the filters from.\n * @returns A string with human-readable filters from the notification.\n */\nexport function stringifyFilters(notification: Notification): string {\n const filters = []\n if (notification.minDate) filters.push(`from ${notification.minDate}`)\n if (notification.maxDate) filters.push(`to ${notification.maxDate}`)\n if (notification.minVersion) filters.push(`from v${notification.minVersion}`)\n if (notification.maxVersion) filters.push(`to v${notification.maxVersion}`)\n if (notification.frequency === 'once') filters.push('show only once')\n if (notification.frequency === 'once_a_day') filters.push('show once a day')\n if (notification.frequency === 'once_a_week') filters.push('show once a week')\n if (notification.surface) filters.push(`surface = ${notification.surface}`)\n if (notification.commands) filters.push(`commands = ${notification.commands.join(', ')}`)\n return filters.join('\\n')\n}\n"]}
@@ -158,18 +158,14 @@ export declare function consoleError(message: string): void;
158
158
  * @param message - The message to print.
159
159
  */
160
160
  export declare function consoleWarn(message: string): void;
161
- interface OutputWhereAppropriateOptions {
162
- skipUIEvent?: boolean;
163
- }
164
161
  /**
165
162
  * Writes a message to the appropiated logger.
166
163
  *
167
164
  * @param logLevel - The log level to use to determine if the message should be output.
168
165
  * @param logger - The logger to use to output the message.
169
166
  * @param message - The message to output.
170
- * @param options - Additional options.
171
167
  */
172
- export declare function outputWhereAppropriate(logLevel: LogLevel, logger: Logger, message: string, options?: OutputWhereAppropriateOptions): void;
168
+ export declare function outputWhereAppropriate(logLevel: LogLevel, logger: Logger, message: string): void;
173
169
  /**
174
170
  * Returns a message without styles (colors or any ANSI escape codes).
175
171
  *
@@ -192,4 +188,3 @@ export declare function shouldDisplayColors(_process?: NodeJS.Process): boolean;
192
188
  * @returns The formatted message.
193
189
  */
194
190
  export declare function formatSection(title: string, body: string): string;
195
- export {};
@@ -4,7 +4,6 @@ import { currentProcessIsGlobal } from './is-global.js';
4
4
  import colors from './colors.js';
5
5
  import { isTruthy } from './context/utilities.js';
6
6
  import { ColorContentToken, CommandContentToken, ErrorContentToken, HeadingContentToken, ItalicContentToken, JsonContentToken, LinesDiffContentToken, LinkContentToken, PathContentToken, RawContentToken, SubHeadingContentToken, } from '../../private/node/content-tokens.js';
7
- import { recordUIEvent } from '../../private/node/demo-recorder.js';
8
7
  import { tokenItemToString } from '../../private/node/ui/components/TokenizedText.js';
9
8
  import stripAnsi from 'strip-ansi';
10
9
  import { Writable } from 'stream';
@@ -338,9 +337,8 @@ export function consoleWarn(message) {
338
337
  * @param logLevel - The log level to use to determine if the message should be output.
339
338
  * @param logger - The logger to use to output the message.
340
339
  * @param message - The message to output.
341
- * @param options - Additional options.
342
340
  */
343
- export function outputWhereAppropriate(logLevel, logger, message, options = { skipUIEvent: false }) {
341
+ export function outputWhereAppropriate(logLevel, logger, message) {
344
342
  if (shouldOutput(logLevel)) {
345
343
  if (logger instanceof Writable) {
346
344
  logger.write(message);
@@ -348,8 +346,6 @@ export function outputWhereAppropriate(logLevel, logger, message, options = { sk
348
346
  else {
349
347
  logger(message, logLevel);
350
348
  }
351
- if (!options.skipUIEvent)
352
- recordUIEvent({ type: 'output', properties: { content: message } });
353
349
  }
354
350
  }
355
351
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/public/node/output.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAA;AAExD,OAAO,EAAC,sBAAsB,EAAC,MAAM,gBAAgB,CAAA;AAErD,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAE/C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EAEnB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,GACvB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAC,iBAAiB,EAAC,MAAM,mDAAmD,CAAA;AACnF,OAAO,SAAS,MAAM,YAAY,CAAA;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAA;AAK/B,MAAM,OAAO,eAAe;IAE1B,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAA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IACvD,MAAM,cAAc,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAA;IAC/E,OAAO,aAAa,CAAA,GAAG,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAAA;AAC7E,CAAC;AAED,8BAA8B","sourcesContent":["/* eslint-disable no-console */\nimport {isUnitTest, isVerbose} from './context/local.js'\nimport {PackageManager} from './node-package-manager.js'\nimport {currentProcessIsGlobal} from './is-global.js'\nimport {AbortSignal} from './abort.js'\nimport colors from './colors.js'\nimport {isTruthy} from './context/utilities.js'\nimport {TokenItem} from './ui.js'\nimport {\n ColorContentToken,\n CommandContentToken,\n ContentToken,\n ErrorContentToken,\n HeadingContentToken,\n ItalicContentToken,\n JsonContentToken,\n LinesDiffContentToken,\n LinkContentToken,\n PathContentToken,\n RawContentToken,\n SubHeadingContentToken,\n} from '../../private/node/content-tokens.js'\nimport {recordUIEvent} from '../../private/node/demo-recorder.js'\nimport {tokenItemToString} from '../../private/node/ui/components/TokenizedText.js'\nimport stripAnsi from 'strip-ansi'\nimport {Writable} from 'stream'\nimport type {Change} from 'diff'\n\nexport type Logger = Writable | ((message: string, logLevel?: LogLevel) => void)\n\nexport class TokenizedString {\n value: string\n constructor(value: string) {\n this.value = value\n }\n}\n\nexport type OutputMessage = string | TokenizedString\n\nexport const outputToken = {\n raw(value: string): RawContentToken {\n return new RawContentToken(value)\n },\n genericShellCommand(value: OutputMessage): CommandContentToken {\n return new CommandContentToken(value)\n },\n json(value: unknown): JsonContentToken {\n return new JsonContentToken(value)\n },\n path(value: OutputMessage): PathContentToken {\n return new PathContentToken(value)\n },\n link(value: OutputMessage, link?: string, fallback?: string | undefined): LinkContentToken {\n return new LinkContentToken(value, link, fallback)\n },\n heading(value: OutputMessage): HeadingContentToken {\n return new HeadingContentToken(value)\n },\n subheading(value: OutputMessage): SubHeadingContentToken {\n return new SubHeadingContentToken(value)\n },\n italic(value: OutputMessage): ItalicContentToken {\n return new ItalicContentToken(value)\n },\n errorText(value: OutputMessage): ErrorContentToken {\n return new ErrorContentToken(value)\n },\n cyan(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.cyan)\n },\n yellow(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.yellow)\n },\n magenta(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.magenta)\n },\n green(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.green)\n },\n gray(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.gray)\n },\n packagejsonScript(packageManager: PackageManager, scriptName: string, ...scriptArgs: string[]): CommandContentToken {\n return new CommandContentToken(formatPackageManagerCommand(packageManager, scriptName, ...scriptArgs))\n },\n successIcon(): ColorContentToken {\n return new ColorContentToken('✔', colors.green)\n },\n failIcon(): ErrorContentToken {\n return new ErrorContentToken('✖')\n },\n linesDiff(value: Change[]): LinesDiffContentToken {\n return new LinesDiffContentToken(value)\n },\n}\n\n/**\n * Given a command and its arguments, it formats it depending on the package manager.\n *\n * @param packageManager - The package manager to use (pnpm, npm, yarn).\n * @param scriptName - The name of the script to run.\n * @param scriptArgs - The arguments to pass to the script.\n * @returns The formatted command.\n */\nexport function formatPackageManagerCommand(\n packageManager: PackageManager,\n scriptName: string,\n ...scriptArgs: string[]\n): string {\n if (currentProcessIsGlobal()) {\n return [scriptName, ...scriptArgs].join(' ')\n }\n switch (packageManager) {\n case 'pnpm':\n case 'bun':\n case 'yarn': {\n const pieces = [packageManager, scriptName, ...scriptArgs]\n return pieces.join(' ')\n }\n case 'npm': {\n const pieces = ['npm', 'run', scriptName]\n if (scriptArgs.length > 0) {\n pieces.push('--')\n pieces.push(...scriptArgs)\n }\n return pieces.join(' ')\n }\n case 'unknown': {\n const pieces = [scriptName, ...scriptArgs]\n return pieces.join(' ')\n }\n }\n}\n\n/**\n * Creates a tokenized string from an array of strings and tokens.\n *\n * @param strings - The strings to join.\n * @param keys - Array of tokens or strings to join.\n * @returns The tokenized string.\n */\nexport function outputContent(\n strings: TemplateStringsArray,\n ...keys: (ContentToken<unknown> | string)[]\n): TokenizedString {\n let output = ``\n strings.forEach((string, i) => {\n output += string\n if (i >= keys.length) {\n return\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const token = keys[i]!\n\n if (typeof token === 'string') {\n output += token\n } else if (token) {\n const enumTokenOutput = token.output()\n\n if (Array.isArray(enumTokenOutput)) {\n enumTokenOutput.forEach((line: string) => {\n output += line\n })\n } else {\n output += enumTokenOutput\n }\n }\n })\n return new TokenizedString(output)\n}\n\n/** Log levels. */\nexport type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent'\n\n/**\n * It maps a level to a numeric value.\n *\n * @param level - The level for which we'll return its numeric value.\n * @returns The numeric value of the level.\n */\nfunction logLevelValue(level: LogLevel): number {\n switch (level) {\n case 'trace':\n return 10\n case 'debug':\n return 20\n case 'info':\n return 30\n case 'warn':\n return 40\n case 'error':\n return 50\n case 'fatal':\n return 60\n default:\n return 30\n }\n}\n\n/**\n * It returns the current log level (debug or info).\n *\n * @returns The log level set by the user.\n */\nfunction currentLogLevel(): LogLevel {\n if (isVerbose()) {\n return 'debug'\n } else {\n return 'info'\n }\n}\n\n/**\n * It checks if the message should be outputted or not.\n *\n * @param logLevel - The desired log level for the message.\n * @returns True if the message should be outputted, false otherwise.\n */\nfunction shouldOutput(logLevel: LogLevel): boolean {\n if (isUnitTest()) {\n return false\n }\n const currentLogLevelValue = logLevelValue(currentLogLevel())\n const messageLogLevelValue = logLevelValue(logLevel)\n return messageLogLevelValue >= currentLogLevelValue\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nexport let collectedLogs: {[key: string]: string[]} = {}\n\n/**\n * This is only used during UnitTesting.\n * If we are in a testing context, instead of printing the logs to the console,\n * we will store them in a variable that can be accessed from the tests.\n *\n * @param key - The key of the log.\n * @param content - The content of the log.\n */\nexport function collectLog(key: string, content: OutputMessage): void {\n const output = collectedLogs.output ?? []\n const data = collectedLogs[key] ?? []\n data.push(stripAnsi(stringifyMessage(content) ?? ''))\n output.push(stripAnsi(stringifyMessage(content) ?? ''))\n collectedLogs[key] = data\n collectedLogs.output = output\n}\n\nexport const clearCollectedLogs = (): void => {\n // console.log('clearCollectLogs')\n collectedLogs = {}\n // console.log(collectedLogs)\n}\n\n/**\n * Ouputs information to the user.\n * Info messages don't get additional formatting.\n * Note: Info messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputInfo(content: OutputMessage, logger: Logger = consoleLog): void {\n const message = stringifyMessage(content)\n if (isUnitTest()) collectLog('info', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Outputs a success message to the user.\n * Success messages receive a special formatting to make them stand out in the console.\n * Note: Success messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputSuccess(content: OutputMessage, logger: Logger = consoleLog): void {\n const message = colors.bold(`✅ Success! ${stringifyMessage(content)}.`)\n if (isUnitTest()) collectLog('success', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Outputs a completed message to the user.\n * Completed message receive a special formatting to make them stand out in the console.\n * Note: Completed messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputCompleted(content: OutputMessage, logger: Logger = consoleLog): void {\n const message = `${colors.green('✔')} ${stringifyMessage(content)}`\n if (isUnitTest()) collectLog('completed', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Ouputs debug information to the user. By default these output is hidden unless the user calls the CLI with --verbose.\n * Debug messages don't get additional formatting.\n * Note: Debug messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputDebug(content: OutputMessage, logger: Logger = consoleLog): void {\n if (isUnitTest()) collectLog('debug', content)\n const message = colors.gray(stringifyMessage(content))\n outputWhereAppropriate('debug', logger, `${new Date().toISOString()}: ${message}`)\n}\n\n/**\n * Outputs a warning message to the user.\n * Warning messages receive a special formatting to make them stand out in the console.\n * Note: Warning messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputWarn(content: OutputMessage, logger: Logger = consoleWarn): void {\n if (isUnitTest()) collectLog('warn', content)\n const message = colors.yellow(stringifyMessage(content))\n outputWhereAppropriate('warn', logger, message)\n}\n\n/**\n * Prints a new line in the terminal.\n */\nexport function outputNewline(): void {\n console.log()\n}\n\n/**\n * Converts a Message to string.\n *\n * @param message - The message to convert to string.\n * @returns The string representation of the message.\n */\nexport function stringifyMessage(message: OutputMessage): string {\n if (message instanceof TokenizedString) {\n return message.value\n } else {\n return message\n }\n}\n\n/**\n * Convert a TokenItem to string.\n *\n * @param item - The item to convert to string.\n * @returns The string representation of the item.\n */\nexport function itemToString(item: TokenItem): string {\n return tokenItemToString(item)\n}\n\nexport interface OutputProcess {\n /**\n * The prefix to include in the logs\n * [vite] Output coming from Vite.\n */\n prefix: string\n /**\n * A callback to invoke the process. Stdout and stderr should be used\n * to send standard output and error data that gets formatted with the\n * right prefix.\n */\n action: (stdout: Writable, stderr: Writable, signal: AbortSignal) => Promise<void>\n}\n\n/**\n * Prints a log message in the console.\n *\n * @param message - The message to print.\n */\nexport function consoleLog(message: string): void {\n console.log(withOrWithoutStyle(message))\n}\n\n/**\n * Prints an error message in the console.\n *\n * @param message - The message to print.\n */\nexport function consoleError(message: string): void {\n console.error(withOrWithoutStyle(message))\n}\n\n/**\n * Prints a warning message in the console.\n *\n * @param message - The message to print.\n */\nexport function consoleWarn(message: string): void {\n console.warn(withOrWithoutStyle(message))\n}\n\ninterface OutputWhereAppropriateOptions {\n skipUIEvent?: boolean\n}\n\n/**\n * Writes a message to the appropiated logger.\n *\n * @param logLevel - The log level to use to determine if the message should be output.\n * @param logger - The logger to use to output the message.\n * @param message - The message to output.\n * @param options - Additional options.\n */\nexport function outputWhereAppropriate(\n logLevel: LogLevel,\n logger: Logger,\n message: string,\n options: OutputWhereAppropriateOptions = {skipUIEvent: false},\n): void {\n if (shouldOutput(logLevel)) {\n if (logger instanceof Writable) {\n logger.write(message)\n } else {\n logger(message, logLevel)\n }\n if (!options.skipUIEvent) recordUIEvent({type: 'output', properties: {content: message}})\n }\n}\n\n/**\n * Returns a colored or uncolored version of a message, depending on the environment.\n *\n * @param message - The message to color or not.\n * @returns The message with or without colors.\n */\nfunction withOrWithoutStyle(message: string): string {\n if (shouldDisplayColors()) {\n return message\n } else {\n return unstyled(message)\n }\n}\n\n/**\n * Returns a message without styles (colors or any ANSI escape codes).\n *\n * @param message - The message to remove styles from.\n * @returns The message without styles.\n */\nexport function unstyled(message: string): string {\n return stripAnsi(message)\n}\n\n/**\n * Checks if the console outputs should display colors or not.\n *\n * @param _process - Optional, the process-like object to use to check if the console should display colors. Defaults to the global process.\n * @returns True if the console outputs should display colors, false otherwise.\n */\nexport function shouldDisplayColors(_process = process): boolean {\n const {env, stdout} = _process\n if (Object.hasOwnProperty.call(env, 'FORCE_COLOR')) {\n return isTruthy(env.FORCE_COLOR)\n } else {\n return Boolean(stdout.isTTY)\n }\n}\n\n/**\n * Parse title and body to be a single formatted string.\n *\n * @param title - The title of the message. Will be formatted as a heading.\n * @param body - The body of the message. Will respect the original formatting.\n * @returns The formatted message.\n */\nexport function formatSection(title: string, body: string): string {\n const formattedTitle = `${title.toUpperCase()}${' '.repeat(35 - title.length)}`\n return outputContent`${outputToken.heading(formattedTitle)}\\n${body}`.value\n}\n\n/* eslint-enable no-console */\n"]}
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/public/node/output.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAA;AAExD,OAAO,EAAC,sBAAsB,EAAC,M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AAM,EAAC,GAAG,EAAE,MAAM,EAAC,GAAG,QAAQ,CAAA;IAC9B,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,EAAE;QAClD,OAAO,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;KACjC;SAAM;QACL,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;KAC7B;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,IAAY;IACvD,MAAM,cAAc,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE,CAAA;IAC/E,OAAO,aAAa,CAAA,GAAG,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAAA;AAC7E,CAAC;AAED,8BAA8B","sourcesContent":["/* eslint-disable no-console */\nimport {isUnitTest, isVerbose} from './context/local.js'\nimport {PackageManager} from './node-package-manager.js'\nimport {currentProcessIsGlobal} from './is-global.js'\nimport {AbortSignal} from './abort.js'\nimport colors from './colors.js'\nimport {isTruthy} from './context/utilities.js'\nimport {TokenItem} from './ui.js'\nimport {\n ColorContentToken,\n CommandContentToken,\n ContentToken,\n ErrorContentToken,\n HeadingContentToken,\n ItalicContentToken,\n JsonContentToken,\n LinesDiffContentToken,\n LinkContentToken,\n PathContentToken,\n RawContentToken,\n SubHeadingContentToken,\n} from '../../private/node/content-tokens.js'\nimport {tokenItemToString} from '../../private/node/ui/components/TokenizedText.js'\nimport stripAnsi from 'strip-ansi'\nimport {Writable} from 'stream'\nimport type {Change} from 'diff'\n\nexport type Logger = Writable | ((message: string, logLevel?: LogLevel) => void)\n\nexport class TokenizedString {\n value: string\n constructor(value: string) {\n this.value = value\n }\n}\n\nexport type OutputMessage = string | TokenizedString\n\nexport const outputToken = {\n raw(value: string): RawContentToken {\n return new RawContentToken(value)\n },\n genericShellCommand(value: OutputMessage): CommandContentToken {\n return new CommandContentToken(value)\n },\n json(value: unknown): JsonContentToken {\n return new JsonContentToken(value)\n },\n path(value: OutputMessage): PathContentToken {\n return new PathContentToken(value)\n },\n link(value: OutputMessage, link?: string, fallback?: string | undefined): LinkContentToken {\n return new LinkContentToken(value, link, fallback)\n },\n heading(value: OutputMessage): HeadingContentToken {\n return new HeadingContentToken(value)\n },\n subheading(value: OutputMessage): SubHeadingContentToken {\n return new SubHeadingContentToken(value)\n },\n italic(value: OutputMessage): ItalicContentToken {\n return new ItalicContentToken(value)\n },\n errorText(value: OutputMessage): ErrorContentToken {\n return new ErrorContentToken(value)\n },\n cyan(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.cyan)\n },\n yellow(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.yellow)\n },\n magenta(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.magenta)\n },\n green(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.green)\n },\n gray(value: OutputMessage): ColorContentToken {\n return new ColorContentToken(value, colors.gray)\n },\n packagejsonScript(packageManager: PackageManager, scriptName: string, ...scriptArgs: string[]): CommandContentToken {\n return new CommandContentToken(formatPackageManagerCommand(packageManager, scriptName, ...scriptArgs))\n },\n successIcon(): ColorContentToken {\n return new ColorContentToken('✔', colors.green)\n },\n failIcon(): ErrorContentToken {\n return new ErrorContentToken('✖')\n },\n linesDiff(value: Change[]): LinesDiffContentToken {\n return new LinesDiffContentToken(value)\n },\n}\n\n/**\n * Given a command and its arguments, it formats it depending on the package manager.\n *\n * @param packageManager - The package manager to use (pnpm, npm, yarn).\n * @param scriptName - The name of the script to run.\n * @param scriptArgs - The arguments to pass to the script.\n * @returns The formatted command.\n */\nexport function formatPackageManagerCommand(\n packageManager: PackageManager,\n scriptName: string,\n ...scriptArgs: string[]\n): string {\n if (currentProcessIsGlobal()) {\n return [scriptName, ...scriptArgs].join(' ')\n }\n switch (packageManager) {\n case 'pnpm':\n case 'bun':\n case 'yarn': {\n const pieces = [packageManager, scriptName, ...scriptArgs]\n return pieces.join(' ')\n }\n case 'npm': {\n const pieces = ['npm', 'run', scriptName]\n if (scriptArgs.length > 0) {\n pieces.push('--')\n pieces.push(...scriptArgs)\n }\n return pieces.join(' ')\n }\n case 'unknown': {\n const pieces = [scriptName, ...scriptArgs]\n return pieces.join(' ')\n }\n }\n}\n\n/**\n * Creates a tokenized string from an array of strings and tokens.\n *\n * @param strings - The strings to join.\n * @param keys - Array of tokens or strings to join.\n * @returns The tokenized string.\n */\nexport function outputContent(\n strings: TemplateStringsArray,\n ...keys: (ContentToken<unknown> | string)[]\n): TokenizedString {\n let output = ``\n strings.forEach((string, i) => {\n output += string\n if (i >= keys.length) {\n return\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const token = keys[i]!\n\n if (typeof token === 'string') {\n output += token\n } else if (token) {\n const enumTokenOutput = token.output()\n\n if (Array.isArray(enumTokenOutput)) {\n enumTokenOutput.forEach((line: string) => {\n output += line\n })\n } else {\n output += enumTokenOutput\n }\n }\n })\n return new TokenizedString(output)\n}\n\n/** Log levels. */\nexport type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent'\n\n/**\n * It maps a level to a numeric value.\n *\n * @param level - The level for which we'll return its numeric value.\n * @returns The numeric value of the level.\n */\nfunction logLevelValue(level: LogLevel): number {\n switch (level) {\n case 'trace':\n return 10\n case 'debug':\n return 20\n case 'info':\n return 30\n case 'warn':\n return 40\n case 'error':\n return 50\n case 'fatal':\n return 60\n default:\n return 30\n }\n}\n\n/**\n * It returns the current log level (debug or info).\n *\n * @returns The log level set by the user.\n */\nfunction currentLogLevel(): LogLevel {\n if (isVerbose()) {\n return 'debug'\n } else {\n return 'info'\n }\n}\n\n/**\n * It checks if the message should be outputted or not.\n *\n * @param logLevel - The desired log level for the message.\n * @returns True if the message should be outputted, false otherwise.\n */\nfunction shouldOutput(logLevel: LogLevel): boolean {\n if (isUnitTest()) {\n return false\n }\n const currentLogLevelValue = logLevelValue(currentLogLevel())\n const messageLogLevelValue = logLevelValue(logLevel)\n return messageLogLevelValue >= currentLogLevelValue\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nexport let collectedLogs: {[key: string]: string[]} = {}\n\n/**\n * This is only used during UnitTesting.\n * If we are in a testing context, instead of printing the logs to the console,\n * we will store them in a variable that can be accessed from the tests.\n *\n * @param key - The key of the log.\n * @param content - The content of the log.\n */\nexport function collectLog(key: string, content: OutputMessage): void {\n const output = collectedLogs.output ?? []\n const data = collectedLogs[key] ?? []\n data.push(stripAnsi(stringifyMessage(content) ?? ''))\n output.push(stripAnsi(stringifyMessage(content) ?? ''))\n collectedLogs[key] = data\n collectedLogs.output = output\n}\n\nexport const clearCollectedLogs = (): void => {\n // console.log('clearCollectLogs')\n collectedLogs = {}\n // console.log(collectedLogs)\n}\n\n/**\n * Ouputs information to the user.\n * Info messages don't get additional formatting.\n * Note: Info messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputInfo(content: OutputMessage, logger: Logger = consoleLog): void {\n const message = stringifyMessage(content)\n if (isUnitTest()) collectLog('info', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Outputs a success message to the user.\n * Success messages receive a special formatting to make them stand out in the console.\n * Note: Success messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputSuccess(content: OutputMessage, logger: Logger = consoleLog): void {\n const message = colors.bold(`✅ Success! ${stringifyMessage(content)}.`)\n if (isUnitTest()) collectLog('success', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Outputs a completed message to the user.\n * Completed message receive a special formatting to make them stand out in the console.\n * Note: Completed messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputCompleted(content: OutputMessage, logger: Logger = consoleLog): void {\n const message = `${colors.green('✔')} ${stringifyMessage(content)}`\n if (isUnitTest()) collectLog('completed', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Ouputs debug information to the user. By default these output is hidden unless the user calls the CLI with --verbose.\n * Debug messages don't get additional formatting.\n * Note: Debug messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputDebug(content: OutputMessage, logger: Logger = consoleLog): void {\n if (isUnitTest()) collectLog('debug', content)\n const message = colors.gray(stringifyMessage(content))\n outputWhereAppropriate('debug', logger, `${new Date().toISOString()}: ${message}`)\n}\n\n/**\n * Outputs a warning message to the user.\n * Warning messages receive a special formatting to make them stand out in the console.\n * Note: Warning messages are sent through the standard output.\n *\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport function outputWarn(content: OutputMessage, logger: Logger = consoleWarn): void {\n if (isUnitTest()) collectLog('warn', content)\n const message = colors.yellow(stringifyMessage(content))\n outputWhereAppropriate('warn', logger, message)\n}\n\n/**\n * Prints a new line in the terminal.\n */\nexport function outputNewline(): void {\n console.log()\n}\n\n/**\n * Converts a Message to string.\n *\n * @param message - The message to convert to string.\n * @returns The string representation of the message.\n */\nexport function stringifyMessage(message: OutputMessage): string {\n if (message instanceof TokenizedString) {\n return message.value\n } else {\n return message\n }\n}\n\n/**\n * Convert a TokenItem to string.\n *\n * @param item - The item to convert to string.\n * @returns The string representation of the item.\n */\nexport function itemToString(item: TokenItem): string {\n return tokenItemToString(item)\n}\n\nexport interface OutputProcess {\n /**\n * The prefix to include in the logs\n * [vite] Output coming from Vite.\n */\n prefix: string\n /**\n * A callback to invoke the process. Stdout and stderr should be used\n * to send standard output and error data that gets formatted with the\n * right prefix.\n */\n action: (stdout: Writable, stderr: Writable, signal: AbortSignal) => Promise<void>\n}\n\n/**\n * Prints a log message in the console.\n *\n * @param message - The message to print.\n */\nexport function consoleLog(message: string): void {\n console.log(withOrWithoutStyle(message))\n}\n\n/**\n * Prints an error message in the console.\n *\n * @param message - The message to print.\n */\nexport function consoleError(message: string): void {\n console.error(withOrWithoutStyle(message))\n}\n\n/**\n * Prints a warning message in the console.\n *\n * @param message - The message to print.\n */\nexport function consoleWarn(message: string): void {\n console.warn(withOrWithoutStyle(message))\n}\n\n/**\n * Writes a message to the appropiated logger.\n *\n * @param logLevel - The log level to use to determine if the message should be output.\n * @param logger - The logger to use to output the message.\n * @param message - The message to output.\n */\nexport function outputWhereAppropriate(logLevel: LogLevel, logger: Logger, message: string): void {\n if (shouldOutput(logLevel)) {\n if (logger instanceof Writable) {\n logger.write(message)\n } else {\n logger(message, logLevel)\n }\n }\n}\n\n/**\n * Returns a colored or uncolored version of a message, depending on the environment.\n *\n * @param message - The message to color or not.\n * @returns The message with or without colors.\n */\nfunction withOrWithoutStyle(message: string): string {\n if (shouldDisplayColors()) {\n return message\n } else {\n return unstyled(message)\n }\n}\n\n/**\n * Returns a message without styles (colors or any ANSI escape codes).\n *\n * @param message - The message to remove styles from.\n * @returns The message without styles.\n */\nexport function unstyled(message: string): string {\n return stripAnsi(message)\n}\n\n/**\n * Checks if the console outputs should display colors or not.\n *\n * @param _process - Optional, the process-like object to use to check if the console should display colors. Defaults to the global process.\n * @returns True if the console outputs should display colors, false otherwise.\n */\nexport function shouldDisplayColors(_process = process): boolean {\n const {env, stdout} = _process\n if (Object.hasOwnProperty.call(env, 'FORCE_COLOR')) {\n return isTruthy(env.FORCE_COLOR)\n } else {\n return Boolean(stdout.isTTY)\n }\n}\n\n/**\n * Parse title and body to be a single formatted string.\n *\n * @param title - The title of the message. Will be formatted as a heading.\n * @param body - The body of the message. Will respect the original formatting.\n * @returns The formatted message.\n */\nexport function formatSection(title: string, body: string): string {\n const formattedTitle = `${title.toUpperCase()}${' '.repeat(35 - title.length)}`\n return outputContent`${outputToken.heading(formattedTitle)}\\n${body}`.value\n}\n\n/* eslint-enable no-console */\n"]}
@@ -102,9 +102,9 @@ export declare function cwd(): string;
102
102
  */
103
103
  export declare function sniffForPath(argv?: string[]): string | undefined;
104
104
  /**
105
- * Returns whether the `--json` flag is present in the arguments.
105
+ * Returns whether the `--json` or `-j` flags are present in the arguments.
106
106
  *
107
- * @param argv - The arguments to search for the `--json` flag.
108
- * @returns Whether the `--json` flag is present in the arguments.
107
+ * @param argv - The arguments to search for the `--json` and `-j` flags.
108
+ * @returns Whether the `--json` or `-j` flag is present in the arguments.
109
109
  */
110
110
  export declare function sniffForJson(argv?: string[]): boolean;