This commit is contained in:
Tienson Qin
2019-12-11 10:48:29 +08:00
parent 0f07cec7d9
commit ae19250623
7 changed files with 1000 additions and 22 deletions

1
.gitignore vendored
View File

@@ -1,6 +1,7 @@
node_modules/
public/js
/.cpcache
/target
/checkouts
/src/gen

7
dev/shadow/user.clj Normal file
View File

@@ -0,0 +1,7 @@
(ns shadow.user
(:require [shadow.cljs.devtools.api :as api]))
(defn cljs-repl
[]
(api/watch :app)
(api/repl :app))

935
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,5 +5,19 @@
"devDependencies": {
"shadow-cljs": "2.8.81"
},
"dependencies": {}
"scripts": {
"watch": "npx shadow-cljs watch app",
"release": "npx shadow-cljs release app",
"server": "npx shadow-cljs server;",
"clean": "rm -rf target; rm -rf public/js/compiled"
},
"dependencies": {
"@material-ui/core": "^4.7.2",
"@material-ui/icons": "^4.5.1",
"browserfs": "^1.4.3",
"isomorphic-git": "^0.72.0",
"mldoc_org": "0.0.3",
"react": "^16.12.0",
"react-dom": "^16.12.0"
}
}

3
public/css/style.css Normal file
View File

@@ -0,0 +1,3 @@
.grow {
flex-grow: 1;
}

26
public/index.html Normal file
View File

@@ -0,0 +1,26 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
<link rel="stylesheet" href="css/style.css" type="text/css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<title>Gitnotes</title>
</head>
<body>
<div id="root"></div>
<script src="https://unpkg.com/browserfs"></script>
<script src="https://unpkg.com/isomorphic-git"></script>
<script>
BrowserFS.configure({ fs: "IndexedDB", options: {} }, function (err) {
if (err) return console.log(err);
window.fs = BrowserFS.BFSRequire("fs");
git.plugins.set('fs', window.fs);
});
</script>
<script src="/js/main.js"></script>
</body>
</html>

View File

@@ -1,11 +1,33 @@
;; shadow-cljs configuration
{:source-paths
["src/dev"
"src/main"
"src/test"]
{:source-paths ["src" "dev"]
:dependencies
[]
[[binaryage/devtools "0.9.10"]
[cider/cider-nrepl "0.23.0-SNAPSHOT"]
[rum "0.11.4"]
[funcool/promesa "4.0.2"]
[prismatic/dommy "1.1.0"]
[metosin/reitit "0.3.10"]
[metosin/reitit-spec "0.3.10"]
[metosin/reitit-frontend "0.3.10"]]
:nrepl {:port 8701}
:builds
{}}
{:app
{:target :browser
:modules {:main {:init-fn frontend.core/init}}
:devtools
;; before live-reloading any code call this function
{:before-load frontend.core/stop
;; after live-reloading finishes call this function
:after-load frontend.core/start
;; serve the public directory over http at port 8700
;:http-root "public"
;:http-port 8700
:http-root "public"
:http-port 3000
:preloads [devtools.preload]}
}}}