svelte-on-rails 0.0.34 → 0.0.35

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: 3fdbb3868bbac50f65971957df0748db4c578fc317bab77065e64155b5d9c2d9
4
- data.tar.gz: b30194ddee3daf2742d1d21e3d63ca835ff60123f6514dade9c5b6d930e0bc82
3
+ metadata.gz: 3b3b3a20bdc53e8344c4e03d88ace00eb01e7c9f9b05545ea626af2a6131ef45
4
+ data.tar.gz: ccc007c3e60640ad5707b9361d73ffd7967a9af439a86be6ad358d5024fcd76c
5
5
  SHA512:
6
- metadata.gz: dbf57486fba0f80bb50077243d7781b3d4ea3e21adf8c98dd54a6df7e71c416db846072e515c85296652db815d8b0423c528491ec5560edd998bdd614d28ad76
7
- data.tar.gz: 9db84e5d1ad4f60cc0a9bb1e5c69c81f40a1c2466fc67f4f27faa8a53148f66f2cfe5636884960573db1e8f99d8d4e8223fe3534f1083d0297732970b4172df1
6
+ metadata.gz: f3ff1581778782262c1798b73aed2fabff57a9f29b9d473fe80c40d4d440005e6aea26d9b1b118ed2a4f2cb61b833a2c26ebc188c736d034d776ba32fbe13cca
7
+ data.tar.gz: 33a3971a817cc494dc8245bad803c008a30ca01026e04d2391619cab50f53184b7de8945ab98ade59895eaffd1750b57d3140825207787dfdb915a6849359e34
data/README.md CHANGED
@@ -259,51 +259,30 @@ Example from the rails console for a medium complex component
259
259
 
260
260
  ## Testing
261
261
 
262
- Testings are within the gem by `rspec`. Mainly there are 2 types of tests:
263
-
264
- **compiler tests**
265
-
266
- The folder `spec/rails_vite_test_app` holds a package.json
267
- with the `@csedl/svelte-on-rails` package, mainly because of the
268
- peer dependencies necessary for ssr tests, and some example components.
269
- This is mainly for testing the compiler.
270
-
271
- **Fully complete tests**
272
-
273
- The folder `spec/installer_tests`, mainly, is emptied
274
- before test. Tests there are starting by `rails new` followed
275
- by running the installer.
276
-
262
+ Tests are based on the included templates, like the `hello world template` and on the installer.
263
+
264
+ That means, basically, when you run a test, it creates a new rails app and runs the installer.
265
+ The destination folder is defined by the file `generated_test_app_path` within the gems root folder.
266
+ The string there must represent a full path to a existing folder.
267
+
268
+ When you want to develop the components, the workflow is:
269
+
270
+ - run a component test
271
+ - the first run is slow because the installer must build the app
272
+ - the second run is fast because the app is already built
273
+ - open the browser by localhost:3000
274
+ - change the component
275
+ - run the component test again
276
+ - see the changes in the browser
277
+
277
278
  NOTE: Theese tests are dependend on your environment, including the running ruby version!
278
- I am woring on `rvm` If you work on a different environment, tests may have to be adopted.
279
+ I am working on rvm. If you work on a different environment, some (not many) changes may be necessary.
280
+ Thats your part :)
279
281
 
280
282
  The current test cases including (among others):
281
283
 
282
- - create a completely new rails app, running the full installer and check if a `hello World` component is visible and javascript is working.
283
- - run `assets:precompile` within a rails app and check if the gem does its precompiling too.
284
-
285
- Development helpers:
286
-
287
- ```bash
288
- rake svelte_on_rails:create_test_app
289
- ```
290
-
291
- This creates a new rails app within `spec/installer_tests` and runs the installer with `--full`.
292
- On the last line it shows you the path to the test app.
293
- Now you can cd into this folder and run `rails s`.
294
-
295
- ```bash
296
- rake svelte_on_rails:replace_test_app_hello_world
297
- ```
298
-
299
- Overwrites the hello world files within this test app from template.
300
-
301
- As a rule of thumb, for **component tests**, before each test, templates are copied onto the tests-app, and be tested by playwright and the rails server should remain running at the end of each component test.
302
- On that way the templates easily can be developped and tested, the end user has maximum function stability and the developer always see the latest changes.
303
-
304
- Idea is to have all working examples within the template and included in the testing scope as in the hello world component.
305
-
306
- ... for having a 100% WYSIWYG and a easy maintainable package so that contributors are motivated to come into my project.
284
+ create a completely new rails app, running the full installer and check if a hello World component is visible and javascript is working.
285
+ run assets:precompile within a rails app and check if the gem does its precompiling too.
307
286
 
308
287
  ## Licence
309
288
 
@@ -37,14 +37,4 @@ module SvelteOnRails
37
37
  puts "Error running create_test_app task: #{e.message}"
38
38
  end
39
39
 
40
- def self.run_replace_hello_world_task
41
- # Ensure Rake tasks are loaded
42
- Rake::Task.define_task(:environment) # Define a dummy environment task (if needed)
43
- load File.expand_path('../rakefile', __FILE__) # Load the gem's Rakefile
44
-
45
- # Invoke the task
46
- Rake::Task['svelte_on_rails:replace_test_app_hello_world'].invoke
47
- rescue StandardError => e
48
- puts "Error running replace_test_app_hello_world task: #{e.message}"
49
- end
50
40
  end
@@ -72,33 +72,4 @@ namespace :svelte_on_rails do
72
72
  SvelteOnRails::Compiler.reset_and_compile_all
73
73
  end
74
74
 
75
- desc "Build test app within spec/installer_tests"
76
- task :create_test_app do
77
- TestHelpers.cleanup_rails_app
78
- TestHelpers.create_rails_app
79
- TestHelpers.gem_setup("rails g svelte_on_rails:install --full")
80
- puts '-'*80
81
- puts "Built test app successfully!"
82
- puts "You can now run the server by:"
83
- puts "$ cd #{TestHelpers.installer_test_app_path} && rails s"
84
- end
85
-
86
- desc "Build test app within spec/installer_tests"
87
- task :replace_test_app_hello_world do
88
- #require_relative '../../lib/svelte_on_rails/lib/utils'
89
- require_relative '../../spec/test_helpers'
90
- th = TestHelpers
91
- puts '-'*80
92
- hw_i = SvelteOnRails::Installer::HelloWorld
93
- #utils = SvelteOnRails::Lib::Utils
94
- @hello_world_path = hw_i.install_hello_world(
95
- SvelteOnRails::Generators::InstallGenerator::HELLO_WORLD_FILES,
96
- app_root: th.installer_test_app_path,
97
- force: true,
98
- )
99
-
100
- puts '-'*80
101
- puts "replaced Hello World component with new one"
102
- end
103
-
104
75
  end
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: 0.0.34
4
+ version: 0.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Sedlmair