vite_rails 1.0.11 → 2.0.3
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/CHANGELOG.md +23 -0
- data/README.md +52 -34
- data/lib/tasks/vite.rake +17 -0
- data/lib/vite_rails.rb +5 -82
- data/lib/vite_rails/config.rb +11 -130
- data/lib/vite_rails/engine.rb +7 -11
- data/lib/vite_rails/installation.rb +52 -0
- data/lib/vite_rails/tag_helpers.rb +61 -0
- data/lib/vite_rails/version.rb +2 -2
- data/{lib/install/config/vite.json → templates/config/rails-vite.json} +1 -0
- data/{lib/install/javascript → templates}/entrypoints/application.js +0 -0
- metadata +27 -166
- data/CONTRIBUTING.md +0 -33
- data/lib/install/bin/vite +0 -17
- data/lib/install/binstubs.rb +0 -6
- data/lib/install/config/vite.config.ts +0 -11
- data/lib/install/template.rb +0 -40
- data/lib/tasks/vite/binstubs.rake +0 -12
- data/lib/tasks/vite/build.rake +0 -39
- data/lib/tasks/vite/clean.rake +0 -23
- data/lib/tasks/vite/clobber.rake +0 -20
- data/lib/tasks/vite/info.rake +0 -20
- data/lib/tasks/vite/install.rake +0 -12
- data/lib/tasks/vite/install_dependencies.rake +0 -14
- data/lib/tasks/vite/verify_install.rake +0 -23
- data/lib/vite_rails/builder.rb +0 -111
- data/lib/vite_rails/commands.rb +0 -109
- data/lib/vite_rails/dev_server.rb +0 -23
- data/lib/vite_rails/dev_server_proxy.rb +0 -57
- data/lib/vite_rails/helper.rb +0 -71
- data/lib/vite_rails/manifest.rb +0 -140
- data/lib/vite_rails/runner.rb +0 -53
- data/package.json +0 -19
- data/package/default.vite.json +0 -16
- data/test/builder_test.rb +0 -77
- data/test/commands_test.rb +0 -67
- data/test/config_test.rb +0 -133
- data/test/dev_server_proxy_test.rb +0 -102
- data/test/dev_server_test.rb +0 -9
- data/test/engine_rake_tasks_test.rb +0 -81
- data/test/helper_test.rb +0 -70
- data/test/manifest_test.rb +0 -79
- data/test/mode_test.rb +0 -16
- data/test/mounted_app/Rakefile +0 -6
- data/test/mounted_app/test/dummy/Rakefile +0 -5
- data/test/mounted_app/test/dummy/bin/rails +0 -5
- data/test/mounted_app/test/dummy/bin/rake +0 -5
- data/test/mounted_app/test/dummy/config.ru +0 -7
- data/test/mounted_app/test/dummy/config/application.rb +0 -12
- data/test/mounted_app/test/dummy/config/environment.rb +0 -5
- data/test/mounted_app/test/dummy/config/vite.json +0 -14
- data/test/mounted_app/test/dummy/package.json +0 -8
- data/test/mounted_app/test/dummy/yarn.lock +0 -208
- data/test/rake_tasks_test.rb +0 -60
- data/test/runner_test.rb +0 -31
- data/test/test_app/Rakefile +0 -5
- data/test/test_app/app/frontend/entrypoints/application.js +0 -2
- data/test/test_app/bin/vite +0 -17
- data/test/test_app/config.ru +0 -7
- data/test/test_app/config/application.rb +0 -13
- data/test/test_app/config/environment.rb +0 -6
- data/test/test_app/config/vite.json +0 -18
- data/test/test_app/config/vite_additional_paths.json +0 -5
- data/test/test_app/config/vite_public_dir.json +0 -5
- data/test/test_app/package.json +0 -13
- data/test/test_app/public/vite-production/manifest.json +0 -22
- data/test/test_app/some.config.js +0 -0
- data/test/test_app/yarn.lock +0 -11
- data/test/test_helper.rb +0 -68
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'vite_rails'
|
4
|
+
|
5
|
+
# Internal: Extends the base installation script from Vite Ruby to work for a
|
6
|
+
# typical Rails app.
|
7
|
+
module ViteRails::Installation
|
8
|
+
RAILS_TEMPLATES = Pathname.new(File.expand_path('../../templates', __dir__))
|
9
|
+
|
10
|
+
# Override: Setup a typical apps/web Hanami app to use Vite.
|
11
|
+
def setup_app_files
|
12
|
+
cp RAILS_TEMPLATES.join('config/rails-vite.json'), config.config_path
|
13
|
+
if root.join('app/javascript').exist?
|
14
|
+
Dry::CLI::Utils::Files.replace_first_line config.config_path, 'app/frontend', %( "sourceCodeDir": "app/javascript",)
|
15
|
+
end
|
16
|
+
setup_content_security_policy root.join('config/initializers/content_security_policy.rb')
|
17
|
+
end
|
18
|
+
|
19
|
+
# Internal: Configure CSP rules that allow to load @vite/client correctly.
|
20
|
+
def setup_content_security_policy(csp_file)
|
21
|
+
return unless csp_file.exist?
|
22
|
+
|
23
|
+
inject_line_after csp_file, 'policy.script_src', <<~CSP
|
24
|
+
# You may need to enable this in production as well depending on your setup.
|
25
|
+
# policy.script_src *policy.script_src, :blob if Rails.env.test?
|
26
|
+
CSP
|
27
|
+
inject_line_after csp_file, 'policy.connect_src', <<~CSP
|
28
|
+
# Allow @vite/client to hot reload changes in development
|
29
|
+
# policy.connect_src *policy.connect_src, "ws://\#{ ViteRuby.config.host_with_port }" if Rails.env.development?
|
30
|
+
CSP
|
31
|
+
inject_line_after csp_file, 'policy.script_src', <<~CSP
|
32
|
+
# Allow @vite/client to hot reload changes in development
|
33
|
+
# policy.script_src *policy.script_src, :unsafe_eval, "http://#{ ViteRuby.config.host_with_port }" if Rails.env.development?
|
34
|
+
CSP
|
35
|
+
end
|
36
|
+
|
37
|
+
# Override: Create a sample JS file and attempt to inject it in an HTML template.
|
38
|
+
def install_sample_files
|
39
|
+
unless config.resolved_entrypoints_dir.join('application.js').exist?
|
40
|
+
cp RAILS_TEMPLATES.join('entrypoints/application.js'), config.resolved_entrypoints_dir.join('application.js')
|
41
|
+
end
|
42
|
+
|
43
|
+
if (layout_file = root.join('app/views/layouts/application.html.erb')).exist?
|
44
|
+
inject_line_before layout_file, '</head>', <<-HTML
|
45
|
+
<%= vite_client_tag %>
|
46
|
+
<%= vite_javascript_tag 'application' %>
|
47
|
+
HTML
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
ViteRuby::CLI::Install.prepend(ViteRails::Installation)
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Public: Allows to render HTML tags for scripts and styles processed by Vite.
|
4
|
+
module ViteRails::TagHelpers
|
5
|
+
# Public: Renders a script tag for vite/client to enable HMR in development.
|
6
|
+
def vite_client_tag
|
7
|
+
return unless src = vite_manifest.vite_client_src
|
8
|
+
|
9
|
+
tag.script(src: src, type: 'module')
|
10
|
+
end
|
11
|
+
|
12
|
+
# Public: Resolves the path for the specified Vite asset.
|
13
|
+
#
|
14
|
+
# Example:
|
15
|
+
# <%= vite_asset_path 'calendar.css' %> # => "/vite/assets/calendar-1016838bab065ae1e122.css"
|
16
|
+
def vite_asset_path(name, **options)
|
17
|
+
path_to_asset vite_manifest.path_for(name, **options)
|
18
|
+
end
|
19
|
+
|
20
|
+
# Public: Renders a <script> tag for the specified Vite entrypoints.
|
21
|
+
def vite_javascript_tag(*names,
|
22
|
+
type: 'module',
|
23
|
+
asset_type: :javascript,
|
24
|
+
skip_preload_tags: false,
|
25
|
+
skip_style_tags: false,
|
26
|
+
crossorigin: 'anonymous',
|
27
|
+
**options)
|
28
|
+
entries = vite_manifest.resolve_entries(*names, type: asset_type)
|
29
|
+
tags = javascript_include_tag(*entries.fetch(:scripts), crossorigin: crossorigin, type: type, **options)
|
30
|
+
tags << vite_preload_tag(*entries.fetch(:imports), crossorigin: crossorigin) unless skip_preload_tags
|
31
|
+
tags << stylesheet_link_tag(*entries.fetch(:stylesheets)) unless skip_style_tags
|
32
|
+
tags
|
33
|
+
end
|
34
|
+
|
35
|
+
# Public: Renders a <script> tag for the specified Vite entrypoints.
|
36
|
+
def vite_typescript_tag(*names, **options)
|
37
|
+
vite_javascript_tag(*names, asset_type: :typescript, extname: false, **options)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Public: Renders a <link> tag for the specified Vite entrypoints.
|
41
|
+
def vite_stylesheet_tag(*names, **options)
|
42
|
+
style_paths = names.map { |name| vite_asset_path(name, type: :stylesheet) }
|
43
|
+
stylesheet_link_tag(*style_paths, **options)
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
# Internal: Returns the current manifest loaded by Vite Ruby.
|
49
|
+
def vite_manifest
|
50
|
+
ViteRuby.instance.manifest
|
51
|
+
end
|
52
|
+
|
53
|
+
# Internal: Renders a modulepreload link tag.
|
54
|
+
def vite_preload_tag(*sources, crossorigin:)
|
55
|
+
sources.map { |source|
|
56
|
+
href = path_to_asset(source)
|
57
|
+
try(:request).try(:send_early_hints, 'Link' => %(<#{ href }>; rel=modulepreload; as=script; crossorigin=#{ crossorigin }))
|
58
|
+
tag.link(rel: 'modulepreload', href: href, as: 'script', crossorigin: crossorigin)
|
59
|
+
}.join("\n").html_safe
|
60
|
+
end
|
61
|
+
end
|
data/lib/vite_rails/version.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,113 +1,63 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vite_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.3
|
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-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: railties
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '5.1'
|
20
|
-
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '5.1'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rack-proxy
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
20
|
+
- - "<"
|
32
21
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
22
|
+
version: '8'
|
34
23
|
type: :runtime
|
35
24
|
prerelease: false
|
36
25
|
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.6.1
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: railties
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
26
|
requirements:
|
45
27
|
- - ">="
|
46
28
|
- !ruby/object:Gem::Version
|
47
29
|
version: '5.1'
|
48
|
-
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
30
|
+
- - "<"
|
53
31
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
32
|
+
version: '8'
|
55
33
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
34
|
+
name: vite_ruby
|
57
35
|
requirement: !ruby/object:Gem::Requirement
|
58
36
|
requirements:
|
59
|
-
- - "
|
37
|
+
- - "~>"
|
60
38
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
39
|
+
version: '1.0'
|
62
40
|
type: :runtime
|
63
41
|
prerelease: false
|
64
42
|
version_requirements: !ruby/object:Gem::Requirement
|
65
43
|
requirements:
|
66
|
-
- - "
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: bundler
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 1.3.0
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 1.3.0
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rubocop
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.93.1
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '='
|
44
|
+
- - "~>"
|
95
45
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0
|
46
|
+
version: '1.0'
|
97
47
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
48
|
+
name: spring
|
99
49
|
requirement: !ruby/object:Gem::Requirement
|
100
50
|
requirements:
|
101
|
-
- - "
|
51
|
+
- - "~>"
|
102
52
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
53
|
+
version: '2.1'
|
104
54
|
type: :development
|
105
55
|
prerelease: false
|
106
56
|
version_requirements: !ruby/object:Gem::Requirement
|
107
57
|
requirements:
|
108
|
-
- - "
|
58
|
+
- - "~>"
|
109
59
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
60
|
+
version: '2.1'
|
111
61
|
description:
|
112
62
|
email:
|
113
63
|
- maximomussini@gmail.com
|
@@ -116,77 +66,23 @@ extensions: []
|
|
116
66
|
extra_rdoc_files: []
|
117
67
|
files:
|
118
68
|
- CHANGELOG.md
|
119
|
-
- CONTRIBUTING.md
|
120
69
|
- LICENSE.txt
|
121
70
|
- README.md
|
122
|
-
- lib/
|
123
|
-
- lib/install/binstubs.rb
|
124
|
-
- lib/install/config/vite.config.ts
|
125
|
-
- lib/install/config/vite.json
|
126
|
-
- lib/install/javascript/entrypoints/application.js
|
127
|
-
- lib/install/template.rb
|
128
|
-
- lib/tasks/vite/binstubs.rake
|
129
|
-
- lib/tasks/vite/build.rake
|
130
|
-
- lib/tasks/vite/clean.rake
|
131
|
-
- lib/tasks/vite/clobber.rake
|
132
|
-
- lib/tasks/vite/info.rake
|
133
|
-
- lib/tasks/vite/install.rake
|
134
|
-
- lib/tasks/vite/install_dependencies.rake
|
135
|
-
- lib/tasks/vite/verify_install.rake
|
71
|
+
- lib/tasks/vite.rake
|
136
72
|
- lib/vite_rails.rb
|
137
|
-
- lib/vite_rails/builder.rb
|
138
|
-
- lib/vite_rails/commands.rb
|
139
73
|
- lib/vite_rails/config.rb
|
140
|
-
- lib/vite_rails/dev_server.rb
|
141
|
-
- lib/vite_rails/dev_server_proxy.rb
|
142
74
|
- lib/vite_rails/engine.rb
|
143
|
-
- lib/vite_rails/
|
144
|
-
- lib/vite_rails/
|
145
|
-
- lib/vite_rails/runner.rb
|
75
|
+
- lib/vite_rails/installation.rb
|
76
|
+
- lib/vite_rails/tag_helpers.rb
|
146
77
|
- lib/vite_rails/version.rb
|
147
|
-
-
|
148
|
-
-
|
149
|
-
|
150
|
-
- test/commands_test.rb
|
151
|
-
- test/config_test.rb
|
152
|
-
- test/dev_server_proxy_test.rb
|
153
|
-
- test/dev_server_test.rb
|
154
|
-
- test/engine_rake_tasks_test.rb
|
155
|
-
- test/helper_test.rb
|
156
|
-
- test/manifest_test.rb
|
157
|
-
- test/mode_test.rb
|
158
|
-
- test/mounted_app/Rakefile
|
159
|
-
- test/mounted_app/test/dummy/Rakefile
|
160
|
-
- test/mounted_app/test/dummy/bin/rails
|
161
|
-
- test/mounted_app/test/dummy/bin/rake
|
162
|
-
- test/mounted_app/test/dummy/config.ru
|
163
|
-
- test/mounted_app/test/dummy/config/application.rb
|
164
|
-
- test/mounted_app/test/dummy/config/environment.rb
|
165
|
-
- test/mounted_app/test/dummy/config/vite.json
|
166
|
-
- test/mounted_app/test/dummy/package.json
|
167
|
-
- test/mounted_app/test/dummy/yarn.lock
|
168
|
-
- test/rake_tasks_test.rb
|
169
|
-
- test/runner_test.rb
|
170
|
-
- test/test_app/Rakefile
|
171
|
-
- test/test_app/app/frontend/entrypoints/application.js
|
172
|
-
- test/test_app/bin/vite
|
173
|
-
- test/test_app/config.ru
|
174
|
-
- test/test_app/config/application.rb
|
175
|
-
- test/test_app/config/environment.rb
|
176
|
-
- test/test_app/config/vite.json
|
177
|
-
- test/test_app/config/vite_additional_paths.json
|
178
|
-
- test/test_app/config/vite_public_dir.json
|
179
|
-
- test/test_app/package.json
|
180
|
-
- test/test_app/public/vite-production/manifest.json
|
181
|
-
- test/test_app/some.config.js
|
182
|
-
- test/test_app/yarn.lock
|
183
|
-
- test/test_helper.rb
|
184
|
-
homepage: https://github.com/ElMassimo/vite_rails
|
78
|
+
- templates/config/rails-vite.json
|
79
|
+
- templates/entrypoints/application.js
|
80
|
+
homepage: https://github.com/ElMassimo/vite_ruby
|
185
81
|
licenses:
|
186
82
|
- MIT
|
187
83
|
metadata:
|
188
|
-
source_code_uri: https://github.com/ElMassimo/
|
189
|
-
changelog_uri: https://github.com/ElMassimo/
|
84
|
+
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@2.0.3/vite_rails
|
85
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@2.0.3/vite_rails/CHANGELOG.md
|
190
86
|
post_install_message:
|
191
87
|
rdoc_options: []
|
192
88
|
require_paths:
|
@@ -195,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
195
91
|
requirements:
|
196
92
|
- - ">="
|
197
93
|
- !ruby/object:Gem::Version
|
198
|
-
version: 2.5
|
94
|
+
version: '2.5'
|
199
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
96
|
requirements:
|
201
97
|
- - ">="
|
@@ -206,39 +102,4 @@ rubygems_version: 3.1.4
|
|
206
102
|
signing_key:
|
207
103
|
specification_version: 4
|
208
104
|
summary: Use Vite in Rails and bring joy to your JavaScript experience
|
209
|
-
test_files:
|
210
|
-
- test/builder_test.rb
|
211
|
-
- test/commands_test.rb
|
212
|
-
- test/config_test.rb
|
213
|
-
- test/dev_server_proxy_test.rb
|
214
|
-
- test/dev_server_test.rb
|
215
|
-
- test/engine_rake_tasks_test.rb
|
216
|
-
- test/helper_test.rb
|
217
|
-
- test/manifest_test.rb
|
218
|
-
- test/mode_test.rb
|
219
|
-
- test/mounted_app/Rakefile
|
220
|
-
- test/mounted_app/test/dummy/Rakefile
|
221
|
-
- test/mounted_app/test/dummy/bin/rails
|
222
|
-
- test/mounted_app/test/dummy/bin/rake
|
223
|
-
- test/mounted_app/test/dummy/config.ru
|
224
|
-
- test/mounted_app/test/dummy/config/application.rb
|
225
|
-
- test/mounted_app/test/dummy/config/environment.rb
|
226
|
-
- test/mounted_app/test/dummy/config/vite.json
|
227
|
-
- test/mounted_app/test/dummy/package.json
|
228
|
-
- test/mounted_app/test/dummy/yarn.lock
|
229
|
-
- test/rake_tasks_test.rb
|
230
|
-
- test/runner_test.rb
|
231
|
-
- test/test_app/Rakefile
|
232
|
-
- test/test_app/app/frontend/entrypoints/application.js
|
233
|
-
- test/test_app/bin/vite
|
234
|
-
- test/test_app/config.ru
|
235
|
-
- test/test_app/config/application.rb
|
236
|
-
- test/test_app/config/environment.rb
|
237
|
-
- test/test_app/config/vite.json
|
238
|
-
- test/test_app/config/vite_additional_paths.json
|
239
|
-
- test/test_app/config/vite_public_dir.json
|
240
|
-
- test/test_app/package.json
|
241
|
-
- test/test_app/public/vite-production/manifest.json
|
242
|
-
- test/test_app/some.config.js
|
243
|
-
- test/test_app/yarn.lock
|
244
|
-
- test/test_helper.rb
|
105
|
+
test_files: []
|
data/CONTRIBUTING.md
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
## Setting Up a Development Environment
|
2
|
-
|
3
|
-
1. Install [Yarn](https://yarnpkg.com/)
|
4
|
-
|
5
|
-
2. Run the following commands to set up the development environment.
|
6
|
-
|
7
|
-
```
|
8
|
-
bundle install
|
9
|
-
```
|
10
|
-
|
11
|
-
## Making sure your changes pass all tests
|
12
|
-
There are a number of automated checks which run on GitHub Actions when a pull request is created.
|
13
|
-
You can run those checks on your own locally to make sure that your changes would not break the CI build.
|
14
|
-
|
15
|
-
### 1. Check the code for JavaScript style violations
|
16
|
-
```
|
17
|
-
yarn lint
|
18
|
-
```
|
19
|
-
|
20
|
-
### 2. Check the code for Ruby style violations
|
21
|
-
```
|
22
|
-
bundle exec rubocop
|
23
|
-
```
|
24
|
-
|
25
|
-
### 3. Run the JavaScript test suite
|
26
|
-
```
|
27
|
-
yarn test
|
28
|
-
```
|
29
|
-
|
30
|
-
### 4. Run the Ruby test suite
|
31
|
-
```
|
32
|
-
bundle exec rake test
|
33
|
-
```
|
data/lib/install/bin/vite
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
ENV['RAILS_ENV'] ||= ENV['RACK_ENV'] || 'development'
|
5
|
-
ENV['NODE_ENV'] ||= ENV['RAILS_ENV'] == 'development' ? 'development' : 'production'
|
6
|
-
|
7
|
-
require 'pathname'
|
8
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', Pathname.new(__FILE__).realpath)
|
9
|
-
|
10
|
-
require 'bundler/setup'
|
11
|
-
|
12
|
-
require 'vite_rails'
|
13
|
-
|
14
|
-
APP_ROOT = File.expand_path('..', __dir__)
|
15
|
-
Dir.chdir(APP_ROOT) do
|
16
|
-
ViteRails.run(ARGV)
|
17
|
-
end
|