Refactor(desktop-client): code structure for improved readability and maintainability
This commit is contained in:
@@ -1,18 +1,72 @@
|
||||
appId: com.geo.rankly.desktop
|
||||
productName: GEO Rankly Desktop
|
||||
copyright: Copyright © 2026 GEO Rankly
|
||||
directories:
|
||||
output: release
|
||||
files:
|
||||
- out/**
|
||||
buildResources: build
|
||||
compression: maximum
|
||||
removePackageScripts: true
|
||||
removePackageKeywords: true
|
||||
asar: true
|
||||
asarUnpack:
|
||||
- "**/node_modules/better-sqlite3/build/Release/**"
|
||||
- "**/node_modules/better-sqlite3/lib/**"
|
||||
- "**/node_modules/bindings/**"
|
||||
- "**/node_modules/file-uri-to-path/**"
|
||||
- "**/node_modules/playwright-core/lib/**"
|
||||
- "**/node_modules/playwright-core/bin/**"
|
||||
files:
|
||||
- out/**/*
|
||||
- package.json
|
||||
- "!**/*.map"
|
||||
- "!**/*.ts"
|
||||
- "!**/*.tsx"
|
||||
- "!**/*.md"
|
||||
- "!**/*.markdown"
|
||||
- "!**/{test,tests,__tests__,__mocks__,example,examples,docs,doc,demo,samples,man}/**"
|
||||
- "!**/{LICENSE,LICENSE.*,license,CHANGELOG,CHANGELOG.*,README,README.*,HISTORY,HISTORY.*,AUTHORS,CONTRIBUTING}*"
|
||||
- "!**/.*"
|
||||
- "!**/node_modules/.bin/**"
|
||||
- "!**/node_modules/*/{Makefile,Gulpfile.js,Gruntfile.js,CMakeLists.txt,*.coffee,*.flow,*.c,*.cc,*.cpp,*.h,*.hpp,*.gyp,*.gypi,*.tgz,binding.gyp}"
|
||||
- "!**/node_modules/**/{*.d.ts,tsconfig*.json,jest.config*,rollup.config*,webpack.config*,vite.config*}"
|
||||
- "!**/node_modules/better-sqlite3/{deps,src,docs,benchmark}/**"
|
||||
- "!**/node_modules/better-sqlite3/{test_extension.c,download.sh,*.gyp,*.gypi}"
|
||||
- "!**/node_modules/playwright-core/{types,ThirdPartyNotices.txt}/**"
|
||||
- "!**/node_modules/**/*.{c,cc,cpp,h,hpp,cmake,m4,am,sh}"
|
||||
mac:
|
||||
category: public.app-category.productivity
|
||||
identity: null
|
||||
notarize: false
|
||||
hardenedRuntime: false
|
||||
gatekeeperAssess: false
|
||||
electronLanguages:
|
||||
- en
|
||||
- zh_CN
|
||||
target:
|
||||
- dmg
|
||||
- zip
|
||||
- target: dmg
|
||||
arch: [arm64]
|
||||
- target: zip
|
||||
arch: [arm64]
|
||||
dmg:
|
||||
format: ULFO
|
||||
contents:
|
||||
- x: 130
|
||||
y: 220
|
||||
- x: 410
|
||||
y: 220
|
||||
type: link
|
||||
path: /Applications
|
||||
win:
|
||||
target:
|
||||
- nsis
|
||||
- target: nsis
|
||||
arch: [x64]
|
||||
nsis:
|
||||
oneClick: false
|
||||
perMachine: false
|
||||
allowToChangeInstallationDirectory: true
|
||||
linux:
|
||||
category: Office
|
||||
target:
|
||||
- AppImage
|
||||
- target: AppImage
|
||||
arch: [x64]
|
||||
publish: null
|
||||
|
||||
@@ -8,9 +8,25 @@ import { AntDesignVueResolver } from "unplugin-vue-components/resolvers";
|
||||
|
||||
const rootDir = fileURLToPath(new URL(".", import.meta.url));
|
||||
|
||||
const workspacePackages = [
|
||||
"@geo/shared-types",
|
||||
"@geo/http-client",
|
||||
"@geo/publisher-platforms",
|
||||
"@geo/ui-shared",
|
||||
];
|
||||
|
||||
const workspaceAliases = {
|
||||
"@geo/shared-types": resolve(rootDir, "../../packages/shared-types/src/index.ts"),
|
||||
"@geo/http-client": resolve(rootDir, "../../packages/http-client/src/index.ts"),
|
||||
"@geo/publisher-platforms": resolve(rootDir, "../../packages/publisher-platforms/src/index.ts"),
|
||||
"@geo/ui-shared": resolve(rootDir, "../../packages/ui-shared/src/index.ts"),
|
||||
"@geo/ui-shared/tokens": resolve(rootDir, "../../packages/ui-shared/src/tokens/index.ts"),
|
||||
"@geo/ui-shared/tokens.css": resolve(rootDir, "../../packages/ui-shared/src/tokens/index.css"),
|
||||
};
|
||||
|
||||
export default defineConfig({
|
||||
main: {
|
||||
plugins: [externalizeDepsPlugin()],
|
||||
plugins: [externalizeDepsPlugin({ exclude: workspacePackages })],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
@@ -26,11 +42,12 @@ export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
"@main": resolve(rootDir, "src/main"),
|
||||
...workspaceAliases,
|
||||
},
|
||||
},
|
||||
},
|
||||
preload: {
|
||||
plugins: [externalizeDepsPlugin()],
|
||||
plugins: [externalizeDepsPlugin({ exclude: workspacePackages })],
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
@@ -46,6 +63,7 @@ export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
"@preload": resolve(rootDir, "src/preload"),
|
||||
...workspaceAliases,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -64,11 +82,7 @@ export default defineConfig({
|
||||
resolve: {
|
||||
alias: {
|
||||
"@renderer": resolve(rootDir, "src/renderer"),
|
||||
"@geo/shared-types": resolve(rootDir, "../../packages/shared-types/src/index.ts"),
|
||||
"@geo/http-client": resolve(rootDir, "../../packages/http-client/src/index.ts"),
|
||||
"@geo/ui-shared": resolve(rootDir, "../../packages/ui-shared/src/index.ts"),
|
||||
"@geo/ui-shared/tokens": resolve(rootDir, "../../packages/ui-shared/src/tokens/index.ts"),
|
||||
"@geo/ui-shared/tokens.css": resolve(rootDir, "../../packages/ui-shared/src/tokens/index.css"),
|
||||
...workspaceAliases,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -2,36 +2,39 @@
|
||||
"name": "@geo/desktop-client",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "GEO Rankly Desktop — account health, monitor scheduler, and publish dispatch client.",
|
||||
"author": {
|
||||
"name": "GEO Rankly",
|
||||
"email": "support@geo-rankly.local"
|
||||
},
|
||||
"type": "module",
|
||||
"main": "out/main/bootstrap.cjs",
|
||||
"scripts": {
|
||||
"dev": "unset ELECTRON_RUN_AS_NODE && electron-vite dev --inspect=9229",
|
||||
"build": "electron-vite build",
|
||||
"package:mac": "electron-builder --mac --arm64 ",
|
||||
"package:mac": "electron-builder --mac --arm64",
|
||||
"test": "vitest run",
|
||||
"typecheck": "vue-tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons-vue": "^7.0.1",
|
||||
"@geo/http-client": "workspace:*",
|
||||
"@geo/publisher-platforms": "workspace:*",
|
||||
"@geo/shared-types": "workspace:*",
|
||||
"@geo/ui-shared": "workspace:*",
|
||||
"ant-design-vue": "^4.2.6",
|
||||
"better-sqlite3": "^12.8.0",
|
||||
"electron-updater": "^6.0.0",
|
||||
"marked": "^17.0.5",
|
||||
"pino": "^9.0.0",
|
||||
"playwright-core": "^1.55.0",
|
||||
"vue": "^3.5.31",
|
||||
"vue-router": "^4.5.1",
|
||||
"ws": "^8.20.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ant-design/icons-vue": "^7.0.1",
|
||||
"@geo/http-client": "workspace:*",
|
||||
"@geo/publisher-platforms": "workspace:*",
|
||||
"@geo/shared-types": "workspace:*",
|
||||
"@geo/ui-shared": "workspace:*",
|
||||
"@playwright/test": "^1.0.0",
|
||||
"@types/node": "^24.0.0",
|
||||
"@types/ws": "^8.18.1",
|
||||
"@vitejs/plugin-vue": "^5.2.4",
|
||||
"ant-design-vue": "^4.2.6",
|
||||
"electron": "41.2.0",
|
||||
"electron-builder": "^25.0.0",
|
||||
"electron-vite": "^2.0.0",
|
||||
@@ -39,6 +42,84 @@
|
||||
"unplugin-vue-components": "^32.0.0",
|
||||
"vite": "^5.4.19",
|
||||
"vitest": "^2.0.0",
|
||||
"vue": "^3.5.31",
|
||||
"vue-router": "^4.5.1",
|
||||
"vue-tsc": "^3.2.6"
|
||||
},
|
||||
"build": {
|
||||
"appId": "com.geo.rankly.desktop",
|
||||
"productName": "GEO Rankly Desktop",
|
||||
"copyright": "Copyright © 2026 GEO Rankly",
|
||||
"directories": {
|
||||
"output": "release",
|
||||
"buildResources": "build"
|
||||
},
|
||||
"compression": "maximum",
|
||||
"removePackageScripts": true,
|
||||
"removePackageKeywords": true,
|
||||
"asar": true,
|
||||
"asarUnpack": [
|
||||
"**/node_modules/better-sqlite3/build/Release/**",
|
||||
"**/node_modules/better-sqlite3/lib/**",
|
||||
"**/node_modules/bindings/**",
|
||||
"**/node_modules/file-uri-to-path/**",
|
||||
"**/node_modules/playwright-core/lib/**",
|
||||
"**/node_modules/playwright-core/bin/**"
|
||||
],
|
||||
"files": [
|
||||
"out/**/*",
|
||||
"package.json",
|
||||
"!**/*.map",
|
||||
"!**/*.ts",
|
||||
"!**/*.tsx",
|
||||
"!**/*.md",
|
||||
"!**/*.markdown",
|
||||
"!**/{test,tests,__tests__,__mocks__,example,examples,docs,doc,demo,samples,man}/**",
|
||||
"!**/{LICENSE,LICENSE.*,license,CHANGELOG,CHANGELOG.*,README,README.*,HISTORY,HISTORY.*,AUTHORS,CONTRIBUTING}*",
|
||||
"!**/.*",
|
||||
"!**/node_modules/.bin/**",
|
||||
"!**/node_modules/*/{Makefile,Gulpfile.js,Gruntfile.js,CMakeLists.txt,*.coffee,*.flow,*.c,*.cc,*.cpp,*.h,*.hpp,*.gyp,*.gypi,*.tgz,binding.gyp}",
|
||||
"!**/node_modules/**/{*.d.ts,tsconfig*.json,jest.config*,rollup.config*,webpack.config*,vite.config*}",
|
||||
"!**/node_modules/better-sqlite3/{deps,src,docs,benchmark}/**",
|
||||
"!**/node_modules/better-sqlite3/{test_extension.c,download.sh,*.gyp,*.gypi}",
|
||||
"!**/node_modules/playwright-core/{types,ThirdPartyNotices.txt}/**",
|
||||
"!**/node_modules/**/*.{c,cc,cpp,h,hpp,cmake,m4,am,sh}"
|
||||
],
|
||||
"mac": {
|
||||
"category": "public.app-category.productivity",
|
||||
"identity": null,
|
||||
"electronLanguages": ["en", "zh_CN"],
|
||||
"target": [
|
||||
{ "target": "dmg", "arch": ["arm64"] },
|
||||
{ "target": "zip", "arch": ["arm64"] }
|
||||
],
|
||||
"notarize": false,
|
||||
"hardenedRuntime": false,
|
||||
"gatekeeperAssess": false
|
||||
},
|
||||
"dmg": {
|
||||
"format": "ULFO",
|
||||
"contents": [
|
||||
{ "x": 130, "y": 220 },
|
||||
{ "x": 410, "y": 220, "type": "link", "path": "/Applications" }
|
||||
]
|
||||
},
|
||||
"win": {
|
||||
"target": [
|
||||
{ "target": "nsis", "arch": ["x64"] }
|
||||
]
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"perMachine": false,
|
||||
"allowToChangeInstallationDirectory": true
|
||||
},
|
||||
"linux": {
|
||||
"target": [
|
||||
{ "target": "AppImage", "arch": ["x64"] }
|
||||
],
|
||||
"category": "Office"
|
||||
},
|
||||
"publish": null
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user