Commit Graph

26 Commits

Author SHA1 Message Date
pengx17
bfcf4a105e
build(electron): add nsis build to release-desktop workflow (#6677)
Updater may break after this PR and will be fixed in the next one

After this PR, we will have two windows installer options
- affine-0.14.0-canary.9-canary-windows-x64.exe
- affine-0.14.0-canary.9-canary-windows-x64.nsis.exe (added)
2024-04-25 03:52:27 +00:00
pengx17
0b380f94c7
build(electron): add nsis script for windows installer (#6674)
This pr only includes how to bundle the app into an installer after package step.

todo (not in this pr)
- [ ] make sure updater can work for both nsis & squirrel
- [ ] integrate nsis build into github action workflow

Advantage over Squirrel:
- allowing user to specify the installation location
- better uninstaller

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/b75f1076-62e7-445c-bbf9-d7be00dbfc59.png)

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/c9ddc58c-512e-487e-80c8-7c4bd51482a8.png)

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/cfc5c281-e044-4929-a261-b02a4619117b.png)
2024-04-25 03:30:04 +00:00
pengx17
ebb38a42a0
fix: temporary fix for running electron tests (#6576)
a workaround for spawn EINVAL error.
Found this issue according to https://github.com/node-red/node-red/pull/4652

~~In our case the electron app is spawned by playwright. I am still investigating the issue but don't know how long it takes.~~

Upstream fix: https://github.com/microsoft/playwright/pull/30382
2024-04-16 06:57:17 +00:00
EYHN
9c6eba8971
fix(electron): fix build script (#6422) 2024-04-01 07:51:35 +00:00
pengx17
b15ae21c45
fix(electron): optimize bundle size by removing unused dependencies (#6415)
Should greatly reduce the size of helper.js and could speed up the time on starting the client app.

fix https://github.com/toeverything/AFFiNE/issues/6312

Before:

![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/681d6766-7d48-4574-b791-49e2c0ae6e1b.png)

After:
![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/ab13e624-7e03-407d-9538-3b9452694402.png)
2024-03-30 09:06:10 +00:00
Brooooooklyn
c2847e2082
chore(core): split sentry and setup into web/electron (#6357) 2024-03-28 10:24:25 +00:00
pengx17
00092c9955
fix(electron): fix electron build (#6305) 2024-03-25 15:57:22 +00:00
EYHN
b93871f045
feat(electron): define runtimeConfig in esbuild (#6287) 2024-03-25 03:55:26 +00:00
Brooooooklyn
85ee22329c
fix(electron): add icon for AppImage build (#6257)
1. the icon is fixed in `/Applications`: 128b8c22f9 (diff-a694a3e854f53b066e34ec310e05bd18b4944c016455f6963f54a351784d5fa6L91)
2. the App's icon MUST be 64x64 png and set via `setIcon`

![image](https://github.com/toeverything/AFFiNE/assets/584378/bbce0007-066b-413f-a85a-193acbbe5c13)
2024-03-21 14:29:02 +00:00
LongYinan
332cd3b380
refactor(core): split web entry from core (#6082)
This pr is trying to split `web` and `electron` entries from `core`. It allows more platform-related optimization to be addressed in each entry.
We should remove all browser/electron only codes from `core` eventually, this is the very first step for that.
2024-03-19 07:48:56 +00:00
Peng Xiao
65b32156a8
build: do not fail build for a non-fatal error (#6017) 2024-03-05 08:27:47 +00:00
Peng Xiao
3fcbfe4d30
fix(electron): electron updater issues (#6005)
- generate-yml.js does not filter files correctly
- add version to generated bundles
- change `.AppImage` to `.appimage`. See https://github.com/electron-userland/electron-builder/blob/master/packages/electron-updater/src/providers/Provider.ts#L88
2024-03-05 03:27:52 +00:00
Peng Xiao
3881164854
build(electron): generate latest-linux.yml (#5822) 2024-02-19 14:25:02 +00:00
LongYinan
fa8655e43e
style: apply prefer-node-protocol lint rule (#5627)
it makes it perfectly clear that the package is a Node.js builtin module.
2024-01-19 03:47:08 +00:00
EYHN
265ee81666
refactor(infra): remove old plugin system (#5411)
plugin system need redesign
2023-12-27 02:49:59 +00:00
Joooye_34
9fbd9b39d6
ci: set version correctly and remove nightly build workflow (#5367) 2023-12-21 10:00:12 +00:00
Peng Xiao
e8cfc807ea
fix(electron): use tree-kill for electron dev (#5252)
electron process sometimes do not get re-spawned because of some child process not being closed.
use tree-kill instead.
2023-12-11 04:26:19 +00:00
LongYinan
0ee2ecc1e9
ci: always perform fresh build in deployment job (#5066) 2023-11-28 06:59:50 +00:00
Peng Xiao
8841dc3c4e
fix(electron): electron dev startup on win (#5031) 2023-11-27 08:45:33 +00:00
LongYinan
3499dbbb7f
feat: upgrade dependencies and lockfile (#5016)
- Close https://github.com/toeverything/AFFiNE/security/dependabot/47
2023-11-23 05:18:05 +00:00
Peng Xiao
3839a9bd15
build(electron): asar (#4965)
Due to restrictions on how Electron package works, the `node_modules` should not be hoisted and not to use s/h-links at all. This is why we need to have two separate installs for electron and non-electron packages in the build.

Tested via the following script

```bash
#!/bin/bash

echo "step 1: clean up"
find . -name "node_modules" -prune -exec rm -rf '{}' +
# git clean -dfX
build_type=canary

echo "step 2: install web dependencies"
# firstly, build web static
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 SENTRYCLI_SKIP_DOWNLOAD=1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 HUSKY=1 yarn

echo "step 3: generate assets"
BUILD_TYPE="$build_type" yarn workspace @affine/electron generate-assets

# cleanup node_modules
find . -name "node_modules" -prune -exec rm -rf '{}' +

echo "step 4: install electron dependencies"
# install electron deps
yarn config set nmHoistingLimits workspaces
yarn config set enableScripts false
yarn config set nmMode classic
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 HUSKY=0 yarn workspaces focus @affine/electron @affine/monorepo

echo "step 5: build native"
# build native
yarn workspace @affine/native build
yarn workspace @affine/storage build

echo "step 6: build electron"
# build electron
yarn workspace @affine/electron build

echo "step 7: package electron"
# package
SKIP_GENERATE_ASSETS=1 BUILD_TYPE="$build_type" HOIST_NODE_MODULES=1 yarn workspace @affine/electron package
```
2023-11-21 17:44:30 +00:00
Peng Xiao
a8d89254ce
fix(electron): dev reload (#4911) 2023-11-12 03:19:27 +00:00
Alex Yang
d9e2d17a26 refactor: cleanup code 2023-10-20 19:28:04 -05:00
Alex Yang
97d8660a54
refactor(electron): fix vitest and add behavior test (#4655) 2023-10-18 22:14:30 -05:00
Alex Yang
b14a6bc29e build: fix generate-assets.ts 2023-10-18 16:33:09 -05:00
Joooye_34
bed9310519
refactor(infra): directory structure (#4615) 2023-10-18 15:30:08 +00:00