Commit Graph

5 Commits

Author SHA1 Message Date
William Chargin 32220148c0 Upgrade: babel-plugin-flow-react-proptypes@^18.0.0 (#27)
Summary:
Generated: `yarn add --dev babel-plugin-flow-react-proptypes@^18.0.0`.

This pulls in brigand/babel-plugin-flow-react-proptypes#182 and
brigand/babel-plugin-flow-react-proptypes#184, both of which affect this
project.

wchargin-branch: upgrade-flow-proptypes-18.0.0
2018-02-18 14:13:42 -08:00
Dandelion Mané 167289a75a
Set up prettier as an autoformatter (#18)
Setup prettier precommit, with yarn prettify to reformat.

- Prettier runs as a precommit hook and fails if code is improperly formatted.
- Run `yarn prettify` to reformat the project.
2018-02-18 01:59:28 -08:00
William Chargin 5744d3c860
Autogenerate PropTypes from Flow types (#20)
Summary:
Closes #17; see discussion there.

This commit uses the `babel-plugin-flow-react-proptypes` package to
automatically create PropType definitions from components that are typed
with Flow. It simultaneously updates all of our existing components to
be typed with Flow. As a result, we have both static and dynamic type
checking.

Test Plan:
Note that `yarn test` and `yarn flow` report no errors, and that there
are no prop validation errors at runtime with `yarn start`.

Then, apply the following patch:
```diff
diff --git a/explorer/src/UserExplorer.js b/explorer/src/UserExplorer.js
index bb574cd..636a10d 100644
--- a/explorer/src/UserExplorer.js
+++ b/explorer/src/UserExplorer.js
@@ -18,7 +18,7 @@ export class UserExplorer extends Component<{
         .sort((a,b) => b[1] - a[1]);
     const entries = sortedUserWeightTuples.map(authorWeight => {
       const [author, weight] = authorWeight;
-      return <UserEntry userId={author} weight={weight} key={author}/>
+      return <UserEntry userId={55} weight={weight} key={author}/>
     });
     return <div className="user-explorer">
       <h3> User Explorer </h3>
```
Note that `yarn test` fails (the `App.test.js` E2E rendering test),
`yarn flow` fails, and there is a runtime prop validation error.

wchargin-branch: autogenerate-proptypes
2018-02-17 13:30:16 -08:00
William Chargin ee59eb9b30
Eject from create-react-app (#19)
Summary:
This commit was created by performing the following steps:
  - `rm -r node_modules`
  - `yarn install`
  - `yarn eject`
  - `rm -r node_modules`
  - `yarn install`
on an environment wit Node v6.11.1.

The final `rm -r node_modules && yarn install` ensures that the
`yarn.lock` file is updated accordingly.

Test Plan:
`yarn test`, `yarn flow`, and `yarn start` all still do the right thing.

wchargin-branch: eject
2018-02-17 13:28:47 -08:00
Dandelion Mané 91bdce2e5e
Frontend setup (#13)
* Initial infrastructure for sourcecred-explorer.

Setup npm, yarn, flow, jest using scaffolding from
create-react-app.

- used create-react-app to get the basic pieces
- added support for flow via instructions in the
create-react-app user guide
- added flow-typed so that flow+jest will work well

* Add some additional resources

* Add index.css

* Remove .DS_STORE per @wchargin's suggestion
2018-02-16 14:32:24 -08:00