{"action":"created","issue":{"url":"https://api.github.com/repos/poetic/stanza/issues/25","repository_url":"https://api.github.com/repos/poetic/stanza","labels_url":"https://api.github.com/repos/poetic/stanza/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/poetic/stanza/issues/25/comments","events_url":"https://api.github.com/repos/poetic/stanza/issues/25/events","html_url":"https://github.com/poetic/stanza/issues/25","id":158457908,"number":25,"title":"Errors when running npm test on a new stanza-generated meteor project","user":{"login":"dvmorris","id":186253,"avatar_url":"https://avatars.githubusercontent.com/u/186253?v=3","gravatar_id":"","url":"https://api.github.com/users/dvmorris","html_url":"https://github.com/dvmorris","followers_url":"https://api.github.com/users/dvmorris/followers","following_url":"https://api.github.com/users/dvmorris/following{/other_user}","gists_url":"https://api.github.com/users/dvmorris/gists{/gist_id}","starred_url":"https://api.github.com/users/dvmorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvmorris/subscriptions","organizations_url":"https://api.github.com/users/dvmorris/orgs","repos_url":"https://api.github.com/users/dvmorris/repos","events_url":"https://api.github.com/users/dvmorris/events{/privacy}","received_events_url":"https://api.github.com/users/dvmorris/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-03T21:26:17Z","updated_at":"2016-06-03T22:13:09Z","closed_at":null,"body":"On a newly generated stanza project from WebFlow with `stanza -u`, I get a series of errors when running `npm test`. I was able to resolve them, and will provide the contents of AppWrapper.jsx below.\r\n\r\nErrors\r\n```\r\n> meteor npm test\r\n\r\n> project@ test /Users/.../project\r\n> npm run lint && chimp --mocha --path=tests --browser=phantomjs\r\n\r\n> project@ lint /Users/.../project\r\n> eslint . --ext .jsx,.js\r\n\r\n.../AppWrapper.jsx\r\n  15:3   error  redirectToLoginWhenUnauthorized should be placed after componentWillReceiveProps  react/sort-comp\r\n  33:18  error  'loggingIn' is defined but never used                                             no-unused-vars\r\n  33:27  error  Expected exception block, space or tab after '/*' in comment                      spaced-comment\r\n  35:29  error  'loggedIn' is not defined                                                         no-undef\r\n  39:13  error  'loggingIn' is missing in props validation                                        react/prop-types\r\n  39:24  error  'loggedIn' is missing in props validation                                         react/prop-types\r\n  39:47  error  Missing semicolon                                                                 semi\r\n  49:55  error  Unexpected block statement surrounding arrow body                                 arrow-body-style\r\n\r\n✖ 8 problems (8 errors, 0 warnings)\r\n\r\nnpm ERR! Darwin 15.5.0\r\nnpm ERR! argv \"node\" \"/Users/.../.meteor/packages/meteor-tool/.1.3.2_4.5b0j9g++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm\" \"run\" \"lint\"\r\nnpm ERR! node v0.10.43\r\nnpm ERR! npm  v2.14.22\r\nnpm ERR! code ELIFECYCLE\r\nnpm ERR! project@ lint: `eslint . --ext .jsx,.js`\r\nnpm ERR! Exit status 1\r\n...\r\n```\r\n\r\nAppWrapper.jsx\r\n```javascript\r\n// custom\r\nimport React from 'react';\r\nimport _ from 'lodash';\r\nimport { Meteor } from 'meteor/meteor';\r\nimport { createContainer } from 'meteor/react-meteor-data';\r\nimport ParamStore from 'param-store';\r\nimport App from './App';\r\nimport Index from './Index';\r\n\r\nconst PUBLIC_ROUTES = [\r\n  'login',\r\n];\r\n\r\nclass AppWrapper extends React.Component {\r\n  componentWillMount() {\r\n    this.redirectToLoginWhenUnauthorized(this.props);\r\n  }\r\n\r\n  componentWillReceiveProps(nextProps) {\r\n    this.redirectToLoginWhenUnauthorized(nextProps);\r\n  }\r\n\r\n  redirectToLoginWhenUnauthorized({ loggingIn, loggedIn }) {\r\n    if (loggingIn) {\r\n      return;\r\n    }\r\n\r\n    if (!this.isAuthorized({ loggingIn, loggedIn })) {\r\n      ParamStore.set({ path: 'login' });\r\n    }\r\n  }\r\n\r\n  isAuthorized({ /* loggingIn, */loggedIn }) {\r\n    const isPublicRoute = _.includes(PUBLIC_ROUTES, ParamStore.get('path'));\r\n    return isPublicRoute || loggedIn;\r\n  }\r\n\r\n  render() {\r\n    const { loggingIn, loggedIn } = this.props;\r\n\r\n    if (loggingIn || !this.isAuthorized({ loggingIn, loggedIn })) {\r\n      return <Index noRedirect />;\r\n    }\r\n\r\n    return <App />;\r\n  }\r\n}\r\n\r\nAppWrapper.propTypes = {\r\n  loggedIn: React.PropTypes.bool,\r\n  loggingIn: React.PropTypes.bool,\r\n};\r\n\r\nconst AppWrapperWithContainer = createContainer(() => ({\r\n  loggingIn: Meteor.loggingIn(),\r\n  loggedIn: Boolean(Meteor.user()),\r\n}), AppWrapper);\r\n\r\nexport default AppWrapperWithContainer;\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/poetic/stanza/issues/comments/223707248","html_url":"https://github.com/poetic/stanza/issues/25#issuecomment-223707248","issue_url":"https://api.github.com/repos/poetic/stanza/issues/25","id":223707248,"user":{"login":"Chun-Yang","id":2827867,"avatar_url":"https://avatars.githubusercontent.com/u/2827867?v=3","gravatar_id":"","url":"https://api.github.com/users/Chun-Yang","html_url":"https://github.com/Chun-Yang","followers_url":"https://api.github.com/users/Chun-Yang/followers","following_url":"https://api.github.com/users/Chun-Yang/following{/other_user}","gists_url":"https://api.github.com/users/Chun-Yang/gists{/gist_id}","starred_url":"https://api.github.com/users/Chun-Yang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chun-Yang/subscriptions","organizations_url":"https://api.github.com/users/Chun-Yang/orgs","repos_url":"https://api.github.com/users/Chun-Yang/repos","events_url":"https://api.github.com/users/Chun-Yang/events{/privacy}","received_events_url":"https://api.github.com/users/Chun-Yang/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T22:13:09Z","updated_at":"2016-06-03T22:13:09Z","body":"Thanks! We do need to update this file!"}}
{"actor":{"display_login":"Chun-Yang"}}