Skip to content

Commit

Permalink
Regenerate examples using Rails 8.0.1 (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbrictson authored Jan 18, 2025
1 parent 4db77e2 commit 2ae96b2
Show file tree
Hide file tree
Showing 218 changed files with 6,552 additions and 3,221 deletions.
32 changes: 20 additions & 12 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ The Rails apps in this directory were all generated by `gem exec nextgen create`

```
What version of Rails will you use?
7.2.1
edge (7-2-stable)
main (8.0.0.beta1)
8.0.1
edge (8-0-stable)
main (8.1.0.alpha)
Which database?
‣ SQLite3 (default)
Expand All @@ -23,8 +23,7 @@ What style of Rails app do you need?
API only
How will you manage frontend assets?
‣ Sprockets (default)
Propshaft
‣ Propshaft (default)
Vite
Which CSS framework will you use with the asset pipeline?
Expand All @@ -46,7 +45,10 @@ Which JavaScript bundler will you use with the asset pipeline?
Rails can preinstall the following. Which do you need?
‣ ⬢ Brakeman
⬢ GitHub Actions CI
⬢ Kamal
⬢ RuboCop
⬢ Solid Cache+Queue
⬢ Thruster
⬡ devcontainer files
Which optional Rails frameworks do you need?
Expand All @@ -69,7 +71,7 @@ Include system testing (capybara)?
No
Which optional enhancements would you like to add?
‣ ⬡ Annotate Models
‣ ⬡ AnnotateRb
⬡ BasicAuth controller concern
⬡ Bundler Audit
⬡ capybara-lockstep
Expand All @@ -87,11 +89,9 @@ Which optional enhancements would you like to add?
⬡ rack-mini-profiler
⬡ RuboCop (nextgen custom config)
⬡ shoulda
⬡ Sidekiq
⬡ Staging environment
⬡ Stylelint
⬡ Thor
⬡ Tomo
⬡ VCR
```

Expand All @@ -112,8 +112,7 @@ Which test framework will you use?

```
How will you manage frontend assets?
Sprockets (default)
Propshaft
Propshaft (default)
‣ Vite
Which JavaScript package manager will you use?
Expand All @@ -123,11 +122,20 @@ Which JavaScript package manager will you use?

## all

[`examples/all`](./all) shows what is generated when all optional Nextgen enhancements are selected, including Sidekiq, Factory Bot, Bundler Audit, ESLint, and more than a dozen others.
[`examples/all`](./all) shows what is generated when all optional Nextgen enhancements are selected, including Sidekiq, Factory Bot, Bundler Audit, ESLint, and more than a dozen others. In this example, the default Kamal and Solid Cache+Queue choices have been deselected so that Tomo and Sidekiq can be installed in their place.

```
Rails can preinstall the following. Which do you need?
⬢ Brakeman
⬢ GitHub Actions CI
⬡ Kamal
⬢ RuboCop
‣ ⬡ Solid Cache+Queue
⬢ Thruster
⬡ devcontainer files
Which optional enhancements would you like to add?
‣ ⬢ Annotate Models
‣ ⬢ AnnotateRb
⬢ BasicAuth controller concern
⬢ Bundler Audit
⬢ capybara-lockstep
Expand Down
58 changes: 58 additions & 0 deletions examples/all/.annotaterb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
:position: before
:position_in_additional_file_patterns: before
:position_in_class: before
:position_in_factory: before
:position_in_fixture: before
:position_in_routes: before
:position_in_serializer: before
:position_in_test: before
:classified_sort: true
:exclude_controllers: true
:exclude_factories: false
:exclude_fixtures: false
:exclude_helpers: true
:exclude_scaffolds: true
:exclude_serializers: false
:exclude_sti_subclasses: false
:exclude_tests: false
:force: false
:format_markdown: false
:format_rdoc: false
:format_yard: false
:frozen: false
:ignore_model_sub_dir: false
:ignore_unknown_models: false
:include_version: false
:show_check_constraints: false
:show_complete_foreign_keys: false
:show_foreign_keys: true
:show_indexes: true
:simple_indexes: false
:sort: false
:timestamp: false
:trace: false
:with_comment: true
:with_column_comments: true
:with_table_comments: true
:active_admin: false
:command:
:debug: false
:hide_default_column_types: ''
:hide_limit_column_types: ''
:ignore_columns:
:ignore_routes:
:models: true
:routes: false
:skip_on_db_migrate: false
:target_action: :do_annotations
:wrapper:
:wrapper_close:
:wrapper_open:
:classes_default_to_s: []
:additional_file_patterns: []
:model_dir:
- app/models
:require: []
:root_dir:
- ''
3 changes: 1 addition & 2 deletions examples/all/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
# Ignore bundler config.
/.bundle

# Ignore all environment files (except templates).
# Ignore all environment files.
/.env*
!/.env*.erb

# Ignore all default key files.
/config/master.key
Expand Down
File renamed without changes.
31 changes: 23 additions & 8 deletions examples/all/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
stylelint:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -26,7 +26,7 @@ jobs:
run: yarn run lint:css

eslint:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -44,8 +44,23 @@ jobs:
- name: Lint JavaScript files with eslint
run: yarn run lint:js

erb_lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: .ruby-version
bundler-cache: true

- name: Lint ERB with erb_lint
run: bin/erb_lint --lint-all

scan_gems:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -61,7 +76,7 @@ jobs:
run: bundle exec bundle-audit check --update -v

scan_ruby:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -77,7 +92,7 @@ jobs:
run: bin/brakeman --no-pager

scan_js:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout code
Expand All @@ -93,7 +108,7 @@ jobs:
run: bin/importmap audit

lint:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -108,7 +123,7 @@ jobs:
run: bin/rubocop -f github

test:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

# services:
# redis:
Expand All @@ -118,7 +133,7 @@ jobs:
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Install packages
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips sqlite3
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git pkg-config google-chrome-stable

- name: Checkout code
uses: actions/checkout@v4
Expand Down
3 changes: 1 addition & 2 deletions examples/all/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
# Ignore bundler config.
/.bundle

# Ignore all environment files (except templates).
# Ignore all environment files.
/.env*
!/.env*.erb

# Ignore all logfiles and tempfiles.
/log/*
Expand Down
6 changes: 2 additions & 4 deletions examples/all/.overcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ PreCommit:
ErbLint:
enabled: true
required_executable: bundle
command: ["bundle", "exec", "erblint"]
command: ["bundle", "exec", "erb_lint"]
include: "**/*.html.erb"

EsLint:
Expand Down Expand Up @@ -52,15 +52,13 @@ PreCommit:
RuboCop:
enabled: true
required_executable: bundle
command: ["bundle", "exec", "rubocop"]
command: ["bundle", "exec", "rubocop", "-c", ".rubocop.yml"]
on_warn: fail

Stylelint:
enabled: true
required_executable: npx
command: ["npx", "--no-install", "stylelint"]
env:
NODE_OPTIONS: --no-deprecation
include:
- app/assets/**/*.css
- app/components/**/*.css
Expand Down
2 changes: 1 addition & 1 deletion examples/all/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.5
3.4.1
13 changes: 6 additions & 7 deletions examples/all/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import strictValuePlugin from "stylelint-declaration-strict-value";

export default {
plugins: [strictValuePlugin],
extends: ["stylelint-config-standard", "stylelint-prettier/recommended"],
rules: {
"color-hex-length": null,
Expand All @@ -18,18 +15,20 @@ export default {
ignoreProperties: ["font-named-instance"],
},
],
"scale-unlimited/declaration-strict-value": [
"/color/",
"declaration-property-value-allowed-list": [
{
disableFix: true,
ignoreValues: [
"/color/": [
/^var\(--/,
"currentcolor",
"inherit",
"initial",
"transparent",
"unset",
],
},
{
message: "Found hard-coded color value; expected var(--...)",
},
],
"selector-class-pattern": [
// classes must be in BEM form, like this:
Expand Down
2 changes: 1 addition & 1 deletion examples/all/.tomo/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

set application: "all_example"
set deploy_to: "/var/www/%{application}"
set nodenv_node_version: "20.18.0"
set nodenv_node_version: "22.13.0"
set nodenv_install_yarn: true
set git_url: nil # FIXME
set git_branch: "main"
Expand Down
19 changes: 11 additions & 8 deletions examples/all/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# syntax = docker/dockerfile:1
# syntax=docker/dockerfile:1
# check=error=true

# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand:
# docker build -t my-app .
# docker run -d -p 80:80 -p 443:443 --name my-app -e RAILS_MASTER_KEY=<value from config/master.key> my-app
# docker build -t all_example .
# docker run -d -p 80:80 -e RAILS_MASTER_KEY=<value from config/master.key> --name all_example all_example

# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html

# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
ARG RUBY_VERSION=3.3.5
ARG RUBY_VERSION=3.4.1
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base

# Rails app lives here
Expand All @@ -31,7 +34,7 @@ RUN apt-get update -qq && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives

# Install application gems
COPY Gemfile Gemfile.lock ./
COPY .ruby-version Gemfile Gemfile.lock ./
RUN bundle install && \
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
bundle exec bootsnap precompile --gemfile
Expand Down Expand Up @@ -64,6 +67,6 @@ USER 1000:1000
# Entrypoint prepares the database.
ENTRYPOINT ["/rails/bin/docker-entrypoint"]

# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD ["./bin/rails", "server"]
# Start server via Thruster by default, this can be overwritten at runtime
EXPOSE 80
CMD ["./bin/thrust", "./bin/rails", "server"]
9 changes: 5 additions & 4 deletions examples/all/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ gem "bootsnap", require: false
gem "good_migrations"
gem "importmap-rails"
gem "jbuilder"
gem "propshaft"
gem "puma", ">= 5.0"
gem "rack-canonical-host"
gem "rails", "~> 7.2.1"
gem "sprockets-rails"
gem "sqlite3", ">= 1.4"
gem "rails", "~> 8.0.1"
gem "sqlite3", ">= 2.1"
gem "stimulus-rails"
gem "thruster", require: false
gem "turbo-rails"
gem "tzinfo-data", platforms: %i[windows jruby]

Expand All @@ -26,7 +27,7 @@ group :development, :test do
end

group :development do
gem "annotate"
gem "annotaterb"
gem "bundler-audit", require: false
gem "erb_lint", require: false
gem "letter_opener"
Expand Down
Loading

0 comments on commit 2ae96b2

Please sign in to comment.