Skip to content

Commit

Permalink
fix(commands): Fix 'npm run clean' breaking (react-boilerplate#1185)
Browse files Browse the repository at this point in the history
Added a constants.js file to templates that contains the DEFAULT_LOCALE
export to be added to containers/App/constants on 'npm run clean'.
  • Loading branch information
j-rooks authored and mxstbr committed Nov 3, 2016
1 parent 3fdad6a commit cea4812
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internals/scripts/clean.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require('shelljs/global');
const addCheckMark = require('./helpers/checkmark.js');
const addCheckMark = require('./helpers/checkmark.js');

if (!which('git')) {
echo('Sorry, this script requires git');
Expand All @@ -22,6 +22,7 @@ mkdir('-p', 'app/containers/App');
mkdir('-p', 'app/containers/NotFoundPage');
mkdir('-p', 'app/containers/HomePage');
cp('internals/templates/appContainer.js', 'app/containers/App/index.js');
cp('internals/templates/constants.js', 'app/containers/App/constants.js');
cp('internals/templates/notFoundPage/notFoundPage.js', 'app/containers/NotFoundPage/index.js');
cp('internals/templates/notFoundPage/messages.js', 'app/containers/NotFoundPage/messages.js');
cp('internals/templates/homePage/homePage.js', 'app/containers/HomePage/index.js');
Expand Down
12 changes: 12 additions & 0 deletions internals/templates/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* AppConstants
* Each action has a corresponding type, which the reducer knows and picks up on.
* To avoid weird typos between the reducer and the actions, we save them as
* constants here. We prefix them with 'yourproject/YourComponent' so we avoid
* reducers accidentally picking up actions they shouldn't.
*
* Follow this format:
* export const YOUR_ACTION_CONSTANT = 'yourproject/YourContainer/YOUR_ACTION_CONSTANT';
*/

export const DEFAULT_LOCALE = 'en';

0 comments on commit cea4812

Please sign in to comment.