nextgen 0.4.0 → 0.5.1
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 +7 -11
- data/lib/nextgen/actions/git.rb +2 -2
- data/lib/nextgen/generators/eslint.rb +1 -1
- data/lib/nextgen/generators/stylelint.rb +2 -2
- data/lib/nextgen/generators/vite.rb +1 -1
- data/lib/nextgen/version.rb +1 -1
- data/template/.overcommit.yml.tt +4 -0
- data/template/app/controllers/concerns/basic_auth.rb +1 -1
- data/template/package.json +2 -1
- metadata +4 -4
- /data/template/{postcss.config.js → postcss.config.cjs} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04eaa622183ac57d5a4e4ec6f7a100f74bdd1449a190324db19714b728e0261d
|
4
|
+
data.tar.gz: 8461524c611b9c60501ab7f46bd0b19a79c5e8eb88731dcf1ecfc2bbb9146766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93ed354680534ae076e8396a7d196acafaa30a9b85fb61b39fe8fd6cffb4c36a00234506042fdda491842d7c2afbb1dacda68f3785c8a877fc6b1b43cd02f5be
|
7
|
+
data.tar.gz: 32d17f15e35d96bdf808a4586233fa944fddff2a6e6e312a58085a1c16be73c9717cae79bd5b9e5c21b3b2c851fe944de5bc184bf0a3f3a3b128ae203fab6e8c
|
data/README.md
CHANGED
@@ -7,12 +7,12 @@
|
|
7
7
|
|
8
8
|
Nextgen is an **interactive** and flexible alternative to `rails new` that includes opt-in support for modern frontend development with ⚡️**Vite.**
|
9
9
|
|
10
|
-
[**About**](#about)
|
11
|
-
|
|
12
10
|
[**Requirements**](#requirements)
|
13
11
|
|
|
14
12
|
[**Usage**](#usage)
|
15
13
|
|
|
14
|
+
[**Examples**](./examples)
|
15
|
+
|
|
16
16
|
[**What's included**](#whats-included)<br>
|
17
17
|
[Support](#support)
|
18
18
|
|
|
@@ -24,21 +24,13 @@ Nextgen is an **interactive** and flexible alternative to `rails new` that inclu
|
|
24
24
|
|
25
25
|

|
26
26
|
|
27
|
-
## About
|
28
|
-
|
29
|
-
Nextgen is an interactive and flexible Rails app generator that starts with the official recommendations of `rails new`, and then lets you apply dozens of best-practices, tweaks, documentation, and personal preferences. Opt out of things you don't need (Action Mailbox?), choose your test framework and database, and opt into a curated set of additional gems like FactoryBot and RuboCop configured with reasonable defaults.
|
30
|
-
|
31
|
-
If you need to use React or (gasp!) TypeScript alongside Rails, Nextgen also has you covered with its ability to generate a robust Vite + Rails setup. [Vite](https://vite-ruby.netlify.app) brings excellent frontend tooling that goes well beyond what the default Rails stack can provide.
|
32
|
-
|
33
|
-
Nextgen is maintained by [@mattbrictson](https://github.com/mattbrictson) and is the tool I use to generate all of my personal and professional Rails projects. For more details, check out [what's included](#whats-included) below, or peruse the [examples directory](./examples) of apps generated by Nextgen.
|
34
|
-
|
35
27
|
## Requirements
|
36
28
|
|
37
29
|
Nextgen generates apps using **Rails 7.1**.
|
38
30
|
|
39
31
|
- **Ruby 3.0+** is required
|
40
32
|
- **Rubygems 3.4.8+** is required (run `gem update --system` to get it)
|
41
|
-
- **Node 18+ and Yarn** are required if you choose Vite or other Node-based options
|
33
|
+
- **Node 18.12+ and Yarn** are required if you choose Vite or other Node-based options
|
42
34
|
- Additional tools may be required depending on the options you select (e.g. PostgreSQL)
|
43
35
|
|
44
36
|
Going forward, my goal is that Nextgen will always target the latest stable version of Rails and the next pre-release version. Support for Node LTS and Ruby versions will be dropped as soon as they reach EOL (see [Ruby](https://endoflife.date/ruby) and [Node](https://endoflife.date/nodejs) EOL schedules).
|
@@ -56,6 +48,10 @@ This will download the latest version of the `nextgen` gem and use it to create
|
|
56
48
|
> [!NOTE]
|
57
49
|
> If you get an "Unknown command exec" error, fix it by upgrading rubygems: `gem update --system`.
|
58
50
|
|
51
|
+
## Examples
|
52
|
+
|
53
|
+
Check out the [examples directory](./examples) to see some Rails apps that were generated with `nextgen create`. RSpec, Vite, and vanilla Rails variations are included.
|
54
|
+
|
59
55
|
## What's included
|
60
56
|
|
61
57
|
**Nextgen starts with the "omakase" default behavior of `rails new`,** so you get the great things included in Rails 7.1 like a production-ready Dockerfile, 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.
|
data/lib/nextgen/actions/git.rb
CHANGED
@@ -13,7 +13,7 @@ module Nextgen
|
|
13
13
|
def apply_as_git_commit(path, message: nil)
|
14
14
|
say message, :cyan if message
|
15
15
|
@commit_messages = []
|
16
|
-
initially_clean =
|
16
|
+
initially_clean = git_working? && git_status == :clean
|
17
17
|
say_status :apply, File.basename(path)
|
18
18
|
apply path, verbose: false
|
19
19
|
return if !initially_clean || git_status == :clean
|
@@ -35,7 +35,7 @@ module Nextgen
|
|
35
35
|
def git_working?
|
36
36
|
return @git_working if defined?(@git_working)
|
37
37
|
|
38
|
-
@git_working =
|
38
|
+
@git_working = git_status != :error && git_user_configured?
|
39
39
|
end
|
40
40
|
|
41
41
|
def git_user_configured?
|
@@ -9,7 +9,7 @@ add_yarn_packages(
|
|
9
9
|
dev: true
|
10
10
|
)
|
11
11
|
add_package_json_scripts(
|
12
|
-
"lint:js": "eslint 'app/{components,frontend,javascript}/**/*.{js,jsx,ts,tsx}'",
|
12
|
+
"lint:js": "eslint 'app/{assets,components,frontend,javascript}/**/*.{cjs,js,jsx,ts,tsx}'",
|
13
13
|
"fix:js": "npm run -- lint:js --fix",
|
14
14
|
lint: "npm-run-all lint:**",
|
15
15
|
fix: "npm-run-all fix:**"
|
@@ -42,7 +42,7 @@ end
|
|
42
42
|
|
43
43
|
say_git "Install autoprefixer"
|
44
44
|
add_yarn_packages "postcss@^8.4.24", "autoprefixer@^10.4.14"
|
45
|
-
copy_file "postcss.config.
|
45
|
+
copy_file "postcss.config.cjs"
|
46
46
|
|
47
47
|
say_git "Disable autoBuild in test environment"
|
48
48
|
gsub_file "config/vite.json", /("test": \{.+?"autoBuild":\s*)true/m, '\1false'
|
data/lib/nextgen/version.rb
CHANGED
data/template/.overcommit.yml.tt
CHANGED
@@ -19,6 +19,10 @@ PreCommit:
|
|
19
19
|
required_executable: npx
|
20
20
|
command: ["npx", "--no-install", "eslint", "-f", "compact"]
|
21
21
|
include:
|
22
|
+
- app/assets/**/*.cjs
|
23
|
+
- app/components/**/*.cjs
|
24
|
+
- app/frontend/**/*.cjs
|
25
|
+
- app/javascript/**/*.cjs
|
22
26
|
- app/assets/**/*.js
|
23
27
|
- app/assets/**/*.jsx
|
24
28
|
- app/components/**/*.js
|
@@ -13,7 +13,7 @@ module BasicAuth
|
|
13
13
|
return true if expected_username.blank? || expected_password.blank?
|
14
14
|
|
15
15
|
authenticate_or_request_with_http_basic do |username, password|
|
16
|
-
ActiveSupport::SecurityUtils.secure_compare(username, expected_username) &
|
16
|
+
ActiveSupport::SecurityUtils.secure_compare(username, expected_username) &
|
17
17
|
ActiveSupport::SecurityUtils.secure_compare(password, expected_password)
|
18
18
|
end
|
19
19
|
end
|
data/template/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nextgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brictson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -180,7 +180,7 @@ files:
|
|
180
180
|
- template/lib/templates/rspec/system/system_spec.rb
|
181
181
|
- template/lib/vite_inline_svg_file_loader.rb
|
182
182
|
- template/package.json
|
183
|
-
- template/postcss.config.
|
183
|
+
- template/postcss.config.cjs
|
184
184
|
- template/spec/support/factory_bot.rb
|
185
185
|
- template/spec/support/mailer.rb
|
186
186
|
- template/spec/support/shoulda.rb
|
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
219
219
|
- !ruby/object:Gem::Version
|
220
220
|
version: '0'
|
221
221
|
requirements: []
|
222
|
-
rubygems_version: 3.4.
|
222
|
+
rubygems_version: 3.4.22
|
223
223
|
signing_key:
|
224
224
|
specification_version: 4
|
225
225
|
summary: Generate your next Rails app interactively!
|
File without changes
|