vite_rails_legacy 2.0.2 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +35 -0
- data/README.md +20 -0
- data/lib/tasks/vite.rake +0 -16
- data/lib/vite_rails_legacy/installation.rb +9 -0
- data/lib/vite_rails_legacy/tag_helpers.rb +2 -2
- data/lib/vite_rails_legacy/version.rb +1 -1
- data/templates/entrypoints/application.js +8 -0
- metadata +8 -64
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12259ef6d6e0ea8dbb919ab70bf61a48039ebd2d787545faf3acc686d42193bc
|
4
|
+
data.tar.gz: 394b6287b45d675b8cec372534b61c61e37f0be35d6dee2cbe61378945ac31f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15219aed9c6d3b261cc3c81ce42b163801aab203809f87e20d9a515b502c648dc8f39f5a5729fd51e77f9d4af27f0b6562e6da5e2725456adc0e45dd88174883
|
7
|
+
data.tar.gz: 12f47c7a05e31ebd6fc6c9f33d62c6c737db8bd8786e4ef152641a33e72db0f69975bbdc8248941d06a070238d962bb139c59f3c8ccd16c605be99112c4a942a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,38 @@
|
|
1
|
+
## [2.0.7](https://github.com/ElMassimo/vite_ruby/compare/vite_rails_legacy@2.0.6...vite_rails_legacy@2.0.7) (2021-03-20)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Simplify installation of build dependencies by using package manager flags ([5c8bb62](https://github.com/ElMassimo/vite_ruby/commit/5c8bb625926f2ab1788a3e3a22aeafd7104984cb))
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
## [2.0.6](https://github.com/ElMassimo/vite_ruby/compare/vite_rails_legacy@2.0.5...vite_rails_legacy@2.0.6) (2021-03-19)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* Typo typecript -> typescript in tag helpers ([#38](https://github.com/ElMassimo/vite_ruby/issues/38)) ([3d375df](https://github.com/ElMassimo/vite_ruby/commit/3d375df8553c8542966ac912a38fe70b7d59ba74))
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
## [2.0.5](https://github.com/ElMassimo/vite_ruby/compare/vite_rails_legacy@2.0.4...vite_rails_legacy@2.0.5) (2021-03-18)
|
20
|
+
|
21
|
+
* Add more help text in the example entrypoints ([87d6f14](https://github.com/ElMassimo/vite_ruby/commit/87d6f14a59bba2667089bb952960dce059f36592))
|
22
|
+
|
23
|
+
## [2.0.4](https://github.com/ElMassimo/vite_ruby/compare/vite_rails_legacy@2.0.3...vite_rails_legacy@2.0.4) (2021-03-18)
|
24
|
+
|
25
|
+
|
26
|
+
### Bug Fixes
|
27
|
+
|
28
|
+
* Using a .jsx extension in a tag helper in development ([a56491b](https://github.com/ElMassimo/vite_ruby/commit/a56491b96720ae537b6b6305aa7efa70cf19e4ee))
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
## [2.0.3](https://github.com/ElMassimo/vite_ruby/compare/vite_rails_legacy@2.0.2...vite_rails_legacy@2.0.3) (2021-03-07)
|
33
|
+
|
34
|
+
- Add a bounded requirement to `vite_ruby` dependency.
|
35
|
+
|
1
36
|
## ViteRailsLegacy 2.0.2 (2020-02-11)
|
2
37
|
|
3
38
|
- Release a version of Vite Rails that supports Rails 4.
|
data/README.md
CHANGED
@@ -32,9 +32,29 @@
|
|
32
32
|
|
33
33
|
[vite_rails]: https://github.com/ElMassimo/vite_ruby/tree/main/vite_rails
|
34
34
|
[vite_ruby]: https://github.com/ElMassimo/vite_ruby/tree/main/vite_ruby
|
35
|
+
[website]: https://vite-rails.netlify.app/
|
35
36
|
|
36
37
|
__Vite Rails Legacy__ is [__Vite Rails__][vite_rails], modified to support Rails 4.
|
37
38
|
|
39
|
+
## Installation 💿
|
40
|
+
|
41
|
+
Add this line to your application's Gemfile:
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
gem 'vite_rails_legacy'
|
45
|
+
```
|
46
|
+
|
47
|
+
Then, run:
|
48
|
+
|
49
|
+
```bash
|
50
|
+
bundle install
|
51
|
+
bundle exec vite install
|
52
|
+
```
|
53
|
+
|
54
|
+
This will generate configuration files and a sample setup.
|
55
|
+
|
56
|
+
Additional installation instructions are available in the [documentation website][website].
|
57
|
+
|
38
58
|
## Why a separate library? 🤔
|
39
59
|
|
40
60
|
I don't want the burden of having to support Rails 4 in the main codebase.
|
data/lib/tasks/vite.rake
CHANGED
@@ -1,20 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# Set NODE_ENV before installation, so that Rails installs JS build dependencies
|
4
|
-
# on servers that precompile assets.
|
5
|
-
installation_tasks = ['yarn:install', 'webpacker:yarn_install'].select { |name| Rake::Task.task_defined?(name) }.each do |name|
|
6
|
-
Rake::Task[name].enhance([:'vite_rails:set_node_env'])
|
7
|
-
end
|
8
|
-
|
9
|
-
# Ensure dependencies are installed in older versions of Rails
|
10
|
-
Rake::Task['assets:precompile']&.enhance([:'vite:install_dependencies']) if installation_tasks.none?
|
11
|
-
|
12
3
|
require 'vite_ruby'
|
13
4
|
ViteRuby.install_tasks
|
14
|
-
|
15
|
-
namespace :vite_rails do
|
16
|
-
desc 'Fixes Rails management of node dev dependencies (build dependencies)'
|
17
|
-
task :set_node_env do
|
18
|
-
ENV['NODE_ENV'] = 'development'
|
19
|
-
end
|
20
|
-
end
|
@@ -25,6 +25,15 @@ module ViteRailsLegacy::Installation
|
|
25
25
|
inject_line_before layout_file, '</head>', <<-HTML
|
26
26
|
<%= vite_client_tag %>
|
27
27
|
<%= vite_javascript_tag 'application' %>
|
28
|
+
<!--
|
29
|
+
If using a TypeScript entrypoint file:
|
30
|
+
vite_typescript_tag 'application'
|
31
|
+
|
32
|
+
If using a .jsx or .tsx entrypoint, add the extension:
|
33
|
+
vite_javascript_tag 'application.jsx'
|
34
|
+
|
35
|
+
Visit the guide for more information: https://vite-ruby.netlify.app/guide/rails
|
36
|
+
-->
|
28
37
|
HTML
|
29
38
|
end
|
30
39
|
end
|
@@ -26,7 +26,7 @@ module ViteRailsLegacy::TagHelpers
|
|
26
26
|
crossorigin: 'anonymous',
|
27
27
|
**options)
|
28
28
|
entries = vite_manifest.resolve_entries(*names, type: asset_type)
|
29
|
-
tags = javascript_include_tag(*entries.fetch(:scripts), crossorigin: crossorigin, type: type, **options)
|
29
|
+
tags = javascript_include_tag(*entries.fetch(:scripts), crossorigin: crossorigin, type: type, extname: false, **options)
|
30
30
|
tags << vite_preload_tag(*entries.fetch(:imports), crossorigin: crossorigin) unless skip_preload_tags
|
31
31
|
tags << stylesheet_link_tag(*entries.fetch(:stylesheets)) unless skip_style_tags
|
32
32
|
tags
|
@@ -34,7 +34,7 @@ module ViteRailsLegacy::TagHelpers
|
|
34
34
|
|
35
35
|
# Public: Renders a <script> tag for the specified Vite entrypoints.
|
36
36
|
def vite_typescript_tag(*names, **options)
|
37
|
-
vite_javascript_tag(*names, asset_type: :typescript,
|
37
|
+
vite_javascript_tag(*names, asset_type: :typescript, **options)
|
38
38
|
end
|
39
39
|
|
40
40
|
# Public: Renders a <link> tag for the specified Vite entrypoints.
|
@@ -5,6 +5,14 @@
|
|
5
5
|
// <%= vite_javascript_tag 'application' %>
|
6
6
|
console.log('Vite ⚡️ Rails')
|
7
7
|
|
8
|
+
// If using a TypeScript entrypoint file:
|
9
|
+
// <%= vite_typescript_tag 'application.jsx' %>
|
10
|
+
//
|
11
|
+
// If you want to use .jsx or .tsx, add the extension:
|
12
|
+
// <%= vite_javascript_tag 'application.jsx' %>
|
13
|
+
|
14
|
+
console.log('Visit the guide for more information: ', 'https://vite-ruby.netlify.app/guide/rails')
|
15
|
+
|
8
16
|
// Example: Load Rails libraries in Vite.
|
9
17
|
//
|
10
18
|
// import '@rails/ujs'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vite_rails_legacy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
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: 2021-
|
11
|
+
date: 2021-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -28,72 +28,16 @@ dependencies:
|
|
28
28
|
name: vite_ruby
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.3.0
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 1.3.0
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rubocop
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubocop-minitest
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop-performance
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
40
|
+
version: '1.0'
|
97
41
|
description:
|
98
42
|
email:
|
99
43
|
- maximomussini@gmail.com
|
@@ -117,8 +61,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
|
|
117
61
|
licenses:
|
118
62
|
- MIT
|
119
63
|
metadata:
|
120
|
-
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails_legacy@2.0.
|
121
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails_legacy@2.0.
|
64
|
+
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails_legacy@2.0.7/vite_rails_legacy
|
65
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails_legacy@2.0.7/vite_rails_legacy/CHANGELOG.md
|
122
66
|
post_install_message:
|
123
67
|
rdoc_options: []
|
124
68
|
require_paths:
|