refactor(mobile): upgrade to capacitor v5

This commit is contained in:
Andelf
2023-09-25 12:48:25 +08:00
parent 438976c7e6
commit 6fc7a1a137
33 changed files with 1162 additions and 1059 deletions

View File

@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'
android {
namespace "com.logseq.app"
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.logseq.app"

View File

@@ -2,8 +2,8 @@
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
@@ -19,7 +19,7 @@ dependencies {
implementation project(':capacitor-splash-screen')
implementation project(':capacitor-status-bar')
implementation project(':capawesome-capacitor-background-task')
implementation project(':hugotomazi-capacitor-navigation-bar')
implementation project(':capgo-capacitor-navigation-bar')
implementation project(':logseq-capacitor-file-sync')
implementation project(':capacitor-voice-recorder')
implementation project(':send-intent')

View File

@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.logseq.app">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"

View File

@@ -40,8 +40,8 @@
"classpath": "io.capawesome.capacitorjs.plugins.backgroundtask.BackgroundTaskPlugin"
},
{
"pkg": "@hugotomazi/capacitor-navigation-bar",
"classpath": "br.com.tombus.capacitor.plugin.navigationbar.NavigationBarPlugin"
"pkg": "@capgo/capacitor-navigation-bar",
"classpath": "ee.forgr.capacitor_navigation_bar.NavigationBarPlugin"
},
{
"pkg": "@logseq/capacitor-file-sync",

View File

@@ -8,8 +8,8 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.13'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

View File

@@ -32,8 +32,8 @@ project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacit
include ':capawesome-capacitor-background-task'
project(':capawesome-capacitor-background-task').projectDir = new File('../node_modules/@capawesome/capacitor-background-task/android')
include ':hugotomazi-capacitor-navigation-bar'
project(':hugotomazi-capacitor-navigation-bar').projectDir = new File('../node_modules/@hugotomazi/capacitor-navigation-bar/android')
include ':capgo-capacitor-navigation-bar'
project(':capgo-capacitor-navigation-bar').projectDir = new File('../node_modules/@capgo/capacitor-navigation-bar/android')
include ':logseq-capacitor-file-sync'
project(':logseq-capacitor-file-sync').projectDir = new File('../node_modules/@logseq/capacitor-file-sync/android')

View File

@@ -20,5 +20,4 @@ org.gradle.jvmargs=-Xmx4096m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@@ -1,16 +1,16 @@
ext {
minSdkVersion = 22
compileSdkVersion = 32
targetSdkVersion = 32
androidxActivityVersion = '1.4.0'
androidxAppCompatVersion = '1.4.2'
compileSdkVersion = 33
targetSdkVersion = 33
androidxActivityVersion = '1.7.0'
androidxAppCompatVersion = '1.6.1'
androidxCoordinatorLayoutVersion = '1.2.0'
androidxCoreVersion = '1.8.0'
androidxFragmentVersion = '1.4.1'
androidxCoreVersion = '1.10.0'
androidxFragmentVersion = '1.5.6'
junitVersion = '4.13.2'
androidxJunitVersion = '1.1.3'
androidxEspressoCoreVersion = '3.4.0'
androidxJunitVersion = '1.1.5'
androidxEspressoCoreVersion = '3.5.1'
cordovaAndroidVersion = '10.1.1'
coreSplashScreenVersion = '1.0.0-rc01'
androidxWebkitVersion = '1.4.0'
coreSplashScreenVersion = '1.0.0'
androidxWebkitVersion = '1.6.1'
}

View File

@@ -9,6 +9,10 @@ const config: CapacitorConfig = {
bundledWebRuntime: false,
webDir: 'public',
loggingBehavior: 'debug',
server: {
// https://capacitorjs.com/docs/updating/5-0#update-androidscheme
androidScheme: 'http',
},
plugins: {
SplashScreen: {
launchShowDuration: 500,

2
ios/.gitignore vendored
View File

@@ -1,9 +1,9 @@
App/build
App/Pods
App/Podfile.lock
App/App/public
DerivedData
xcuserdata
# Cordova plugins for Capacitor
capacitor-cordova-ios-plugins

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -1,116 +1,14 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "AppIcon-20x20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "AppIcon-20x20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "AppIcon-29x29@2x-1.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "AppIcon-29x29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "AppIcon-40x40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "AppIcon-40x40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon-60x60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon-60x60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "AppIcon-20x20@1x.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "AppIcon-20x20@2x-1.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "AppIcon-29x29@1x.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "AppIcon-29x29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "AppIcon-40x40@1x.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "AppIcon-40x40@2x-1.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "AppIcon-76x76@1x.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "AppIcon-76x76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "AppIcon-83.5x83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "AppIcon-512@2x.png",
"scale" : "1x"
"images" : [
{
"filename" : "AppIcon-512@2x.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -21,7 +21,7 @@ def capacitor_pods
pod 'CapacitorSplashScreen', :path => '../../node_modules/@capacitor/splash-screen'
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'
pod 'CapawesomeCapacitorBackgroundTask', :path => '../../node_modules/@capawesome/capacitor-background-task'
pod 'HugotomaziCapacitorNavigationBar', :path => '../../node_modules/@hugotomazi/capacitor-navigation-bar'
pod 'CapgoCapacitorNavigationBar', :path => '../../node_modules/@capgo/capacitor-navigation-bar'
pod 'LogseqCapacitorFileSync', :path => '../../node_modules/@logseq/capacitor-file-sync'
pod 'CapacitorVoiceRecorder', :path => '../../node_modules/capacitor-voice-recorder'
pod 'SendIntent', :path => '../../node_modules/send-intent'

View File

@@ -5,7 +5,7 @@
"main": "static/electron.js",
"devDependencies": {
"@axe-core/playwright": "=4.4.4",
"@capacitor/cli": "^4.0.0",
"@capacitor/cli": "^5.0.0",
"@playwright/test": "=1.31.0",
"@tailwindcss/aspect-ratio": "0.4.2",
"@tailwindcss/forms": "0.5.3",
@@ -76,24 +76,24 @@
"postinstall": "yarn tldraw:build && yarn amplify:build "
},
"dependencies": {
"@capacitor/android": "^4.0.0",
"@capacitor/app": "^4.0.0",
"@capacitor/camera": "^4.0.0",
"@capacitor/clipboard": "^4.0.0",
"@capacitor/core": "^4.0.0",
"@capacitor/filesystem": "^4.0.0",
"@capacitor/haptics": "^4.0.0",
"@capacitor/ios": "^4.0.0",
"@capacitor/keyboard": "^4.0.0",
"@capacitor/share": "^4.0.0",
"@capacitor/splash-screen": "^4.0.0",
"@capacitor/status-bar": "^4.0.0",
"@capawesome/capacitor-background-task": "^2.0.0",
"@capacitor/android": "^5.0.0",
"@capacitor/app": "^5.0.0",
"@capacitor/camera": "^5.0.0",
"@capacitor/clipboard": "^5.0.0",
"@capacitor/core": "^5.0.0",
"@capacitor/filesystem": "^5.0.0",
"@capacitor/haptics": "^5.0.0",
"@capacitor/ios": "^5.0.0",
"@capacitor/keyboard": "^5.0.0",
"@capacitor/share": "^5.0.0",
"@capacitor/splash-screen": "^5.0.0",
"@capacitor/status-bar": "^5.0.0",
"@capawesome/capacitor-background-task": "^5.0.0",
"@excalidraw/excalidraw": "0.15.3",
"@highlightjs/cdn-assets": "10.4.1",
"@hugotomazi/capacitor-navigation-bar": "^2.0.0",
"@capgo/capacitor-navigation-bar": "^6.0.0",
"@isomorphic-git/lightning-fs": "^4.6.0",
"@logseq/capacitor-file-sync": "0.0.35",
"@logseq/capacitor-file-sync": "5.0.0",
"@logseq/diff-merge": "0.2.2",
"@logseq/react-tweet-embed": "1.3.1-1",
"@radix-ui/colors": "^0.1.8",
@@ -102,7 +102,7 @@
"@tabler/icons": "^1.96.0",
"@tippyjs/react": "4.2.5",
"bignumber.js": "^9.0.2",
"capacitor-voice-recorder": "4.0.0",
"capacitor-voice-recorder": "^5.0.0",
"check-password-strength": "2.0.7",
"chokidar": "3.5.1",
"chrono-node": "2.2.4",
@@ -143,7 +143,7 @@
"remove-accents": "0.4.2",
"reveal.js": "^4.5.0",
"sanitize-filename": "1.6.3",
"send-intent": "3.0.11",
"send-intent": "^5.0.0",
"shepherd.js": "^9.1.0",
"tailwind-capitalize-first-letter": "^1.0.4",
"threads": "1.6.5",

View File

@@ -6,7 +6,7 @@
["/frontend/selection" :as selection]
["/frontend/utils" :as utils]
["@capacitor/status-bar" :refer [^js StatusBar Style]]
["@hugotomazi/capacitor-navigation-bar" :refer [^js NavigationBar]]
["@capgo/capacitor-navigation-bar" :refer [^js NavigationBar]]
["grapheme-splitter" :as GraphemeSplitter]
["remove-accents" :as removeAccents]
["sanitize-filename" :as sanitizeFilename]
@@ -209,7 +209,7 @@
(p/do!
(.setStyle StatusBar (clj->js {:style (.-Light Style)}))
(when (mobile-util/native-android?)
(.setColor NavigationBar (clj->js {:color "#ffffff"}))
(.setNavigationBarColo NavigationBar (clj->js {:color "#ffffff"}))
(.setBackgroundColor StatusBar (clj->js {:color "#ffffff"}))))))
#?(:cljs

2001
yarn.lock

File diff suppressed because it is too large Load Diff