From a76ee1e5f452e1f2ca42043a89fa127c6a3bee5e Mon Sep 17 00:00:00 2001 From: gaoshuaixing Date: Mon, 13 Jan 2025 10:56:42 +0800 Subject: [PATCH] chore: update config --- cmd/bin.js | 42 ++++++++++++++++++++-------- electron/service/os/window.ts | 3 +- frontend/package.json | 2 +- frontend/src/utils/iconList.ts | 50 +++++++++++++++++----------------- package.json | 10 ++++--- 5 files changed, 64 insertions(+), 43 deletions(-) diff --git a/cmd/bin.js b/cmd/bin.js index 8990245..0c6cb54 100644 --- a/cmd/bin.js +++ b/cmd/bin.js @@ -128,18 +128,36 @@ module.exports = { * 加密 */ encrypt: { - type: 'confusion', // none | confusion | bytecode | strict - files: [ - './public/electron/**/*.(js|json)', - ], - fileExt: ['.js'], - cleanFiles: ['./public/electron'], - specificFiles: ['./public/electron/preload/bridge.js'], - confusionOptions: { - compact: true, - stringArray: true, - stringArrayEncoding: ['none'], - deadCodeInjection: false, + frontend: { + type: 'confusion', + files: [ + './public/dist/**/*.(js|json)', + ], + cleanFiles: ['./public/dist'], + confusionOptions: { + compact: true, + stringArray: true, + stringArrayEncoding: ['none'], + stringArrayCallsTransform: true, + numbersToExpressions: true, + target: 'browser', + } + }, + electron: { + type: 'confusion', + files: [ + './public/electron/**/*.(js|json)', + ], + cleanFiles: ['./public/electron'], + confusionOptions: { + compact: true, + stringArray: true, + stringArrayEncoding: ['rc4'], + deadCodeInjection: false, + stringArrayCallsTransform: true, + numbersToExpressions: true, + target: 'node', + } } }, diff --git a/electron/service/os/window.ts b/electron/service/os/window.ts index 19c1cb0..cc9231e 100644 --- a/electron/service/os/window.ts +++ b/electron/service/os/window.ts @@ -4,6 +4,7 @@ import { getMainWindow } from 'ee-core/electron'; import { isProd, getBaseDir } from 'ee-core/ps'; import { getConfig } from 'ee-core/config'; import { isFileProtocol } from 'ee-core/utils'; +import { logger } from 'ee-core/log'; /** * Window @@ -40,7 +41,7 @@ class WindowService { contentUrl = addr + content; } - console.log('contentUrl: ', contentUrl); + logger.info('[createWindow] url: ', contentUrl); const opt = { title: windowTitle, x: 10, diff --git a/frontend/package.json b/frontend/package.json index 0953c97..843d15c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "ee", - "version": "1.0.0", + "version": "4.0.0", "scripts": { "dev": "vite --host --port 8080", "serve": "vite --host --port 8080", diff --git a/frontend/src/utils/iconList.ts b/frontend/src/utils/iconList.ts index 9b1335e..e8597aa 100644 --- a/frontend/src/utils/iconList.ts +++ b/frontend/src/utils/iconList.ts @@ -1,27 +1,27 @@ export default [ - { name: '对话框', type: 'icon-duihuakuang' }, - { name: '闹钟', type: 'icon-naozhong' }, - { name: '笑脸', type: 'icon-xiaolian' }, - { name: 'ok', type: 'icon-ok' }, - { name: '风车', type: 'icon-fengche' }, - { name: '汗颜', type: 'icon-hanyan' }, - { name: '相机', type: 'icon-xiangji' }, - { name: '礼物', type: 'icon-liwu' }, - { name: '礼花', type: 'icon-lihua' }, - { name: '扭蛋', type: 'icon-niudan' }, - { name: '流星', type: 'icon-liuxing' }, - { name: '风筝', type: 'icon-fengzheng' }, - { name: '蛋糕', type: 'icon-dangao' }, - { name: '泡泡', type: 'icon-paopao' }, - { name: '购物', type: 'icon-gouwu' }, - { name: '饮料', type: 'icon-yinliao' }, - { name: '云彩', type: 'icon-yuncai' }, - { name: '彩铅', type: 'icon-caiqian' }, - { name: '纸飞机', type: 'icon-zhifeiji' }, - { name: '点赞', type: 'icon-dianzan' }, - { name: '煎蛋', type: 'icon-jiandan' }, - { name: '小熊', type: 'icon-xiaoxiong' }, - { name: '花', type: 'icon-hua' }, - { name: '眼睛', type: 'icon-yanjing' }, - ] + { name: '对话框', type: 'icon-duihuakuang' }, + { name: '闹钟', type: 'icon-naozhong' }, + { name: '笑脸', type: 'icon-xiaolian' }, + { name: 'ok', type: 'icon-ok' }, + { name: '风车', type: 'icon-fengche' }, + { name: '汗颜', type: 'icon-hanyan' }, + { name: '相机', type: 'icon-xiangji' }, + { name: '礼物', type: 'icon-liwu' }, + { name: '礼花', type: 'icon-lihua' }, + { name: '扭蛋', type: 'icon-niudan' }, + { name: '流星', type: 'icon-liuxing' }, + { name: '风筝', type: 'icon-fengzheng' }, + { name: '蛋糕', type: 'icon-dangao' }, + { name: '泡泡', type: 'icon-paopao' }, + { name: '购物', type: 'icon-gouwu' }, + { name: '饮料', type: 'icon-yinliao' }, + { name: '云彩', type: 'icon-yuncai' }, + { name: '彩铅', type: 'icon-caiqian' }, + { name: '纸飞机', type: 'icon-zhifeiji' }, + { name: '点赞', type: 'icon-dianzan' }, + { name: '煎蛋', type: 'icon-jiandan' }, + { name: '小熊', type: 'icon-xiaoxiong' }, + { name: '花', type: 'icon-hua' }, + { name: '眼睛', type: 'icon-yanjing' }, +] \ No newline at end of file diff --git a/package.json b/package.json index 6e64e0b..2fe1353 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "./public/electron/main.js", "scripts": { "dev": "ee-bin dev", - "build": "npm run build-frontend && ee-bin encrypt", + "build": "npm run build-frontend && npm run build-electron && ee-bin encrypt", "start": "ee-bin start", "dev-frontend": "ee-bin dev --serve=frontend", "dev-electron": "ee-bin dev --serve=electron", @@ -13,18 +13,20 @@ "dev-go-w": "ee-bin exec --cmds=go_w", "dev-python": "ee-bin exec --cmds=python", "build-frontend": "ee-bin build --cmds=frontend && ee-bin move --flag=frontend_dist", + "build-electron": "ee-bin build --cmds=electron", "build-go-w": "ee-bin move --flag=go_static,go_config,go_package && ee-bin build --cmds=go_w", "build-go-m": "ee-bin move --flag=go_static,go_config,go_package,go_images && ee-bin build --cmds=go_m", "build-go-l": "ee-bin move --flag=go_static,go_config,go_package,go_images && ee-bin build --cmds=go_l", "build-python": "ee-bin build --cmds=python && ee-bin move --flag=python_dist", + "encrypt": "ee-bin encrypt", + "clean": "ee-bin clean", + "icon": "ee-bin icon", + "re-sqlite": "electron-rebuild -f -w better-sqlite3", "build-w": "ee-bin build --cmds=win64", "build-we": "ee-bin build --cmds=win_e", "build-m": "ee-bin build --cmds=mac", "build-m-arm64": "ee-bin build --cmds=mac_arm64", "build-l": "ee-bin build --cmds=linux", - "clean": "ee-bin clean", - "icon": "ee-bin icon", - "re-sqlite": "electron-rebuild -f -w better-sqlite3", "debug-dev": "cross-env DEBUG=ee-* ee-bin dev", "debug-encrypt": "ee-bin encrypt", "debug-electron": "cross-env DEBUG=ee-* ee-bin dev --serve=electron",