shopify-cli 2.2.2 → 2.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6192e829e79c4cfe8a1e6fe1214d17f57da63bcf3802de71a7171a0037a2c1a
4
- data.tar.gz: 11f3a7167a24c5b011f930de1a9554176c6371c1a63350ea3a94d9965f521336
3
+ metadata.gz: 200674ac9337744994af930500ea30904f13292fba380ec0d58cf990f94c50f5
4
+ data.tar.gz: cb7f7b17ebbdbc430afe269d713e68cf9db00e71a7aa5026c1752ba8f2db9792
5
5
  SHA512:
6
- metadata.gz: e35ac5b91dea19c5c443616063d1993eefe787b702a9813c4598361f264967baf09d6f4f34a54456b67c6c226cc96b032d3a2bb742ea5425c49fcd3ab843b1fe
7
- data.tar.gz: c27174aeaf83c67b292a0374b591833f87be66df912e85389148d008e7df0d3c83252b81034d14e1388be2e9a34112f6e9bf925e26359fb11fbfe84cdd8bb875
6
+ metadata.gz: eed6884b0ee2ec5dc30bfbd4927dedb13ac3a77088af02a24ada09b08d1341696c56c8ce01d177cffe7c67f5db262d2146c51a0f95345e628c1e8a477debe543
7
+ data.tar.gz: e5211bf92e8b8cab56a17e3714ffcc3d8a8bf8d63aa408c4621a1a65778d4ff0a0d3ae6c57613ee46661d19d9441246aa57388f58f46116acbb712c8f1841750
@@ -24,10 +24,6 @@ Tip: include an error message (in a `<details></details>` tag) if your issue is
24
24
  1.
25
25
  1.
26
26
 
27
- ## Reduced test case
28
-
29
- The best way to get your bug fixed is to provide a [reduced test case](https://developer.mozilla.org/en-US/docs/Mozilla/QA/Reducing_testcases).
30
-
31
27
 
32
28
 
33
29
  ## Specifications
data/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  Unreleased
2
2
  ------
3
3
 
4
+ Version 2.3.0
5
+ ------
6
+
7
+ * [#1386](https://github.com/Shopify/shopify-cli/pull/1386): Update Theme-Check to 1.2
8
+ * [#1457](https://github.com/Shopify/shopify-cli/pull/1457): Fix uploading of binary theme files under Windows
9
+ * [#1480](https://github.com/Shopify/shopify-cli/pull/1480): Fix customers pages not working with `theme serve`
10
+ * [#1479](https://github.com/Shopify/shopify-cli/pull/1479): Add theme push & pull option to ignore files per command
11
+
4
12
  Version 2.2.2
5
13
  ------
6
14
  * [1382](https://github.com/Shopify/shopify-cli/pull/1382): Client side module upload for Scripts
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.2.2)
4
+ shopify-cli (2.3.0)
5
5
  listen (~> 3.5)
6
- theme-check (~> 1.1)
6
+ theme-check (~> 1.2)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -76,7 +76,7 @@ GEM
76
76
  rubocop-shopify (2.0.1)
77
77
  rubocop (~> 1.11)
78
78
  ruby-progressbar (1.11.0)
79
- theme-check (1.1.0)
79
+ theme-check (1.2.0)
80
80
  liquid (>= 5.0.1)
81
81
  nokogumbo
82
82
  timecop (0.9.2)
@@ -4,7 +4,7 @@ module Extension
4
4
  module Models
5
5
  module SpecificationHandlers
6
6
  class CheckoutUiExtension < Default
7
- PERMITTED_CONFIG_KEYS = [:metafields, :extension_points]
7
+ PERMITTED_CONFIG_KEYS = [:extension_points, :metafields, :name]
8
8
 
9
9
  def config(context)
10
10
  {
@@ -9,6 +9,10 @@ module Theme
9
9
  options do |parser, flags|
10
10
  parser.on("-n", "--nodelete") { flags[:nodelete] = true }
11
11
  parser.on("-i", "--themeid=ID") { |theme_id| flags[:theme_id] = theme_id }
12
+ parser.on("-x", "--ignore=PATTERN") do |pattern|
13
+ flags[:ignores] ||= []
14
+ flags[:ignores] << pattern
15
+ end
12
16
  end
13
17
 
14
18
  def call(args, _name)
@@ -29,6 +33,8 @@ module Theme
29
33
  end
30
34
 
31
35
  ignore_filter = ShopifyCli::Theme::IgnoreFilter.from_path(root)
36
+ ignore_filter.add_patterns(options.flags[:ignores]) if options.flags[:ignores]
37
+
32
38
  syncer = ShopifyCli::Theme::Syncer.new(@ctx, theme: theme, ignore_filter: ignore_filter)
33
39
  begin
34
40
  syncer.start_threads
@@ -15,6 +15,10 @@ module Theme
15
15
  parser.on("-j", "--json") { flags[:json] = true }
16
16
  parser.on("-a", "--allow-live") { flags[:allow_live] = true }
17
17
  parser.on("-p", "--publish") { flags[:publish] = true }
18
+ parser.on("-x", "--ignore=PATTERN") do |pattern|
19
+ flags[:ignores] ||= []
20
+ flags[:ignores] << pattern
21
+ end
18
22
  end
19
23
 
20
24
  def call(args, _name)
@@ -48,6 +52,8 @@ module Theme
48
52
  end
49
53
 
50
54
  ignore_filter = ShopifyCli::Theme::IgnoreFilter.from_path(root)
55
+ ignore_filter.add_patterns(options.flags[:ignores]) if options.flags[:ignores]
56
+
51
57
  syncer = ShopifyCli::Theme::Syncer.new(@ctx, theme: theme, ignore_filter: ignore_filter)
52
58
  begin
53
59
  syncer.start_threads
@@ -59,10 +59,20 @@ module ShopifyCli
59
59
  def start(identifier, args)
60
60
  return for_ident(identifier) if running?(identifier)
61
61
 
62
- # Windows doesn't support forking process without extra gems, so we resort to spawning a new child process -
63
- # that means that it dies along with the original process if it is interrupted. On UNIX, we fork the process so
64
- # that it doesn't have to be restarted on every run.
65
- if Context.new.windows?
62
+ # Some systems don't support forking process without extra gems, so we resort to spawning a new child process -
63
+ # that means that it dies along with the original process if it is interrupted. If possible, we fork the process
64
+ # so that it doesn't have to be restarted on every run.
65
+ if Process.respond_to?(:fork)
66
+ fork do
67
+ pid_file = new(identifier, pid: Process.pid)
68
+ pid_file.write
69
+ STDOUT.reopen(pid_file.log_path, "w")
70
+ STDERR.reopen(pid_file.log_path, "w")
71
+ STDIN.reopen("/dev/null", "r")
72
+ Process.setsid
73
+ exec(*args)
74
+ end
75
+ else
66
76
  pid_file = new(identifier)
67
77
 
68
78
  # Make sure the file exists and is empty, otherwise Windows fails
@@ -77,16 +87,6 @@ module ShopifyCli
77
87
  pid_file.write
78
88
 
79
89
  Process.detach(pid)
80
- else
81
- fork do
82
- pid_file = new(identifier, pid: Process.pid)
83
- pid_file.write
84
- STDOUT.reopen(pid_file.log_path, "w")
85
- STDERR.reopen(pid_file.log_path, "w")
86
- STDIN.reopen("/dev/null", "r")
87
- Process.setsid
88
- exec(*args)
89
- end
90
90
  end
91
91
 
92
92
  sleep(0.1)
@@ -47,6 +47,10 @@ module ShopifyCli
47
47
  super(k) || super(@names[k.downcase])
48
48
  end
49
49
 
50
+ def fetch(k, default = nil)
51
+ self[k] || super(@names[k.downcase], default)
52
+ end
53
+
50
54
  def []=(k, v)
51
55
  canonical = k.downcase.freeze
52
56
  # .delete is expensive, don't invoke it unless necessary
@@ -155,11 +155,16 @@ module ShopifyCli
155
155
  Time.now - @last_session_cookie_refresh >= SESSION_COOKIE_MAX_AGE
156
156
  end
157
157
 
158
+ def extract_secure_session_id_from_response_headers(headers)
159
+ return unless headers["set-cookie"]
160
+ headers["set-cookie"][SESSION_COOKIE_REGEXP, 1]
161
+ end
162
+
158
163
  def secure_session_id
159
164
  if secure_session_id_expired?
160
165
  @ctx.debug("Refreshing preview _secure_session_id cookie")
161
166
  response = request("HEAD", "/", query: { preview_theme_id: @theme.id })
162
- @secure_session_id = response["set-cookie"][SESSION_COOKIE_REGEXP, 1]
167
+ @secure_session_id = extract_secure_session_id_from_response_headers(response)
163
168
  @last_session_cookie_refresh = Time.now
164
169
  end
165
170
 
@@ -179,6 +184,13 @@ module ShopifyCli
179
184
  response_headers["location"].gsub!(%r{(https://#{@theme.shop})}, "http://127.0.0.1:9292")
180
185
  end
181
186
 
187
+ new_session_id = extract_secure_session_id_from_response_headers(response_headers)
188
+ if new_session_id
189
+ @ctx.debug("New _secure_session_id cookie from response")
190
+ @secure_session_id = new_session_id
191
+ @last_session_cookie_refresh = Time.now
192
+ end
193
+
182
194
  response_headers
183
195
  end
184
196
 
@@ -17,12 +17,20 @@ module ShopifyCli
17
17
  end
18
18
 
19
19
  def read
20
- path.read
20
+ if text?
21
+ path.read
22
+ else
23
+ path.read(mode: "rb")
24
+ end
21
25
  end
22
26
 
23
- def write(*args)
27
+ def write(content)
24
28
  path.parent.mkpath unless path.parent.directory?
25
- path.write(*args)
29
+ if text?
30
+ path.write(content)
31
+ else
32
+ path.write(content, 0, mode: "wb")
33
+ end
26
34
  end
27
35
 
28
36
  def delete
@@ -59,6 +59,13 @@ module ShopifyCli
59
59
  @globs = globs
60
60
  end
61
61
 
62
+ def add_patterns(patterns)
63
+ regexes, globs = patterns_to_regexes_and_globs(patterns)
64
+
65
+ @regexes += regexes
66
+ @globs += globs
67
+ end
68
+
62
69
  def match?(path)
63
70
  path = path.to_s
64
71
 
@@ -256,7 +256,7 @@ module ShopifyCli
256
256
 
257
257
  attachment = body.dig("asset", "attachment")
258
258
  value = if attachment
259
- file.write(Base64.decode64(attachment), 0, mode: "wb")
259
+ file.write(Base64.decode64(attachment))
260
260
  else
261
261
  file.write(body.dig("asset", "value"))
262
262
  end
@@ -1,3 +1,3 @@
1
1
  module ShopifyCli
2
- VERSION = "2.2.2"
2
+ VERSION = "2.3.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.1")
47
+ spec.add_dependency("theme-check", "~> 1.2")
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.2.2
4
+ version: 2.3.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-08-12 00:00:00.000000000 Z
11
+ date: 2021-08-30 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.1'
81
+ version: '1.2'
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.1'
88
+ version: '1.2'
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