shopify-cli 1.11.0 → 1.12.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: e1ca8221a25313b8cd908a02e4c5c68dc9f74ed38e7472804346419e45d8d9d8
4
- data.tar.gz: b0658aae7cb7ca368b78aa80f3fab364867bc1d6ae36515c07f3692bb87730cb
3
+ metadata.gz: 45acefe059ce1e83e77f20be8ee3b7815c5be28f834ef7697dd9000175884c4f
4
+ data.tar.gz: a1abb2765725c6a1d593f869c323f179429b7c21d25de9bfa8649e5817dc9d6e
5
5
  SHA512:
6
- metadata.gz: 54fde8fed1098f483c817cfb0dd8d9ab291556da026dabcc7d0e0dc934fb9c2e97dd2865d72257ca75a2c5d1560759e4ece27c8acc76a8a56f299e8f004594f0
7
- data.tar.gz: b193f5f389c2a03875e98d4636aa3cd16c7bfe212d798defed234233b0aad410382e3f56d83b58f63189b6f8256be762518c4439bfe732961c682db8fd81cb25
6
+ metadata.gz: 5f73366ea4f16f7d5615fe6ae62edd58692f85288b7f6056be61a4cbcbf72c94a1979cc806255fe55c82504f42433c1264ca9b479203639dbaf209273189cccc
7
+ data.tar.gz: 556ef6bdc6338c156d1ef6c9f9971e37d687cd7c1c8c93f6dc609a053f2303cde7d03b968e2e0e2336e59bc5b89539e8fb3a12f38e3427bbddb29bf448d7f130
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  Unreleased
2
2
  ------
3
3
 
4
+ Version 1.12.0
5
+ --------------
6
+ * [1255](https://github.com/Shopify/shopify-app-cli/pull/1255): Fix beta flag checks when running `shopify serve`
7
+
4
8
  Version 1.11.0
5
9
  --------------
6
10
  * [#1221](https://github.com/Shopify/shopify-app-cli/pull/1221): Prioritizes returning an HTTPS URL over HTTP from `shopify tunnel status`.
@@ -12,6 +12,7 @@ module Extension
12
12
 
13
13
  property! :renderer, accepts: Models::NpmPackage
14
14
  property! :cli, accepts: Models::NpmPackage
15
+ property :beta_access, accepts: Array, default: -> { [] }
15
16
 
16
17
  def accepts_port?
17
18
  case cli
@@ -49,6 +50,26 @@ module Extension
49
50
  end
50
51
  end
51
52
 
53
+ def accepts_shop?
54
+ return false unless beta_access.include?(:argo_admin_beta)
55
+ case cli
56
+ when admin?
57
+ cli >= ARGO_ADMIN_CLI_0_11_0
58
+ else
59
+ false
60
+ end
61
+ end
62
+
63
+ def accepts_api_key?
64
+ return false unless beta_access.include?(:argo_admin_beta)
65
+ case cli
66
+ when admin?
67
+ cli >= ARGO_ADMIN_CLI_0_11_0
68
+ else
69
+ false
70
+ end
71
+ end
72
+
52
73
  private
53
74
 
54
75
  def admin?
@@ -8,6 +8,7 @@ module Extension
8
8
  property! :context, accepts: ShopifyCli::Context
9
9
  property! :port, accepts: Integer, default: 39351
10
10
  property :tunnel_url, accepts: String, default: ""
11
+ property :beta_access, accepts: Array, default: -> { [] }
11
12
 
12
13
  def call
13
14
  validate_env!
@@ -58,10 +59,10 @@ module Extension
58
59
  def validate_env!
59
60
  ExtensionProject.reload
60
61
 
61
- ShopifyCli::Shopifolk.check && ShopifyCli::Feature.enabled?(:argo_admin_beta)
62
-
63
62
  return if required_fields.none?
64
63
 
64
+ return unless beta_access.include?(:argo_admin_beta)
65
+
65
66
  ShopifyCli::Tasks::EnsureEnv.call(context, required: required_fields)
66
67
  ShopifyCli::Tasks::EnsureDevStore.call(context) if required_fields.include?(:shop)
67
68
 
@@ -25,11 +25,12 @@ module Extension
25
25
 
26
26
  def options
27
27
  project = ExtensionProject.current
28
+ api_key = project.env.api_key
28
29
 
29
30
  @serve_options ||= [].tap do |options|
30
31
  options << "--port=#{port}" if argo_runtime.accepts_port?
31
- options << "--shop=#{project.env.shop}" if required_fields.include?(:shop)
32
- options << "--apiKey=#{project.env.api_key}" if required_fields.include?(:api_key)
32
+ options << "--shop=#{project.env.shop}" if required_fields.include?(:shop) && argo_runtime.accepts_shop?
33
+ options << "--apiKey=#{api_key}" if required_fields.include?(:api_key) && argo_runtime.accepts_api_key?
33
34
  options << "--argoVersion=#{renderer_package.version}" if argo_runtime.accepts_argo_version?
34
35
  options << "--uuid=#{project.registration_uuid}" if argo_runtime.accepts_uuid?
35
36
  options << "--publicUrl=#{public_url}" if argo_runtime.accepts_tunnel_url?
@@ -51,8 +51,14 @@ module Extension
51
51
  end
52
52
 
53
53
  def serve(context:, port:, tunnel_url:)
54
- Features::ArgoServe.new(specification_handler: self, argo_runtime: argo_runtime(context),
55
- context: context, port: port, tunnel_url: tunnel_url).call
54
+ Features::ArgoServe.new(
55
+ specification_handler: self,
56
+ argo_runtime: argo_runtime(context),
57
+ context: context,
58
+ port: port,
59
+ tunnel_url: tunnel_url,
60
+ beta_access: beta_access
61
+ ).call
56
62
  end
57
63
 
58
64
  def renderer_package(context)
@@ -62,10 +68,19 @@ module Extension
62
68
  def argo_runtime(context)
63
69
  @argo_runtime ||= Features::ArgoRuntime.new(
64
70
  renderer: renderer_package(context),
65
- cli: cli_package(context)
71
+ cli: cli_package(context),
72
+ beta_access: beta_access
66
73
  )
67
74
  end
68
75
 
76
+ def beta_access
77
+ argo_admin_beta? ? [:argo_admin_beta] : []
78
+ end
79
+
80
+ def argo_admin_beta?
81
+ ShopifyCli::Shopifolk.check && ShopifyCli::Feature.enabled?(:argo_admin_beta)
82
+ end
83
+
69
84
  def cli_package(context)
70
85
  cli_package_name = specification.features.argo&.cli_package_name
71
86
  return unless cli_package_name
@@ -33,7 +33,7 @@ module ShopifyCli
33
33
  end
34
34
 
35
35
  def acting_as_shopify_organization?
36
- !!@acting_as_shopify_organization || (Project.has_current? && Project.current.config["shopify_organization"])
36
+ !!(@acting_as_shopify_organization || (Project.has_current? && Project.current.config["shopify_organization"]))
37
37
  end
38
38
 
39
39
  def reset
@@ -1,3 +1,3 @@
1
1
  module ShopifyCli
2
- VERSION = "1.11.0"
2
+ VERSION = "1.12.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: 1.11.0
4
+ version: 1.12.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-05-19 00:00:00.000000000 Z
11
+ date: 2021-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler