Skip to content

Commit 52ae6f1

Browse files
committed
use rake react_on_rails:locale to generate js locale files in test
1 parent bf6721d commit 52ae6f1

7 files changed

+6
-13
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ install:
2929
- npm install npm@latest -g
3030
- npm --version
3131
- npm install
32-
- rake db:setup
3332
- npm run build:client && npm run build:server
33+
- rake db:setup
3434

3535
# Tip: No need to run xvfb if running headless testing. However, we're going to start with
3636
# Poltergeist and switch to selenium if a test fails.

Procfile.dev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
rails: REACT_ON_RAILS_ENV=HOT rails s -b 0.0.0.0
88

99
# Run the hot reload server for client development
10-
hot-assets: sh -c 'rm app/assets/webpack/* || true && HOT_RAILS_PORT=3500 npm run hot-assets'
10+
hot-assets: sh -c 'rm app/assets/webpack/* || true && bundle exec rake react_on_rails:locale && HOT_RAILS_PORT=3500 npm run hot-assets'
1111

1212
# Render static client assets
1313
rails-static-client-assets: sh -c 'npm run build:dev:client'

Procfile.hot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
rails: REACT_ON_RAILS_ENV=HOT rails s -b 0.0.0.0
77

88
# Run the hot reload server for client development
9-
hot-assets: sh -c 'rm app/assets/webpack/* || true && HOT_RAILS_PORT=3500 npm run hot-assets'
9+
hot-assets: sh -c 'rm app/assets/webpack/* || true && bundle exec rake react_on_rails:locale && HOT_RAILS_PORT=3500 npm run hot-assets'
1010

1111
# Keep the JS fresh for server rendering. Remove if not server rendering
1212
rails-server-assets: sh -c 'npm run build:dev:server'

Procfile.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# in rails_helper.rb.
44

55
# Build client assets, watching for changes.
6-
rails-client-assets: sh -c 'npm run build:dev:client'
6+
rails-client-assets: sh -c 'bundle exec rake react_on_rails:locale && npm run build:dev:client'
77

88
# Build server assets, watching for changes. Remove if not server rendering.
99
rails-server-assets: sh -c 'npm run build:dev:server'

Procfile.static

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
rails: REACT_ON_RAILS_ENV= rails s -b 0.0.0.0
33

44
# Build client assets, watching for changes.
5-
rails-client-assets: rm app/assets/webpack/* || true && npm run build:dev:client
5+
rails-client-assets: rm app/assets/webpack/* || true && bundle exec rake react_on_rails:locale && npm run build:dev:client
66

77
# Build server assets, watching for changes. Remove if not server rendering.
88
rails-server-assets: npm run build:dev:server

Procfile.static.trace

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
rails: TRACE_REACT_ON_RAILS=TRUE rails s -b 0.0.0.0
33

44
# Build client assets, watching for changes.
5-
rails-client-assets: npm run build:dev:client
5+
rails-client-assets: bundle exec rake react_on_rails:locale && npm run build:dev:client
66

77
# Build server assets, watching for changes. Remove if not server rendering.
88
rails-server-assets: npm run build:dev:server

config/application.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,5 @@ class Application < Rails::Application
1212
# Application configuration should go into files in config/initializers
1313
# -- all .rb files in that directory are automatically loaded.
1414
config.action_cable.allowed_request_origins = [Rails.application.secrets.action_cable_url]
15-
16-
################################################################################
17-
# ReactOnRails will convert rails locales to javascript files for react-intl.
18-
################################################################################
19-
config.after_initialize do
20-
ReactOnRails::LocalesToJs.new
21-
end
2215
end
2316
end

0 commit comments

Comments
 (0)