shopify-cli 1.6.0 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile +12 -12
  4. data/Rakefile +32 -30
  5. data/bin/load_shopify.rb +6 -6
  6. data/bin/shopify +2 -2
  7. data/ext/shopify-cli/extconf.rb +7 -7
  8. data/lib/docgen/markdown.rb +11 -11
  9. data/lib/{project_types/extension/graphql → graphql}/get_app_by_api_key.graphql +0 -0
  10. data/lib/project_types/extension/cli.rb +52 -45
  11. data/lib/project_types/extension/commands/build.rb +3 -3
  12. data/lib/project_types/extension/commands/create.rb +16 -9
  13. data/lib/project_types/extension/commands/extension_command.rb +8 -5
  14. data/lib/project_types/extension/commands/push.rb +8 -8
  15. data/lib/project_types/extension/commands/register.rb +19 -30
  16. data/lib/project_types/extension/commands/serve.rb +2 -2
  17. data/lib/project_types/extension/commands/tunnel.rb +12 -12
  18. data/lib/project_types/extension/extension_project.rb +4 -4
  19. data/lib/project_types/extension/extension_project_keys.rb +4 -4
  20. data/lib/project_types/extension/features/argo.rb +13 -13
  21. data/lib/project_types/extension/features/argo_config.rb +5 -5
  22. data/lib/project_types/extension/features/argo_dependencies.rb +5 -5
  23. data/lib/project_types/extension/features/argo_setup.rb +2 -2
  24. data/lib/project_types/extension/features/argo_setup_steps.rb +4 -4
  25. data/lib/project_types/extension/forms/create.rb +28 -34
  26. data/lib/project_types/extension/forms/questions/ask_app.rb +53 -0
  27. data/lib/project_types/extension/forms/questions/ask_name.rb +40 -0
  28. data/lib/project_types/extension/forms/questions/ask_type.rb +36 -0
  29. data/lib/project_types/extension/messages/messages.rb +53 -52
  30. data/lib/project_types/extension/models/lazy_specification_handler.rb +12 -0
  31. data/lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb +1 -1
  32. data/lib/project_types/extension/models/specification_handlers/default.rb +2 -2
  33. data/lib/project_types/extension/models/specifications.rb +3 -3
  34. data/lib/project_types/extension/tasks/configure_features.rb +4 -4
  35. data/lib/project_types/extension/tasks/converters/app_converter.rb +6 -6
  36. data/lib/project_types/extension/tasks/converters/registration_converter.rb +6 -6
  37. data/lib/project_types/extension/tasks/converters/validation_error_converter.rb +4 -4
  38. data/lib/project_types/extension/tasks/converters/version_converter.rb +7 -7
  39. data/lib/project_types/extension/tasks/create_extension.rb +4 -4
  40. data/lib/project_types/extension/tasks/fetch_specifications.rb +4 -4
  41. data/lib/project_types/extension/tasks/get_app.rb +4 -4
  42. data/lib/project_types/extension/tasks/get_apps.rb +3 -3
  43. data/lib/project_types/extension/tasks/update_draft.rb +4 -4
  44. data/lib/project_types/extension/tasks/user_errors.rb +4 -4
  45. data/lib/project_types/node/cli.rb +19 -19
  46. data/lib/project_types/node/commands/connect.rb +3 -3
  47. data/lib/project_types/node/commands/create.rb +40 -38
  48. data/lib/project_types/node/commands/deploy.rb +4 -4
  49. data/lib/project_types/node/commands/deploy/heroku.rb +24 -24
  50. data/lib/project_types/node/commands/generate.rb +8 -8
  51. data/lib/project_types/node/commands/open.rb +2 -2
  52. data/lib/project_types/node/commands/populate.rb +6 -6
  53. data/lib/project_types/node/commands/populate/customer.rb +5 -5
  54. data/lib/project_types/node/commands/populate/draft_order.rb +5 -5
  55. data/lib/project_types/node/commands/populate/product.rb +5 -5
  56. data/lib/project_types/node/commands/serve.rb +9 -9
  57. data/lib/project_types/node/commands/tunnel.rb +7 -7
  58. data/lib/project_types/node/forms/create.rb +7 -7
  59. data/lib/project_types/node/messages/messages.rb +3 -3
  60. data/lib/project_types/rails/cli.rb +21 -21
  61. data/lib/project_types/rails/commands/connect.rb +3 -3
  62. data/lib/project_types/rails/commands/create.rb +51 -48
  63. data/lib/project_types/rails/commands/deploy.rb +4 -4
  64. data/lib/project_types/rails/commands/deploy/heroku.rb +30 -30
  65. data/lib/project_types/rails/commands/generate.rb +7 -7
  66. data/lib/project_types/rails/commands/generate/webhook.rb +6 -6
  67. data/lib/project_types/rails/commands/open.rb +2 -2
  68. data/lib/project_types/rails/commands/populate.rb +6 -6
  69. data/lib/project_types/rails/commands/populate/customer.rb +5 -5
  70. data/lib/project_types/rails/commands/populate/draft_order.rb +5 -5
  71. data/lib/project_types/rails/commands/populate/product.rb +5 -5
  72. data/lib/project_types/rails/commands/serve.rb +11 -11
  73. data/lib/project_types/rails/commands/tunnel.rb +7 -7
  74. data/lib/project_types/rails/forms/create.rb +23 -23
  75. data/lib/project_types/rails/gem.rb +23 -23
  76. data/lib/project_types/rails/messages/messages.rb +4 -4
  77. data/lib/project_types/rails/ruby.rb +2 -2
  78. data/lib/project_types/script/cli.rb +40 -40
  79. data/lib/project_types/script/commands/create.rb +9 -8
  80. data/lib/project_types/script/commands/disable.rb +3 -3
  81. data/lib/project_types/script/commands/enable.rb +9 -7
  82. data/lib/project_types/script/commands/push.rb +5 -4
  83. data/lib/project_types/script/errors.rb +17 -0
  84. data/lib/project_types/script/forms/create.rb +5 -5
  85. data/lib/project_types/script/graphql/app_script_update_or_create.graphql +2 -0
  86. data/lib/project_types/script/layers/application/build_script.rb +6 -8
  87. data/lib/project_types/script/layers/application/create_script.rb +2 -2
  88. data/lib/project_types/script/layers/application/disable_script.rb +2 -2
  89. data/lib/project_types/script/layers/application/enable_script.rb +2 -2
  90. data/lib/project_types/script/layers/application/project_dependencies.rb +4 -4
  91. data/lib/project_types/script/layers/application/push_script.rb +4 -12
  92. data/lib/project_types/script/layers/domain/push_package.rb +5 -1
  93. data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +3 -3
  94. data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +10 -10
  95. data/lib/project_types/script/layers/infrastructure/errors.rb +1 -1
  96. data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +2 -2
  97. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +12 -17
  98. data/lib/project_types/script/layers/infrastructure/rust_project_creator.rb +4 -4
  99. data/lib/project_types/script/layers/infrastructure/rust_task_runner.rb +1 -1
  100. data/lib/project_types/script/layers/infrastructure/script_service.rb +18 -16
  101. data/lib/project_types/script/messages/messages.rb +14 -8
  102. data/lib/project_types/script/script_project.rb +27 -5
  103. data/lib/project_types/script/ui/error_handler.rb +80 -68
  104. data/lib/project_types/script/ui/printing_spinner.rb +1 -1
  105. data/lib/project_types/script/ui/strict_spinner.rb +1 -1
  106. data/lib/project_types/theme/cli.rb +19 -19
  107. data/lib/project_types/theme/commands/connect.rb +12 -12
  108. data/lib/project_types/theme/commands/create.rb +11 -11
  109. data/lib/project_types/theme/commands/deploy.rb +8 -8
  110. data/lib/project_types/theme/commands/generate.rb +3 -3
  111. data/lib/project_types/theme/commands/generate/env.rb +15 -15
  112. data/lib/project_types/theme/commands/push.rb +15 -15
  113. data/lib/project_types/theme/commands/serve.rb +5 -5
  114. data/lib/project_types/theme/forms/connect.rb +4 -4
  115. data/lib/project_types/theme/forms/create.rb +5 -5
  116. data/lib/project_types/theme/tasks/ensure_themekit_installed.rb +22 -22
  117. data/lib/project_types/theme/themekit.rb +15 -15
  118. data/lib/rubygems_plugin.rb +3 -3
  119. data/lib/shopify-cli/admin_api.rb +11 -11
  120. data/lib/shopify-cli/admin_api/populate_resource_command.rb +17 -17
  121. data/lib/shopify-cli/admin_api/schema.rb +3 -3
  122. data/lib/shopify-cli/api.rb +10 -10
  123. data/lib/shopify-cli/command.rb +1 -1
  124. data/lib/shopify-cli/commands.rb +9 -9
  125. data/lib/shopify-cli/commands/config.rb +28 -52
  126. data/lib/shopify-cli/commands/connect.rb +10 -10
  127. data/lib/shopify-cli/commands/create.rb +5 -5
  128. data/lib/shopify-cli/commands/help.rb +6 -6
  129. data/lib/shopify-cli/commands/logout.rb +3 -3
  130. data/lib/shopify-cli/commands/system.rb +32 -32
  131. data/lib/shopify-cli/commands/version.rb +2 -2
  132. data/lib/shopify-cli/context.rb +23 -23
  133. data/lib/shopify-cli/core.rb +4 -4
  134. data/lib/shopify-cli/core/entry_point.rb +5 -5
  135. data/lib/shopify-cli/core/executor.rb +1 -1
  136. data/lib/shopify-cli/core/help_resolver.rb +2 -2
  137. data/lib/shopify-cli/core/monorail.rb +16 -16
  138. data/lib/shopify-cli/db.rb +2 -2
  139. data/lib/shopify-cli/feature.rb +1 -1
  140. data/lib/shopify-cli/form.rb +1 -1
  141. data/lib/shopify-cli/git.rb +17 -17
  142. data/lib/shopify-cli/helpers.rb +1 -1
  143. data/lib/shopify-cli/helpers/haikunator.rb +1 -1
  144. data/lib/shopify-cli/heroku.rb +28 -28
  145. data/lib/shopify-cli/http_request.rb +2 -2
  146. data/lib/shopify-cli/js_deps.rb +12 -12
  147. data/lib/shopify-cli/js_system.rb +5 -5
  148. data/lib/shopify-cli/lazy_delegator.rb +55 -0
  149. data/lib/shopify-cli/messages/messages.rb +4 -14
  150. data/lib/shopify-cli/oauth.rb +25 -25
  151. data/lib/shopify-cli/oauth/servlet.rb +9 -9
  152. data/lib/shopify-cli/options.rb +3 -3
  153. data/lib/shopify-cli/packager.rb +24 -24
  154. data/lib/shopify-cli/partners_api.rb +16 -16
  155. data/lib/shopify-cli/partners_api/organizations.rb +10 -10
  156. data/lib/shopify-cli/process_supervision.rb +7 -7
  157. data/lib/shopify-cli/project.rb +16 -16
  158. data/lib/shopify-cli/project_type.rb +3 -3
  159. data/lib/shopify-cli/resources.rb +1 -1
  160. data/lib/shopify-cli/resources/env_file.rb +9 -9
  161. data/lib/shopify-cli/result.rb +8 -8
  162. data/lib/shopify-cli/shopifolk.rb +6 -9
  163. data/lib/shopify-cli/sub_command.rb +1 -1
  164. data/lib/shopify-cli/task.rb +3 -3
  165. data/lib/shopify-cli/tasks.rb +7 -7
  166. data/lib/shopify-cli/tasks/create_api_client.rb +5 -5
  167. data/lib/shopify-cli/tasks/ensure_dev_store.rb +11 -11
  168. data/lib/shopify-cli/tasks/ensure_env.rb +15 -15
  169. data/lib/shopify-cli/tasks/ensure_loopback_url.rb +4 -4
  170. data/lib/shopify-cli/tasks/select_org_and_shop.rb +19 -19
  171. data/lib/shopify-cli/tasks/update_dashboard_urls.rb +10 -10
  172. data/lib/shopify-cli/transform_data_structure.rb +86 -0
  173. data/lib/shopify-cli/tunnel.rb +30 -30
  174. data/lib/shopify-cli/version.rb +1 -1
  175. data/lib/shopify_cli.rb +56 -54
  176. data/shopify-cli.gemspec +6 -6
  177. data/vendor/gen/template/bin/update-deps +9 -9
  178. metadata +9 -4
  179. data/lib/project_types/extension/forms/register.rb +0 -47
@@ -1,3 +1,3 @@
1
1
  module ShopifyCli
2
- VERSION = '1.6.0'
2
+ VERSION = "1.7.0"
3
3
  end
data/lib/shopify_cli.rb CHANGED
@@ -8,7 +8,7 @@ Thread.report_on_exception = false
8
8
  # require_relative 'support/ruby_backports'
9
9
 
10
10
  # See bin/load_shopify.rb
11
- ENV['PATH'] = ENV['PATH'].split(':').select { |p| p.start_with?('/', '~') }.join(':') unless defined?($original_env)
11
+ ENV["PATH"] = ENV["PATH"].split(":").select { |p| p.start_with?("/", "~") }.join(":") unless defined?($original_env)
12
12
 
13
13
  # Load vendor and CLI UI/Kit.
14
14
  # Nothing else should be loaded at this point and nothing else should be added to the load path on boot
@@ -21,10 +21,10 @@ deps.each do |dep|
21
21
  $LOAD_PATH.unshift(vendor_path) unless $LOAD_PATH.include?(vendor_path)
22
22
  end
23
23
 
24
- require 'cli/ui'
25
- require 'cli/kit'
26
- require 'smart_properties'
27
- require_relative 'shopify-cli/version'
24
+ require "cli/ui"
25
+ require "cli/kit"
26
+ require "smart_properties"
27
+ require_relative "shopify-cli/version"
28
28
 
29
29
  # Enable stdout routing. At this point all calls to STDOUT (and STDERR) will go through this class.
30
30
  # See https://github.com/Shopify/cli-ui/blob/master/lib/cli/ui/stdout_router.rb for more info
@@ -39,16 +39,16 @@ CLI::UI::StdoutRouter.enable
39
39
  module ShopifyCli
40
40
  extend CLI::Kit::Autocall
41
41
 
42
- TOOL_NAME = 'shopify'
43
- TOOL_FULL_NAME = 'Shopify CLI'
44
- ROOT = File.expand_path('../..', __FILE__)
45
- PROJECT_TYPES_DIR = File.join(ROOT, 'lib', 'project_types')
46
- TEMP_DIR = File.join(ROOT, '.tmp')
42
+ TOOL_NAME = "shopify"
43
+ TOOL_FULL_NAME = "Shopify CLI"
44
+ ROOT = File.expand_path("../..", __FILE__)
45
+ PROJECT_TYPES_DIR = File.join(ROOT, "lib", "project_types")
46
+ TEMP_DIR = File.join(ROOT, ".tmp")
47
47
 
48
48
  # programmer emoji if default install location, else wrench emoji
49
- EMOJI = ROOT == '/opt/shopify' ? "\u{1f469}\u{200d}\u{1f4bb}" : "\u{1f527}"
49
+ EMOJI = ROOT == "/opt/shopify" ? "\u{1f469}\u{200d}\u{1f4bb}" : "\u{1f527}"
50
50
  # shrug or boom emoji
51
- FAILMOJI = ROOT == '/opt/shopify' ? "\u{1f937}" : "\u{1f4a5}"
51
+ FAILMOJI = ROOT == "/opt/shopify" ? "\u{1f937}" : "\u{1f4a5}"
52
52
 
53
53
  # Exit management in `shopify-app-cli` follows the management set out by CLI Kit.
54
54
  # https://github.com/Shopify/cli-kit/blob/master/lib/cli/kit.rb
@@ -94,47 +94,49 @@ module ShopifyCli
94
94
  )
95
95
  end
96
96
 
97
- autoload :AdminAPI, 'shopify-cli/admin_api'
98
- autoload :API, 'shopify-cli/api'
99
- autoload :Command, 'shopify-cli/command'
100
- autoload :Commands, 'shopify-cli/commands'
101
- autoload :Context, 'shopify-cli/context'
102
- autoload :Core, 'shopify-cli/core'
103
- autoload :DB, 'shopify-cli/db'
104
- autoload :Feature, 'shopify-cli/feature'
105
- autoload :Form, 'shopify-cli/form'
106
- autoload :Git, 'shopify-cli/git'
107
- autoload :Helpers, 'shopify-cli/helpers'
108
- autoload :Heroku, 'shopify-cli/heroku'
109
- autoload :JsDeps, 'shopify-cli/js_deps'
110
- autoload :JsSystem, 'shopify-cli/js_system'
111
- autoload :MethodObject, 'shopify-cli/method_object'
112
- autoload :Log, 'shopify-cli/log'
113
- autoload :OAuth, 'shopify-cli/oauth'
114
- autoload :Options, 'shopify-cli/options'
115
- autoload :PartnersAPI, 'shopify-cli/partners_api'
116
- autoload :ProcessSupervision, 'shopify-cli/process_supervision'
117
- autoload :Project, 'shopify-cli/project'
118
- autoload :ProjectType, 'shopify-cli/project_type'
119
- autoload :ResolveConstant, 'shopify-cli/resolve_constant'
120
- autoload :Resources, 'shopify-cli/resources'
121
- autoload :Result, 'shopify-cli/result'
122
- autoload :Shopifolk, 'shopify-cli/shopifolk'
123
- autoload :SubCommand, 'shopify-cli/sub_command'
124
- autoload :Task, 'shopify-cli/task'
125
- autoload :Tasks, 'shopify-cli/tasks'
126
- autoload :Tunnel, 'shopify-cli/tunnel'
127
-
128
- require 'shopify-cli/messages/messages'
97
+ autoload :AdminAPI, "shopify-cli/admin_api"
98
+ autoload :API, "shopify-cli/api"
99
+ autoload :Command, "shopify-cli/command"
100
+ autoload :Commands, "shopify-cli/commands"
101
+ autoload :Context, "shopify-cli/context"
102
+ autoload :Core, "shopify-cli/core"
103
+ autoload :DB, "shopify-cli/db"
104
+ autoload :Feature, "shopify-cli/feature"
105
+ autoload :Form, "shopify-cli/form"
106
+ autoload :Git, "shopify-cli/git"
107
+ autoload :Helpers, "shopify-cli/helpers"
108
+ autoload :Heroku, "shopify-cli/heroku"
109
+ autoload :JsDeps, "shopify-cli/js_deps"
110
+ autoload :JsSystem, "shopify-cli/js_system"
111
+ autoload :MethodObject, "shopify-cli/method_object"
112
+ autoload :LazyDelegator, "shopify-cli/lazy_delegator"
113
+ autoload :Log, "shopify-cli/log"
114
+ autoload :OAuth, "shopify-cli/oauth"
115
+ autoload :Options, "shopify-cli/options"
116
+ autoload :PartnersAPI, "shopify-cli/partners_api"
117
+ autoload :ProcessSupervision, "shopify-cli/process_supervision"
118
+ autoload :Project, "shopify-cli/project"
119
+ autoload :ProjectType, "shopify-cli/project_type"
120
+ autoload :ResolveConstant, "shopify-cli/resolve_constant"
121
+ autoload :Resources, "shopify-cli/resources"
122
+ autoload :Result, "shopify-cli/result"
123
+ autoload :Shopifolk, "shopify-cli/shopifolk"
124
+ autoload :SubCommand, "shopify-cli/sub_command"
125
+ autoload :Task, "shopify-cli/task"
126
+ autoload :Tasks, "shopify-cli/tasks"
127
+ autoload :TransformDataStructure, "shopify-cli/transform_data_structure"
128
+ autoload :Tunnel, "shopify-cli/tunnel"
129
+
130
+ require "shopify-cli/messages/messages"
129
131
  Context.load_messages(ShopifyCli::Messages::MESSAGES)
130
132
 
131
133
  def self.cache_dir
132
- cache_dir = if ENV.key?('RUNNING_SHOPIFY_CLI_TESTS')
134
+ cache_dir = if ENV.key?("RUNNING_SHOPIFY_CLI_TESTS")
133
135
  TEMP_DIR
134
- elsif ENV['LOCALAPPDATA'].nil?
135
- File.join(File.expand_path(ENV.fetch('XDG_CACHE_HOME', '~/.cache')), TOOL_NAME)
136
+ elsif ENV["LOCALAPPDATA"].nil?
137
+ File.join(File.expand_path(ENV.fetch("XDG_CACHE_HOME", "~/.cache")), TOOL_NAME)
136
138
  else
137
- File.join(File.expand_path(ENV['LOCALAPPDATA']), TOOL_NAME)
139
+ File.join(File.expand_path(ENV["LOCALAPPDATA"]), TOOL_NAME)
138
140
  end
139
141
 
140
142
  # Make sure the cache dir always exists
@@ -144,20 +146,20 @@ module ShopifyCli
144
146
  end
145
147
 
146
148
  def self.tool_config_path
147
- if ENV.key?('RUNNING_SHOPIFY_CLI_TESTS')
149
+ if ENV.key?("RUNNING_SHOPIFY_CLI_TESTS")
148
150
  TEMP_DIR
149
- elsif ENV['APPDATA'].nil?
150
- File.join(File.expand_path(ENV.fetch('XDG_CONFIG_HOME', '~/.config')), TOOL_NAME)
151
+ elsif ENV["APPDATA"].nil?
152
+ File.join(File.expand_path(ENV.fetch("XDG_CONFIG_HOME", "~/.config")), TOOL_NAME)
151
153
  else
152
- File.join(File.expand_path(ENV['APPDATA']), TOOL_NAME)
154
+ File.join(File.expand_path(ENV["APPDATA"]), TOOL_NAME)
153
155
  end
154
156
  end
155
157
 
156
158
  def self.log_file
157
- File.join(tool_config_path, 'logs', 'log.log')
159
+ File.join(tool_config_path, "logs", "log.log")
158
160
  end
159
161
 
160
162
  def self.debug_log_file
161
- File.join(tool_config_path, 'logs', 'debug.log')
163
+ File.join(tool_config_path, "logs", "debug.log")
162
164
  end
163
165
  end
data/shopify-cli.gemspec CHANGED
@@ -1,11 +1,11 @@
1
- require_relative 'lib/shopify-cli/version'
1
+ require_relative "lib/shopify-cli/version"
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "shopify-cli"
5
5
  spec.version = ShopifyCli::VERSION
6
6
  spec.authors = ["Shopify"]
7
7
  spec.email = ["dev-tools-education@shopify.com"]
8
- spec.license = 'MIT'
8
+ spec.license = "MIT"
9
9
 
10
10
  spec.summary = "Shopify CLI helps you build Shopify apps faster."
11
11
  spec.description = <<~HERE
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
 
26
26
  # Specify which files should be added to the gem when it is released.
27
27
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
28
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
28
+ spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
29
29
  %x(git ls-files -z).split("\x0").reject do |f|
30
30
  f.match(%r{^(test|spec|features|packaging)/}) ||
31
31
  f.match(%r{^bin/(update-deps|shopify.bat)$})
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
  spec.require_paths = ["lib", "vendor"]
36
36
  spec.extensions = ["ext/shopify-cli/extconf.rb"]
37
37
 
38
- spec.add_development_dependency('bundler', '~> 1.17')
39
- spec.add_development_dependency('rake', '~> 12.3', '>= 12.3.3')
40
- spec.add_development_dependency('minitest', '~> 5.0')
38
+ spec.add_development_dependency("bundler", "~> 1.17")
39
+ spec.add_development_dependency("rake", "~> 12.3", ">= 12.3.3")
40
+ spec.add_development_dependency("minitest", "~> 5.0")
41
41
  end
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  $LOAD_PATH.unshift(File.expand_path("../../vendor/deps/cli-ui/lib", __FILE__))
4
- require 'open3'
5
- require 'fileutils'
4
+ require "open3"
5
+ require "fileutils"
6
6
 
7
7
  def fmt(tag, msg)
8
8
  # Not really CLI::UI.fmt compatible: no nesting support, for example.
@@ -27,7 +27,7 @@ def warn(msg)
27
27
  end
28
28
 
29
29
  def source_path
30
- File.expand_path(ENV.fetch('SOURCE_ROOT', File.expand_path('../../..', __FILE__)))
30
+ File.expand_path(ENV.fetch("SOURCE_ROOT", File.expand_path("../../..", __FILE__)))
31
31
  end
32
32
 
33
33
  deps = %w(cli-ui cli-kit)
@@ -50,18 +50,18 @@ deps.each do |dep|
50
50
  dirty = false
51
51
 
52
52
  Dir.chdir(path) do
53
- _, _, stat = Open3.capture3('git fetch origin master')
53
+ _, _, stat = Open3.capture3("git fetch origin master")
54
54
  bail("couldn't git fetch in dependency: {{yellow:#{dep}}}") unless stat.success?
55
55
 
56
- head_sha, stat = Open3.capture2('git rev-parse HEAD')
56
+ head_sha, stat = Open3.capture2("git rev-parse HEAD")
57
57
  bail("couldn't determine HEAD: {{yellow:#{dep}}}") unless stat.success?
58
58
  head_sha.chomp!
59
59
 
60
- fetch_head_sha, stat = Open3.capture2('git rev-parse FETCH_HEAD')
60
+ fetch_head_sha, stat = Open3.capture2("git rev-parse FETCH_HEAD")
61
61
  bail("couldn't determine FETCH_HEAD: {{yellow:#{dep}}}") unless stat.success?
62
62
  fetch_head_sha.chomp!
63
63
 
64
- git_status, stat = Open3.capture2('git status --porcelain')
64
+ git_status, stat = Open3.capture2("git status --porcelain")
65
65
  bail("couldn't determine git status: {{yellow:#{dep}}}") unless stat.success?
66
66
 
67
67
  if head_sha != fetch_head_sha
@@ -84,8 +84,8 @@ deps.each do |dep|
84
84
  depdir = File.expand_path("../../vendor/deps/#{dep}", __FILE__)
85
85
  FileUtils.rm_rf(depdir)
86
86
  FileUtils.mkdir_p(depdir)
87
- dstlib = File.expand_path('lib', depdir)
88
- srclib = File.expand_path('lib', path)
87
+ dstlib = File.expand_path("lib", depdir)
88
+ srclib = File.expand_path("lib", path)
89
89
 
90
90
  FileUtils.cp_r(srclib, dstlib)
91
91
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-26 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -127,6 +127,7 @@ files:
127
127
  - lib/graphql/extension_create.graphql
128
128
  - lib/graphql/extension_update_draft.graphql
129
129
  - lib/graphql/find_organization.graphql
130
+ - lib/graphql/get_app_by_api_key.graphql
130
131
  - lib/graphql/get_app_urls.graphql
131
132
  - lib/graphql/update_dashboard_urls.graphql
132
133
  - lib/project_types/extension/cli.rb
@@ -146,11 +147,13 @@ files:
146
147
  - lib/project_types/extension/features/argo_setup_step.rb
147
148
  - lib/project_types/extension/features/argo_setup_steps.rb
148
149
  - lib/project_types/extension/forms/create.rb
149
- - lib/project_types/extension/forms/register.rb
150
- - lib/project_types/extension/graphql/get_app_by_api_key.graphql
150
+ - lib/project_types/extension/forms/questions/ask_app.rb
151
+ - lib/project_types/extension/forms/questions/ask_name.rb
152
+ - lib/project_types/extension/forms/questions/ask_type.rb
151
153
  - lib/project_types/extension/messages/message_loading.rb
152
154
  - lib/project_types/extension/messages/messages.rb
153
155
  - lib/project_types/extension/models/app.rb
156
+ - lib/project_types/extension/models/lazy_specification_handler.rb
154
157
  - lib/project_types/extension/models/registration.rb
155
158
  - lib/project_types/extension/models/specification.rb
156
159
  - lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb
@@ -284,6 +287,7 @@ files:
284
287
  - lib/shopify-cli/http_request.rb
285
288
  - lib/shopify-cli/js_deps.rb
286
289
  - lib/shopify-cli/js_system.rb
290
+ - lib/shopify-cli/lazy_delegator.rb
287
291
  - lib/shopify-cli/messages/messages.rb
288
292
  - lib/shopify-cli/method_object.rb
289
293
  - lib/shopify-cli/oauth.rb
@@ -309,6 +313,7 @@ files:
309
313
  - lib/shopify-cli/tasks/ensure_loopback_url.rb
310
314
  - lib/shopify-cli/tasks/select_org_and_shop.rb
311
315
  - lib/shopify-cli/tasks/update_dashboard_urls.rb
316
+ - lib/shopify-cli/transform_data_structure.rb
312
317
  - lib/shopify-cli/tunnel.rb
313
318
  - lib/shopify-cli/version.rb
314
319
  - lib/shopify_cli.rb
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Extension
4
- module Forms
5
- class Register < ShopifyCli::Form
6
- flag_arguments :api_key
7
-
8
- attr_reader :app
9
-
10
- def ask
11
- self.app = ask_app
12
- end
13
-
14
- private
15
-
16
- attr_writer :app
17
-
18
- def ask_app
19
- if !api_key.nil?
20
- found_app = Tasks::GetApp.call(context: ctx, api_key: api_key)
21
- ctx.abort(ctx.message('register.invalid_api_key', api_key)) if found_app.nil?
22
- found_app
23
- else
24
- apps = load_apps
25
- CLI::UI::Prompt.ask(ctx.message('register.ask_app')) do |handler|
26
- apps.each do |app|
27
- handler.option("#{app.title} by #{app.business_name}") { app }
28
- end
29
- end
30
- end
31
- end
32
-
33
- def load_apps
34
- ctx.puts(@ctx.message('register.loading_apps'))
35
- apps = Tasks::GetApps.call(context: ctx)
36
-
37
- apps.empty? ? abort_no_apps : apps
38
- end
39
-
40
- def abort_no_apps
41
- ctx.puts(@ctx.message('register.no_apps'))
42
- ctx.puts(@ctx.message('register.learn_about_apps'))
43
- raise ShopifyCli::AbortSilent
44
- end
45
- end
46
- end
47
- end