Commit Graph

50 Commits

Author SHA1 Message Date
JimmFly
23518cae16
feat(core): add manual check for updates (#4957)
work for #4523

add `appBuildType` to `runtimeConfig`
add `useAppUpdater` to manage client updates

<!--
copilot:summary
-->
### <samp>🤖[[deprecated]](https://githubnext.com/copilot-for-prs-sunset) Generated by Copilot at cdd012c</samp>

This pull request refactors and enhances the update functionality for the frontend. It introduces a new custom hook `useAppUpdater` that simplifies the update logic and state management, and uses it in various components and commands. It also adds more options and feedback for the user to control and monitor the update process, such as manual download, auto-check, and auto-download toggles, and update status and progress indicators. It also updates the `AboutAffine` component to show the app icon, version, and build type. It also adds new translations, dependencies, types, and schemas related to the update functionality.

<img width="1073" alt="image" src="https://github.com/toeverything/AFFiNE/assets/102217452/16ae7a6a-0035-4e57-902b-6b8f63169501">
2023-11-29 13:31:25 +00:00
LongYinan
7a7cbc45d7
fix: add prefer-readonly rule (#5122) 2023-11-29 15:19:00 +08:00
LongYinan
bd488262fa
fix: add prefer-date-now rule (#5113) 2023-11-29 04:43:55 +00:00
LongYinan
923844f302
fix: add eqeqeq lint rule (#5106) 2023-11-29 04:43:31 +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
Peng Xiao
71d6b730f7
chore: bump blocksuite (#5051)
https://github.com/toeverything/blocksuite/pull/5337
2023-11-27 04:46:23 +00:00
Joooye_34
317ca7f4e7
ci: fix storybook publish problem (#5047) 2023-11-23 23:38:09 +08:00
LongYinan
25eda22af6
v0.10.3-canary.2 2023-11-23 16:47:40 +08:00
Peng Xiao
7463e87742
fix(electron): clone db file when enable cloud for desktop (#5028)
At the moment on desktop the user's local blob data will be lost after enable cloud.
This is because blob data is only synced from old idb to new idb, but not sync into sqlitedb.

This pr will simply clone the db file for desktop app. It should also speed up the time when enabling cloud for a large local workspace.
2023-11-23 07:23:16 +00:00
李华桥
9ded6afb4b
chore: v0.10.3-canary.1 2023-11-23 14:39:55 +08: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
Joooye_34
4c8d54b3a7
refactor(core): use manual upgrade to replace auto migration when web setup (#5022)
1. Split logic in `packages/common/infra/src/blocksuite/index.ts` to multiple single files
2. Move migration logic from setup to upgrade module, to prevent auto migration problems and loading problem
2023-11-23 02:26:06 +00:00
Flrande
d7d47853fe
chore: bump blocksuite (#5030) 2023-11-22 20:51:35 +08:00
Flrande
a3d880daa3
chore: bump blocksuite (#5026) 2023-11-22 20:12:52 +08: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
李华桥
00c11d40cf
v0.10.3-canary.0 2023-11-21 10:02:46 +08:00
李华桥
0f6b28fd06
c0.11.0-canary.0 2023-11-20 23:53:50 +08:00
Flrande
8b2c3d4c41
chore: bump blocksuite (#4958) 2023-11-16 22:01:03 +08:00
Peng Xiao
16488d594c
fix(infra): compatibility fix for space prefix (#4912)
It seems there are some cases that [this upstream PR](https://github.com/toeverything/blocksuite/pull/4747) will cause data loss.

Because of some historical reasons, the page id could be different with its doc id.
It might be caused by subdoc migration in the following (not 100% sure if all white screen issue is caused by it) 0714c12703/packages/common/infra/src/blocksuite/index.ts (L538-L540)

In version 0.10, page id in spaces no longer has prefix "space:"
The data flow for fetching a doc's updates is:
- page id in `meta.pages` -> find `${page-id}` in `doc.spaces` -> `doc` -> `doc.guid`
if `doc` is not found in `doc.spaces`, a new doc will be created and its `doc.guid` is the same with its pageId
- because of guid logic change, the doc that previously prefixed with `space:` will not be found in `doc.spaces`
- when fetching the rows of this doc using the doc id === page id,
  it will return EMPTY since there is no updates associated with the page id

The provided fix in the PR will patch the `spaces` field of the root doc so that after 0.10 the page doc can still be found in the `spaces` map. It shall apply to both of the idb & sqlite datasources.

Special thanks to @lawvs 's db file for investigation!
2023-11-14 14:39:50 +08:00
Peng Xiao
a8d89254ce
fix(electron): dev reload (#4911) 2023-11-12 03:19:27 +00:00
李华桥
7525126d89
fix(core): change server url of stable to insider 2023-11-10 20:07:18 +08:00
Yifeng Wang
2117d6b232
chore: bump blocksuite (#4901) 2023-11-10 13:23:29 +08:00
李华桥
5c48c83301
v0.10.0 2023-11-10 11:42:04 +08:00
李华桥
063f5a683e
v0.10.0-canary.16 2023-11-10 10:10:54 +08:00
李华桥
075eead9fa
v0.10.0-canary.15 2023-11-09 23:27:12 +08:00
Peng Xiao
442115632b
chore(component): bump bs (#4880) 2023-11-09 04:47:10 +00:00
Joooye_34
744cd47481
v0.10.0-canary.14 2023-11-08 15:36:54 +08:00
Hongtao Lye
12c72e63b1
chore: bump blocksuite version (#4862) 2023-11-08 07:12:48 +00:00
Joooye_34
f50b8002b3
v0.10.0-canary.13 2023-11-07 09:55:30 +08:00
Joooye_34
8554d5d791
v0.10.0-canary.12 2023-11-07 00:13:51 +08:00
Peng Xiao
da9934fbdc
fix(electron): add search to proxied url (#4852) 2023-11-06 14:47:44 +00:00
Joooye_34
3b74ff2b92
v0.10.0-canary.11 2023-11-06 18:10:28 +08:00
Joooye_34
fb0aaabe53
v0.10.0-canary.10 2023-11-02 23:40:34 +08:00
Hongtao Lye
15024c6c8a
chore: bump blocksuite (#4801) 2023-11-02 09:12:23 +00:00
Joooye_34
75c8dd75e3
v0.10.0-canary.9 2023-11-01 22:03:47 +08:00
Joooye_34
0273ea8b00
v0.10.0-canary.8 2023-11-01 00:03:04 +08:00
Peng Xiao
8ca53326a7
fix(electron): update app icons (#4789)
Co-authored-by: Joooye_34 <Joooye1991@gmail.com>
2023-10-31 09:09:42 +00:00
Joooye_34
563863005f
v0.10.0-canary.6 2023-10-31 14:40:47 +08:00
Joooye_34
37ec552f74
v0.10.0-canary.5 2023-10-31 11:54:25 +08:00
Joooye_34
17afe218fe v0.10.0-canary.4 2023-10-31 01:49:15 +08:00
joooye34
559ec3956f v0.10.0-canary.3 2023-10-24 20:18:21 +08:00
LongYinan
b13705ba3d
ci: remove setup-maker to reduce release duration (#4710) 2023-10-24 10:09:40 +00:00
Flrande
627e5dfbb5
feat: bump blocksuite (#4706) 2023-10-24 09:00:27 +00:00
Alex Yang
d9e2d17a26 refactor: cleanup code 2023-10-20 19:28:04 -05:00
LongYinan
54aad58388
ci: fix electron make script on Windows (#4666) 2023-10-19 13:00:11 +00:00
LongYinan
37c6560dd6
v0.10.0-canary.2 2023-10-19 17:18:18 +08: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