vite_ruby 3.0.0.beta.2 → 3.0.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/default.vite.json +1 -0
- data/lib/tasks/vite.rake +8 -6
- data/lib/vite_ruby/config.rb +2 -2
- data/lib/vite_ruby/manifest.rb +12 -4
- data/lib/vite_ruby/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 986dd5b70d8f36f1296181067e11673e3522c56bef0dba1e1dc6c7e01aa857ad
|
4
|
+
data.tar.gz: 006f21577207d6739bc6d52e20c0c9fbc9baee83fa8229306726c71816580a86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dee8949824d3b4be6ae1ba5fcbfeed11e5b8160c2fd5df3dd5897f41e344c52ee1df26d2142d8f41b7a9a4fb8f9168ea5a82395793be1ac69b84279c86f8b32
|
7
|
+
data.tar.gz: 5e9344faf0d00c931abb4312e60b9c2c21029e13c23966b998b87f6b48edcad98f942918c8049f6c5d1d9004ffca6a24dc4085cb8b885e3f43c9f3870391032c
|
data/default.vite.json
CHANGED
data/lib/tasks/vite.rake
CHANGED
@@ -40,13 +40,15 @@ namespace :vite do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
|
44
|
-
Rake::Task
|
45
|
-
|
46
|
-
|
43
|
+
unless ENV['VITE_RUBY_SKIP_ASSETS_PRECOMPILE_EXTENSION'] == 'true'
|
44
|
+
if Rake::Task.task_defined?('assets:precompile')
|
45
|
+
Rake::Task['assets:precompile'].enhance do |task|
|
46
|
+
prefix = task.name.split(/#|assets:precompile/).first
|
47
|
+
Rake::Task["#{ prefix }vite:build"].invoke
|
48
|
+
end
|
49
|
+
else
|
50
|
+
Rake::Task.define_task('assets:precompile' => ['vite:install_dependencies', 'vite:build'])
|
47
51
|
end
|
48
|
-
else
|
49
|
-
Rake::Task.define_task('assets:precompile' => ['vite:install_dependencies', 'vite:build'])
|
50
52
|
end
|
51
53
|
|
52
54
|
# Any prerequisite task that installs packages should also install build dependencies.
|
data/lib/vite_ruby/config.rb
CHANGED
@@ -147,7 +147,7 @@ private
|
|
147
147
|
multi_env_config.fetch('all', {})
|
148
148
|
.merge(multi_env_config.fetch(mode, {}))
|
149
149
|
rescue Errno::ENOENT => error
|
150
|
-
|
150
|
+
$stderr << "Check that your vite.json configuration file is available in the load path:\n\n\t#{ error.message }\n\n"
|
151
151
|
{}
|
152
152
|
end
|
153
153
|
end
|
@@ -159,7 +159,7 @@ private
|
|
159
159
|
NOT_CONFIGURABLE_WITH_ENV = %w[additional_entrypoints watch_additional_paths].freeze
|
160
160
|
|
161
161
|
# Internal: Configuration options that can be provided as env vars.
|
162
|
-
CONFIGURABLE_WITH_ENV = (DEFAULT_CONFIG.keys + %w[mode root
|
162
|
+
CONFIGURABLE_WITH_ENV = (DEFAULT_CONFIG.keys + %w[mode root] - NOT_CONFIGURABLE_WITH_ENV).freeze
|
163
163
|
|
164
164
|
# Internal: If any of these files is modified the build won't be skipped.
|
165
165
|
DEFAULT_WATCHED_PATHS = %w[
|
data/lib/vite_ruby/manifest.rb
CHANGED
@@ -149,20 +149,28 @@ private
|
|
149
149
|
def resolve_entry_name(name, type: nil)
|
150
150
|
name = with_file_extension(name.to_s, type)
|
151
151
|
|
152
|
-
raise ArgumentError, "Asset names can not be relative. Found: #{ name }" if name.start_with?('.')
|
152
|
+
raise ArgumentError, "Asset names can not be relative. Found: #{ name }" if name.start_with?('.') && !name.include?('legacy-polyfills')
|
153
153
|
|
154
154
|
# Explicit path, relative to the source_code_dir.
|
155
155
|
name.sub(%r{^~/(.+)$}) { return Regexp.last_match(1) }
|
156
156
|
|
157
157
|
# Explicit path, relative to the project root.
|
158
|
-
name.sub(%r{^/(.+)$}) {
|
159
|
-
return dev_server_running? ? File.join(FS_PREFIX, config.root, Regexp.last_match(1)) : Regexp.last_match(1)
|
160
|
-
}
|
158
|
+
name.sub(%r{^/(.+)$}) { return resolve_absolute_entry(Regexp.last_match(1)) }
|
161
159
|
|
162
160
|
# Sugar: Prefix with the entrypoints dir if the path is not nested.
|
163
161
|
name.include?('/') ? name : File.join(config.entrypoints_dir, name)
|
164
162
|
end
|
165
163
|
|
164
|
+
# Internal: Entry names in the manifest are relative to the Vite.js.
|
165
|
+
# During develoment, files outside the root must be requested explicitly.
|
166
|
+
def resolve_absolute_entry(name)
|
167
|
+
if dev_server_running?
|
168
|
+
File.join(FS_PREFIX, config.root, name)
|
169
|
+
else
|
170
|
+
config.root.join(name).relative_path_from(config.vite_root_dir).to_s
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
166
174
|
# Internal: Adds a file extension to the file name, unless it already has one.
|
167
175
|
def with_file_extension(name, entry_type)
|
168
176
|
if File.extname(name).empty? && (ext = extension_for_type(entry_type))
|
data/lib/vite_ruby/version.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class ViteRuby
|
4
|
-
VERSION = '3.0.0.beta.
|
4
|
+
VERSION = '3.0.0.beta.3'
|
5
5
|
|
6
6
|
# Internal: Versions used by default when running `vite install`.
|
7
7
|
DEFAULT_VITE_VERSION = '^2.5.0'
|
8
|
-
DEFAULT_PLUGIN_VERSION = '^3.0.0-beta.
|
8
|
+
DEFAULT_PLUGIN_VERSION = '^3.0.0-beta.4'
|
9
9
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vite_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.beta.
|
4
|
+
version: 3.0.0.beta.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Máximo Mussini
|
@@ -201,8 +201,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
|
|
201
201
|
licenses:
|
202
202
|
- MIT
|
203
203
|
metadata:
|
204
|
-
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.0.0.beta.
|
205
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.0.0.beta.
|
204
|
+
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.0.0.beta.3/vite_ruby
|
205
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.0.0.beta.3/vite_ruby/CHANGELOG.md
|
206
206
|
post_install_message: "Thanks for installing Vite Ruby!\n\nIf you upgraded the gem
|
207
207
|
manually, please run:\n\tbundle exec vite upgrade"
|
208
208
|
rdoc_options: []
|