瀏覽代碼

handle lightning-fs

Konstantinos Kaloutas 2 年之前
父節點
當前提交
20421e4cc4
共有 6 個文件被更改,包括 43 次插入4 次删除
  1. 2 1
      gulpfile.js
  2. 1 0
      package.json
  3. 0 0
      resources/js/lightning-fs.min.js
  4. 1 1
      resources/js/worker.js
  5. 2 2
      src/main/frontend/fs.cljs
  6. 37 0
      yarn.lock

+ 2 - 1
gulpfile.js

@@ -62,7 +62,8 @@ const common = {
         'node_modules/reveal.js/dist/reveal.js',
         'node_modules/shepherd.js/dist/js/shepherd.min.js',
         'node_modules/marked/marked.min.js',
-        'node_modules/@highlightjs/cdn-assets/highlight.min.js'
+        'node_modules/@highlightjs/cdn-assets/highlight.min.js',
+        'node_modules/@isomorphic-git/lightning-fs/dist/lightning-fs.min.js'
       ]).pipe(gulp.dest(path.join(outputPath, 'js'))),
       () => gulp.src([
         'node_modules/@tabler/icons/iconfont/tabler-icons.min.css',

+ 1 - 0
package.json

@@ -91,6 +91,7 @@
         "@excalidraw/excalidraw": "0.12.0",
         "@highlightjs/cdn-assets": "10.4.1",
         "@hugotomazi/capacitor-navigation-bar": "^2.0.0",
+        "@isomorphic-git/lightning-fs": "^4.6.0",
         "@logseq/capacitor-file-sync": "0.0.32",
         "@logseq/diff-merge": "0.2.2",
         "@logseq/react-tweet-embed": "1.3.1-1",

文件差異過大導致無法顯示
+ 0 - 0
resources/js/lightning-fs.min.js


+ 1 - 1
resources/js/worker.js

@@ -1,6 +1,6 @@
 importScripts(
   // Batched optimization
-  "./lightning-fs.min.js?v=0.0.2.3",
+  "./lightning-fs.min.js",
   // Fixed a bug
   "./magic_portal.js"
 );

+ 2 - 2
src/main/frontend/fs.cljs

@@ -127,7 +127,7 @@
   [repo old-path new-path]
   (let [new-path (gp-util/path-normalize new-path)]
     (cond
-                                        ; See https://github.com/isomorphic-git/lightning-fs/issues/41
+      ; See https://github.com/isomorphic-git/lightning-fs/issues/41
       (= old-path new-path)
       (p/resolved nil)
 
@@ -187,7 +187,7 @@
 
 (defn get-files
   "List all files in the directory, recursively.
-   
+
    Wrap as {:path string :files []}, using relative path"
   [dir]
   (let [fs-record (get-native-backend)]

+ 37 - 0
yarn.lock

@@ -456,6 +456,21 @@
     untildify "^4.0.0"
     wrap-ansi "^7.0.0"
 
+"@isomorphic-git/[email protected]":
+  version "3.3.2"
+  resolved "https://registry.npmjs.org/@isomorphic-git/idb-keyval/-/idb-keyval-3.3.2.tgz#c0509a6c5987d8a62efb3e47f2815bcc5eda2489"
+  integrity sha512-r8/AdpiS0/WJCNR/t/gsgL+M8NMVj/ek7s60uz3LmpCaTF2mEVlZJlB01ZzalgYzRLXwSPC92o+pdzjM7PN/pA==
+
+"@isomorphic-git/lightning-fs@^4.6.0":
+  version "4.6.0"
+  resolved "https://registry.npmjs.org/@isomorphic-git/lightning-fs/-/lightning-fs-4.6.0.tgz#a7f49784c121241a50cefba6198cff8d6e86eb20"
+  integrity sha512-tfon8f1h6LawjFI/d8lZPWRPTxmdvyTMbkT/j5yo6dB0hALhKw5D9JsdCcUu/D1pAcMMiU7GZFDsDGqylerr7g==
+  dependencies:
+    "@isomorphic-git/idb-keyval" "3.3.2"
+    isomorphic-textencoder "1.0.1"
+    just-debounce-it "1.1.0"
+    just-once "1.1.0"
+
 "@jridgewell/gen-mapping@^0.1.0":
   version "0.1.1"
   resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996"
@@ -2915,6 +2930,11 @@ fast-sort@^2.2.0:
   resolved "https://registry.yarnpkg.com/fast-sort/-/fast-sort-2.2.0.tgz#20903763531fbcbb41c9df5ab1bf5f2cefc8476a"
   integrity sha512-W7zqnn2zsYoQA87FKmYtgOsbJohOrh7XrtZrCVHN5XZKqTBTv5UG+rSS3+iWbg/nepRQUOu+wnas8BwtK8kiCg==
 
+fast-text-encoding@^1.0.0:
+  version "1.0.6"
+  resolved "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz#0aa25f7f638222e3396d72bf936afcf1d42d6867"
+  integrity sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==
+
 fastdom@^1.0.9:
   version "1.0.11"
   resolved "https://registry.yarnpkg.com/fastdom/-/fastdom-1.0.11.tgz#f22984f9df6b9a6081e5ce2e49cfb5525daf198a"
@@ -4161,6 +4181,13 @@ isobject@^3.0.0, isobject@^3.0.1:
   resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
   integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==
 
[email protected]:
+  version "1.0.1"
+  resolved "https://registry.npmjs.org/isomorphic-textencoder/-/isomorphic-textencoder-1.0.1.tgz#38dcd3b4416d29cd33e274f64b99ae567cd15e83"
+  integrity sha512-676hESgHullDdHDsj469hr+7t3i/neBKU9J7q1T4RHaWwLAsaQnywC0D1dIUId0YZ+JtVrShzuBk1soo0+GVcQ==
+  dependencies:
+    fast-text-encoding "^1.0.0"
+
 "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
   version "4.0.0"
   resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -4232,11 +4259,21 @@ [email protected]:
     readable-stream "~2.3.6"
     set-immediate-shim "~1.0.1"
 
[email protected]:
+  version "1.1.0"
+  resolved "https://registry.npmjs.org/just-debounce-it/-/just-debounce-it-1.1.0.tgz#8e92578effc155358a44f458c52ffbee66983bef"
+  integrity sha512-87Nnc0qZKgBZuhFZjYVjSraic0x7zwjhaTMrCKlj0QYKH6lh0KbFzVnfu6LHan03NO7J8ygjeBeD0epejn5Zcg==
+
 just-debounce@^1.0.0:
   version "1.1.0"
   resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.1.0.tgz#2f81a3ad4121a76bc7cb45dbf704c0d76a8e5ddf"
   integrity sha512-qpcRocdkUmf+UTNBYx5w6dexX5J31AKK1OmPwH630a83DdVVUIngk55RSAiIGpQyoH0dlr872VHfPjnQnK1qDQ==
 
[email protected]:
+  version "1.1.0"
+  resolved "https://registry.npmjs.org/just-once/-/just-once-1.1.0.tgz#fe81a185ebaeeb0947a7e705bf01cb6808db0ad8"
+  integrity sha512-+rZVpl+6VyTilK7vB/svlMPil4pxqIJZkbnN7DKZTOzyXfun6ZiFeq2Pk4EtCEHZ0VU4EkdFzG8ZK5F3PErcDw==
+
 katex@^0.16.7:
   version "0.16.8"
   resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.8.tgz#89b453f40e8557f423f31a1009e9298dd99d5ceb"

部分文件因文件數量過多而無法顯示