nextgen 0.3.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1591abd0b5db745b385bf46cd2b7f3322e8e70fa498c227d856e390db9ae0841
4
- data.tar.gz: 9d1ed374bda103b54f0c79aaf00a7ada704b3ce3e9c87a0037c0ab2e0d702668
3
+ metadata.gz: b4d5f0c3ca15b206d8b567446f10d9b20132b34e00d32eacf809ded55d8fa414
4
+ data.tar.gz: 731730e1da7a5c32eecdc4ab6b8d34f22abd87261cf92b13325fc54508d4eb19
5
5
  SHA512:
6
- metadata.gz: 8430143a55d838a9eeab4ab90a1fb115ec5f1fc3f6b7c0e8780e7bf35f9cdf06e2ba728f86df8a28f697b08b09701ab8b1a8b2b9256e6de17b4981226aef70d0
7
- data.tar.gz: 8279239e32266c60ed81c39d69116e4cc9693a2faaed087b1fceb026dbb3e882f4efea4386d640c0ccbc4408981f1d0718e686f4b3473b6bc440ba718755277c
6
+ metadata.gz: 51c9da0058d9b3c6b94978e82d78380669ffb650723e2de91290c3d8cb781cf0c2fa21ec814dc8c5ce61a713d480c48769a75ba19b3cafb6bee795ef4f7b079f
7
+ data.tar.gz: 558a1f7705eec3f3ce0fd56f299a128bb32a498b180b7703da8c929815af10490e4cd87bdf4ed3ae5e4ff5149b35fa4d71822167e46ea720a55dcb778beaaaae
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
  ![Screen recording of Nextgen in action](./demo.gif)
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.
@@ -70,6 +70,10 @@ factory_bot_rails:
70
70
  description: "Install and configure factory_bot_rails gem"
71
71
  requires: active_record
72
72
 
73
+ github_pr_template:
74
+ prompt: "GitHub PR template"
75
+ description: "Add GitHub pull request template"
76
+
73
77
  git_safe:
74
78
 
75
79
  good_migrations:
@@ -135,7 +135,7 @@ module Nextgen
135
135
  "MySQL" => "mysql"
136
136
  }
137
137
  all_databases = common_databases.merge(
138
- %w[MySQL Oracle SQLServer JDBCMySQL JDBCSQLite3 JDBCPostgreSQL JDBC].to_h do |name|
138
+ %w[MySQL Trilogy Oracle SQLServer JDBCMySQL JDBCSQLite3 JDBCPostgreSQL JDBC].to_h do |name|
139
139
  [name, name.downcase]
140
140
  end,
141
141
  "None (disable Active Record)" => nil
@@ -185,6 +185,7 @@ module Nextgen
185
185
  rails_opts.javascript = prompt.select(
186
186
  "Which JavaScript bundler will you use with the asset pipeline?",
187
187
  "Importmap (default)" => "importmap",
188
+ "Bun" => "bun",
188
189
  "ESBuild" => "esbuild",
189
190
  "Rollup" => "rollup",
190
191
  "Webpack" => "webpack",
@@ -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:**"
@@ -0,0 +1 @@
1
+ template ".github/PULL_REQUEST_TEMPLATE.md.tt"
@@ -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.js"
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'
@@ -3,6 +3,7 @@ module Nextgen
3
3
  DATABASES = %w[
4
4
  postgresql
5
5
  mysql
6
+ trilogy
6
7
  sqlite3
7
8
  oracle
8
9
  sqlserver
@@ -1,3 +1,3 @@
1
1
  module Nextgen
2
- VERSION = "0.3.0".freeze
2
+ VERSION = "0.5.0".freeze
3
3
  end
@@ -0,0 +1,21 @@
1
+ Problem
2
+ =======
3
+
4
+ <!-- describe what motivated this PR -->
5
+
6
+ <!-- link to issue or ticket -->
7
+
8
+ Solution
9
+ ========
10
+
11
+ Steps to verify
12
+ ---------------
13
+
14
+ 1. step
15
+ 1. step
16
+ 1. step
17
+ <% if File.exist?("app/views/layouts/application.html.erb") -%>
18
+
19
+ Screenshots
20
+ -----------
21
+ <% end -%>
@@ -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
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "private": true,
3
+ "type": "module",
3
4
  "engines": {
4
- "node": ">=18.0.0"
5
+ "node": ">=18.12.0"
5
6
  }
6
7
  }
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.3.0
4
+ version: 0.5.0
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-10-28 00:00:00.000000000 Z
11
+ date: 2023-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -117,6 +117,7 @@ files:
117
117
  - lib/nextgen/generators/factory_bot_rails.rb
118
118
  - lib/nextgen/generators/git_safe.rb
119
119
  - lib/nextgen/generators/github_actions.rb
120
+ - lib/nextgen/generators/github_pr_template.rb
120
121
  - lib/nextgen/generators/good_migrations.rb
121
122
  - lib/nextgen/generators/home_controller.rb
122
123
  - lib/nextgen/generators/initial_git_commit.rb
@@ -146,6 +147,7 @@ files:
146
147
  - template/.env.sample
147
148
  - template/.erb-lint.yml.tt
148
149
  - template/.eslintrc.cjs
150
+ - template/.github/PULL_REQUEST_TEMPLATE.md.tt
149
151
  - template/.github/workflows/ci.yml.tt
150
152
  - template/.overcommit.yml.tt
151
153
  - template/.prettierrc.cjs
@@ -178,7 +180,7 @@ files:
178
180
  - template/lib/templates/rspec/system/system_spec.rb
179
181
  - template/lib/vite_inline_svg_file_loader.rb
180
182
  - template/package.json
181
- - template/postcss.config.js
183
+ - template/postcss.config.cjs
182
184
  - template/spec/support/factory_bot.rb
183
185
  - template/spec/support/mailer.rb
184
186
  - template/spec/support/shoulda.rb
File without changes