proscenium 0.21.4-x86_64-linux → 0.21.6-x86_64-linux
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 +4 -4
- data/lib/proscenium/ext/proscenium +0 -0
- data/lib/proscenium/log_subscriber.rb +1 -1
- data/lib/proscenium/middleware/silence_request.rb +31 -0
- data/lib/proscenium/middleware.rb +4 -16
- data/lib/proscenium/railtie.rb +4 -1
- data/lib/proscenium/templates/rescues/build_error.html.erb +2 -2
- data/lib/proscenium/version.rb +1 -1
- data/lib/proscenium.rb +5 -3
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: b8a97679b1b56f7a5647d73e778afdf3830b9b1f762cb5ab2f2938b645b4b17d
         | 
| 4 | 
            +
              data.tar.gz: d3e3435b3d4e20f67aee83c59b7a14e6943632081cf042fabb96900be6b7ea6d
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: a2bfc8e2aedbfb4e3129e3e6ca682c99f06603775dc2f99eb10ab5d1d35d5968314d495d7c9c06f3346fbb64abc6046b89bd32af7b768c7ff7aa4f2a2346a008
         | 
| 7 | 
            +
              data.tar.gz: 81cbe65e093e62d49eab491f52b7aa538bd4bb12c3fa77ef05ce5b9856b85cd1b72e84e288a960bae4d2ca406c704b6c7c3cca940dcddd76e82367721d9398e3
         | 
| Binary file | 
| @@ -20,7 +20,7 @@ module Proscenium | |
| 20 20 | 
             
                  path = CGI.unescape(path) if path.start_with?(/https?%3A%2F%2F/)
         | 
| 21 21 |  | 
| 22 22 | 
             
                  info do
         | 
| 23 | 
            -
                    message = "#{color('[Proscenium]', nil, bold: true)} Building /#{path}"
         | 
| 23 | 
            +
                    message = "  #{color('[Proscenium]', nil, bold: true)} Building /#{path}"
         | 
| 24 24 | 
             
                    message << " (Duration: #{event.duration.round(1)}ms | Allocations: #{event.allocations})"
         | 
| 25 25 | 
             
                  end
         | 
| 26 26 | 
             
                end
         | 
| @@ -0,0 +1,31 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            require 'active_support/logger_silence'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            module Proscenium
         | 
| 6 | 
            +
              class Middleware::SilenceRequest
         | 
| 7 | 
            +
                def initialize(app)
         | 
| 8 | 
            +
                  @app = app
         | 
| 9 | 
            +
                end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                def call(env)
         | 
| 12 | 
            +
                  request = ActionDispatch::Request.new(env)
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                  if (request.get? || request.head?) && proscenium_request?(request)
         | 
| 15 | 
            +
                    Rails.logger.silence { @app.call(env) }
         | 
| 16 | 
            +
                  else
         | 
| 17 | 
            +
                    @app.call(env)
         | 
| 18 | 
            +
                  end
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                private
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                def proscenium_request?(request)
         | 
| 24 | 
            +
                  return true if request.path.match?(CHUNKS_PATH)
         | 
| 25 | 
            +
             | 
| 26 | 
            +
                  pathname = Pathname.new(request.path)
         | 
| 27 | 
            +
                  pathname.fnmatch?(GEMS_PATH_GLOB, File::FNM_EXTGLOB) ||
         | 
| 28 | 
            +
                    pathname.fnmatch?(APP_PATH_GLOB, File::FNM_EXTGLOB)
         | 
| 29 | 
            +
                end
         | 
| 30 | 
            +
              end
         | 
| 31 | 
            +
            end
         | 
| @@ -4,12 +4,12 @@ module Proscenium | |
| 4 4 | 
             
              class Middleware
         | 
| 5 5 | 
             
                extend ActiveSupport::Autoload
         | 
| 6 6 |  | 
| 7 | 
            -
                # Error when the build command fails.
         | 
| 8 7 | 
             
                class BuildError < StandardError; end
         | 
| 9 8 |  | 
| 10 9 | 
             
                autoload :Base
         | 
| 11 10 | 
             
                autoload :Esbuild
         | 
| 12 11 | 
             
                autoload :RubyGems
         | 
| 12 | 
            +
                autoload :SilenceRequest
         | 
| 13 13 |  | 
| 14 14 | 
             
                def initialize(app)
         | 
| 15 15 | 
             
                  @app = app
         | 
| @@ -22,7 +22,7 @@ module Proscenium | |
| 22 22 |  | 
| 23 23 | 
             
                  # If this is a request for an asset chunk, we want to serve it with a very long
         | 
| 24 24 | 
             
                  # cache lifetime, since these are content-hashed and will never change.
         | 
| 25 | 
            -
                  if request.path.match?( | 
| 25 | 
            +
                  if request.path.match?(CHUNKS_PATH)
         | 
| 26 26 | 
             
                    ::ActionDispatch::FileHandler.new(
         | 
| 27 27 | 
             
                      Rails.public_path.join('assets').to_s,
         | 
| 28 28 | 
             
                      headers: {
         | 
| @@ -46,23 +46,11 @@ module Proscenium | |
| 46 46 | 
             
                def find_type(request)
         | 
| 47 47 | 
             
                  pathname = Pathname.new(request.path)
         | 
| 48 48 |  | 
| 49 | 
            -
                  if pathname.fnmatch?( | 
| 49 | 
            +
                  if pathname.fnmatch?(GEMS_PATH_GLOB, File::FNM_EXTGLOB)
         | 
| 50 50 | 
             
                    RubyGems
         | 
| 51 | 
            -
                  elsif pathname.fnmatch?( | 
| 51 | 
            +
                  elsif pathname.fnmatch?(APP_PATH_GLOB, File::FNM_EXTGLOB)
         | 
| 52 52 | 
             
                    Esbuild
         | 
| 53 53 | 
             
                  end
         | 
| 54 54 | 
             
                end
         | 
| 55 | 
            -
             | 
| 56 | 
            -
                def app_path_glob
         | 
| 57 | 
            -
                  "/{#{Proscenium::ALLOWED_DIRECTORIES}}/**.{#{file_extensions}}"
         | 
| 58 | 
            -
                end
         | 
| 59 | 
            -
             | 
| 60 | 
            -
                def gems_path_glob
         | 
| 61 | 
            -
                  "/node_modules/@rubygems/**.{#{file_extensions}}"
         | 
| 62 | 
            -
                end
         | 
| 63 | 
            -
             | 
| 64 | 
            -
                def file_extensions
         | 
| 65 | 
            -
                  @file_extensions ||= FILE_EXTENSIONS.join(',')
         | 
| 66 | 
            -
                end
         | 
| 67 55 | 
             
              end
         | 
| 68 56 | 
             
            end
         | 
    
        data/lib/proscenium/railtie.rb
    CHANGED
    
    | @@ -46,7 +46,10 @@ module Proscenium | |
| 46 46 | 
             
                end
         | 
| 47 47 |  | 
| 48 48 | 
             
                initializer 'proscenium.middleware' do |app|
         | 
| 49 | 
            -
                   | 
| 49 | 
            +
                  unless config.proscenium.logging
         | 
| 50 | 
            +
                    app.middleware.insert_before Rails::Rack::Logger, Proscenium::Middleware::SilenceRequest
         | 
| 51 | 
            +
                  end
         | 
| 52 | 
            +
                  app.middleware.insert_before ActionDispatch::ActionableExceptions, Proscenium::Middleware
         | 
| 50 53 | 
             
                end
         | 
| 51 54 |  | 
| 52 55 | 
             
                initializer 'proscenium.sideloading' do
         | 
| @@ -19,8 +19,8 @@ | |
| 19 19 |  | 
| 20 20 | 
             
            <%= @exception.error['location']['line'].to_s.rjust 5 %> │    <%= @exception.error['location']['line_text'] %>
         | 
| 21 21 | 
             
                  │    <%= (@exception.error['location']['length'] > 1 ? "~" * @exception.error['location']['length'] : "^").rjust(@exception.error['location']['column'] + @exception.error['location']['length']) %>
         | 
| 22 | 
            -
            <%- if @exception.error['location']['suggestion'].present?  | 
| 23 | 
            -
            <% else %> <%- end  | 
| 22 | 
            +
            <%- if @exception.error['location']['suggestion'].present? %>    + │    <%= @exception.error['location']['suggestion'].rjust(@exception.error['location']['column'] + 1) %>
         | 
| 23 | 
            +
            <% else %> <%- end %>
         | 
| 24 24 | 
             
            </pre>
         | 
| 25 25 | 
             
                  </div>
         | 
| 26 26 | 
             
                </div>
         | 
    
        data/lib/proscenium/version.rb
    CHANGED
    
    
    
        data/lib/proscenium.rb
    CHANGED
    
    | @@ -5,9 +5,6 @@ require 'active_support' | |
| 5 5 | 
             
            module Proscenium
         | 
| 6 6 | 
             
              extend ActiveSupport::Autoload
         | 
| 7 7 |  | 
| 8 | 
            -
              FILE_EXTENSIONS = ['js', 'mjs', 'ts', 'jsx', 'tsx', 'css', 'js.map', 'mjs.map', 'jsx.map',
         | 
| 9 | 
            -
                                 'ts.map', 'tsx.map', 'css.map'].freeze
         | 
| 10 | 
            -
             | 
| 11 8 | 
             
              # Default paths for Rails assets. Used by the `compute_asset_path` helper to maintain Rails
         | 
| 12 9 | 
             
              # default conventions of where JS and CSS files are located.
         | 
| 13 10 | 
             
              DEFAULT_RAILS_ASSET_PATHS = {
         | 
| @@ -15,7 +12,12 @@ module Proscenium | |
| 15 12 | 
             
                javascript: 'app/javascript/'
         | 
| 16 13 | 
             
              }.freeze
         | 
| 17 14 |  | 
| 15 | 
            +
              FILE_EXTENSIONS = ['js', 'mjs', 'ts', 'jsx', 'tsx', 'css', 'js.map', 'mjs.map', 'jsx.map',
         | 
| 16 | 
            +
                                 'ts.map', 'tsx.map', 'css.map'].freeze
         | 
| 18 17 | 
             
              ALLOWED_DIRECTORIES = 'app,lib,config,vendor,node_modules'
         | 
| 18 | 
            +
              APP_PATH_GLOB = "/{#{ALLOWED_DIRECTORIES}}/**.{#{FILE_EXTENSIONS.join(',')}}".freeze
         | 
| 19 | 
            +
              GEMS_PATH_GLOB = "/node_modules/@rubygems/**.{#{FILE_EXTENSIONS.join(',')}}".freeze
         | 
| 20 | 
            +
              CHUNKS_PATH = %r{^/_asset_chunks/}
         | 
| 19 21 |  | 
| 20 22 | 
             
              # Environment variables that should always be passed to the builder.
         | 
| 21 23 | 
             
              DEFAULT_ENV_VARS = Set['RAILS_ENV', 'NODE_ENV'].freeze
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: proscenium
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.21. | 
| 4 | 
            +
              version: 0.21.6
         | 
| 5 5 | 
             
            platform: x86_64-linux
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Joel Moss
         | 
| 8 8 | 
             
            autorequire:
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2025-10- | 
| 11 | 
            +
            date: 2025-10-24 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: ffi
         | 
| @@ -70,6 +70,7 @@ files: | |
| 70 70 | 
             
            - lib/proscenium/middleware/base.rb
         | 
| 71 71 | 
             
            - lib/proscenium/middleware/esbuild.rb
         | 
| 72 72 | 
             
            - lib/proscenium/middleware/ruby_gems.rb
         | 
| 73 | 
            +
            - lib/proscenium/middleware/silence_request.rb
         | 
| 73 74 | 
             
            - lib/proscenium/monkey.rb
         | 
| 74 75 | 
             
            - lib/proscenium/railtie.rb
         | 
| 75 76 | 
             
            - lib/proscenium/react-manager/index.jsx
         |