From a800ba8d8e1bdcc084871392ec97d7469165d3d8 Mon Sep 17 00:00:00 2001 From: Aaron Van Bokhoven Date: Mon, 15 Feb 2016 21:37:34 -1000 Subject: [PATCH] Update Base Generator Helpful Message - Add info for hot reloading server npm cmd. - Remove duplicate code from redux generator helpful msg because base now prints the same msg. - Update tests to reflect changes. - Update CHANGELOG. --- CHANGELOG.md | 7 ++++- .../react_on_rails/base_generator.rb | 6 +++++ .../react_with_redux_generator.rb | 11 -------- .../generators/install_generator_spec.rb | 27 ++++++++++++++++--- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 864de1d25..c02365eb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. Items under Contributors: please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version. ## [Unreleased] +## [3.0.2] - 2016-02-15 +##### Fixed +- Fixed missing information in the helpful message after running the base install generator regarding how to run the node server with hot reloading support. + ## [3.0.1] - 2016-02-15 ##### Fixed - Fixed several jscs linter issues. @@ -169,7 +173,8 @@ Best done with Object destructing: ##### Fixed - Fix several generator related issues. -[Unreleased]: https://github.com/shakacode/react_on_rails/compare/3.0.1...master +[Unreleased]: https://github.com/shakacode/react_on_rails/compare/3.0.2...master +[3.0.2]: https://github.com/shakacode/react_on_rails/compare/3.0.1...3.0.2 [3.0.1]: https://github.com/shakacode/react_on_rails/compare/3.0.0...3.0.1 [3.0.0]: https://github.com/shakacode/react_on_rails/compare/2.3.0...3.0.0 [2.3.0]: https://github.com/shakacode/react_on_rails/compare/2.2.0...2.3.0 diff --git a/lib/generators/react_on_rails/base_generator.rb b/lib/generators/react_on_rails/base_generator.rb index 1bb707815..30d556829 100644 --- a/lib/generators/react_on_rails/base_generator.rb +++ b/lib/generators/react_on_rails/base_generator.rb @@ -207,6 +207,12 @@ def print_helpful_message npm run rails-server - Visit http://localhost:3000/hello_world and see your React On Rails app running! + + - Run the npm express-server command to load the node server with hot reloading support. + + npm run express-server + + - Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server. MSG GeneratorMessages.add_info(message) end diff --git a/lib/generators/react_on_rails/react_with_redux_generator.rb b/lib/generators/react_on_rails/react_with_redux_generator.rb index 32511bfa1..884335990 100644 --- a/lib/generators/react_on_rails/react_with_redux_generator.rb +++ b/lib/generators/react_on_rails/react_with_redux_generator.rb @@ -45,17 +45,6 @@ def template_appropriate_version_of_hello_world_app_client location = "client/app/bundles/HelloWorld/startup" template("redux/base/#{location}/HelloWorldAppClient.jsx.tt", "#{location}/#{filename}") end - - def print_helpful_message - message = <<-MSG - - Run the npm express-server command to load the node server with hot reloading support. - - npm run express-server - - - Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server. - MSG - GeneratorMessages.add_info(message) - end end end end diff --git a/spec/react_on_rails/generators/install_generator_spec.rb b/spec/react_on_rails/generators/install_generator_spec.rb index c92de5114..8c1874e58 100644 --- a/spec/react_on_rails/generators/install_generator_spec.rb +++ b/spec/react_on_rails/generators/install_generator_spec.rb @@ -245,6 +245,12 @@ npm run rails-server - Visit http://localhost:3000/hello_world and see your React On Rails app running! + + - Run the npm express-server command to load the node server with hot reloading support. + + npm run express-server + + - Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server. MSG expect(GeneratorMessages.output) .to include(GeneratorMessages.format_info(expected)) @@ -252,12 +258,25 @@ specify "react with redux generator contains a helpful message" do run_generator_test_with_args(%w(--redux)) - expected = <<-MSG - - Run the npm express-server command to load the node server with hot reloading support. + expected = <<-MSG.strip_heredoc + + What to do next: + + - Ensure your bundle and npm are up to date. + + bundle && npm i + + - Run the npm rails-server command to load the rails server. + + npm run rails-server + + - Visit http://localhost:3000/hello_world and see your React On Rails app running! + + - Run the npm express-server command to load the node server with hot reloading support. - npm run express-server + npm run express-server - - Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server. + - Visit http://localhost:4000 and see your React On Rails app running using the Webpack Dev server. MSG expect(GeneratorMessages.output) .to include(GeneratorMessages.format_info(expected))