Browse Source

Merge branch 'master' into enhance/ios-native-navigation

Tienson Qin 1 week ago
parent
commit
05ba914a42

+ 5 - 0
deps/cli/CHANGELOG.md

@@ -1,3 +1,8 @@
+## 0.4.1
+* Add `--open-schema` option to `validate` command
+* Fix `append` command fails
+* Fix `import-edn` command hangs on unexpected errors
+
 ## 0.4.0
 * BREAKING CHANGE: Commands that call local graphs are invoked with `-g` instead of as an argument e.g. `logseq search foo -g db-name` instead of `logseq search db-name foo`
 * Add `import-edn` command for local and in-app graphs

+ 1 - 1
deps/cli/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@logseq/cli",
-  "version": "0.4.0",
+  "version": "0.4.1",
   "description": "Logseq CLI",
   "bin": {
     "logseq": "cli.mjs"

+ 2 - 2
deps/cli/src/logseq/cli/commands/validate.cljs

@@ -11,9 +11,9 @@
 
 (defn- validate-db*
   "Validate datascript db as a vec of entity maps"
-  [db ent-maps* {:keys [closed]}]
+  [db ent-maps* {:keys [open-schema]}]
   (let [ent-maps (db-malli-schema/update-properties-in-ents db ent-maps*)
-        explainer (db-validate/get-schema-explainer closed)]
+        explainer (db-validate/get-schema-explainer (not open-schema))]
     (if-let [explanation (binding [db-malli-schema/*db-for-validate-fns* db
                                    db-malli-schema/*closed-values-validate?* true]
                            (->> (map (fn [e] (dissoc e :db/id)) ent-maps) explainer not-empty))]

+ 2 - 3
deps/cli/src/logseq/cli/spec.cljs

@@ -89,6 +89,5 @@
             :coerce []
             :require true
             :desc "Local graph(s) to validate"}
-   :closed {:alias :c
-            :default true
-            :desc "Validate entities have no extra keys"}})
+   :open-schema {:alias :o
+                 :desc "Validate with open schema to allow extra keys/attributes in an entity map"}})