diff --git a/.eslintcache b/.eslintcache index 6e1c708..c2aa950 100644 --- a/.eslintcache +++ b/.eslintcache @@ -1 +1 @@ -[{"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\electron.vite.config.ts":"1","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\eslint.config.mjs":"2","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\index.ts":"3","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\launch.ts":"4","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\list.ts":"5","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\paths.ts":"6","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\types.ts":"7","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\app.ts":"8","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\index.ts":"9","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\ipc.ts":"10","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\server.ts":"11","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\main\\index.ts":"12","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\preload\\index.d.ts":"13","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\preload\\index.ts":"14","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\renderer\\src\\env.d.ts":"15","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\renderer\\src\\main.ts":"16"},{"size":307,"mtime":1770948182594,"results":"17","hashOfConfig":"18"},{"size":335,"mtime":1770948616909,"results":"19","hashOfConfig":"20"},{"size":181,"mtime":1770951445071,"results":"21","hashOfConfig":"18"},{"size":1025,"mtime":1770952229497,"results":"22","hashOfConfig":"18"},{"size":5944,"mtime":1770955024555,"results":"23","hashOfConfig":"18"},{"size":778,"mtime":1770952651493,"results":"24","hashOfConfig":"18"},{"size":478,"mtime":1770952183776,"results":"25","hashOfConfig":"18"},{"size":8282,"mtime":1770988601352,"results":"26","hashOfConfig":"18"},{"size":131,"mtime":1770949683440,"results":"27","hashOfConfig":"18"},{"size":1562,"mtime":1770951750982,"results":"28","hashOfConfig":"18"},{"size":878,"mtime":1770953257990,"results":"29","hashOfConfig":"18"},{"size":2977,"mtime":1770983959147,"results":"30","hashOfConfig":"18"},{"size":518,"mtime":1770949733473,"results":"31","hashOfConfig":"18"},{"size":1422,"mtime":1770949725340,"results":"32","hashOfConfig":"18"},{"size":198,"mtime":1770948241682,"results":"33","hashOfConfig":"18"},{"size":119,"mtime":1770948217655,"results":"34","hashOfConfig":"18"},{"filePath":"35","messages":"36","suppressedMessages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ujohuf",{"filePath":"38","messages":"39","suppressedMessages":"40","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"siocln",{"filePath":"41","messages":"42","suppressedMessages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","suppressedMessages":"46","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"47","messages":"48","suppressedMessages":"49","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"50","messages":"51","suppressedMessages":"52","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"53","messages":"54","suppressedMessages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"56","messages":"57","suppressedMessages":"58","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"59","messages":"60","suppressedMessages":"61","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"62","messages":"63","suppressedMessages":"64","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"65","messages":"66","suppressedMessages":"67","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"68","messages":"69","suppressedMessages":"70","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"71","messages":"72","suppressedMessages":"73","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"74","messages":"75","suppressedMessages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\electron.vite.config.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\eslint.config.mjs",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\index.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\launch.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\list.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\paths.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\types.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\app.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\index.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\ipc.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\server.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\main\\index.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\preload\\index.d.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\preload\\index.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\renderer\\src\\env.d.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\renderer\\src\\main.ts",[],[]] \ No newline at end of file +[{"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\electron.vite.config.ts":"1","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\eslint.config.mjs":"2","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\index.ts":"3","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\launch.ts":"4","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\list.ts":"5","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\paths.ts":"6","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\types.ts":"7","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\app.ts":"8","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\index.ts":"9","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\ipc.ts":"10","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\server.ts":"11","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\main\\index.ts":"12","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\preload\\index.d.ts":"13","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\preload\\index.ts":"14","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\renderer\\src\\env.d.ts":"15","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\renderer\\src\\main.ts":"16","C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\SQLitte\\index.ts":"17"},{"size":397,"mtime":1771392641198,"results":"18","hashOfConfig":"19"},{"size":335,"mtime":1770948616909,"results":"20","hashOfConfig":"21"},{"size":181,"mtime":1770951445071,"results":"22","hashOfConfig":"19"},{"size":1025,"mtime":1770952229497,"results":"23","hashOfConfig":"19"},{"size":5944,"mtime":1770955024555,"results":"24","hashOfConfig":"19"},{"size":778,"mtime":1770952651493,"results":"25","hashOfConfig":"19"},{"size":478,"mtime":1770952183776,"results":"26","hashOfConfig":"19"},{"size":8460,"mtime":1771393545129,"results":"27","hashOfConfig":"19"},{"size":131,"mtime":1770949683440,"results":"28","hashOfConfig":"19"},{"size":1562,"mtime":1770951750982,"results":"29","hashOfConfig":"19"},{"size":878,"mtime":1770953257990,"results":"30","hashOfConfig":"19"},{"size":2977,"mtime":1770983959147,"results":"31","hashOfConfig":"19"},{"size":518,"mtime":1770949733473,"results":"32","hashOfConfig":"19"},{"size":1422,"mtime":1770949725340,"results":"33","hashOfConfig":"19"},{"size":198,"mtime":1770948241682,"results":"34","hashOfConfig":"19"},{"size":119,"mtime":1770948217655,"results":"35","hashOfConfig":"19"},{"size":890,"mtime":1771393598051,"results":"36","hashOfConfig":"19"},{"filePath":"37","messages":"38","suppressedMessages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ujohuf",{"filePath":"40","messages":"41","suppressedMessages":"42","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"siocln",{"filePath":"43","messages":"44","suppressedMessages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"46","messages":"47","suppressedMessages":"48","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"49","messages":"50","suppressedMessages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"52","messages":"53","suppressedMessages":"54","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"55","messages":"56","suppressedMessages":"57","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"58","messages":"59","suppressedMessages":"60","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"61","messages":"62","suppressedMessages":"63","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"64","messages":"65","suppressedMessages":"66","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"67","messages":"68","suppressedMessages":"69","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"70","messages":"71","suppressedMessages":"72","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"73","messages":"74","suppressedMessages":"75","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"76","messages":"77","suppressedMessages":"78","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"79","messages":"80","suppressedMessages":"81","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"82","messages":"83","suppressedMessages":"84","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"85","messages":"86","suppressedMessages":"87","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\electron.vite.config.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\eslint.config.mjs",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\index.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\launch.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\list.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\paths.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\app_list\\types.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\app.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\index.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\ipc.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\eiysia\\server.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\main\\index.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\preload\\index.d.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\preload\\index.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\renderer\\src\\env.d.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\renderer\\src\\main.ts",[],[],"C:\\Users\\HiteVision station\\Documents\\LanStart\\LanMontainDesktop\\src\\SQLitte\\index.ts",[],[]] \ No newline at end of file diff --git a/electron-builder.yml b/electron-builder.yml index fe6e8f9..7526a3f 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -11,6 +11,7 @@ files: - '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}' asarUnpack: - resources/** + - '**/*.node' win: executableName: desktop nsis: diff --git a/electron.vite.config.ts b/electron.vite.config.ts index 6b30e11..f7bab97 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -3,7 +3,13 @@ import { defineConfig } from 'electron-vite' import vue from '@vitejs/plugin-vue' export default defineConfig({ - main: {}, + main: { + build: { + rollupOptions: { + external: ['better-sqlite3'] + } + } + }, preload: {}, renderer: { resolve: { diff --git a/package.json b/package.json index 317b013..ccf6fa6 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@electron-toolkit/preload": "^3.0.2", "@electron-toolkit/utils": "^4.0.0", "@elysiajs/node": "^1.4.4", + "better-sqlite3": "^12.6.2", "electron-updater": "^6.3.9", "elysia": "^1.4.25" }, @@ -46,6 +47,7 @@ "pnpm": { "onlyBuiltDependencies": [ "electron", + "better-sqlite3", "esbuild" ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c245e3a..0e7225c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@elysiajs/node': specifier: ^1.4.4 version: 1.4.4(elysia@1.4.25(@sinclair/typebox@0.34.48)(exact-mirror@0.2.7(@sinclair/typebox@0.34.48))(file-type@21.3.0)(openapi-types@12.1.3)(typescript@5.9.3)) + better-sqlite3: + specifier: ^12.6.2 + version: 12.6.2 electron-updater: specifier: ^6.3.9 version: 6.7.3 @@ -1060,6 +1063,13 @@ packages: resolution: {integrity: sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==} hasBin: true + better-sqlite3@12.6.2: + resolution: {integrity: sha512-8VYKM3MjCa9WcaSAI3hzwhmyHVlH8tiGFwf0RlTsZPWJ1I5MkzjiudCo4KC4DxOaL/53A5B1sI/IbldNFDbsKA==} + engines: {node: 20.x || 22.x || 23.x || 24.x || 25.x} + + bindings@1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -1125,6 +1135,9 @@ packages: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} + chownr@1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + chownr@3.0.0: resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} engines: {node: '>=18'} @@ -1236,6 +1249,10 @@ packages: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} + deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -1482,6 +1499,10 @@ packages: '@sinclair/typebox': optional: true + expand-template@2.0.3: + resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} + engines: {node: '>=6'} + exponential-backoff@3.1.3: resolution: {integrity: sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==} @@ -1529,6 +1550,9 @@ packages: resolution: {integrity: sha512-8kPJMIGz1Yt/aPEwOsrR97ZyZaD1Iqm8PClb1nYFclUCkBi0Ma5IsYNQzvSFS9ib51lWyIw5mIT9rWzI/xjpzA==} engines: {node: '>=20'} + file-uri-to-path@1.0.0: + resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + filelist@1.0.4: resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} @@ -1551,6 +1575,9 @@ packages: resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==} engines: {node: '>= 6'} + fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + fs-extra@10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} engines: {node: '>=12'} @@ -1606,6 +1633,9 @@ packages: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} engines: {node: '>=8'} + github-from-package@0.0.0: + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} + glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} @@ -1722,6 +1752,9 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + ip-address@10.1.0: resolution: {integrity: sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==} engines: {node: '>= 12'} @@ -1946,6 +1979,9 @@ packages: resolution: {integrity: sha512-KZxYo1BUkWD2TVFLr0MQoM8vUUigWD3LlD83a/75BqC+4qE0Hb1Vo5v1FgcfaNXvfXzr+5EhQ6ing/CaBijTlw==} engines: {node: '>= 18'} + mkdirp-classic@0.5.3: + resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true @@ -1961,6 +1997,9 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + napi-build-utils@2.0.0: + resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -1968,6 +2007,10 @@ packages: resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} engines: {node: '>= 0.6'} + node-abi@3.87.0: + resolution: {integrity: sha512-+CGM1L1CgmtheLcBuleyYOn7NWPVu0s0EJH2C4puxgEZb9h8QpR9G2dBfZJOAUhi7VQxuBPMd0hiISWcTyiYyQ==} + engines: {node: '>=10'} + node-abi@4.26.0: resolution: {integrity: sha512-8QwIZqikRvDIkXS2S93LjzhsSPJuIbfaMETWH+Bx8oOT9Sa9UsUtBFQlc3gBNd1+QINjaTloitXr1W3dQLi9Iw==} engines: {node: '>=22.12.0'} @@ -2086,6 +2129,11 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + prebuild-install@7.1.3: + resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==} + engines: {node: '>=10'} + hasBin: true + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -2125,6 +2173,10 @@ packages: resolution: {integrity: sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==} engines: {node: '>=10'} + rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + read-binary-file-arch@1.0.6: resolution: {integrity: sha512-BNg9EN3DD3GsDXX7Aa8O4p92sryjkmzYYgmgTAc6CA4uGLEDzFfxOxugu21akOxpcXHiEgsYkC6nPsQvLLLmEg==} hasBin: true @@ -2221,6 +2273,12 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + simple-concat@1.0.1: + resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + + simple-get@4.0.1: + resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} + simple-update-notifier@2.0.0: resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} engines: {node: '>=10'} @@ -2287,6 +2345,10 @@ packages: resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} engines: {node: '>=12'} + strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -2307,6 +2369,13 @@ packages: resolution: {integrity: sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ==} engines: {node: ^14.18.0 || >=16.0.0} + tar-fs@2.1.4: + resolution: {integrity: sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==} + + tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + tar@7.5.7: resolution: {integrity: sha512-fov56fJiRuThVFXD6o6/Q354S7pnWMJIVlDBYijsTNx6jKSE4pvrDTs6lUnmGvNyfJwFQQwWy3owKz1ucIhveQ==} engines: {node: '>=18'} @@ -2348,6 +2417,9 @@ packages: peerDependencies: typescript: '>=4.8.4' + tunnel-agent@0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -3493,6 +3565,15 @@ snapshots: baseline-browser-mapping@2.9.19: {} + better-sqlite3@12.6.2: + dependencies: + bindings: 1.5.0 + prebuild-install: 7.1.3 + + bindings@1.5.0: + dependencies: + file-uri-to-path: 1.0.0 + bl@4.1.0: dependencies: buffer: 5.7.1 @@ -3599,6 +3680,8 @@ snapshots: ansi-styles: 4.3.0 supports-color: 7.2.0 + chownr@1.1.4: {} + chownr@3.0.0: {} chromium-pickle-js@0.2.0: {} @@ -3687,6 +3770,8 @@ snapshots: dependencies: mimic-response: 3.1.0 + deep-extend@0.6.0: {} + deep-is@0.1.4: {} defaults@1.0.4: @@ -4047,6 +4132,8 @@ snapshots: optionalDependencies: '@sinclair/typebox': 0.34.48 + expand-template@2.0.3: {} + exponential-backoff@3.1.3: {} extract-zip@2.0.1: @@ -4093,6 +4180,8 @@ snapshots: transitivePeerDependencies: - supports-color + file-uri-to-path@1.0.0: {} + filelist@1.0.4: dependencies: minimatch: 5.1.6 @@ -4122,6 +4211,8 @@ snapshots: hasown: 2.0.2 mime-types: 2.1.35 + fs-constants@1.0.0: {} + fs-extra@10.1.0: dependencies: graceful-fs: 4.2.11 @@ -4190,6 +4281,8 @@ snapshots: dependencies: pump: 3.0.3 + github-from-package@0.0.0: {} + glob-parent@6.0.2: dependencies: is-glob: 4.0.3 @@ -4324,6 +4417,8 @@ snapshots: inherits@2.0.4: {} + ini@1.3.8: {} + ip-address@10.1.0: {} is-extglob@2.1.1: {} @@ -4524,6 +4619,8 @@ snapshots: dependencies: minipass: 7.1.2 + mkdirp-classic@0.5.3: {} + mkdirp@0.5.6: dependencies: minimist: 1.2.8 @@ -4534,10 +4631,16 @@ snapshots: nanoid@3.3.11: {} + napi-build-utils@2.0.0: {} + natural-compare@1.4.0: {} negotiator@1.0.0: {} + node-abi@3.87.0: + dependencies: + semver: 7.7.4 + node-abi@4.26.0: dependencies: semver: 7.7.4 @@ -4662,6 +4765,21 @@ snapshots: commander: 9.5.0 optional: true + prebuild-install@7.1.3: + dependencies: + detect-libc: 2.1.2 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.8 + mkdirp-classic: 0.5.3 + napi-build-utils: 2.0.0 + node-abi: 3.87.0 + pump: 3.0.3 + rc: 1.2.8 + simple-get: 4.0.1 + tar-fs: 2.1.4 + tunnel-agent: 0.6.0 + prelude-ls@1.2.1: {} prettier-linter-helpers@1.0.1: @@ -4694,6 +4812,13 @@ snapshots: quick-lru@5.1.1: {} + rc@1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + read-binary-file-arch@1.0.6: dependencies: debug: 4.4.3 @@ -4806,6 +4931,14 @@ snapshots: signal-exit@4.1.0: {} + simple-concat@1.0.1: {} + + simple-get@4.0.1: + dependencies: + decompress-response: 6.0.0 + once: 1.4.0 + simple-concat: 1.0.1 + simple-update-notifier@2.0.0: dependencies: semver: 7.7.4 @@ -4876,6 +5009,8 @@ snapshots: dependencies: ansi-regex: 6.2.2 + strip-json-comments@2.0.1: {} + strip-json-comments@3.1.1: {} strtok3@10.3.4: @@ -4896,6 +5031,21 @@ snapshots: dependencies: '@pkgr/core': 0.2.9 + tar-fs@2.1.4: + dependencies: + chownr: 1.1.4 + mkdirp-classic: 0.5.3 + pump: 3.0.3 + tar-stream: 2.2.0 + + tar-stream@2.2.0: + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.5 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + tar@7.5.7: dependencies: '@isaacs/fs-minipass': 4.0.1 @@ -4945,6 +5095,10 @@ snapshots: dependencies: typescript: 5.9.3 + tunnel-agent@0.6.0: + dependencies: + safe-buffer: 5.2.1 + type-check@0.4.0: dependencies: prelude-ls: 1.2.1 diff --git a/src/SQLitte/index.ts b/src/SQLitte/index.ts new file mode 100644 index 0000000..aaa6213 --- /dev/null +++ b/src/SQLitte/index.ts @@ -0,0 +1,42 @@ +import { app as electronApp } from 'electron' +import { join } from 'path' +import Database from 'better-sqlite3' + +export type SqliteDb = { + pragma: (sql: string) => unknown + exec: (sql: string) => unknown + close: () => void +} + +export type SqliteHandle = { + db: SqliteDb + filePath: string + close: () => void +} + +export function createSqlite(): SqliteHandle { + const filePath = join(electronApp.getPath('userData'), 'lanmountain.sqlite3') + const db = new Database(filePath) as unknown as SqliteDb + + db.pragma('journal_mode = WAL') + db.pragma('foreign_keys = ON') + db.exec(` + CREATE TABLE IF NOT EXISTS kv ( + key TEXT PRIMARY KEY, + value TEXT NOT NULL, + updatedAt INTEGER NOT NULL + ); + `) + + const close = (): void => { + try { + db.close() + } catch { + return + } + } + + electronApp.once('before-quit', close) + + return { db, filePath, close } +} diff --git a/src/eiysia/app.ts b/src/eiysia/app.ts index d710294..03a54b8 100644 --- a/src/eiysia/app.ts +++ b/src/eiysia/app.ts @@ -5,6 +5,7 @@ import { promises as fs } from 'fs' import { join } from 'path' import { promisify } from 'util' import { launchStartMenuEntry, listWindowsStartMenuApps } from '../app_list' +import { createSqlite } from '../SQLitte' export interface EiysiaDependencies { getMainWindow: () => BrowserWindow | null @@ -23,6 +24,8 @@ export function createEiysiaApp(deps: EiysiaDependencies): { iconDataUrl: string } + const sqliteHandle = createSqlite() + const iconCache = new Map() const appsCacheFilePath = join(electronApp.getPath('userData'), 'apps-cache.json') let cachedApps: CachedApp[] = [] @@ -182,6 +185,10 @@ export function createEiysiaApp(deps: EiysiaDependencies): { } return new Elysia() + .get('/db/sqlite/health', () => ({ + ok: true, + path: sqliteHandle.filePath + })) .get('/health', () => ({ ok: true, time: Date.now() diff --git a/tsconfig.node.json b/tsconfig.node.json index 60b9a0e..199acf0 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -1,6 +1,13 @@ { "extends": "@electron-toolkit/tsconfig/tsconfig.node.json", - "include": ["electron.vite.config.*", "src/main/**/*", "src/preload/**/*", "src/eiysia/**/*", "src/app_list/**/*"], + "include": [ + "electron.vite.config.*", + "src/main/**/*", + "src/preload/**/*", + "src/eiysia/**/*", + "src/app_list/**/*", + "src/SQLitte/**/*" + ], "compilerOptions": { "composite": true, "types": ["electron-vite/node"]