vite_rails 3.0.6 → 3.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae7313c888c156ad4339418c4f959d58e19982b5c385eb27666cfb674b74ace6
4
- data.tar.gz: 4807b2ad1775adad6e623d93314e7578cea3f8b9f22a9d205cdeccb747e57ffb
3
+ metadata.gz: fb154f72531497ece6858cec4733d819cb8a3182b4b8b148ba60551d5466ba44
4
+ data.tar.gz: 6cf27644de19cd8de3dc4a5df37d2de6e1fd3f902087a657a24e5867bb4b8fc2
5
5
  SHA512:
6
- metadata.gz: 514c5258487253ee409c141d01ae76f48b577ce31bfc4a91b2f3d4850342c4b0d2f1678daa64f8b79e08a7a38e9f1147bc00410a70256bd1978a2f73a0500409
7
- data.tar.gz: fcab6762518180d3824dc6d875842a1a195c424d054c7f04fe8bd67caa0def73395cd7d11a6d7d79d62ea2d10a1b61f985df6dadbe39b11100026717981cbff0
6
+ metadata.gz: 2c621f4ece5a5bd325574203f32579b979db0081dc973847273febaec609b9172f6e3dbe47876138239311c71dc2e368891bb18bb08c7ce5a153e47f9ebe9dc9
7
+ data.tar.gz: 2b3649725d4267e6de2610c9ecfc317c2112d5633cdd64a3c7503ade1aa412b73a123190227abb8769060165d221ad95987e3bb153009953040ed06e432b4966
data/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## [3.0.9](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.8...vite_rails@3.0.9) (2022-04-29)
2
+
3
+
4
+ ### Features
5
+
6
+ * add vite_asset_url helper ([#208](https://github.com/ElMassimo/vite_ruby/issues/208)) ([d269793](https://github.com/ElMassimo/vite_ruby/commit/d2697934b5a866ea5b14588b650a00dfe88454a3))
7
+
8
+
9
+
10
+ ## [3.0.8](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.7...vite_rails@3.0.8) (2022-04-14)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * prevent error when using a proc in asset_host (close [#202](https://github.com/ElMassimo/vite_ruby/issues/202)) ([#203](https://github.com/ElMassimo/vite_ruby/issues/203)) ([cb23a81](https://github.com/ElMassimo/vite_ruby/commit/cb23a81037651ac01d993935f68cc526ec2c844d))
16
+
17
+
18
+
19
+ ## [3.0.7](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.6...vite_rails@3.0.7) (2022-03-17)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * load rails environment before rake tasks (close [#193](https://github.com/ElMassimo/vite_ruby/issues/193)) ([72afbc7](https://github.com/ElMassimo/vite_ruby/commit/72afbc7ab5ca33833e9330954499bcf460fd7669))
25
+
26
+
27
+
1
28
  ## [3.0.6](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.5...vite_rails@3.0.6) (2022-02-04)
2
29
 
3
30
 
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>
data/lib/tasks/vite.rake CHANGED
@@ -2,3 +2,4 @@
2
2
 
3
3
  require 'vite_ruby'
4
4
  ViteRuby.install_tasks
5
+ Rake::Task['vite:verify_install'].enhance(:environment) if Rake::Task.task_defined?(:environment)
@@ -4,8 +4,9 @@ module ViteRails::Config
4
4
  # Override: Default values for a Rails application.
5
5
  def config_defaults
6
6
  require 'rails'
7
+ asset_host = Rails.application&.config&.action_controller&.asset_host
7
8
  super(
8
- asset_host: Rails.application&.config&.action_controller&.asset_host,
9
+ asset_host: asset_host.is_a?(Proc) ? nil : asset_host,
9
10
  mode: Rails.env.to_s,
10
11
  root: Rails.root || Dir.pwd,
11
12
  )
@@ -22,6 +22,14 @@ module ViteRails::TagHelpers
22
22
  path_to_asset vite_manifest.path_for(name, **options)
23
23
  end
24
24
 
25
+ # Public: Resolves the url for the specified Vite asset.
26
+ #
27
+ # Example:
28
+ # <%= vite_asset_url 'calendar.css' %> # => "https://example.com/vite/assets/calendar-1016838bab065ae1e122.css"
29
+ def vite_asset_url(name, **options)
30
+ url_to_asset vite_manifest.path_for(name, **options)
31
+ end
32
+
25
33
  # Public: Renders a <script> tag for the specified Vite entrypoints.
26
34
  def vite_javascript_tag(*names,
27
35
  type: 'module',
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViteRails
4
- VERSION = '3.0.6'
4
+ VERSION = '3.0.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vite_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.6
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Máximo Mussini
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-04 00:00:00.000000000 Z
11
+ date: 2022-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -82,8 +82,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
82
82
  licenses:
83
83
  - MIT
84
84
  metadata:
85
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.6/vite_rails
86
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.6/vite_rails/CHANGELOG.md
85
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.9/vite_rails
86
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.9/vite_rails/CHANGELOG.md
87
87
  post_install_message:
88
88
  rdoc_options: []
89
89
  require_paths: