proscenium 0.21.4-x86_64-darwin → 0.21.6-x86_64-darwin
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/ext/proscenium.h +1 -9
- 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: 73bfd46f757a568bc396030d83a700b92b688bd7b1ce202f75801bdb6b1bdaa8
|
|
4
|
+
data.tar.gz: eb081a7f9a7fb639f4f6504c3ac7e9e58a8b10d39f14b0c3dedb1b922e6356e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1668d90ca4d1732d42014ba4244ed783d8db930eaee83c627da66b0abaa507bdfb16cdb23b3e3af4fc859441ca17a071ef96e3ddc31bbc38f172b0f13c57a455
|
|
7
|
+
data.tar.gz: 8c6ccf8a3bbbfaf4ec480eef08bab1210684e787d69b1519d5d75b5cf31ba61cc549305f31bf0513d455ddee95dc83581eab1f1394b1d6c2815695e5c4a4ced0
|
|
Binary file
|
|
@@ -12,8 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
#ifndef GO_CGO_GOSTRING_TYPEDEF
|
|
14
14
|
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
|
|
15
|
-
extern size_t _GoStringLen(_GoString_ s);
|
|
16
|
-
extern const char *_GoStringPtr(_GoString_ s);
|
|
17
15
|
#endif
|
|
18
16
|
|
|
19
17
|
#endif
|
|
@@ -55,16 +53,10 @@ typedef size_t GoUintptr;
|
|
|
55
53
|
typedef float GoFloat32;
|
|
56
54
|
typedef double GoFloat64;
|
|
57
55
|
#ifdef _MSC_VER
|
|
58
|
-
#if !defined(__cplusplus) || _MSVC_LANG <= 201402L
|
|
59
56
|
#include <complex.h>
|
|
60
57
|
typedef _Fcomplex GoComplex64;
|
|
61
58
|
typedef _Dcomplex GoComplex128;
|
|
62
59
|
#else
|
|
63
|
-
#include <complex>
|
|
64
|
-
typedef std::complex<float> GoComplex64;
|
|
65
|
-
typedef std::complex<double> GoComplex128;
|
|
66
|
-
#endif
|
|
67
|
-
#else
|
|
68
60
|
typedef float _Complex GoComplex64;
|
|
69
61
|
typedef double _Complex GoComplex128;
|
|
70
62
|
#endif
|
|
@@ -91,7 +83,7 @@ typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;
|
|
|
91
83
|
extern "C" {
|
|
92
84
|
#endif
|
|
93
85
|
|
|
94
|
-
extern void reset_config(
|
|
86
|
+
extern void reset_config();
|
|
95
87
|
|
|
96
88
|
// Build the given `path` using the `config`.
|
|
97
89
|
//
|
|
@@ -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-darwin
|
|
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
|