svelte-on-rails 7.1.2 → 7.1.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 +4 -4
- data/README.md +3 -3
- data/lib/svelte_on_rails/renderer/renderer.rb +19 -23
- 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: 970ffe37f898ba6c9f0b9069ae2116c5519f79c37d657e41e395b702a17e3863
|
4
|
+
data.tar.gz: 2268e86265ba09a36a0c3513263985e670eae3ff06261b7799211161489bbac2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 668fc5b19bae1d1da87d864a081e6c5a7eb201f0f5b3df775c754d4c03ebc6c56b5eff69019d9508e9fedf47b399c1ae77c0eef4bbe3cc159fe0822afa2cfc7f
|
7
|
+
data.tar.gz: 736e4de6627a22755057fc5909ce87f642be1c80cac55bf6d74a461d3b02b23065935951779f989abcd9264dd6602df0f6bcfabb8746e30cafae9ce950c70d48
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Realizing [DHH's vision](https://rubyonrails.org/2021/12/15/Rails-7-fulfilling-a
|
|
11
11
|
|
12
12
|
Svelte offers the simplest and most elegant soulution to building reactive, high-performance front-end components.
|
13
13
|
|
14
|
-
See: [Comparitions on the guide](https://svelte-on-rails
|
14
|
+
See: [Comparitions on the guide](https://svelte-on-rails.dev/about/why.html)
|
15
15
|
|
16
16
|
# Features
|
17
17
|
|
@@ -93,9 +93,9 @@ And you will see "Svelte Hello World" on the browser! 👍 🤗
|
|
93
93
|
|
94
94
|
# Contributors welcome
|
95
95
|
|
96
|
-
see [Guide / run your first test](https://svelte-on-rails
|
96
|
+
see [Guide / run your first test](https://svelte-on-rails.dev/first_test.html)
|
97
97
|
|
98
98
|
|
99
99
|
## Licence
|
100
100
|
|
101
|
-
Copyright © 2025-2028 sedlmair.ch. Distributed by [MIT License](https://svelte-on-rails
|
101
|
+
Copyright © 2025-2028 sedlmair.ch. Distributed by [MIT License](https://svelte-on-rails.dev/license.html)
|
@@ -31,36 +31,32 @@ module SvelteOnRails
|
|
31
31
|
cnf.rails_root
|
32
32
|
].join(' ')
|
33
33
|
|
34
|
-
|
35
|
-
stdout, stderr, status = Open3.capture3(cmd, stdin_data: props.to_json)
|
34
|
+
stdout, stderr, status = Open3.capture3(cmd, stdin_data: props.to_json, chdir: cnf.rails_root)
|
36
35
|
|
37
|
-
|
36
|
+
ary = stdout.split('[svelte-on-rails:successful-json-response]')
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
begin
|
38
|
+
unless ary.length == 2
|
39
|
+
raise "[svelte-on-rails] render ERROR for component: #{@component_files[:svelte_filename]}\n\ncommand:\n+++\n#{cmd}\n+++\n\nstdout:\n+++\n#{stdout}+++\n\n\nstderr:\n+++\n#{stderr}+++"
|
40
|
+
end
|
45
41
|
|
42
|
+
begin
|
46
43
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
44
|
+
res = JSON.parse(ary[1])
|
45
|
+
css_file = @component_files[:compiled_file] + '.css'
|
46
|
+
if File.exist?(css_file)
|
47
|
+
res['css'] = File.read(css_file)
|
48
|
+
end
|
52
49
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
50
|
+
unless status.to_s.match(/^pid [0-9]+ exit 0$/)
|
51
|
+
cmp = "#{@component_files[:svelte_filename]} was returned «#{status.to_s}»\n\n"
|
52
|
+
msg = "#{cmp}output from render.js (stderr) =>\n+++\n" + stderr + "+++\n\nRender Svelte Server-side =>\n#{cmd}\n\n"
|
53
|
+
utils.puts_warning(msg)
|
54
|
+
end
|
58
55
|
|
59
|
-
|
60
|
-
rescue JSON::ParserError => e
|
56
|
+
return res
|
61
57
|
|
62
|
-
|
63
|
-
|
58
|
+
rescue => e
|
59
|
+
raise "MY_ERR => #{e}\n\n+++\n#{e.backtrace.join("\n")}\n+++"
|
64
60
|
end
|
65
61
|
end
|
66
62
|
|