diff --git a/gulpfile.ts b/gulpfile.ts index c1e0b8f..f810bea 100644 --- a/gulpfile.ts +++ b/gulpfile.ts @@ -4,7 +4,6 @@ import * as path from 'path'; const gulp = require('gulp'); const del = require('del'); -const deepmerge = require('deepmerge'); const {log, colors} = require('gulp-util'); const $ = { diff --git a/package.json b/package.json index 73b3ac2..939c269 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "eslint-plugin-react": "^2.3.0", "gulp": "^3.9.0", "gulp-changed": "^1.3.0", + "gulp-changed-in-place": "^2.0.1", "gulp-cli": "^0.3.0", "gulp-collector": "^0.1.0", "gulp-dev-express": "^1.0.1", @@ -38,6 +39,8 @@ }, "dependencies": { "express": "^4.13.3", + "lodash": "^3.10.1", + "radium": "^0.14.2", "react": "^0.13.0" } } diff --git a/src/client/app.tsx b/src/client/app.tsx index d0962c9..0a24041 100644 --- a/src/client/app.tsx +++ b/src/client/app.tsx @@ -1,13 +1,48 @@ +const Radium = require('radium'); + import * as React from 'react'; +enum Kinds { + primary, + warning +} + interface HelloWorldProps extends React.Props { name: string; + kind: Kinds; } +var styles = { + base: { + color: '#fff' + }, + + [Kinds.primary]: { + background: '#0074D9' + }, + + [Kinds.warning]: { + background: '#FF4136' + } +}; + +// @Radium export default class App extends React.Component { + static propTypes: React.ValidationMap = { + kind: React.PropTypes.oneOf([Kinds.primary, Kinds.warning]).isRequired + }; + render() { return ( -

Hello, {this.props.name}...

+
+

Hello, {this.props.name}...

+
+
); } } + +module.exports = App; \ No newline at end of file diff --git a/src/client/index.tsx b/src/client/index.tsx index ec08412..5e9663b 100644 --- a/src/client/index.tsx +++ b/src/client/index.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import App from './App'; +import App1 = require('./App'); -React.render(, document.getElementById('root')); +React.render(, document.getElementById('root')); document.getElementById('time').innerHTML = new Date().toString(); diff --git a/src/public/images/twitter.svg b/src/public/images/twitter.svg new file mode 100644 index 0000000..e2c0696 --- /dev/null +++ b/src/public/images/twitter.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/public/index.html b/src/public/index.html index 1583e48..6958088 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -7,6 +7,6 @@

Testing...

---
--- - + diff --git a/src/server/webpack.ts b/src/server/webpack.ts index f1ce916..ca7b246 100644 --- a/src/server/webpack.ts +++ b/src/server/webpack.ts @@ -11,6 +11,7 @@ const app = new WebpackDevServer(webpack(config), { historyApiFallback: true, publicPath: '/static/', stats: { colors: true }, + proxy: { '*': 'http://localhost:3000' }, }); app.listen(3001, 'localhost', function() { diff --git a/tsconfig.json b/tsconfig.json index b00cdd2..f9b3b1f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,8 @@ { "compilerOptions": { "declaration": false, + "target": "es5", + "experimentalDecorators": true, "noLib": false, "module": "commonjs", "jsx": "react", diff --git a/webpack.common.js b/webpack.common.js index c39b0f5..4d27274 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -5,7 +5,7 @@ module.exports = { react: { test: /\.ts(x)?$/, loaders: ['react-hot', 'ts-loader'], - include: path.join(__dirname, 'src', 'client') + include: path.join(__dirname, 'src', 'client'), }, }, preLoaders: { diff --git a/webpack.config-development.js b/webpack.config-development.js index ce080dd..250fd2f 100644 --- a/webpack.config-development.js +++ b/webpack.config-development.js @@ -24,10 +24,6 @@ module.exports = { ], loaders: [ common.loaders.react, - { - test: /[.]html$/, - loader: 'file' - } ] } };