vite_ruby 2.0.0.beta.2 → 2.0.0.beta.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f6ca7bd5b83588c6e0118597ba98d5477979d10348ae86a757f25942f179286
4
- data.tar.gz: aa1dd99bd6e495e77ab56376a6b5ae691490c26114d1c707cc6dc14c293e11f4
3
+ metadata.gz: db7a467c6b97a89c6704a7f94ff6c20b4b1bb39bd49fbb5d5f0fd67ea754fbdb
4
+ data.tar.gz: edffb992d9fda5dc7993d620037ba2866b3f1ec8bf1561b4ed4e0a420646c6fb
5
5
  SHA512:
6
- metadata.gz: 47e230e531f02ff5d1a5f8ed3467d1d15aede112cf3dfad4bd993b4870819969434da21d65a93427428ca5683c5fb4aa5b4f64d0c0dd9f9736752b2291b3990c
7
- data.tar.gz: 13c81b2beee62dec05099f673585af7cdce73cd96e9191e7083f3e55f50a5ee4d9c15ef4f58938305cc9d74726f4f7d17c301170cb0a2415f74ee4a0a28abd7e
6
+ metadata.gz: f2d8967f4ec47d49e4e829dfdf8aa8a087e576852fbdbe1343e1117f5397348ac40220bed5071715619a4395ea8bfc5521df58000d187e68eee69e021ddb23c5
7
+ data.tar.gz: f08b6882162c082006f4de9a3e105de5ffe9a2c55a53ffb9ec8c1659963c135c4657d7acf964df6a1e2bf521af6a2bfabbfbbde1e53d579f0620b418813eae9f
data/lib/vite_ruby.rb CHANGED
@@ -19,7 +19,7 @@ class ViteRuby
19
19
 
20
20
  # Internal: Versions used by default when running `vite install`.
21
21
  DEFAULT_VITE_VERSION = '^2.5.0-beta.2'
22
- DEFAULT_PLUGIN_VERSION = '^3.0.0-beta.1'
22
+ DEFAULT_PLUGIN_VERSION = '^3.0.0-beta.3'
23
23
 
24
24
  # Internal: Companion libraries for Vite Ruby, and their target framework.
25
25
  COMPANION_LIBRARIES = {
@@ -30,7 +30,7 @@ class ViteRuby::Config
30
30
 
31
31
  # Public: The directory where the entries are located.
32
32
  def resolved_entrypoints_dir
33
- root.join(source_code_dir, entrypoints_dir)
33
+ vite_root_dir.join(entrypoints_dir)
34
34
  end
35
35
 
36
36
  # Internal: The directory where Vite stores its processing cache.
@@ -38,6 +38,11 @@ class ViteRuby::Config
38
38
  root.join('node_modules/.vite')
39
39
  end
40
40
 
41
+ # Public: The directory that Vite uses as root.
42
+ def vite_root_dir
43
+ root.join(source_code_dir)
44
+ end
45
+
41
46
  # Public: Sets additional environment variables for vite-plugin-ruby.
42
47
  def to_env
43
48
  CONFIGURABLE_WITH_ENV.each_with_object({}) do |option, env|
@@ -52,13 +52,12 @@ private
52
52
  path = env['PATH_INFO']
53
53
  return true if path.start_with?(vite_asset_url_prefix) # Vite asset
54
54
  return true if path.start_with?(VITE_DEPENDENCY_PREFIX) # Packages and imports
55
- return true if vite_entrypoint?(path) # HMR for entrypoint stylesheets and imports does not include the prefix
55
+ return true if file_in_vite_root?(path) # Fallback if Vite can serve the file
56
56
  end
57
57
 
58
- # Internal: We want to avoid checking the filesystem if possible
59
- def vite_entrypoint?(path)
60
- path.include?('.') &&
61
- config.resolved_entrypoints_dir.join(path.start_with?('/') ? path[1..-1] : path).file?
58
+ def file_in_vite_root?(path)
59
+ path.include?('.') && # Check for extension, avoid filesystem if possible.
60
+ config.vite_root_dir.join(path.start_with?('/') ? path[1..-1] : path).file?
62
61
  end
63
62
 
64
63
  def vite_asset_url_prefix
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ViteRuby
4
- VERSION = '2.0.0.beta.2'
4
+ VERSION = '2.0.0.beta.3'
5
5
  end
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: 2.0.0.beta.2
4
+ version: 2.0.0.beta.3
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-08-11 00:00:00.000000000 Z
11
+ date: 2021-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli
@@ -198,8 +198,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
198
198
  licenses:
199
199
  - MIT
200
200
  metadata:
201
- source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@2.0.0.beta.2/vite_ruby
202
- changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@2.0.0.beta.2/vite_ruby/CHANGELOG.md
201
+ source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_ruby@2.0.0.beta.3/vite_ruby
202
+ changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_ruby@2.0.0.beta.3/vite_ruby/CHANGELOG.md
203
203
  post_install_message:
204
204
  rdoc_options: []
205
205
  require_paths: