mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
Merge branch 'master' into enhance/mobile-silk
This commit is contained in:
@@ -195,11 +195,11 @@
|
||||
(map #(vector % (str % "_Class")))
|
||||
(into {}))]
|
||||
(when (seq renamed-classes)
|
||||
(if verbose
|
||||
(println "Renaming the following classes because they have names that conflict with Logseq's case insensitive :block/name:"
|
||||
(keys renamed-classes) "\n")
|
||||
(when (pos? (count renamed-classes))
|
||||
(println "Renaming" (count renamed-classes) "classes due to page name conflicts"))))
|
||||
(if verbose
|
||||
(println "Renaming the following classes because they have names that conflict with Logseq's case insensitive :block/name:"
|
||||
(keys renamed-classes) "\n")
|
||||
(when (pos? (count renamed-classes))
|
||||
(println "Renaming" (count renamed-classes) "classes due to page name conflicts"))))
|
||||
renamed-classes))
|
||||
|
||||
(defn- get-all-properties [schema-data {:keys [verbose]}]
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
(ns logseq.tasks.dev
|
||||
"Tasks for general development. For desktop or mobile development see their
|
||||
namespaces"
|
||||
(:require [babashka.process :refer [shell]]
|
||||
(:require [babashka.cli :as cli]
|
||||
[babashka.fs :as fs]
|
||||
[babashka.cli :as cli]
|
||||
[logseq.tasks.util :as task-util]
|
||||
[logseq.tasks.dev.lint :as dev-lint]
|
||||
[babashka.process :refer [shell]]
|
||||
[clojure.core.async :as async]
|
||||
[clojure.data :as data]
|
||||
[clojure.edn :as edn]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.pprint :as pp]
|
||||
[clojure.edn :as edn]
|
||||
[clojure.data :as data]
|
||||
[clojure.core.async :as async]
|
||||
[clojure.string :as string]))
|
||||
[clojure.string :as string]
|
||||
[logseq.tasks.dev.lint :as dev-lint]
|
||||
[logseq.tasks.util :as task-util]))
|
||||
|
||||
(defn test
|
||||
"Run tests. Pass args through to cmd 'yarn cljs:run-test'"
|
||||
@@ -75,7 +75,7 @@
|
||||
(fs/glob "." "{src/main,deps/graph-parser/src}/**")))))]
|
||||
(do
|
||||
(println "Building publishing js asset...")
|
||||
(shell "clojure -M:cljs release publishing"))
|
||||
(shell "clojure -M:cljs release publishing workers"))
|
||||
(println "Publishing js asset is up to date")))
|
||||
|
||||
(defn publishing-backend
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
(defn watch-publishing-frontend
|
||||
[& _args]
|
||||
(shell "clojure -M:cljs watch publishing"))
|
||||
(shell "npx shadow-cljs watch publishing"))
|
||||
|
||||
(defn watch-publishing-backend
|
||||
"Builds publishing backend once watch-publishing-frontend has built initial frontend"
|
||||
@@ -110,4 +110,4 @@
|
||||
(let [db-graph (fs/path parent-graph-dir (fs/file-name file-graph))]
|
||||
(println "Importing" (str db-graph) "...")
|
||||
(apply shell "bb" "dev:db-import" file-graph db-graph import-options)
|
||||
(shell "bb" "dev:validate-db" db-graph "-gHc")))))
|
||||
(shell "bb" "dev:validate-db" db-graph "-gHc")))))
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
"electron.db"
|
||||
"frontend.handler.db-based."
|
||||
"frontend.worker.handler.page.db-based"
|
||||
"frontend.components.property" "frontend.components.class" "frontend.components.quick-add"
|
||||
"frontend.inference-worker"
|
||||
"frontend.components.property" "frontend.components.class" "frontend.components.quick-add" "frontend.components.vector-search"
|
||||
"frontend.components.db-based" "frontend.components.objects" "frontend.components.query.view"
|
||||
"mobile.core" "mobile.events" "mobile.externals" "mobile.init" "mobile.state"
|
||||
"mobile.components"]))
|
||||
@@ -58,8 +59,10 @@
|
||||
"src/main/frontend/components/property"
|
||||
"src/main/frontend/components/objects.cljs"
|
||||
"src/main/frontend/components/quick_add.cljs"
|
||||
"src/main/frontend/components/vector_search"
|
||||
"src/main/frontend/components/db_based"
|
||||
"src/main/frontend/components/query/view.cljs"
|
||||
"src/main/frontend/inference_worker"
|
||||
"src/electron/electron/db.cljs"
|
||||
"src/main/mobile"]))
|
||||
|
||||
|
||||
@@ -43,13 +43,14 @@
|
||||
(when (pos? (:exit res)) (System/exit (:exit res)))))
|
||||
(println "No clj* files have changed to lint."))))
|
||||
|
||||
(defn- validate-frontend-not-in-worker
|
||||
(defn- validate-frontend-not-in-workers
|
||||
[]
|
||||
(let [res (shell {:out :string}
|
||||
"git grep -h" "\\[frontend.*:as" "src/main/frontend/worker")
|
||||
"git grep -h" "\\[frontend.*:as"
|
||||
"src/main/frontend/worker" "src/main/frontend/worker_common" "src/main/frontend/inference_worker")
|
||||
req-lines (->> (:out res)
|
||||
string/split-lines
|
||||
(remove #(re-find #"frontend\.worker|frontend\.common" %)))]
|
||||
(remove #(re-find #"frontend\.worker|frontend\.common|frontend\.inference-worker" %)))]
|
||||
|
||||
(if (seq req-lines)
|
||||
(do
|
||||
@@ -58,10 +59,10 @@
|
||||
(System/exit 1))
|
||||
(println "Valid worker namespaces!"))))
|
||||
|
||||
(defn- validate-worker-not-in-frontend
|
||||
(defn- validate-workers-not-in-frontend
|
||||
[]
|
||||
(let [res (shell {:out :string :continue true}
|
||||
"grep -r --exclude-dir=worker" "\\[frontend.worker.*:" "src/main/frontend")
|
||||
"grep -r --exclude-dir=worker --exclude-dir=inference_worker" "\\[frontend.worker.*:" "src/main/frontend")
|
||||
;; allow reset-file b/c it's only affects tests
|
||||
allowed-exceptions #{"src/main/frontend/handler/file_based/file.cljs: [frontend.worker.file.reset :as file-reset]"}
|
||||
invalid-lines (when (= 0 (:exit res))
|
||||
@@ -75,8 +76,7 @@
|
||||
(println "Valid frontend namespaces!"))))
|
||||
|
||||
(defn worker-and-frontend-separate
|
||||
"Ensures worker is independent of frontend"
|
||||
"Ensures workers are independent of frontend"
|
||||
[]
|
||||
(validate-frontend-not-in-worker)
|
||||
(validate-worker-not-in-frontend))
|
||||
|
||||
(validate-frontend-not-in-workers)
|
||||
(validate-workers-not-in-frontend))
|
||||
|
||||
Reference in New Issue
Block a user