Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/andrzejsliwa/rails_components_template

Rails Application Template with Komponent.io and other opinionated decisions
https://github.com/andrzejsliwa/rails_components_template

application components rails rspec stimulusjs template

Last synced: 10 days ago
JSON representation

Rails Application Template with Komponent.io and other opinionated decisions

Awesome Lists containing this project

README

        

## Rails Application Template with Komponent.io and other opinionated decisions

```bash
$ rvm 2.5.0
$ gem install rails -v=5.2.0.rc1
$ git clone [email protected]:andrzejsliwa/rails_components_template.git ~/.rails_components_template
$ ln -s ~/.rails_components_template/.railsrc ~/.railsrc
$ rails new someapp
$ cd someapp
$ foreman start -f Procfile.dev
```

or apply it on existing application: (WARNING!: check duplicates from insertions)
```bash
$ cd someapp
$ bin/rails app:template LOCATION=~/.rails_components_template/template.rb
```
## Batteries included ;)

* removed sprockets and replaced it with webpacker
* moved app/script to frontend, and applied on it komponent.io with support for stimulus
* configured webpacker to point with source_path to frontend directory
* switched from include tag to pack tags
* moved turbolinks (with leaving gem for rails integration on redirecting), actioncable, rails-ujs to yarn
* prepended view path with frontend for komponents views
* configured komponent in application.rb and in controller
* added cable.js to frontend directory
* replaced sass with postcss
* added postcss-import, postcss-cssnext, postcss-nested (with support for BEM)
* added stylelint with configuration
* added normalize.css
* added foreman with default Procfile (for heroku) and Procfile.dev for development
* added custom user handling for postgres via ENV variable
* added support for .env via dotenv-rails
* allow webpack-dev-server host as allowed origin for connect-src in content_security_policy
* added browserlint with nice defaults
* replaced erb with slim for templates
* added task for conversion of erb -> slim (with html2slim gem)
* added rake hook for assets:precompile to handle yarn and webpacker compilation on heroku
* turn on gem for redis (action cable)
* added guard with extensions (migrations, rspec, rubocop, shell, spring)
* added guard configuration
* added pry with extensions (rescue, byebug)
* added factory_bot_rails as replacement for fixtures
* added faker for generating fake data in specs
* added & configured annotate (database structure annotations in models)
* added awesome_print for rails console
* replaced standard tests with rspec
* enabled support for system specs in rails_helper
* added missing generator for system spec
* added selenium-webdriver to drive system spec
* added oop-interface for real interfaces (with narrowing scope)
* added methods for making referencing methods in Ruby easy
* added airbrake & newrelic_rpm for error handling and monitoring
* added rake mutant tasks (configured in .mutant_subjects and .mutant_ignored_subjects)
* defined default rake task on spec & mutant
* added RAILS_EAGER_LOAD flag to detect NameErrors on CI and solve issue with mutant running
* configured overcommit