Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates #532

Merged
merged 1 commit into from
Jun 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 25 additions & 63 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,81 +5,43 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.2.2'

# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem 'rails', '7.0.5'

# Use postgresql as the database for Active Record
gem 'bootsnap', require: false
gem 'newrelic_rpm', '~> 9.2'
gem 'pg', '~> 1.5'

# Use the Puma web server [https://github.com/puma/puma]
gem 'puma', '~> 6.3'

# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem 'jbuilder'

# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"

# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', require: false

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"

# Transpile app-like JavaScript. Read more: https://github.com/shakacode/shakapacker
gem 'shakapacker', '6.6.0'

# Turbo makes navigating your web application faster. Read more: https://github.com/hotwired/turbo-rails
gem 'turbo-rails', '~> 1.4'

# Template Engine
gem 'rails', '7.0.5'
gem 'shakapacker', '7.0.0'
gem 'slim-rails', '~> 3.6'

# App monitoring
gem 'newrelic_rpm', '~> 9.2'
gem 'turbo-rails', '~> 1.4'
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]

group :development, :test do
gem 'byebug', '~> 11.1', platforms: %i[mri mingw x64_mingw]
gem 'factory_bot_rails', '~> 6.2'
gem 'faker', '~> 3.2'
gem 'pry', '~> 0.14.2'
gem 'pry-byebug', '~> 3.10'
gem 'pry-rails', '~> 0.3.9'
gem 'rspec-rails', '~> 6.0'
gem 'rubocop', '~> 1.52', require: false
gem 'rubocop-performance', '~> 1.18', require: false
gem 'rubocop-rails', '~> 2.20', require: false
gem 'rubocop-rspec', '~> 2.22', require: false
gem 'slim_lint', '~> 0.24.0', require: false
gem 'byebug', platforms: %i[mri mingw x64_mingw]
gem 'factory_bot_rails'
gem 'faker'
gem 'pry'
gem 'pry-byebug'
gem 'pry-rails'
gem 'rspec-rails'
gem 'rubocop', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
gem 'slim_lint', require: false
end

group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
gem 'rack-mini-profiler'
gem 'web-console'

# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
# gem "rack-mini-profiler"

# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end

group :test do
gem 'capybara', '~> 3.39'
gem 'email_spec', '~> 2.2'
gem 'selenium-webdriver', '~> 4.10'
gem 'simplecov', '~> 0.22.0', require: false
gem 'simplecov-lcov', '~> 0.8.0', require: false
gem 'webmock', '~> 3.18', require: false
gem 'capybara'
gem 'email_spec'
gem 'selenium-webdriver'
gem 'simplecov', require: false
gem 'simplecov-lcov', require: false
gem 'webmock', require: false
end

group :production do
Expand Down
49 changes: 27 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ GEM
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.6.3)
language_server-protocol (3.17.0.3)
launchy (2.5.2)
addressable (~> 2.8)
loofah (2.21.3)
Expand Down Expand Up @@ -159,6 +160,8 @@ GEM
nio4r (~> 2.0)
racc (1.7.1)
rack (2.2.7)
rack-mini-profiler (3.1.0)
rack (>= 1.2.0)
rack-proxy (0.7.6)
rack
rack-test (2.1.0)
Expand Down Expand Up @@ -212,8 +215,9 @@ GEM
rspec-mocks (~> 3.12)
rspec-support (~> 3.12)
rspec-support (3.12.0)
rubocop (1.52.1)
rubocop (1.53.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
rainbow (>= 2.2.2, < 4.0)
Expand Down Expand Up @@ -246,7 +250,7 @@ GEM
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
shakapacker (6.6.0)
shakapacker (7.0.0)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
Expand All @@ -271,7 +275,7 @@ GEM
temple (0.10.2)
thor (1.2.2)
tilt (2.2.0)
timeout (0.3.2)
timeout (0.4.0)
turbo-rails (1.4.0)
actionpack (>= 6.0.0)
activejob (>= 6.0.0)
Expand Down Expand Up @@ -301,34 +305,35 @@ PLATFORMS

DEPENDENCIES
bootsnap
byebug (~> 11.1)
capybara (~> 3.39)
email_spec (~> 2.2)
factory_bot_rails (~> 6.2)
faker (~> 3.2)
byebug
capybara
email_spec
factory_bot_rails
faker
newrelic_rpm (~> 9.2)
pg (~> 1.5)
pry (~> 0.14.2)
pry-byebug (~> 3.10)
pry-rails (~> 0.3.9)
pry
pry-byebug
pry-rails
puma (~> 6.3)
rack-mini-profiler
rack-timeout (~> 0.6.3)
rails (= 7.0.5)
rspec-rails (~> 6.0)
rubocop (~> 1.52)
rubocop-performance (~> 1.18)
rubocop-rails (~> 2.20)
rubocop-rspec (~> 2.22)
selenium-webdriver (~> 4.10)
shakapacker (= 6.6.0)
simplecov (~> 0.22.0)
simplecov-lcov (~> 0.8.0)
rspec-rails
rubocop
rubocop-performance
rubocop-rails
rubocop-rspec
selenium-webdriver
shakapacker (= 7.0.0)
simplecov
simplecov-lcov
slim-rails (~> 3.6)
slim_lint (~> 0.24.0)
slim_lint
turbo-rails (~> 1.4)
tzinfo-data
web-console
webmock (~> 3.18)
webmock

RUBY VERSION
ruby 3.2.2p53
Expand Down
2 changes: 1 addition & 1 deletion Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
web: bundle exec bin/rails server -p 3000
webpacker: bundle exec bin/webpacker-dev-server
shakapacker: bundle exec bin/shakapacker-dev-server
67 changes: 34 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,40 @@

This is an opinionated starter web application based on the following technology stack:

* [Ruby 3.2.2][1]
* [Rails 7.0.5][2]
* [Webpack 5][15]
* [Yarn][16]
* [Puma][3]
* [PostgreSQL][4]
* [Redis][18]
* [RSpec][5]
* [Bootstrap 5.3.0][8]
* [Autoprefixer][9]
* [Font Awesome 6.4.0 SVG][10]
* [Slim][11]
* [RuboCop][12]
* [RuboCop RSpec][17]
* [Slim-Lint][13]
* [stylelint][14]

[1]: https://www.ruby-lang.org/en/
[2]: https://rubyonrails.org/
[3]: https://puma.io/
[4]: https://www.postgresql.org/
[5]: https://rspec.info/
[8]: https://getbootstrap.com/
[9]: https://github.com/postcss/autoprefixer
[10]: https://fontawesome.com/
[11]: http://slim-lang.com/
[12]: https://github.com/bbatsov/rubocop
[13]: https://github.com/sds/slim-lint
[14]: https://stylelint.io/
[15]: https://webpack.js.org/
[16]: https://yarnpkg.com/lang/en/
[17]: https://github.com/backus/rubocop-rspec
[18]: https://redis.io/
* [Ruby 3.2.2][:ruby-url]
* [Rails 7.0.5][:ruby-on-rails-url]
* [Webpack 5][:webpack-url] (via [Shakapacker][:shakapacker-url])
* [Yarn][:yarn-url]
* [Puma][:puma-url]
* [PostgreSQL][:postgresql-url]
* [Redis][:redis-url]
* [RSpec][:rspec-url]
* [Bootstrap 5.3.0][:bootstrap-url]
* [Autoprefixer][:autoprefixer-url]
* [Font Awesome 6.4.0 SVG][:fontawesome-url]
* [Slim][:slim-url]
* [RuboCop][:rubocop-url]
* [RuboCop RSpec][:rubocop-rspec-url]
* [Slim-Lint][:slim-lint-url]
* [stylelint][:stylelint-url]

[:autoprefixer-url]: https://github.com/postcss/autoprefixer
[:bootstrap-url]: https://getbootstrap.com/
[:fontawesome-url]: https://fontawesome.com/
[:postgresql-url]: https://www.postgresql.org/
[:puma-url]: https://puma.io/
[:redis-url]: https://redis.io/
[:rspec-url]: https://rspec.info/
[:rubocop-rspec-url]: https://github.com/backus/rubocop-rspec
[:rubocop-url]: https://github.com/bbatsov/rubocop
[:ruby-on-rails-url]: https://rubyonrails.org/
[:ruby-url]: https://www.ruby-lang.org/en/
[:shakapacker-url]: https://github.com/shakacode/shakapacker
[:slim-lint-url]: https://github.com/sds/slim-lint
[:slim-url]: http://slim-lang.com/
[:stylelint-url]: https://stylelint.io/
[:webpack-url]: https://webpack.js.org/
[:yarn-url]: https://yarnpkg.com/lang/en/

Starter App is deployable on [Heroku](https://www.heroku.com/). Demo: https://ruby3-rails7-bootstrap-heroku.herokuapp.com/

Expand Down
6 changes: 3 additions & 3 deletions bin/webpacker → bin/shakapacker
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ENV["RAILS_ENV"] ||= "development"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)

require "bundler/setup"
require "webpacker"
require "webpacker/webpack_runner"
require "shakapacker"
require "shakapacker/webpack_runner"

APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::WebpackRunner.run(ARGV)
Shakapacker::WebpackRunner.run(ARGV)
end
6 changes: 3 additions & 3 deletions bin/webpacker-dev-server → bin/shakapacker-dev-server
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ENV["RAILS_ENV"] ||= "development"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)

require "bundler/setup"
require "webpacker"
require "webpacker/dev_server_runner"
require "shakapacker"
require "shakapacker/dev_server_runner"

APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::DevServerRunner.run(ARGV)
Shakapacker::DevServerRunner.run(ARGV)
end
2 changes: 1 addition & 1 deletion config/newrelic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ common: &default_settings

# Defines a comma-delimited list of Rake tasks that the agent should not
# instrument. For example, assets:precompile,db:migrate.
# autostart.denylisted_rake_tasks: "about,assets:clean,assets:clobber,assets:environment,assets:precompile,assets:precompile:all,db:create,db:drop,db:fixtures:load,db:migrate,db:migrate:status,db:rollback,db:schema:cache:clear,db:schema:cache:dump,db:schema:dump,db:schema:load,db:seed,db:setup,db:structure:dump,db:version,doc:app,log:clear,middleware,notes,notes:custom,rails:template,rails:update,routes,secret,spec,spec:features,spec:requests,spec:controllers,spec:helpers,spec:models,spec:views,spec:routing,spec:rcov,stats,test,test:all,test:all:db,test:recent,test:single,test:uncommitted,time:zones:all,tmp:clear,tmp:create,webpacker:compile"
# autostart.denylisted_rake_tasks: "about,assets:clean,assets:clobber,assets:environment,assets:precompile,assets:precompile:all,db:create,db:drop,db:fixtures:load,db:migrate,db:migrate:status,db:rollback,db:schema:cache:clear,db:schema:cache:dump,db:schema:dump,db:schema:load,db:seed,db:setup,db:structure:dump,db:version,doc:app,log:clear,middleware,notes,notes:custom,rails:template,rails:update,routes,secret,spec,spec:features,spec:requests,spec:controllers,spec:helpers,spec:models,spec:views,spec:routing,spec:rcov,stats,test,test:all,test:all:db,test:recent,test:single,test:uncommitted,time:zones:all,tmp:clear,tmp:create,shakapacker:compile"

# Backports the faster Active Record connection lookup introduced in Rails 6,
# which improves agent performance when instrumenting Active Record. Note that
Expand Down
8 changes: 4 additions & 4 deletions config/webpacker.yml → config/shakapacker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Note: You must restart bin/webpacker-dev-server for changes to take effect
# Note: You must restart bin/shakapacker-dev-server for changes to take effect

default: &default
source_path: app/javascript
Expand All @@ -19,10 +19,10 @@ default: &default

public_root_path: public
public_output_path: packs
cache_path: tmp/webpacker
cache_path: tmp/shakapacker
webpack_compile_output: true
# See https://github.com/shakacode/shakapacker#deployment
webpacker_precompile: true
shakapacker_precompile: true

# Location for manifest.json, defaults to {public_output_path}/manifest.json if unset
# manifest_path: public/packs/manifest.json
Expand Down Expand Up @@ -79,7 +79,7 @@ development:
compress: true
# Note that apps that do not check the host are vulnerable to DNS rebinding attacks
allowed_hosts: 'all'
# Shows progress and colorizes output of bin/webpacker[-dev-server]
# Shows progress and colorizes output of bin/shakapacker[-dev-server]
pretty: true
headers:
'Access-Control-Allow-Origin': '*'
Expand Down
3 changes: 2 additions & 1 deletion config/webpack/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { env, webpackConfig, merge } = require('shakapacker')
const { env, generateWebpackConfig, merge } = require('shakapacker')
const { existsSync } = require('fs')
const { resolve } = require('path')

Expand Down Expand Up @@ -26,4 +26,5 @@ if (existsSync(path)) {
customConfig = merge(customConfig, envSpecificConfig)
}

const webpackConfig = generateWebpackConfig()
module.exports = merge(webpackConfig, customConfig)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"resolve-url-loader": "^5.0.0",
"sass": "^1.63.6",
"sass-loader": "^13.3.2",
"shakapacker": "6.6.0",
"shakapacker": "7.0.0",
"style-loader": "^3.3.3",
"terser-webpack-plugin": "^5.3.9",
"webpack": "^5.88.0",
Expand Down
Loading