svelte-on-rails 1.0.4 → 1.0.6
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/svelte_on_rails/lib/utils.rb +3 -0
- data/lib/svelte_on_rails/renderer/renderer.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a080f0c8e8ee734a5dc38528123100e404b915c82cdb4b2a5d14f51e2e6df6d
|
4
|
+
data.tar.gz: b8dc0eef17027c855e0af5f4c161c4c60b0c60ad23b414b97f59939c044e0ecf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ac3c47a7866b909e8ad2be933386c78b1825d64b7b5ac7172b668c4e69d54022e1cdc1e8afacf9979e4210bd230eff2a36bce5deffb0fb42b3dbccbbb8b1cc9
|
7
|
+
data.tar.gz: c8d83d58b12a8e3bcebf406e91e56838c8f811014ab1456d73ed4f0822c0e74e43c92c0119203aa31fc388b5f890fc7a8b2539ddf8c5b896dc265e7f4fe31432
|
@@ -63,6 +63,9 @@ module SvelteOnRails
|
|
63
63
|
cmd = "./node_modules/.bin/vite build --config vite-ssr.config.ts"
|
64
64
|
puts `#{cmd}`
|
65
65
|
end
|
66
|
+
unless Dir.exist?(config.ssr_dist_folder)
|
67
|
+
raise "Could not find dist folder: #{config.ssr_dist_folder}"
|
68
|
+
end
|
66
69
|
if last_mtime
|
67
70
|
mtime_path = config.ssr_dist_folder.join('last_mtime')
|
68
71
|
File.write(mtime_path, last_mtime.to_s)
|
@@ -6,10 +6,11 @@ module SvelteOnRails
|
|
6
6
|
def initialize(compiled_file: nil, component_name: nil, base_path: SvelteOnRails::Configuration.instance.components_folder_full)
|
7
7
|
|
8
8
|
config = SvelteOnRails::Configuration.instance
|
9
|
-
if config.watch_changes?
|
9
|
+
if !Dir.exist?(config.ssr_dist_folder) || config.watch_changes?
|
10
10
|
SvelteOnRails::Lib::Utils.watch_changes_and_precompile
|
11
11
|
end
|
12
12
|
|
13
|
+
@component_name = component_name
|
13
14
|
@compiled_file = if compiled_file
|
14
15
|
compiled_file.sub(/\.svelte$/, '')
|
15
16
|
elsif component_name
|
@@ -38,7 +39,8 @@ module SvelteOnRails
|
|
38
39
|
stdout, stderr, status = Open3.capture3(cmd, stdin_data: props.to_json, chdir: utils.gem_app_dir)
|
39
40
|
|
40
41
|
unless status.to_s.match(/^pid [0-9]+ exit 0$/)
|
41
|
-
|
42
|
+
cmp = (@component_name ? "#{@component_name} could not be rendered\n\n" : nil)
|
43
|
+
raise "#{cmp}Error output from render.js (stderr) =>\n+++\n" + stderr + "+++\n\nRender Svelte Server-side =>\n#{cmd}\n\n"
|
42
44
|
end
|
43
45
|
|
44
46
|
begin
|