shopify-cli 2.2.2 → 2.6.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 (267) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -0
  3. data/.github/ISSUE_TEMPLATE.md +0 -4
  4. data/.github/workflows/shopify.yml +104 -0
  5. data/.gitignore +3 -0
  6. data/.rubocop.yml +14 -14
  7. data/.rubocop_todo.yml +3 -3
  8. data/CHANGELOG.md +30 -0
  9. data/CONTRIBUTING.md +23 -0
  10. data/Dockerfile +17 -0
  11. data/Gemfile +1 -0
  12. data/Gemfile.lock +67 -24
  13. data/RELEASING.md +1 -1
  14. data/Rakefile +75 -18
  15. data/bin/console +11 -0
  16. data/bin/shopify +16 -4
  17. data/dev.yml +14 -1
  18. data/ext/shopify-cli/extconf.rb +2 -0
  19. data/ext/shopify-extensions/extconf.rb +21 -0
  20. data/ext/shopify-extensions/shopify_extensions.rb +152 -0
  21. data/ext/shopify-extensions/version +1 -0
  22. data/lib/project_types/extension/cli.rb +19 -3
  23. data/lib/project_types/extension/commands/build.rb +32 -3
  24. data/lib/project_types/extension/commands/check.rb +2 -2
  25. data/lib/project_types/extension/commands/connect.rb +1 -1
  26. data/lib/project_types/extension/commands/create.rb +59 -16
  27. data/lib/project_types/extension/commands/extension_command.rb +1 -1
  28. data/lib/project_types/extension/commands/info.rb +1 -1
  29. data/lib/project_types/extension/commands/push.rb +1 -1
  30. data/lib/project_types/extension/commands/register.rb +2 -2
  31. data/lib/project_types/extension/commands/serve.rb +5 -5
  32. data/lib/project_types/extension/commands/tunnel.rb +6 -6
  33. data/lib/project_types/extension/extension_project.rb +4 -4
  34. data/lib/project_types/extension/features/argo.rb +3 -3
  35. data/lib/project_types/extension/features/argo_config.rb +5 -5
  36. data/lib/project_types/extension/features/argo_serve.rb +21 -6
  37. data/lib/project_types/extension/features/argo_setup.rb +1 -1
  38. data/lib/project_types/extension/features/argo_setup_step.rb +1 -1
  39. data/lib/project_types/extension/features/argo_setup_steps.rb +2 -2
  40. data/lib/project_types/extension/forms/connect.rb +2 -2
  41. data/lib/project_types/extension/forms/create.rb +6 -3
  42. data/lib/project_types/extension/forms/questions/ask_app.rb +2 -2
  43. data/lib/project_types/extension/forms/questions/ask_name.rb +1 -1
  44. data/lib/project_types/extension/forms/questions/ask_registration.rb +2 -2
  45. data/lib/project_types/extension/forms/questions/ask_template.rb +44 -0
  46. data/lib/project_types/extension/forms/questions/ask_type.rb +2 -2
  47. data/lib/project_types/extension/messages/message_loading.rb +2 -2
  48. data/lib/project_types/extension/messages/messages.rb +3 -0
  49. data/lib/project_types/extension/models/development_server.rb +78 -0
  50. data/lib/project_types/extension/models/development_server_requirements.rb +35 -0
  51. data/lib/project_types/extension/models/lazy_specification_handler.rb +1 -1
  52. data/lib/project_types/extension/models/server_config/base.rb +31 -0
  53. data/lib/project_types/extension/models/server_config/development.rb +23 -0
  54. data/lib/project_types/extension/models/server_config/development_entries.rb +38 -0
  55. data/lib/project_types/extension/models/server_config/development_renderer.rb +30 -0
  56. data/lib/project_types/extension/models/server_config/extension.rb +35 -0
  57. data/lib/project_types/extension/models/server_config/root.rb +18 -0
  58. data/lib/project_types/extension/models/server_config/user.rb +10 -0
  59. data/lib/project_types/extension/models/specification.rb +1 -1
  60. data/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +1 -1
  61. data/lib/project_types/extension/models/specification_handlers/default.rb +14 -2
  62. data/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +1 -1
  63. data/lib/project_types/extension/models/specifications.rb +4 -4
  64. data/lib/project_types/extension/tasks/choose_next_available_port.rb +2 -2
  65. data/lib/project_types/extension/tasks/configure_features.rb +1 -1
  66. data/lib/project_types/extension/tasks/configure_options.rb +1 -1
  67. data/lib/project_types/extension/tasks/converters/product_converter.rb +1 -1
  68. data/lib/project_types/extension/tasks/converters/server_config_converter.rb +31 -0
  69. data/lib/project_types/extension/tasks/create_extension.rb +2 -2
  70. data/lib/project_types/extension/tasks/fetch_specifications.rb +2 -2
  71. data/lib/project_types/extension/tasks/find_npm_packages.rb +5 -5
  72. data/lib/project_types/extension/tasks/get_app.rb +2 -2
  73. data/lib/project_types/extension/tasks/get_apps.rb +2 -2
  74. data/lib/project_types/extension/tasks/get_extensions.rb +2 -2
  75. data/lib/project_types/extension/tasks/get_product.rb +2 -2
  76. data/lib/project_types/extension/tasks/load_server_config.rb +23 -0
  77. data/lib/project_types/extension/tasks/run_extension_command.rb +81 -0
  78. data/lib/project_types/extension/tasks/update_draft.rb +2 -2
  79. data/lib/project_types/node/cli.rb +3 -3
  80. data/lib/project_types/node/commands/connect.rb +4 -4
  81. data/lib/project_types/node/commands/create.rb +10 -14
  82. data/lib/project_types/node/commands/deploy/heroku.rb +4 -4
  83. data/lib/project_types/node/commands/deploy.rb +3 -3
  84. data/lib/project_types/node/commands/generate.rb +2 -2
  85. data/lib/project_types/node/commands/open.rb +3 -3
  86. data/lib/project_types/node/commands/serve.rb +15 -7
  87. data/lib/project_types/node/commands/tunnel.rb +6 -6
  88. data/lib/project_types/node/forms/create.rb +3 -3
  89. data/lib/project_types/node/messages/messages.rb +3 -0
  90. data/lib/project_types/php/cli.rb +27 -0
  91. data/lib/project_types/php/commands/connect.rb +19 -0
  92. data/lib/project_types/php/commands/create.rb +143 -0
  93. data/lib/project_types/php/commands/deploy/heroku.rb +129 -0
  94. data/lib/project_types/php/commands/deploy.rb +32 -0
  95. data/lib/project_types/php/commands/open.rb +16 -0
  96. data/lib/project_types/php/commands/serve.rb +51 -0
  97. data/lib/project_types/php/commands/tunnel.rb +37 -0
  98. data/lib/project_types/php/forms/create.rb +45 -0
  99. data/lib/project_types/php/messages/messages.rb +191 -0
  100. data/lib/project_types/rails/cli.rb +3 -3
  101. data/lib/project_types/rails/commands/connect.rb +4 -4
  102. data/lib/project_types/rails/commands/create.rb +12 -16
  103. data/lib/project_types/rails/commands/deploy/heroku.rb +4 -4
  104. data/lib/project_types/rails/commands/deploy.rb +3 -3
  105. data/lib/project_types/rails/commands/generate/webhook.rb +3 -3
  106. data/lib/project_types/rails/commands/generate.rb +3 -3
  107. data/lib/project_types/rails/commands/open.rb +3 -3
  108. data/lib/project_types/rails/commands/serve.rb +8 -8
  109. data/lib/project_types/rails/commands/tunnel.rb +6 -6
  110. data/lib/project_types/rails/forms/create.rb +3 -3
  111. data/lib/project_types/rails/gem.rb +1 -1
  112. data/lib/project_types/rails/ruby.rb +1 -1
  113. data/lib/project_types/script/cli.rb +16 -6
  114. data/lib/project_types/script/commands/create.rb +4 -2
  115. data/lib/project_types/script/commands/push.rb +2 -2
  116. data/lib/project_types/script/config/extension_points.yml +30 -29
  117. data/lib/project_types/script/forms/create.rb +1 -1
  118. data/lib/project_types/script/layers/application/create_script.rb +32 -12
  119. data/lib/project_types/script/layers/application/extension_points.rb +4 -4
  120. data/lib/project_types/script/layers/application/push_script.rb +13 -1
  121. data/lib/project_types/script/layers/domain/extension_point.rb +13 -45
  122. data/lib/project_types/script/layers/domain/push_package.rb +0 -12
  123. data/lib/project_types/script/layers/domain/script_project.rb +2 -2
  124. data/lib/project_types/script/layers/infrastructure/api_clients/partners_proxy_api_client.rb +57 -0
  125. data/lib/project_types/script/layers/infrastructure/api_clients/script_service_api_client.rb +35 -0
  126. data/lib/project_types/script/layers/infrastructure/command_runner.rb +1 -1
  127. data/lib/project_types/script/layers/infrastructure/errors.rb +5 -0
  128. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +10 -90
  129. data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +76 -11
  130. data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +1 -1
  131. data/lib/project_types/script/layers/infrastructure/languages/typescript_project_creator.rb +33 -0
  132. data/lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb +105 -0
  133. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +1 -1
  134. data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +6 -6
  135. data/lib/project_types/script/layers/infrastructure/script_service.rb +25 -144
  136. data/lib/project_types/script/layers/infrastructure/script_uploader.rb +27 -0
  137. data/lib/project_types/script/layers/infrastructure/service_locator.rb +20 -0
  138. data/lib/project_types/script/messages/messages.rb +4 -0
  139. data/lib/project_types/script/tasks/ensure_env.rb +7 -7
  140. data/lib/project_types/script/ui/error_handler.rb +84 -76
  141. data/lib/project_types/script/ui/printing_spinner.rb +1 -1
  142. data/lib/project_types/theme/cli.rb +3 -3
  143. data/lib/project_types/theme/commands/check.rb +3 -3
  144. data/lib/project_types/theme/commands/delete.rb +7 -7
  145. data/lib/project_types/theme/commands/init.rb +3 -3
  146. data/lib/project_types/theme/commands/language_server.rb +2 -2
  147. data/lib/project_types/theme/commands/package.rb +2 -2
  148. data/lib/project_types/theme/commands/publish.rb +5 -5
  149. data/lib/project_types/theme/commands/pull.rb +15 -9
  150. data/lib/project_types/theme/commands/push.rb +18 -12
  151. data/lib/project_types/theme/commands/serve.rb +4 -4
  152. data/lib/project_types/theme/forms/confirm_store.rb +1 -1
  153. data/lib/project_types/theme/forms/select.rb +2 -2
  154. data/lib/{shopify-cli → shopify_cli}/admin_api/populate_resource_command.rb +3 -3
  155. data/lib/{shopify-cli → shopify_cli}/admin_api/schema.rb +4 -4
  156. data/lib/{shopify-cli → shopify_cli}/admin_api.rb +27 -27
  157. data/lib/{shopify-cli → shopify_cli}/api.rb +8 -8
  158. data/lib/shopify_cli/command/app_sub_command.rb +16 -0
  159. data/lib/{shopify-cli → shopify_cli}/command.rb +3 -3
  160. data/lib/{shopify-cli → shopify_cli}/commands/config.rb +14 -14
  161. data/lib/{shopify-cli → shopify_cli}/commands/help.rb +4 -4
  162. data/lib/{shopify-cli → shopify_cli}/commands/login.rb +7 -7
  163. data/lib/shopify_cli/commands/logout.rb +39 -0
  164. data/lib/{shopify-cli → shopify_cli}/commands/populate/customer.rb +4 -4
  165. data/lib/{shopify-cli → shopify_cli}/commands/populate/draft_order.rb +4 -4
  166. data/lib/{shopify-cli → shopify_cli}/commands/populate/product.rb +4 -4
  167. data/lib/shopify_cli/commands/populate.rb +23 -0
  168. data/lib/shopify_cli/commands/store.rb +15 -0
  169. data/lib/{shopify-cli → shopify_cli}/commands/switch.rb +5 -5
  170. data/lib/{shopify-cli → shopify_cli}/commands/system.rb +10 -10
  171. data/lib/shopify_cli/commands/version.rb +15 -0
  172. data/lib/{shopify-cli → shopify_cli}/commands/whoami.rb +7 -7
  173. data/lib/shopify_cli/commands.rb +34 -0
  174. data/lib/{shopify-cli → shopify_cli}/connect.rb +3 -3
  175. data/lib/shopify_cli/constants.rb +54 -0
  176. data/lib/{shopify-cli → shopify_cli}/context.rb +6 -6
  177. data/lib/{shopify-cli → shopify_cli}/core/entry_point.rb +7 -7
  178. data/lib/{shopify-cli → shopify_cli}/core/executor.rb +8 -4
  179. data/lib/{shopify-cli → shopify_cli}/core/finalize.rb +1 -1
  180. data/lib/{shopify-cli → shopify_cli}/core/help_resolver.rb +2 -2
  181. data/lib/{shopify-cli → shopify_cli}/core/monorail.rb +8 -8
  182. data/lib/shopify_cli/core.rb +8 -0
  183. data/lib/{shopify-cli → shopify_cli}/db.rb +8 -8
  184. data/lib/shopify_cli/environment.rb +91 -0
  185. data/lib/shopify_cli/exception_reporter/permission_controller.rb +54 -0
  186. data/lib/shopify_cli/exception_reporter.rb +55 -0
  187. data/lib/{shopify-cli → shopify_cli}/feature.rb +8 -8
  188. data/lib/{shopify-cli → shopify_cli}/form.rb +2 -2
  189. data/lib/{shopify-cli → shopify_cli}/git.rb +38 -8
  190. data/lib/{shopify-cli → shopify_cli}/helpers/haikunator.rb +1 -1
  191. data/lib/shopify_cli/helpers.rb +5 -0
  192. data/lib/{shopify-cli → shopify_cli}/heroku.rb +38 -13
  193. data/lib/{shopify-cli → shopify_cli}/http_request.rb +1 -1
  194. data/lib/{shopify-cli → shopify_cli}/identity_auth/servlet.rb +1 -1
  195. data/lib/{shopify-cli → shopify_cli}/identity_auth.rb +24 -31
  196. data/lib/{shopify-cli → shopify_cli}/js_deps.rb +7 -7
  197. data/lib/{shopify-cli → shopify_cli}/js_system.rb +10 -10
  198. data/lib/{shopify-cli → shopify_cli}/lazy_delegator.rb +2 -2
  199. data/lib/{shopify-cli → shopify_cli}/messages/messages.rb +44 -2
  200. data/lib/{shopify-cli → shopify_cli}/method_object.rb +15 -8
  201. data/lib/shopify_cli/migrator/migration.rb +27 -0
  202. data/lib/shopify_cli/migrator/migrations/1631709766_noop.rb +13 -0
  203. data/lib/shopify_cli/migrator.rb +48 -0
  204. data/lib/{shopify-cli → shopify_cli}/options.rb +1 -1
  205. data/lib/{shopify-cli → shopify_cli}/packager.rb +8 -8
  206. data/lib/{shopify-cli → shopify_cli}/partners_api/organizations.rb +1 -1
  207. data/lib/{shopify-cli → shopify_cli}/partners_api.rb +16 -40
  208. data/lib/shopify_cli/php_deps.rb +102 -0
  209. data/lib/{shopify-cli → shopify_cli}/process_supervision.rb +23 -21
  210. data/lib/{shopify-cli → shopify_cli}/project.rb +15 -15
  211. data/lib/{shopify-cli → shopify_cli}/project_commands.rb +3 -3
  212. data/lib/{shopify-cli → shopify_cli}/project_type.rb +5 -5
  213. data/lib/{shopify-cli → shopify_cli}/resolve_constant.rb +5 -5
  214. data/lib/{shopify-cli → shopify_cli}/resources/env_file.rb +1 -1
  215. data/lib/shopify_cli/resources.rb +5 -0
  216. data/lib/{shopify-cli → shopify_cli}/result.rb +11 -11
  217. data/lib/{shopify-cli → shopify_cli}/shopifolk.rb +6 -6
  218. data/lib/{shopify-cli → shopify_cli}/sub_command.rb +1 -1
  219. data/lib/{shopify-cli → shopify_cli}/task.rb +1 -1
  220. data/lib/{shopify-cli → shopify_cli}/tasks/confirm_store.rb +3 -3
  221. data/lib/{shopify-cli → shopify_cli}/tasks/create_api_client.rb +4 -4
  222. data/lib/shopify_cli/tasks/ensure_authenticated.rb +13 -0
  223. data/lib/{shopify-cli → shopify_cli}/tasks/ensure_dev_store.rb +5 -5
  224. data/lib/{shopify-cli → shopify_cli}/tasks/ensure_env.rb +3 -3
  225. data/lib/{shopify-cli → shopify_cli}/tasks/ensure_loopback_url.rb +4 -4
  226. data/lib/{shopify-cli → shopify_cli}/tasks/ensure_project_type.rb +3 -3
  227. data/lib/{shopify-cli → shopify_cli}/tasks/select_org_and_shop.rb +8 -8
  228. data/lib/{shopify-cli → shopify_cli}/tasks/update_dashboard_urls.rb +6 -6
  229. data/lib/{shopify-cli → shopify_cli}/tasks.rb +10 -10
  230. data/lib/{shopify-cli → shopify_cli}/theme/dev_server/certificate_manager.rb +5 -5
  231. data/lib/{shopify-cli → shopify_cli}/theme/dev_server/header_hash.rb +5 -1
  232. data/lib/{shopify-cli → shopify_cli}/theme/dev_server/hot-reload.js +0 -0
  233. data/lib/{shopify-cli → shopify_cli}/theme/dev_server/hot_reload.rb +5 -6
  234. data/lib/{shopify-cli → shopify_cli}/theme/dev_server/local_assets.rb +1 -1
  235. data/lib/{shopify-cli → shopify_cli}/theme/dev_server/proxy.rb +15 -3
  236. data/lib/{shopify-cli → shopify_cli}/theme/dev_server/sse.rb +1 -1
  237. data/lib/{shopify-cli → shopify_cli}/theme/dev_server/watcher.rb +1 -1
  238. data/lib/{shopify-cli → shopify_cli}/theme/dev_server/web_server.rb +1 -1
  239. data/lib/{shopify-cli → shopify_cli}/theme/dev_server.rb +3 -3
  240. data/lib/shopify_cli/theme/development_theme.rb +83 -0
  241. data/lib/{shopify-cli → shopify_cli}/theme/file.rb +12 -4
  242. data/lib/{shopify-cli → shopify_cli}/theme/ignore_filter.rb +8 -1
  243. data/lib/{shopify-cli → shopify_cli}/theme/mime_type.rb +1 -1
  244. data/lib/{shopify-cli → shopify_cli}/theme/syncer.rb +7 -7
  245. data/lib/{shopify-cli → shopify_cli}/theme/theme.rb +4 -4
  246. data/lib/{shopify-cli → shopify_cli}/transform_data_structure.rb +4 -4
  247. data/lib/{shopify-cli → shopify_cli}/tunnel.rb +14 -14
  248. data/lib/shopify_cli/version.rb +3 -0
  249. data/lib/shopify_cli.rb +61 -50
  250. data/shopify-cli.gemspec +13 -5
  251. data/utilities/docker.rb +47 -0
  252. data/utilities/utilities.rb +5 -0
  253. metadata +155 -97
  254. data/.github/workflows/build.yml +0 -28
  255. data/lib/project_types/script/layers/infrastructure/languages/rust_project_creator.rb +0 -73
  256. data/lib/project_types/script/layers/infrastructure/languages/rust_task_runner.rb +0 -60
  257. data/lib/shopify-cli/commands/logout.rb +0 -39
  258. data/lib/shopify-cli/commands/populate.rb +0 -23
  259. data/lib/shopify-cli/commands/store.rb +0 -15
  260. data/lib/shopify-cli/commands/version.rb +0 -15
  261. data/lib/shopify-cli/commands.rb +0 -34
  262. data/lib/shopify-cli/core.rb +0 -8
  263. data/lib/shopify-cli/helpers.rb +0 -5
  264. data/lib/shopify-cli/resources.rb +0 -5
  265. data/lib/shopify-cli/tasks/ensure_authenticated.rb +0 -13
  266. data/lib/shopify-cli/theme/development_theme.rb +0 -69
  267. data/lib/shopify-cli/version.rb +0 -3
@@ -1,6 +1,6 @@
1
1
  require "fileutils"
2
2
 
3
- module ShopifyCli
3
+ module ShopifyCLI
4
4
  ##
5
5
  # ProcessSupervision wraps a running process spawned by `exec` and keeps track
6
6
  # if its `pid` and keeps a log file for it as well
@@ -19,7 +19,7 @@ module ShopifyCli
19
19
  class << self
20
20
  def run_dir
21
21
  # is the directory where the pid and logfile are kept
22
- File.join(ShopifyCli.cache_dir, "sv")
22
+ File.join(ShopifyCLI.cache_dir, "sv")
23
23
  end
24
24
 
25
25
  ##
@@ -36,7 +36,7 @@ module ShopifyCli
36
36
  # will be nil if the process is not running.
37
37
  #
38
38
  def for_ident(identifier)
39
- pid, time = File.read(File.join(ShopifyCli::ProcessSupervision.run_dir, "#{identifier}.pid")).split(":")
39
+ pid, time = File.read(File.join(ShopifyCLI::ProcessSupervision.run_dir, "#{identifier}.pid")).split(":")
40
40
  new(identifier, pid: Integer(pid), time: time)
41
41
  rescue Errno::ENOENT
42
42
  nil
@@ -50,19 +50,31 @@ module ShopifyCli
50
50
  #
51
51
  # * `identifier` - a string or symbol to identify the new process by.
52
52
  # * `args` - a command to run, either a string or array of strings
53
+ # * `force_spawn` - whether we want the child process to be a spawn and not a fork, so it is terminated along with
54
+ # the parent
53
55
  #
54
56
  # #### Returns
55
57
  #
56
58
  # * `process` - ProcessSupervision instance if the process is running, this
57
59
  # will be nil if the process did not start.
58
60
  #
59
- def start(identifier, args)
61
+ def start(identifier, args, force_spawn: false)
60
62
  return for_ident(identifier) if running?(identifier)
61
63
 
62
- # Windows doesn't support forking process without extra gems, so we resort to spawning a new child process -
63
- # that means that it dies along with the original process if it is interrupted. On UNIX, we fork the process so
64
- # that it doesn't have to be restarted on every run.
65
- if Context.new.windows?
64
+ # Some systems don't support forking process without extra gems, so we resort to spawning a new child process -
65
+ # that means that it dies along with the original process if it is interrupted. If possible, we fork the process
66
+ # so that it doesn't have to be restarted on every run.
67
+ if Process.respond_to?(:fork) && !force_spawn
68
+ fork do
69
+ pid_file = new(identifier, pid: Process.pid)
70
+ pid_file.write
71
+ STDOUT.reopen(pid_file.log_path, "w")
72
+ STDERR.reopen(pid_file.log_path, "w")
73
+ STDIN.reopen("/dev/null", "r")
74
+ Process.setsid
75
+ exec(*args)
76
+ end
77
+ else
66
78
  pid_file = new(identifier)
67
79
 
68
80
  # Make sure the file exists and is empty, otherwise Windows fails
@@ -77,16 +89,6 @@ module ShopifyCli
77
89
  pid_file.write
78
90
 
79
91
  Process.detach(pid)
80
- else
81
- fork do
82
- pid_file = new(identifier, pid: Process.pid)
83
- pid_file.write
84
- STDOUT.reopen(pid_file.log_path, "w")
85
- STDERR.reopen(pid_file.log_path, "w")
86
- STDIN.reopen("/dev/null", "r")
87
- Process.setsid
88
- exec(*args)
89
- end
90
92
  end
91
93
 
92
94
  sleep(0.1)
@@ -132,9 +134,9 @@ module ShopifyCli
132
134
  @identifier = identifier
133
135
  @pid = pid
134
136
  @time = time
135
- FileUtils.mkdir_p(ShopifyCli::ProcessSupervision.run_dir)
136
- @pid_path = File.join(ShopifyCli::ProcessSupervision.run_dir, "#{identifier}.pid")
137
- @log_path = File.join(ShopifyCli::ProcessSupervision.run_dir, "#{identifier}.log")
137
+ FileUtils.mkdir_p(ShopifyCLI::ProcessSupervision.run_dir)
138
+ @pid_path = File.join(ShopifyCLI::ProcessSupervision.run_dir, "#{identifier}.pid")
139
+ @log_path = File.join(ShopifyCLI::ProcessSupervision.run_dir, "#{identifier}.log")
138
140
  end
139
141
 
140
142
  ##
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
  require "shopify_cli"
3
3
 
4
- module ShopifyCli
4
+ module ShopifyCLI
5
5
  ##
6
- # ShopifyCli::Project captures the current project that the user is working on.
6
+ # ShopifyCLI::Project captures the current project that the user is working on.
7
7
  # This class can be used to fetch and save project environment as well as the
8
8
  # project config `.shopify-cli.yml`.
9
9
  #
@@ -25,13 +25,13 @@ module ShopifyCli
25
25
  #
26
26
  # #### Raises
27
27
  #
28
- # * `ShopifyCli::Abort` - If the cli is not currently in a project directory
28
+ # * `ShopifyCLI::Abort` - If the cli is not currently in a project directory
29
29
  # then this will be raised with a message implying that the user is not in
30
30
  # a project directory.
31
31
  #
32
32
  # #### Example
33
33
  #
34
- # project = ShopifyCli::Project.current
34
+ # project = ShopifyCLI::Project.current
35
35
  #
36
36
  def current(force_reload: false)
37
37
  clear if force_reload
@@ -60,7 +60,7 @@ module ShopifyCli
60
60
  #
61
61
  # #### Example
62
62
  #
63
- # type = ShopifyCli::Project.current_project_type
63
+ # type = ShopifyCLI::Project.current_project_type
64
64
  #
65
65
  def current_project_type
66
66
  return unless has_current?
@@ -81,7 +81,7 @@ module ShopifyCli
81
81
  #
82
82
  # #### Example
83
83
  #
84
- # type = ShopifyCli::Project.current_project_type
84
+ # type = ShopifyCLI::Project.current_project_type
85
85
  #
86
86
  def write(ctx, project_type:, organization_id:, **identifiers)
87
87
  require "yaml" # takes 20ms, so deferred as late as possible.
@@ -113,7 +113,7 @@ module ShopifyCli
113
113
  def at(dir)
114
114
  proj_dir = directory(dir)
115
115
  unless proj_dir
116
- raise(ShopifyCli::Abort, Context.message("core.project.error.not_in_project"))
116
+ raise(ShopifyCLI::Abort, Context.message("core.project.error.not_in_project"))
117
117
  end
118
118
  @at ||= Hash.new { |h, k| h[k] = new(directory: k) }
119
119
  @at[proj_dir]
@@ -136,11 +136,11 @@ module ShopifyCli
136
136
  #
137
137
  # #### Returns
138
138
  #
139
- # * `env` - An instance of a ShopifyCli::Resources::EnvFile
139
+ # * `env` - An instance of a ShopifyCLI::Resources::EnvFile
140
140
  #
141
141
  # #### Example
142
142
  #
143
- # ShopifyCli::Project.current.env
143
+ # ShopifyCLI::Project.current.env
144
144
  #
145
145
  def env
146
146
  @env ||= begin
@@ -159,18 +159,18 @@ module ShopifyCli
159
159
  #
160
160
  # #### Raises
161
161
  #
162
- # * `ShopifyCli::Abort` - If the yml is invalid or poorly formatted
163
- # * `ShopifyCli::Abort` - If the yml file does not exist
162
+ # * `ShopifyCLI::Abort` - If the yml is invalid or poorly formatted
163
+ # * `ShopifyCLI::Abort` - If the yml file does not exist
164
164
  #
165
165
  # #### Example
166
166
  #
167
- # ShopifyCli::Project.current.config
167
+ # ShopifyCLI::Project.current.config
168
168
  #
169
169
  def config
170
170
  @config ||= begin
171
171
  config = load_yaml_file(".shopify-cli.yml")
172
172
  unless config.is_a?(Hash)
173
- raise ShopifyCli::Abort, Context.message("core.yaml.error.not_hash", ".shopify-cli.yml")
173
+ raise ShopifyCLI::Abort, Context.message("core.yaml.error.not_hash", ".shopify-cli.yml")
174
174
  end
175
175
 
176
176
  # The app_type key was deprecated in favour of project_type, so replace it
@@ -191,12 +191,12 @@ module ShopifyCli
191
191
  begin
192
192
  YAML.load_file(f)
193
193
  rescue Psych::SyntaxError => e
194
- raise(ShopifyCli::Abort, Context.message("core.yaml.error.invalid", relative_path, e.message))
194
+ raise(ShopifyCLI::Abort, Context.message("core.yaml.error.invalid", relative_path, e.message))
195
195
  # rescue Errno::EACCES => e
196
196
  # TODO
197
197
  # Dev::Helpers::EaccesHandler.diagnose_and_raise(f, e, mode: :read)
198
198
  rescue Errno::ENOENT
199
- raise ShopifyCli::Abort, Context.message("core.yaml.error.not_found", f)
199
+ raise ShopifyCLI::Abort, Context.message("core.yaml.error.not_found", f)
200
200
  end
201
201
  end
202
202
  end
@@ -1,4 +1,4 @@
1
- module ShopifyCli
1
+ module ShopifyCLI
2
2
  class ProjectCommands < Command
3
3
  def call(*)
4
4
  @ctx.puts(self.class.help)
@@ -6,9 +6,9 @@ module ShopifyCli
6
6
 
7
7
  def self.help
8
8
  project_type = name.split("::")[0].downcase
9
- ShopifyCli::Context.message(
9
+ ShopifyCLI::Context.message(
10
10
  "#{project_type}.help",
11
- ShopifyCli::TOOL_NAME,
11
+ ShopifyCLI::TOOL_NAME,
12
12
  subcommand_registry.command_names.join(" | ")
13
13
  )
14
14
  end
@@ -1,4 +1,4 @@
1
- module ShopifyCli
1
+ module ShopifyCLI
2
2
  class ProjectType
3
3
  extend Feature::Set
4
4
 
@@ -20,7 +20,7 @@ module ShopifyCli
20
20
  end
21
21
 
22
22
  def load_type(current_type, shallow = false)
23
- filepath = File.join(ShopifyCli::ROOT, "lib", "project_types", current_type.to_s, "cli.rb")
23
+ filepath = File.join(ShopifyCLI::ROOT, "lib", "project_types", current_type.to_s, "cli.rb")
24
24
  return unless File.exist?(filepath)
25
25
  @shallow_load = shallow
26
26
  @current_type = current_type
@@ -31,7 +31,7 @@ module ShopifyCli
31
31
  end
32
32
 
33
33
  def load_all
34
- Dir.glob(File.join(ShopifyCli::ROOT, "lib", "project_types", "*", "cli.rb")).map do |filepath|
34
+ Dir.glob(File.join(ShopifyCLI::ROOT, "lib", "project_types", "*", "cli.rb")).map do |filepath|
35
35
  load_type(filepath.split(File::Separator)[-2].to_sym, true)
36
36
  end
37
37
  end
@@ -41,7 +41,7 @@ module ShopifyCli
41
41
  end
42
42
 
43
43
  def project_filepath(path)
44
- File.join(ShopifyCli::PROJECT_TYPES_DIR, project_type.to_s, path)
44
+ File.join(ShopifyCLI::PROJECT_TYPES_DIR, project_type.to_s, path)
45
45
  end
46
46
 
47
47
  def title(name)
@@ -50,7 +50,7 @@ module ShopifyCli
50
50
 
51
51
  def register_task(task, name)
52
52
  return if project_load_shallow
53
- ShopifyCli::Tasks.register(task, name)
53
+ ShopifyCLI::Tasks.register(task, name)
54
54
  end
55
55
 
56
56
  def register_messages(messages)
@@ -4,13 +4,13 @@
4
4
  # are resolved relative to `Kernal`, but the top-level namespace is
5
5
  # configurable:
6
6
  #
7
- # ShopifyCli::Resolve.call(:object).value # => Object
8
- # ShopifyCli::Resolve.call('minitest/test').value # => MiniTest::Test
9
- # ShopifyCli::Resolve.call(:test, namespace: MiniTest) # => MiniTest::Test
7
+ # ShopifyCLI::Resolve.call(:object).value # => Object
8
+ # ShopifyCLI::Resolve.call('minitest/test').value # => MiniTest::Test
9
+ # ShopifyCLI::Resolve.call(:test, namespace: MiniTest) # => MiniTest::Test
10
10
  #
11
- module ShopifyCli
11
+ module ShopifyCLI
12
12
  class ResolveConstant
13
- include ShopifyCli::MethodObject
13
+ include ShopifyCLI::MethodObject
14
14
  property! :namespace, accepts: ->(ns) { ns.respond_to?(:const_get) }, default: -> { Kernel }
15
15
 
16
16
  def call(name)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module ShopifyCli
3
+ module ShopifyCLI
4
4
  module Resources
5
5
  class EnvFile
6
6
  include SmartProperties
@@ -0,0 +1,5 @@
1
+ module ShopifyCLI
2
+ module Resources
3
+ autoload :EnvFile, "shopify_cli/resources/env_file"
4
+ end
5
+ end
@@ -1,4 +1,4 @@
1
- module ShopifyCli
1
+ module ShopifyCLI
2
2
  ##
3
3
  # This module defines two containers for wrapping the result of an action. One
4
4
  # for signifying the successful execution of an action and one for signifying
@@ -261,8 +261,8 @@ module ShopifyCli
261
261
  end
262
262
 
263
263
  ##
264
- # raises an `ShopifyCli::Result::UnexpectedError` as a
265
- # `ShopifyCli::Result::Failure` does not carry a success value.
264
+ # raises an `ShopifyCLI::Result::UnexpectedError` as a
265
+ # `ShopifyCLI::Result::Failure` does not carry a success value.
266
266
  #
267
267
  def value
268
268
  raise UnexpectedFailure
@@ -342,7 +342,7 @@ module ShopifyCli
342
342
  end
343
343
 
344
344
  ##
345
- # wraps the given value into a `ShopifyCli::Result::Success` container
345
+ # wraps the given value into a `ShopifyCLI::Result::Success` container
346
346
  #
347
347
  # #### Parameters
348
348
  #
@@ -353,7 +353,7 @@ module ShopifyCli
353
353
  end
354
354
 
355
355
  ##
356
- # wraps the given value into a `ShopifyCli::Result::Failure` container
356
+ # wraps the given value into a `ShopifyCLI::Result::Failure` container
357
357
  #
358
358
  # #### Parameters
359
359
  #
@@ -367,8 +367,8 @@ module ShopifyCli
367
367
  # takes either a value or a block and chooses the appropriate result
368
368
  # container based on the type of the value or the type of the block's return
369
369
  # value. If the type is an exception, it is wrapped in a
370
- # `ShopifyCli::Result::Failure` and otherwise in a
371
- # `ShopifyCli::Result::Success`. If a block was provided instead of value, a
370
+ # `ShopifyCLI::Result::Failure` and otherwise in a
371
+ # `ShopifyCLI::Result::Success`. If a block was provided instead of value, a
372
372
  # `Proc` is returned and the result wrapping doesn't occur until the block
373
373
  # is invoked.
374
374
  #
@@ -384,12 +384,12 @@ module ShopifyCli
384
384
  #
385
385
  # #### Examples
386
386
  #
387
- # Result.wrap(1) # => ShopifyCli::Result::Success
388
- # Result.wrap(RuntimeError.new) # => ShopifyCli::Result::Failure
387
+ # Result.wrap(1) # => ShopifyCLI::Result::Success
388
+ # Result.wrap(RuntimeError.new) # => ShopifyCLI::Result::Failure
389
389
  #
390
390
  # Result.wrap { 1 } # => Proc
391
- # Result.wrap { 1 }.call # => ShopifyCli::Result::Success
392
- # Result.wrap { raise }.call # => ShopifyCli::Result::Failure
391
+ # Result.wrap { 1 }.call # => ShopifyCLI::Result::Success
392
+ # Result.wrap { raise }.call # => ShopifyCLI::Result::Failure
393
393
  #
394
394
  # Result.wrap { |s| s.upcase }.call("hello").tap do |result|
395
395
  # result # => Result::Success
@@ -1,6 +1,6 @@
1
- module ShopifyCli
1
+ module ShopifyCLI
2
2
  ##
3
- # ShopifyCli::Shopifolk contains the logic to determine if the user appears to be a Shopify staff
3
+ # ShopifyCLI::Shopifolk contains the logic to determine if the user appears to be a Shopify staff
4
4
  #
5
5
  # The Shopifolk Feature flag will persist between runs so if the flag is enabled or disabled,
6
6
  # it will still be in that same state until the next class invocation.
@@ -20,10 +20,10 @@ module ShopifyCli
20
20
  #
21
21
  # #### Example
22
22
  #
23
- # ShopifyCli::Shopifolk.check
23
+ # ShopifyCLI::Shopifolk.check
24
24
  #
25
25
  def check
26
- ShopifyCli::Shopifolk.new.shopifolk?
26
+ ShopifyCLI::Shopifolk.new.shopifolk?
27
27
  end
28
28
 
29
29
  def act_as_shopify_organization
@@ -52,10 +52,10 @@ module ShopifyCli
52
52
  return true if Feature.enabled?(FEATURE_NAME)
53
53
 
54
54
  if shopifolk_by_gcloud? && shopifolk_by_dev?
55
- ShopifyCli::Feature.enable(FEATURE_NAME)
55
+ ShopifyCLI::Feature.enable(FEATURE_NAME)
56
56
  true
57
57
  else
58
- ShopifyCli::Feature.disable(FEATURE_NAME)
58
+ ShopifyCLI::Feature.disable(FEATURE_NAME)
59
59
  false
60
60
  end
61
61
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require "shopify_cli"
3
3
 
4
- module ShopifyCli
4
+ module ShopifyCLI
5
5
  class SubCommand < Command
6
6
  class << self
7
7
  def call(args, command_name, parent_command)
@@ -1,6 +1,6 @@
1
1
  require "shopify_cli"
2
2
 
3
- module ShopifyCli
3
+ module ShopifyCLI
4
4
  class Task
5
5
  def self.call(*args, **kwargs)
6
6
  task = new
@@ -1,11 +1,11 @@
1
1
  require "shopify_cli"
2
2
 
3
- module ShopifyCli
3
+ module ShopifyCLI
4
4
  module Tasks
5
- class ConfirmStore < ShopifyCli::Task
5
+ class ConfirmStore < ShopifyCLI::Task
6
6
  def call(ctx)
7
7
  @ctx = ctx
8
- store = ShopifyCli::AdminAPI.get_shop_or_abort(ctx)
8
+ store = ShopifyCLI::AdminAPI.get_shop_or_abort(ctx)
9
9
  if CLI::UI::Prompt.confirm(ctx.message("core.tasks.confirm_store.prompt", store), default: false)
10
10
  ctx.puts(ctx.message("core.tasks.confirm_store.confirmation", store))
11
11
  else
@@ -1,13 +1,13 @@
1
1
  require "shopify_cli"
2
2
 
3
- module ShopifyCli
3
+ module ShopifyCLI
4
4
  module Tasks
5
- class CreateApiClient < ShopifyCli::Task
5
+ class CreateApiClient < ShopifyCLI::Task
6
6
  VALID_APP_TYPES = %w(public custom)
7
7
  DEFAULT_APP_URL = "https://shopify.github.io/shopify-cli/help/start-app/"
8
8
 
9
9
  def call(ctx, org_id:, title:, type:)
10
- resp = ShopifyCli::PartnersAPI.query(
10
+ resp = ShopifyCLI::PartnersAPI.query(
11
11
  ctx,
12
12
  "create_app",
13
13
  org: org_id.to_i,
@@ -31,7 +31,7 @@ module ShopifyCli
31
31
  ctx.abort(user_errors.map { |err| "#{err["field"]} #{err["message"]}" }.join(", "))
32
32
  end
33
33
 
34
- ShopifyCli::Core::Monorail.metadata[:api_key] = resp.dig("data", "appCreate", "app", "apiKey")
34
+ ShopifyCLI::Core::Monorail.metadata[:api_key] = resp.dig("data", "appCreate", "app", "apiKey")
35
35
 
36
36
  resp.dig("data", "appCreate", "app")
37
37
  end
@@ -0,0 +1,13 @@
1
+ require "shopify_cli"
2
+
3
+ module ShopifyCLI
4
+ module Tasks
5
+ class EnsureAuthenticated < ShopifyCLI::Task
6
+ def call(ctx)
7
+ ctx.abort(
8
+ ctx.message("core.identity_auth.login_prompt", ShopifyCLI::TOOL_NAME)
9
+ ) unless ShopifyCLI::IdentityAuth::IDENTITY_ACCESS_TOKENS.all? { |key| ShopifyCLI::DB.exists?(key) }
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,8 +1,8 @@
1
1
  require "shopify_cli"
2
2
 
3
- module ShopifyCli
3
+ module ShopifyCLI
4
4
  module Tasks
5
- class EnsureDevStore < ShopifyCli::Task
5
+ class EnsureDevStore < ShopifyCLI::Task
6
6
  def call(ctx)
7
7
  @ctx = ctx
8
8
  return ctx.abort(ctx.message(
@@ -12,7 +12,7 @@ module ShopifyCli
12
12
  return unless CLI::UI::Prompt.confirm(
13
13
  ctx.message("core.tasks.ensure_dev_store.convert_to_dev_store", project.env.shop)
14
14
  )
15
- ShopifyCli::PartnersAPI.query(ctx, "convert_dev_to_test_store", input: {
15
+ ShopifyCLI::PartnersAPI.query(ctx, "convert_dev_to_test_store", input: {
16
16
  organizationID: shop["orgID"].to_i,
17
17
  shopId: shop["shopId"],
18
18
  })
@@ -22,13 +22,13 @@ module ShopifyCli
22
22
  private
23
23
 
24
24
  def project
25
- @project ||= ShopifyCli::Project.current
25
+ @project ||= ShopifyCLI::Project.current
26
26
  end
27
27
 
28
28
  def shop
29
29
  @shop ||= begin
30
30
  current_domain = project.env.shop
31
- ShopifyCli::PartnersAPI::Organizations.fetch_all(@ctx).map do |org|
31
+ ShopifyCLI::PartnersAPI::Organizations.fetch_all(@ctx).map do |org|
32
32
  org["stores"].find do |store|
33
33
  store["orgID"] = org["id"]
34
34
  store["shopDomain"] == current_domain
@@ -1,8 +1,8 @@
1
1
  require "shopify_cli"
2
2
 
3
- module ShopifyCli
3
+ module ShopifyCLI
4
4
  module Tasks
5
- class EnsureEnv < ShopifyCli::Task
5
+ class EnsureEnv < ShopifyCLI::Task
6
6
  def call(ctx, regenerate: false, required: [:api_key, :secret])
7
7
  @ctx = ctx
8
8
  env_data =
@@ -50,7 +50,7 @@ module ShopifyCli
50
50
  handler.option(@ctx.message("core.tasks.ensure_env.app_type.select_public")) { "public" }
51
51
  handler.option(@ctx.message("core.tasks.ensure_env.app_type.select_custom")) { "custom" }
52
52
  end
53
- ShopifyCli::Tasks::CreateApiClient.call(@ctx, org_id: org_id, title: title, type: type)
53
+ ShopifyCLI::Tasks::CreateApiClient.call(@ctx, org_id: org_id, title: title, type: type)
54
54
  else
55
55
  CLI::UI::Prompt.ask(@ctx.message("core.tasks.ensure_env.app_select")) do |handler|
56
56
  apps.each { |app| handler.option(app["title"]) { app } }
@@ -1,16 +1,16 @@
1
- module ShopifyCli
1
+ module ShopifyCLI
2
2
  module Tasks
3
- class EnsureLoopbackURL < ShopifyCli::Task
3
+ class EnsureLoopbackURL < ShopifyCLI::Task
4
4
  def call(ctx)
5
5
  @ctx = ctx
6
6
  api_key = Project.current.env.api_key
7
- result = ShopifyCli::PartnersAPI.query(ctx, "get_app_urls", apiKey: api_key)
7
+ result = ShopifyCLI::PartnersAPI.query(ctx, "get_app_urls", apiKey: api_key)
8
8
  loopback = IdentityAuth::REDIRECT_HOST
9
9
  app = result["data"]["app"]
10
10
  urls = app["redirectUrlWhitelist"]
11
11
  if urls.grep(/#{loopback}/).empty?
12
12
  with_loopback = urls.push(loopback)
13
- ShopifyCli::PartnersAPI.query(@ctx, "update_dashboard_urls", input: {
13
+ ShopifyCLI::PartnersAPI.query(@ctx, "update_dashboard_urls", input: {
14
14
  redirectUrlWhitelist: with_loopback, apiKey: api_key
15
15
  })
16
16
  end
@@ -1,10 +1,10 @@
1
1
  require "shopify_cli"
2
2
 
3
- module ShopifyCli
3
+ module ShopifyCLI
4
4
  module Tasks
5
- class EnsureProjectType < ShopifyCli::Task
5
+ class EnsureProjectType < ShopifyCLI::Task
6
6
  def call(ctx, project_type)
7
- return true if project_type.to_sym == ShopifyCli::Project.current_project_type
7
+ return true if project_type.to_sym == ShopifyCLI::Project.current_project_type
8
8
  ctx.abort(ctx.message("core.tasks.ensure_project_type.wrong_project_type", project_type))
9
9
  end
10
10
  end
@@ -1,8 +1,8 @@
1
1
  require "shopify_cli"
2
2
 
3
- module ShopifyCli
3
+ module ShopifyCLI
4
4
  module Tasks
5
- class SelectOrgAndShop < ShopifyCli::Task
5
+ class SelectOrgAndShop < ShopifyCLI::Task
6
6
  attr_reader :ctx
7
7
 
8
8
  def call(ctx, organization_id: nil, shop_domain: nil)
@@ -12,7 +12,7 @@ module ShopifyCli
12
12
  unless Shopifolk.acting_as_shopify_organization?
13
13
  shop_domain ||= get_shop_domain(org)
14
14
  end
15
- ShopifyCli::Core::Monorail.metadata[:organization_id] = org["id"].to_i
15
+ ShopifyCLI::Core::Monorail.metadata[:organization_id] = org["id"].to_i
16
16
  response(org["id"].to_i, shop_domain)
17
17
  end
18
18
 
@@ -25,20 +25,20 @@ module ShopifyCli
25
25
  end
26
26
 
27
27
  def organizations
28
- @organizations ||= ShopifyCli::PartnersAPI::Organizations.fetch_all(ctx)
28
+ @organizations ||= ShopifyCLI::PartnersAPI::Organizations.fetch_all(ctx)
29
29
  end
30
30
 
31
31
  def get_organization(organization_id)
32
32
  @organization ||= if !organization_id.nil?
33
- org = ShopifyCli::PartnersAPI::Organizations.fetch(ctx, id: organization_id)
33
+ org = ShopifyCLI::PartnersAPI::Organizations.fetch(ctx, id: organization_id)
34
34
  if org.nil?
35
- ctx.puts(ctx.message("core.tasks.select_org_and_shop.authentication_issue", ShopifyCli::TOOL_NAME))
35
+ ctx.puts(ctx.message("core.tasks.select_org_and_shop.authentication_issue", ShopifyCLI::TOOL_NAME))
36
36
  ctx.abort(ctx.message("core.tasks.select_org_and_shop.error.organization_not_found"))
37
37
  end
38
38
  org
39
39
  elsif organizations.count == 0
40
40
  if Shopifolk.acting_as_shopify_organization?
41
- ctx.abort(ctx.message("core.tasks.select_org_and_shop.error.shopifolk_notice", ShopifyCli::TOOL_NAME))
41
+ ctx.abort(ctx.message("core.tasks.select_org_and_shop.error.shopifolk_notice", ShopifyCLI::TOOL_NAME))
42
42
  else
43
43
  ctx.abort(ctx.message("core.tasks.select_org_and_shop.error.no_organizations"))
44
44
  end
@@ -64,7 +64,7 @@ module ShopifyCli
64
64
  if valid_stores.count == 0
65
65
  ctx.puts(ctx.message("core.tasks.select_org_and_shop.error.no_development_stores"))
66
66
  ctx.puts(ctx.message("core.tasks.select_org_and_shop.create_store", organization["id"]))
67
- ctx.puts(ctx.message("core.tasks.select_org_and_shop.authentication_issue", ShopifyCli::TOOL_NAME))
67
+ ctx.puts(ctx.message("core.tasks.select_org_and_shop.authentication_issue", ShopifyCLI::TOOL_NAME))
68
68
  elsif valid_stores.count == 1
69
69
  domain = valid_stores.first["shopDomain"]
70
70
  ctx.puts(ctx.message("core.tasks.select_org_and_shop.development_store", domain))
@@ -1,24 +1,24 @@
1
- module ShopifyCli
1
+ module ShopifyCLI
2
2
  module Tasks
3
- class UpdateDashboardURLS < ShopifyCli::Task
3
+ class UpdateDashboardURLS < ShopifyCLI::Task
4
4
  NGROK_REGEX = /https:\/\/([a-z0-9\-]+\.ngrok\.io)(.*)/
5
5
 
6
6
  def call(ctx, url:, callback_url:)
7
7
  @ctx = ctx
8
- project = ShopifyCli::Project.current
8
+ project = ShopifyCLI::Project.current
9
9
  api_key = project.env.api_key
10
- result = ShopifyCli::PartnersAPI.query(ctx, "get_app_urls", apiKey: api_key)
10
+ result = ShopifyCLI::PartnersAPI.query(ctx, "get_app_urls", apiKey: api_key)
11
11
  app = result["data"]["app"]
12
12
  consent = check_application_url(app["applicationUrl"], url)
13
13
  constructed_urls = construct_redirect_urls(app["redirectUrlWhitelist"], url, callback_url)
14
14
  return if url == app["applicationUrl"]
15
- ShopifyCli::PartnersAPI.query(@ctx, "update_dashboard_urls", input: {
15
+ ShopifyCLI::PartnersAPI.query(@ctx, "update_dashboard_urls", input: {
16
16
  applicationUrl: consent ? url : app["applicationUrl"],
17
17
  redirectUrlWhitelist: constructed_urls, apiKey: api_key
18
18
  })
19
19
  @ctx.puts(@ctx.message("core.tasks.update_dashboard_urls.updated"))
20
20
  rescue
21
- @ctx.puts(@ctx.message("core.tasks.update_dashboard_urls.update_error", ShopifyCli::TOOL_NAME))
21
+ @ctx.puts(@ctx.message("core.tasks.update_dashboard_urls.update_error", ShopifyCLI::TOOL_NAME))
22
22
  raise
23
23
  end
24
24