vite_rails 3.0.11 → 3.0.13

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: d5d0c675e4c826ddbaa033cb54f2e548fb0379bd84a75348e2e3459ac0c67a14
4
- data.tar.gz: 6a16b9d34044669bbe681daa4f5b1617e80c6fd6b96a5fc18016905e30b4b855
3
+ metadata.gz: cabf760d39a47511f0b1d0f81c4e4e3b9ae0c11f7fc95c303b70c8375ea44f39
4
+ data.tar.gz: 5baf486c7d0e58458d9eb7c43e95efdf04b1c2f479f078ec38d356342fd45574
5
5
  SHA512:
6
- metadata.gz: a369d365c6051075ce0c9eb90c5a661506b1db3317fbab9781e17804332d94f96119a21e1bff43da6cf142abdf04c5347af8f64ff8b2d3583a68ebdb85676f45
7
- data.tar.gz: 2a568eaffe572f921a3a56af5012931d3a17cca9c991a80a8c64e8d1e128eedfc38e9a82c62170883d15f87a334793c787a392dd1fce048a28bc768a5c92754a
6
+ metadata.gz: f93350532a41c87455a88553bee2bef63cd8628008646558611965889c76d8455e1771dc9a71a71bed669d7b2d65c805bf10695155339ba95c5f073934c5e47e
7
+ data.tar.gz: 7c8a26f232a97246580c79ed7785397530a8e60523c376bd02cc088005990cb5836ac5ecbd16e71e53e908180eab28661ded94ec014fb662b833a31871a9fc74
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [3.0.13](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.12...vite_rails@3.0.13) (2022-11-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * avoid removing double extension for non-preprocessor assets ([#301](https://github.com/ElMassimo/vite_ruby/issues/301)) ([2024f62](https://github.com/ElMassimo/vite_ruby/commit/2024f62af917cabcb817c32a5fbbe709d477c19f))
7
+
8
+
9
+
10
+ ## [3.0.12](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.11...vite_rails@3.0.12) (2022-08-12)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * 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))
16
+
17
+
18
+ ### Features
19
+
20
+ * allow framework-specific libraries to extend the CLI ([a0ed66f](https://github.com/ElMassimo/vite_ruby/commit/a0ed66fe64fb2549cecc358ccd60c82be44255aa))
21
+
22
+
23
+
1
24
  ## [3.0.11](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.10...vite_rails@3.0.11) (2022-08-11)
2
25
 
3
26
 
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'
@@ -42,7 +42,11 @@ module ViteRails::TagHelpers
42
42
  entries = vite_manifest.resolve_entries(*names, type: asset_type)
43
43
  tags = javascript_include_tag(*entries.fetch(:scripts), crossorigin: crossorigin, type: type, extname: false, **options)
44
44
  tags << vite_preload_tag(*entries.fetch(:imports), crossorigin: crossorigin, **options) unless skip_preload_tags
45
+
46
+ options[:extname] = false if Rails::VERSION::MAJOR >= 7
47
+
45
48
  tags << stylesheet_link_tag(*entries.fetch(:stylesheets), media: media, **options) unless skip_style_tags
49
+
46
50
  tags
47
51
  end
48
52
 
@@ -54,6 +58,9 @@ module ViteRails::TagHelpers
54
58
  # Public: Renders a <link> tag for the specified Vite entrypoints.
55
59
  def vite_stylesheet_tag(*names, **options)
56
60
  style_paths = names.map { |name| vite_asset_path(name, type: :stylesheet) }
61
+
62
+ options[:extname] = false if Rails::VERSION::MAJOR >= 7
63
+
57
64
  stylesheet_link_tag(*style_paths, **options)
58
65
  end
59
66
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ViteRails
4
- VERSION = '3.0.11'
4
+ VERSION = '3.0.13'
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.11
4
+ version: 3.0.13
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-08-11 00:00:00.000000000 Z
11
+ date: 2022-11-13 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.11/vite_rails
86
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.11/vite_rails/CHANGELOG.md
91
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.13/vite_rails
92
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.13/vite_rails/CHANGELOG.md
87
93
  post_install_message:
88
94
  rdoc_options: []
89
95
  require_paths: