svelte-on-rails 9.0.0 → 9.1.0

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: c7247500d2d0c44d3c91cf1bfa5aec7861ec4306928fdfecbcc42e79fda5e63a
4
- data.tar.gz: 5668e8ec34a3d12fb794641fc763162aa11b1ba2611f4b6fd4145762f743e11e
3
+ metadata.gz: 148d58c862740c4a3c5d5715359df0450703f83128cf38ddb782dac35585709c
4
+ data.tar.gz: 615ec4cdeaf8024d762e332a875fda94ed51ac59336f2525578b67432c9858ec
5
5
  SHA512:
6
- metadata.gz: 806a37910e007388a2d89e10d370ca144e46180c78138d1eb7ee05852edec90fc43436f452c64d5901881eb77c1567c416406cff7ecb1e9102a4906a9ba56918
7
- data.tar.gz: d2f5c37db64f31f061cca10132a4c2b1e70773e3377cce4502a411bcf23afbafad7e98809e9e2f08a933375a721df48a96dabbd12fd3b869dc0fbb88f2b6e41c
6
+ metadata.gz: 32bea744a051827875dc6e9ed0668b5a527018c1dc2f291df4e020aa6e9b2efed40d4e1b41dfa53117131dffd9e12005d5c1f711c5cd89a6383f57dabdcaba7e
7
+ data.tar.gz: 0b870713e8adab22f8fb06d2a0a0786db941fdda4696018504ffeed9eb5f752d2b0a3d88078e257528ba6b94ecac0b8700ba4a2a88179230e6a4c7db3414e3e6
data/README.md CHANGED
@@ -15,7 +15,6 @@ See: [Comparitions on the guide](https://svelte-on-rails.dev/about/why.html)
15
15
 
16
16
  # Features
17
17
 
18
- - ✍️ Sophisticated error messages
19
18
  - 🚀 Cero-config deployment
20
19
  - 🤝 Fully integrated with `assets:precompile`
21
20
  - 😍 Contributor friendly
@@ -53,58 +52,22 @@ If you have issues, please open one, and contributors are welcome!
53
52
  - When `.nvmrc` is present on projects root, it is respected
54
53
  - If node is not included on the PATH you can configure your node path by environment variable `SVELTE_ON_RAILS_NODE_BIN`
55
54
 
56
- **PROPS ON RUBY <= 3**
55
+ **ARGS ON RUBY <= 3**
57
56
 
58
- On ruby <3 Arguments are misinterpreted, see [issue-10](https://gitlab.com/sedl/svelte-on-rails/-/issues/10)
57
+ On ruby <3 Arguments are less conciese interpreted, see [issue-10](https://gitlab.com/sedl/svelte-on-rails/-/issues/10)
59
58
 
60
59
 
61
- ## Installation on a existing app
60
+ ## Installation / Getting Started
62
61
 
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).
62
+ Please follow
64
63
 
65
- Required: `vite_rails` must be installed, it wants a `app/frontend` folder.
64
+ * [docs / Installation](https://svelte-on-rails.dev/installation/installer.html)
65
+ * [docs / Getting Started](https://svelte-on-rails.dev/installation/installer.html)
66
66
 
67
- Check Svelte Installation: [install svelte on rails](https://dev.to/chmich/setup-inertia-and-svelte-on-rails-7-3glk)
67
+ ## Contributors welcome!
68
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
- ```
90
-
91
- Add it to the view
92
-
93
- ```erb
94
- <%= svelte_component('HelloWorld', {title: 'Hello World'}) %>
95
- ```
96
-
97
- And you will see «Svelte Hello World» on the browser! 👍 🤗
98
-
99
- # Contributors welcome
100
-
101
- see [Guide / run your first test](https://svelte-on-rails.dev/first_test.html)
102
-
103
- # Special Thanks
104
-
105
- - [vite_ruby](https://github.com/ElMassimo/vite_ruby)
106
- - [react_on_rails](https://github.com/shakacode/react_on_rails)
69
+ * [Contributing Guide](https://svelte-on-rails.dev/contributing/first_test.html)
107
70
 
108
71
  ## Licence
109
72
 
110
- Copyright © 2025-2027 sedlmair.ch. Distributed by [MIT License](https://svelte-on-rails.dev/license.html)
73
+ Copyright © 2025-2027 sedlmair.ch. Distributed by [MIT License](https://svelte-on-rails.dev/contributing/license.html)
@@ -0,0 +1,21 @@
1
+ require "rails/generators"
2
+
3
+ module SvelteOnRails
4
+ module Generators
5
+ class UpdateGenerator < Rails::Generators::Base
6
+
7
+ def vite_config
8
+
9
+ puts '-' * 80
10
+ puts ' ▶︎▶︎▶︎ UPDATING SVELTE-ON-RAILS GEM'
11
+ puts '-' * 80
12
+
13
+ utils = SvelteOnRails::Installer::Utils
14
+ utils.write_templates(['config_base'], ask_for_overwrite: true, only: ['vite-ssr.config.ts'])
15
+
16
+ puts "Update vite.config.js"
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -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.0.0
4
+ version: 9.1.0
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