Skip to content

Commit b05f7aa

Browse files
authored
feat(TypeScript): Add TodoMVC TypeScript (#263)
* initialize todomvc typescript version * Update gitignore * Convert domain/infra to TypeScript * Convert store to TypeScript * Convert usecase to TypeScript * Covert component/ to TypeScript * Convert index to TypeScript * chore(example): update meta data * Change test target to lib/ * fix typo * chore: Update README
1 parent 47c67a3 commit b05f7aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+6213
-28
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,4 @@ __obj/
9191
# Build cache.
9292
.eslintcache
9393
.textlintcache
94+
/examples/**/lib/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"env"
4+
]
5+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# TodoMVC TypeScript
2+
3+
TodoMVC is popular example for MV* library.
4+
5+
## Tutorial
6+
7+
:memo: Please see tutorial documents!
8+
9+
- https://almin.js.org/docs/tutorial/todomvc/
10+
11+
## Installation
12+
13+
npm install
14+
15+
## Usage
16+
17+
npm start
18+
open http://localhost:8080/
19+
20+
## Tests
21+
22+
npm test
23+
24+
### Domain Layer
25+
26+
- TodoList
27+
- `TodoList` is a collection of TodoItem
28+
29+
#### Value Object
30+
31+
- TodoItem
32+
- `TodoItem` is a value object for todo item.
33+
34+
### Store
35+
36+
- TodoStore
37+
- TodoStore merge with `TodoList`
38+
- TodoStore has state for filtering
39+
40+
## License
41+
42+
BSD
43+
44+
## Credit
45+
46+
This TodoMVC's component was created by Bill Fisher.
47+
48+
- [TodoMVC](http://todomvc.com/)
49+
- [flux/examples/flux-todomvc at master · facebook/flux](https://github.com/facebook/flux/tree/master/examples/flux-todomvc)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"private": true,
3+
"name": "example-todomvc-typescript",
4+
"version": "1.0.2",
5+
"description": "TODO MVC example",
6+
"directories": {
7+
"test": "test"
8+
},
9+
"scripts": {
10+
"clean": "rimraf public/build && mkdirp public/build",
11+
"start": "webpack-dev-server --hot --content-base public/ --open",
12+
"build": "webpack -p",
13+
"build:ts": "cross-env NODE_ENV=production tsc -p .",
14+
"watch:ts": "tsc -p . --watch",
15+
"test": "npm run build:ts && mocha test/",
16+
"ci": "npm test",
17+
"prepublish": "npm run --if-present build"
18+
},
19+
"author": "azu",
20+
"license": "MIT",
21+
"dependencies": {
22+
"almin": "^0.13.0",
23+
"almin-logger": "^5.0.0",
24+
"babel-preset-env": "^1.6.0",
25+
"babel-register": "^6.24.1",
26+
"classnames": "^2.2.3",
27+
"map-like": "^2.0.0",
28+
"prop-types": "^15.5.4",
29+
"react": "^15.5.3",
30+
"react-dom": "^15.5.3",
31+
"uuid": "^3.0.1"
32+
},
33+
"devDependencies": {
34+
"@types/mocha": "^2.2.41",
35+
"@types/node": "^8.0.15",
36+
"@types/react": "^15.0.38",
37+
"@types/react-dom": "^15.5.1",
38+
"@types/uuid": "^3.4.0",
39+
"awesome-typescript-loader": "^3.2.1",
40+
"cross-env": "^5.0.1",
41+
"mkdirp": "^0.5.1",
42+
"mocha": "^3.4.2",
43+
"rimraf": "^2.5.2",
44+
"typescript": "^2.4.2",
45+
"webpack": "^2.0.0",
46+
"webpack-dev-server": "^2.0.0"
47+
}
48+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2014-2015, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*
9+
* base.css overrides
10+
*/
11+
12+
/**
13+
* We are not changing from display:none, but rather re-rendering instead.
14+
* Therefore this needs to be displayed normally by default.
15+
*/
16+
#todo-list li .edit {
17+
display: inline;
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Almin • TodoMVC</title>
6+
<link rel="stylesheet" href="./todomvc-common/base.css">
7+
<link rel="stylesheet" href="./css/app.css">
8+
</head>
9+
<body>
10+
<section id="todoapp"></section>
11+
<footer id="info">
12+
<p>Double-click to edit a todo</p>
13+
<p>Created by <a href="https://github.com/azu">@azu</a></p>
14+
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
15+
</footer>
16+
<script src="build/bundle.js"></script>
17+
</body>
18+
</html>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "todomvc-common",
3+
"version": "0.1.9",
4+
"homepage": "https://github.com/tastejs/todomvc-common",
5+
"_release": "0.1.9",
6+
"_resolution": {
7+
"type": "version",
8+
"tag": "v0.1.9",
9+
"commit": "7dd61b0ebf56c020e719a69444442cc7ae7242ff"
10+
},
11+
"_source": "git://github.com/tastejs/todomvc-common.git",
12+
"_target": "~0.1.4",
13+
"_originalSource": "todomvc-common"
14+
}

0 commit comments

Comments
 (0)