فهرست منبع

chore(dev): rm unused workspace card

Andelf 3 سال پیش
والد
کامیت
c3e96dba43
7فایلهای تغییر یافته به همراه4 افزوده شده و 118 حذف شده
  1. 0 1
      .github/workflows/build-android.yml
  2. 1 1
      Dockerfile
  3. 1 2
      deps.edn
  4. 0 15
      public/workspaces/index.html
  5. 2 15
      shadow-cljs.edn
  6. 0 79
      src/workspaces/workspaces/cards.cljs
  7. 0 5
      src/workspaces/workspaces/main.cljs

+ 0 - 1
.github/workflows/build-android.yml

@@ -125,7 +125,6 @@ jobs:
         run: |
           cp -r static public/
           rm -rvf public/static/js/publishing
-          rm -rvf public/workspaces
           rm -rvf public/static/js/*.js.map || true
           rm -rvf public/static/*.*
           rm -rvf public/static/ios

+ 1 - 1
Dockerfile

@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install ca-certificates && \
 WORKDIR /data/
 
 # Build for static resources
-RUN git clone https://github.com/logseq/logseq.git &&  cd /data/logseq && yarn && yarn release && mv ./static ./public && rm -r ./public/workspaces
+RUN git clone https://github.com/logseq/logseq.git &&  cd /data/logseq && yarn && yarn release && mv ./static ./public
 
 # Web App Runner image
 FROM nginx:stable-alpine

+ 1 - 2
deps.edn

@@ -1,4 +1,4 @@
-{:paths ["src/main" "src/electron" "src/workspaces" "templates"]
+{:paths ["src/main" "src/electron" "templates"]
  :deps
  {org.clojure/clojure                   {:mvn/version "1.10.0"}
   rum/rum                               {:mvn/version "0.12.9"}
@@ -28,7 +28,6 @@
   binaryage/devtools                    {:mvn/version "1.0.5"}
   camel-snake-kebab/camel-snake-kebab   {:mvn/version "0.4.2"}
   instaparse/instaparse                 {:mvn/version "1.4.10"}
-  nubank/workspaces                     {:mvn/version "1.1.1"}
   org.clojars.mmb90/cljs-cache          {:mvn/version "0.1.4"}
   logseq/graph-parser                   {:local/root "deps/graph-parser"}}
 

+ 0 - 15
public/workspaces/index.html

@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <link href="/static/css/style.css" rel="stylesheet" type="text/css">
-    <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
-  </head>
-  <body>
-    <div id="app"></div>
-    <!-- you might need to change the js path depending on your configuration -->
-    <script src="/static/js/workspaces/main.js" type="text/javascript"></script>
-    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
-  </body>
-</html>

+ 2 - 15
shadow-cljs.edn

@@ -3,8 +3,7 @@
  :nrepl {:port 8701}
 
  ;; "." for /static
- :dev-http {3001 ["static" "."]
-            3002 ["public/workspaces" "."]}
+ :dev-http {3001 ["static" "."]}
 
  :builds
  {:app {:target        :browser
@@ -95,16 +94,4 @@
                :devtools         {:before-load frontend.core/stop
                                   :after-load  frontend.core/start
                                   :preloads    [devtools.preload]}}
-
-  :cards {:target     nubank.workspaces.shadow-cljs.target
-          :ns-regexp  "(test|cards)$"
-          :output-dir "./public/workspaces/static/js/workspaces"
-          :asset-path "/static/js/workspaces"
-          :preloads   [] ;; optional, list namespaces to be pre loaded
-          :devtools   {:after-load  nubank.workspaces.core/after-load
-                       :loader-mode :eval
-                       :watch-path  "/static"
-                       :watch-dir   "static"
-                       :preloads    [devtools.preload
-                                     shadow.remote.runtime.cljs.browser]}
-          :modules    {:main {:entries [workspaces.main]}}}}}
+  }}

+ 0 - 79
src/workspaces/workspaces/cards.cljs

@@ -1,79 +0,0 @@
-(ns workspaces.cards
-  (:require [frontend.extensions.graph :as graph]
-            [frontend.ui :as ui]
-            [nubank.workspaces.card-types.react :as ct.react]
-            [nubank.workspaces.core :as ws]
-            [rum.core :as rum]))
-
-;; simple function to create react elemnents
-(defn element [name props & children]
-  (apply js/React.createElement name (clj->js props) children))
-
-(ws/defcard hello-card
-  (ct.react/react-card
-   (element "div" {} "Hello World")))
-
-(rum/defc ui-button
-  []
-  (ui/button "Text"
-    :background "green"
-    :on-click (fn [] (js/alert "button clicked"))))
-
-(ws/defcard button-card
-  (ct.react/react-card
-   (ui-button)))
-
-(rum/defc graph
-  []
-  (graph/graph-2d
-   {:data {:nodes [{:id "a" :label "a"} {:id "b" :label "b"}]
-           :edges [{:source "a" :target "b"}]}
-    :width 150
-    :height 150
-    :fitView true}))
-
-(ws/defcard graph-card
-  (ct.react/react-card
-   (graph)))
-
-(defn random-graph
-  [n]
-  (let [nodes (for [i (range 0 n)]
-                {:id (str i)
-                 :label (str i)})
-        edges (->
-               (for [i (range 0 (/ n 2))]
-                 (let [source i
-                       target (inc i)]
-                   {:id (str source target)
-                    :source (str source)
-                    :target (str target)}))
-               (distinct))]
-    {:nodes nodes
-     :links edges}))
-
-;; (rum/defc pixi-graph
-;;   []
-;;   (let [{:keys [nodes links]} (random-graph 4000)]
-;;     (pixi/graph (fn []
-;;                   {:nodes nodes
-;;                   :links links
-;;                   :style {:node {:size 15
-;;                                  :color "#666666"
-;;                                  :border {:width 2
-;;                                           :color "#ffffff"}
-;;                                  :label {:content (fn [node] (.-id node))
-;;                                          :type js/window.PixiGraph.TextType.TEXT
-;;                                          :fontSize 12
-;;                                          :color "#333333"
-;;                                          :backgroundColor "rgba(255, 255, 255, 0.5)"
-;;                                          :padding 4}}
-;;                           :edge {:width 1
-;;                                  :color "#cccccc"}}
-;;                   :hover-style {:node {:border {:color "#000000"}
-;;                                        :label {:backgroundColor "rgba(238, 238, 238, 1)"}}
-;;                                 :edge {:color "#999999"}}}))))
-
-;; (ws/defcard pixi-graph-card
-;;   (ct.react/react-card
-;;    (pixi-graph)))

+ 0 - 5
src/workspaces/workspaces/main.cljs

@@ -1,5 +0,0 @@
-(ns workspaces.main
-  (:require [nubank.workspaces.core :as ws]
-            [workspaces.cards]))
-
-(defonce init (ws/mount))