Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit d7996f0

Browse files
committed
Add a build script
1 parent a7674c0 commit d7996f0

File tree

5 files changed

+55
-0
lines changed

5 files changed

+55
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules/
2+
dist/

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ TodoMVC application using [OrbitDB](https://github.com/orbitdb/orbit-db) as a da
1515
git clone <repo>
1616
cd repo/
1717
npm install
18+
npm run build
1819
```
1920

2021
## Run

build.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
mkdir -p dist/lib
2+
mkdir -p dist/src
3+
cp node_modules/todomvc-common/base.css dist/lib/
4+
cp node_modules/todomvc-app-css/index.css dist/lib/
5+
cp node_modules/todomvc-common/base.js dist/lib/
6+
cp node_modules/react/dist/react-with-addons.js dist/lib/
7+
cp node_modules/classnames/index.js dist/lib/classnames.js
8+
cp node_modules/react/dist/JSXTransformer.js dist/lib/
9+
cp node_modules/director/build/director.js dist/lib/
10+
cp node_modules/orbit-db/dist/orbitdb.min.js dist/lib/
11+
cp node_modules/ipfs/dist/index.min.js dist/lib/ipfs.min.js
12+
cp -R src/ dist/src/
13+
cp index.dist.html dist/index.html

index.dist.html

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!doctype html>
2+
<html lang="en" data-framework="react">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>OrbitDB • TodoMVC</title>
6+
<link rel="stylesheet" href="lib/base.css">
7+
<link rel="stylesheet" href="lib/index.css">
8+
<link rel="stylesheet" href="src/app.css">
9+
</head>
10+
<body>
11+
<section class="todoapp"></section>
12+
<footer class="info">
13+
<p>Double-click to edit a todo</p>
14+
<p>Created by <a href="http://github.com/haadcode/">Haad</a></p>
15+
<p>Based on <a href="https://github.com/tastejs/todomvc/tree/master/examples/react">React</a> <a href="http://todomvc.com">TodoMVC</a></p>
16+
</footer>
17+
18+
<script src="lib/base.js"></script>
19+
<script src="lib/react-with-addons.js"></script>
20+
<script src="lib/classnames.js"></script>
21+
<script src="lib/JSXTransformer.js"></script>
22+
<script src="lib/director.js"></script>
23+
<script src="lib/orbitdb.min.js"></script>
24+
<script src="lib/ipfs.min.js"></script>
25+
26+
<!-- OrbitDB -->
27+
<script type="text/javascript" src="src/store.js"></script>
28+
29+
<!-- Todo MVC -->
30+
<script src="src/utils.js"></script>
31+
<script src="src/todoModel.js"></script>
32+
<!-- jsx is an optional syntactic sugar that transforms methods in React's
33+
`render` into an HTML-looking format. Since the two models above are
34+
unrelated to React, we didn't need those transforms. -->
35+
<script type="text/jsx" src="src/todoItem.jsx"></script>
36+
<script type="text/jsx" src="src/footer.jsx"></script>
37+
<script type="text/jsx" src="src/app.jsx"></script>
38+
</body>
39+
</html>

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"http-server": "^0.10.0"
2121
},
2222
"scripts": {
23+
"build": "./build.sh",
2324
"start": "http-server -c-1 & open http://127.0.0.1:8080/index.html & wait",
2425
"test": "echo \"Error: no test specified\" && exit 1"
2526
},

0 commit comments

Comments
 (0)