shopify-cli 2.0.0 → 2.2.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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -0
  3. data/Gemfile.lock +4 -4
  4. data/README.md +3 -1
  5. data/RELEASING.md +2 -0
  6. data/THEMEKIT_MIGRATION.md +18 -0
  7. data/lib/graphql/api_versions.graphql +1 -1
  8. data/lib/graphql/get_variant_id.graphql +16 -0
  9. data/lib/project_types/extension/cli.rb +10 -1
  10. data/lib/project_types/extension/commands/check.rb +44 -0
  11. data/lib/project_types/extension/commands/serve.rb +8 -2
  12. data/lib/project_types/extension/extension_project.rb +39 -1
  13. data/lib/project_types/extension/extension_project_keys.rb +1 -0
  14. data/lib/project_types/extension/features/argo_runtime.rb +6 -38
  15. data/lib/project_types/extension/features/argo_serve.rb +30 -1
  16. data/lib/project_types/extension/features/runtimes/admin.rb +29 -0
  17. data/lib/project_types/extension/features/runtimes/base.rb +19 -0
  18. data/lib/project_types/extension/features/runtimes/checkout_post_purchase.rb +23 -0
  19. data/lib/project_types/extension/features/runtimes/checkout_ui_extension.rb +29 -0
  20. data/lib/project_types/extension/messages/messages.rb +19 -6
  21. data/lib/project_types/extension/models/product.rb +12 -0
  22. data/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +10 -2
  23. data/lib/project_types/extension/models/specification_handlers/default.rb +13 -4
  24. data/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +15 -0
  25. data/lib/project_types/extension/tasks/configure_features.rb +1 -0
  26. data/lib/project_types/extension/tasks/converters/product_converter.rb +21 -0
  27. data/lib/project_types/extension/tasks/get_product.rb +22 -0
  28. data/lib/project_types/node/messages/messages.rb +1 -1
  29. data/lib/project_types/rails/messages/messages.rb +18 -18
  30. data/lib/project_types/script/commands/create.rb +1 -1
  31. data/lib/project_types/script/graphql/app_script_update_or_create.graphql +3 -3
  32. data/lib/project_types/script/layers/infrastructure/script_service.rb +17 -2
  33. data/lib/project_types/theme/cli.rb +1 -0
  34. data/lib/project_types/theme/commands/init.rb +42 -0
  35. data/lib/project_types/theme/commands/serve.rb +3 -1
  36. data/lib/project_types/theme/forms/select.rb +1 -1
  37. data/lib/project_types/theme/messages/messages.rb +14 -3
  38. data/lib/shopify-cli/admin_api.rb +6 -2
  39. data/lib/shopify-cli/api.rb +2 -2
  40. data/lib/shopify-cli/context.rb +1 -1
  41. data/lib/shopify-cli/core/monorail.rb +8 -3
  42. data/lib/shopify-cli/http_request.rb +6 -0
  43. data/lib/shopify-cli/messages/messages.rb +9 -8
  44. data/lib/shopify-cli/packager.rb +5 -5
  45. data/lib/shopify-cli/theme/dev_server.rb +5 -5
  46. data/lib/shopify-cli/theme/dev_server/local_assets.rb +1 -1
  47. data/lib/shopify-cli/theme/file.rb +2 -2
  48. data/lib/shopify-cli/theme/syncer.rb +9 -5
  49. data/lib/shopify-cli/theme/theme.rb +5 -5
  50. data/lib/shopify-cli/tunnel.rb +1 -1
  51. data/lib/shopify-cli/version.rb +1 -1
  52. data/shopify-cli.gemspec +1 -1
  53. metadata +15 -4
@@ -20,9 +20,9 @@ module ShopifyCli
20
20
  path.read
21
21
  end
22
22
 
23
- def write(content)
23
+ def write(*args)
24
24
  path.parent.mkpath unless path.parent.directory?
25
- path.write(content)
25
+ path.write(*args)
26
26
  end
27
27
 
28
28
  def delete
@@ -149,7 +149,7 @@ module ShopifyCli
149
149
  # Process lower-priority files in the background
150
150
 
151
151
  # Assets are served locally, so can be uploaded in the background
152
- enqueue_updates(@theme.asset_files)
152
+ enqueue_updates(@theme.static_asset_files)
153
153
 
154
154
  unless delay_low_priority_files
155
155
  wait!(&block)
@@ -254,8 +254,12 @@ module ShopifyCli
254
254
 
255
255
  update_checksums(body)
256
256
 
257
- value = body.dig("asset", "value") || Base64.decode64(body.dig("asset", "attachment"))
258
- file.write(value)
257
+ attachment = body.dig("asset", "attachment")
258
+ value = if attachment
259
+ file.write(Base64.decode64(attachment), 0, mode: "wb")
260
+ else
261
+ file.write(body.dig("asset", "value"))
262
+ end
259
263
 
260
264
  response
261
265
  end
@@ -277,7 +281,7 @@ module ShopifyCli
277
281
 
278
282
  def update_checksums(api_response)
279
283
  api_response.values.flatten.each do |asset|
280
- if asset["key"] && asset["checksum"]
284
+ if asset["key"]
281
285
  @checksums[asset["key"]] = asset["checksum"]
282
286
  end
283
287
  end
@@ -310,7 +314,7 @@ module ShopifyCli
310
314
 
311
315
  def backoff_if_near_limit!(used, limit)
312
316
  if used > limit - @threads.size
313
- @ctx.debug("Near API call limit, waiting 2 sec ...")
317
+ @ctx.debug("Near API call limit, waiting 2 sec")
314
318
  @backoff_mutex.synchronize { sleep 2 }
315
319
  end
316
320
  end
@@ -20,11 +20,11 @@ module ShopifyCli
20
20
  end
21
21
 
22
22
  def theme_files
23
- glob(["**/*.liquid", "**/*.json", "assets/*"])
23
+ glob(["**/*.liquid", "**/*.json", "assets/*"]).uniq
24
24
  end
25
25
 
26
- def asset_files
27
- glob("assets/*")
26
+ def static_asset_files
27
+ glob("assets/*").reject(&:liquid?)
28
28
  end
29
29
 
30
30
  def liquid_files
@@ -43,8 +43,8 @@ module ShopifyCli
43
43
  theme_files.include?(self[file])
44
44
  end
45
45
 
46
- def asset_paths
47
- asset_files.map(&:relative_path)
46
+ def static_asset_paths
47
+ static_asset_files.map(&:relative_path)
48
48
  end
49
49
 
50
50
  def [](file)
@@ -149,7 +149,7 @@ module ShopifyCli
149
149
  check_prereq_command(ctx, "curl")
150
150
  check_prereq_command(ctx, ctx.linux? ? "unzip" : "tar")
151
151
  spinner = CLI::UI::SpinGroup.new
152
- spinner.add("Installing ngrok...") do
152
+ spinner.add(ctx.message("core.tunnel.installing")) do
153
153
  zip_dest = File.join(ShopifyCli.cache_dir, "ngrok.zip")
154
154
  unless File.exist?(zip_dest)
155
155
  ctx.system("curl", "-o", zip_dest, DOWNLOAD_URLS[ctx.os], chdir: ShopifyCli.cache_dir)
@@ -1,3 +1,3 @@
1
1
  module ShopifyCli
2
- VERSION = "2.0.0"
2
+ VERSION = "2.2.0"
3
3
  end
data/shopify-cli.gemspec CHANGED
@@ -44,5 +44,5 @@ Gem::Specification.new do |spec|
44
44
  spec.add_development_dependency("minitest", "~> 5.0")
45
45
 
46
46
  spec.add_dependency("listen", "~> 3.5")
47
- spec.add_dependency("theme-check", "~> 1.0")
47
+ spec.add_dependency("theme-check", "~> 1.1")
48
48
  end
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: 2.0.0
4
+ version: 2.2.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-06-28 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.0'
81
+ version: '1.1'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.0'
88
+ version: '1.1'
89
89
  description: |
90
90
  Shopify CLI helps you build Shopify apps faster. It quickly scaffolds Node.js
91
91
  and Ruby on Rails embedded apps. It also automates many common tasks in the
@@ -121,6 +121,7 @@ files:
121
121
  - RELEASING.md
122
122
  - Rakefile
123
123
  - SECURITY.md
124
+ - THEMEKIT_MIGRATION.md
124
125
  - bin/load_shopify.rb
125
126
  - bin/shopify
126
127
  - dev.yml
@@ -158,9 +159,11 @@ files:
158
159
  - lib/graphql/find_organization.graphql
159
160
  - lib/graphql/get_app_by_api_key.graphql
160
161
  - lib/graphql/get_app_urls.graphql
162
+ - lib/graphql/get_variant_id.graphql
161
163
  - lib/graphql/update_dashboard_urls.graphql
162
164
  - lib/project_types/extension/cli.rb
163
165
  - lib/project_types/extension/commands/build.rb
166
+ - lib/project_types/extension/commands/check.rb
164
167
  - lib/project_types/extension/commands/connect.rb
165
168
  - lib/project_types/extension/commands/create.rb
166
169
  - lib/project_types/extension/commands/extension_command.rb
@@ -180,6 +183,10 @@ files:
180
183
  - lib/project_types/extension/features/argo_setup.rb
181
184
  - lib/project_types/extension/features/argo_setup_step.rb
182
185
  - lib/project_types/extension/features/argo_setup_steps.rb
186
+ - lib/project_types/extension/features/runtimes/admin.rb
187
+ - lib/project_types/extension/features/runtimes/base.rb
188
+ - lib/project_types/extension/features/runtimes/checkout_post_purchase.rb
189
+ - lib/project_types/extension/features/runtimes/checkout_ui_extension.rb
183
190
  - lib/project_types/extension/forms/connect.rb
184
191
  - lib/project_types/extension/forms/create.rb
185
192
  - lib/project_types/extension/forms/questions/ask_app.rb
@@ -191,6 +198,7 @@ files:
191
198
  - lib/project_types/extension/models/app.rb
192
199
  - lib/project_types/extension/models/lazy_specification_handler.rb
193
200
  - lib/project_types/extension/models/npm_package.rb
201
+ - lib/project_types/extension/models/product.rb
194
202
  - lib/project_types/extension/models/registration.rb
195
203
  - lib/project_types/extension/models/specification.rb
196
204
  - lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb
@@ -204,6 +212,7 @@ files:
204
212
  - lib/project_types/extension/tasks/configure_features.rb
205
213
  - lib/project_types/extension/tasks/configure_options.rb
206
214
  - lib/project_types/extension/tasks/converters/app_converter.rb
215
+ - lib/project_types/extension/tasks/converters/product_converter.rb
207
216
  - lib/project_types/extension/tasks/converters/registration_converter.rb
208
217
  - lib/project_types/extension/tasks/converters/validation_error_converter.rb
209
218
  - lib/project_types/extension/tasks/converters/version_converter.rb
@@ -213,6 +222,7 @@ files:
213
222
  - lib/project_types/extension/tasks/get_app.rb
214
223
  - lib/project_types/extension/tasks/get_apps.rb
215
224
  - lib/project_types/extension/tasks/get_extensions.rb
225
+ - lib/project_types/extension/tasks/get_product.rb
216
226
  - lib/project_types/extension/tasks/update_draft.rb
217
227
  - lib/project_types/extension/tasks/user_errors.rb
218
228
  - lib/project_types/node/cli.rb
@@ -280,6 +290,7 @@ files:
280
290
  - lib/project_types/theme/cli.rb
281
291
  - lib/project_types/theme/commands/check.rb
282
292
  - lib/project_types/theme/commands/delete.rb
293
+ - lib/project_types/theme/commands/init.rb
283
294
  - lib/project_types/theme/commands/language_server.rb
284
295
  - lib/project_types/theme/commands/package.rb
285
296
  - lib/project_types/theme/commands/publish.rb