shopify-cli 2.16.1 → 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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/Gemfile.lock +3 -3
  4. data/ext/shopify-extensions/version +1 -1
  5. data/lib/project_types/extension/cli.rb +1 -0
  6. data/lib/project_types/extension/commands/build.rb +0 -2
  7. data/lib/project_types/extension/commands/serve.rb +8 -3
  8. data/lib/project_types/extension/features/argo_serve.rb +1 -1
  9. data/lib/project_types/extension/forms/questions/ask_template.rb +3 -3
  10. data/lib/project_types/extension/messages/messages.rb +16 -0
  11. data/lib/project_types/extension/models/development_server_requirements.rb +1 -1
  12. data/lib/project_types/extension/models/server_config/capabilities.rb +11 -0
  13. data/lib/project_types/extension/models/server_config/development.rb +9 -0
  14. data/lib/project_types/extension/models/server_config/development_renderer.rb +2 -0
  15. data/lib/project_types/extension/models/server_config/extension.rb +10 -3
  16. data/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +1 -1
  17. data/lib/project_types/extension/models/specification_handlers/{beacon_extension.rb → web_pixel_extension.rb} +11 -10
  18. data/lib/project_types/extension/models/specification_handlers/{beacon_extension_utils → web_pixel_extension_utils}/script_config.rb +1 -1
  19. data/lib/project_types/extension/models/specification_handlers/{beacon_extension_utils → web_pixel_extension_utils}/script_config_repository.rb +2 -2
  20. data/lib/project_types/extension/tasks/configure_options.rb +1 -1
  21. data/lib/project_types/extension/tasks/convert_server_config.rb +8 -4
  22. data/lib/project_types/extension/tasks/execute_commands/outdated_extension_detection.rb +5 -1
  23. data/lib/project_types/extension/tasks/merge_server_config.rb +4 -2
  24. data/lib/project_types/script/cli.rb +1 -0
  25. data/lib/project_types/script/config/extension_points.yml +20 -18
  26. data/lib/project_types/script/graphql/app_script_set.graphql +2 -0
  27. data/lib/project_types/script/layers/application/push_script.rb +1 -0
  28. data/lib/project_types/script/layers/domain/app_bridge.rb +16 -0
  29. data/lib/project_types/script/layers/domain/script_project.rb +1 -0
  30. data/lib/project_types/script/layers/infrastructure/errors.rb +11 -0
  31. data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +15 -1
  32. data/lib/project_types/script/layers/infrastructure/script_service.rb +9 -0
  33. data/lib/project_types/script/messages/messages.rb +4 -1
  34. data/lib/project_types/script/ui/error_handler.rb +8 -0
  35. data/lib/project_types/theme/commands/delete.rb +1 -0
  36. data/lib/project_types/theme/commands/open.rb +6 -1
  37. data/lib/project_types/theme/commands/publish.rb +1 -0
  38. data/lib/project_types/theme/commands/serve.rb +28 -0
  39. data/lib/project_types/theme/forms/select.rb +4 -1
  40. data/lib/project_types/theme/messages/messages.rb +33 -3
  41. data/lib/shopify_cli/admin_api.rb +1 -1
  42. data/lib/shopify_cli/commands/login.rb +2 -2
  43. data/lib/shopify_cli/context.rb +1 -1
  44. data/lib/shopify_cli/core/monorail.rb +1 -1
  45. data/lib/shopify_cli/git.rb +7 -2
  46. data/lib/shopify_cli/heroku.rb +5 -3
  47. data/lib/shopify_cli/messages/messages.rb +1 -1
  48. data/lib/shopify_cli/release.rb +5 -2
  49. data/lib/shopify_cli/services/app/create/node_service.rb +1 -1
  50. data/lib/shopify_cli/services/app/create/php_service.rb +1 -1
  51. data/lib/shopify_cli/theme/dev_server/hot_reload/sections_index.rb +5 -6
  52. data/lib/shopify_cli/theme/dev_server/watcher.rb +2 -1
  53. data/lib/shopify_cli/theme/dev_server.rb +20 -3
  54. data/lib/shopify_cli/theme/development_theme.rb +11 -1
  55. data/lib/shopify_cli/theme/file.rb +9 -0
  56. data/lib/shopify_cli/theme/syncer/forms/select_update_strategy.rb +2 -2
  57. data/lib/shopify_cli/theme/syncer/json_update_handler.rb +1 -1
  58. data/lib/shopify_cli/theme/theme_admin_api.rb +3 -1
  59. data/lib/shopify_cli/version.rb +1 -1
  60. metadata +7 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 671c2f790725e98a8ff2cd52ba3e82bfba8602119b9438e935f5762b2369944d
4
- data.tar.gz: 3636ef6682230d30d507f1e721771a52230fa6dedda9537b56ecd133729d5ddf
3
+ metadata.gz: bad168cdd878e04ba4bc934a9caa6bfd19ffba653564734395d0e53a20957a81
4
+ data.tar.gz: 2f45edbce9f20fe63472a26221a71ef4733ad6e9f951abe86f3b213a869b0cc4
5
5
  SHA512:
6
- metadata.gz: 90a96e0a4357d43118ed0417e310042327e520ac4ecfc3c6789a66a2acc502f908c99ce54b16768b56975ad8a83ca9e74f23d2f14fa2475083b2e46f126f238d
7
- data.tar.gz: f969943491bee41c44c172984942d8ee406e6e9bbbf95556b93f4843978925b127db0d52f52d961d19fff7ede178b990db25e83ff7a19dd0107f6ce040d50f6d
6
+ metadata.gz: 14ced1d055b8aa918d0168aa0b91ba8e8a3093a99838868a630866b34af28f4547e55cf208dc6051ee4ef20426b5202badaa5b7ab2ac5c536a9e39030a4d1744
7
+ data.tar.gz: 37d84adeb8489f6596f2ed9bf1481ecc9060697a88fb10fcd5b59e8c20bf3e021c0502019c43b38fb0ec1e424b06ecd4f377ebb20a5517272a9e46cce2fcc1ff
data/CHANGELOG.md CHANGED
@@ -2,6 +2,32 @@ 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.18.0 - 2022-05-30
6
+
7
+ ### Added
8
+ * [#2336](https://github.com/Shopify/shopify-cli/pull/2336): Add `--theme/-t` flag support to the `theme serve` command
9
+ * [#2325](https://github.com/Shopify/shopify-cli/pull/2325): Add `-e/--editor` flag to open theme editor in the `theme open` command
10
+ * [#2330](https://github.com/Shopify/shopify-cli/pull/2330): Add remote file deleted warning flow to `theme serve --theme-editor-sync`
11
+
12
+ ### Fixed
13
+ * [#2352](https://github.com/Shopify/shopify-cli/pull/2352): Provide better DX when dealing with empty theme selection
14
+ * [#2347](https://github.com/Shopify/shopify-cli/pull/2347): Fix #2346 Heroku CLI installation for Apple silicon
15
+
16
+ ## Version 2.17.0 - 2022-05-12
17
+
18
+ ### Added
19
+ * [#2262](https://github.com/Shopify/shopify-cli/pull/2262): Add `capabilities` permissions to checkout extensions config
20
+ * [#2292](https://github.com/Shopify/shopify-cli/pull/2292): Add support for App Bridge create/details URLs for scripts
21
+
22
+ ### Fixed
23
+ * [#2287](https://github.com/Shopify/shopify-cli/pull/2287): Fix `Encoding::UndefinedConversionError` on `theme serve` and `theme pull`
24
+ * [#2310](https://github.com/Shopify/shopify-cli/pull/2310): Fix live-reload to be resilient and no longer raise an error when a locale file is invalid
25
+ * [#2297](https://github.com/Shopify/shopify-cli/pull/2297): Only show update message when the new version is higher
26
+ * [#2270](https://github.com/Shopify/shopify-cli/pull/2270): Use ignore filter regex in watcher class
27
+
28
+ ### Changed
29
+ * [#2299](https://github.com/Shopify/shopify-cli/pull/2299): Improve the unauthorized API errors when doing theme development
30
+
5
31
  ## Version 2.16.1 - 2022-04-26
6
32
 
7
33
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.16.1)
4
+ shopify-cli (2.18.1)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.10.1)
@@ -101,7 +101,7 @@ GEM
101
101
  mocha (1.13.0)
102
102
  multi_test (0.1.2)
103
103
  multipart-post (2.1.1)
104
- nokogiri (1.13.4)
104
+ nokogiri (1.13.6)
105
105
  mini_portile2 (~> 2.8.0)
106
106
  racc (~> 1.4)
107
107
  octokit (4.22.0)
@@ -118,7 +118,7 @@ GEM
118
118
  pry (~> 0.13.0)
119
119
  public_suffix (4.0.6)
120
120
  racc (1.6.0)
121
- rack (2.2.3)
121
+ rack (2.2.3.1)
122
122
  rainbow (3.1.1)
123
123
  rake (13.0.6)
124
124
  rb-fsevent (0.11.1)
@@ -1 +1 @@
1
- v0.4.0
1
+ v0.12.0
@@ -122,6 +122,7 @@ module Extension
122
122
  module ServerConfig
123
123
  autoload :Base, Project.project_filepath("models/server_config/base")
124
124
  autoload :App, Project.project_filepath("models/server_config/app")
125
+ autoload :Capabilities, Project.project_filepath("models/server_config/capabilities")
125
126
  autoload :Development, Project.project_filepath("models/server_config/development")
126
127
  autoload :DevelopmentEntries, Project.project_filepath("models/server_config/development_entries")
127
128
  autoload :DevelopmentRenderer, Project.project_filepath("models/server_config/development_renderer")
@@ -4,8 +4,6 @@ require "shopify_cli"
4
4
  module Extension
5
5
  class Command
6
6
  class Build < ExtensionCommand
7
- hidden_feature
8
-
9
7
  prerequisite_task ensure_project_type: :extension
10
8
 
11
9
  YARN_BUILD_COMMAND = %w(build)
@@ -14,6 +14,9 @@ module Extension
14
14
  parser.on("--resourceUrl=RESOURCE_URL", "Provide a resource URL") do |resource_url|
15
15
  flags[:resource_url] = resource_url
16
16
  end
17
+ parser.on("-p", "--port=PORT", "Specify the port to use") do |port|
18
+ flags[:port] = port.to_i
19
+ end
17
20
  end
18
21
 
19
22
  class RuntimeConfiguration
@@ -22,13 +25,14 @@ module Extension
22
25
  property :tunnel_url, accepts: String, default: nil
23
26
  property :resource_url, accepts: String, default: nil
24
27
  property! :tunnel_requested, accepts: [true, false], reader: :tunnel_requested?, default: true
25
- property! :port, accepts: (1...(2**16)), default: DEFAULT_PORT
28
+ property :port, accepts: (1...(2**16))
26
29
  end
27
30
 
28
31
  def call(_args, _command_name)
29
32
  config = RuntimeConfiguration.new(
30
33
  tunnel_requested: tunnel_requested?,
31
- resource_url: options.flags[:resource_url]
34
+ resource_url: options.flags[:resource_url],
35
+ port: options.flags[:port]
32
36
  )
33
37
 
34
38
  ShopifyCLI::Result
@@ -51,10 +55,11 @@ module Extension
51
55
  end
52
56
 
53
57
  def find_available_port(runtime_configuration)
58
+ return runtime_configuration unless runtime_configuration.port.nil?
54
59
  return runtime_configuration unless specification_handler.choose_port?(@ctx)
55
60
 
56
61
  chosen_port = Tasks::ChooseNextAvailablePort
57
- .call(from: runtime_configuration.port)
62
+ .call(from: DEFAULT_PORT)
58
63
  .unwrap { |_error| @ctx.abort(@ctx.message("serve.no_available_ports_found")) }
59
64
  runtime_configuration.tap { |c| c.port = chosen_port }
60
65
  end
@@ -9,7 +9,7 @@ module Extension
9
9
  property! :specification_handler, accepts: Extension::Models::SpecificationHandlers::Default
10
10
  property :argo_runtime, accepts: -> (runtime) { runtime.class < Features::Runtimes::Base }
11
11
  property! :context, accepts: ShopifyCLI::Context
12
- property! :port, accepts: Integer, default: ShopifyCLI::Constants::Extension::DEFAULT_PORT
12
+ property! :port, accepts: Integer
13
13
  property :tunnel_url, accepts: String, default: nil
14
14
  property! :js_system, accepts: ->(jss) { jss.respond_to?(:call) }, default: ShopifyCLI::JsSystem
15
15
  property :resource_url, accepts: String, default: nil
@@ -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
 
@@ -0,0 +1,11 @@
1
+ module Extension
2
+ module Models
3
+ module ServerConfig
4
+ class Capabilities < Base
5
+ include SmartProperties
6
+
7
+ property :network_access, accepts: [true, false], default: false
8
+ end
9
+ end
10
+ end
11
+ end
@@ -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,6 +26,8 @@ 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 "web_pixel_extension"
30
+ nil
29
31
  else
30
32
  raise ArgumentError, "Unknown extension type: #{type}"
31
33
  end
@@ -10,11 +10,14 @@ module Extension
10
10
  property! :type, accepts: String
11
11
  property! :user, accepts: ServerConfig::User
12
12
  property! :development, accepts: ServerConfig::Development
13
+ property :capabilities, accepts: ServerConfig::Capabilities
13
14
  property :extension_points, accepts: Array
14
- property :version, accepts: String
15
15
  property :title, accepts: String
16
+ property :description, accepts: String
17
+ property :version, accepts: String
18
+ property :metafields, accepts: Array
16
19
 
17
- def self.build(uuid: "", template:, type:, root_dir:)
20
+ def self.build(uuid: "", template:, type:, root_dir:, **args)
18
21
  renderer = ServerConfig::DevelopmentRenderer.find(type)
19
22
  entry = ServerConfig::DevelopmentEntries.find(template)
20
23
  new(
@@ -26,7 +29,11 @@ module Extension
26
29
  template: template,
27
30
  renderer: renderer,
28
31
  entries: entry
29
- )
32
+ ),
33
+ capabilities: ServerConfig::Capabilities.new(
34
+ network_access: false
35
+ ),
36
+ metafields: args.delete(:metafields)
30
37
  )
31
38
  end
32
39
 
@@ -15,7 +15,7 @@ module Extension
15
15
  (?<region>[a-zA-Z]{2}) # Optional region subtag
16
16
  )?
17
17
  \z}x
18
- PERMITTED_CONFIG_KEYS = [:extension_points, :metafields, :name]
18
+ PERMITTED_CONFIG_KEYS = [:extension_points, :metafields, :name, :capabilities]
19
19
 
20
20
  def config(context)
21
21
  {
@@ -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
@@ -9,13 +9,14 @@ module Extension
9
9
  property! :api_key, accepts: String
10
10
  property! :context, accepts: ShopifyCLI::Context
11
11
  property! :hash, accepts: Hash
12
- property :port, accepts: Integer, default: ShopifyCLI::Constants::Extension::DEFAULT_PORT
12
+ property! :port, accepts: Integer
13
13
  property! :registration_uuid, accepts: String
14
14
  property :resource_url, accepts: String
15
15
  property! :store, accepts: String
16
16
  property! :title, accepts: String
17
17
  property :tunnel_url, accepts: String
18
18
  property! :type, accepts: String
19
+ property :metafields, accepts: Array
19
20
 
20
21
  DEFAULT_BUILD_DIR = "build"
21
22
 
@@ -27,10 +28,9 @@ module Extension
27
28
  context.abort(context.message("tasks.errors.parse_error")) if hash.nil?
28
29
 
29
30
  renderer = Models::ServerConfig::DevelopmentRenderer.find(type)
30
-
31
31
  extension = Models::ServerConfig::Extension.new(
32
32
  uuid: registration_uuid,
33
- type: type.upcase,
33
+ type: type,
34
34
  user: Models::ServerConfig::User.new,
35
35
  development: Models::ServerConfig::Development.new(
36
36
  build_dir: hash.dig("development", "build_dir") || DEFAULT_BUILD_DIR,
@@ -40,8 +40,12 @@ module Extension
40
40
  )
41
41
  ),
42
42
  extension_points: hash.dig("extension_points"),
43
+ capabilities: Models::ServerConfig::Capabilities.new(
44
+ network_access: hash.dig("capabilities", "network_access") || false
45
+ ),
43
46
  version: renderer ? version(renderer.name, context) : nil,
44
- title: title
47
+ title: title,
48
+ metafields: metafields
45
49
  )
46
50
 
47
51
  unless resource_url.nil?
@@ -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")
@@ -9,7 +9,7 @@ module Extension
9
9
 
10
10
  property! :context, accepts: ShopifyCLI::Context
11
11
  property! :file_path, accepts: ->(path) { Pathname(path).yield_self(&:absolute?) }
12
- property :port, accepts: Integer, default: ShopifyCLI::Constants::Extension::DEFAULT_PORT
12
+ property! :port, accepts: Integer, default: ShopifyCLI::Constants::Extension::DEFAULT_PORT
13
13
  property :resource_url, accepts: String
14
14
  property :tunnel_url, accepts: String
15
15
  property! :type, accepts: Models::DevelopmentServerRequirements::SUPPORTED_EXTENSION_TYPES
@@ -32,7 +32,9 @@ module Extension
32
32
  store: project.env.shop || "",
33
33
  title: project.title,
34
34
  tunnel_url: tunnel_url,
35
- type: type
35
+ type: type,
36
+ port: port,
37
+ metafields: config["metafields"]
36
38
  )
37
39
  rescue Psych::SyntaxError => e
38
40
  raise(
@@ -50,6 +50,7 @@ module Script
50
50
  autoload :ExtensionPoint, Project.project_filepath("layers/domain/extension_point")
51
51
  autoload :ScriptConfig, Project.project_filepath("layers/domain/script_config")
52
52
  autoload :ScriptProject, Project.project_filepath("layers/domain/script_project")
53
+ autoload :AppBridge, Project.project_filepath("layers/domain/app_bridge")
53
54
  end
54
55
 
55
56
  module Infrastructure
@@ -9,50 +9,52 @@ payment_methods:
9
9
  repo: "https://github.com/Shopify/scripts-apis-examples"
10
10
  rust:
11
11
  repo: "https://github.com/Shopify/scripts-apis-examples"
12
- shipping_methods:
12
+ payment_customization:
13
+ beta: true
13
14
  domain: 'checkout'
14
15
  libraries:
15
- typescript:
16
- beta: true
17
- package: "@shopify/scripts-checkout-apis"
18
- repo: "https://github.com/Shopify/scripts-apis-examples"
19
16
  wasm:
20
17
  repo: "https://github.com/Shopify/scripts-apis-examples"
21
- merchandise_discount_types:
22
- beta: true
23
- domain: 'discounts'
18
+ rust:
19
+ repo: "https://github.com/Shopify/scripts-apis-examples"
20
+ shipping_methods:
21
+ domain: 'checkout'
24
22
  libraries:
25
23
  typescript:
26
24
  beta: true
27
- package: "@shopify/scripts-discounts-apis"
25
+ package: "@shopify/scripts-checkout-apis"
28
26
  repo: "https://github.com/Shopify/scripts-apis-examples"
29
27
  wasm:
30
28
  repo: "https://github.com/Shopify/scripts-apis-examples"
31
- delivery_discount_types:
29
+ rust:
30
+ repo: "https://github.com/Shopify/scripts-apis-examples"
31
+ product_discounts:
32
32
  beta: true
33
33
  domain: 'discounts'
34
34
  libraries:
35
- typescript:
36
- beta: true
37
- package: "@shopify/scripts-discounts-apis"
38
- repo: "https://github.com/Shopify/scripts-apis-examples"
39
35
  wasm:
40
36
  repo: "https://github.com/Shopify/scripts-apis-examples"
41
- product_discount_type:
37
+ rust:
38
+ repo: "https://github.com/Shopify/scripts-apis-examples"
39
+ order_discounts:
42
40
  beta: true
43
41
  domain: 'discounts'
44
42
  libraries:
45
43
  wasm:
46
44
  repo: "https://github.com/Shopify/scripts-apis-examples"
47
- order_discount_type:
45
+ rust:
46
+ repo: "https://github.com/Shopify/scripts-apis-examples"
47
+ shipping_discounts:
48
48
  beta: true
49
49
  domain: 'discounts'
50
50
  libraries:
51
51
  wasm:
52
52
  repo: "https://github.com/Shopify/scripts-apis-examples"
53
- shipping_discount_type:
53
+ rust:
54
+ repo: "https://github.com/Shopify/scripts-apis-examples"
55
+ shipping_rates_consolidation:
54
56
  beta: true
55
- domain: 'discounts'
57
+ domain: 'checkout'
56
58
  libraries:
57
59
  wasm:
58
60
  repo: "https://github.com/Shopify/scripts-apis-examples"
@@ -12,6 +12,7 @@ mutation AppScriptSet(
12
12
  $moduleUploadUrl: String!,
13
13
  $library: LibraryInput,
14
14
  $inputQuery: String,
15
+ $appBridge: AppBridgeInput!,
15
16
  ) {
16
17
  appScriptSet(
17
18
  uuid: $uuid
@@ -27,6 +28,7 @@ mutation AppScriptSet(
27
28
  moduleUploadUrl: $moduleUploadUrl,
28
29
  library: $library,
29
30
  inputQuery: $inputQuery,
31
+ appBridge: $appBridge
30
32
  ) {
31
33
  userErrors {
32
34
  field
@@ -55,6 +55,7 @@ module Script
55
55
  force: force,
56
56
  metadata: package.metadata,
57
57
  script_config: package.script_config,
58
+ app_bridge: script_project.app_bridge,
58
59
  module_upload_url: module_upload_url,
59
60
  library: package.library,
60
61
  input_query: script_project.input_query,
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Script
4
+ module Layers
5
+ module Domain
6
+ class AppBridge
7
+ attr_reader :create_path, :details_path
8
+
9
+ def initialize(create_path:, details_path:)
10
+ @create_path = create_path
11
+ @details_path = details_path
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -17,6 +17,7 @@ module Script
17
17
  property! :language, accepts: String
18
18
 
19
19
  property :script_config, accepts: ScriptConfig
20
+ property :app_bridge, accepts: AppBridge
20
21
  property :input_query, accepts: String
21
22
 
22
23
  def initialize(*)
@@ -194,6 +194,17 @@ module Script
194
194
  messages.join("\n")
195
195
  end
196
196
  end
197
+
198
+ class InvalidAppBridgePathError < ScriptProjectError
199
+ def initialize(path_type)
200
+ @path_type = path_type
201
+ super()
202
+ end
203
+
204
+ def path_key
205
+ "app_bridge_#{@path_type}_path"
206
+ end
207
+ end
197
208
  end
198
209
  end
199
210
  end