nextgen 0.36.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -4
- data/config/generators.yml +0 -4
- data/config/rails_versions.yml +2 -1
- data/lib/nextgen/actions.rb +2 -2
- data/lib/nextgen/commands/create.rb +15 -0
- data/lib/nextgen/generators/base.rb +4 -3
- data/lib/nextgen/generators/erb_lint.rb +1 -0
- data/lib/nextgen/version.rb +1 -1
- data/template/.overcommit.yml.tt +1 -1
- data/template/README.md.tt +1 -1
- data/template/lib/tasks/erb_lint.rake +1 -1
- data/template/test/vite_helper.rb +1 -2
- metadata +3 -4
- data/lib/nextgen/generators/bundler_audit.rb +0 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c220f677e85be4d7743b5d4dbb09ae9d0d7f97d1373458f7ee1c1a2d371e9e7
|
|
4
|
+
data.tar.gz: 79073932f4c22dbf2fbd8819e73fc2186d8ba1fdaa48f833ce925b513ff34a0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9e400966014de7e998e9cf8da63858310a57bc2568dd8e6e54b7a9002971d2bd86eaeffb14441337ee827c6a326d681221fd1ebc4602cbeaa47bd247ff93c22
|
|
7
|
+
data.tar.gz: 3f95b74419456f3c631060d8b9fe30e1dcbac165596bfbbb02cc39ad7b39d82e2fbb4bdfd749090f977b88359ce4f7fd110cc5947c4c56972883e15869462b4f
|
data/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Nextgen is an **interactive** and flexible alternative to `rails new` that inclu
|
|
|
25
25
|
|
|
26
26
|
## Requirements
|
|
27
27
|
|
|
28
|
-
Nextgen generates apps using **Rails 8.
|
|
28
|
+
Nextgen generates apps using **Rails 8.1**.
|
|
29
29
|
|
|
30
30
|
- **Ruby 3.2+** is required
|
|
31
31
|
- **Rubygems 3.4.8+** is required (run `gem update --system` to get it)
|
|
@@ -53,7 +53,7 @@ Check out the [examples directory](./examples) to see some Rails apps that were
|
|
|
53
53
|
|
|
54
54
|
## What's included
|
|
55
55
|
|
|
56
|
-
**Nextgen starts with the "omakase" default behavior of `rails new`,** so you get the great things included in Rails 8.
|
|
56
|
+
**Nextgen starts with the "omakase" default behavior of `rails new`,** so you get the great things included in Rails 8.1 like RuboCop, a GitHub Actions CI workflow, your choice of database platform, CSS framework, etc. You can also interactively disable parts of the default stack that you don't need, like JBuilder or Action Mailbox.
|
|
57
57
|
|
|
58
58
|
On top of that foundation, Nextgen offers dozens of useful enhancements to the vanilla Rails experience. You are free to pick and choose which (if any) of these to apply to your new project. Behind the scenes, **each enhancement is applied in a separate git commit,** so that you can later see what was applied and why, and revert the suggestions if necessary.
|
|
59
59
|
|
|
@@ -75,7 +75,7 @@ Prefer RSpec? Nextgen can set you up with RSpec, plus the gems and configuration
|
|
|
75
75
|
Prefer npm? Nextgen allows you to choose Yarn or npm to manage your app's JavaScript dependencies. Your Dockerfile, CI jobs, `bin/setup` script, etc. will be adjusted appropriately.
|
|
76
76
|
|
|
77
77
|
> [!NOTE]
|
|
78
|
-
> As of Rails 8.
|
|
78
|
+
> As of Rails 8.1, `rails new` is still hard-coded to use Yarn in some places. Therefore you may still need Yarn installed on your system in order to generate a new app. Nextgen will remove these Yarn references from your generated project if you select the npm option.
|
|
79
79
|
|
|
80
80
|
### Opinionated RuboCop Config
|
|
81
81
|
|
|
@@ -86,7 +86,6 @@ By default, Rails apps include RuboCop with a config defined by the [rubocop-rai
|
|
|
86
86
|
Nextgen can install and configure your choice of these recommended gems:
|
|
87
87
|
|
|
88
88
|
- [annotaterb](https://github.com/drwl/annotaterb)
|
|
89
|
-
- [bundler-audit](https://github.com/rubysec/bundler-audit)
|
|
90
89
|
- [capybara-lockstep](https://github.com/makandra/capybara-lockstep)
|
|
91
90
|
- [dotenv](https://github.com/bkeepers/dotenv)
|
|
92
91
|
- [erb_lint](https://github.com/Shopify/erb_lint)
|
data/config/generators.yml
CHANGED
|
@@ -45,10 +45,6 @@ basic_auth:
|
|
|
45
45
|
prompt: "BasicAuth controller concern"
|
|
46
46
|
description: "Allow app to be secured with ENV-based basic auth credentials"
|
|
47
47
|
|
|
48
|
-
bundler_audit:
|
|
49
|
-
prompt: "Bundler Audit"
|
|
50
|
-
description: "Install bundler-audit gem to detect CVEs in Ruby dependencies"
|
|
51
|
-
|
|
52
48
|
capybara_lockstep:
|
|
53
49
|
prompt: "capybara-lockstep"
|
|
54
50
|
description: "Install capybara-lockstep gem for less-flaky browser testing"
|
data/config/rails_versions.yml
CHANGED
|
@@ -18,6 +18,7 @@ current: ¤t
|
|
|
18
18
|
mariadb-trilogy: MariaDB-Trilogy
|
|
19
19
|
default_features:
|
|
20
20
|
brakeman: Brakeman
|
|
21
|
+
bundler-audit: bundler-audit
|
|
21
22
|
ci: GitHub Actions CI
|
|
22
23
|
kamal: Kamal
|
|
23
24
|
rubocop: RuboCop
|
|
@@ -29,7 +30,7 @@ current: ¤t
|
|
|
29
30
|
edge:
|
|
30
31
|
<<: *current
|
|
31
32
|
args: ["--edge"]
|
|
32
|
-
label: "edge (8-
|
|
33
|
+
label: "edge (8-1-stable)"
|
|
33
34
|
|
|
34
35
|
main:
|
|
35
36
|
<<: *current
|
data/lib/nextgen/actions.rb
CHANGED
|
@@ -143,9 +143,9 @@ module Nextgen
|
|
|
143
143
|
|
|
144
144
|
paths.reverse_each do |path|
|
|
145
145
|
gsub_file("config/application.rb", /autoload_lib\(ignore: %w.*$/) do |match|
|
|
146
|
-
next match if match.match?(/%w.*[
|
|
146
|
+
next match if match.match?(/%w.*[(\[ ]#{Regexp.quote(path)}[ )\]]/)
|
|
147
147
|
|
|
148
|
-
match.sub(/%w[
|
|
148
|
+
match.sub(/%w[(\[]/, '\0' + path + " ")
|
|
149
149
|
end
|
|
150
150
|
end
|
|
151
151
|
end
|
|
@@ -14,6 +14,8 @@ module Nextgen
|
|
|
14
14
|
class Commands::Create # rubocop:disable Metrics/ClassLength
|
|
15
15
|
extend Forwardable
|
|
16
16
|
|
|
17
|
+
RESERVED_NAMES = %w[application destroy plugin runner test].freeze
|
|
18
|
+
|
|
17
19
|
def self.run(app_path, options)
|
|
18
20
|
new(app_path, options).run
|
|
19
21
|
end
|
|
@@ -24,6 +26,8 @@ module Nextgen
|
|
|
24
26
|
end
|
|
25
27
|
|
|
26
28
|
def run # rubocop:disable Metrics/MethodLength, Metrics/PerceivedComplexity
|
|
29
|
+
reserved_word_message if app_name_is_reserved_word?
|
|
30
|
+
|
|
27
31
|
say <<~BANNER
|
|
28
32
|
Welcome to nextgen, the interactive Rails app generator!
|
|
29
33
|
|
|
@@ -106,6 +110,17 @@ module Nextgen
|
|
|
106
110
|
|
|
107
111
|
def_delegators :shell, :say
|
|
108
112
|
|
|
113
|
+
def app_name_is_reserved_word?
|
|
114
|
+
RESERVED_NAMES.include?(app_name.downcase)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def reserved_word_message
|
|
118
|
+
say <<~APP_NAME
|
|
119
|
+
Your Rails app name: "#{cyan(app_name)}", is a reserved word. Please rerun the initial command with an unreserved word instead.
|
|
120
|
+
APP_NAME
|
|
121
|
+
exit(false)
|
|
122
|
+
end
|
|
123
|
+
|
|
109
124
|
def continue_if(question)
|
|
110
125
|
if prompt.yes?(question)
|
|
111
126
|
say
|
|
@@ -32,7 +32,7 @@ append_to_file "Rakefile", <<~RUBY
|
|
|
32
32
|
end
|
|
33
33
|
RUBY
|
|
34
34
|
|
|
35
|
-
if File.
|
|
35
|
+
if File.read("Gemfile").match?(/^\s*gem ['"]capybara['"]/)
|
|
36
36
|
say_git "Configure system tests"
|
|
37
37
|
copy_test_support_file "capybara.rb.tt"
|
|
38
38
|
copy_file "test/application_system_test_case.rb", force: true
|
|
@@ -41,7 +41,9 @@ if File.exist?("test/application_system_test_case.rb")
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
missing_ruby_decl = !File.read("Gemfile").match?(/^ruby /)
|
|
44
|
-
if missing_ruby_decl &&
|
|
44
|
+
if missing_ruby_decl &&
|
|
45
|
+
File.exist?(".ruby-version") &&
|
|
46
|
+
File.read(".ruby-version").match?(/\A(ruby-)?\d+\.\d+.\d+.\s*\z/m)
|
|
45
47
|
say_git "Add ruby declaration to Gemfile"
|
|
46
48
|
ruby_decl = if bundler_ruby_file_supported?
|
|
47
49
|
'ruby file: ".ruby-version"'
|
|
@@ -58,7 +60,6 @@ if File.exist?("app/views/layouts/application.html.erb")
|
|
|
58
60
|
gsub_file "app/views/layouts/application.html.erb", "<html>", '<html lang="en">'
|
|
59
61
|
gsub_file "app/views/layouts/application.html.erb", %r{^\s*<title>.*</title>}, <<~ERB.gsub(/^/, " ").rstrip
|
|
60
62
|
<title><%= content_for?(:title) ? strip_tags(yield(:title)) : #{app_const_base.titleize.inspect} %></title>
|
|
61
|
-
<meta name="apple-mobile-web-app-title" content="#{app_const_base.titleize}">
|
|
62
63
|
ERB
|
|
63
64
|
end
|
|
64
65
|
|
data/lib/nextgen/version.rb
CHANGED
data/template/.overcommit.yml.tt
CHANGED
data/template/README.md.tt
CHANGED
|
@@ -3,6 +3,5 @@
|
|
|
3
3
|
return if ViteRuby.config.auto_build
|
|
4
4
|
|
|
5
5
|
# Compile assets once at the start of testing
|
|
6
|
-
|
|
7
|
-
seconds = Benchmark.realtime { ViteRuby.commands.build }
|
|
6
|
+
seconds = ActiveSupport::Benchmark.realtime { ViteRuby.commands.build }
|
|
8
7
|
puts format("Built Vite assets (%.1fms)", seconds * 1_000)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nextgen
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.38.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Brictson
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - "~>"
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 8.
|
|
18
|
+
version: 8.1.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - "~>"
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 8.
|
|
25
|
+
version: 8.1.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: thor
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -107,7 +107,6 @@ files:
|
|
|
107
107
|
- lib/nextgen/generators/annotaterb.rb
|
|
108
108
|
- lib/nextgen/generators/base.rb
|
|
109
109
|
- lib/nextgen/generators/basic_auth.rb
|
|
110
|
-
- lib/nextgen/generators/bundler_audit.rb
|
|
111
110
|
- lib/nextgen/generators/capybara_lockstep.rb
|
|
112
111
|
- lib/nextgen/generators/clean_gemfile.rb
|
|
113
112
|
- lib/nextgen/generators/dotenv.rb
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
install_gem "bundler-audit", group: :development, require: false
|
|
4
|
-
binstub "bundler-audit"
|
|
5
|
-
|
|
6
|
-
if File.exist?(".github/workflows/ci.yml")
|
|
7
|
-
say_git "Add bundle-audit job to CI workflow"
|
|
8
|
-
inject_into_file ".github/workflows/ci.yml", <<-YAML, after: /^jobs:\n/
|
|
9
|
-
scan_gems:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout code
|
|
14
|
-
uses: actions/checkout@v5
|
|
15
|
-
|
|
16
|
-
- name: Set up Ruby
|
|
17
|
-
uses: ruby/setup-ruby@v1
|
|
18
|
-
with:
|
|
19
|
-
ruby-version: .ruby-version
|
|
20
|
-
bundler-cache: true
|
|
21
|
-
|
|
22
|
-
- name: Scan for security vulnerabilities in Ruby dependencies
|
|
23
|
-
run: bundle exec bundle-audit check --update -v
|
|
24
|
-
|
|
25
|
-
YAML
|
|
26
|
-
end
|