Sha256: f1d7f068fddfb5c1077cbc09983224f1bed7c3a55510d63dd56f3cec674c3604

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

module Extension
  module Models
    module ServerConfig
      class DevelopmentRenderer < Base
        include SmartProperties

        VALID_RENDERERS = [
          "@shopify/admin-ui-extensions",
          "@shopify/post-purchase-ui-extensions",
          "@shopify/checkout-ui-extensions",
          "@shopify/retail-ui-extensions",
        ]

        property! :name, accepts: VALID_RENDERERS
        property! :version, accepts: String, default: "latest"

        def self.find(type)
          case type.downcase
          when "product_subscription"
            new(name: "@shopify/admin-ui-extensions", version: "^1.0.1")
          when "checkout_ui_extension"
            new(name: "@shopify/checkout-ui-extensions", version: "^0.15.0")
          when "checkout_post_purchase"
            new(name: "@shopify/post-purchase-ui-extensions", version: "^0.13.2")
          when "pos_ui_extension"
            new(name: "@shopify/retail-ui-extensions", version: "^0.1.0")
          when "beacon_extension"
            nil
          else
            raise ArgumentError, "Unknown extension type: #{type}"
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shopify-cli-2.18.0 lib/project_types/extension/models/server_config/development_renderer.rb