vite_ruby 3.0.0.beta.2 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/default.vite.json +1 -0
- data/lib/tasks/vite.rake +8 -6
- data/lib/vite_ruby/cli/build.rb +1 -0
- data/lib/vite_ruby/commands.rb +1 -1
- data/lib/vite_ruby/config.rb +2 -2
- data/lib/vite_ruby/manifest.rb +12 -4
- data/lib/vite_ruby/version.rb +3 -3
- data/lib/vite_ruby.rb +1 -1
- data/templates/config/vite.json +2 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cdcbf5bc964a78456156b8cd05e946e9f737a20832af1077fc5821c3340b135
|
4
|
+
data.tar.gz: 87bbae5376b7873a420e802df908c8fb0f544dd18d6c7b32d9464248acf08bcd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7fdecb430b866c5fcfeca1b93389c35483a2937739b45cbccc15366bfe4f52792e9c3218db44357bbeaa41631894599da44ea22efcf0dcf24a00d25a1448277
|
7
|
+
data.tar.gz: d91ec79eb0d1e1f81e4eeb32d3f9a660b76ae5bdf4ed02b393a2b6289bcc2a8627ca4a6e997acd375c05c51a18910269bd01fd86cc588bbd3687aede5864017b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,25 @@
|
|
1
|
+
## [3.0.2](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.1...vite_ruby@3.0.2) (2021-10-29)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* enable hmr when running tests in development with vite dev server ([e253bba](https://github.com/ElMassimo/vite_ruby/commit/e253bba26d164aabc7a9526df504c207ad2cf6f9))
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
## [3.0.1](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@3.0.0...vite_ruby@3.0.1) (2021-10-27)
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* expose the `--watch` flag for the build command ([4e20d0a](https://github.com/ElMassimo/vite_ruby/commit/4e20d0a7b697b535e13335dac5a75fb8a193a133))
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
# [3.0.0](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.20...vite_ruby@3.0.0) (2021-08-16)
|
20
|
+
|
21
|
+
See https://github.com/ElMassimo/vite_ruby/pull/116 for features and breaking changes.
|
22
|
+
|
1
23
|
## [1.2.20](https://github.com/ElMassimo/vite_ruby/compare/vite_ruby@1.2.18...vite_ruby@1.2.20) (2021-07-30)
|
2
24
|
|
3
25
|
|
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/cli/build.rb
CHANGED
@@ -6,6 +6,7 @@ class ViteRuby::CLI::Build < ViteRuby::CLI::Vite
|
|
6
6
|
desc 'Bundle all entrypoints using Vite.'
|
7
7
|
shared_options
|
8
8
|
option(:force, desc: 'Force the build even if assets have not changed', type: :boolean)
|
9
|
+
option(:watch, desc: 'Start the Rollup watcher and rebuild on files changes', type: :boolean)
|
9
10
|
|
10
11
|
def call(**options)
|
11
12
|
super { |args| ViteRuby.commands.build_from_task(*args) }
|
data/lib/vite_ruby/commands.rb
CHANGED
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.
|
4
|
+
VERSION = '3.0.2'
|
5
5
|
|
6
6
|
# Internal: Versions used by default when running `vite install`.
|
7
|
-
DEFAULT_VITE_VERSION = '^2.
|
8
|
-
DEFAULT_PLUGIN_VERSION = '^3.0.
|
7
|
+
DEFAULT_VITE_VERSION = '^2.6.13'
|
8
|
+
DEFAULT_PLUGIN_VERSION = '^3.0.2'
|
9
9
|
end
|
data/lib/vite_ruby.rb
CHANGED
@@ -97,7 +97,7 @@ class ViteRuby
|
|
97
97
|
|
98
98
|
# Public: The proxy for assets should only run in development mode.
|
99
99
|
def run_proxy?
|
100
|
-
config.mode == 'development'
|
100
|
+
config.mode == 'development' || (config.mode == 'test' && !ENV['CI'])
|
101
101
|
rescue StandardError => error
|
102
102
|
logger.error("Failed to check mode for Vite: #{ error.message }")
|
103
103
|
false
|
data/templates/config/vite.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vite_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Máximo Mussini
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|
@@ -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.
|
205
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.0.
|
204
|
+
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@3.0.2/vite_ruby
|
205
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@3.0.2/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: []
|
@@ -215,9 +215,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
215
|
version: '2.4'
|
216
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
217
|
requirements:
|
218
|
-
- - "
|
218
|
+
- - ">="
|
219
219
|
- !ruby/object:Gem::Version
|
220
|
-
version:
|
220
|
+
version: '0'
|
221
221
|
requirements: []
|
222
222
|
rubygems_version: 3.1.4
|
223
223
|
signing_key:
|