opal-vite-rails 0.2.13 → 0.3.13
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/lib/opal/vite/rails/engine.rb +0 -4
- data/lib/opal/vite/rails/helper.rb +9 -1
- data/lib/opal/vite/rails/manifest.rb +5 -1
- data/lib/opal/vite/rails/version.rb +1 -1
- data/lib/opal-vite-rails.rb +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb4b027bd6a9af93d8ca80700e7fcadb26251b792e3b0df8f43f72492d680717
|
|
4
|
+
data.tar.gz: 509ab21889bf6c849f0775c051ac6ae98474977fd37fb6251a71d47fce2894f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c598f18eba197fc1cd9c94f6a21c40997cf05dd4626e6f23f29a5de6d28022891784d7a492e668c0f7542d75a0600c19f09999d6eeb5ec2884e40ce70c0c18be
|
|
7
|
+
data.tar.gz: c4eaef2d98bdf29e2c7d09310cac16a72e37c655f1d8e35605e68e190c788710b2975fb709290454a0dce68fade9199cf1ae52350bf8dbb539e4b4dd3dc3f7eb
|
|
@@ -18,10 +18,6 @@ module Opal
|
|
|
18
18
|
Opal::Vite::Rails.config.public_output_path = app.config.opal_vite.public_output_path
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
# Set manifest path from ViteRails
|
|
22
|
-
if defined?(ViteRuby)
|
|
23
|
-
Opal::Vite::Rails.config.manifest_path = ViteRuby.manifest_path
|
|
24
|
-
end
|
|
25
21
|
end
|
|
26
22
|
|
|
27
23
|
initializer "opal_vite.view_helpers" do
|
|
@@ -33,9 +33,17 @@ module Opal
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
# Get asset path from Vite manifest
|
|
36
|
+
#
|
|
37
|
+
# NOTE: the manifest lives on the ViteRuby *instance* — `ViteRuby.manifest`
|
|
38
|
+
# is not a class-level delegator (it raises NoMethodError), so we go
|
|
39
|
+
# through `ViteRuby.instance`. Use ViteRuby::Manifest#path_for (public)
|
|
40
|
+
# rather than #lookup: #lookup is *protected* and returns the raw manifest
|
|
41
|
+
# entry Hash ({ "file" => "..." }), so `lookup(name).to_s` would emit the
|
|
42
|
+
# Hash's inspect string instead of a URL. #path_for returns the resolved
|
|
43
|
+
# asset URL string.
|
|
36
44
|
def opal_asset_path(name)
|
|
37
45
|
if defined?(ViteRuby)
|
|
38
|
-
ViteRuby.manifest.
|
|
46
|
+
ViteRuby.instance.manifest.path_for(name)
|
|
39
47
|
else
|
|
40
48
|
# Fallback to standard asset path
|
|
41
49
|
"/#{Opal::Vite::Rails.config.public_output_path}/#{name}"
|
|
@@ -39,7 +39,11 @@ module Opal
|
|
|
39
39
|
private
|
|
40
40
|
|
|
41
41
|
def default_manifest_path
|
|
42
|
-
if defined?(::
|
|
42
|
+
if defined?(::ViteRuby) && ::ViteRuby.instance.config.respond_to?(:manifest_paths)
|
|
43
|
+
vite_config = ::ViteRuby.instance.config
|
|
44
|
+
vite_config.manifest_paths.first ||
|
|
45
|
+
vite_config.build_output_dir.join('.vite', 'manifest.json')
|
|
46
|
+
elsif defined?(::Rails)
|
|
43
47
|
::Rails.public_path.join('vite', 'manifest.json')
|
|
44
48
|
else
|
|
45
49
|
'public/vite/manifest.json'
|
data/lib/opal-vite-rails.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opal-vite-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.13
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- stofu1234
|
|
@@ -15,14 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: '0.3'
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
25
|
+
version: '0.3'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: ostruct
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0.2'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0.2'
|
|
26
40
|
- !ruby/object:Gem::Dependency
|
|
27
41
|
name: railties
|
|
28
42
|
requirement: !ruby/object:Gem::Requirement
|