Skip to content

Updated eslint-config-shakacode to 13.2.0 #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.0.0
7.2.0
18 changes: 11 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ language:
rvm:
- 2.3.1
sudo: false
notifications:
slack: shakacode:YvfXbuFMcFAHt6ZjABIs0KET
addons:
apt:
sources:
Expand All @@ -22,16 +24,18 @@ before_install:
- export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH
install:
- bundle install
- nvm install 6.9.1
- nvm use 6.9.1
- chromedriver-update
- nvm install stable && nvm alias default stable
- npm install npm@latest -g
- npm --version
- npm install
- npm run build:client && npm run build:server
- rake db:setup
# No need to run xvfb if running headless testing
#before_script:
# - export DISPLAY=:99.0
# - sh -e /etc/init.d/xvfb start
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

script:
- bundle exec rake db:schema:load
# - DRIVER=selenium_firefox bundle exec rake
- bundle exec rake
- DRIVER=poltergeist_errors_ok bundle exec rake
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ See package.json and Gemfile for versions

## Javascript development without Rails: using the Webpack Dev Server

We include a sample setup for developing your JavaScript files without Rails. However, this is no longer recommended as it's best to create your APIs in Rails, and take advantage of the hot reloading of your react components provided by this project.

1. Run the node server with file `server-express.js` with command `npm run` or `cd client && node server-express.js`.
2. Point your browser to [http://localhost:4000](http://localhost:4000)

Expand Down Expand Up @@ -141,6 +143,9 @@ Save a change to a JSX file and see it update immediately in the browser! Note,
<%= env_javascript_include_tag(static: 'application_static', hot: 'application_non_webpack', options: { 'data-turbolinks-track' => true }) %>
```

## Testing

+ Be sure to see [Integration Test Notes](./docs/integration-test-notes.md) for advice on running your integration tests.

+ **Testing Mode**: When running tests, it is useful to run `foreman start -f Procfile.spec` in order to have webpack automatically recompile the static bundles. Rspec is configured to automatically check whether or not this process is running. If it is not, it will automatically rebuild the webpack bundle to ensure you are not running tests on stale client code. This is achieved via the `ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)`
line in the `rails_helper.rb` file. If you are using this project as an example and are not using RSpec, you may want to implement similar logic in your own project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Button from 'react-bootstrap/lib/Button';
import Nav from 'react-bootstrap/lib/Nav';
import NavItem from 'react-bootstrap/lib/NavItem';
import Alert from 'react-bootstrap/lib/Alert';
import ReactCSSTransitionGroup from 'react/lib/ReactCSSTransitionGroup';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
import _ from 'lodash';

import BaseComponent from 'libs/components/BaseComponent';
Expand Down Expand Up @@ -180,7 +180,7 @@ export default class CommentForm extends BaseComponent {
return (
<div>
<hr />
<form className="commentForm form" onSubmit={this.handleSubmit}>
<form className="commentForm form form-stacked" onSubmit={this.handleSubmit}>
<FormGroup controlId="formBasicName">
<ControlLabel>Name</ControlLabel>
<FormControl
Expand Down Expand Up @@ -227,7 +227,7 @@ export default class CommentForm extends BaseComponent {
return (
<div>
<hr />
<Form inline className="commentForm form-inline" onSubmit={this.handleSubmit}>
<Form inline className="commentForm" onSubmit={this.handleSubmit}>
<FormGroup controlId="formInlineName" >
<ControlLabel>
Name
Expand Down Expand Up @@ -311,12 +311,16 @@ export default class CommentForm extends BaseComponent {

const { cssTransitionGroupClassNames } = this.props;

// For animation with ReactCSSTransitionGroup
// https://facebook.github.io/react/docs/animation.html
// The 500 must correspond to the 0.5s in:
// client/app/bundles/comments/components/CommentBox/CommentBox.scss:6
return (
<div>
<ReactCSSTransitionGroup
transitionName={cssTransitionGroupClassNames}
transitionEnterTimeout={300}
transitionLeaveTimeout={300}
transitionEnterTimeout={500}
transitionLeaveTimeout={500}
>
{this.errorWarning()}
</ReactCSSTransitionGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const {
describe('Comment', () => {
it('renders an author and comment with proper css classes', () => {
const component = renderIntoDocument(
<Comment author="Frank" text="Hi!" />
<Comment author="Frank" text="Hi!" />,
);

// TODO: Setup testing of CSS Modules classNames
Expand All @@ -25,7 +25,7 @@ describe('Comment', () => {

it('shows the author', () => {
const component = renderIntoDocument(
<Comment author="Frank" text="Hi!" />
<Comment author="Frank" text="Hi!" />,
);

const author = findRenderedDOMComponentWithClass(component, 'js-comment-author');
Expand All @@ -34,7 +34,7 @@ describe('Comment', () => {

it('shows the comment text in markdown', () => {
const component = renderIntoDocument(
<Comment author="Frank" text="Hi!" />
<Comment author="Frank" text="Hi!" />,
);

const comment = findRenderedDOMComponentWithClass(component, 'js-comment-text');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Alert from 'react-bootstrap/lib/Alert';
import BaseComponent from 'libs/components/BaseComponent';
import Immutable from 'immutable';
import React, { PropTypes } from 'react';
import ReactCSSTransitionGroup from 'react/lib/ReactCSSTransitionGroup';
import ReactCSSTransitionGroup from 'react-addons-css-transition-group';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import _ from 'lodash';

import Comment from './Comment/Comment';
Expand Down Expand Up @@ -44,9 +44,13 @@ export default class CommentList extends BaseComponent {
key={$$comment.get('id') || index}
author={$$comment.get('author')}
text={$$comment.get('text')}
/>
/>,
);

// For animation with ReactCSSTransitionGroup
// https://facebook.github.io/react/docs/animation.html
// The 500 must correspond to the 0.5s in:
// client/app/bundles/comments/components/CommentBox/CommentBox.scss:6
return (
<div>
<ReactCSSTransitionGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('CommentList', () => {
<CommentList
$$comments={comments}
cssTransitionGroupClassNames={cssTransitionGroupClassNames}
/>
/>,
);
const list = scryRenderedComponentsWithType(component, Comment);
expect(list.length).to.equal(2);
Expand All @@ -49,7 +49,7 @@ describe('CommentList', () => {
<CommentList
$$comments={comments} error="zomg"
cssTransitionGroupClassNames={cssTransitionGroupClassNames}
/>
/>,
);

const alert = findRenderedDOMComponentWithTag(component, 'strong');
Expand Down
2 changes: 1 addition & 1 deletion client/app/bundles/comments/reducers/commentsReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function commentsReducer($$state = $$initialState, action = null)
state
.updateIn(
['$$comments'],
$$comments => $$comments.unshift(Immutable.fromJS(comment))
$$comments => $$comments.unshift(Immutable.fromJS(comment)),
)
.merge({
submitCommentError: null,
Expand Down
2 changes: 1 addition & 1 deletion client/app/bundles/comments/startup/ClientRouterApp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default (_props, _railsContext) => {
// Create an enhanced history that syncs navigation events with the store
const history = syncHistoryWithStore(
browserHistory,
store
store,
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const RouterAppExpress = (_props, _railsContext) => {
// Create an enhanced history that syncs navigation events with the store
const history = syncHistoryWithStore(
browserHistory,
store
store,
);

return (
Expand Down
2 changes: 1 addition & 1 deletion client/app/bundles/comments/startup/serverRegistration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ReactOnRails.register(
RouterApp,
NavigationBarApp,
SimpleCommentScreen,
}
},
);

ReactOnRails.registerStore({
Expand Down
2 changes: 1 addition & 1 deletion client/app/bundles/comments/store/commentsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default (props, railsContext) => {

const reducer = combineReducers(reducers);
const composedStore = compose(
applyMiddleware(thunkMiddleware, loggerMiddleware)
applyMiddleware(thunkMiddleware, loggerMiddleware),
);

return composedStore(createStore)(reducer, initialState);
Expand Down
2 changes: 1 addition & 1 deletion client/app/bundles/comments/store/routerCommentsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default (props, railsContext) => {

// Sync dispatched route actions to the history
const finalCreateStore = compose(
applyMiddleware(thunkMiddleware, loggerMiddleware)
applyMiddleware(thunkMiddleware, loggerMiddleware),
)(createStore);

return finalCreateStore(reducer, initialState);
Expand Down
1 change: 0 additions & 1 deletion client/app/libs/middlewares/loggerMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export default function logger({ getState }) {
readableState[storeItem] = (
state[storeItem].toJS ? state[storeItem].toJS() : state[storeItem]
);
return;
});

console.log('state after dispatch', readableState);
Expand Down
Loading