minivite_rails 0.1.0 → 0.1.1
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 +4 -4
- data/.rubocop.yml +14 -1
- data/Gemfile.lock +4 -1
- data/README.md +3 -1
- data/lib/minivite_rails/configuration.rb +1 -0
- data/lib/minivite_rails/manifest.rb +2 -1
- data/lib/minivite_rails/tag_helpers.rb +2 -2
- data/lib/minivite_rails/version.rb +1 -1
- data/lib/minivite_rails.rb +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55cbf29f11571e14ba878bdb8bdbf89a748c4d0a9267b674d50dd99a461d767f
|
4
|
+
data.tar.gz: a2436d71daf84c73c0581d4d3cb7aa475051adb84275525298cdf718ee52fa76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d29a6e557b46e1289d7d8816876e1685fac6e8315072b5a055ec735697733f274d042c1ee8f32bfb247474a1abf17bfb8b4b46073a28ed1019dacc99730e12f9
|
7
|
+
data.tar.gz: 5b4d168c70aae016a2588a641e9811d195add800ea109f2f92721d77b488af5671799f0b02e8ae672904269bb5713abe13ecf787849cf39a71b3ee9de2c9bfda
|
data/.rubocop.yml
CHANGED
@@ -1,7 +1,20 @@
|
|
1
1
|
require: rubocop-rspec
|
2
2
|
|
3
3
|
AllCops:
|
4
|
-
|
4
|
+
NewCops: enable
|
5
|
+
TargetRubyVersion: 3.0
|
5
6
|
|
6
7
|
Layout/LineLength:
|
7
8
|
Max: 120
|
9
|
+
|
10
|
+
Metrics/ClassLength:
|
11
|
+
Max: 200
|
12
|
+
|
13
|
+
RSpec/NestedGroups:
|
14
|
+
Max: 5
|
15
|
+
|
16
|
+
RSpec/ExampleLength:
|
17
|
+
Max: 15
|
18
|
+
|
19
|
+
RSpec/NamedSubject:
|
20
|
+
Enabled: false
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
minivite_rails (0.1.
|
4
|
+
minivite_rails (0.1.1)
|
5
5
|
actionview (>= 6.0.0)
|
6
6
|
railties (>= 6.0.0)
|
7
7
|
|
@@ -48,6 +48,8 @@ GEM
|
|
48
48
|
minitest (5.17.0)
|
49
49
|
nokogiri (1.14.1-x86_64-darwin)
|
50
50
|
racc (~> 1.4)
|
51
|
+
nokogiri (1.14.1-x86_64-linux)
|
52
|
+
racc (~> 1.4)
|
51
53
|
parallel (1.22.1)
|
52
54
|
parser (3.2.0.0)
|
53
55
|
ast (~> 2.4.1)
|
@@ -113,6 +115,7 @@ GEM
|
|
113
115
|
PLATFORMS
|
114
116
|
x86_64-darwin-21
|
115
117
|
x86_64-darwin-22
|
118
|
+
x86_64-linux
|
116
119
|
|
117
120
|
DEPENDENCIES
|
118
121
|
debug (~> 1.0)
|
data/README.md
CHANGED
@@ -162,7 +162,7 @@ MiniviteRails.configuration do |c|
|
|
162
162
|
end
|
163
163
|
```
|
164
164
|
|
165
|
-
|
165
|
+
The corresponding Vite configuration for above admin panel:
|
166
166
|
|
167
167
|
```js
|
168
168
|
import { fileURLToPath, URL } from 'node:url'
|
@@ -189,6 +189,8 @@ export default defineConfig({
|
|
189
189
|
|
190
190
|
```
|
191
191
|
|
192
|
+
__Note:__ The sub configuration must have a unique name and it will inherit all the configurations' value from the main configuration.
|
193
|
+
|
192
194
|
## Special Thanks
|
193
195
|
|
194
196
|
This project uses ideas and codes from the following projects:
|
@@ -8,6 +8,7 @@ require 'active_support/core_ext/object/blank'
|
|
8
8
|
require 'rails'
|
9
9
|
|
10
10
|
module MiniviteRails
|
11
|
+
# Class to load and parse the manifest.json file generated by Vite.
|
11
12
|
class Manifest
|
12
13
|
class FileNotFoundError < StandardError; end
|
13
14
|
class MissingEntryError < StandardError; end
|
@@ -38,7 +39,7 @@ module MiniviteRails
|
|
38
39
|
prefix_vite_asset('@vite/client') if dev_server_available?
|
39
40
|
end
|
40
41
|
|
41
|
-
def resolve_entries(*names, **options)
|
42
|
+
def resolve_entries(*names, **options) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity
|
42
43
|
entries = names.map { |name| lookup!(name, **options) }
|
43
44
|
script_paths = entries.map { |entry| entry.fetch('file') }
|
44
45
|
|
@@ -5,8 +5,8 @@ require 'action_view'
|
|
5
5
|
# Use tag helpers from Vite Ruby
|
6
6
|
# https://github.com/ElMassimo/vite_ruby/blob/main/vite_rails/lib/vite_rails/tag_helpers.rb
|
7
7
|
|
8
|
-
# Public: Allows to render HTML tags for scripts and styles processed by Vite.
|
9
8
|
module MiniviteRails
|
9
|
+
# Public: Allows to render HTML tags for scripts and styles processed by Vite.
|
10
10
|
module TagHelpers
|
11
11
|
# Public: Renders a script tag for vite/client to enable HMR in development.
|
12
12
|
def vite_client_tag(id: nil, **options)
|
@@ -38,7 +38,7 @@ module MiniviteRails
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# Public: Renders a <script> tag for the specified Vite entrypoints.
|
41
|
-
def vite_javascript_tag(*names,
|
41
|
+
def vite_javascript_tag(*names, # rubocop:disable Metrics/ParameterLists
|
42
42
|
id: nil,
|
43
43
|
type: 'module',
|
44
44
|
asset_type: :javascript,
|
data/lib/minivite_rails.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Main entrypoint
|
3
4
|
module MiniviteRails
|
4
5
|
require 'minivite_rails/configuration'
|
5
6
|
require 'minivite_rails/manifest'
|
@@ -25,5 +26,5 @@ end
|
|
25
26
|
|
26
27
|
require 'active_support/lazy_load_hooks'
|
27
28
|
ActiveSupport.on_load :action_view do
|
28
|
-
|
29
|
+
ActionView::Base.include MiniviteRails::TagHelpers
|
29
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minivite_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Linh Tran
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -133,6 +133,7 @@ licenses:
|
|
133
133
|
- MIT
|
134
134
|
metadata:
|
135
135
|
homepage_uri: https://github.com/linhmtran168/minivite_rails
|
136
|
+
rubygems_mfa_required: 'true'
|
136
137
|
post_install_message:
|
137
138
|
rdoc_options: []
|
138
139
|
require_paths:
|
@@ -141,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
141
142
|
requirements:
|
142
143
|
- - ">="
|
143
144
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
145
|
+
version: '3.0'
|
145
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
146
147
|
requirements:
|
147
148
|
- - ">="
|