Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nicolas Goutay
committed
Feb 27, 2016
1 parent
06cacd1
commit 9e2d23c
Showing
5 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>React TodoMVC</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="bundle.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"name": "redux-todomvc", | ||
"version": "1.0.0", | ||
"description": "Companion repository for the \"Getting Started with React, Redux and Immutable: a Test-Driven TodoMVC Tutorial\" article.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha --compilers js:babel-core/register --require ./test/setup.js 'test/**/*.@(js|jsx)'", | ||
"test:watch": "npm run test -- --watch --watch-extensions jsx" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/phacks/redux-todomvc.git" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/phacks/redux-todomvc/issues" | ||
}, | ||
"homepage": "https://github.com/phacks/redux-todomvc#readme", | ||
"devDependencies": { | ||
"babel-core": "^6.5.2", | ||
"babel-loader": "^6.2.4", | ||
"babel-preset-es2015": "^6.5.0", | ||
"babel-preset-react": "^6.5.0", | ||
"chai": "^3.5.0", | ||
"chai-immutable": "^1.5.3", | ||
"jsdom": "^8.0.4", | ||
"mocha": "^2.4.5", | ||
"react-hot-loader": "^1.3.0", | ||
"webpack": "^1.12.14", | ||
"webpack-dev-server": "^1.14.1" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
"es2015", | ||
"react" | ||
] | ||
}, | ||
"dependencies": { | ||
"immutable": "^3.7.6", | ||
"react": "^0.14.7", | ||
"react-dom": "^0.14.7" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log('Hello World!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import jsdom from 'jsdom'; | ||
import chai from 'chai'; | ||
import chaiImmutable from 'chai-immutable'; | ||
|
||
const doc = jsdom.jsdom('<!doctype html><html><body></body></html>'); | ||
const win = doc.defaultView; | ||
|
||
global.document = doc; | ||
global.window = win; | ||
|
||
Object.keys(window).forEach((key) => { | ||
if (!(key in global)) { | ||
global[key] = window[key]; | ||
} | ||
}); | ||
|
||
chai.use(chaiImmutable); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var webpack = require('webpack'); | ||
|
||
module.exports = { | ||
entry: [ | ||
'webpack-dev-server/client?http://localhost:8080', | ||
'webpack/hot/only-dev-server', | ||
'./src/index.js' | ||
], | ||
module: { | ||
loaders: [{ | ||
test: /\.jsx?$/, | ||
exclude: /node_modules/, | ||
loader: 'react-hot!babel' | ||
}] | ||
}, | ||
resolve: { | ||
extensions: ['', '.js', '.jsx'] | ||
}, | ||
output: { | ||
path: __dirname + '/dist', | ||
publicPath: '/', | ||
filename: 'bundle.js' | ||
}, | ||
devServer: { | ||
contentBase: './dist', | ||
hot: true | ||
}, | ||
plugins: [ | ||
new webpack.HotModuleReplacementPlugin() // Wire in the hot loading plugin | ||
] | ||
}; |