next_rails_scaffold 0.1.13 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +17 -1
- data/README.md +7 -4
- data/lib/generators/rails/next_rails_scaffold/next_rails_scaffold_generator.rb +3 -3
- data/lib/next_rails_scaffold/engine.rb +2 -0
- data/lib/next_rails_scaffold/version.rb +1 -1
- data/lib/next_rails_scaffold.rb +2 -2
- metadata +4 -4
- data/next_rails_scaffold.gemspec +0 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 195a1ccf90ee28354555ce504dc25ff17f6515101c508e8b705cbe5fa0c4b2c7
|
4
|
+
data.tar.gz: a3c0c958f340ae052a235b6c1c61285a4f95fe27ba4ad9431fa6eb75c143586a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95b824a162a6ba13a7b0f12138bcffcfd27b5d1b2adcf33906cbda6d1bb8e5f3cd87ff2ca9ddeea6ee65b8c31f239eb19b940df4c81dd36845551c0e07ad8b98
|
7
|
+
data.tar.gz: d5ab3b8a2f828d610a14438a3dc5f291a1fb034cd929903d5d2f3771df067017937746e3823473bab1735d4057a3fc45067d16159f339de6346b6380a2e7db9d
|
data/.rubocop.yml
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion:
|
2
|
+
TargetRubyVersion: 3.3.6
|
3
|
+
NewCops: enable
|
3
4
|
|
4
5
|
Style/StringLiterals:
|
5
6
|
Enabled: true
|
@@ -11,3 +12,18 @@ Style/StringLiteralsInInterpolation:
|
|
11
12
|
|
12
13
|
Layout/LineLength:
|
13
14
|
Max: 120
|
15
|
+
|
16
|
+
Style/Documentation:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Metrics/AbcSize:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Metrics/CyclomaticComplexity:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Metrics/MethodLength:
|
26
|
+
Enabled: false
|
27
|
+
|
28
|
+
Metrics/PerceivedComplexity:
|
29
|
+
Enabled: false
|
data/README.md
CHANGED
@@ -22,6 +22,8 @@ In one of my posts on [Medium](https://medium.com/@raphox/rails-and-next-js-the-
|
|
22
22
|
1. When I compare the alternatives offered by [Hotwire](https://hotwired.dev/) with the entire React ecosystem, for me Hotwire is stuck in the way of developing web applications that were practiced more than ten years ago when there were no frameworks like React;
|
23
23
|
2. The maturity and ease of the Ruby language and the Ruby on Rails framework justify having more than one language in the same project;
|
24
24
|
3. Nothing prevents me from keeping the static site or Single-Page Application (SPA) for smaller projects and, if there's a need or demand, later maintaining my API and configuring my Next application to run on a Node server and offer SSR;
|
25
|
+
4. Like Ruby on Rails itself, it is a framework that seeks to offer tools that help you create a new project with almost everything that a web application normally needs. The purpose of this gem is also to select the best tools you'll need to create a React application. In the future, new tools will be integrated into the project, but for now, you can see our current [stack](https://github.com/raphox/next-rails-scaffold#frontend-tech-stack) of Node packages;
|
26
|
+
5. The reason for generating a scaffold, apart from saving time, is also to provide you with a development standard that will be validated and adjusted by other developers and teams. You'll have a path to follow when starting a new project;
|
25
27
|
|
26
28
|
## Key Features:
|
27
29
|
|
@@ -67,17 +69,18 @@ app/
|
|
67
69
|
...
|
68
70
|
frontend/
|
69
71
|
src
|
72
|
+
components
|
73
|
+
Post.js
|
74
|
+
PostForm.js
|
70
75
|
pages
|
71
76
|
posts
|
72
77
|
[id]
|
73
78
|
edit.js
|
74
79
|
index.js
|
75
|
-
_components
|
76
|
-
Post.js
|
77
|
-
PostForm.js
|
78
80
|
index.js
|
79
81
|
new.js
|
80
|
-
|
82
|
+
providers.js
|
83
|
+
services.js
|
81
84
|
```
|
82
85
|
|
83
86
|
Sample app https://github.com/raphox/next-rails-app.
|
@@ -6,9 +6,9 @@ module Rails
|
|
6
6
|
|
7
7
|
source_root File.expand_path("templates", __dir__)
|
8
8
|
|
9
|
-
NODE_REQUIRED_VERSION = ">= 18.
|
10
|
-
YARN_VERSION = "
|
11
|
-
NEXT_VERSION = "
|
9
|
+
NODE_REQUIRED_VERSION = ">= 18.18.0"
|
10
|
+
YARN_VERSION = "4.5.3"
|
11
|
+
NEXT_VERSION = "15.0.3"
|
12
12
|
|
13
13
|
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
14
14
|
|
data/lib/next_rails_scaffold.rb
CHANGED
@@ -7,7 +7,7 @@ require_relative "next_rails_scaffold/version"
|
|
7
7
|
module NextRailsScaffold
|
8
8
|
class Error < StandardError; end
|
9
9
|
|
10
|
-
@@configured = false
|
10
|
+
@@configured = false # rubocop:disable Style/ClassVars
|
11
11
|
|
12
12
|
def self.configured? # :nodoc:
|
13
13
|
@@configured
|
@@ -16,7 +16,7 @@ module NextRailsScaffold
|
|
16
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
|
-
@@configured = true
|
19
|
+
@@configured = true # rubocop:disable Style/ClassVars
|
20
20
|
yield Rails.application.config
|
21
21
|
end
|
22
22
|
end
|
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.
|
4
|
+
version: 0.2.0
|
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: 2024-11-
|
11
|
+
date: 2024-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -60,13 +60,13 @@ files:
|
|
60
60
|
- lib/next_rails_scaffold/actions.rb
|
61
61
|
- lib/next_rails_scaffold/engine.rb
|
62
62
|
- lib/next_rails_scaffold/version.rb
|
63
|
-
- next_rails_scaffold.gemspec
|
64
63
|
- sig/next_rails_scaffold.rbs
|
65
64
|
homepage: https://github.com/raphox/next-rails#readme
|
66
65
|
licenses:
|
67
66
|
- MIT
|
68
67
|
metadata:
|
69
68
|
allowed_push_host: https://rubygems.org
|
69
|
+
rubygems_mfa_required: 'true'
|
70
70
|
homepage_uri: https://github.com/raphox/next-rails#readme
|
71
71
|
source_code_uri: https://github.com/raphox/next-rails
|
72
72
|
changelog_uri: https://github.com/raphox/next-rails/blob/main/CHANGELOG.md
|
@@ -78,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements:
|
79
79
|
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
81
|
+
version: 3.3.0
|
82
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
84
|
- - ">="
|
data/next_rails_scaffold.gemspec
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "lib/next_rails_scaffold/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = "next_rails_scaffold"
|
7
|
-
spec.version = NextRailsScaffold::VERSION
|
8
|
-
spec.authors = ["Raphael Araújo"]
|
9
|
-
spec.email = ["raphox.araujo@gmail.com"]
|
10
|
-
|
11
|
-
spec.summary = <<~HEREDOC
|
12
|
-
The `next_rails_scaffold` gem enhances the default Ruby on Rails scaffold generator by seamlessly integrating with Next.js, a React framework. This gem automates the process of scaffolding a Rails application along with a corresponding frontend directory containing a Next.js application. The generated Next.js app includes all necessary pages and components, leveraging the power of page routing for a smooth and organized development experience.
|
13
|
-
HEREDOC
|
14
|
-
spec.description = <<~HEREDOC
|
15
|
-
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.
|
16
|
-
|
17
|
-
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.
|
18
|
-
|
19
|
-
Key Features:
|
20
|
-
|
21
|
-
- **Automatic Frontend Setup:** The gem automates the creation of a frontend directory within the Rails project, ready for Next.js development.
|
22
|
-
- **Page Routing Integration:** All scaffolded resources come with their own pages and components, organized using Next.js' page routing system.
|
23
|
-
- **Effortless Transition:** Developers can seamlessly switch between Rails backend and Next.js frontend development within the same project.
|
24
|
-
- **Boosted Productivity:** Accelerate development by eliminating the manual setup of frontend components and pages, allowing developers to focus on building features.
|
25
|
-
|
26
|
-
Integrate `next_rails_scaffold` into your Ruby on Rails projects to enjoy a streamlined, organized, and efficient full-stack development experience.
|
27
|
-
HEREDOC
|
28
|
-
spec.homepage = "https://github.com/raphox/next-rails#readme"
|
29
|
-
spec.license = "MIT"
|
30
|
-
spec.required_ruby_version = ">= 2.6.0"
|
31
|
-
|
32
|
-
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
33
|
-
|
34
|
-
spec.metadata["homepage_uri"] = spec.homepage
|
35
|
-
spec.metadata["source_code_uri"] = "https://github.com/raphox/next-rails"
|
36
|
-
spec.metadata["changelog_uri"] = "https://github.com/raphox/next-rails/blob/main/CHANGELOG.md"
|
37
|
-
|
38
|
-
# Specify which files should be added to the gem when it is released.
|
39
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
40
|
-
spec.files = Dir.chdir(__dir__) do
|
41
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
42
|
-
(File.expand_path(f) == __FILE__) ||
|
43
|
-
f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
|
44
|
-
end
|
45
|
-
end
|
46
|
-
spec.bindir = "exe"
|
47
|
-
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
48
|
-
spec.require_paths = ["lib"]
|
49
|
-
|
50
|
-
spec.add_dependency "rails", ">= 7.1.2"
|
51
|
-
|
52
|
-
# For more information and examples about making a new gem, check out our
|
53
|
-
# guide at: https://bundler.io/guides/creating_gem.html
|
54
|
-
end
|