vite_padrino 3.0.0.beta.1 → 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 +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +4 -4
- data/lib/vite_padrino/installation.rb +6 -6
- data/lib/vite_padrino/tag_helpers.rb +11 -9
- data/lib/vite_padrino/version.rb +1 -1
- data/lib/vite_padrino.rb +4 -4
- data/templates/config/padrino-vite.json +2 -1
- metadata +10 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 86de6739310f80c395f320bedfb028087b5d0dd574a6c2ee53ff80ac95ee2d87
|
|
4
|
+
data.tar.gz: 24339e02fc7ba46eea253d950f4aec921f6f32c203a490ad5c4ed371937fa93c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f82557d8d8a6cfa01617d513c8b9661a0747bbab0c5d2e13f232b24126b82cceb07b7737aea547780b1d69de3b9d6ac3554bf044772407ee1cc71dda43f84888
|
|
7
|
+
data.tar.gz: 6f5b22b4ea0433bdf3af26e042a5a9dbe6188e1d76267c8f5593d5003843270c14daa8681f9f643fdb2964a7a62f64740aff5331860a0fd77e50ecc9fcabd82e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
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
|
+
|
|
15
|
+
# [3.0.0](https://github.com/ElMassimo/vite_ruby/compare/vite_padrino@0.5.4...vite_padrino@3.0.0) (2021-08-16)
|
|
16
|
+
|
|
17
|
+
See https://github.com/ElMassimo/vite_ruby/pull/116 for features and breaking changes.
|
|
18
|
+
|
|
1
19
|
## [0.5.4](https://github.com/ElMassimo/vite_ruby/compare/vite_padrino@0.5.3...vite_padrino@0.5.4) (2021-04-21)
|
|
2
20
|
|
|
3
21
|
|
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/
|
|
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]:
|
|
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://
|
|
50
|
-
[bundling]: https://
|
|
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
|
|
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(
|
|
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(
|
|
13
|
-
inject_line_after root.join(
|
|
14
|
-
append root.join(
|
|
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(
|
|
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:
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
63
|
-
|
|
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
|
data/lib/vite_padrino/version.rb
CHANGED
data/lib/vite_padrino.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
require
|
|
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 !=
|
|
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
|
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.
|
|
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:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: vite_ruby
|
|
@@ -16,15 +15,14 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 3.0
|
|
18
|
+
version: '3.0'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - "~>"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 3.0
|
|
27
|
-
description:
|
|
25
|
+
version: '3.0'
|
|
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.
|
|
47
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_padrino@3.0.
|
|
48
|
-
|
|
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
|
|
@@ -56,12 +54,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
56
54
|
version: '2.5'
|
|
57
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
56
|
requirements:
|
|
59
|
-
- - "
|
|
57
|
+
- - ">="
|
|
60
58
|
- !ruby/object:Gem::Version
|
|
61
|
-
version:
|
|
59
|
+
version: '0'
|
|
62
60
|
requirements: []
|
|
63
|
-
rubygems_version:
|
|
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: []
|