Skip to content

Commit cba5b53

Browse files
committed
Rails new for demo of React on Rails v12
rails new --skip-sprockets -J --skip-turbolinks test-react-on-rails-v12-ssr-v2
0 parents  commit cba5b53

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1294
-0
lines changed

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
# Ignore bundler config.
8+
/.bundle
9+
10+
# Ignore the default SQLite database.
11+
/db/*.sqlite3
12+
/db/*.sqlite3-journal
13+
/db/*.sqlite3-*
14+
15+
# Ignore all logfiles and tempfiles.
16+
/log/*
17+
/tmp/*
18+
!/log/.keep
19+
!/tmp/.keep
20+
21+
# Ignore pidfiles, but keep the directory.
22+
/tmp/pids/*
23+
!/tmp/pids/
24+
!/tmp/pids/.keep
25+
26+
# Ignore uploaded files in development.
27+
/storage/*
28+
!/storage/.keep
29+
30+
/public/assets
31+
.byebug_history
32+
33+
# Ignore master key for decrypting credentials and more.
34+
/config/master.key

Gemfile

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
source 'https://rubygems.org'
2+
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3+
4+
ruby '2.7.1'
5+
6+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
7+
gem 'rails', '~> 6.0.3', '>= 6.0.3.1'
8+
# Use sqlite3 as the database for Active Record
9+
gem 'sqlite3', '~> 1.4'
10+
# Use Puma as the app server
11+
gem 'puma', '~> 4.1'
12+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
13+
gem 'jbuilder', '~> 2.7'
14+
# Use Redis adapter to run Action Cable in production
15+
# gem 'redis', '~> 4.0'
16+
# Use Active Model has_secure_password
17+
# gem 'bcrypt', '~> 3.1.7'
18+
19+
# Use Active Storage variant
20+
# gem 'image_processing', '~> 1.2'
21+
22+
# Reduces boot times through caching; required in config/boot.rb
23+
gem 'bootsnap', '>= 1.4.2', require: false
24+
25+
group :development, :test do
26+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
27+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
28+
end
29+
30+
group :development do
31+
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
32+
gem 'web-console', '>= 3.3.0'
33+
gem 'listen', '~> 3.2'
34+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
35+
gem 'spring'
36+
gem 'spring-watcher-listen', '~> 2.0.0'
37+
end
38+
39+
group :test do
40+
# Adds support for Capybara system testing and selenium driver
41+
gem 'capybara', '>= 2.15'
42+
gem 'selenium-webdriver'
43+
# Easy installation and use of web drivers to run system tests with browsers
44+
gem 'webdrivers'
45+
end
46+
47+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
48+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.lock

+200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
actioncable (6.0.3.2)
5+
actionpack (= 6.0.3.2)
6+
nio4r (~> 2.0)
7+
websocket-driver (>= 0.6.1)
8+
actionmailbox (6.0.3.2)
9+
actionpack (= 6.0.3.2)
10+
activejob (= 6.0.3.2)
11+
activerecord (= 6.0.3.2)
12+
activestorage (= 6.0.3.2)
13+
activesupport (= 6.0.3.2)
14+
mail (>= 2.7.1)
15+
actionmailer (6.0.3.2)
16+
actionpack (= 6.0.3.2)
17+
actionview (= 6.0.3.2)
18+
activejob (= 6.0.3.2)
19+
mail (~> 2.5, >= 2.5.4)
20+
rails-dom-testing (~> 2.0)
21+
actionpack (6.0.3.2)
22+
actionview (= 6.0.3.2)
23+
activesupport (= 6.0.3.2)
24+
rack (~> 2.0, >= 2.0.8)
25+
rack-test (>= 0.6.3)
26+
rails-dom-testing (~> 2.0)
27+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
28+
actiontext (6.0.3.2)
29+
actionpack (= 6.0.3.2)
30+
activerecord (= 6.0.3.2)
31+
activestorage (= 6.0.3.2)
32+
activesupport (= 6.0.3.2)
33+
nokogiri (>= 1.8.5)
34+
actionview (6.0.3.2)
35+
activesupport (= 6.0.3.2)
36+
builder (~> 3.1)
37+
erubi (~> 1.4)
38+
rails-dom-testing (~> 2.0)
39+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
40+
activejob (6.0.3.2)
41+
activesupport (= 6.0.3.2)
42+
globalid (>= 0.3.6)
43+
activemodel (6.0.3.2)
44+
activesupport (= 6.0.3.2)
45+
activerecord (6.0.3.2)
46+
activemodel (= 6.0.3.2)
47+
activesupport (= 6.0.3.2)
48+
activestorage (6.0.3.2)
49+
actionpack (= 6.0.3.2)
50+
activejob (= 6.0.3.2)
51+
activerecord (= 6.0.3.2)
52+
marcel (~> 0.3.1)
53+
activesupport (6.0.3.2)
54+
concurrent-ruby (~> 1.0, >= 1.0.2)
55+
i18n (>= 0.7, < 2)
56+
minitest (~> 5.1)
57+
tzinfo (~> 1.1)
58+
zeitwerk (~> 2.2, >= 2.2.2)
59+
addressable (2.7.0)
60+
public_suffix (>= 2.0.2, < 5.0)
61+
bindex (0.8.1)
62+
bootsnap (1.4.7)
63+
msgpack (~> 1.0)
64+
builder (3.2.4)
65+
byebug (11.1.3)
66+
capybara (3.33.0)
67+
addressable
68+
mini_mime (>= 0.1.3)
69+
nokogiri (~> 1.8)
70+
rack (>= 1.6.0)
71+
rack-test (>= 0.6.3)
72+
regexp_parser (~> 1.5)
73+
xpath (~> 3.2)
74+
childprocess (3.0.0)
75+
concurrent-ruby (1.1.6)
76+
crass (1.0.6)
77+
erubi (1.9.0)
78+
ffi (1.13.1)
79+
globalid (0.4.2)
80+
activesupport (>= 4.2.0)
81+
i18n (1.8.5)
82+
concurrent-ruby (~> 1.0)
83+
jbuilder (2.10.0)
84+
activesupport (>= 5.0.0)
85+
listen (3.2.1)
86+
rb-fsevent (~> 0.10, >= 0.10.3)
87+
rb-inotify (~> 0.9, >= 0.9.10)
88+
loofah (2.6.0)
89+
crass (~> 1.0.2)
90+
nokogiri (>= 1.5.9)
91+
mail (2.7.1)
92+
mini_mime (>= 0.1.1)
93+
marcel (0.3.3)
94+
mimemagic (~> 0.3.2)
95+
method_source (1.0.0)
96+
mimemagic (0.3.5)
97+
mini_mime (1.0.2)
98+
mini_portile2 (2.4.0)
99+
minitest (5.14.1)
100+
msgpack (1.3.3)
101+
nio4r (2.5.2)
102+
nokogiri (1.10.10)
103+
mini_portile2 (~> 2.4.0)
104+
public_suffix (4.0.5)
105+
puma (4.3.5)
106+
nio4r (~> 2.0)
107+
rack (2.2.3)
108+
rack-test (1.1.0)
109+
rack (>= 1.0, < 3)
110+
rails (6.0.3.2)
111+
actioncable (= 6.0.3.2)
112+
actionmailbox (= 6.0.3.2)
113+
actionmailer (= 6.0.3.2)
114+
actionpack (= 6.0.3.2)
115+
actiontext (= 6.0.3.2)
116+
actionview (= 6.0.3.2)
117+
activejob (= 6.0.3.2)
118+
activemodel (= 6.0.3.2)
119+
activerecord (= 6.0.3.2)
120+
activestorage (= 6.0.3.2)
121+
activesupport (= 6.0.3.2)
122+
bundler (>= 1.3.0)
123+
railties (= 6.0.3.2)
124+
sprockets-rails (>= 2.0.0)
125+
rails-dom-testing (2.0.3)
126+
activesupport (>= 4.2.0)
127+
nokogiri (>= 1.6)
128+
rails-html-sanitizer (1.3.0)
129+
loofah (~> 2.3)
130+
railties (6.0.3.2)
131+
actionpack (= 6.0.3.2)
132+
activesupport (= 6.0.3.2)
133+
method_source
134+
rake (>= 0.8.7)
135+
thor (>= 0.20.3, < 2.0)
136+
rake (13.0.1)
137+
rb-fsevent (0.10.4)
138+
rb-inotify (0.10.1)
139+
ffi (~> 1.0)
140+
regexp_parser (1.7.1)
141+
rubyzip (2.3.0)
142+
selenium-webdriver (3.142.7)
143+
childprocess (>= 0.5, < 4.0)
144+
rubyzip (>= 1.2.2)
145+
spring (2.1.0)
146+
spring-watcher-listen (2.0.1)
147+
listen (>= 2.7, < 4.0)
148+
spring (>= 1.2, < 3.0)
149+
sprockets (4.0.2)
150+
concurrent-ruby (~> 1.0)
151+
rack (> 1, < 3)
152+
sprockets-rails (3.2.1)
153+
actionpack (>= 4.0)
154+
activesupport (>= 4.0)
155+
sprockets (>= 3.0.0)
156+
sqlite3 (1.4.2)
157+
thor (1.0.1)
158+
thread_safe (0.3.6)
159+
tzinfo (1.2.7)
160+
thread_safe (~> 0.1)
161+
web-console (4.0.4)
162+
actionview (>= 6.0.0)
163+
activemodel (>= 6.0.0)
164+
bindex (>= 0.4.0)
165+
railties (>= 6.0.0)
166+
webdrivers (4.4.1)
167+
nokogiri (~> 1.6)
168+
rubyzip (>= 1.3.0)
169+
selenium-webdriver (>= 3.0, < 4.0)
170+
websocket-driver (0.7.3)
171+
websocket-extensions (>= 0.1.0)
172+
websocket-extensions (0.1.5)
173+
xpath (3.2.0)
174+
nokogiri (~> 1.8)
175+
zeitwerk (2.4.0)
176+
177+
PLATFORMS
178+
ruby
179+
180+
DEPENDENCIES
181+
bootsnap (>= 1.4.2)
182+
byebug
183+
capybara (>= 2.15)
184+
jbuilder (~> 2.7)
185+
listen (~> 3.2)
186+
puma (~> 4.1)
187+
rails (~> 6.0.3, >= 6.0.3.1)
188+
selenium-webdriver
189+
spring
190+
spring-watcher-listen (~> 2.0.0)
191+
sqlite3 (~> 1.4)
192+
tzinfo-data
193+
web-console (>= 3.3.0)
194+
webdrivers
195+
196+
RUBY VERSION
197+
ruby 2.7.1p83
198+
199+
BUNDLED WITH
200+
2.1.4

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# README
2+
3+
This README would normally document whatever steps are necessary to get the
4+
application up and running.
5+
6+
Things you may want to cover:
7+
8+
* Ruby version
9+
10+
* System dependencies
11+
12+
* Configuration
13+
14+
* Database creation
15+
16+
* Database initialization
17+
18+
* How to run the test suite
19+
20+
* Services (job queues, cache servers, search engines, etc.)
21+
22+
* Deployment instructions
23+
24+
* ...

Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative 'config/application'
5+
6+
Rails.application.load_tasks

app/assets/config/manifest.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//= link_tree ../images
2+
//= link_directory ../stylesheets .css

app/assets/images/.keep

Whitespace-only changes.
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* This is a manifest file that'll be compiled into application.css, which will include all the files
3+
* listed below.
4+
*
5+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
7+
*
8+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10+
* files in this directory. Styles in this file should be added after the last require_* statement.
11+
* It is generally better to create a new file per style scope.
12+
*
13+
*= require_tree .
14+
*= require_self
15+
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Channel < ActionCable::Channel::Base
3+
end
4+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module ApplicationCable
2+
class Connection < ActionCable::Connection::Base
3+
end
4+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class ApplicationController < ActionController::Base
2+
end

app/controllers/concerns/.keep

Whitespace-only changes.

app/helpers/application_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end

app/jobs/application_job.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class ApplicationJob < ActiveJob::Base
2+
# Automatically retry jobs that encountered a deadlock
3+
# retry_on ActiveRecord::Deadlocked
4+
5+
# Most jobs are safe to ignore if the underlying records are no longer available
6+
# discard_on ActiveJob::DeserializationError
7+
end

app/mailers/application_mailer.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class ApplicationMailer < ActionMailer::Base
2+
default from: '[email protected]'
3+
layout 'mailer'
4+
end

app/models/application_record.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class ApplicationRecord < ActiveRecord::Base
2+
self.abstract_class = true
3+
end

app/models/concerns/.keep

Whitespace-only changes.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>TestReactOnRailsV12SsrV2</title>
5+
<%= csrf_meta_tags %>
6+
<%= csp_meta_tag %>
7+
8+
<%= stylesheet_link_tag 'application', media: 'all' %>
9+
</head>
10+
11+
<body>
12+
<%= yield %>
13+
</body>
14+
</html>

app/views/layouts/mailer.html.erb

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5+
<style>
6+
/* Email styles need to be inline */
7+
</style>
8+
</head>
9+
10+
<body>
11+
<%= yield %>
12+
</body>
13+
</html>

app/views/layouts/mailer.text.erb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= yield %>

0 commit comments

Comments
 (0)