shopify-cli 2.12.0 → 2.13.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/shopify.yml +2 -1
  3. data/.rubocop.yml +1 -1
  4. data/.ruby-version +1 -1
  5. data/CHANGELOG.md +10 -0
  6. data/Gemfile.lock +14 -14
  7. data/bin/shopify +4 -4
  8. data/dev.yml +1 -1
  9. data/ext/javy/hashes/javy-arm-macos-v0.2.0.gz.sha256 +1 -0
  10. data/ext/javy/hashes/javy-x86_64-linux-v0.2.0.gz.sha256 +1 -0
  11. data/ext/javy/hashes/javy-x86_64-macos-v0.2.0.gz.sha256 +1 -0
  12. data/ext/javy/hashes/javy-x86_64-windows-v0.2.0.gz.sha256 +1 -0
  13. data/ext/javy/version +1 -1
  14. data/lib/project_types/extension/features/argo_setup_steps.rb +4 -6
  15. data/lib/project_types/extension/tasks/configure_features.rb +15 -2
  16. data/lib/project_types/extension/tasks/convert_server_config.rb +2 -1
  17. data/lib/project_types/script/commands/create.rb +4 -4
  18. data/lib/project_types/script/errors.rb +1 -1
  19. data/lib/project_types/script/forms/create.rb +7 -7
  20. data/lib/project_types/script/layers/application/build_script.rb +22 -24
  21. data/lib/project_types/script/layers/application/create_script.rb +9 -10
  22. data/lib/project_types/script/layers/application/project_dependencies.rb +12 -14
  23. data/lib/project_types/script/layers/application/push_script.rb +2 -0
  24. data/lib/project_types/script/layers/domain/errors.rb +3 -3
  25. data/lib/project_types/script/layers/domain/push_package.rb +6 -0
  26. data/lib/project_types/script/layers/domain/script_config.rb +2 -4
  27. data/lib/project_types/script/layers/domain/script_project.rb +3 -2
  28. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +19 -4
  29. data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +0 -15
  30. data/lib/project_types/script/layers/infrastructure/languages/typescript_project_creator.rb +19 -4
  31. data/lib/project_types/script/layers/infrastructure/languages/wasm_project_creator.rb +0 -3
  32. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +4 -0
  33. data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +13 -25
  34. data/lib/project_types/script/layers/infrastructure/script_service.rb +4 -2
  35. data/lib/project_types/script/messages/messages.rb +7 -7
  36. data/lib/project_types/script/ui/error_handler.rb +4 -4
  37. data/lib/project_types/script/ui/strict_spinner.rb +4 -6
  38. data/lib/project_types/theme/cli.rb +2 -0
  39. data/lib/project_types/theme/commands/common/root_helper.rb +11 -5
  40. data/lib/project_types/theme/commands/list.rb +34 -0
  41. data/lib/project_types/theme/commands/open.rb +65 -0
  42. data/lib/project_types/theme/commands/pull.rb +2 -2
  43. data/lib/project_types/theme/commands/push.rb +2 -2
  44. data/lib/project_types/theme/forms/select.rb +11 -39
  45. data/lib/project_types/theme/messages/messages.rb +31 -2
  46. data/lib/project_types/theme/presenters/theme_presenter.rb +48 -0
  47. data/lib/project_types/theme/presenters/themes_presenter.rb +32 -0
  48. data/lib/shopify_cli/api.rb +1 -1
  49. data/lib/shopify_cli/constants.rb +2 -2
  50. data/lib/shopify_cli/context.rb +11 -13
  51. data/lib/shopify_cli/services/app/create/rails_service.rb +1 -1
  52. data/lib/shopify_cli/theme/syncer.rb +7 -7
  53. data/lib/shopify_cli/version.rb +1 -1
  54. data/shopify-dev +9 -11
  55. metadata +10 -2
@@ -570,21 +570,19 @@ module ShopifyCLI
570
570
  trap("INFO", "DEFAULT")
571
571
 
572
572
  fork do
573
- begin
574
- r, w = IO.pipe
573
+ r, w = IO.pipe
574
+ @signal = false
575
+ trap("SIGINFO") do
576
+ @signal = true
577
+ w.write(0)
578
+ end
579
+ while r.read(1)
580
+ next unless @signal
575
581
  @signal = false
576
- trap("SIGINFO") do
577
- @signal = true
578
- w.write(0)
579
- end
580
- while r.read(1)
581
- next unless @signal
582
- @signal = false
583
- yield
584
- end
585
- rescue Interrupt
586
- exit(0)
582
+ yield
587
583
  end
584
+ rescue Interrupt
585
+ exit(0)
588
586
  end
589
587
  end
590
588
 
@@ -109,7 +109,7 @@ module ShopifyCLI
109
109
 
110
110
  def check_ruby
111
111
  ruby_version = Rails::Ruby.version(context)
112
- return if ruby_version.satisfies?("~>2.5") || ruby_version.satisfies?("~>3.0.0")
112
+ return if ruby_version.satisfies?("~>2.5") || ruby_version.satisfies?("~>3.1.0")
113
113
  context.abort(context.message("core.app.create.rails.error.invalid_ruby_version"))
114
114
  end
115
115
 
@@ -47,11 +47,11 @@ module ShopifyCLI
47
47
  end
48
48
 
49
49
  def lock_io!
50
- @reporters.each { |reporter| reporter.disable! }
50
+ @reporters.each(&:disable!)
51
51
  end
52
52
 
53
53
  def unlock_io!
54
- @reporters.each { |reporter| reporter.enable! }
54
+ @reporters.each(&:enable!)
55
55
  end
56
56
 
57
57
  def enqueue_updates(files)
@@ -118,7 +118,7 @@ module ShopifyCLI
118
118
  operation = @queue.pop
119
119
  break if operation.nil? # shutdown was called
120
120
  perform(operation)
121
- rescue Exception => e
121
+ rescue Exception => e # rubocop:disable Lint/RescueException
122
122
  error_suffix = ": #{e}"
123
123
  error_suffix += + "\n\t#{e.backtrace.join("\n\t")}" if @ctx.debug?
124
124
  report_error(operation, error_suffix)
@@ -288,7 +288,7 @@ module ShopifyCLI
288
288
  update_checksums(body)
289
289
 
290
290
  attachment = body.dig("asset", "attachment")
291
- value = if attachment
291
+ if attachment
292
292
  file.write(Base64.decode64(attachment))
293
293
  else
294
294
  file.write(body.dig("asset", "value"))
@@ -305,7 +305,7 @@ module ShopifyCLI
305
305
  method: "DELETE",
306
306
  api_version: API_VERSION,
307
307
  body: JSON.generate(asset: {
308
- key: file.relative_path.to_s
308
+ key: file.relative_path.to_s,
309
309
  })
310
310
  )
311
311
 
@@ -332,7 +332,7 @@ module ShopifyCLI
332
332
  parsed_body = JSON.parse(exception&.response&.body)
333
333
  message = parsed_body.dig("errors", "asset") || parsed_body["message"] || exception.message
334
334
  # Truncate to first lines
335
- [message].flatten.map { |message| message.split("\n", 2).first }
335
+ [message].flatten.map { |mess| mess.split("\n", 2).first }
336
336
  rescue JSON::ParserError
337
337
  [exception.message]
338
338
  end
@@ -340,7 +340,7 @@ module ShopifyCLI
340
340
  def backoff_if_near_limit!(used, limit)
341
341
  if used > limit - @threads.size
342
342
  @ctx.debug("Near API call limit, waiting 2 sec…")
343
- @backoff_mutex.synchronize { sleep 2 }
343
+ @backoff_mutex.synchronize { sleep(2) }
344
344
  end
345
345
  end
346
346
 
@@ -1,3 +1,3 @@
1
1
  module ShopifyCLI
2
- VERSION = "2.12.0"
2
+ VERSION = "2.13.0"
3
3
  end
data/shopify-dev CHANGED
@@ -3,16 +3,14 @@
3
3
  require_relative "./bin/load_shopify"
4
4
 
5
5
  exit(proc do
6
- begin
7
- ShopifyCLI::ErrorHandler.call do
8
- ShopifyCLI::Core::EntryPoint.call(ARGV.dup)
9
- end
10
- rescue StandardError => error
11
- ShopifyCLI::ErrorHandler.exception = error
12
- if ShopifyCLI::Environment.print_stacktrace?
13
- raise error
14
- else
15
- 1
16
- end
6
+ ShopifyCLI::ErrorHandler.call do
7
+ ShopifyCLI::Core::EntryPoint.call(ARGV.dup)
17
8
  end
9
+ rescue StandardError => error
10
+ ShopifyCLI::ErrorHandler.exception = error
11
+ if ShopifyCLI::Environment.print_stacktrace?
12
+ raise error
13
+ else
14
+ 1
15
+ end
18
16
  end.call)
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.12.0
4
+ version: 2.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-23 00:00:00.000000000 Z
11
+ date: 2022-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -154,9 +154,13 @@ files:
154
154
  - docs/users/installation.md
155
155
  - docs/users/migrate-from-themekit.md
156
156
  - ext/javy/hashes/javy-arm-macos-v0.1.0.gz.sha256
157
+ - ext/javy/hashes/javy-arm-macos-v0.2.0.gz.sha256
157
158
  - ext/javy/hashes/javy-x86_64-linux-v0.1.0.gz.sha256
159
+ - ext/javy/hashes/javy-x86_64-linux-v0.2.0.gz.sha256
158
160
  - ext/javy/hashes/javy-x86_64-macos-v0.1.0.gz.sha256
161
+ - ext/javy/hashes/javy-x86_64-macos-v0.2.0.gz.sha256
159
162
  - ext/javy/hashes/javy-x86_64-windows-v0.1.0.gz.sha256
163
+ - ext/javy/hashes/javy-x86_64-windows-v0.2.0.gz.sha256
160
164
  - ext/javy/javy.rb
161
165
  - ext/javy/version
162
166
  - ext/shopify-extensions/extconf.rb
@@ -340,6 +344,8 @@ files:
340
344
  - lib/project_types/theme/commands/delete.rb
341
345
  - lib/project_types/theme/commands/init.rb
342
346
  - lib/project_types/theme/commands/language_server.rb
347
+ - lib/project_types/theme/commands/list.rb
348
+ - lib/project_types/theme/commands/open.rb
343
349
  - lib/project_types/theme/commands/package.rb
344
350
  - lib/project_types/theme/commands/publish.rb
345
351
  - lib/project_types/theme/commands/pull.rb
@@ -351,6 +357,8 @@ files:
351
357
  - lib/project_types/theme/forms/confirm_store.rb
352
358
  - lib/project_types/theme/forms/select.rb
353
359
  - lib/project_types/theme/messages/messages.rb
360
+ - lib/project_types/theme/presenters/theme_presenter.rb
361
+ - lib/project_types/theme/presenters/themes_presenter.rb
354
362
  - lib/project_types/theme/ui/sync_progress_bar.rb
355
363
  - lib/rubygems_plugin.rb
356
364
  - lib/shopify_cli.rb