svelte-on-rails 9.1.0 → 9.1.2
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: 882a0c3debc51bbee5427a0018a11824d81858cc1520757f08291ac61688ee11
|
|
4
|
+
data.tar.gz: 2b0f1c6e42d88f0c0493638f6702bc6380d16b50ae1fd62e01fcdf436e7de795
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 361cde3cd2fa88777bdbfa4a904a5fa3424d01af094ace0610c512c17f78cd45a407c28a2cefe501419923905046464bc0222e26d34f342b132d0d5ac0d9aea2
|
|
7
|
+
data.tar.gz: ce4d0f017de39c488051a6c33750238a048b197858e657a4d6d5dfb9b0edf7cf733f6976f40745e475fdfaba54cb83fc5cd6df435588cbdc17ac598a650a17cf
|
data/README.md
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
Realizing [DHH's vision](https://rubyonrails.org/2021/12/15/Rails-7-fulfilling-a-vision) with modern front-end technologies.
|
|
9
9
|
|
|
10
|
+
`svelte-on-rails` does not yet have many downloads on RubyGems. However, as it is integrated into the apps of my biggest customers, it will certainly be maintained.
|
|
11
|
+
|
|
10
12
|
# Why Integrate Svelte?
|
|
11
13
|
|
|
12
14
|
Svelte offers the simplest and most elegant soulution to building reactive, high-performance front-end components.
|
|
@@ -4,11 +4,7 @@ module SvelteOnRails
|
|
|
4
4
|
module Generators
|
|
5
5
|
class InstallGenerator < Rails::Generators::Base
|
|
6
6
|
|
|
7
|
-
class_option :full, type: :boolean, default: false, desc: "Run full installation with additional setup"
|
|
8
7
|
class_option :force, type: :boolean, default: false, desc: "Do not ask for overwriting files"
|
|
9
|
-
class_option :turbo, type: :boolean, default: false, desc: "Use @hotwired/turbo-rails"
|
|
10
|
-
class_option :turbo_streams, type: :boolean, default: false, desc: "Turbo::StreamsChannel"
|
|
11
|
-
class_option :hello_world, type: :boolean, default: false, desc: "Create Hello World component"
|
|
12
8
|
|
|
13
9
|
require 'svelte_on_rails/installer/utils'
|
|
14
10
|
require 'svelte_on_rails/installer/haml'
|
|
@@ -76,9 +72,6 @@ module SvelteOnRails
|
|
|
76
72
|
raise Thor::Error, "Unknown options: #{unknown_options.join(', ')}. Valid options are: #{valid_display}\nNothing done."
|
|
77
73
|
end
|
|
78
74
|
|
|
79
|
-
if options[:turbo_streams] && !(options[:full] || options[:turbo])
|
|
80
|
-
raise Thor::Error, "--turbo-streams option cannot be used without --turbo"
|
|
81
|
-
end
|
|
82
75
|
end
|
|
83
76
|
|
|
84
77
|
def application_js_path
|
|
@@ -4,16 +4,27 @@ module SvelteOnRails
|
|
|
4
4
|
module Generators
|
|
5
5
|
class UpdateGenerator < Rails::Generators::Base
|
|
6
6
|
|
|
7
|
-
def
|
|
7
|
+
def initialize(*args)
|
|
8
|
+
|
|
9
|
+
super
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def updating
|
|
8
13
|
|
|
9
14
|
puts '-' * 80
|
|
10
15
|
puts ' ▶︎▶︎▶︎ UPDATING SVELTE-ON-RAILS GEM'
|
|
11
16
|
puts '-' * 80
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
utils
|
|
18
|
+
i_utils = SvelteOnRails::Installer::Utils
|
|
19
|
+
utils = SvelteOnRails::Lib::Utils
|
|
20
|
+
|
|
21
|
+
i_utils.write_templates(['config_base'], ask_for_overwrite: true, only: ['vite-ssr.config.ts'])
|
|
22
|
+
|
|
23
|
+
puts '-' * 80
|
|
24
|
+
puts ' ▶︎▶︎▶︎ Updated svelte-on-rails gem, now precompiling svelte assets....'
|
|
25
|
+
puts '-' * 80
|
|
26
|
+
utils.precompile
|
|
15
27
|
|
|
16
|
-
puts "Update vite.config.js"
|
|
17
28
|
end
|
|
18
29
|
|
|
19
30
|
end
|
|
@@ -89,8 +89,14 @@ export default defineConfig(({ mode }) => {
|
|
|
89
89
|
compilerOptions: {
|
|
90
90
|
// Enable runes mode for Svelte 5+ (explicit reactivity, signals)
|
|
91
91
|
runes: true,
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
warningFilter: (warning) => {
|
|
93
|
+
const suppressed = [
|
|
94
|
+
// 'a11y_click_events_have_key_events',
|
|
95
|
+
// 'a11y_no_static_element_interactions',
|
|
96
|
+
// https://svelte.dev/docs/svelte/compiler-warnings
|
|
97
|
+
];
|
|
98
|
+
return !suppressed.includes(warning.code);
|
|
99
|
+
}
|
|
94
100
|
},
|
|
95
101
|
}),
|
|
96
102
|
{
|