svelte-on-rails 11.0.6 → 11.0.7
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e04a25d3bcc9557f181a14529761a7fa0c5e9b6bd6d68a89680a660495822a58
|
|
4
|
+
data.tar.gz: bdfa056a4b6d06bad4f24271c8da88fcf011c5c653b1453ef9d3b54f7008653b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c23b04fdc8c6a5ff0852d2c20ef128c2766a034c73107ac554e14cc149dcd2808d62645c6c2f0e7596b4deac9faebc125ddcae12713539e4747c18780c60d5e
|
|
7
|
+
data.tar.gz: b7257de3179f1afca8e48aeb50d10cbff5ed960685e291f3adb040ca2f8b929e582770400bdbcb0e8ad4b70e9c325ea4cccece386b1410db0320f07569d95fe1
|
|
@@ -30,6 +30,8 @@ module SvelteOnRails
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def fingerprint(component_path)
|
|
33
|
+
# We do not cache this as this function is only for development.
|
|
34
|
+
# Therefore, it is fast enough.
|
|
33
35
|
build_fingerprint(component_path)
|
|
34
36
|
end
|
|
35
37
|
|
|
@@ -37,12 +39,12 @@ module SvelteOnRails
|
|
|
37
39
|
|
|
38
40
|
# ensure we have a current manifest loaded
|
|
39
41
|
|
|
40
|
-
if watch_changes? && File.mtime(manifest_json_path) != @manifest_mtime
|
|
42
|
+
if watch_changes? && File.mtime(manifest_json_path).to_f.round(3) != @manifest_mtime
|
|
41
43
|
@manifest = {}
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
if !@manifest.present?
|
|
45
|
-
@manifest_mtime = File.mtime(manifest_json_path)
|
|
47
|
+
@manifest_mtime = File.mtime(manifest_json_path).to_f.round(3)
|
|
46
48
|
@manifest = JSON.parse(File.read(manifest_json_path))
|
|
47
49
|
else
|
|
48
50
|
@manifest
|
|
@@ -53,14 +55,20 @@ module SvelteOnRails
|
|
|
53
55
|
private
|
|
54
56
|
|
|
55
57
|
def last_build
|
|
56
|
-
if watch_changes? && !@last_build.present?
|
|
57
|
-
|
|
58
|
+
if watch_changes? && (!@last_build.present? || @last_build != File.mtime(manifest_json_path).to_f.round(3))
|
|
59
|
+
if File.exist?(manifest_json_path)
|
|
60
|
+
# we assume the developer has run a build manually
|
|
61
|
+
else
|
|
58
62
|
raise "File not found: #{manifest_json_path}"
|
|
59
63
|
end
|
|
64
|
+
@manifest = {}
|
|
65
|
+
@component_files = {}
|
|
66
|
+
@dev_modules_map = {}
|
|
67
|
+
|
|
60
68
|
@last_build = (File.mtime(manifest_json_path).to_f.round(3) - 1.0)
|
|
61
|
-
else
|
|
62
|
-
@last_build
|
|
63
69
|
end
|
|
70
|
+
|
|
71
|
+
@last_build
|
|
64
72
|
end
|
|
65
73
|
|
|
66
74
|
def fetch_source_files(component, files = [])
|
|
@@ -11,6 +11,14 @@ module SvelteOnRails
|
|
|
11
11
|
cnf = SvelteOnRails::Configuration.instance
|
|
12
12
|
manifest = cnf.manifest[component_path]
|
|
13
13
|
|
|
14
|
+
if manifest.nil? && cnf.watch_changes?
|
|
15
|
+
cnf.vite_build
|
|
16
|
+
manifest = cnf.manifest[component_path]
|
|
17
|
+
end
|
|
18
|
+
if manifest.nil?
|
|
19
|
+
raise "[svelte-on-rails] ERROR: No manifest found for component: «#{component_path}»\nAvailable keys in current manifest.json are:\n\n+++\n • #{cnf.manifest.keys.join("\n • ")}\n+++\n."
|
|
20
|
+
end
|
|
21
|
+
|
|
14
22
|
cmd = [
|
|
15
23
|
cnf.node_bin_path,
|
|
16
24
|
cnf.rails_root.join('node_modules/@csedl/svelte-on-rails/src/ssr/render.js'),
|