Tienson Qin 6 лет назад
Родитель
Сommit
ae19250623
7 измененных файлов с 844 добавлено и 17 удалено
  1. 1 0
      .gitignore
  2. 7 0
      dev/shadow/user.clj
  3. 764 10
      package-lock.json
  4. 15 1
      package.json
  5. 3 0
      public/css/style.css
  6. 26 0
      public/index.html
  7. 28 6
      shadow-cljs.edn

+ 1 - 0
.gitignore

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

+ 7 - 0
dev/shadow/user.clj

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

Разница между файлами не показана из-за своего большого размера
+ 764 - 10
package-lock.json


+ 15 - 1
package.json

@@ -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 - 0
public/css/style.css

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

+ 26 - 0
public/index.html

@@ -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>

+ 28 - 6
shadow-cljs.edn

@@ -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]}
+   }}}

Некоторые файлы не были показаны из-за большого количества измененных файлов