generated from mattbrictson/gem
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example Rails projects generated with Nextgen (#4)
- Loading branch information
1 parent
f08526d
commit 2a68a25
Showing
402 changed files
with
11,593 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# Examples | ||
|
||
The Rails apps in this directory were all generated by `gem exec nextgen create` with various interactive menu items chosen. | ||
|
||
## default | ||
|
||
[`examples/default`](./default) was created by choosing the default option for every question, and declining all optional Nextgen enhancements. This generally represents the default Rails "omakase" experience with a [base](../lib/nextgen/generators/base.rb) level of improvements. | ||
|
||
``` | ||
What version of Rails will you use? | ||
‣ 7.1.1 | ||
edge (7-1-stable branch) | ||
Which database? | ||
‣ SQLite3 (default) | ||
PostgreSQL (recommended) | ||
MySQL | ||
More options... | ||
What style of Rails app do you need? | ||
‣ Standard, full-stack Rails (default) | ||
API only | ||
How will you manage frontend assets? | ||
‣ Sprockets (default) | ||
Propshaft | ||
Vite | ||
Which CSS framework will you use with the asset pipeline? | ||
‣ None (default) | ||
Bootstrap | ||
Bulma | ||
PostCSS | ||
Sass | ||
Tailwind | ||
Which JavaScript bundler will you use with the asset pipeline? | ||
‣ Importmap (default) | ||
ESBuild | ||
Rollup | ||
Webpack | ||
None | ||
Which optional Rails frameworks do you need? | ||
‣ ⬢ Hotwire | ||
⬢ JBuilder | ||
⬢ Action Mailer | ||
⬢ Active Job | ||
⬢ Action Cable | ||
⬢ Active Storage | ||
⬢ Action Text | ||
⬢ Action Mailbox | ||
Which test framework will you use? | ||
‣ Minitest (default) | ||
RSpec | ||
None | ||
Include system testing (capybara)? | ||
‣ Yes (default) | ||
No | ||
Which optional enhancements would you like to add? | ||
‣ ⬡ Annotate Models | ||
⬡ BasicAuth controller concern | ||
⬡ Brakeman | ||
⬡ Bundler Audit | ||
⬡ capybara-lockstep | ||
⬡ dotenv-rails | ||
⬡ ERB Lint | ||
⬡ ESLint | ||
⬡ Factory Bot | ||
⬡ GitHub Actions | ||
⬡ good_migrations | ||
⬡ letter_opener | ||
⬡ Open browser on startup | ||
⬡ Overcommit | ||
⬡ rack-canonical-host | ||
⬡ rack-mini-profiler | ||
⬡ RuboCop | ||
⬡ shoulda | ||
⬡ Sidekiq | ||
⬡ Stylelint | ||
⬡ Thor | ||
⬡ Tomo | ||
``` | ||
|
||
## rspec | ||
|
||
[`examples/rspec`](./rspec) is the same as the default example, except "RSpec" was chosen when prompted to select a test framework: | ||
|
||
``` | ||
Which test framework will you use? | ||
Minitest (default) | ||
‣ RSpec | ||
None | ||
``` | ||
|
||
## vite | ||
|
||
[`examples/vite`](./vite) shows what is generated when "Vite" is chosen as an alternative to Sprockets. | ||
|
||
``` | ||
How will you manage frontend assets? | ||
Sprockets (default) | ||
Propshaft | ||
‣ Vite | ||
``` | ||
|
||
## all | ||
|
||
[`examples/all`](./all) shows what is generated when all optional Nextgen enhancements are selected, including Sidekiq, Factory Bot, GitHub Actions, RuboCop, and more than a dozen others. | ||
|
||
``` | ||
Which optional enhancements would you like to add? | ||
‣ ⬢ Annotate Models | ||
⬢ BasicAuth controller concern | ||
⬢ Brakeman | ||
⬢ Bundler Audit | ||
⬢ capybara-lockstep | ||
⬢ dotenv-rails | ||
⬢ ERB Lint | ||
⬢ ESLint | ||
⬢ Factory Bot | ||
⬢ GitHub Actions | ||
⬢ good_migrations | ||
⬢ letter_opener | ||
⬢ Open browser on startup | ||
⬢ Overcommit | ||
⬢ rack-canonical-host | ||
⬢ rack-mini-profiler | ||
⬢ RuboCop | ||
⬢ shoulda | ||
⬢ Sidekiq | ||
⬢ Stylelint | ||
⬢ Thor | ||
⬢ Tomo | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. | ||
|
||
# Ignore git directory. | ||
/.git/ | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all environment files (except templates). | ||
/.env* | ||
!/.env*.erb | ||
|
||
# Ignore all default key files. | ||
/config/master.key | ||
/config/credentials/*.key | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
/tmp/* | ||
!/log/.keep | ||
!/tmp/.keep | ||
|
||
# Ignore pidfiles, but keep the directory. | ||
/tmp/pids/* | ||
!/tmp/pids/.keep | ||
|
||
# Ignore storage (uploaded files in development and any SQLite databases). | ||
/storage/* | ||
!/storage/.keep | ||
/tmp/storage/* | ||
!/tmp/storage/.keep | ||
|
||
# Ignore assets. | ||
/node_modules/ | ||
/app/assets/builds/* | ||
!/app/assets/builds/.keep | ||
/public/assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# https://editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[Makefile] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# These environment variables are needed to run the app locally. | ||
# Copy these into a file named .env to have them loaded automatically. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
EnableDefaultLinters: true | ||
exclude: | ||
- "node_modules/**/*" | ||
- "vendor/**/*" | ||
linters: | ||
ErbSafety: | ||
enabled: true | ||
Rubocop: | ||
enabled: true | ||
rubocop_config: | ||
inherit_from: | ||
- .rubocop.yml | ||
Layout/InitialIndentation: | ||
Enabled: false | ||
Layout/TrailingEmptyLines: | ||
Enabled: false | ||
Lint/UselessAssignment: | ||
Enabled: false | ||
Naming/FileName: | ||
Enabled: false | ||
Rails/OutputSafety: | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** @type {import("@types/eslint").Linter.Config */ | ||
|
||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 2022, | ||
sourceType: "module", | ||
}, | ||
plugins: ["prettier"], | ||
rules: { | ||
"no-unused-vars": [ | ||
"error", | ||
{ | ||
args: "after-used", | ||
argsIgnorePattern: "^_", | ||
varsIgnorePattern: "^_", | ||
}, | ||
], | ||
"no-var": "error", | ||
"prettier/prettier": "error", | ||
}, | ||
extends: ["eslint:recommended", "prettier"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# See https://git-scm.com/docs/gitattributes for more about git attribute files. | ||
|
||
# Mark the database schema as having been generated. | ||
db/schema.rb linguist-generated | ||
|
||
# Mark any vendored files as having been vendored. | ||
vendor/* linguist-vendored | ||
config/credentials/*.yml.enc diff=rails_credentials | ||
config/credentials.yml.enc diff=rails_credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
name: CI | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
env: | ||
RAILS_ENV: test | ||
jobs: | ||
test: | ||
name: "Test" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
cache: yarn | ||
- run: npx --yes ci | ||
- run: mkdir -p ./tmp/screenshots | ||
- run: bundle exec rake db:prepare | ||
- run: bundle exec rake test:all | ||
- uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: capybara-screenshots | ||
path: ./tmp/screenshots/ | ||
retention-days: 7 | ||
if-no-files-found: ignore | ||
erblint: | ||
name: "Lint / erblint" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bin/erblint --lint-all | ||
eslint: | ||
name: "Lint / eslint" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
cache: yarn | ||
- run: npx --yes ci | ||
- run: yarn lint:js | ||
rubocop: | ||
name: "Lint / rubocop" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bin/rubocop | ||
stylelint: | ||
name: "Lint / stylelint" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: "lts/*" | ||
cache: yarn | ||
- run: npx --yes ci | ||
- run: yarn lint:css | ||
brakeman: | ||
name: "Security / brakeman" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bundle exec brakeman --exit-on-warn --no-progress --color --output /dev/stdout | ||
bundle-audit: | ||
name: "Security / bundle-audit" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bundle exec bundle-audit check --update -v |
Oops, something went wrong.