浏览代码

chore: mv file-based util namespaces to their own directory

Makes maintenance of different graph types easier and increases linting
of what occurs in these namespaces
Gabriel Horner 1 年之前
父节点
当前提交
e5e9c5c687

+ 2 - 2
.clj-kondo/config.edn

@@ -134,8 +134,8 @@
              frontend.test.helper test-helper
              frontend.ui ui
              frontend.util util
-             frontend.util.clock clock
-             frontend.util.drawer drawer
+             frontend.util.file-based.clock clock
+             frontend.util.file-based.drawer drawer
              frontend.util.page page-util
              frontend.util.property property
              frontend.util.persist-var persist-var

+ 2 - 1
scripts/src/logseq/tasks/dev/db_and_file_graphs.clj

@@ -24,6 +24,7 @@
   (mapv escape-shell-regex
         ["frontend.handler.file-based" "frontend.handler.file-sync"
          "frontend.db.file-based"
+         "frontend.util.file-based"
          "frontend.worker.handler.page.file-based"
          ;; Want to only specify this ns and not the ones under it but don't have a way yet
          "frontend.worker.file"
@@ -46,7 +47,7 @@
 (def file-graph-paths
   "Paths _only_ for file graphs"
   ["src/main/frontend/handler/file_based" "src/main/frontend/handler/file_sync.cljs" "src/main/frontend/db/file_based"
-   "src/main/frontend/worker/handler/page/file_based" "src/main/frontend/worker/file.cljs"
+   "src/main/frontend/util/file_based" "src/main/frontend/worker/handler/page/file_based" "src/main/frontend/worker/file.cljs"
    "src/main/frontend/fs"
    "src/main/frontend/components/file_sync.cljs"
    "src/main/frontend/components/file_based"

+ 1 - 1
src/main/frontend/commands.cljs

@@ -12,7 +12,7 @@
             [frontend.state :as state]
             [frontend.util :as util]
             [frontend.util.cursor :as cursor]
-            [frontend.util.priority :as priority]
+            [frontend.util.file-based.priority :as priority]
             [frontend.handler.file-based.property :as file-property-handler]
             [frontend.handler.db-based.property.util :as db-pu]
             [frontend.handler.property.file :as property-file]

+ 1 - 1
src/main/frontend/components/block.cljs

@@ -66,7 +66,7 @@
             [logseq.shui.dialog.core :as shui-dialog]
             [frontend.util :as util]
             [frontend.extensions.pdf.utils :as pdf-utils]
-            [frontend.util.drawer :as drawer]
+            [frontend.util.file-based.drawer :as drawer]
             [frontend.handler.property.file :as property-file]
             [frontend.handler.file-based.property.util :as property-util]
             [frontend.util.text :as text-util]

+ 2 - 2
src/main/frontend/components/file_based/block.cljs

@@ -3,8 +3,8 @@
             [frontend.handler.editor :as editor-handler]
             [frontend.ui :as ui]
             [frontend.util :as util]
-            [frontend.util.clock :as clock]
-            [frontend.util.drawer :as drawer]
+            [frontend.util.file-based.clock :as clock]
+            [frontend.util.file-based.drawer :as drawer]
             [frontend.state :as state]
             [reitit.frontend.easy :as rfe]
             [rum.core :as rum]))

+ 1 - 1
src/main/frontend/components/file_based/query_table.cljs

@@ -8,7 +8,7 @@
             [frontend.handler.property :as property-handler]
             [frontend.state :as state]
             [frontend.util :as util]
-            [frontend.util.clock :as clock]
+            [frontend.util.file-based.clock :as clock]
             [frontend.handler.file-based.property :as file-property-handler]
             [medley.core :as medley]
             [rum.core :as rum]

+ 1 - 1
src/main/frontend/extensions/srs.cljs

@@ -25,7 +25,7 @@
             [frontend.ui :as ui]
             [frontend.util :as util]
             [frontend.format.mldoc :as mldoc]
-            [frontend.util.drawer :as drawer]
+            [frontend.util.file-based.drawer :as drawer]
             [frontend.util.persist-var :as persist-var]
             [logseq.graph-parser.property :as gp-property]
             [logseq.common.util.page-ref :as page-ref]

+ 1 - 1
src/main/frontend/handler/block.cljs

@@ -13,7 +13,7 @@
    [logseq.outliner.op]
    [frontend.state :as state]
    [frontend.util :as util]
-   [frontend.util.drawer :as drawer]
+   [frontend.util.file-based.drawer :as drawer]
    [goog.dom :as gdom]
    [logseq.graph-parser.block :as gp-block]
    [logseq.db.sqlite.util :as sqlite-util]

+ 2 - 2
src/main/frontend/handler/editor.cljs

@@ -40,9 +40,9 @@
             [frontend.state :as state]
             [frontend.template :as template]
             [frontend.util :as util]
-            [frontend.util.clock :as clock]
+            [frontend.util.file-based.clock :as clock]
             [frontend.util.cursor :as cursor]
-            [frontend.util.drawer :as drawer]
+            [frontend.util.file-based.drawer :as drawer]
             [frontend.util.keycode :as keycode]
             [frontend.util.list :as list]
             [frontend.util.text :as text-util]

+ 2 - 2
src/main/frontend/handler/file_based/editor.cljs

@@ -10,8 +10,8 @@
             [frontend.modules.outliner.op :as outliner-op]
             [frontend.modules.outliner.ui :as ui-outliner-tx]
             [frontend.util :as util]
-            [frontend.util.clock :as clock]
-            [frontend.util.drawer :as drawer]
+            [frontend.util.file-based.clock :as clock]
+            [frontend.util.file-based.drawer :as drawer]
             [frontend.handler.file-based.status :as status]
             [frontend.handler.property.file :as property-file]
             [frontend.handler.file-based.property :as file-property-handler]

+ 2 - 2
src/main/frontend/util/clock.cljs → src/main/frontend/util/file_based/clock.cljs

@@ -1,7 +1,7 @@
-(ns frontend.util.clock
+(ns frontend.util.file-based.clock
   "Provides clock related functionality used by tasks"
   (:require [frontend.state :as state]
-            [frontend.util.drawer :as drawer]
+            [frontend.util.file-based.drawer :as drawer]
             [frontend.util :as util]
             [cljs-time.core :as t]
             [cljs-time.format :as tf]

+ 1 - 1
src/main/frontend/util/drawer.cljs → src/main/frontend/util/file_based/drawer.cljs

@@ -1,4 +1,4 @@
-(ns ^:no-doc frontend.util.drawer
+(ns ^:no-doc frontend.util.file-based.drawer
   (:require [clojure.string :as string]
             [frontend.util :as util]
             [frontend.format.mldoc :as mldoc]

+ 1 - 1
src/main/frontend/util/priority.cljs → src/main/frontend/util/file_based/priority.cljs

@@ -1,4 +1,4 @@
-(ns frontend.util.priority
+(ns frontend.util.file-based.priority
   "Util fns for task priorities e.g. A, B, C.
    File graph only"
   (:require [clojure.string :as string]

+ 2 - 2
src/test/frontend/util/clocktime_test.cljs → src/test/frontend/util/file_based/clock_test.cljs

@@ -1,6 +1,6 @@
-(ns frontend.util.clocktime-test
+(ns frontend.util.file-based.clock-test
   (:require [cljs.test :refer [deftest is]]
-            [frontend.util.clock :as clock]))
+            [frontend.util.file-based.clock :as clock]))
 
 
 (deftest test-seconds->days:hours:minutes:seconds

+ 2 - 2
src/test/frontend/util/priority_test.cljs → src/test/frontend/util/file_based/priority_test.cljs

@@ -1,6 +1,6 @@
-(ns frontend.util.priority-test
+(ns frontend.util.file-based.priority-test
   (:require [cljs.test :refer [are deftest]]
-            [frontend.util.priority :as priority]))
+            [frontend.util.file-based.priority :as priority]))
 
 (deftest add-or-update-priority-markdown
   (are [content priority expect] (= expect (priority/add-or-update-priority content :markdown priority))