shopify-cli 2.18.0 → 2.18.1

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: 7dc113806552b27305be696850c04b292d7ba8feb0e5a60c0755bdb93b193535
4
- data.tar.gz: 7fd46f5612eda607b0e2b2f01ea8662ce1d6d4803475b4e7d3bde98155ed06db
3
+ metadata.gz: bad168cdd878e04ba4bc934a9caa6bfd19ffba653564734395d0e53a20957a81
4
+ data.tar.gz: 2f45edbce9f20fe63472a26221a71ef4733ad6e9f951abe86f3b213a869b0cc4
5
5
  SHA512:
6
- metadata.gz: d1553e12053b6666755dde7c4381fce2018da1d73ab2f85cc456f6ad97fd58db89360a4fe02beb7b40d3a6d0010e2c8f15b68ff6246ff25426796f39f451aafc
7
- data.tar.gz: 5a9f020586bfaf2b828aed9bb1ae4040bc0deab133e71181fe49c5710fd9a5a3b3cc71faf653f0311054038b76d749303947e0af6d902b7096cf84c2c610a3bf
6
+ metadata.gz: 14ced1d055b8aa918d0168aa0b91ba8e8a3093a99838868a630866b34af28f4547e55cf208dc6051ee4ef20426b5202badaa5b7ab2ac5c536a9e39030a4d1744
7
+ data.tar.gz: 37d84adeb8489f6596f2ed9bf1481ecc9060697a88fb10fcd5b59e8c20bf3e021c0502019c43b38fb0ec1e424b06ecd4f377ebb20a5517272a9e46cce2fcc1ff
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.18.0)
4
+ shopify-cli (2.18.1)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.10.1)
@@ -12,7 +12,7 @@ module Extension
12
12
 
13
13
  def call(project_details)
14
14
  if template_required?(project_details)
15
- project_details.template = template || choose_interactively
15
+ project_details.template = template || choose_interactively(project_details)
16
16
  end
17
17
  project_details
18
18
  end
@@ -24,9 +24,9 @@ module Extension
24
24
  Models::DevelopmentServerRequirements.supported?(type)
25
25
  end
26
26
 
27
- def choose_interactively
27
+ def choose_interactively(project_details)
28
28
  prompt.call(ctx.message("create.ask_template")) do |handler|
29
- Models::ServerConfig::Development::VALID_TEMPLATES.each do |template|
29
+ Models::ServerConfig::Development.find(project_details&.type&.identifier).each do |template|
30
30
  handler.option(template) { template }
31
31
  end
32
32
  end
@@ -216,6 +216,22 @@ module Extension
216
216
  * Add a develop script: shopify-cli-extensions develop
217
217
  * Change the build script to: shopify-cli-extensions build
218
218
  TEXT
219
+ product_subscription: <<~TEXT.strip,
220
+ Please update your package.json as follows:
221
+ * Replace the development dependency @shopify/admin-ui-extensions-run
222
+ with @shopify/shopify-cli-extensions
223
+ * Remove the start and server script
224
+ * Add a develop script: shopify-cli-extensions develop
225
+ * Change the build script to: shopify-cli-extensions build
226
+ TEXT
227
+ checkout_post_purchase: <<~TEXT.strip,
228
+ Please update your package.json as follows:
229
+ * Replace the development dependency @shopify/checkout-ui-extensions-run
230
+ with @shopify/shopify-cli-extensions
231
+ * Remove the start and server script
232
+ * Add a develop script: shopify-cli-extensions develop
233
+ * Change the build script to: shopify-cli-extensions build
234
+ TEXT
219
235
  },
220
236
  },
221
237
  warnings: {
@@ -9,7 +9,7 @@ module Extension
9
9
  "checkout_ui_extension",
10
10
  "checkout_post_purchase",
11
11
  "product_subscription",
12
- "beacon_extension",
12
+ "web_pixel_extension",
13
13
  "pos_ui_extension",
14
14
  ]
15
15
 
@@ -18,6 +18,15 @@ module Extension
18
18
  property :renderer, accepts: ServerConfig::DevelopmentRenderer
19
19
  property :entries, accepts: ServerConfig::DevelopmentEntries
20
20
  property :resource, accepts: ServerConfig::DevelopmentResource
21
+
22
+ def self.find(type)
23
+ case type.downcase
24
+ when "web_pixel_extension"
25
+ ["javascript"]
26
+ else
27
+ VALID_TEMPLATES
28
+ end
29
+ end
21
30
  end
22
31
  end
23
32
  end
@@ -26,7 +26,7 @@ module Extension
26
26
  new(name: "@shopify/post-purchase-ui-extensions", version: "^0.13.2")
27
27
  when "pos_ui_extension"
28
28
  new(name: "@shopify/retail-ui-extensions", version: "^0.1.0")
29
- when "beacon_extension"
29
+ when "web_pixel_extension"
30
30
  nil
31
31
  else
32
32
  raise ArgumentError, "Unknown extension type: #{type}"
@@ -2,45 +2,46 @@
2
2
  require "base64"
3
3
  require "fileutils"
4
4
  require "json"
5
- require_relative "beacon_extension_utils/script_config"
6
- require_relative "beacon_extension_utils/script_config_repository"
5
+ require_relative "web_pixel_extension_utils/script_config"
6
+ require_relative "web_pixel_extension_utils/script_config_repository"
7
7
 
8
8
  module Extension
9
9
  module Models
10
10
  module SpecificationHandlers
11
- class BeaconExtension < Default
11
+ class WebPixelExtension < Default
12
12
  SCRIPT_FILE = "build/main.js"
13
13
 
14
14
  def name
15
- "Beacon Extension"
15
+ "Web Pixel Extension"
16
16
  end
17
17
 
18
18
  def read_configuration
19
19
  end
20
20
 
21
21
  def access_config_property(context, ext_config, key, &process_value)
22
- context.abort(context.message("core.extension.push.beacon_extension.error.missing_config_key_error",
22
+ context.abort(context.message("core.extension.push.web_pixel_extension.error.missing_config_key_error",
23
23
  key)) unless ext_config.key?(key)
24
24
 
25
25
  begin
26
26
  process_value.nil? ? ext_config[key] : process_value.call(ext_config[key])
27
27
  rescue StandardError
28
- context.abort(context.message("core.extension.push.beacon_extension.error.invalid_config_value_error", key))
28
+ context.abort(context.message("core.extension.push.web_pixel_extension.error.invalid_config_value_error",
29
+ key))
29
30
  end
30
31
  end
31
32
 
32
33
  def config(context)
33
34
  begin
34
- ext_config = BeaconExtensionUtils::ScriptConfigYmlRepository.new(ctx: context).get!.content
35
+ ext_config = WebPixelExtensionUtils::ScriptConfigYmlRepository.new(ctx: context).get!.content
35
36
  rescue StandardError
36
- context.abort(context.message("core.extension.push.beacon_extension.error.file_read_error",
37
- BeaconExtensionUtils::ScriptConfigYmlRepository.filename))
37
+ context.abort(context.message("core.extension.push.web_pixel_extension.error.file_read_error",
38
+ WebPixelExtensionUtils::ScriptConfigYmlRepository.filename))
38
39
  end
39
40
 
40
41
  begin
41
42
  script_contents = File.read(File.join(context.root, SCRIPT_FILE)).chomp
42
43
  rescue
43
- context.abort(context.message("core.extension.push.beacon_extension.error.file_read_error", SCRIPT_FILE))
44
+ context.abort(context.message("core.extension.push.web_pixel_extension.error.file_read_error", SCRIPT_FILE))
44
45
  end
45
46
  {
46
47
  runtime_context: access_config_property(context, ext_config, "runtime_context"),
@@ -3,7 +3,7 @@
3
3
  module Extension
4
4
  module Models
5
5
  module SpecificationHandlers
6
- module BeaconExtensionUtils
6
+ module WebPixelExtensionUtils
7
7
  class ScriptConfig
8
8
  attr_reader :content, :version, :configuration, :filename
9
9
 
@@ -2,7 +2,7 @@ require_relative "script_config"
2
2
  module Extension
3
3
  module Models
4
4
  module SpecificationHandlers
5
- module BeaconExtensionUtils
5
+ module WebPixelExtensionUtils
6
6
  class ScriptConfigRepository
7
7
  include SmartProperties
8
8
  property! :ctx, accepts: ShopifyCLI::Context
@@ -27,7 +27,7 @@ module Extension
27
27
  private
28
28
 
29
29
  def from_h(hash)
30
- Extension::Models::SpecificationHandlers::BeaconExtensionUtils::ScriptConfig.new(content: hash,
30
+ Extension::Models::SpecificationHandlers::WebPixelExtensionUtils::ScriptConfig.new(content: hash,
31
31
  filename: filename)
32
32
  end
33
33
 
@@ -14,7 +14,7 @@ module Extension
14
14
 
15
15
  def configure_skip_build(attributes)
16
16
  attributes[:options].merge!(skip_build: attributes[:identifier] == "theme_app_extension" ||
17
- attributes[:identifier] == "beacon_extension")
17
+ attributes[:identifier] == "web_pixel_extension")
18
18
  end
19
19
  end
20
20
  end
@@ -20,6 +20,10 @@ module Extension
20
20
  case type
21
21
  when "checkout_ui_extension"
22
22
  context.message("errors.outdated_extensions.checkout_ui_extension")
23
+ when "product_subscription"
24
+ context.message("errors.outdated_extensions.product_subscription")
25
+ when "checkout_post_purchase"
26
+ context.message("errors.outdated_extensions.checkout_post_purchase")
23
27
  else
24
28
  context.message("errors.outdated_extensions.unknown")
25
29
  end
@@ -33,7 +37,7 @@ module Extension
33
37
 
34
38
  def valid?(package)
35
39
  case type
36
- when "checkout_ui_extension"
40
+ when "checkout_ui_extension", "product_subscription", "checkout_post_purchase"
37
41
  package.dev_dependency?("@shopify/shopify-cli-extensions") &&
38
42
  package.script?("build") &&
39
43
  package.script?("develop")
@@ -37,7 +37,9 @@ module Script
37
37
  extension_point_type: extension_point_type,
38
38
  title: title,
39
39
  description: nil,
40
- language: language
40
+ language: language,
41
+ app_bridge_create_path: "/",
42
+ app_bridge_details_path: "/",
41
43
  )
42
44
 
43
45
  build_script_project(script_config: nil)
@@ -124,8 +126,8 @@ module Script
124
126
  end
125
127
 
126
128
  def app_bridge
127
- create_path = project_config_value("app_bridge_create_path") || "/"
128
- details_path = project_config_value("app_bridge_details_path") || "/"
129
+ create_path = project_config_value!("app_bridge_create_path")
130
+ details_path = project_config_value!("app_bridge_details_path")
129
131
 
130
132
  Domain::AppBridge.new(
131
133
  create_path: create_path,
@@ -24,7 +24,7 @@ module Script
24
24
  oauth_help: "Wait a few minutes and try again.",
25
25
 
26
26
  invalid_context_cause: "Your .shopify-cli.yml is formatted incorrectly. It's missing values for "\
27
- "extension_point_type or title.",
27
+ "extension_point_type, title, app_bridge_create_path or app_bridge_details_path.",
28
28
  invalid_context_help: "Add these values.",
29
29
 
30
30
  invalid_script_title_cause: "Script title contains unsupported characters.",
@@ -67,9 +67,14 @@ module ShopifyCLI
67
67
  if Dir.exist?(dest)
68
68
  ctx.abort(ctx.message("core.git.error.directory_exists"))
69
69
  else
70
+ repo, branch = repository.split("#")
70
71
  success_message = ctx.message("core.git.cloned", dest)
71
- CLI::UI::Frame.open(ctx.message("core.git.cloning", repository, dest), success_text: success_message) do
72
- clone_progress("clone", "--single-branch", repository, dest, ctx: ctx)
72
+ CLI::UI::Frame.open(ctx.message("core.git.cloning", repo, dest), success_text: success_message) do
73
+ if branch
74
+ clone_progress("clone", "--single-branch", "--branch", branch, repo, dest, ctx: ctx)
75
+ else
76
+ clone_progress("clone", "--single-branch", repo, dest, ctx: ctx)
77
+ end
73
78
  end
74
79
  end
75
80
  end
@@ -285,7 +285,7 @@ module ShopifyCLI
285
285
  },
286
286
  extension: {
287
287
  push: {
288
- beacon_extension: {
288
+ web_pixel_extension: {
289
289
  error: {
290
290
  file_read_error: "There was a problem reading %s",
291
291
  missing_config_key_error: "Configuration is missing key: %s",
@@ -117,7 +117,7 @@ module ShopifyCLI
117
117
  end
118
118
 
119
119
  def build(name)
120
- ShopifyCLI::Git.clone("https://github.com/Shopify/shopify-app-node.git", name)
120
+ ShopifyCLI::Git.clone("https://github.com/Shopify/shopify-app-template-node.git#cli_two", name)
121
121
 
122
122
  context.root = File.join(context.root, name)
123
123
 
@@ -74,7 +74,7 @@ module ShopifyCLI
74
74
  end
75
75
 
76
76
  def build(form)
77
- ShopifyCLI::Git.clone("https://github.com/Shopify/shopify-app-php.git", form.name)
77
+ ShopifyCLI::Git.clone("https://github.com/Shopify/shopify-app-template-php.git#cli_two", form.name)
78
78
 
79
79
  context.root = File.join(context.root, form.name)
80
80
  context.chdir(context.root)
@@ -1,3 +1,3 @@
1
1
  module ShopifyCLI
2
- VERSION = "2.18.0"
2
+ VERSION = "2.18.1"
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.18.0
4
+ version: 2.18.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-30 00:00:00.000000000 Z
11
+ date: 2022-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -253,13 +253,13 @@ files:
253
253
  - lib/project_types/extension/models/server_config/root.rb
254
254
  - lib/project_types/extension/models/server_config/user.rb
255
255
  - lib/project_types/extension/models/specification.rb
256
- - lib/project_types/extension/models/specification_handlers/beacon_extension.rb
257
- - lib/project_types/extension/models/specification_handlers/beacon_extension_utils/script_config.rb
258
- - lib/project_types/extension/models/specification_handlers/beacon_extension_utils/script_config_repository.rb
259
256
  - lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb
260
257
  - lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
261
258
  - lib/project_types/extension/models/specification_handlers/default.rb
262
259
  - lib/project_types/extension/models/specification_handlers/theme_app_extension.rb
260
+ - lib/project_types/extension/models/specification_handlers/web_pixel_extension.rb
261
+ - lib/project_types/extension/models/specification_handlers/web_pixel_extension_utils/script_config.rb
262
+ - lib/project_types/extension/models/specification_handlers/web_pixel_extension_utils/script_config_repository.rb
263
263
  - lib/project_types/extension/models/specifications.rb
264
264
  - lib/project_types/extension/models/validation_error.rb
265
265
  - lib/project_types/extension/models/version.rb