Developing the gem
Contributors welcome!
The monorepo structure is used. To avoid confused IDEs, declare /gem and /js as modules when opening your IDE.
Testing by gems rspec
The gem has full test-coverage on the main-functionality, including Websocket and caching functionality.
Tests are written in Rspec.
A very minimal Rails application is booted via the Combustion gem. This allows the Puma web server to run independently as a standalone Rack server process, while still using the lightweight Combustion Rails app as its Rack application handler. No controller or view modules are loaded, keeping the setup as minimal and maintainable as possible.
JavaScript testing is done by playwright.
Testing by rails-app
If you want to apply your local changes to a custom rails-app, just download the repository, and link the gem:
# Gemfile:
gem "svelte-on-rails", path: "~/local/path/to/svelte-on-rails/gem"
# then run:
bundle install
you may need to run the installer, check the Installation steps
After every gem-code-change you need to restart the rails-app to have the changes applied.
and the npm-package:
// package.json:
"dependencies": {
"@csedl/svelte-on-rails": "~/local/path/to/svelte-on-rails/js",
}
// then run:
npm install
After every npm-package-code-change you need to run something like
rm -rf public/assets public/vite-dev public/svelte-ssr && rails assets:precompileAnd then refresh the page, to see the changes applied on the browser.