Skip to content

Commit

Permalink
perf: ➖ Remove redundant packages
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Mar 5, 2024
1 parent 34c9393 commit f9e4a0e
Show file tree
Hide file tree
Showing 11 changed files with 63 additions and 44 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
.github
.gitignore
node_modules
dist
dist-electron
dist-release
15 changes: 12 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
module.exports = {
extends: ['@viarotel-org'],
extends: ['@antfu'],
rules: {
'antfu/top-level-function': 'off',
'no-unused-vars': 'off',
'eqeqeq': 'off',
'prefer-promise-reject-errors': 'off',
'no-new-func': 'off',

'antfu/top-level-function': 'off',
'curly': 'off',
'no-console': 'off',
'unused-imports/no-unused-vars': 'off',

'import/default': 'off',

'vue/no-mutating-props': 'off',
'vue/no-use-v-if-with-v-for': 'off',
'vue/html-self-closing': 'off',
'vue/block-order': 'off',
'vue/no-unused-refs': 'off',

'n/prefer-global/process': 'off',

'@typescript-eslint/no-invalid-this': 'off',
},
}
2 changes: 1 addition & 1 deletion copilot/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="flex flex-col absolute inset-fix-0 h-full overflow-hidden">
<div class="flex flex-col absolute inset-0 h-full overflow-hidden">
<div class="py-4 px-4 flex items-center flex-none">
<a class="block" :href="escrcpyURL" target="_blank">
<img src="@electron/resources/build/logo.png" class="h-9" alt="" />
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"build:mac": "vite build && electron-builder --mac",
"build:linux": "vite build && electron-builder --linux",
"preview": "vite preview",
"lint": "eslint . --ext .md,.vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .eslintignore --fix",
"lint": "eslint . --ignore-path .eslintignore",
"lint:fix": "eslint . --ignore-path .eslintignore --fix",
"svgo": "svgo --folder=src/icons/svgo --output=src/icons/svg --config=src/icons/svgo.config.js",
"postinstall": "electron-builder install-app-deps",
"prepare": "husky install"
Expand All @@ -22,15 +23,15 @@
"vue": "^3.3.6"
},
"devDependencies": {
"@antfu/eslint-config": "^0.43.1",
"@devicefarmer/adbkit": "^3.2.5",
"@electron-toolkit/preload": "^2.0.0",
"@electron-toolkit/utils": "^2.0.1",
"@hono/node-server": "^1.2.3",
"@intlify/unplugin-vue-i18n": "^1.4.0",
"@viarotel-org/design": "^0.7.0",
"@viarotel-org/eslint-config": "^0.7.0",
"@viarotel-org/postcss-config": "^0.7.0",
"@viarotel-org/unocss-config": "^0.7.4",
"@unocss/reset": "^0.58.5",
"@unocss/transformer-directives": "^0.58.5",
"@viarotel-org/unocss-preset-shades": "^0.8.2",
"@vitejs/plugin-vue": "^4.4.0",
"dayjs": "^1.11.10",
"electron": "^27.0.3",
Expand All @@ -51,14 +52,14 @@
"postcss-nested": "^6.0.1",
"postcss-scss": "^4.0.9",
"typescript": "5.2.2",
"unocss": "^0.58.5",
"vite": "^4.5.0",
"vite-plugin-electron": "^0.14.1",
"vite-plugin-electron-renderer": "^0.14.5",
"vite-plugin-eslint": "^1.8.1",
"vite-svg-loader": "^4.0.0",
"vue-command": "^35.2.1",
"vue-i18n": "^9.5.0",
"which": "^4.0.0",
"ws": "^8.14.2"
}
}
}
7 changes: 2 additions & 5 deletions src/components/Device/components/MirrorAction/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ export default {
this.loading = false
await mirroring
}
catch (error) {
} catch (error) {
console.warn(error)
if (error.message) {
this.$message.warning(error.message)
Expand All @@ -64,9 +63,7 @@ export default {
}
},
onStdout() {},
onStderr() {
this.loading = false
},
onStderr() {},
},
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default {
{
excludes: ['--video-source', '--mouse', '--keyboard'],
isCamera: true,
},
}
)}`
try {
Expand All @@ -50,8 +50,7 @@ export default {
this.loading = false
await mirroring
}
catch (error) {
} catch (error) {
console.warn(error)
if (error.message) {
Expand All @@ -62,9 +61,7 @@ export default {
}
},
onStdout() {},
onStderr() {
this.loading = false
},
onStderr() {},
},
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ export default {
this.loading = false
await mirroring
}
catch (error) {
} catch (error) {
console.warn(error)
if (error.message) {
Expand All @@ -59,9 +58,7 @@ export default {
}
},
onStdout() {},
onStderr() {
this.loading = false
},
onStderr() {},
},
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ export default {
await recording
this.onRecordSuccess(savePath)
}
catch (error) {
} catch (error) {
console.warn(error)
if (error.message) {
Expand All @@ -62,17 +61,15 @@ export default {
}
},
onStdout() {},
onStderr() {
this.loading = false
},
onStderr() {},
getRecordPath(row) {
const config = this.$store.preference.getData(row.id)
const basePath = config.savePath
const extension = config['--record-format'] || 'mp4'
const fileName = this.$store.device.getLabel(
row,
({ time }) => `record-${time}.${extension}`,
({ time }) => `record-${time}.${extension}`
)
const joinValue = this.$path.join(basePath, fileName)
Expand All @@ -90,12 +87,11 @@ export default {
cancelButtonText: this.$t('common.cancel'),
closeOnClickModal: false,
type: 'success',
},
}
)
await this.$electron.ipcRenderer.invoke('show-item-in-folder', savePath)
}
catch (error) {
} catch (error) {
console.warn(error)
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/styles/css/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import '@viarotel-org/design/styles/resets'
import '@unocss/reset/tailwind-compat.css'
import './desktop.css'
import './helpers.css'
import './helpers.css'
29 changes: 26 additions & 3 deletions unocss.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
import extendConfig from '@viarotel-org/unocss-config/src/desktop/index.js'
import { presetWind, defineConfig } from 'unocss'
import transformerDirectives from '@unocss/transformer-directives'
import { presetShades } from '@viarotel-org/unocss-preset-shades'

export default extendConfig({
shortcuts: {},
const presetMain = presetWind()

const presets = [presetMain, presetShades('#028d71')]

export default defineConfig({
// @ts-ignore
presets,
transformers: [transformerDirectives()],
theme: {
boxShadow: {
el: 'var(--el-box-shadow)',
'el-light': 'var(--el-box-shadow-light)',
'el-lighter': 'var(--el-box-shadow-lighter)',
'el-dark': 'var(--el-box-shadow-dark)',
},
},
shortcuts: {
'inset-0': 'top-0 bottom-0 left-0 right-0',
'inset-center':
'top-1/2 left-1/2 transform -translate-y-1/2 -translate-x-1/2',
'inset-left-center': 'left-1/2 transform -translate-x-1/2',
'inset-top-center': 'top-1/2 transform -translate-y-1/2',
},
})
2 changes: 0 additions & 2 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import useRenderer from 'vite-plugin-electron-renderer'
import { notBundle } from 'vite-plugin-electron/plugin'

import useVue from '@vitejs/plugin-vue'
import useEslint from 'vite-plugin-eslint'
import useUnoCSS from 'unocss/vite'
import useSvg from 'vite-svg-loader'
import useI18n from '@intlify/unplugin-vue-i18n/vite'
Expand Down Expand Up @@ -47,7 +46,6 @@ export default params =>
},
},
plugins: [
useEslint(),
useUnoCSS(),
useSvg(),
useVue(),
Expand Down

0 comments on commit f9e4a0e

Please sign in to comment.