Skip to content

Commit 0da13cb

Browse files
committed
Manually include only the needed Electron package files
1 parent 110f058 commit 0da13cb

File tree

4 files changed

+78
-70
lines changed

4 files changed

+78
-70
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
desktop: patch
3+
---
4+
5+
Optimise package size

apps/desktop/build.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,20 @@ import { NodeContext } from '@effect/platform-node';
33
import { Config, Effect, pipe } from 'effect';
44
import { build, type Configuration } from 'electron-builder';
55

6+
const libFiles = (lib: string) => [`node_modules/${lib}/package.json`, `node_modules/${lib}/dist`];
7+
68
const config: Configuration = {
79
artifactName: '${productName}-${version}-${platform}-${arch}.${ext}',
8-
asarUnpack: [
9-
'resources/**',
10-
'**/node_modules/@the-dev-tools/server/dist/server*',
11-
'**/node_modules/@the-dev-tools/cli/dist/cli*',
12-
],
1310
extraMetadata: {
1411
name: 'DevTools-Studio',
1512
},
16-
files: ['!src/*', '!*.{js,ts}', '!{tsconfig.json,tsconfig.*.json}'],
13+
files: [
14+
'!**/*',
15+
'out',
16+
...libFiles('@the-dev-tools/cli'),
17+
...libFiles('@the-dev-tools/server'),
18+
...libFiles('@the-dev-tools/worker-js'),
19+
],
1720
linux: {
1821
category: 'Development',
1922
target: ['AppImage'],

apps/desktop/package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,44 +11,44 @@
1111
"dev": "electron-vite dev"
1212
},
1313
"dependencies": {
14+
"@the-dev-tools/cli": "workspace:^",
15+
"@the-dev-tools/server": "workspace:^",
16+
"@the-dev-tools/worker-js": "workspace:^"
17+
},
18+
"devDependencies": {
1419
"@bufbuild/protobuf": "catalog:",
15-
"@connectrpc/connect": "catalog:",
1620
"@connectrpc/connect-node": "catalog:",
21+
"@connectrpc/connect": "catalog:",
1722
"@effect-atom/atom-react": "catalog:",
18-
"@effect/platform": "catalog:",
1923
"@effect/platform-browser": "catalog:",
2024
"@effect/platform-node": "catalog:",
21-
"@the-dev-tools/cli": "workspace:^",
22-
"@the-dev-tools/client": "workspace:^",
23-
"@the-dev-tools/server": "workspace:^",
24-
"@the-dev-tools/ui": "workspace:^",
25-
"@the-dev-tools/worker-js": "workspace:^",
26-
"@vitejs/plugin-react": "catalog:",
27-
"builder-util-runtime": "catalog:",
28-
"effect": "catalog:",
29-
"electron-updater": "6.7.3",
30-
"react": "catalog:",
31-
"react-dom": "catalog:",
32-
"react-markdown": "catalog:",
33-
"undici": "catalog:",
34-
"yaml": "catalog:"
35-
},
36-
"devDependencies": {
25+
"@effect/platform": "catalog:",
3726
"@lezer/generator": "catalog:",
3827
"@tailwindcss/typography": "catalog:",
3928
"@tailwindcss/vite": "catalog:",
29+
"@the-dev-tools/client": "workspace:^",
4030
"@the-dev-tools/eslint-config": "workspace:^",
41-
"@types/react": "catalog:",
31+
"@the-dev-tools/ui": "workspace:^",
4232
"@types/react-dom": "catalog:",
33+
"@types/react": "catalog:",
34+
"@vitejs/plugin-react": "catalog:",
4335
"babel-plugin-react-compiler": "catalog:",
44-
"electron": "catalog:",
36+
"builder-util-runtime": "catalog:",
37+
"effect": "catalog:",
4538
"electron-builder": "catalog:",
4639
"electron-devtools-installer": "catalog:",
40+
"electron-updater": "6.7.3",
4741
"electron-vite": "catalog:",
42+
"electron": "catalog:",
4843
"eslint": "catalog:",
44+
"react-dom": "catalog:",
45+
"react-markdown": "catalog:",
46+
"react": "catalog:",
4947
"tailwindcss": "catalog:",
5048
"typescript": "catalog:",
49+
"undici": "catalog:",
50+
"vite-tsconfig-paths": "catalog:",
5151
"vite": "catalog:",
52-
"vite-tsconfig-paths": "catalog:"
52+
"yaml": "catalog:"
5353
}
5454
}

pnpm-lock.yaml

Lines changed: 43 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)