vite_rails 3.0.9 → 3.0.12

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: fb154f72531497ece6858cec4733d819cb8a3182b4b8b148ba60551d5466ba44
4
- data.tar.gz: 6cf27644de19cd8de3dc4a5df37d2de6e1fd3f902087a657a24e5867bb4b8fc2
3
+ metadata.gz: 87f7246669f3ec73dddc5be4e8a2809182a3be54e9d08265801e7242a70eaae7
4
+ data.tar.gz: bfacca9cf21fc33e124a2afae31fe71a6abfa62335ae00cc64b33798e49717cb
5
5
  SHA512:
6
- metadata.gz: 2c621f4ece5a5bd325574203f32579b979db0081dc973847273febaec609b9172f6e3dbe47876138239311c71dc2e368891bb18bb08c7ce5a153e47f9ebe9dc9
7
- data.tar.gz: 2b3649725d4267e6de2610c9ecfc317c2112d5633cdd64a3c7503ade1aa412b73a123190227abb8769060165d221ad95987e3bb153009953040ed06e432b4966
6
+ metadata.gz: cc1aac21990900da7441f4198ef003c9035344918fc91df3582f10e58c9ca98e62cacdbf8af3a17828b2e14afa8ae902f38af9f8ad9e1720fb5767c6fc127488
7
+ data.tar.gz: '04048b113957e4d4edc300c97b03cfdf999aea5ff5e4b94cb6c48ab8f1823b9f0ae5d1078ba2871c365e6e90422bdde820a806ca377471a58d93952eb5f7ac43'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,35 @@
1
+ ## [3.0.12](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.11...vite_rails@3.0.12) (2022-08-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * ensure rails app is initialized before inferring config ([#240](https://github.com/ElMassimo/vite_ruby/issues/240)) ([3ddc2bc](https://github.com/ElMassimo/vite_ruby/commit/3ddc2bc7873f06b6dd8e58e7c6b4e8a7fd8833f1))
7
+
8
+
9
+ ### Features
10
+
11
+ * allow framework-specific libraries to extend the CLI ([a0ed66f](https://github.com/ElMassimo/vite_ruby/commit/a0ed66fe64fb2549cecc358ccd60c82be44255aa))
12
+
13
+
14
+
15
+ ## [3.0.11](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.10...vite_rails@3.0.11) (2022-08-11)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * use javascript_include_tag in vite_client_tag ([#238](https://github.com/ElMassimo/vite_ruby/issues/238)) ([3d8b366](https://github.com/ElMassimo/vite_ruby/commit/3d8b3668b2f43dacbaf09127fa67a27767e03ffe))
21
+
22
+
23
+
24
+ ## [3.0.10](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.9...vite_rails@3.0.10) (2022-06-15)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * symbol error on rake enhance call ([#218](https://github.com/ElMassimo/vite_ruby/issues/218)) ([5507156](https://github.com/ElMassimo/vite_ruby/commit/550715624ceb39e1ea5e845e73dcaf5557caa66f))
30
+
31
+
32
+
1
33
  ## [3.0.9](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.8...vite_rails@3.0.9) (2022-04-29)
2
34
 
3
35
 
data/lib/tasks/vite.rake CHANGED
@@ -2,4 +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)
5
+ Rake::Task['vite:verify_install'].enhance([:environment]) if Gem.loaded_specs['rails']
@@ -2,9 +2,26 @@
2
2
 
3
3
  require 'vite_rails'
4
4
 
5
+ module ViteRails::CLI
6
+ end
7
+
8
+ module ViteRails::CLI::Build
9
+ def call(**options)
10
+ ensure_rails_init
11
+ super
12
+ end
13
+
14
+ # Internal: Attempts to initialize the Rails application.
15
+ def ensure_rails_init
16
+ require File.expand_path('config/environment', Dir.pwd)
17
+ rescue StandardError, LoadError => error
18
+ $stderr << "Unable to initialize Rails application before Vite build:\n\n\t#{ error.message }\n\n"
19
+ end
20
+ end
21
+
5
22
  # Internal: Extends the base installation script from Vite Ruby to work for a
6
23
  # typical Rails app.
7
- module ViteRails::Installation
24
+ module ViteRails::CLI::Install
8
25
  RAILS_TEMPLATES = Pathname.new(File.expand_path('../../templates', __dir__))
9
26
 
10
27
  # Override: Setup a typical apps/web Hanami app to use Vite.
@@ -63,4 +80,5 @@ module ViteRails::Installation
63
80
  end
64
81
  end
65
82
 
66
- ViteRuby::CLI::Install.prepend(ViteRails::Installation)
83
+ ViteRuby::CLI::Build.prepend(ViteRails::CLI::Build)
84
+ ViteRuby::CLI::Install.prepend(ViteRails::CLI::Install)
@@ -1,6 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViteRails::Config
4
+ private
5
+
4
6
  # Override: Default values for a Rails application.
5
7
  def config_defaults
6
8
  require 'rails'
@@ -6,7 +6,7 @@ module ViteRails::TagHelpers
6
6
  def vite_client_tag
7
7
  return unless src = vite_manifest.vite_client_src
8
8
 
9
- tag.script(src: src, type: 'module')
9
+ javascript_include_tag(src, type: 'module', extname: false)
10
10
  end
11
11
 
12
12
  # Public: Renders a script tag to enable HMR with React Refresh.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViteRails
4
- VERSION = '3.0.9'
4
+ VERSION = '3.0.12'
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.9
4
+ version: 3.0.12
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-04-29 00:00:00.000000000 Z
11
+ date: 2022-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -34,6 +34,9 @@ dependencies:
34
34
  name: vite_ruby
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 3.2.2
37
40
  - - "~>"
38
41
  - !ruby/object:Gem::Version
39
42
  version: '3.0'
@@ -41,6 +44,9 @@ dependencies:
41
44
  prerelease: false
42
45
  version_requirements: !ruby/object:Gem::Requirement
43
46
  requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ version: 3.2.2
44
50
  - - "~>"
45
51
  - !ruby/object:Gem::Version
46
52
  version: '3.0'
@@ -70,9 +76,9 @@ files:
70
76
  - README.md
71
77
  - lib/tasks/vite.rake
72
78
  - lib/vite_rails.rb
79
+ - lib/vite_rails/cli.rb
73
80
  - lib/vite_rails/config.rb
74
81
  - lib/vite_rails/engine.rb
75
- - lib/vite_rails/installation.rb
76
82
  - lib/vite_rails/tag_helpers.rb
77
83
  - lib/vite_rails/version.rb
78
84
  - templates/Procfile.dev
@@ -82,8 +88,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
82
88
  licenses:
83
89
  - MIT
84
90
  metadata:
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
91
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.12/vite_rails
92
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.12/vite_rails/CHANGELOG.md
87
93
  post_install_message:
88
94
  rdoc_options: []
89
95
  require_paths:
@@ -99,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
105
  - !ruby/object:Gem::Version
100
106
  version: '0'
101
107
  requirements: []
102
- rubygems_version: 3.2.32
108
+ rubygems_version: 3.3.7
103
109
  signing_key:
104
110
  specification_version: 4
105
111
  summary: Use Vite in Rails and bring joy to your JavaScript experience