proscenium 0.19.0.beta9 → 0.19.0.beta11

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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/lib/proscenium/bundled_gems.rb +1 -1
  3. data/lib/proscenium/css_module.rb +0 -5
  4. data/lib/proscenium/ensure_loaded.rb +14 -10
  5. data/lib/proscenium/ext/proscenium +0 -0
  6. data/lib/proscenium/middleware.rb +0 -6
  7. data/lib/proscenium/phlex.rb +0 -6
  8. data/lib/proscenium/railtie.rb +1 -24
  9. data/lib/proscenium/resolver.rb +0 -9
  10. data/lib/proscenium/version.rb +1 -1
  11. data/lib/proscenium/view_component.rb +0 -6
  12. data/lib/proscenium.rb +5 -34
  13. metadata +24 -118
  14. data/lib/proscenium/registry/bundled_package.rb +0 -29
  15. data/lib/proscenium/registry/package.rb +0 -95
  16. data/lib/proscenium/registry/ruby_gem_package.rb +0 -28
  17. data/lib/proscenium/registry.rb +0 -29
  18. data/lib/proscenium/ruby_gems.rb +0 -67
  19. data/lib/proscenium/ui/breadcrumbs/component.module.css +0 -14
  20. data/lib/proscenium/ui/breadcrumbs/component.rb +0 -71
  21. data/lib/proscenium/ui/breadcrumbs/computed_element.rb +0 -69
  22. data/lib/proscenium/ui/breadcrumbs/control.rb +0 -95
  23. data/lib/proscenium/ui/breadcrumbs/mixins.css +0 -83
  24. data/lib/proscenium/ui/breadcrumbs.rb +0 -72
  25. data/lib/proscenium/ui/component.rb +0 -7
  26. data/lib/proscenium/ui/custom_element.js +0 -54
  27. data/lib/proscenium/ui/flash/bun.lock +0 -19
  28. data/lib/proscenium/ui/flash/index.css +0 -1
  29. data/lib/proscenium/ui/flash/index.js +0 -77
  30. data/lib/proscenium/ui/flash/node_modules/dom-mutations/index.d.ts +0 -33
  31. data/lib/proscenium/ui/flash/node_modules/dom-mutations/index.js +0 -44
  32. data/lib/proscenium/ui/flash/node_modules/dom-mutations/license +0 -9
  33. data/lib/proscenium/ui/flash/node_modules/dom-mutations/package.json +0 -59
  34. data/lib/proscenium/ui/flash/node_modules/dom-mutations/readme.md +0 -125
  35. data/lib/proscenium/ui/flash/node_modules/sourdough-toast/LICENSE +0 -20
  36. data/lib/proscenium/ui/flash/node_modules/sourdough-toast/README.md +0 -11
  37. data/lib/proscenium/ui/flash/node_modules/sourdough-toast/package.json +0 -44
  38. data/lib/proscenium/ui/flash/node_modules/sourdough-toast/src/sourdough-toast.css +0 -697
  39. data/lib/proscenium/ui/flash/node_modules/sourdough-toast/src/sourdough-toast.js +0 -537
  40. data/lib/proscenium/ui/flash/package.json +0 -11
  41. data/lib/proscenium/ui/flash.rb +0 -15
  42. data/lib/proscenium/ui/form/field_methods.rb +0 -88
  43. data/lib/proscenium/ui/form/fields/base.rb +0 -188
  44. data/lib/proscenium/ui/form/fields/checkbox/index.jsx +0 -48
  45. data/lib/proscenium/ui/form/fields/checkbox/index.module.css +0 -9
  46. data/lib/proscenium/ui/form/fields/checkbox/previews/basic.jsx +0 -8
  47. data/lib/proscenium/ui/form/fields/checkbox.rb +0 -32
  48. data/lib/proscenium/ui/form/fields/date.module.css +0 -27
  49. data/lib/proscenium/ui/form/fields/datetime.rb +0 -15
  50. data/lib/proscenium/ui/form/fields/hidden.rb +0 -9
  51. data/lib/proscenium/ui/form/fields/input/index.jsx +0 -71
  52. data/lib/proscenium/ui/form/fields/input/index.module.css +0 -13
  53. data/lib/proscenium/ui/form/fields/input/previews/basic.jsx +0 -8
  54. data/lib/proscenium/ui/form/fields/input.rb +0 -14
  55. data/lib/proscenium/ui/form/fields/radio_group.rb +0 -173
  56. data/lib/proscenium/ui/form/fields/radio_input/index.jsx +0 -44
  57. data/lib/proscenium/ui/form/fields/radio_input/index.module.css +0 -13
  58. data/lib/proscenium/ui/form/fields/radio_input/previews/basic.jsx +0 -8
  59. data/lib/proscenium/ui/form/fields/radio_input.rb +0 -17
  60. data/lib/proscenium/ui/form/fields/rich_textarea.css +0 -23
  61. data/lib/proscenium/ui/form/fields/rich_textarea.js +0 -6
  62. data/lib/proscenium/ui/form/fields/rich_textarea.rb +0 -18
  63. data/lib/proscenium/ui/form/fields/select.jsx +0 -47
  64. data/lib/proscenium/ui/form/fields/select.module.css +0 -46
  65. data/lib/proscenium/ui/form/fields/select.rb +0 -300
  66. data/lib/proscenium/ui/form/fields/tel.css +0 -297
  67. data/lib/proscenium/ui/form/fields/tel.js +0 -83
  68. data/lib/proscenium/ui/form/fields/tel.rb +0 -54
  69. data/lib/proscenium/ui/form/fields/textarea/index.jsx +0 -50
  70. data/lib/proscenium/ui/form/fields/textarea/index.module.css +0 -13
  71. data/lib/proscenium/ui/form/fields/textarea/previews/basic.jsx +0 -8
  72. data/lib/proscenium/ui/form/fields/textarea.rb +0 -18
  73. data/lib/proscenium/ui/form/translation.rb +0 -71
  74. data/lib/proscenium/ui/form.css +0 -52
  75. data/lib/proscenium/ui/form.rb +0 -211
  76. data/lib/proscenium/ui/props.css +0 -7
  77. data/lib/proscenium/ui/stimulus-loading.js +0 -65
  78. data/lib/proscenium/ui/test.js +0 -1
  79. data/lib/proscenium/ui/ujs/class.js +0 -15
  80. data/lib/proscenium/ui/ujs/data_confirm.js +0 -23
  81. data/lib/proscenium/ui/ujs/data_disable_with.js +0 -68
  82. data/lib/proscenium/ui/ujs/index.js +0 -9
  83. data/lib/proscenium/ui.rb +0 -11
  84. /data/lib/proscenium/{ui/react-manager → react-manager}/index.jsx +0 -0
  85. /data/lib/proscenium/{ui/react-manager → react-manager}/react.js +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 626f28026ff85ae9171c3c219211c8ff793c4f5f92d6139e790380b0150db163
4
- data.tar.gz: be61f3291b7b0930d8be64f0c0cc42ee4eddcbe306e8d5b5862d9fe7fb618fbb
3
+ metadata.gz: 7b98dee04473b7b140c7521cf0c87f176e24fc5f2308f90bce52a9ffd6fd9d01
4
+ data.tar.gz: 67a2f65151f79296999a1f67519570a43b7ccde535fa29df8ffcae39be3a26b4
5
5
  SHA512:
6
- metadata.gz: b90f329dff4f536c8359be1696a8d83aac74ccf334382cedf8faad868f18de1d36800c436e19fad7565946fef6b9726c3ad94600e7cb27f9de800627950bf549
7
- data.tar.gz: a160134f3d0c6b536e2edc2375173c5776c8b8a739166f5205613886f7299ab95c7c1fdc450c15096f57744951ccf10dcd806be0b13b262e5683d9bee5a6bc7b
6
+ metadata.gz: 5ff88d28ca35d1a3ef437af74718a90459de2e93f30ecbfcbf89aea69f4655e56f12a36903669c2617a5afde4f042fa3fb1fd11bfc7285bf259665f3ac742919
7
+ data.tar.gz: 268d23eeec545c80096ecdd7d877c0efbe45fc327bd802c3296f754a19cf5ce6c8f2d25e31c168160bfa18fde8e50a7a2fbe786a35212444662d6fa10b221339
@@ -13,7 +13,7 @@ module Proscenium
13
13
  bundle = {}
14
14
  specs.each do |s|
15
15
  bundle[s.name] = if s.name == 'proscenium'
16
- Pathname(s.full_gem_path).join('lib/proscenium/ui').to_s
16
+ Pathname(s.full_gem_path).join('lib/proscenium').to_s
17
17
  else
18
18
  s.full_gem_path
19
19
  end
@@ -1,11 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Proscenium::CssModule
4
- extend ActiveSupport::Autoload
5
-
6
- autoload :Path
7
- autoload :Transformer
8
-
9
4
  class TransformError < StandardError
10
5
  def initialize(name, additional_msg = nil)
11
6
  msg = "Failed to transform CSS module `#{name}`"
@@ -7,17 +7,21 @@ module Proscenium
7
7
  def self.included(child)
8
8
  child.class_eval do
9
9
  append_after_action do
10
- if request.format.html? && Importer.imported?
11
- if Importer.js_imported?
12
- raise NotIncludedError, 'There are side loaded javascripts to be included, but ' \
13
- 'they have not been included in the page. Did you forget ' \
14
- 'to add the `#include_assets` helper in your views?'
15
- end
10
+ if request.format.html? && !response.redirect? && Importer.imported?
11
+ msg = <<-TEXT.squish
12
+ There are side loaded and imported assets to be included, but they have not been
13
+ included in the page. Did you forget to add the `#include_assets` helper in your
14
+ views? These assets were imported but not included:
15
+ #{Importer.imported.keys.to_sentence}
16
+ TEXT
16
17
 
17
- if Importer.css_imported?
18
- raise NotIncludedError, 'There are side loaded stylesheets to be included, but ' \
19
- 'they have not been included in the page. Did you forget ' \
20
- 'to add the `#include_assets` helper in your views?'
18
+ if Proscenium.config.ensure_loaded == :log
19
+ Rails.logger.warn do
20
+ "#{ActiveSupport::LogSubscriber.new.send(:color, ' [Proscenium]', nil,
21
+ bold: true)} #{msg}"
22
+ end
23
+ elsif Proscenium.config.ensure_loaded == :raise
24
+ raise NotIncludedError, msg
21
25
  end
22
26
  end
23
27
  end
Binary file
@@ -2,15 +2,9 @@
2
2
 
3
3
  module Proscenium
4
4
  class Middleware
5
- extend ActiveSupport::Autoload
6
-
7
5
  # Error when the build command fails.
8
6
  class BuildError < StandardError; end
9
7
 
10
- autoload :Base
11
- autoload :Esbuild
12
- autoload :RubyGems
13
-
14
8
  def initialize(app)
15
9
  @app = app
16
10
 
@@ -4,12 +4,6 @@ require 'phlex-rails'
4
4
 
5
5
  module Proscenium
6
6
  class Phlex < ::Phlex::HTML
7
- extend ActiveSupport::Autoload
8
-
9
- autoload :CssModules
10
- autoload :ReactComponent
11
- autoload :AssetInclusions
12
-
13
7
  include Proscenium::SourcePath
14
8
  include CssModules
15
9
  include AssetInclusions
@@ -14,7 +14,7 @@ module Proscenium
14
14
  config.proscenium.bundle = true
15
15
  config.proscenium.side_load = true
16
16
  config.proscenium.code_splitting = true
17
-
17
+ config.proscenium.ensure_loaded = :raise
18
18
  config.proscenium.cache_query_string = Rails.env.production? && ENV.fetch('REVISION', nil)
19
19
  config.proscenium.cache_max_age = 2_592_000 # 30 days
20
20
 
@@ -33,19 +33,6 @@ module Proscenium
33
33
  end
34
34
  end
35
35
 
36
- initializer 'proscenium.ui' do
37
- ActiveSupport::Inflector.inflections(:en) do |inflect|
38
- inflect.acronym 'UI'
39
- end
40
- end
41
-
42
- initializer 'proscenium.debugging' do
43
- if Rails.gem_version >= Gem::Version.new('7.1.0')
44
- tpl_path = root.join('lib', 'proscenium', 'templates').to_s
45
- ActionDispatch::DebugView::RESCUES_TEMPLATE_PATHS << tpl_path
46
- end
47
- end
48
-
49
36
  initializer 'proscenium.middleware' do |app|
50
37
  app.middleware.insert_after ActionDispatch::Static, Proscenium::Middleware
51
38
  end
@@ -63,15 +50,5 @@ module Proscenium
63
50
  ActionView::PartialRenderer.prepend Monkey::PartialRenderer
64
51
  end
65
52
  end
66
-
67
- initializer 'proscenium.public_path' do |app|
68
- if app.config.public_file_server.enabled
69
- headers = app.config.public_file_server.headers || {}
70
- index = app.config.public_file_server.index_name || 'index'
71
-
72
- app.middleware.insert_after(ActionDispatch::Static, ActionDispatch::Static,
73
- root.join('public').to_s, index:, headers:)
74
- end
75
- end
76
53
  end
77
54
  end
@@ -19,16 +19,7 @@ module Proscenium
19
19
  end
20
20
 
21
21
  self.resolved[path] ||= if (gem = BundledGems.paths.find { |_, v| path.start_with? "#{v}/" })
22
- # If the path is a rubygem, and it is installed with npm via the
23
- # @rubygems scope, then resolve the path to the symlinked location
24
- # in node_modules.
25
- # npm_path = Rails.root.join("node_modules/@rubygems/#{gem.first}")
26
- # if npm_path.symlink?
27
- # npm_path.realpath.join(path.sub(/^#{gem.last}/, '.')).to_s
28
- # .delete_prefix(Rails.root.to_s)
29
- # else
30
22
  path.sub(/^#{gem.last}/, "/node_modules/@rubygems/#{gem.first}")
31
- # end
32
23
  elsif path.start_with?("#{Rails.root}/")
33
24
  path.delete_prefix Rails.root.to_s
34
25
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Proscenium
4
- VERSION = '0.19.0.beta9'
4
+ VERSION = '0.19.0.beta11'
5
5
  end
@@ -1,12 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Proscenium::ViewComponent < ViewComponent::Base
4
- extend ActiveSupport::Autoload
5
-
6
- autoload :Sideload
7
- autoload :ReactComponent
8
- autoload :CssModules
9
-
10
4
  include Proscenium::SourcePath
11
5
  include CssModules
12
6
 
data/lib/proscenium.rb CHANGED
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support'
4
- require 'active_record/type' # needed by Literal, even though we're not using ActiveRecord
5
- require 'literal'
3
+ require 'zeitwerk'
4
+ require 'proscenium/railtie'
6
5
 
7
- module Proscenium
8
- extend ActiveSupport::Autoload
6
+ loader = Zeitwerk::Loader.for_gem
7
+ loader.setup
9
8
 
9
+ module Proscenium
10
10
  FILE_EXTENSIONS = ['js', 'mjs', 'ts', 'jsx', 'tsx', 'css', 'js.map', 'mjs.map', 'jsx.map',
11
11
  'ts.map', 'tsx.map', 'css.map'].freeze
12
12
 
@@ -22,25 +22,6 @@ module Proscenium
22
22
  # Environment variables that should always be passed to the builder.
23
23
  DEFAULT_ENV_VARS = Set['RAILS_ENV', 'NODE_ENV'].freeze
24
24
 
25
- autoload :SourcePath
26
- autoload :Utils
27
- autoload :Monkey
28
- autoload :Middleware
29
- autoload :EnsureLoaded
30
- autoload :SideLoad
31
- autoload :CssModule
32
- autoload :ReactComponentable
33
- autoload :ViewComponent
34
- autoload :Phlex
35
- autoload :Helper
36
- autoload :Builder
37
- autoload :Importer
38
- autoload :Resolver
39
- autoload :BundledGems
40
- autoload :RubyGems
41
- autoload :Registry
42
- autoload :UI
43
-
44
25
  class Deprecator
45
26
  def deprecation_warning(name, message, _caller_backtrace = nil)
46
27
  msg = "`#{name}` is deprecated and will be removed in a near future release of Proscenium"
@@ -65,18 +46,8 @@ module Proscenium
65
46
  @config ||= Railtie.config.proscenium
66
47
  end
67
48
 
68
- def ui_path
69
- @ui_path ||= Railtie.root.join('lib', 'proscenium', 'ui')
70
- end
71
-
72
- def ui_path_regex
73
- @ui_path_regex ||= Regexp.new("^#{Proscenium.ui_path}/")
74
- end
75
-
76
49
  def root
77
50
  Railtie.root
78
51
  end
79
52
  end
80
53
  end
81
-
82
- require 'proscenium/railtie'
metadata CHANGED
@@ -1,28 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proscenium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0.beta9
4
+ version: 0.19.0.beta11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 2025-04-09 00:00:00.000000000 Z
11
+ date: 2025-04-22 00:00:00.000000000 Z
11
12
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: countries
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - "~>"
17
- - !ruby/object:Gem::Version
18
- version: 7.1.0
19
- type: :runtime
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - "~>"
24
- - !ruby/object:Gem::Version
25
- version: 7.1.0
26
13
  - !ruby/object:Gem::Dependency
27
14
  name: ffi
28
15
  requirement: !ruby/object:Gem::Requirement
@@ -37,20 +24,6 @@ dependencies:
37
24
  - - "~>"
38
25
  - !ruby/object:Gem::Version
39
26
  version: 1.17.0
40
- - !ruby/object:Gem::Dependency
41
- name: literal
42
- requirement: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '1.0'
47
- type: :runtime
48
- prerelease: false
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '1.0'
54
27
  - !ruby/object:Gem::Dependency
55
28
  name: phlex-rails
56
29
  requirement: !ruby/object:Gem::Requirement
@@ -65,20 +38,6 @@ dependencies:
65
38
  - - "~>"
66
39
  - !ruby/object:Gem::Version
67
40
  version: '1.2'
68
- - !ruby/object:Gem::Dependency
69
- name: phonelib
70
- requirement: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: 0.10.3
75
- type: :runtime
76
- prerelease: false
77
- version_requirements: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - "~>"
80
- - !ruby/object:Gem::Version
81
- version: 0.10.3
82
41
  - !ruby/object:Gem::Dependency
83
42
  name: rails
84
43
  requirement: !ruby/object:Gem::Requirement
@@ -113,6 +72,21 @@ dependencies:
113
72
  - - "~>"
114
73
  - !ruby/object:Gem::Version
115
74
  version: 1.1.1
75
+ - !ruby/object:Gem::Dependency
76
+ name: zeitwerk
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: 2.7.2
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: 2.7.2
89
+ description:
116
90
  email:
117
91
  - joel@developwithstyle.com
118
92
  executables: []
@@ -146,83 +120,13 @@ files:
146
120
  - lib/proscenium/phlex/css_modules.rb
147
121
  - lib/proscenium/phlex/react_component.rb
148
122
  - lib/proscenium/railtie.rb
123
+ - lib/proscenium/react-manager/index.jsx
124
+ - lib/proscenium/react-manager/react.js
149
125
  - lib/proscenium/react_componentable.rb
150
- - lib/proscenium/registry.rb
151
- - lib/proscenium/registry/bundled_package.rb
152
- - lib/proscenium/registry/package.rb
153
- - lib/proscenium/registry/ruby_gem_package.rb
154
126
  - lib/proscenium/resolver.rb
155
- - lib/proscenium/ruby_gems.rb
156
127
  - lib/proscenium/side_load.rb
157
128
  - lib/proscenium/source_path.rb
158
129
  - lib/proscenium/templates/rescues/build_error.html.erb
159
- - lib/proscenium/ui.rb
160
- - lib/proscenium/ui/breadcrumbs.rb
161
- - lib/proscenium/ui/breadcrumbs/component.module.css
162
- - lib/proscenium/ui/breadcrumbs/component.rb
163
- - lib/proscenium/ui/breadcrumbs/computed_element.rb
164
- - lib/proscenium/ui/breadcrumbs/control.rb
165
- - lib/proscenium/ui/breadcrumbs/mixins.css
166
- - lib/proscenium/ui/component.rb
167
- - lib/proscenium/ui/custom_element.js
168
- - lib/proscenium/ui/flash.rb
169
- - lib/proscenium/ui/flash/bun.lock
170
- - lib/proscenium/ui/flash/index.css
171
- - lib/proscenium/ui/flash/index.js
172
- - lib/proscenium/ui/flash/node_modules/dom-mutations/index.d.ts
173
- - lib/proscenium/ui/flash/node_modules/dom-mutations/index.js
174
- - lib/proscenium/ui/flash/node_modules/dom-mutations/license
175
- - lib/proscenium/ui/flash/node_modules/dom-mutations/package.json
176
- - lib/proscenium/ui/flash/node_modules/dom-mutations/readme.md
177
- - lib/proscenium/ui/flash/node_modules/sourdough-toast/LICENSE
178
- - lib/proscenium/ui/flash/node_modules/sourdough-toast/README.md
179
- - lib/proscenium/ui/flash/node_modules/sourdough-toast/package.json
180
- - lib/proscenium/ui/flash/node_modules/sourdough-toast/src/sourdough-toast.css
181
- - lib/proscenium/ui/flash/node_modules/sourdough-toast/src/sourdough-toast.js
182
- - lib/proscenium/ui/flash/package.json
183
- - lib/proscenium/ui/form.css
184
- - lib/proscenium/ui/form.rb
185
- - lib/proscenium/ui/form/field_methods.rb
186
- - lib/proscenium/ui/form/fields/base.rb
187
- - lib/proscenium/ui/form/fields/checkbox.rb
188
- - lib/proscenium/ui/form/fields/checkbox/index.jsx
189
- - lib/proscenium/ui/form/fields/checkbox/index.module.css
190
- - lib/proscenium/ui/form/fields/checkbox/previews/basic.jsx
191
- - lib/proscenium/ui/form/fields/date.module.css
192
- - lib/proscenium/ui/form/fields/datetime.rb
193
- - lib/proscenium/ui/form/fields/hidden.rb
194
- - lib/proscenium/ui/form/fields/input.rb
195
- - lib/proscenium/ui/form/fields/input/index.jsx
196
- - lib/proscenium/ui/form/fields/input/index.module.css
197
- - lib/proscenium/ui/form/fields/input/previews/basic.jsx
198
- - lib/proscenium/ui/form/fields/radio_group.rb
199
- - lib/proscenium/ui/form/fields/radio_input.rb
200
- - lib/proscenium/ui/form/fields/radio_input/index.jsx
201
- - lib/proscenium/ui/form/fields/radio_input/index.module.css
202
- - lib/proscenium/ui/form/fields/radio_input/previews/basic.jsx
203
- - lib/proscenium/ui/form/fields/rich_textarea.css
204
- - lib/proscenium/ui/form/fields/rich_textarea.js
205
- - lib/proscenium/ui/form/fields/rich_textarea.rb
206
- - lib/proscenium/ui/form/fields/select.jsx
207
- - lib/proscenium/ui/form/fields/select.module.css
208
- - lib/proscenium/ui/form/fields/select.rb
209
- - lib/proscenium/ui/form/fields/tel.css
210
- - lib/proscenium/ui/form/fields/tel.js
211
- - lib/proscenium/ui/form/fields/tel.rb
212
- - lib/proscenium/ui/form/fields/textarea.rb
213
- - lib/proscenium/ui/form/fields/textarea/index.jsx
214
- - lib/proscenium/ui/form/fields/textarea/index.module.css
215
- - lib/proscenium/ui/form/fields/textarea/previews/basic.jsx
216
- - lib/proscenium/ui/form/translation.rb
217
- - lib/proscenium/ui/props.css
218
- - lib/proscenium/ui/react-manager/index.jsx
219
- - lib/proscenium/ui/react-manager/react.js
220
- - lib/proscenium/ui/stimulus-loading.js
221
- - lib/proscenium/ui/test.js
222
- - lib/proscenium/ui/ujs/class.js
223
- - lib/proscenium/ui/ujs/data_confirm.js
224
- - lib/proscenium/ui/ujs/data_disable_with.js
225
- - lib/proscenium/ui/ujs/index.js
226
130
  - lib/proscenium/utils.rb
227
131
  - lib/proscenium/version.rb
228
132
  - lib/proscenium/view_component.rb
@@ -237,6 +141,7 @@ metadata:
237
141
  source_code_uri: https://github.com/joelmoss/proscenium
238
142
  changelog_uri: https://github.com/joelmoss/proscenium/releases
239
143
  rubygems_mfa_required: 'true'
144
+ post_install_message:
240
145
  rdoc_options: []
241
146
  require_paths:
242
147
  - lib
@@ -244,14 +149,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
244
149
  requirements:
245
150
  - - ">="
246
151
  - !ruby/object:Gem::Version
247
- version: 3.2.0
152
+ version: 3.3.0
248
153
  required_rubygems_version: !ruby/object:Gem::Requirement
249
154
  requirements:
250
155
  - - ">="
251
156
  - !ruby/object:Gem::Version
252
157
  version: '0'
253
158
  requirements: []
254
- rubygems_version: 3.6.5
159
+ rubygems_version: 3.5.22
160
+ signing_key:
255
161
  specification_version: 4
256
162
  summary: The engine powering your Rails frontend
257
163
  test_files: []
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rubygems/package'
4
-
5
- class Proscenium::Registry
6
- class BundledPackage < Package
7
- def version = @version ||= spec.version.to_s
8
-
9
- private
10
-
11
- def package_json
12
- @package_json ||= begin
13
- unless (gem_path = Proscenium::BundledGems.pathname_for(gem_name))
14
- raise PackageNotInstalledError, name
15
- end
16
-
17
- if (package_path = gem_path.join('package.json')).exist?
18
- JSON.parse(package_path.read)
19
- else
20
- default_package_json
21
- end
22
- end
23
- end
24
-
25
- def spec
26
- @spec ||= Bundler.load.specs[gem_name].first
27
- end
28
- end
29
- end
@@ -1,95 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Proscenium::Registry
4
- # 1. Fetch the gem metadata from RubyGems API.
5
- # 2. Extract any package.json from the gem, and populate the response with it.
6
- # 3. Create a tarball containing the fetched package.json. This will be downloaded by the npm
7
- # client, and unpacked into node_modules. Proscenium ignores this, as it will pull contents
8
- # directly from location of the installed gem.
9
- # 4. Return a valid npm response listing package details, tarball location, and its dependencies.
10
- #
11
- # See https://wiki.commonjs.org/wiki/Packages/Registry
12
- class Package
13
- extend Literal::Properties
14
-
15
- prop :name, String, :positional, reader: :private
16
- prop :version, _String?
17
- prop :host, String
18
-
19
- def as_json
20
- {
21
- name:,
22
- 'dist-tags': {
23
- latest: version
24
- },
25
- versions: {
26
- version => {
27
- name:,
28
- version:,
29
- dependencies: package_json['dependencies'] || {},
30
- dist: {
31
- tarball:,
32
- integrity:,
33
- shasum:
34
- }
35
- }
36
- }
37
- }
38
- end
39
-
40
- def validate!
41
- return self if name.start_with?('@rubygems/')
42
-
43
- raise PackageUnsupportedError, name
44
- end
45
-
46
- def gem_name = @gem_name ||= name.gsub('@rubygems/', '')
47
- def version = @version # rubocop:disable Style/TrivialAccessors
48
- def shasum = Digest::SHA1.file(tarball_path).hexdigest
49
- def integrity = "sha512-#{Digest::SHA512.file(tarball_path).base64digest}"
50
-
51
- private
52
-
53
- def tarball
54
- create_tarball unless tarball_path.exist?
55
-
56
- "#{@host}/#{tarball_path.relative_path_from(Rails.public_path)}"
57
- end
58
-
59
- def tarball_name
60
- @tarball_name ||= "#{gem_name}-#{version}"
61
- end
62
-
63
- def tarball_path
64
- @tarball_path ||= Rails.public_path.join('proscenium_registry_tarballs')
65
- .join("@rubygems/#{gem_name}/#{tarball_name}.tgz")
66
- end
67
-
68
- def create_tarball
69
- FileUtils.mkdir_p(File.dirname(tarball_path))
70
-
71
- File.open(tarball_path, 'wb') do |file|
72
- Zlib::GzipWriter.wrap(file) do |gz|
73
- Gem::Package::TarWriter.new(gz) do |tar|
74
- contents = package_json.to_json
75
- tar.add_file_simple('package/package.json', 0o444, contents.length) do |io|
76
- io.write contents
77
- end
78
- end
79
- end
80
- end
81
- end
82
-
83
- def package_json
84
- @package_json ||= default_package_json
85
- end
86
-
87
- def default_package_json
88
- {
89
- name:,
90
- version:,
91
- dependencies: {}
92
- }
93
- end
94
- end
95
- end
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Proscenium::Registry
4
- class RubyGemPackage < Package
5
- def version = spec['version']
6
-
7
- private
8
-
9
- def package_json
10
- @package_json ||= begin
11
- package_path = Proscenium::RubyGems.path_for(gem_name, version).join('package.json')
12
- if package_path.exist?
13
- JSON.parse path.read
14
- else
15
- default_package_json
16
- end
17
- end
18
- end
19
-
20
- def spec
21
- @spec ||= if @version.present?
22
- Gems::V2.info gem_name, @version
23
- else
24
- Gems.info(gem_name)
25
- end
26
- end
27
- end
28
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Proscenium::Registry
4
- extend ActiveSupport::Autoload
5
-
6
- autoload :Package
7
- autoload :BundledPackage
8
- autoload :RubyGemPackage
9
-
10
- class PackageUnsupportedError < StandardError
11
- def initialize(name)
12
- super("Package `#{name}` is not valid; only Ruby gems are supported via the @rubygems scope.")
13
- end
14
- end
15
-
16
- class PackageNotInstalledError < StandardError
17
- def initialize(name)
18
- super("Package `#{name}` is not found in your bundle; have you installed the Ruby gem?")
19
- end
20
- end
21
-
22
- def self.bundled_package(name, host:)
23
- BundledPackage.new(name, host:).validate!
24
- end
25
-
26
- def self.ruby_gem_package(name, version, host:)
27
- RubyGemPackage.new(name, version:, host:).validate!
28
- end
29
- end