More idiomatic project setup

This commit is contained in:
Michel Weststrate 2015-12-14 13:08:26 +01:00
parent 625fd8dd06
commit 58cdd3038f
7 changed files with 22 additions and 17 deletions

3
.gitignore vendored
View file

@ -1,4 +1,3 @@
node_modules/
typings/
public/js/app/*.js
temp/
public/js/bundle.js

View file

@ -1,6 +1,7 @@
The MIT License (MIT)
Copyright (c) 2015 Benny van Reeven
Copyright (c) 2015 Michel Weststrate
Forked from: https://github.com/bvanreeven/react-typescript
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -2,19 +2,20 @@
Minimal boilerplate for a single-page app using Mobservable, Mobservable-React, React, TypeScript 1.6 with TSX, and Visual Studio Code.
Usage:
Initial install:
* Install Node.js
* `npm install -g tsd`
* `npm install`
* `tsd install`
Build:
* `npm run build`
To view the app:
* `npm install -g http-server`
* `http-server`
* Open [http://localhost:8080/](http://localhost:8080/) in your browser of choice.
* `npm start`
## Credits

View file

@ -8,19 +8,21 @@
},
"main": "index.js",
"dependencies": {
"mobservable": "^1.0.0",
"mobservable-react": "^2.0.0",
"mobservable": "^1.1.4",
"mobservable-react": "^2.1.0",
"mobservable-react-devtools": "^2.0.4",
"react": "^0.14",
"react-dom": "^0.14"
},
"devDependencies": {
"browserify": "^11.1.0",
"mkdirp": "^0.5.1",
"http-server": "^0.8.5",
"tsify": "^0.13.1",
"typescript": "^1.6.2"
},
"scripts": {
"build": "mkdirp public/js/app && tsc && browserify ./temp/app.js -o public/js/app/bundle.js",
"start": "http-server"
"build": "browserify src/index.tsx -p tsify > public/js/bundle.js",
"start": "cd public && http-server -o index.html"
},
"author": "Michel Weststrate",
"license": "MIT"

View file

@ -3,17 +3,17 @@
<head>
<meta charset="utf-8">
<title>My First React App</title>
<title>Mobservable-React-Typescript boilerplate project</title>
<link rel="stylesheet" href="css/bootstrap.css">
</head>
<body>
<div class="container">
<h1>My First React App</h1>
<h1>Mobservable-React-Typescript boilerplate project</h1>
<div id="app"></div>
</div>
<script src="js/app/bundle.js"></script>
<script src="js/bundle.js"></script>
</body>
</html>

View file

@ -5,6 +5,8 @@ import ReactDOM = require('react-dom');
import {observable} from 'mobservable';
import {observer} from 'mobservable-react';
import "mobservable-react-devtools";
class DemoProps {
public name: string;
}

View file

@ -8,9 +8,9 @@
"experimentalDecorators": true,
"noLib": false,
"jsx": "react",
"outDir": "./temp"
"outDir": "dist"
},
"files": [
"app/app.tsx"
"src/index.tsx"
]
}