Sha256: 9c8f31ee58167009fab8122dc2f9fa37f3aa6e05dfbd56aa412b51ed26106847

Contents?: true

Size: 1.42 KB

Versions: 16

Compression:

Stored size: 1.42 KB

Contents

# frozen_string_literal: true

require 'active_support/dependencies/autoload'

module Proscenium
  extend ActiveSupport::Autoload

  FILE_EXTENSIONS = ['js', 'mjs', 'ts', 'jsx', 'tsx', 'css', 'js.map', 'mjs.map', 'jsx.map',
                     'ts.map', 'tsx.map', 'css.map'].freeze

  ALLOWED_DIRECTORIES = 'app,lib,config,vendor,node_modules'

  # Environment variables that should always be passed to the builder.
  DEFAULT_ENV_VARS = Set['RAILS_ENV', 'NODE_ENV'].freeze

  autoload :SourcePath
  autoload :Utils
  autoload :Monkey
  autoload :Middleware
  autoload :EnsureLoaded
  autoload :SideLoad
  autoload :CssModule
  autoload :ReactComponentable
  autoload :ViewComponent
  autoload :Phlex
  autoload :Helper
  autoload :Builder
  autoload :Importer
  autoload :Resolver

  class Deprecator
    def deprecation_warning(name, message, _caller_backtrace = nil)
      msg = "`#{name}` is deprecated and will be removed in a near future release of Proscenium"
      msg << " (#{message})" if message
      Kernel.warn msg
    end
  end

  class PathResolutionFailed < StandardError
    def initialize(path)
      @path = path
      super
    end

    def message
      "Path #{@path.inspect} cannot be resolved"
    end
  end

  class << self
    def config
      @config ||= Railtie.config.proscenium
    end

    def cache
      @cache ||= config.cache || ActiveSupport::Cache::NullStore.new
    end
  end
end

require 'proscenium/railtie'

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
proscenium-0.15.0.beta.4-x86_64-linux lib/proscenium.rb
proscenium-0.15.0.beta.4-aarch64-linux lib/proscenium.rb
proscenium-0.15.0.beta.4-arm64-darwin lib/proscenium.rb
proscenium-0.15.0.beta.4-x86_64-darwin lib/proscenium.rb
proscenium-0.15.0.beta.3-x86_64-linux lib/proscenium.rb
proscenium-0.15.0.beta.3-aarch64-linux lib/proscenium.rb
proscenium-0.15.0.beta.3-arm64-darwin lib/proscenium.rb
proscenium-0.15.0.beta.3-x86_64-darwin lib/proscenium.rb
proscenium-0.15.0.beta.2-x86_64-linux lib/proscenium.rb
proscenium-0.15.0.beta.2-aarch64-linux lib/proscenium.rb
proscenium-0.15.0.beta.2-arm64-darwin lib/proscenium.rb
proscenium-0.15.0.beta.2-x86_64-darwin lib/proscenium.rb
proscenium-0.15.0.beta.1-x86_64-linux lib/proscenium.rb
proscenium-0.15.0.beta.1-aarch64-linux lib/proscenium.rb
proscenium-0.15.0.beta.1-arm64-darwin lib/proscenium.rb
proscenium-0.15.0.beta.1-x86_64-darwin lib/proscenium.rb