nextgen 0.17.0 → 0.18.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9bb3fbf79823d7029b6d3f3fadda859e223df7dd10adcc3b8c4d2c65b3c2a04
4
- data.tar.gz: db43cfa7369353bb4c8caf0d1de807814fdf6fc3a4918cdf8d0bf69fe25e2a14
3
+ metadata.gz: 232f4be6f3272b3ea41b9ec5b00dec9839cfa895e191ca4877a15adbc362531a
4
+ data.tar.gz: 9118e393ffb6addc9d93c1050d673b07c775de544f8d0378347f5c17239b633d
5
5
  SHA512:
6
- metadata.gz: 1c2d3a708b62075ff5d47c5edd9159a0a70c2750c291b1460b8f29d91dd0eedd01df98b80e4579e1007d8a9e919a98cd71a9bb0fe76a74be48d0a3d0f6ba3f3d
7
- data.tar.gz: 8a1a5a9553f4ec332f294a1f8d4dae880d7e9e52c36ce29c368e13427d940c191d7da69d262980e8c2af2fa6154326199fc4b752c2ecfaf21fed8af2277e2af7
6
+ metadata.gz: 06704c5b229053280d8501695edd1dbc4c611ae727dc4b7979a533227ba9ab26e597f3602f27af5dd6241bede88e0d60dedbaebc81d99da7d705da885c83a1fb
7
+ data.tar.gz: c7e27d364cbd00690fe2dbec0ec0e5792e3ee22834081c8efcdd0d313145f4d8085160c12067d5672193beeefe1c3d741087469f3d1b93ccef996581fd3cb825
data/README.md CHANGED
@@ -107,7 +107,7 @@ Nextgen can optionally install and configure these Node packages to work nicely
107
107
  [Vite](https://vitejs.dev) (pronounced _veet_) is a next generation Node-based frontend build system and hot-reloading dev server. It can completely take the place of the asset pipeline and integrate seamlessly with Rails via the [vite_rails](https://github.com/ElMassimo/vite_ruby) gem. If you opt-in, Nextgen can set you up with Vite and adds a bunch of vite_rails best practices:
108
108
 
109
109
  - All frontend sources (CSS, JS, images) are moved to `app/frontend`
110
- - A `yarn start` script is used to start the Rails server and Vite dev server
110
+ - A `bin/dev` script is used to start the Rails server and Vite dev server
111
111
  - The [autoprefixer](https://github.com/postcss/autoprefixer) package is installed and activated via PostCSS
112
112
  - A base set of CSS files are added, including [modern_normalize](https://github.com/sindresorhus/modern-normalize)
113
113
  - A Vite-compatible inline SVG helper is added
@@ -119,7 +119,7 @@ module Nextgen
119
119
 
120
120
  desc "Apply auto-corrections"
121
121
  task fix: %w[] do
122
- Thor::Base.shell.new.say_status :OK, "All fixes applied!"
122
+ puts ">>>>>> [OK] All fixes applied!"
123
123
  end
124
124
  RUBY
125
125
  end
@@ -15,6 +15,11 @@ copy_file "DEPLOYMENT.md"
15
15
  say_git "Create a Procfile"
16
16
  template "Procfile.tt"
17
17
 
18
+ unless File.exist?("bin/dev")
19
+ say_git "Create bin/dev script"
20
+ copy_file "bin/dev", mode: :preserve
21
+ end
22
+
18
23
  say_git "Set up default rake task"
19
24
  test_task = "test:all" if minitest?
20
25
  append_to_file "Rakefile", <<~RUBY
@@ -23,7 +28,7 @@ append_to_file "Rakefile", <<~RUBY
23
28
 
24
29
  desc "Run all checks"
25
30
  task default: %w[#{test_task}] do
26
- Thor::Base.shell.new.say_status :OK, "All checks passed!"
31
+ puts ">>>>>> [OK] All checks passed!"
27
32
  end
28
33
  RUBY
29
34
 
@@ -96,8 +96,7 @@ say_git "Add a `yarn start` script"
96
96
  start = "concurrently -i -k --kill-others-on-fail -p none 'RUBY_DEBUG_OPEN=true bin/rails s' 'bin/vite dev'"
97
97
  add_package_json_script(start:)
98
98
  add_yarn_package "concurrently", dev: true
99
- gsub_file "README.md", %r{bin/rails s(erver)?}, "yarn start"
100
- gsub_file "bin/setup", %r{bin/rails s(erver)?}, "yarn start"
99
+ copy_file "bin/dev-yarn", "bin/dev", mode: :preserve, force: true
101
100
  remove_file "Procfile.dev"
102
101
 
103
102
  say_git "Add Safari cache workaround in development"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nextgen
4
- VERSION = "0.17.0"
4
+ VERSION = "0.18.0"
5
5
  end
@@ -38,7 +38,7 @@ bin/setup
38
38
  Start the Rails server with this command:
39
39
 
40
40
  ```
41
- bin/rails s
41
+ bin/dev
42
42
  ```
43
43
 
44
44
  The app will be located at <http://localhost:3000/>.
data/template/bin/dev ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ exec "./bin/rails", "server", *ARGV
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ exec "yarn", "start", *ARGV
data/template/bin/setup CHANGED
@@ -9,7 +9,7 @@ def setup!
9
9
  run "bundle install" if bundle_needed?
10
10
  run "overcommit --install" if overcommit_installable?
11
11
  run "bin/rails db:prepare" if database_present?
12
- run "yarn install" if yarn_needed?
12
+ run "yarn install --check-files" if yarn_needed?
13
13
  run "bin/rails tmp:create" if tmp_missing?
14
14
  run "bin/rails restart"
15
15
 
@@ -20,7 +20,7 @@ def setup!
20
20
  end
21
21
 
22
22
  say_status :Ready!,
23
- "Use #{colorize("bin/rails s", :yellow)} to start the app, " \
23
+ "Use #{colorize("bin/dev", :yellow)} to start the app, " \
24
24
  "or #{colorize("bin/rake", :yellow)} to run tests"
25
25
  end
26
26
 
@@ -49,7 +49,7 @@ def database_present?
49
49
  end
50
50
 
51
51
  def yarn_needed?
52
- File.exist?("yarn.lock") && !run("yarn check --check-files", silent: true, exception: false)
52
+ File.exist?("yarn.lock")
53
53
  end
54
54
 
55
55
  def tmp_missing?
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.17.0
4
+ version: 0.18.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: 2024-07-09 00:00:00.000000000 Z
11
+ date: 2024-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -167,6 +167,8 @@ files:
167
167
  - template/app/frontend/stylesheets/reset.css
168
168
  - template/app/helpers/inline_svg_helper.rb
169
169
  - template/app/views/home/index.html.erb.tt
170
+ - template/bin/dev
171
+ - template/bin/dev-yarn
170
172
  - template/bin/setup
171
173
  - template/config/environments/staging.rb
172
174
  - template/config/initializers/generators.rb
@@ -222,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
224
  - !ruby/object:Gem::Version
223
225
  version: '0'
224
226
  requirements: []
225
- rubygems_version: 3.5.11
227
+ rubygems_version: 3.5.16
226
228
  signing_key:
227
229
  specification_version: 4
228
230
  summary: Generate your next Rails app interactively!