shopify-cli 2.15.3 → 2.15.6

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: 8f795330308fe8098043f9757452c62c5366eebcd724a90b3e81aafceb82a4f0
4
- data.tar.gz: b5bac3e2def77bb94b993d39230a489d646bee5848cf4500e523da2b413e517f
3
+ metadata.gz: 756d40b258dafcaa9e3fd02305cbc3eb4bc1416b5711f22543c9b6221c4bd888
4
+ data.tar.gz: 476eea5325f671f2e3a1337700356f895792c1e4b2568dc56e38c58b4d1e93d5
5
5
  SHA512:
6
- metadata.gz: 05ffb12d03f75fd4bd1f5f8e0709445b51364cd8d8576407473c2f7ccc8ae1fa6d202181005041dd258ede96a1cd4a2382d9572cc427f936d62a9071229ce997
7
- data.tar.gz: 2afbac5fe6fc03aa52858b00118661faac907cb23bb9c37368e46e4eb79feb3a309482d7ac59828b964c7a43d6de3c2446e750b6412344729e115f422b42bb84
6
+ metadata.gz: 11bee20d53a3809978a2cf37a7f4ed3e759f0edd7d53ac8ec9e08dad76c1bd3ed8fcbf66262dc686d7bf929fec256685189facaf1255c2f51c2f566757b7ae29
7
+ data.tar.gz: 8cb0d2cb3d2edf801f752b74ed8534816180e257d3a1afef8fb0b13ffa5a3a85388bd6bb71df04d0c42bf450cedd1008e473f36cf48722435eea912645dcb1e9
data/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@ 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.15.6 - 2022-04-12
6
+
7
+ ### Fixed
8
+ * [#2246](https://github.com/Shopify/shopify-cli/pull/2246): Fix callback urls for app serve
9
+
10
+ ## Version 2.15.5 - 2022-04-08
11
+
12
+ ### Fixed
13
+ * [#2237](https://github.com/Shopify/shopify-cli/pull/2237): Fix Homebrew Wrapper
14
+
15
+ ## Version 2.15.4 - 2022-04-08
16
+
17
+ ### Fixed
18
+ * [#2230](https://github.com/Shopify/shopify-cli/pull/2230): Show an error without ngrok account
19
+ * [#2235](https://github.com/Shopify/shopify-cli/pull/2235): Update shopify-extensions to v0.3.0 and fix issues with template choosing and missing dependencies
20
+ * [#2226](https://github.com/Shopify/shopify-cli/pull/2226): Fix liquid file size validation to disclude locales directory
21
+
5
22
  ## Version 2.15.3 - 2022-04-07
6
23
 
7
24
  ### Changed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.15.3)
4
+ shopify-cli (2.15.6)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.10.1)
@@ -1 +1 @@
1
- v0.2.0
1
+ v0.3.0
@@ -1,5 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pathname"
4
+ require "json"
5
+ require "yaml"
6
+
3
7
  module Extension
4
8
  class PackageResolutionFailed < RuntimeError; end
5
9
 
@@ -21,8 +21,7 @@ module Extension
21
21
 
22
22
  def template_required?(project_details)
23
23
  type = project_details&.type&.identifier
24
- (Models::DevelopmentServerRequirements.beta_enabled? &&
25
- Models::DevelopmentServerRequirements.type_supported?(type.downcase))
24
+ Models::DevelopmentServerRequirements.supported?(type)
26
25
  end
27
26
 
28
27
  def choose_interactively
@@ -38,7 +38,10 @@ module Extension
38
38
  # Other assets should be treated as UTF-8 encoded text
39
39
  mode = "rt"
40
40
  encoding = "UTF-8"
41
- current_liquid_size += File.size(filename)
41
+
42
+ if dirname == "snippets" || dirname == "blocks"
43
+ current_liquid_size += File.size(filename)
44
+ end
42
45
  end
43
46
  current_size += File.size(filename)
44
47
  if current_size > BUNDLE_SIZE_LIMIT
@@ -760,16 +760,12 @@ module ShopifyCLI
760
760
  " package manager for your system.",
761
761
  ngrok: "Something went wrong with ngrok installation,"\
762
762
  "please make sure %s exists within %s before trying again",
763
+ signup_required: "A free ngrok account is required: {{underline:https://ngrok.com/signup}}. After you "\
764
+ "signup, install your personal authorization token using {{command:%s app tunnel auth <token>}}.",
763
765
  },
764
766
  installing: "Installing ngrok…",
765
767
  not_running: "{{green:x}} ngrok tunnel not running",
766
768
  prereq_command_location: "%s @ %s",
767
- signup_suggestion: <<~MESSAGE,
768
- {{*}} To avoid tunnels that timeout, it is recommended to signup for a free ngrok
769
- account at {{underline:https://ngrok.com/signup}}. After you signup, install your
770
- personalized authorization token using {{command:%s app tunnel auth <token>}}.
771
- MESSAGE
772
- start: "{{v}} ngrok tunnel running at {{underline:%s}}",
773
769
  start_with_account: "{{v}} ngrok tunnel running at {{underline:%s}}, with account %s",
774
770
  stopped: "{{green:x}} ngrok tunnel stopped",
775
771
  timed_out: "{{x}} ngrok tunnel has timed out, restarting…",
@@ -36,7 +36,7 @@ module ShopifyCLI
36
36
  ShopifyCLI::Tasks::UpdateDashboardURLS.call(
37
37
  context,
38
38
  url: project.env.host,
39
- callback_url: "/auth/shopify/callback",
39
+ callback_urls: %w(/auth/shopify/callback /auth/callback),
40
40
  )
41
41
  end
42
42
 
@@ -1,18 +1,21 @@
1
+ require "set"
2
+
1
3
  module ShopifyCLI
2
4
  module Tasks
3
5
  class UpdateDashboardURLS < ShopifyCLI::Task
4
6
  NGROK_REGEX = /https:\/\/([a-z0-9\-]+\.ngrok\.io)(.*)/
5
7
 
6
- def call(ctx, url:, callback_url:)
8
+ def call(ctx, url:, callback_urls:)
7
9
  @ctx = ctx
8
10
  project = ShopifyCLI::Project.current
9
11
  api_key = project.env.api_key
10
12
  result = ShopifyCLI::PartnersAPI.query(ctx, "get_app_urls", apiKey: api_key)
11
13
  app = result["data"]["app"]
12
14
 
13
- return if app["applicationUrl"].match(url)
15
+ constructed_urls = construct_redirect_urls(app["redirectUrlWhitelist"], url, callback_urls)
16
+
17
+ return if already_updated(app, constructed_urls, url)
14
18
 
15
- constructed_urls = construct_redirect_urls(app["redirectUrlWhitelist"], url, callback_url)
16
19
  ShopifyCLI::PartnersAPI.query(@ctx, "update_dashboard_urls", input: {
17
20
  applicationUrl: url,
18
21
  redirectUrlWhitelist: constructed_urls,
@@ -25,7 +28,7 @@ module ShopifyCLI
25
28
  raise
26
29
  end
27
30
 
28
- def construct_redirect_urls(urls, new_url, callback_url)
31
+ def construct_redirect_urls(urls, new_url, callback_urls)
29
32
  new_urls = urls.map do |url|
30
33
  if (match = url.match(NGROK_REGEX))
31
34
  "#{new_url}#{match[2]}"
@@ -33,11 +36,22 @@ module ShopifyCLI
33
36
  url
34
37
  end
35
38
  end
36
- if new_urls.grep(/#{new_url}#{callback_url}/).empty?
37
- new_urls.push("#{new_url}#{callback_url}")
39
+ callback_urls.each do |callback_url|
40
+ if new_urls.grep(/#{new_url}#{callback_url}/).empty?
41
+ new_urls.push("#{new_url}#{callback_url}")
42
+ end
38
43
  end
39
44
  new_urls.uniq
40
45
  end
46
+
47
+ private
48
+
49
+ def already_updated(app, new_redirect_urls, new_url)
50
+ current_url = app["applicationUrl"]
51
+ current_redirect_urls = app["redirectUrlWhitelist"]
52
+ current_url.match(new_url) &&
53
+ Set.new(current_redirect_urls) == Set.new(new_redirect_urls)
54
+ end
41
55
  end
42
56
  end
43
57
  end
@@ -44,7 +44,7 @@ module ShopifyCLI
44
44
 
45
45
  def serve_file(path_info)
46
46
  path = @theme.root.join(path_info[1..-1])
47
- if path.file? && path.readable?
47
+ if path.file? && path.readable? && @theme.theme_file?(path)
48
48
  [
49
49
  200,
50
50
  {
@@ -66,14 +66,9 @@ module ShopifyCLI
66
66
  #
67
67
  def start(ctx, port: PORT)
68
68
  install(ctx)
69
- if authenticated?
70
- url, account = start_ngrok(ctx, port)
71
- ctx.puts(ctx.message("core.tunnel.start_with_account", url, account))
72
- else
73
- url, _ = restart_ngrok(ctx, port)
74
- ctx.puts(ctx.message("core.tunnel.start", url))
75
- ctx.puts(ctx.message("core.tunnel.signup_suggestion", ShopifyCLI::TOOL_NAME))
76
- end
69
+ ctx.abort(ctx.message("core.tunnel.error.signup_required", ShopifyCLI::TOOL_NAME)) unless authenticated?
70
+ url, account = start_ngrok(ctx, port)
71
+ ctx.puts(ctx.message("core.tunnel.start_with_account", url, account))
77
72
  url
78
73
  end
79
74
 
@@ -208,11 +203,6 @@ module ShopifyCLI
208
203
  [log.url, log.account]
209
204
  end
210
205
 
211
- def restart_ngrok(ctx, port)
212
- ShopifyCLI::ProcessSupervision.stop(:ngrok)
213
- start_ngrok(ctx, port)
214
- end
215
-
216
206
  def check_prereq_command(ctx, command)
217
207
  cmd_path = ctx.which(command)
218
208
  ctx.abort(ctx.message("core.tunnel.error.prereq_command_required", command)) if cmd_path.nil?
@@ -1,3 +1,3 @@
1
1
  module ShopifyCLI
2
- VERSION = "2.15.3"
2
+ VERSION = "2.15.6"
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.15.3
4
+ version: 2.15.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-07 00:00:00.000000000 Z
11
+ date: 2022-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler