next_rails_scaffold 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -3
- data/app/controllers/{next_rails → next_rails_scaffold}/static_pages_controller.rb +1 -1
- data/config/routes.rb +1 -1
- data/lib/generators/{next_rails → next_rails_scaffold}/install_generator.rb +3 -3
- data/lib/generators/{next_rails/templates/config/initializers/next_rails.rb → next_rails_scaffold/templates/config/initializers/next_rails_scaffold.rb} +2 -4
- data/lib/generators/rails/{next_rails/next_rails_generator.rb → next_rails_scaffold/next_rails_scaffold_generator.rb} +2 -2
- data/lib/{next_rails → next_rails_scaffold}/actions.rb +1 -1
- data/lib/next_rails_scaffold/engine.rb +8 -0
- data/lib/next_rails_scaffold/version.rb +5 -0
- data/lib/{next_rails.rb → next_rails_scaffold.rb} +5 -5
- data/sig/{next_rails.rbs → next_rails_scaffold.rbs} +1 -1
- metadata +12 -12
- data/lib/next_rails/engine.rb +0 -8
- data/lib/next_rails/version.rb +0 -5
- /data/lib/generators/{next_rails → next_rails_scaffold}/USAGE +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6410f332a9e5aa501713996115198221e8096c8fa7cf6d09754bdeba30b99c31
|
4
|
+
data.tar.gz: 9a6f90d15a0f292b6106325fc49537eabc3890380e5c8f14537747d669cc816f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c40dfa2dc06a5845ece1b8250dac1c77bda54b3363f3d9e00f4c5bd1e2fdfd2e93c90b0d567cc73b939b80c0ccbc8b483cb71c25879b1678e0ca08e89be7e69e
|
7
|
+
data.tar.gz: daa16be2230197dd500e79bb4df7dbc34dc3d80c58a3e24fac15cbf33bd08efbcb22f917b50d2744d46ee4b608ddd4a1c8b63ba503a80da3cd03a553dac1e7db
|
data/README.md
CHANGED
@@ -1,10 +1,21 @@
|
|
1
|
-
#
|
1
|
+
# NextRailsScaffold
|
2
2
|
|
3
3
|
The `next_rails_scaffold` gem is a powerful extension to the standard Ruby on Rails scaffold generator. It streamlines the development workflow by not only creating the backend structure with Rails but also automating the setup of a frontend directory using Next.js. Upon running the scaffold generator, this gem intelligently generates a Next.js application within the specified frontend directory.
|
4
4
|
|
5
5
|
The generated Next.js app follows best practices, including a structured page routing system, ensuring that each resource created by the scaffold has its corresponding page and components. This integration enables developers to seamlessly transition between Rails backend and Next.js frontend development, fostering a cohesive and efficient development environment.
|
6
6
|
|
7
|
-
|
7
|
+
Currently, https://www.hygen.io/ is used to create Next.js code, and the https://github.com/raphox/next-rails-scaffold repository contains template files.
|
8
|
+
|
9
|
+
<div align="center">
|
10
|
+
<a href="https://www.youtube.com/watch?v=eMM3AChZ5LY" target="_blank">
|
11
|
+
<img
|
12
|
+
src="https://img.youtube.com/vi/eMM3AChZ5LY/0.jpg"
|
13
|
+
alt="NextRailsScaffold (next_rails_scaffold)"
|
14
|
+
style="width:60%">
|
15
|
+
</a>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
## Key Features:
|
8
19
|
|
9
20
|
- **Automatic Frontend Setup:** The gem automates the creation of a frontend directory within the Rails project, ready for Next.js development.
|
10
21
|
- **Page Routing Integration:** All scaffolded resources come with their own pages and components, organized using Next.js' page routing system.
|
@@ -57,6 +68,8 @@ frontend/
|
|
57
68
|
services.js
|
58
69
|
```
|
59
70
|
|
71
|
+
Sample app https://github.com/raphox/next-rails-app.
|
72
|
+
|
60
73
|
## Development
|
61
74
|
|
62
75
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -65,7 +78,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
65
78
|
|
66
79
|
## Contributing
|
67
80
|
|
68
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/raphox/
|
81
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/raphox/next_rails_scaffold.
|
69
82
|
|
70
83
|
## License
|
71
84
|
|
data/config/routes.rb
CHANGED
@@ -11,6 +11,6 @@ Rails.application.routes.draw do
|
|
11
11
|
route = path[%r{#{Regexp.escape(static_files_path)}(.*)/index.html}, 1]
|
12
12
|
route = route.gsub(parameter_regex, ':\1')
|
13
13
|
|
14
|
-
get route, to: "
|
14
|
+
get route, to: "next_rails_scaffold/static_pages#index", file_path: path
|
15
15
|
end
|
16
16
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module NextRailsScaffold
|
4
4
|
module Generators
|
5
5
|
class InstallGenerator < Rails::Generators::Base
|
6
|
-
desc "Copy
|
6
|
+
desc "Copy NextRailsScaffold default files"
|
7
7
|
source_root File.expand_path("templates", __dir__)
|
8
8
|
|
9
9
|
def copy_config
|
10
|
-
template "config/initializers/
|
10
|
+
template "config/initializers/next_rails_scaffold.rb"
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -1,11 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
NextRails.setup do |config|
|
3
|
+
NextRailsScaffold.setup do |config|
|
6
4
|
config.generators do |g|
|
7
5
|
g.api_only = true
|
8
6
|
g.resource_route false
|
9
|
-
g.helper :
|
7
|
+
g.helper :next_rails_scaffold
|
10
8
|
end
|
11
9
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Rails
|
4
|
-
class
|
5
|
-
include ::
|
4
|
+
class NextRailsScaffoldGenerator < Rails::Generators::NamedBase
|
5
|
+
include ::NextRailsScaffold::Actions
|
6
6
|
|
7
7
|
source_root File.expand_path("templates", __dir__)
|
8
8
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "
|
4
|
-
require_relative "
|
5
|
-
require_relative "
|
3
|
+
require_relative "next_rails_scaffold/actions"
|
4
|
+
require_relative "next_rails_scaffold/engine"
|
5
|
+
require_relative "next_rails_scaffold/version"
|
6
6
|
|
7
|
-
module
|
7
|
+
module NextRailsScaffold
|
8
8
|
class Error < StandardError; end
|
9
9
|
|
10
10
|
@@configured = false
|
@@ -13,7 +13,7 @@ module NextRails
|
|
13
13
|
@@configured
|
14
14
|
end
|
15
15
|
|
16
|
-
# Default way to setup Next Rails. Run rails generate
|
16
|
+
# Default way to setup Next Rails. Run rails generate next_rails_scaffold:install
|
17
17
|
# to create a fresh initializer with all configuration values.
|
18
18
|
def self.setup
|
19
19
|
@@configured = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: next_rails_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Raphael Araújo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -50,17 +50,17 @@ files:
|
|
50
50
|
- LICENSE.txt
|
51
51
|
- README.md
|
52
52
|
- Rakefile
|
53
|
-
- app/controllers/
|
53
|
+
- app/controllers/next_rails_scaffold/static_pages_controller.rb
|
54
54
|
- config/routes.rb
|
55
|
-
- lib/generators/
|
56
|
-
- lib/generators/
|
57
|
-
- lib/generators/
|
58
|
-
- lib/generators/rails/
|
59
|
-
- lib/
|
60
|
-
- lib/
|
61
|
-
- lib/
|
62
|
-
- lib/
|
63
|
-
- sig/
|
55
|
+
- lib/generators/next_rails_scaffold/USAGE
|
56
|
+
- lib/generators/next_rails_scaffold/install_generator.rb
|
57
|
+
- lib/generators/next_rails_scaffold/templates/config/initializers/next_rails_scaffold.rb
|
58
|
+
- lib/generators/rails/next_rails_scaffold/next_rails_scaffold_generator.rb
|
59
|
+
- lib/next_rails_scaffold.rb
|
60
|
+
- lib/next_rails_scaffold/actions.rb
|
61
|
+
- lib/next_rails_scaffold/engine.rb
|
62
|
+
- lib/next_rails_scaffold/version.rb
|
63
|
+
- sig/next_rails_scaffold.rbs
|
64
64
|
homepage: https://github.com/raphox/next-rails#readme
|
65
65
|
licenses:
|
66
66
|
- MIT
|
data/lib/next_rails/engine.rb
DELETED
data/lib/next_rails/version.rb
DELETED
File without changes
|