Skip to content

Commit

Permalink
Merge pull request #17 from choonchernlim/feature/next
Browse files Browse the repository at this point in the history
Feature/next
  • Loading branch information
choonchernlim authored Sep 8, 2017
2 parents 4800189 + d24d115 commit 65e3d16
Show file tree
Hide file tree
Showing 18 changed files with 132 additions and 107 deletions.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.webpack/**
node/**
node_modules/**
scripts/*
**/*.flow
postcss.config.js
webpack.base.config.js
webpack.config.js
webpack.dev.config.js
8 changes: 1 addition & 7 deletions .nycrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
"require": [
"babel-register"
],
"exclude": [
"scripts/",
"webpack.**.js",
"**/*spec.js",
"**/__tests__/**",
"**/node_modules/**"
],
"reporter": [
"html",
"cobertura"
Expand All @@ -17,3 +10,4 @@
"instrument": false,
"all": true
}

19 changes: 8 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
# Change Log

## 0.9.2 - 2017-09-08

* `nyc` failed to exclude directories properly.
* Added `.eslintignore` file.
* Configured `yarn reinstall` to remove `node_modules` dir before reinstalling it.
* Cleaned up code.
* Dependency updates.

## 0.9.1 - 2017-09-06

* `image-webpack-loader` produced corrupted JPEG files.

* Dependency updates.

## 0.9.0 - 2017-09-01

* Significantly sped up Webpack build time.

* Replaced `npm` with `yarn`.

* `yarn start` will automatically open the browser and bring user to the landing page.

* Added `postcss.config.js` to fix "No PostCSS Config found" error. See https://github.com/postcss/postcss-loader/issues/204

* Added `prop-types` to handle "Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead." warning.

* Externalized nyc config from `package.json` to `.nycrc`.

* ESLint configuration - Allowed trailing comma in multi-line object literal or array (works with IntelliJ IDEA 2017).

* Added `cache-loader` to fix HappyPack's "Option 'tempDir' has been deprecated. Configuring it will cause an error to be thrown in future versions." warning.

* Removed deprecated `react-addons-test-utils` and added `react-test-renderer` to get `enzyme` working again with new React version.

* Dependency update.


## 0.8.1 - 2017-02-23

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "front-end-stack",
"version": "0.9.1",
"version": "0.9.2",
"private": true,
"config": {
"context_root": "/",
Expand All @@ -16,7 +16,7 @@
"test:watch": "nodemon --exec 'yarn test'",
"build": "webpack --progress",
"ci": "node ./scripts/ci",
"reinstall": "yarn cache clean && yarn upgrade",
"reinstall": "yarn cache clean && rimraf node_modules/ && yarn",
"start": "webpack-dev-server --config webpack.dev.config.js --progress",
"stats": "webpack --profile --json > stats.json",
"flow": "flow"
Expand All @@ -40,7 +40,7 @@
"reselect": "3.0.1"
},
"devDependencies": {
"autoprefixer": "7.1.3",
"autoprefixer": "7.1.4",
"babel-cli": "6.26.0",
"babel-core": "6.26.0",
"babel-eslint": "7.2.3",
Expand Down Expand Up @@ -87,7 +87,7 @@
"sinon": "3.2.1",
"style-loader": "0.18.2",
"url-loader": "0.5.9",
"webpack": "3.5.5",
"webpack": "3.5.6",
"webpack-dev-server": "2.7.1",
"webpack-parallel-uglify-plugin": "1.0.0"
}
Expand Down
4 changes: 1 addition & 3 deletions scripts/babel-preset-es2015.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable flowtype/require-valid-file-annotation */
// noinspection JSUnresolvedVariable
/**
* By default, `.babelrc` requires "["es2015",{"modules": false}]" preset to prevent
* modules to be converted into CommonJS modules so that "tree shaking" works when running
Expand All @@ -16,9 +16,7 @@
module.exports = {
presets: [
[
/* eslint-disable global-require, import/no-extraneous-dependencies */
require('babel-preset-es2015').buildPreset,
/* eslint-enable global-require, import/no-extraneous-dependencies */
{
modules: process.env.NODE_ENV === 'test' ? 'commonjs' : false,
},
Expand Down
16 changes: 11 additions & 5 deletions scripts/ci.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable flowtype/require-valid-file-annotation */

// noinspection NpmUsedModulesInstalled
/**
* `yarn run ci`
*
Expand All @@ -24,11 +23,18 @@ const eslint = `eslint ${srcDirPath} ${testDirPath} --color`;
// In addition to the `exclude` patterns defined in package.json, add user defined paths.
// Most importantly, `distDirPath` has to be excluded because it contains large bundled JS files
// and it causes "JavaScript heap out of memory" error.
const nycExtraExcludes = [distDirPath, reportDirPath]
.map(pattern => `--exclude=${pattern}`)
const nycExtraExcludes = [
distDirPath,
reportDirPath,
'**/__tests__/',
'.webpack/',
'node/',
'node_modules/',
'scripts/',
].map(pattern => `--exclude=${pattern}`)
.join(' ');

const nyc = `nyc ${nycExtraExcludes} --report-dir=${reportDirPath}`;
const nyc = `nyc ${nycExtraExcludes} --include=${srcDirPath} --report-dir=${reportDirPath}`;
const mocha = `node_modules/mocha/bin/_mocha ${testDirPath} ${mochaOpts} --reporter mocha-junit-reporter --reporter-options mochaFile=${mochaFilePath} --colors`;

const removeReportDir = `rimraf ${reportDirPath}`;
Expand Down
3 changes: 1 addition & 2 deletions scripts/script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable flowtype/require-valid-file-annotation */

// noinspection NpmUsedModulesInstalled
/**
* Script runner.
*/
Expand Down
3 changes: 1 addition & 2 deletions scripts/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable flowtype/require-valid-file-annotation */

// noinspection NpmUsedModulesInstalled
/**
* `yarn test` - to run all tests.
* `yarn test ./test/submodule` - to run all tests within `./test/submodule`.
Expand Down
1 change: 1 addition & 0 deletions src/flow/general-stub.js.flow
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// General stub to handle "Required module not found" error with Flow
// See https://github.com/reactjs/react-redux/issues/137
// noinspection JSUnusedGlobalSymbols
export default {};
3 changes: 1 addition & 2 deletions src/js/app/components/Home.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { Element } from 'react';
import React from 'react';
import React, { type Element } from 'react';
import Paper from 'material-ui/Paper';
import RaisedButton from 'material-ui/RaisedButton';
import TextField from 'material-ui/TextField';
Expand Down
21 changes: 9 additions & 12 deletions src/js/app/components/Layout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { Element } from 'react';
import React from 'react';
import React, { type Element } from 'react';
import { Style, StyleRoot } from 'radium';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
Expand All @@ -12,29 +11,27 @@ import styles, { mediaQuery } from '../styles';

type Props = {
children: Element<*>,
router: Object
router: Object,
};

type State = {
open: boolean,
mql: Function
mql: Function,
};

export default class Layout extends React.Component<Props, State> {
constructor(props: Props) {
super(props);

this.state = {
open: true,
mql: window.matchMedia(mediaQuery.large),
};
}
state = {
open: true,
mql: window.matchMedia(mediaQuery.large),
};

// noinspection JSUnusedGlobalSymbols
componentWillMount = () => {
this.state.mql.addListener(this.handleMediaQueryChanged);
this.handleMediaQueryChanged();
};

// noinspection JSUnusedGlobalSymbols
componentWillUnmount = () => this.state.mql.removeListener(this.handleMediaQueryChanged);

props: Props;
Expand Down
3 changes: 1 addition & 2 deletions src/js/app/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { Element } from 'react';
import React from 'react';
import React, { type Element } from 'react';
import ReactDOM from 'react-dom';
import { StoreCreator } from 'redux';
import { HistoryMiddleware, Provider } from 'react-redux';
Expand Down
3 changes: 1 addition & 2 deletions src/js/app/routes.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { Element } from 'react';
import React from 'react';
import React, { type Element } from 'react';
import { IndexRoute, Redirect, Route } from 'react-router';
import Layout from './components/Layout';
import Home from './components/Home';
Expand Down
3 changes: 1 addition & 2 deletions src/js/todo-manager/components/Footer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { Element } from 'react';
import React from 'react';
import React, { type Element } from 'react';
import LinkContainer from './Link';

const Footer = (): Element<*> => (
Expand Down
3 changes: 1 addition & 2 deletions src/js/todo-manager/components/Todo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { Element } from 'react';
import React from 'react';
import React, { type Element } from 'react';

type Props = {
onClick: Function,
Expand Down
3 changes: 1 addition & 2 deletions src/js/todo-manager/components/TodoList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { Element } from 'react';
import React from 'react';
import React, { type Element } from 'react';
import { List } from 'immutable';
import { connect } from 'react-redux';
import { toggleTodo } from '../actions';
Expand Down
3 changes: 1 addition & 2 deletions src/js/todo-manager/components/TodoManager.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import type { Element } from 'react';
import React from 'react';
import React, { type Element } from 'react';
import Footer from './Footer';
import AddTodoContainer from './AddTodo';
import TodoListContainer from './TodoList';
Expand Down
Loading

0 comments on commit 65e3d16

Please sign in to comment.