vite_padrino 3.0.0 → 3.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e72fe51a3759361ec1b1569d2ebb4cb59a36c5f09defb23d49aecbf514867915
4
- data.tar.gz: beb66007c730f51713ffd54abf33bc04bfb62563c19c92fc4b8753cb165ae012
3
+ metadata.gz: 86de6739310f80c395f320bedfb028087b5d0dd574a6c2ee53ff80ac95ee2d87
4
+ data.tar.gz: 24339e02fc7ba46eea253d950f4aec921f6f32c203a490ad5c4ed371937fa93c
5
5
  SHA512:
6
- metadata.gz: 3fbe1adaf4cd0a741e06b543c11c5e4b116fec84dc3bedd0cdcc3a25428ad0bd6bbbee78509b54f1621b00dcbbbe05a10dc41eabddf4200497cd9af2b847cc1b
7
- data.tar.gz: '079df3bf2c3172425d319f4384f2d82d4c9ff4934e402081bb6b90607ee8834e34837ef43a1fec71a801c0be223e4e3dc0e176acad58ad361ed789d7459e9809'
6
+ metadata.gz: f82557d8d8a6cfa01617d513c8b9661a0747bbab0c5d2e13f232b24126b82cceb07b7737aea547780b1d69de3b9d6ac3554bf044772407ee1cc71dda43f84888
7
+ data.tar.gz: 6f5b22b4ea0433bdf3af26e042a5a9dbe6188e1d76267c8f5593d5003843270c14daa8681f9f643fdb2964a7a62f64740aff5331860a0fd77e50ecc9fcabd82e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [3.0.1](https://github.com/ElMassimo/vite_ruby/compare/vite_padrino@3.0.0...vite_padrino@3.0.1) (2026-10-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **padrino:** avoid ActiveSupport's try ([#635](https://github.com/ElMassimo/vite_ruby/issues/635)) ([ab4540f](https://github.com/ElMassimo/vite_ruby/commit/ab4540fcaf3043dda81ab6e42ca8425c4a42b9b4))
7
+
8
+
9
+ ### Features
10
+
11
+ * enable hmr when running tests in development with vite dev server ([e253bba](https://github.com/ElMassimo/vite_ruby/commit/e253bba26d164aabc7a9526df504c207ad2cf6f9))
12
+
13
+
14
+
1
15
  # [3.0.0](https://github.com/ElMassimo/vite_ruby/compare/vite_padrino@0.5.4...vite_padrino@3.0.0) (2021-08-16)
2
16
 
3
17
  See https://github.com/ElMassimo/vite_ruby/pull/116 for features and breaking changes.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <h1 align="center">
2
2
  <a href="https://vite-ruby.netlify.app/">
3
- <img src="https://raw.githubusercontent.com/ElMassimo/vite_ruby/main/docs/public/logo.svg" width="120px"/>
3
+ <img src="https://raw.githubusercontent.com/ElMassimo/vite_ruby/main/logo.svg" width="120px"/>
4
4
  </a>
5
5
 
6
6
  <br>
@@ -37,7 +37,7 @@
37
37
  [config]: https://vite-ruby.netlify.app/config/
38
38
  [vite_rails]: https://github.com/ElMassimo/vite_ruby
39
39
  [webpacker]: https://github.com/rails/webpacker
40
- [vite]: http://vitejs.dev/
40
+ [vite]: https://vite.dev/
41
41
  [config file]: https://github.com/ElMassimo/vite_ruby/blob/main/vite-plugin-ruby/default.vite.json
42
42
  [example app]: https://github.com/ElMassimo/pingcrm-vite
43
43
  [heroku]: https://pingcrm-vite.herokuapp.com/
@@ -46,8 +46,8 @@
46
46
  [vite_rails]: https://github.com/ElMassimo/vite_ruby/tree/main/vite_rails
47
47
  [vite_ruby]: https://github.com/ElMassimo/vite_ruby/tree/main/vite_ruby
48
48
  [vite_padrino]: https://github.com/ElMassimo/vite_ruby/tree/main/vite_padrino
49
- [no bundling]: https://vitejs.dev/guide/why.html#the-problems
50
- [bundling]: https://vitejs.dev/guide/why.html#why-bundle-for-production
49
+ [no bundling]: https://vite.dev/guide/why.html#the-problems
50
+ [bundling]: https://vite.dev/guide/why.html#why-bundle-for-production
51
51
 
52
52
  [Vite] is to frontend tooling as Ruby to programming, pure joy! 😍
53
53
 
@@ -1,17 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'vite_padrino'
3
+ require "vite_padrino"
4
4
 
5
5
  # Internal: Extends the base installation script from Vite Ruby to work for a
6
6
  # typical Padrino app.
7
7
  module VitePadrino::Installation
8
- PADRINO_TEMPLATES = Pathname.new(File.expand_path('../../templates', __dir__))
8
+ PADRINO_TEMPLATES = Pathname.new(File.expand_path("../../templates", __dir__))
9
9
 
10
10
  # Override: Setup a typical apps/web Padrino app to use Vite.
11
11
  def setup_app_files
12
- cp PADRINO_TEMPLATES.join('config/padrino-vite.json'), config.config_path
13
- inject_line_after root.join('app/app.rb'), 'register', ' register VitePadrino'
14
- append root.join('Rakefile'), <<~RAKE
12
+ cp PADRINO_TEMPLATES.join("config/padrino-vite.json"), config.config_path
13
+ inject_line_after root.join("app/app.rb"), "register", " register VitePadrino"
14
+ append root.join("Rakefile"), <<~RAKE
15
15
  require 'vite_padrino'
16
16
  ViteRuby.install_tasks
17
17
  RAKE
@@ -20,7 +20,7 @@ module VitePadrino::Installation
20
20
  # Override: Inject the vite client and sample script to the default HTML template.
21
21
  def install_sample_files
22
22
  super
23
- inject_line_after root.join('app/views/layouts/application.haml'), '%title', <<-HTML
23
+ inject_line_after root.join("app/views/layouts/application.haml"), "%title", <<-HTML
24
24
  = vite_client_tag
25
25
  = vite_javascript_tag 'application'
26
26
  HTML
@@ -6,7 +6,7 @@ module VitePadrino::TagHelpers
6
6
  def vite_client_tag
7
7
  return unless src = vite_manifest.vite_client_src
8
8
 
9
- content_tag(:script, nil, src: src, type: 'module')
9
+ content_tag(:script, nil, src: src, type: "module")
10
10
  end
11
11
 
12
12
  # Public: Renders a script tag to enable HMR with React Refresh.
@@ -24,12 +24,12 @@ module VitePadrino::TagHelpers
24
24
 
25
25
  # Public: Renders a <script> tag for the specified Vite entrypoints.
26
26
  def vite_javascript_tag(*names,
27
- type: 'module',
28
- asset_type: :javascript,
29
- skip_preload_tags: false,
30
- skip_style_tags: false,
31
- crossorigin: 'anonymous',
32
- **options)
27
+ type: "module",
28
+ asset_type: :javascript,
29
+ skip_preload_tags: false,
30
+ skip_style_tags: false,
31
+ crossorigin: "anonymous",
32
+ **options)
33
33
  entries = vite_manifest.resolve_entries(*names, type: asset_type)
34
34
  tags = javascript_include_tag(*entries.fetch(:scripts), crossorigin: crossorigin, type: type, extname: false, **options)
35
35
  tags << vite_preload_tag(*entries.fetch(:imports), crossorigin: crossorigin) unless skip_preload_tags
@@ -59,8 +59,10 @@ private
59
59
  def vite_preload_tag(*sources, crossorigin:)
60
60
  sources.map { |source|
61
61
  href = asset_path(source)
62
- try(:request).try(:send_early_hints, 'Link' => %(<#{ href }>; rel=modulepreload; as=script; crossorigin=#{ crossorigin }))
63
- tag(:link, rel: 'modulepreload', href: href, as: 'script', crossorigin: crossorigin)
62
+ if respond_to?(:request) && request.respond_to?(:send_early_hints)
63
+ request.send_early_hints("Link" => %(<#{href}>; rel=modulepreload; as=script; crossorigin=#{crossorigin}))
64
+ end
65
+ tag(:link, rel: "modulepreload", href: href, as: "script", crossorigin: crossorigin)
64
66
  }.join("\n").html_safe
65
67
  end
66
68
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VitePadrino
4
- VERSION = '3.0.0'
4
+ VERSION = "3.0.1"
5
5
  end
data/lib/vite_padrino.rb CHANGED
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'vite_ruby'
4
- require 'vite_padrino/version'
5
- require 'vite_padrino/tag_helpers'
3
+ require "vite_ruby"
4
+ require "vite_padrino/version"
5
+ require "vite_padrino/tag_helpers"
6
6
 
7
7
  module VitePadrino
8
8
  # Internal: Called when the Rack app is available.
9
9
  def self.registered(app)
10
- if RACK_ENV != 'production' && ViteRuby.run_proxy?
10
+ if RACK_ENV != "production" && ViteRuby.run_proxy?
11
11
  app.use(ViteRuby::DevServerProxy, ssl_verify_none: true)
12
12
  end
13
13
  ViteRuby.instance.logger = app.logger
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "test": {
12
12
  "autoBuild": true,
13
- "publicOutputDir": "vite-test"
13
+ "publicOutputDir": "vite-test",
14
+ "port": 3037
14
15
  }
15
16
  }
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_padrino
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-08-16 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: vite_ruby
@@ -24,7 +23,6 @@ dependencies:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
25
  version: '3.0'
27
- description:
28
26
  email:
29
27
  - maximomussini@gmail.com
30
28
  executables: []
@@ -43,9 +41,9 @@ homepage: https://github.com/ElMassimo/vite_ruby
43
41
  licenses:
44
42
  - MIT
45
43
  metadata:
46
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_padrino@3.0.0/vite_padrino
47
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_padrino@3.0.0/vite_padrino/CHANGELOG.md
48
- post_install_message:
44
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_padrino@3.0.1/vite_padrino
45
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_padrino@3.0.1/vite_padrino/CHANGELOG.md
46
+ rubygems_mfa_required: 'true'
49
47
  rdoc_options: []
50
48
  require_paths:
51
49
  - lib
@@ -60,8 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
58
  - !ruby/object:Gem::Version
61
59
  version: '0'
62
60
  requirements: []
63
- rubygems_version: 3.1.4
64
- signing_key:
61
+ rubygems_version: 4.0.16
65
62
  specification_version: 4
66
63
  summary: Use Vite in Padrino and bring joy to your JavaScript experience
67
64
  test_files: []