shopify-cli 2.11.1 → 2.11.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4c9bb44a8b7b750acbf3364201705d93dfb39ce9772976ba2af04183cfc5748
4
- data.tar.gz: fa32248af15c17d01d80132b4caf42ea224edba35146098954f51b4453db50de
3
+ metadata.gz: 4a98682c26b1f02a7a24648c23bb987ceab5a70939e031957e80785c1068d849
4
+ data.tar.gz: bfddf7b2f92004d654a66fa8746619d724789c65da7b236e413857fd8705c65f
5
5
  SHA512:
6
- metadata.gz: 3446d1a595e343f6566b7ec087c187d31518398ad57be75ff519a394133c75e4f0a5f8670d78913271091632d8ef9fdeef4fb1bb3c1b4ac5cb99d0bc12aef765
7
- data.tar.gz: 48ad3c64a367e80facb7aecc393295fb8fa838949a51c7a71310c50a40e6bf2c648b57dbcaf53ade5e15af90ff911593e38865cbb8e2b8dce6b70a8918d83a03
6
+ metadata.gz: 33830ff754743290463c4744cd6e76c37fcf72f6119bcc8d43c9d5a752c3acaab7e9f0e9365f0b0083bae8be2b930d1c1a35affc508210e72998abc11b483d3b
7
+ data.tar.gz: e89c4a64ac97093c8973ccd482ca76b11f3852e29eb124904301c72f930cdce1774fabd1c1d1a3bdb775e065a7e27364a6bb7bbbdcf631c0587ee5e473f793b1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@ 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.11.2
6
+ ### Fixed
7
+ * [#2047](https://github.com/Shopify/shopify-cli/pull/2047): Fix the Homebrew installation
8
+ * [#2019](https://github.com/Shopify/shopify-cli/pull/2019): Provide helpful link when nokogiri fails to load
9
+ * [#2055](https://github.com/Shopify/shopify-cli/pull/2055): Remove unneeded Node requirements
10
+
5
11
  ## Version 2.11.1
6
12
  ### Fixed
7
13
  * [#1973](https://github.com/Shopify/shopify-cli/pull/1973): Fix `theme serve` to preview generated files (`*.css.liquid`)
@@ -12,6 +18,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
12
18
  ## Version 2.11.0
13
19
  ### Fixed
14
20
  * [#2005](https://github.com/Shopify/shopify-cli/pull/2005): Fix PHP app serve on Windows environments
21
+ * [#2020](https://github.com/Shopify/shopify-cli/pull/2020): Fix `theme pull` so that correct dev theme is used with `-d` option
15
22
 
16
23
  ### Added
17
24
  * [#1998](https://github.com/Shopify/shopify-cli/pull/1998): Add support for Rails 7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.11.1)
4
+ shopify-cli (2.11.2)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.9.0)
data/bin/shopify CHANGED
@@ -14,6 +14,15 @@ module Kernel
14
14
  raise if name == "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
15
15
  # Special case for ffi, which rescues this itself
16
16
  raise if name == "#{RUBY_VERSION.split(".")[0, 2].join(".")}/ffi_c"
17
+ # Special case for nokogiri, which might install the wrong architecture
18
+ if name == "nokogiri/nokogiri"
19
+ STDERR.puts "[Note] Nokogiri is failing to load, which most likely means " \
20
+ "it is installed with the wrong architecture for your system. This link " \
21
+ "has instructions for how to install the correct version for your system: " \
22
+ "https://nokogiri.org/tutorials/installing_nokogiri.html"
23
+ STDERR.puts e.full_message
24
+ exit(1)
25
+ end
17
26
  STDERR.puts "[Note] You cannot use gems with Shopify CLI."
18
27
  STDERR.puts "[LoadError] #{e.message}"
19
28
  if ENV["DEBUG"]
@@ -8,9 +8,6 @@ module Extension
8
8
 
9
9
  prerequisite_task ensure_project_type: :extension
10
10
 
11
- recommend_default_node_range
12
- recommend_default_ruby_range
13
-
14
11
  YARN_BUILD_COMMAND = %w(build)
15
12
  NPM_BUILD_COMMAND = %w(run-script build)
16
13
 
@@ -4,7 +4,6 @@ require "theme_check"
4
4
  module Extension
5
5
  class Command
6
6
  class Check < ExtensionCommand
7
- recommend_default_node_range
8
7
  recommend_default_ruby_range
9
8
 
10
9
  class CheckOptions < ShopifyCLI::Options
@@ -5,7 +5,6 @@ module Extension
5
5
  class Create < ShopifyCLI::Command::SubCommand
6
6
  prerequisite_task :ensure_authenticated
7
7
 
8
- recommend_default_node_range
9
8
  recommend_default_ruby_range
10
9
 
11
10
  options do |parser, flags|
@@ -6,7 +6,6 @@ module Extension
6
6
  class Push < ShopifyCLI::Command::SubCommand
7
7
  prerequisite_task ensure_project_type: :extension
8
8
 
9
- recommend_default_node_range
10
9
  recommend_default_ruby_range
11
10
 
12
11
  options do |parser, flags|
@@ -5,7 +5,6 @@ module Extension
5
5
  class Serve < ExtensionCommand
6
6
  prerequisite_task ensure_project_type: :extension
7
7
 
8
- recommend_default_node_range
9
8
  recommend_default_ruby_range
10
9
 
11
10
  DEFAULT_PORT = 39351
@@ -6,10 +6,11 @@ module Extension
6
6
  module Models
7
7
  module SpecificationHandlers
8
8
  class ThemeAppExtension < Default
9
- SUPPORTED_BUCKETS = %w(assets blocks snippets)
9
+ SUPPORTED_BUCKETS = %w(assets blocks snippets locales)
10
10
  BUNDLE_SIZE_LIMIT = 10 * 1024 * 1024 # 10MB
11
11
  LIQUID_SIZE_LIMIT = 100 * 1024 # 100kb
12
12
  SUPPORTED_ASSET_EXTS = %w(.jpg .js .css .png .svg)
13
+ SUPPORTED_LOCALE_EXTS = %w(.json)
13
14
 
14
15
  def create(directory_name, context, getting_started: false)
15
16
  context.root = File.join(context.root, directory_name)
@@ -89,6 +90,11 @@ module Extension
89
90
  raise Extension::Errors::InvalidFilenameError,
90
91
  "Invalid filename: #{filename}; #{ext} is not supported"
91
92
  end
93
+ elsif dirname == "locales"
94
+ unless SUPPORTED_LOCALE_EXTS.include?(ext)
95
+ raise Extension::Errors::InvalidFilenameError,
96
+ "Invalid filename: #{filename}; Only #{SUPPORTED_LOCALE_EXTS.join(", ")} allowed in #{dirname}"
97
+ end
92
98
  elsif ext != ".liquid"
93
99
  raise Extension::Errors::InvalidFilenameError,
94
100
  "Invalid filename: #{filename}; Only .liquid allowed in #{dirname}"
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  require "shopify_cli/theme/theme"
3
+ require "shopify_cli/theme/development_theme"
3
4
  require "shopify_cli/theme/ignore_filter"
4
5
  require "shopify_cli/theme/include_filter"
5
6
  require "shopify_cli/theme/syncer"
@@ -73,7 +74,8 @@ module Theme
73
74
  end
74
75
 
75
76
  if development
76
- return ShopifyCLI::Theme::Theme.development(@ctx, root: root)
77
+ dev_theme = ShopifyCLI::Theme::DevelopmentTheme.find(@ctx, root: root)
78
+ return dev_theme || @ctx.abort(@ctx.message("theme.pull.theme_not_found", dev_theme.name))
77
79
  end
78
80
 
79
81
  select_theme(root)
@@ -91,9 +91,7 @@ module Theme
91
91
  end
92
92
 
93
93
  if development
94
- new_theme = ShopifyCLI::Theme::DevelopmentTheme.new(@ctx, root: root)
95
- new_theme.ensure_exists!
96
- return new_theme
94
+ return ShopifyCLI::Theme::DevelopmentTheme.find_or_create!(@ctx, root: root)
97
95
  end
98
96
 
99
97
  if unpublished
@@ -100,8 +100,10 @@ module ShopifyCLI
100
100
  end
101
101
 
102
102
  def check_node_version
103
+ return unless @compatible_node_range
104
+
103
105
  context = Context.new
104
- if @compatible_node_range && context.which("node").nil?
106
+ if context.which("node").nil?
105
107
  raise ShopifyCLI::Abort, context.message("core.errors.missing_node")
106
108
  end
107
109
 
@@ -65,7 +65,7 @@ module ShopifyCLI
65
65
  end
66
66
 
67
67
  module Node
68
- FROM = "12.0.0"
68
+ FROM = "14.5.0"
69
69
  TO = "17.0.0"
70
70
  end
71
71
  end
@@ -15,7 +15,7 @@ module ShopifyCLI
15
15
  },
16
16
  core: {
17
17
  errors: {
18
- missing_node: "Node is necessary for this command and was not found in the environment.",
18
+ missing_node: "Node is required to continue. Install node here: https://nodejs.org/en/download.",
19
19
  option_parser: {
20
20
  invalid_option: "The option {{command:%s}} is not supported.",
21
21
  missing_argument: "The required argument {{command:%s}} is missing.",
@@ -42,7 +42,7 @@ module ShopifyCLI
42
42
  invalid_type: "The type %s is not supported. The only supported types are"\
43
43
  " {{command:[ rails | node | php ]}}",
44
44
  help: <<~HELP,
45
- {{command:%s app create}}: Creates a ruby on rails app.
45
+ {{command:%s app create}}: Creates a new project in a subdirectory.
46
46
  Usage: {{command:%s app create [ rails | node | php ]}}
47
47
  HELP
48
48
  rails: {
@@ -28,7 +28,7 @@ module ShopifyCLI
28
28
 
29
29
  def start(ctx, root, host: "127.0.0.1", port: 9292, poll: false, mode: ReloadMode.default)
30
30
  @ctx = ctx
31
- theme = DevelopmentTheme.new(ctx, root: root)
31
+ theme = DevelopmentTheme.find_or_create!(ctx, root: root)
32
32
  ignore_filter = IgnoreFilter.from_path(root)
33
33
  @syncer = Syncer.new(ctx, theme: theme, ignore_filter: ignore_filter)
34
34
  watcher = Watcher.new(ctx, theme: theme, syncer: @syncer, ignore_filter: ignore_filter, poll: poll)
@@ -41,8 +41,6 @@ module ShopifyCLI
41
41
  stopped = false
42
42
  address = "http://#{host}:#{port}"
43
43
 
44
- theme.ensure_exists!
45
-
46
44
  trap("INT") do
47
45
  stopped = true
48
46
  stop
@@ -38,6 +38,8 @@ module ShopifyCLI
38
38
  @ctx.debug("Created temporary development theme: #{@id}")
39
39
  ShopifyCLI::DB.set(development_theme_id: @id)
40
40
  end
41
+
42
+ self
41
43
  end
42
44
 
43
45
  def exists?
@@ -63,6 +65,15 @@ module ShopifyCLI
63
65
  new(ctx).delete
64
66
  end
65
67
 
68
+ def self.find(ctx, root: nil)
69
+ dev_theme = new(ctx, root: root)
70
+ dev_theme.exists? ? dev_theme : nil
71
+ end
72
+
73
+ def self.find_or_create!(ctx, root: nil)
74
+ new(ctx, root: root).ensure_exists!
75
+ end
76
+
66
77
  private
67
78
 
68
79
  def generate_theme_name
@@ -176,10 +176,6 @@ module ShopifyCLI
176
176
  find(ctx, root) { |attrs| attrs["role"] == "main" }
177
177
  end
178
178
 
179
- def development(ctx, root: nil)
180
- find(ctx, root) { |attrs| attrs["role"] == "development" }
181
- end
182
-
183
179
  # Finds a Theme by its identifier
184
180
  #
185
181
  # #### Parameters
@@ -1,3 +1,3 @@
1
1
  module ShopifyCLI
2
- VERSION = "2.11.1"
2
+ VERSION = "2.11.2"
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.11.1
4
+ version: 2.11.2
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-09 00:00:00.000000000 Z
11
+ date: 2022-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler