Skip to content

Commit

Permalink
perf: ⬆️ Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Sep 7, 2024
1 parent 3ed1f25 commit 8b03862
Show file tree
Hide file tree
Showing 52 changed files with 201 additions and 203 deletions.
2 changes: 1 addition & 1 deletion electron/configs/gnirehtet/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import which from 'which'
import { extraResolve } from '$electron/helpers/index.js'
import which from 'which'

export const getGnirehtetPath = () => {
switch (process.platform) {
Expand Down
4 changes: 2 additions & 2 deletions electron/configs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { buildResolve, extraResolve } from '$electron/helpers/index.js'

export { adbPath } from './android-platform-tools/index.js'

export { scrcpyPath } from './scrcpy/index.js'
export { gnirehtetApkPath, gnirehtetPath } from './gnirehtet/index.js'

export { gnirehtetPath, gnirehtetApkPath } from './gnirehtet/index.js'
export { scrcpyPath } from './scrcpy/index.js'

export const desktopPath = process.env.DESKTOP_PATH

Expand Down
2 changes: 1 addition & 1 deletion electron/configs/scrcpy/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import which from 'which'
import { extraResolve } from '$electron/helpers/index.js'
import which from 'which'

export const getScrcpyPath = () => {
switch (process.platform) {
Expand Down
2 changes: 1 addition & 1 deletion electron/events/handles/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs-extra'
import { dialog, ipcMain, shell } from 'electron'
import fs from 'fs-extra'

export default (mainWindow) => {
ipcMain.handle(
Expand Down
6 changes: 3 additions & 3 deletions electron/events/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { app, ipcMain } from 'electron'

import shortcuts from './shortcuts/index.js'
import updater from './updater/index.js'
import handles from './handles/index.js'
import tray from './tray/index.js'
import shortcuts from './shortcuts/index.js'
import theme from './theme/index.js'
import tray from './tray/index.js'
import updater from './updater/index.js'

export default (mainWindow) => {
ipcMain.on('restart-app', () => {
Expand Down
4 changes: 2 additions & 2 deletions electron/events/tray/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Menu, Tray, app, dialog } from 'electron'
import { trayPath } from '$electron/configs/index.js'
import appStore from '$electron/helpers/store.js'
import { executeI18n } from '$electron/helpers/index.js'
import appStore from '$electron/helpers/store.js'
import { app, dialog, Menu, Tray } from 'electron'

export default (mainWindow) => {
const t = value => executeI18n(mainWindow, value)
Expand Down
4 changes: 2 additions & 2 deletions electron/events/updater/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { app, ipcMain } from 'electron'
import { devPublishPath } from '$electron/configs/index.js'
import { is } from '@electron-toolkit/utils'
import { app, ipcMain } from 'electron'
import electronUpdater from 'electron-updater'
import { devPublishPath } from '$electron/configs/index.js'

const { autoUpdater } = electronUpdater

Expand Down
12 changes: 6 additions & 6 deletions electron/exposes/adbkit/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import util from 'node:util'
import { exec as _exec, spawn } from 'node:child_process'
import path from 'node:path'
import fs from 'node:fs'
import dayjs from 'dayjs'
import { Adb } from '@devicefarmer/adbkit'
import { uniq } from 'lodash-es'
import appStore from '$electron/helpers/store.js'
import path from 'node:path'
import util from 'node:util'
import { adbPath } from '$electron/configs/index.js'
import appStore from '$electron/helpers/store.js'
import { formatFileSize } from '$renderer/utils/index'
import { Adb } from '@devicefarmer/adbkit'
import dayjs from 'dayjs'
import { uniq } from 'lodash-es'

const exec = util.promisify(_exec)

Expand Down
2 changes: 1 addition & 1 deletion electron/exposes/gnirehtet/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { spawn } from 'node:child_process'
import appStore from '$electron/helpers/store.js'
import {
adbPath,
gnirehtetApkPath,
gnirehtetPath,
} from '$electron/configs/index.js'
import appStore from '$electron/helpers/store.js'

const appDebug = appStore.get('common.debug') || false

Expand Down
12 changes: 6 additions & 6 deletions electron/exposes/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import path from 'node:path'

import '$electron/helpers/console.js'
import electron from './electron/index.js'
import * as configs from '$electron/configs/index.js'
import appLog from '$electron/helpers/log.js'
import store from '$electron/helpers/store.js'
import adbkit from './adbkit/index.js'
import scrcpy from './scrcpy/index.js'
import electron from './electron/index.js'
import gnirehtet from './gnirehtet/index.js'
import scrcpy from './scrcpy/index.js'
import search from './search/index.js'
import * as configs from '$electron/configs/index.js'
import store from '$electron/helpers/store.js'
import appLog from '$electron/helpers/log.js'
import '$electron/helpers/console.js'

export default {
init(expose) {
Expand Down
2 changes: 1 addition & 1 deletion electron/exposes/log/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import log from 'electron-log/main.js'
import { createProxy } from '$electron/helpers/index'
import log from 'electron-log/main.js'

const levels = Object.keys(log.functions)

Expand Down
6 changes: 3 additions & 3 deletions electron/exposes/scrcpy/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import util from 'node:util'
import { exec as _exec, spawn } from 'node:child_process'
import { replaceIP, sleep } from '$renderer/utils/index.js'
import appStore from '$electron/helpers/store.js'
import util from 'node:util'
import { adbPath, scrcpyPath } from '$electron/configs/index.js'
import appStore from '$electron/helpers/store.js'
import { replaceIP, sleep } from '$renderer/utils/index.js'

let adbkit

Expand Down
2 changes: 1 addition & 1 deletion electron/exposes/search/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { primaryColor } from '$renderer/configs/index.js'
import remote from '@electron/remote'
import { FindInPage } from 'electron-find-in-page'
import { primaryColor } from '$renderer/configs/index.js'

export default () => {
const theme = {
Expand Down
4 changes: 2 additions & 2 deletions electron/helpers/console.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import appStore from './store.js'
import { createProxy } from './index.js'
import log from '$electron/helpers/log.js'
import { createProxy } from './index.js'
import appStore from './store.js'

const debug = appStore.get('common.debug') || false

Expand Down
2 changes: 1 addition & 1 deletion electron/helpers/log.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createProxy } from '$electron/helpers/index'
import { shell } from 'electron'
import log from 'electron-log/main.js'
import { createProxy } from '$electron/helpers/index'

log.transports.console.level = false

Expand Down
4 changes: 2 additions & 2 deletions electron/helpers/process.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/** 在主进程中获取关键信息存储到环境变量中,从而在预加载脚本中及渲染进程中使用 */
import { app } from 'electron'

/** 注意: app.isPackaged 可能被被某些方法改变所以请将该文件放到 main.js 必须位于非依赖项的顶部 */
import fixPath from 'fix-path'

import { app } from 'electron'

if (process.platform === 'darwin') {
fixPath()
}
Expand Down
18 changes: 9 additions & 9 deletions electron/main.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import path from 'node:path'
import { createRequire } from 'node:module'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

import { BrowserWindow, app, nativeTheme, shell } from 'electron'
import remote from '@electron/remote/main'
import { electronApp, optimizer } from '@electron-toolkit/utils'
import { app, BrowserWindow, shell } from 'electron'
import contextMenu from 'electron-context-menu'
import remote from '@electron/remote/main'

// process.js 必须位于非依赖项的顶部
import './helpers/process.js'
import appStore from './helpers/store.js'
import { icnsLogoPath, icoLogoPath, logoPath } from './configs/index.js'
import events from './events/index.js'

import log from './helpers/log.js'
import './helpers/console.js'
import appStore from './helpers/store.js'

import { icnsLogoPath, icoLogoPath, logoPath } from './configs/index.js'
// process.js 必须位于非依赖项的顶部
import './helpers/process.js'

import events from './events/index.js'
import './helpers/console.js'

const require = createRequire(import.meta.url)
const __dirname = path.dirname(fileURLToPath(import.meta.url))
Expand Down
4 changes: 4 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default antfu(
'vue/custom-event-name-casing': 'off',
'vue/no-use-v-if-with-v-for': 'off',
'vue/component-tags-order': 'off',

'unicorn/consistent-function-scoping': 'off',
'regexp/no-unused-capturing-group': 'off',
'regexp/no-dupe-disjunctions': 'off',
},
},
)
86 changes: 43 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,50 +22,50 @@
"prepare": "husky install"
},
"dependencies": {
"electron-in-page-search": "^1.3.2",
"nanoid": "^5.0.7",
"pinia-plugin-persistedstate": "^3.2.1",
"vue": "^3.4.26"
"electron-in-page-search": "1.3.2",
"nanoid": "5.0.7",
"pinia-plugin-persistedstate": "3.2.1",
"vue": "3.4.26"
},
"devDependencies": {
"@antfu/eslint-config": "2.16.1",
"@devicefarmer/adbkit": "^3.2.6",
"@electron-toolkit/preload": "^3.0.1",
"@electron-toolkit/utils": "^3.0.0",
"@electron/remote": "^2.1.2",
"@intlify/unplugin-vue-i18n": "^4.0.0",
"@unocss/reset": "^0.59.4",
"@unocss/transformer-directives": "^0.59.4",
"@viarotel-org/unocss-preset-shades": "^0.8.2",
"@vitejs/plugin-vue": "^5.0.4",
"@vueuse/core": "^10.9.0",
"dayjs": "^1.11.11",
"electron": "^30.0.3",
"electron-builder": "^24.13.3",
"electron-context-menu": "^4.0.0",
"electron-find-in-page": "^1.0.8",
"electron-log": "^5.1.2",
"electron-store": "^9.0.0",
"electron-updater": "^6.1.8",
"element-plus": "^2.8.1",
"eslint": "^8.57.0",
"fix-path": "^4.0.0",
"fs-extra": "^11.2.0",
"husky": "^9.0.11",
"lodash-es": "^4.17.21",
"pinia": "^2.1.7",
"postcss": "^8.4.38",
"postcss-nested": "^6.0.1",
"postcss-scss": "^4.0.9",
"unocss": "^0.59.4",
"unplugin-auto-import": "^0.17.5",
"unplugin-vue-components": "^0.27.0",
"vite": "^5.2.11",
"vite-plugin-electron": "^0.28.7",
"vite-plugin-electron-renderer": "^0.14.5",
"vite-svg-loader": "^5.1.0",
"vue-command": "^35.2.1",
"vue-i18n": "^9.13.1",
"which": "^4.0.0"
"@antfu/eslint-config": "3.3.2",
"@devicefarmer/adbkit": "3.2.6",
"@electron-toolkit/preload": "3.0.1",
"@electron-toolkit/utils": "3.0.0",
"@electron/remote": "2.1.2",
"@intlify/unplugin-vue-i18n": "4.0.0",
"@unocss/reset": "0.59.4",
"@unocss/transformer-directives": "0.59.4",
"@viarotel-org/unocss-preset-shades": "0.8.2",
"@vitejs/plugin-vue": "5.0.4",
"@vueuse/core": "10.9.0",
"dayjs": "1.11.11",
"electron": "30.0.3",
"electron-builder": "24.13.3",
"electron-context-menu": "4.0.0",
"electron-find-in-page": "1.0.8",
"electron-log": "5.1.2",
"electron-store": "9.0.0",
"electron-updater": "6.1.8",
"element-plus": "2.8.2",
"eslint": "9.10.0",
"fix-path": "4.0.0",
"fs-extra": "11.2.0",
"husky": "9.0.11",
"lodash-es": "4.17.21",
"pinia": "2.1.7",
"postcss": "8.4.38",
"postcss-nested": "6.0.1",
"postcss-scss": "4.0.9",
"unocss": "0.59.4",
"unplugin-auto-import": "0.17.5",
"unplugin-vue-components": "0.27.0",
"vite": "5.2.11",
"vite-plugin-electron": "0.28.7",
"vite-plugin-electron-renderer": "0.14.5",
"vite-svg-loader": "5.1.0",
"vue-command": "35.2.1",
"vue-i18n": "9.13.1",
"which": "4.0.0"
}
}
18 changes: 9 additions & 9 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@
</template>

<script setup>
import { i18n } from '$/locales/index.js'
import localeModel from '$/plugins/element-plus/locale.js'
import { usePreferenceStore } from '$/store/preference/index.js'
import { useThemeStore } from '$/store/theme/index.js'
import { ElMessageBox } from 'element-plus'
import About from './components/About/index.vue'
import Device from './components/Device/index.vue'
import Preference from './components/Preference/index.vue'
import About from './components/About/index.vue'
import Quick from './components/Quick/index.vue'
import { i18n } from '$/locales/index.js'
import localeModel from '$/plugins/element-plus/locale.js'
import { useThemeStore } from '$/store/theme/index.js'
import { usePreferenceStore } from '$/store/preference/index.js'
const locale = computed(() => {
const i18nLocale = i18n.global.locale.value
Expand Down Expand Up @@ -101,8 +101,8 @@ async function showTips() {
ElMessageBox.alert(
`<div>
${window.t('dependencies.lack.content', {
name: '<a class="hover:underline text-primary-500" href="https://github.com/Genymobile/scrcpy" target="_blank">scrcpy</a>',
})}
name: '<a class="hover:underline text-primary-500" href="https://github.com/Genymobile/scrcpy" target="_blank">scrcpy</a>',
})}
<div>`,
window.t('dependencies.lack.title'),
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
</template>

<script setup>
import { useTaskStore } from '$/store/index.js'
import { useScreenshotAction } from '$/composables/useScreenshotAction/index.js'
import { useTaskStore } from '$/store/index.js'
const props = defineProps({
devices: {
type: Array,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
</template>

<script setup>
import { ElMessage } from 'element-plus'
import InputPath from '$/components/Preference/components/PreferenceForm/components/InputPath/index.vue'
import {
timeUnit as intervalModel,
Expand All @@ -172,7 +172,7 @@ import {
import { useTaskStore } from '$/store/index.js'
import { sleep } from '$/utils'
import InputPath from '$/components/Preference/components/PreferenceForm/components/InputPath/index.vue'
import { ElMessage } from 'element-plus'
const taskStore = useTaskStore()
Expand Down
2 changes: 1 addition & 1 deletion src/components/Device/components/BatchActions/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@

<script setup>
import Application from './Application/index.vue'
import Screenshot from './Screenshot/index.vue'
import FileManage from './FileManage/index.vue'
import Screenshot from './Screenshot/index.vue'
import Shell from './Shell/index.vue'
import Tasks from './Tasks/index.vue'
Expand Down
Loading

0 comments on commit 8b03862

Please sign in to comment.