Sha256: 6e5a9c97d58473260279481bb2174d47a0e02da7138d06aed5399c709a9a517b

Contents?: true

Size: 791 Bytes

Versions: 17

Compression:

Stored size: 791 Bytes

Contents

# frozen_string_literal: true
require "shopify_cli"

module Extension
  module Models
    class DevelopmentServerRequirements
      SUPPORTED_EXTENSION_TYPES = [
        "checkout_ui_extension",
        "checkout_post_purchase",
        "product_subscription",
      ]

      class << self
        def supported?(type)
          binary_installed? && type_supported?(type) && beta_enabled?
        end

        private

        def binary_installed?
          Models::DevelopmentServer.new.executable_installed?
        end

        def type_supported?(type)
          SUPPORTED_EXTENSION_TYPES.include?(type.downcase)
        end

        def beta_enabled?
          ShopifyCLI::Shopifolk.check && ShopifyCLI::Feature.enabled?(:extension_server_beta)
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
shopify-cli-2.15.0 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.14.0 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.13.0 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.12.0 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.11.2 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.11.1 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.11.0 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.10.2 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.10.1 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.10.0 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.9.0 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.8.0 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.7.4 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.7.3 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.7.2 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.7.1 lib/project_types/extension/models/development_server_requirements.rb
shopify-cli-2.7.0 lib/project_types/extension/models/development_server_requirements.rb