svelte-on-rails 9.0.0 → 9.1.1
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: e630de6ad00dc33b2fb616df6f5c5d7deef3e23c3ee0f05a1d50754a85cf165a
|
|
4
|
+
data.tar.gz: 43f856361a8c9323357914e610b3279b00ce8c086afc88c1f3dc1e1e5f452d9e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4584fb9c068a9a42907e9f10b1bd24da3726080b622975b654171bc53aa2719269b18cefdbc9b240d8149f0e05c53c1a86c3e0858ccb85edff109ff3f17130d4
|
|
7
|
+
data.tar.gz: 125febeda32e5400c83f5c10d86228d10300de05d4e705b2819268df7f747a0de4d763f048f1dad57d714c35d94167fcc1cff5639fbbfbd6c6bc22a7c1aef692
|
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.
|
|
@@ -15,7 +17,6 @@ See: [Comparitions on the guide](https://svelte-on-rails.dev/about/why.html)
|
|
|
15
17
|
|
|
16
18
|
# Features
|
|
17
19
|
|
|
18
|
-
- ✍️ Sophisticated error messages
|
|
19
20
|
- 🚀 Cero-config deployment
|
|
20
21
|
- 🤝 Fully integrated with `assets:precompile`
|
|
21
22
|
- 😍 Contributor friendly
|
|
@@ -53,58 +54,22 @@ If you have issues, please open one, and contributors are welcome!
|
|
|
53
54
|
- When `.nvmrc` is present on projects root, it is respected
|
|
54
55
|
- If node is not included on the PATH you can configure your node path by environment variable `SVELTE_ON_RAILS_NODE_BIN`
|
|
55
56
|
|
|
56
|
-
**
|
|
57
|
-
|
|
58
|
-
On ruby <3 Arguments are misinterpreted, see [issue-10](https://gitlab.com/sedl/svelte-on-rails/-/issues/10)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
## Installation on a existing app
|
|
62
|
-
|
|
63
|
-
=> To generate a two-minute, full-featured app, refer to the [guide/installer with options](https://svelte-on-rails.dev/installation/installer_options.html).
|
|
64
|
-
|
|
65
|
-
Required: `vite_rails` must be installed, it wants a `app/frontend` folder.
|
|
66
|
-
|
|
67
|
-
Check Svelte Installation: [install svelte on rails](https://dev.to/chmich/setup-inertia-and-svelte-on-rails-7-3glk)
|
|
68
|
-
|
|
69
|
-
Within the app, add the gem
|
|
70
|
-
|
|
71
|
-
```bash
|
|
72
|
-
bundle add svelte-on-rails
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
and run the installer without options
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
rails g svelte_on_rails:install
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Restart the server, add a hello world component `app/frontend/javascript/HelloWorld.svelte` like
|
|
82
|
-
|
|
83
|
-
```sveltehtml
|
|
84
|
-
<script>
|
|
85
|
-
export let title
|
|
86
|
-
</script>
|
|
87
|
-
|
|
88
|
-
<h1>Svelte {title}</h1>
|
|
89
|
-
```
|
|
57
|
+
**ARGS ON RUBY <= 3**
|
|
90
58
|
|
|
91
|
-
|
|
59
|
+
On ruby <3 Arguments are less conciese interpreted, see [issue-10](https://gitlab.com/sedl/svelte-on-rails/-/issues/10)
|
|
92
60
|
|
|
93
|
-
```erb
|
|
94
|
-
<%= svelte_component('HelloWorld', {title: 'Hello World'}) %>
|
|
95
|
-
```
|
|
96
61
|
|
|
97
|
-
|
|
62
|
+
## Installation / Getting Started
|
|
98
63
|
|
|
99
|
-
|
|
64
|
+
Please follow
|
|
100
65
|
|
|
101
|
-
|
|
66
|
+
* [docs / Installation](https://svelte-on-rails.dev/installation/installer.html)
|
|
67
|
+
* [docs / Getting Started](https://svelte-on-rails.dev/installation/installer.html)
|
|
102
68
|
|
|
103
|
-
|
|
69
|
+
## Contributors welcome!
|
|
104
70
|
|
|
105
|
-
|
|
106
|
-
- [react_on_rails](https://github.com/shakacode/react_on_rails)
|
|
71
|
+
* [Contributing Guide](https://svelte-on-rails.dev/contributing/first_test.html)
|
|
107
72
|
|
|
108
73
|
## Licence
|
|
109
74
|
|
|
110
|
-
Copyright © 2025-2027 sedlmair.ch. Distributed by [MIT License](https://svelte-on-rails.dev/license.html)
|
|
75
|
+
Copyright © 2025-2027 sedlmair.ch. Distributed by [MIT License](https://svelte-on-rails.dev/contributing/license.html)
|
|
@@ -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
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
require "rails/generators"
|
|
2
|
+
|
|
3
|
+
module SvelteOnRails
|
|
4
|
+
module Generators
|
|
5
|
+
class UpdateGenerator < Rails::Generators::Base
|
|
6
|
+
|
|
7
|
+
class_option :compile, type: :boolean, default: false, desc: "Compile Svelte assets only"
|
|
8
|
+
|
|
9
|
+
def initialize(*args)
|
|
10
|
+
|
|
11
|
+
super
|
|
12
|
+
|
|
13
|
+
puts
|
|
14
|
+
|
|
15
|
+
@option_choosed = options[:compile]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def updating
|
|
19
|
+
|
|
20
|
+
puts '-' * 80
|
|
21
|
+
puts ' ▶︎▶︎▶︎ UPDATING SVELTE-ON-RAILS GEM'
|
|
22
|
+
puts '-' * 80
|
|
23
|
+
|
|
24
|
+
i_utils = SvelteOnRails::Installer::Utils
|
|
25
|
+
utils = SvelteOnRails::Lib::Utils
|
|
26
|
+
|
|
27
|
+
!@option_choosed && i_utils.write_templates(['config_base'], ask_for_overwrite: true, only: ['vite-ssr.config.ts'])
|
|
28
|
+
|
|
29
|
+
puts '-' * 80
|
|
30
|
+
puts ' ▶︎▶︎▶︎ Updated svelte-on-rails gem, now precompiling svelte assets....'
|
|
31
|
+
puts '-' * 80
|
|
32
|
+
utils.precompile
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/svelte-on-rails.rb
CHANGED
|
@@ -22,6 +22,7 @@ require 'svelte_on_rails/installer/javascript'
|
|
|
22
22
|
require 'svelte_on_rails/installer/hello_world'
|
|
23
23
|
|
|
24
24
|
require 'generators/svelte_on_rails/install/install_generator'
|
|
25
|
+
require 'generators/svelte_on_rails/update/update_generator'
|
|
25
26
|
require 'generators/showcase_generator'
|
|
26
27
|
|
|
27
28
|
module SvelteOnRails
|
|
@@ -181,9 +181,14 @@ module SvelteOnRails
|
|
|
181
181
|
end
|
|
182
182
|
end
|
|
183
183
|
|
|
184
|
-
def self.write_templates(templates, ask_for_overwrite: true, app_root: nil, silent: false)
|
|
184
|
+
def self.write_templates(templates, ask_for_overwrite: true, app_root: nil, silent: false, only: [])
|
|
185
185
|
|
|
186
186
|
paths = template_paths(templates, app_root: app_root)
|
|
187
|
+
if only.any?
|
|
188
|
+
paths = paths.select do |path|
|
|
189
|
+
only.any? { |pattern| path.include?(pattern) }
|
|
190
|
+
end
|
|
191
|
+
end
|
|
187
192
|
|
|
188
193
|
existing = paths.dup.select { |p| File.exist?(p[2]) }
|
|
189
194
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: svelte-on-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 9.
|
|
4
|
+
version: 9.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christian Sedlmair
|
|
@@ -31,6 +31,7 @@ files:
|
|
|
31
31
|
- README.md
|
|
32
32
|
- lib/generators/showcase_generator.rb
|
|
33
33
|
- lib/generators/svelte_on_rails/install/install_generator.rb
|
|
34
|
+
- lib/generators/svelte_on_rails/update/update_generator.rb
|
|
34
35
|
- lib/svelte-on-rails.rb
|
|
35
36
|
- lib/svelte_on_rails/action_cable.rb
|
|
36
37
|
- lib/svelte_on_rails/active_record_extensions.rb
|