vite_rails 2.0.9 → 2.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/README.md +2 -2
- data/lib/vite_rails/engine.rb +5 -0
- data/lib/vite_rails/installation.rb +1 -1
- data/lib/vite_rails/tag_helpers.rb +5 -0
- data/lib/vite_rails/version.rb +1 -1
- data/templates/entrypoints/application.js +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aeccc7a6aac7af8b23fcd39f6da48291af50b447f6b3e6caeb29edbf19cea55
|
4
|
+
data.tar.gz: 555f0684fc6c3eb369a047913d7b91228796913fa6950a1ed5c2182d5ad60de0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccfbfb3a9d5e9f5342229db3d80debacb9630691d8ecc0d01911ed8c4471d8ff84caa906e9a0bb7c9056b012537b4b1134cef785674245bbbeafad6ab5470e8d
|
7
|
+
data.tar.gz: 842435df00161005d1ffbf1f7862c638befde2498382af4b8e916f7cae15e7d5016a63394ec7a043da4d5aaf690e255a199095f65c6424f43aee7888974b6bc0
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
## [2.0.12](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.11...vite_rails@2.0.12) (2021-05-24)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* Fix typo in comment in example entrypoint in Rails ([78b3104](https://github.com/ElMassimo/vite_ruby/commit/78b3104bc687a79aebd4e0538b8b7c34562cb4eb))
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
## [2.0.11](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.10...vite_rails@2.0.11) (2021-05-10)
|
11
|
+
|
12
|
+
### Refactor
|
13
|
+
|
14
|
+
* Avoid reference to `dry-cli` during installation, use internal APIs instead ([f5b87e](https://github.com/ElMassimo/vite_ruby/commit/f5b87e69790e48397d15e609b44118e399c9493d))
|
15
|
+
|
16
|
+
|
17
|
+
## [2.0.10](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.9...vite_rails@2.0.10) (2021-04-21)
|
18
|
+
|
19
|
+
|
20
|
+
### Features
|
21
|
+
|
22
|
+
* Add helpers to enable HMR when using @vitejs/plugin-react-refresh ([a80f286](https://github.com/ElMassimo/vite_ruby/commit/a80f286d4305bbae29ea7cea42a4329a530f43fa))
|
23
|
+
|
24
|
+
|
25
|
+
|
1
26
|
## [2.0.9](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@2.0.8...vite_rails@2.0.9) (2021-04-15)
|
2
27
|
|
3
28
|
|
data/README.md
CHANGED
@@ -43,8 +43,8 @@
|
|
43
43
|
[heroku]: https://pingcrm-vite.herokuapp.com/
|
44
44
|
[Issues]: https://github.com/ElMassimo/vite_ruby/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc
|
45
45
|
[Discussions]: https://github.com/ElMassimo/vite_ruby/discussions
|
46
|
-
[no bundling]: https://vitejs.dev/guide/
|
47
|
-
[bundling]: https://vitejs.dev/guide/
|
46
|
+
[no bundling]: https://vitejs.dev/guide/why.html#the-problems
|
47
|
+
[bundling]: https://vitejs.dev/guide/why.html#why-bundle-for-production
|
48
48
|
|
49
49
|
[Vite] is to frontend tooling as Ruby to programming, pure joy! 😍
|
50
50
|
|
data/lib/vite_rails/engine.rb
CHANGED
@@ -33,4 +33,9 @@ class ViteRails::Engine < Rails::Engine
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
|
+
|
37
|
+
initializer 'vite_rails.set_source' do |app|
|
38
|
+
source_dir = ViteRuby.config.root.join(ViteRuby.config.source_code_dir)
|
39
|
+
app.config.javascript_path = source_dir.relative_path_from(Rails.root.join('app')).to_s
|
40
|
+
end
|
36
41
|
end
|
@@ -11,7 +11,7 @@ module ViteRails::Installation
|
|
11
11
|
def setup_app_files
|
12
12
|
cp RAILS_TEMPLATES.join('config/rails-vite.json'), config.config_path
|
13
13
|
if dir = %w[app/javascript app/packs].find { |path| root.join(path).exist? }
|
14
|
-
|
14
|
+
replace_first_line config.config_path, 'app/frontend', %( "sourceCodeDir": "#{ dir }",)
|
15
15
|
end
|
16
16
|
setup_content_security_policy root.join('config/initializers/content_security_policy.rb')
|
17
17
|
end
|
@@ -9,6 +9,11 @@ module ViteRails::TagHelpers
|
|
9
9
|
tag.script(src: src, type: 'module')
|
10
10
|
end
|
11
11
|
|
12
|
+
# Public: Renders a script tag to enable HMR with React Refresh.
|
13
|
+
def vite_react_refresh_tag
|
14
|
+
vite_manifest.react_refresh_preamble&.html_safe
|
15
|
+
end
|
16
|
+
|
12
17
|
# Public: Resolves the path for the specified Vite asset.
|
13
18
|
#
|
14
19
|
# Example:
|
data/lib/vite_rails/version.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
console.log('Vite ⚡️ Rails')
|
7
7
|
|
8
8
|
// If using a TypeScript entrypoint file:
|
9
|
-
// <%= vite_typescript_tag 'application
|
9
|
+
// <%= vite_typescript_tag 'application' %>
|
10
10
|
//
|
11
11
|
// If you want to use .jsx or .tsx, add the extension:
|
12
12
|
// <%= vite_javascript_tag 'application.jsx' %>
|
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: 2.0.
|
4
|
+
version: 2.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: 2021-
|
11
|
+
date: 2021-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -81,8 +81,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
|
|
81
81
|
licenses:
|
82
82
|
- MIT
|
83
83
|
metadata:
|
84
|
-
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@2.0.
|
85
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@2.0.
|
84
|
+
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@2.0.13/vite_rails
|
85
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@2.0.13/vite_rails/CHANGELOG.md
|
86
86
|
post_install_message:
|
87
87
|
rdoc_options: []
|
88
88
|
require_paths:
|