shopify-cli 2.27.0 → 2.28.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07ad4ab4b77c8edc5d1ff4bbbc980abcd625e00081c00aa986de0aef8251db43
4
- data.tar.gz: 774eecdb92623ac595ce3cdcf44b6cf1247b882004833a545756eb7b7dd070db
3
+ metadata.gz: e9563000eff4fb285eefdc448c66f51c45cb40b7119870a17994d87e0c037160
4
+ data.tar.gz: 6cb8dbe46c0b825679e8a301206869d6cd523c4881235e220d966a753f477d5e
5
5
  SHA512:
6
- metadata.gz: 32548f2bf7b53d4e3d74a7b100f7f3b89f79438141932fdb876aba9f37a9eeeeb4fd66ed05fef2dbb80abcd05044ca398a30107cbf2277558cd5104f7123ff3a
7
- data.tar.gz: 9075eca951bae25caaaac87774aee024ccaff98391c23d16d9e525f419461ce9cb978a60b640e49c34dd8d30e41b6d33e18050d3c9fbdba586adb70e7b66dcf2
6
+ metadata.gz: 6f67ca0fc39a81731a425e5e7a8bd848d50f7ed698b31f6529b18af0365ab7ca2a8072cada700b0e98028c0d42b3b3cbfcae7108bc30a038d265f85d18b06ed8
7
+ data.tar.gz: afc2b9be9d9b59eca388fe71946ed696ed1e7faf28833468217f0933af1f4fac9ea9f08613cf08ec2b379886b06702641703790762323b8f58e5a40fccff1cb1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## Version 2.28.0 - 2022-10-17
6
+
7
+ ### Fixed
8
+ * [#2646](https://github.com/Shopify/shopify-cli/pull/2646): Demo themes shouldn't appear in the `shopify theme pull/push/list/open` commands
9
+
10
+ ### Changed
11
+ * [#2648](https://github.com/Shopify/shopify-cli/pull/2648): Do not warn users when the CLI 2.x is running as a subprocess
12
+
5
13
  ## Version 2.27.0 - 2022-10-10
6
14
 
7
15
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.27.0)
4
+ shopify-cli (2.28.0)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.11.0)
@@ -8,7 +8,7 @@ module Extension
8
8
  return Messages::MESSAGES if type_specific_messages.nil?
9
9
 
10
10
  if type_specific_messages.key?(:overrides)
11
- deep_merge(Messages::MESSAGES, type_specific_messages[:overrides])
11
+ ShopifyCLI::Utilities.deep_merge(Messages::MESSAGES, type_specific_messages[:overrides])
12
12
  else
13
13
  Messages::MESSAGES
14
14
  end
@@ -29,11 +29,6 @@ module Extension
29
29
 
30
30
  TYPES[type_identifier_symbol]
31
31
  end
32
-
33
- def self.deep_merge(first, second)
34
- merger = proc { |_key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 }
35
- first.merge(second, &merger)
36
- end
37
32
  end
38
33
  end
39
34
  end
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Theme
3
4
  class Project < ShopifyCLI::ProjectType
4
5
  require Project.project_filepath("messages/messages")
5
- register_messages(Theme::Messages::MESSAGES)
6
+ register_messages(Theme::Messages.all)
6
7
  end
7
8
 
8
9
  class Command < ShopifyCLI::Command::ProjectCommand
@@ -145,7 +145,7 @@ module Theme
145
145
  It looks like you are using credentials that do not work with {{command:%s theme serve}}.
146
146
  ERROR_MESSAGE
147
147
  help_message: <<~HELP_MESSAGE,
148
- Run {{command:%s logout}} and {{command:%s login --password "" --store STORE}} to force the authentication thought your browser.
148
+ Run {{command:%s logout}} and {{command:%s login --password "" --store STORE}} to authenticate again.
149
149
  HELP_MESSAGE
150
150
  },
151
151
  operation: {
@@ -390,5 +390,31 @@ module Theme
390
390
  },
391
391
  },
392
392
  }.freeze
393
+
394
+ def self.all
395
+ # In order to support theme development inside CLI3, we spawn CLI2 as a
396
+ # subprocess. Whenever an error happens, we want to show the updated
397
+ # version of the commands for the user to try.
398
+ if ShopifyCLI::Environment.run_as_subprocess?
399
+ ShopifyCLI::Utilities.deep_merge(MESSAGES, {
400
+ theme: {
401
+ serve: {
402
+ auth: {
403
+ error_message: <<~ERROR_MESSAGE,
404
+ It looks like you are using credentials that do not work with {{command:%s theme dev}}.
405
+ ERROR_MESSAGE
406
+ help_message: <<~HELP_MESSAGE,
407
+ Run {{command:%s auth logout}} and {{command:%s theme dev --store STORE}} to authenticate again.
408
+ HELP_MESSAGE
409
+ },
410
+ binding_error: "Couldn't bind to localhost." \
411
+ " To serve your theme, set a different address with {{command:%s theme dev --host=<address>}}",
412
+ },
413
+ },
414
+ })
415
+ else
416
+ MESSAGES
417
+ end
418
+ end
393
419
  end
394
420
  end
@@ -5,7 +5,7 @@ require_relative "theme_presenter"
5
5
  module Theme
6
6
  module Presenters
7
7
  class ThemesPresenter
8
- ORDER_BY_ROLE = %w(live unpublished development)
8
+ SUPPORTED_ROLES = %w(live unpublished development)
9
9
 
10
10
  def initialize(ctx, root)
11
11
  @ctx = ctx
@@ -14,16 +14,13 @@ module Theme
14
14
 
15
15
  def all
16
16
  all_themes
17
- .sort_by { |theme| order_by_role(theme) }
17
+ .select { |theme| SUPPORTED_ROLES.include?(theme.role) }
18
+ .sort_by { |theme| SUPPORTED_ROLES.index(theme.role) }
18
19
  .map { |theme| ThemePresenter.new(theme) }
19
20
  end
20
21
 
21
22
  private
22
23
 
23
- def order_by_role(theme)
24
- ORDER_BY_ROLE.index(theme.role) || ORDER_BY_ROLE.size
25
- end
26
-
27
24
  def all_themes
28
25
  ShopifyCLI::Theme::Theme.all(@ctx, root: @root)
29
26
  end
@@ -117,7 +117,7 @@ module ShopifyCLI
117
117
  end
118
118
 
119
119
  def check_version(version, range:, runtime:, context: Context.new)
120
- return if Environment.test?
120
+ return if Environment.test? || Environment.run_as_subprocess?
121
121
  return if range.nil?
122
122
 
123
123
  version_without_pre_nor_build = Utilities.version_dropping_pre_and_build(version)
@@ -498,7 +498,7 @@ module ShopifyCLI
498
498
  "{{i}} Authentication required. Login to the URL below with your %s credentials to continue.",
499
499
 
500
500
  servlet: {
501
- success_response: "You've successfuly logged into the Shopify CLI!",
501
+ success_response: "You've successfully logged into the Shopify CLI!",
502
502
  invalid_request_response: "Invalid request: %s",
503
503
  invalid_state_response: "The anti-forgery state token does not match the initial request.",
504
504
  },
@@ -12,5 +12,10 @@ module ShopifyCLI
12
12
  curr = File.dirname(curr)
13
13
  end
14
14
  end
15
+
16
+ def self.deep_merge(first, second)
17
+ merger = proc { |_key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 }
18
+ first.merge(second, &merger)
19
+ end
15
20
  end
16
21
  end
@@ -1,3 +1,3 @@
1
1
  module ShopifyCLI
2
- VERSION = "2.27.0"
2
+ VERSION = "2.28.0"
3
3
  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.27.0
4
+ version: 2.28.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-10-10 00:00:00.000000000 Z
11
+ date: 2022-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler