Преглед на файлове

Merge branch 'master' into feat/db

charlie преди 1 година
родител
ревизия
6ade79ba3c
променени са 6 файла, в които са добавени 99 реда и са изтрити 29 реда
  1. 74 8
      .github/workflows/build-desktop-release.yml
  2. 2 1
      resources/package.json
  3. 2 2
      src/main/frontend/util.cljc
  4. 10 10
      src/resources/dicts/it.edn
  5. 7 4
      src/test/frontend/util_test.cljs
  6. 4 4
      static/yarn.lock

+ 74 - 8
.github/workflows/build-desktop-release.yml

@@ -222,7 +222,7 @@ jobs:
           DEBUG: "pw:api"
           RELEASE: true # skip dev only test
 
-  build-linux:
+  build-linux-x64:
     runs-on: ubuntu-20.04
     needs: [ compile-cljs ]
     steps:
@@ -265,7 +265,61 @@ jobs:
       - name: Upload Artifact
         uses: actions/upload-artifact@v3
         with:
-          name: logseq-linux-builds
+          name: logseq-linux-x64-builds
+          path: builds
+
+  build-linux-arm64:
+    runs-on: ubuntu-20.04
+    needs: [ compile-cljs ]
+    steps:
+      - name: Download The Static Asset
+        uses: actions/download-artifact@v3
+        with:
+          name: static
+          path: static
+
+      - name: Retrieve tag version
+        id: ref
+        run: |
+          pkgver=$(cat ./static/VERSION)
+          echo "version=$pkgver" >> $GITHUB_OUTPUT
+
+      - name: Install Node.js, NPM and Yarn
+        uses: actions/setup-node@v3
+        with:
+          node-version: ${{ env.NODE_VERSION }}
+
+      - name: Fetch deps
+        env:
+          npm_config_arch: arm64
+        run: |
+          yarn install --target_arch=arm64 --target_platform=linux
+          rsapi_version=`node -e 'console.log(require("@logseq/rsapi/package.json").optionalDependencies["@logseq/rsapi-linux-arm64-gnu"])'`
+          temp_dir=`mktemp -d`
+          cd "$temp_dir"
+          echo '{"dependencies": {"@logseq/rsapi-linux-arm64-gnu": "'"$rsapi_version"'"}}' > package.json
+          yarn install --ignore-platform
+          cd -
+          mv "$temp_dir/node_modules/@logseq/rsapi-linux-arm64-gnu" node_modules/@logseq/rsapi-linux-arm64-gnu
+          rm -rf "$temp_dir" "node_modules/@logseq/rsapi-linux-x64-gnu"
+        working-directory: ./static
+
+      - name: Build/Release Electron App
+        run: yarn electron:make-linux-arm64
+        working-directory: ./static
+
+      - name: Save artifacts
+        run: |
+          mkdir -p builds
+          # NOTE: save VERSION file to builds directory
+          cp static/VERSION ./builds/VERSION
+          # mv static/out/make/*-*.AppImage ./builds/Logseq-linux-arm64-${{ steps.ref.outputs.version }}.AppImage
+          mv static/out/make/zip/linux/arm64/*-linux-arm64-*.zip ./builds/Logseq-linux-arm64-${{ steps.ref.outputs.version }}.zip
+
+      - name: Upload Artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: logseq-linux-arm64-builds
           path: builds
 
   build-windows:
@@ -498,7 +552,7 @@ jobs:
 
   nightly-release:
     if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly' }}
-    needs: [ build-macos-x64, build-macos-arm64, build-linux, build-windows, build-android, e2e-test ]
+    needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows, build-android, e2e-test ]
     runs-on: ubuntu-20.04
     steps:
       - name: Download MacOS x64 Artifacts
@@ -513,10 +567,16 @@ jobs:
           name: logseq-darwin-arm64-builds
           path: ./
 
-      - name: Download The Linux Artifacts
+      - name: Download The Linux x64 Artifacts
         uses: actions/download-artifact@v3
         with:
-          name: logseq-linux-builds
+          name: logseq-linux-x64-builds
+          path: ./
+
+      - name: Download The Linux arm64 Artifacts
+        uses: actions/download-artifact@v3
+        with:
+          name: logseq-linux-arm64-builds
           path: ./
 
       - name: Download The Windows Artifact
@@ -565,7 +625,7 @@ jobs:
   release:
     # NOTE: For now, we only have beta channel to be released on Github
     if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build-target == 'beta' }}
-    needs: [ build-macos-x64, build-macos-arm64, build-linux, build-windows, e2e-test ]
+    needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows, e2e-test ]
     runs-on: ubuntu-20.04
     steps:
       - name: Download MacOS x64 Artifacts
@@ -580,10 +640,16 @@ jobs:
           name: logseq-darwin-arm64-builds
           path: ./
 
-      - name: Download The Linux Artifacts
+      - name: Download The Linux x64 Artifacts
+        uses: actions/download-artifact@v3
+        with:
+          name: logseq-linux-x64-builds
+          path: ./
+
+      - name: Download The Linux arm64 Artifacts
         uses: actions/download-artifact@v3
         with:
-          name: logseq-linux-builds
+          name: logseq-linux-arm64-builds
           path: ./
 
       - name: Download The Windows Artifact

+ 2 - 1
resources/package.json

@@ -11,6 +11,7 @@
     "electron:dev": "electron-forge start",
     "electron:debug": "electron-forge start --inspect-electron",
     "electron:make": "electron-forge make",
+    "electron:make-linux-arm64": "electron-forge make --platform=linux --arch=arm64",
     "electron:make-macos-arm64": "electron-forge make --platform=darwin --arch=arm64",
     "electron:publish:github": "electron-forge publish",
     "rebuild:all": "electron-rebuild -v 27.1.3 -f",
@@ -28,7 +29,7 @@
     "chokidar": "^3.5.1",
     "command-exists": "1.2.9",
     "diff-match-patch": "1.0.5",
-    "dugite": "2.5.0",
+    "dugite": "2.5.1",
     "electron-deeplink": "1.0.10",
     "electron-dl": "3.3.0",
     "electron-log": "4.3.1",

+ 2 - 2
src/main/frontend/util.cljc

@@ -718,7 +718,7 @@
              (js/console.error e)
              (dec current-pos)))
          (dec current-pos))
-       (dec current-pos))))
+       current-pos)))
 
 #?(:cljs
    ;; for widen char
@@ -735,7 +735,7 @@
              (js/console.error e)
              (inc current-pos)))
          (inc current-pos))
-       (inc current-pos))))
+       current-pos)))
 
 #?(:cljs
    (defn kill-line-before!

+ 10 - 10
src/resources/dicts/it.edn

@@ -585,11 +585,11 @@
  :plugin.install-from-file/title "Installa plugin da plugins.edn"
  :query/config-property-settings "Impostazioni per le proprietà di questa richiesta:"
  :right-side-bar/flashcards "Flashcard"
- :right-side-bar/history "(Dev) cronologia disfai/rifai"
+ :right-side-bar/history "(Dev) cronologia disfare/rifare"
  :right-side-bar/history-global "globale"
  :right-side-bar/history-pageonly "solo pagina corrente"
  :right-side-bar/history-redos "Rifai"
- :right-side-bar/history-undos "Disfai"
+ :right-side-bar/history-undos "Rifare"
  :right-side-bar/pane-close "Chiudi"
  :right-side-bar/pane-close-all "Chiudi tutti"
  :right-side-bar/pane-close-others "Chiudi altri"
@@ -649,9 +649,9 @@
  :settings-page/tab-editor "Editor"
  :settings-page/tab-features "Funzionalità"
  :settings-page/tab-keymap "Scorciatoie"
- :settings-page/theme-dark "scuro"
- :settings-page/theme-light "chiaro"
- :settings-page/theme-system "sistema"
+ :settings-page/theme-dark "Scuro"
+ :settings-page/theme-light "Chiaro"
+ :settings-page/theme-system "Sistema"
  :settings-page/update-available "Trovato una nuova versione "
  :settings-page/update-error-1 "⚠️ Ops, qualcosa è andato storto!"
  :settings-page/update-error-2 " Per favore, controlla il "
@@ -703,8 +703,8 @@
  :whiteboard/link-to-any-page-or-block "Collega a qualsiasi pagina o blocco"
  :whiteboard/lock "Blocca"
  :whiteboard/medium "Medio"
- :whiteboard/move-to-back "Sposta in retro"
- :whiteboard/move-to-front "Sposta in fronte"
+ :whiteboard/move-to-back "Sposta sul retro"
+ :whiteboard/move-to-front "Sposta sul fronte"
  :whiteboard/new-block "Nuovo blocco:"
  :whiteboard/new-block-no-colon "Nuovo blocco"
  :whiteboard/new-page "Nuova pagina:"
@@ -713,8 +713,8 @@
  :whiteboard/open-page "Apri pagina"
  :whiteboard/open-page-in-sidebar "Apri pagina nel pannello laterale"
  :whiteboard/open-twitter-url "Apri link Twitter"
- :whiteboard/open-website-url "Open sito internet"
- :whiteboard/open-youtube-url "Open link YouTube"
+ :whiteboard/open-website-url "Apri sito internet"
+ :whiteboard/open-youtube-url "Apri link YouTube"
  :whiteboard/pack-into-rectangle "Forma rettangolo compresso"
  :whiteboard/pan "Muovi"
  :whiteboard/paste "Incolla"
@@ -741,7 +741,7 @@
  :whiteboard/toggle-pen-mode "Attiva/disattiva modalità penna"
  :whiteboard/triangle "Triangolo"
  :whiteboard/twitter-url "Indirizzo Twitter"
- :whiteboard/undo "Disfai"
+ :whiteboard/undo "Rifare"
  :whiteboard/ungroup "Annulla raggruppamento"
  :whiteboard/unlock "Blocca"
  :whiteboard/website-url "Link sito internet"

+ 7 - 4
src/test/frontend/util_test.cljs

@@ -15,14 +15,17 @@
     (is (= 0 (util/safe-dec-current-pos-from-end "😀" 2)))
     (is (= 0 (util/safe-dec-current-pos-from-end "a" 1)))
     (is (= 4 (util/safe-dec-current-pos-from-end "abcde" 5)))
-    (is (= 1 (util/safe-dec-current-pos-from-end "中文" 2))))
+    (is (= 1 (util/safe-dec-current-pos-from-end "中文" 2)))
+    (is (= 0 (util/safe-dec-current-pos-from-end "中" 1)))
+    (is (= 0 (util/safe-dec-current-pos-from-end "a" 1))))
 
   (testing "safe current position from start for emoji"
     (is (= 5 (util/safe-inc-current-pos-from-start "abc😀d" 3)))
-    (is (= 2 (util/safe-inc-current-pos-from-start "😀" 0)))
     (is (= 2 (util/safe-inc-current-pos-from-start "abcde" 1)))
-    (is (= 1 (util/safe-inc-current-pos-from-start "a" 0)))
-    (is (= 1 (util/safe-inc-current-pos-from-start "中文" 0)))))
+    (is (= 1 (util/safe-inc-current-pos-from-start "中文" 0)))
+    (is (= 2 (util/safe-inc-current-pos-from-start "😀" 0)))
+    (is (= 1 (util/safe-inc-current-pos-from-start "中" 0)))
+    (is (= 1 (util/safe-inc-current-pos-from-start "a" 0)))))
 
 (deftest test-get-line-pos
   (testing "get-line-pos"

+ 4 - 4
static/yarn.lock

@@ -1856,10 +1856,10 @@ ds-store@^0.1.5:
     macos-alias "~0.2.5"
     tn1150 "^0.1.0"
 
[email protected].0:
-  version "2.5.0"
-  resolved "https://registry.yarnpkg.com/dugite/-/dugite-2.5.0.tgz#8b235564fdf8692688283c714149a59d9da79865"
-  integrity sha512-sYsSOqV7NidthDtMUPgKCvqMGqswKkcyAxOMhwEswlcGZ+kHadT2SEDFUJOy0AVR/yTJL6wBF7q1OiySfU0gGA==
[email protected].1:
+  version "2.5.1"
+  resolved "https://registry.yarnpkg.com/dugite/-/dugite-2.5.1.tgz#6ab808ebf321809edf42d974e62eea9c9e256722"
+  integrity sha512-9OjUguynzq8v3GSmp01kbVcMmErc65ZZ0OssO/0PM2RyhD8Dzb8cCuy3z72+IxLwPwNi754jZ0FtMLAFA3D0qA==
   dependencies:
     progress "^2.0.3"
     tar "^6.1.11"