react-rails-api 0.1.4 → 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/README.md +15 -0
- data/lib/react-rails-api/cli.rb +1 -0
- data/lib/react-rails-api/template.rb +8 -1
- data/lib/react-rails-api/templates/.gitignore.tt +2 -0
- data/lib/react-rails-api/templates/application_controller.rb.tt +5 -0
- data/lib/react-rails-api/templates/production.rb.tt +6 -0
- data/lib/react-rails-api/templates/routes.rb.tt +5 -0
- data/lib/react-rails-api/templates/start.rake.tt +0 -5
- data/lib/react-rails-api/version.rb +2 -2
- data/react-rails-api.gemspec +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9b959a6334b55fb25168c8e5243ac4cb3d978b15f43babe1e287a3b8508e385
|
4
|
+
data.tar.gz: 24b052aab15528ea0a749b9b399f5636cd7474eaa63b27c3ca09c19686cf2dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3800e1472ab63bc088e5f96262c4c76850cef596d362ddfef44bfdbc48e330fc7acc6e7a7227add6af87ca774a3c0718341f339dc575f4b0af1f4e9f004793d
|
7
|
+
data.tar.gz: 7c0ed2455fed27f51c76eabfb6b5f8dbbc8e1959e70bfa2d73f9c9f5a50d6f8ccf5d4f5e15a994a8689aedbad2e68c9d0fdf5bb4694e635557b75a53e446e4ca
|
data/README.md
CHANGED
@@ -61,6 +61,21 @@ There are two `rake` tasks that allow you to run development and production buil
|
|
61
61
|
- `start:development` - Starts a development build of the application (running `Procfile.dev`).
|
62
62
|
- `start:production` - Starts a production build of the application (running `Procfile`).
|
63
63
|
|
64
|
+
### Troubleshooting and common errors
|
65
|
+
|
66
|
+
- **Error when precompiling assets on Heroku** (`failed to load command: webpack`)
|
67
|
+
|
68
|
+
This is often as a result of the auto-detected Ruby and Node.js buildpacks being ran in the wrong order.
|
69
|
+
|
70
|
+
This can be fixed by running the following commands in the application's directory:
|
71
|
+
|
72
|
+
```bash
|
73
|
+
$ heroku buildpacks:add heroku/nodejs -i 1
|
74
|
+
$ heroku buildpacks:add heroku/ruby -i 2
|
75
|
+
```
|
76
|
+
|
77
|
+
This ensures that `webpack` is installed before trying to precompile the assets.
|
78
|
+
|
64
79
|
## More information
|
65
80
|
|
66
81
|
For more information about how to use this stack, please read the following blog posts by Charlie Gleason:
|
data/lib/react-rails-api/cli.rb
CHANGED
@@ -81,8 +81,15 @@ after_bundle do
|
|
81
81
|
|
82
82
|
# Add /api scope in config/routes.rb
|
83
83
|
inject_into_file 'routes.rb', template('routes.rb.tt'), before: /^end/
|
84
|
+
|
85
|
+
inside 'environments' do
|
86
|
+
inject_into_file 'production.rb', template('production.rb.tt'), before: /^end/
|
87
|
+
end
|
84
88
|
end
|
85
89
|
|
90
|
+
# Add /public/assets to .gitignore
|
91
|
+
inject_into_file '.gitignore', template('.gitignore.tt'), after: /^\/public\/packs-test/
|
92
|
+
|
86
93
|
if database
|
87
94
|
rails_command 'db:create'
|
88
95
|
|
@@ -102,7 +109,7 @@ after_bundle do
|
|
102
109
|
|
103
110
|
# Create a production Procfile for running the application
|
104
111
|
file 'Procfile', template('Procfile.tt')
|
105
|
-
inject_into_file 'Procfile',
|
112
|
+
inject_into_file 'Procfile', "release: bundle exec rake db:migrate\n", after: "\n" if database
|
106
113
|
|
107
114
|
# Create a rake task for starting the application in the development environment
|
108
115
|
inside File.join('lib', 'tasks') do
|
@@ -3,11 +3,6 @@ namespace :start do
|
|
3
3
|
task :development do
|
4
4
|
exec 'foreman start -f Procfile.dev'
|
5
5
|
end
|
6
|
-
|
7
|
-
desc 'Start production server'
|
8
|
-
task :production do
|
9
|
-
exec 'NPM_CONFIG_PRODUCTION=true yarn postinstall && foreman start'
|
10
|
-
end
|
11
6
|
end
|
12
7
|
|
13
8
|
task start: 'start:development'
|
data/react-rails-api.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'react-rails-api'
|
7
7
|
spec.version = ReactRailsAPI::VERSION
|
8
8
|
spec.authors = ['Edwin Onuonga']
|
9
|
-
spec.email = ['
|
9
|
+
spec.email = ['ed@eonu.net']
|
10
10
|
spec.license = 'MIT'
|
11
11
|
|
12
12
|
spec.summary = %q{All-in-one application generator enabling the integration of a React front-end and a Ruby-on-Rails API back-end with ActiveAdmin CMS.}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: react-rails-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edwin Onuonga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -68,7 +68,7 @@ dependencies:
|
|
68
68
|
version: '12.3'
|
69
69
|
description:
|
70
70
|
email:
|
71
|
-
-
|
71
|
+
- ed@eonu.net
|
72
72
|
executables:
|
73
73
|
- react-rails
|
74
74
|
extensions: []
|
@@ -82,11 +82,13 @@ files:
|
|
82
82
|
- lib/react-rails-api/cli.rb
|
83
83
|
- lib/react-rails-api/template.rb
|
84
84
|
- lib/react-rails-api/templates/.env.tt
|
85
|
+
- lib/react-rails-api/templates/.gitignore.tt
|
85
86
|
- lib/react-rails-api/templates/Procfile.dev.tt
|
86
87
|
- lib/react-rails-api/templates/Procfile.tt
|
87
88
|
- lib/react-rails-api/templates/application.rb.tt
|
88
89
|
- lib/react-rails-api/templates/application_controller.rb.tt
|
89
90
|
- lib/react-rails-api/templates/database.yml.tt
|
91
|
+
- lib/react-rails-api/templates/production.rb.tt
|
90
92
|
- lib/react-rails-api/templates/routes.rb.tt
|
91
93
|
- lib/react-rails-api/templates/start.rake.tt
|
92
94
|
- lib/react-rails-api/version.rb
|