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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b5eacc1f40e589613a5804a54aaf8f09a6b4000da7e8bd3ce05ae225fb76dc3
4
- data.tar.gz: 6dc5725316ed7aa13b5ca4531ea2ca2fd999c6fbe0d33770a9cbf7d479128b76
3
+ metadata.gz: 986dd5b70d8f36f1296181067e11673e3522c56bef0dba1e1dc6c7e01aa857ad
4
+ data.tar.gz: 006f21577207d6739bc6d52e20c0c9fbc9baee83fa8229306726c71816580a86
5
5
  SHA512:
6
- metadata.gz: c7c69993fb89ad7cd0d6f6a50d2a3a0bfe828c4be21875eb7c16c9f18cee13a15a7a7055876cb5b382c9db2c9f4f2b25a2e7178089374505bae7865265efb213
7
- data.tar.gz: 10f64b31dbd0120e00661a30350668b8a622b79111f575d244bf2f5c55ec0cba28e3269cccec7337244154b434188c290889f88a5874168aab6637f0000cfd28
6
+ metadata.gz: 2dee8949824d3b4be6ae1ba5fcbfeed11e5b8160c2fd5df3dd5897f41e344c52ee1df26d2142d8f41b7a9a4fb8f9168ea5a82395793be1ac69b84279c86f8b32
7
+ data.tar.gz: 5e9344faf0d00c931abb4312e60b9c2c21029e13c23966b998b87f6b48edcad98f942918c8049f6c5d1d9004ffca6a24dc4085cb8b885e3f43c9f3870391032c
data/default.vite.json CHANGED
@@ -10,6 +10,7 @@
10
10
  "publicDir": "public",
11
11
  "entrypointsDir": "entrypoints",
12
12
  "sourceCodeDir": "app/frontend",
13
+ "skipCompatibilityCheck": false,
13
14
  "host": "localhost",
14
15
  "https": null,
15
16
  "port": 3036,
data/lib/tasks/vite.rake CHANGED
@@ -40,13 +40,15 @@ namespace :vite do
40
40
  end
41
41
  end
42
42
 
43
- if Rake::Task.task_defined?('assets:precompile')
44
- Rake::Task['assets:precompile'].enhance do |task|
45
- prefix = task.name.split(/#|assets:precompile/).first
46
- Rake::Task["#{ prefix }vite:build"].invoke
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.
@@ -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
- warn "Check that your vite.json configuration file is available in the load path:\n\n\t#{ error.message }\n\n"
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 skip_compatibility_check] - NOT_CONFIGURABLE_WITH_ENV).freeze
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[
@@ -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))
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '3.0.0.beta.2'
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.3'
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.2
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.2/vite_ruby
205
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.0.0.beta.2/vite_ruby/CHANGELOG.md
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: []