Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 36afa88

Browse files
use rake react_on_rails:locale to generate js locale files in test
1 parent bf6721d commit 36afa88

File tree

8 files changed

+9
-13
lines changed

8 files changed

+9
-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

‎client/package.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
"build:server": "webpack --config webpack.server.rails.build.config.js",
3636
"build:test": "npm run build:client && npm run build:server",
3737
"build:production": "npm run build:production:client && npm run build:production:server",
38+
"prebuild:production": "rake react_on_rails:locale",
39+
"prebuild:client": "rake react_on_rails:locale",
40+
"prebuild:server": "rake react_on_rails:locale",
3841
"hot-assets": "babel-node server-rails-hot.js",
3942
"lint": "eslint --ext .js,.jsx ."
4043
},

‎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)

AltStyle によって変換されたページ (->オリジナル) /