Compare commits

..

703 Commits

Author SHA1 Message Date
Alex Yang
b509302711 v0.7.0-canary.41 2023-07-12 14:49:08 +08:00
Alex Yang
e51c98c1dd chore: bump version (#3179) 2023-07-12 06:21:11 +00:00
Alex Yang
bbb1387469 feat: display app version in setting panel (#3170) 2023-07-12 02:39:00 +00:00
xiaodong zuo
4f88774999 fix: the image lost after exporting (#3150)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-07-12 02:21:23 +00:00
Alex Yang
3968deb6d4 feat: add suspense to workspace settings (#3167)
Co-authored-by: Qi <474021214@qq.com>
2023-07-11 15:50:30 +00:00
Alex Yang
37c8465af8 fix: jump to index page after deletion (#3169) 2023-07-11 15:44:00 +00:00
Peng Xiao
d88a21d24a fix: settings style update (#3161) 2023-07-11 12:55:28 +00:00
3720
6ad2d106bc fix: some typo and i18n (#3155) 2023-07-11 11:04:45 +00:00
Alex Yang
8c1fcee135 refactor: remove unused code (#3149) 2023-07-11 08:53:01 +00:00
Peng Xiao
0514da9759 fix: updater not working (#3144) 2023-07-11 07:06:04 +00:00
JimmFly
b2fed03f30 style: modify the style of community item (#3143) 2023-07-11 06:44:06 +00:00
Alex Yang
f5e45573af v0.7.0-canary.40 2023-07-11 12:59:12 +08:00
Alex Yang
ddb2931f38 fix: remove workspace not working (#3140) 2023-07-11 04:37:47 +00:00
Alex Yang
acf17ebace chore: bump version (#3138) 2023-07-11 04:28:01 +00:00
Alex Yang
7af3c05b8b v0.7.0-canary.39 2023-07-10 21:00:06 +08:00
Alex Yang
01de2ae714 revert: restrict node version 2023-07-10 20:51:49 +08:00
Qi
cfa18d1bc3 fix: font style setting only control editor's font (#3117)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-07-10 11:58:53 +00:00
Alex Yang
127c63601e chore: bump version (#3131) 2023-07-10 11:34:43 +00:00
LongYinan
f079b0b49a fix: add semver into server dependencies 2023-07-10 19:32:39 +08:00
Alex Yang
6caf934d47 refactor: follow correct react rules (#3119) 2023-07-10 10:32:15 +00:00
Qi
2f910fbad0 feat: modify setting modal entry in quick search modal (#3089) 2023-07-10 09:28:14 +00:00
Peng Xiao
dac4e390aa fix: add DB migration to add workspace (#3115) 2023-07-10 08:03:18 +00:00
JimmFly
812e0e9c9a style: change switch tip color (#3123) 2023-07-10 07:00:23 +00:00
Alex Yang
05291a8a36 chore: restrict node version (#3120) 2023-07-10 06:19:59 +00:00
JimmFly
8bcc4d6a57 test: fix incorrect day suffix (#3121) 2023-07-10 05:56:12 +00:00
danielchim
e06d5e1c8d fix: page mode shortcut (#3097) 2023-07-09 18:37:49 +00:00
Alex Yang
1c8895f23f feat: improve error log message (#3112) 2023-07-09 05:54:53 +00:00
Alex Yang
8b5d997322 refactor(hooks): reduce null types (#3111) 2023-07-09 05:01:09 +00:00
Peng Xiao
33644a68b2 fix: disable move db by default (#3105)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-07-09 03:37:39 +00:00
mon-jai
bc85ad5b65 fix: sidebar noise background on Windows (#3107) 2023-07-08 16:41:07 +00:00
Alex Yang
fe895905bd v0.7.0-canary.38 2023-07-08 15:57:31 +08:00
Alex Yang
3c5ccd7231 fix: init workspace before loaded (#3104) 2023-07-08 07:42:30 +00:00
Alex Yang
da140b0b85 chore: remove unused code (#3102) 2023-07-08 06:49:11 +00:00
Alex Yang
c4d53d59b5 test: fix flaky (#3100) 2023-07-08 06:30:17 +00:00
boomlion8
a48726d088 fix: color of UI in dark mode (#3081)
Co-authored-by: boomlion8 <201116201@manit.ac.in>
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-07-08 06:00:03 +00:00
Alex Yang
b49306607b feat: improve workspace hook (#3099) 2023-07-08 05:43:39 +00:00
Alex Yang
3d15c60cb1 v0.7.0-canary.37 2023-07-08 02:55:18 +08:00
Alex Yang
283f0cd263 refactor: lazy load workspaces (#3091) 2023-07-07 14:15:27 +00:00
JimmFly
66152401be chore: add new item for share component (#3084) 2023-07-07 13:16:49 +00:00
Qi
b12412a3c1 feat: add font style setting (#3092) 2023-07-07 11:59:38 +00:00
Peng Xiao
ce1e8d868c fix: a possible issue on electron flaky test (#3094) 2023-07-07 11:02:58 +00:00
Alex Yang
3294043180 perf: reduce unused provider connection (#3090) 2023-07-07 08:13:32 +00:00
Alex Yang
152fbaabda ci: fix nx.yml (#3086) 2023-07-07 05:37:40 +00:00
JimmFly
5756bdf8d7 style: adjust settings style (#3083) 2023-07-07 05:36:27 +00:00
Alex Yang
80ee33fd3e chore: bump version (#3078) 2023-07-07 01:55:11 +00:00
Alex Yang
955d80e2c1 test: image preview e2e (#3080)
Co-authored-by: danielchim <kahungchim@gmail.com>
2023-07-06 23:24:03 +00:00
Alex Yang
67fe7f04da build: fix nx inputs (#3079) 2023-07-07 01:15:04 +08:00
Alex Yang
6395521f09 test: upgrade playwright (#3077) 2023-07-06 16:15:18 +00:00
Alex Yang
822078e640 fix: cleanup workspace when switch setting panel (#3072) 2023-07-06 15:27:09 +00:00
Alex Yang
fafd93f7dc refactor: block-hub in tool wrapper (#3073) 2023-07-06 15:18:58 +00:00
Peng Xiao
00ce086e79 fix: workspace storage settings issues (#3055) 2023-07-06 12:48:20 +00:00
Alex Yang
28653d6892 fix(web): setting panel refresh (#3070) 2023-07-06 11:24:26 +00:00
Alex Yang
e30c67482f fix(web): fetch hello-world from local (#3062) 2023-07-06 09:46:17 +00:00
Pratik Kumar
bda28e0404 fix(component): new page button in all page (#3053) 2023-07-06 09:40:37 +00:00
Alex Yang
ce63364299 fix(component): image preview fallback (#3058) 2023-07-06 09:22:23 +00:00
JimmFly
f468dff6aa chore: update communities link and icon (#3052) 2023-07-06 07:24:36 +00:00
Peng Xiao
fab03006e8 fix: menu item click area (#3051) 2023-07-06 06:53:50 +00:00
JimmFly
8a565b8633 fix: date-picker hidden in update collection (#3045) 2023-07-06 06:17:19 +00:00
Alex Yang
e79a6a5d47 v0.7.0-canary.36 2023-07-06 14:07:27 +08:00
Pratik Kumar
95c2e20cb5 fix(component): all page list UI padding (#3046)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-07-06 05:56:08 +00:00
JimmFly
2e0f410978 chore: temporary fix sync script error (#3044) 2023-07-06 12:30:01 +08:00
Alex Yang
fa1cd87348 chore: bump version (#3041) 2023-07-06 03:49:17 +00:00
Alex Yang
e95d28e136 fix: workspace name should change in the setting panel (#3039) 2023-07-06 02:19:06 +00:00
Qi
87ba71e77e fix: a series of setting issues (#3032) 2023-07-05 14:11:42 +00:00
Peng Xiao
dec0c0d3d1 fix: delete workspace in settings (#3030) 2023-07-05 10:31:11 +00:00
Peng Xiao
776172bc88 fix: updater issues (#3027) 2023-07-05 09:29:11 +00:00
Alex Yang
d582548ed8 v0.7.0-canary.35 2023-07-05 16:02:31 +08:00
Alex Yang
70ac31b907 build: remove legacy cloud config (#3024) 2023-07-05 06:57:56 +00:00
Alex Yang
cff9fd1ead chore: bump version (#3023) 2023-07-05 06:54:09 +00:00
Alex Yang
319febb00d docs: update README.md 2023-07-05 14:31:47 +08:00
3720
72fa2da2d3 fix: tags does not exist (#3020) 2023-07-05 04:06:44 +00:00
Alex Yang
3084c427f1 feat: update server login feature (#3004)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2023-07-05 03:13:20 +00:00
3720
9cd1f013f8 fix: flaky tests (#3019) 2023-07-05 02:50:43 +00:00
Alex Yang
a3f58d4302 v0.7.0-canary.34 2023-07-05 02:23:53 +08:00
Alex Yang
d4cb89eafc chore: bump version (#3016) 2023-07-04 17:52:40 +00:00
Peng Xiao
33ba034336 fix: sqlite provider import sub doc db file (#2991)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-07-04 17:47:42 +00:00
Alex Yang
e158c09160 chore: update pre-commit (#3017) 2023-07-04 17:42:14 +00:00
JimmFly
c6ccd6d5de chore: update setting text (#3000) 2023-07-04 17:40:58 +00:00
Alex Yang
ec87864c34 refactor: simplify code (#3015) 2023-07-04 17:34:22 +00:00
Alex Yang
a06ba403d0 ci: check macOS arm64 bundle output (#3012) 2023-07-04 16:59:00 +00:00
Alex Yang
dfbec46ded feat(electron): move preload to infra (#3011) 2023-07-04 16:43:30 +00:00
Alex Yang
24be73ef63 chore: bump nx (#3014) 2023-07-04 16:26:43 +00:00
Alex Yang
3976c37d41 v0.7.0-canary.33 2023-07-04 21:52:04 +08:00
Fangdun Tsai
2bc15665b9 chore(electron): renaming clipboard api (#3005) 2023-07-04 12:51:59 +00:00
Alex Yang
e4539dfeb1 fix: bookmark block output missing (#3010) 2023-07-04 12:48:47 +00:00
Qi
1070e17310 feat: modify setting modal (#3008) 2023-07-04 12:37:46 +00:00
Alex Yang
b4f7eb36ef v0.7.0-canary.32 2023-07-04 16:12:09 +08:00
3720
000f802baa feat: add tags support (#2988)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-07-04 07:32:11 +00:00
Alex Yang
e871ffcba0 refactor: input component (#2999) 2023-07-04 06:52:46 +00:00
Alex Yang
8d2ffe3936 chore: bump version (#2998) 2023-07-04 06:47:35 +00:00
ShortCipher5
9e253420d2 docs: update README.md (#2997) 2023-07-04 14:13:25 +08:00
Alex Yang
edb7847e95 test: use static server (#2996) 2023-07-04 05:37:06 +00:00
Alex Yang
3d70148e0f chore: add circular check (#2995) 2023-07-04 04:54:08 +00:00
Alex Yang
7f89b197da build: enable next server (#2992) 2023-07-04 01:59:06 +00:00
danielchim
32692bd54a feat: page mode shortcut (#2985) 2023-07-03 16:23:53 +00:00
Alex Yang
7b2acec7c3 v0.7.0-canary.31 2023-07-03 23:14:38 +08:00
Alex Yang
f1adf23631 chore: bump version (#2989) 2023-07-03 14:51:49 +00:00
Alex Yang
a5d2fafad6 refactor: remove legacy cloud (#2987) 2023-07-03 14:29:37 +00:00
xiaodong zuo
3d0a907b49 fix: dark mode export PDF leaves margin and notification (#2978) 2023-07-03 12:11:07 +00:00
LongYinan
bacd00655d ci: reduce yarn cache (#2983) 2023-07-03 11:09:17 +00:00
Peng Xiao
08e003b0f6 fix: potential updater issue (#2973) 2023-07-03 11:04:45 +00:00
Alex Yang
0f1c5163a1 feat: remove old setting page by default (#2980) 2023-07-03 10:59:23 +00:00
JimmFly
18874d0d1e chore: add import to sidebar (#2981) 2023-07-03 10:51:28 +00:00
Peng Xiao
7f0a74c694 fix: some potential tests issue (#2982) 2023-07-03 10:46:47 +00:00
Peng Xiao
901fc87716 fix: potential race condition on app load when migration (#2977)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-07-03 09:40:02 +00:00
Alex Yang
ee2ab4086f fix(web): hydration issue (#2974) 2023-07-03 09:06:12 +00:00
JimmFly
af94674c18 style: adjust icon button hover color (#2976) 2023-07-03 08:46:16 +00:00
Alex Yang
262289a398 chore: add affine-cloud build config (#2971) 2023-07-03 07:25:14 +00:00
Alex Yang
467eab4ddf build: update build config (#2967) 2023-07-03 06:17:13 +00:00
Alex Yang
63517e4912 chore: update 'lint-staged' rules (#2969) 2023-07-03 06:00:50 +00:00
JimmFly
6f9487deb7 style: adjust copilot chat style (#2915) 2023-07-03 05:57:30 +00:00
JimmFly
8d0edd5255 i18n: update translation resources (#2968) 2023-07-03 05:15:46 +00:00
Qi
bdea153c82 feat: modify preloading data (#2947) 2023-07-03 02:49:55 +00:00
Alex Yang
d447883b7d v0.7.0-canary.30 2023-07-02 14:18:33 +08:00
Alex Yang
03ec51a96c chore: bump version 2023-07-02 14:17:22 +08:00
Alex Yang
0adf18f5e6 v0.7.0-canary.29 2023-07-02 14:06:14 +08:00
Alex Yang
5e7dc9ff21 chore: bump version (#2960) 2023-07-02 05:26:47 +00:00
Alex Yang
33097382c6 chore: replace 'eslint-plugin-import' (#2957) 2023-07-01 16:35:16 +00:00
Alex Yang
b9df2cdabb ci: update labeler.yml 2023-07-01 23:13:35 +08:00
Alex Yang
158338508a ci: use yarn run test 2023-07-01 23:08:14 +08:00
Alex Yang
640967d9ae v0.7.0-canary.28 2023-07-01 21:35:05 +08:00
Alex Yang
ec973395da fix: remove export script 2023-07-01 21:34:24 +08:00
Alex Yang
b35d99d935 v0.7.0-canary.27 2023-07-01 21:29:11 +08:00
Alex Yang
c0f6e751d2 build: update nx.json 2023-07-01 18:58:14 +08:00
Alex Yang
6af454ceed chore: improve ci build speed (#2953) 2023-07-01 10:47:26 +00:00
Alex Yang
ed829dd43b build: update nx.json 2023-07-01 16:54:21 +08:00
Alex Yang
a9adb4dda2 build: fix nx.json (#2951) 2023-07-01 16:34:30 +08:00
Alex Yang
54a7eeda37 chore: bump version (#2950) 2023-07-01 16:26:43 +08:00
Alex Yang
711e683c6f build: skip type check in next.js build (#2952) 2023-07-01 16:22:21 +08:00
Alex Yang
81c5e6d3d2 build: enhance nx build (#2948) 2023-07-01 01:17:31 +08:00
3720
7a5a5d503a chore: adjust icon and style (#2949) 2023-06-30 23:38:47 +08:00
Alex Yang
b597dbd80f docs: update react badge 2023-06-30 18:03:20 +08:00
Alex Yang
ebdf724012 v0.7.0-canary.26 2023-06-30 17:39:42 +08:00
Alex Yang
14f63e91a9 ci: fix build desktop 2023-06-30 17:39:11 +08:00
Alex Yang
ad218ec65d ci: update paths-ignore 2023-06-30 17:39:11 +08:00
Alex Yang
9fda82564b ci: chmod 777 on output directory 2023-06-30 17:39:11 +08:00
Alex Yang
a52fc54d80 v0.7.0-canary.25 2023-06-30 16:27:59 +08:00
Alex Yang
524c342b5e chore: bump blocksuite to '0.0.0-20230630081054-55a25248-nightly' (#2944) 2023-06-30 16:27:38 +08:00
regischen
f4fc084a0a fix(web): migrate connector (#2941)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-06-30 16:11:04 +08:00
Alex Yang
38a2aa9d17 build(electron): use nx (#2942) 2023-06-30 16:10:35 +08:00
Peng Xiao
9e90242ddb fix: disable sqlite blob storage (#2943) 2023-06-30 16:09:43 +08:00
Alex Yang
fd0c1da608 fix(cli): run dev-web crash 2023-06-30 15:58:13 +08:00
Alex Yang
68c4fccf98 ci: cancel previous build (#2794) 2023-06-30 07:39:27 +00:00
Alex Yang
3c93f4162d build: remove unused package (#2937) 2023-06-30 07:09:12 +00:00
Alex Yang
b6c314e180 refactor(cli): use typescript (#2938) 2023-06-30 06:58:57 +00:00
Alex Yang
62b465a889 ci: build infra code before build layers 2023-06-30 15:20:36 +08:00
3720
9d0db78f64 feat: support for view management (#2892) 2023-06-30 05:40:00 +00:00
Fangdun Tsai
d3393cb0fc feat: expose clipboard apis (#2932) 2023-06-30 04:47:30 +00:00
Alex Yang
79cded302f chore: bump blocksuite to 0.0.0-20230629103121-76e6587d-nightly (#2931) 2023-06-30 04:36:56 +00:00
Alex Yang
53d90a11de chore: tag deprecated files (#2936) 2023-06-30 04:01:14 +00:00
Alex Yang
271ad57160 feat: special ip address 'localhost' (#2935) 2023-06-30 03:54:24 +00:00
Alex Yang
4adbe64a54 fix(web): disable notification center (#2934) 2023-06-30 03:29:05 +00:00
DarkSky
50a8a147fd ci: make helm release only on bump version (#2928) 2023-06-30 02:02:46 +00:00
Ikko Eltociear Ashimine
eaea8e9368 refactor: fix typo in notification-center/index.tsx (#2929) 2023-06-30 09:55:09 +08:00
Hyden Liu
9873baae9f fix: z-index on app sidebar (#2761)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-06-30 01:14:44 +00:00
xiaodong zuo
bc3ce7395e feat: export page as file (#2923) 2023-06-29 21:58:02 +00:00
Alex Yang
8a7908c692 fix(electron): window only ui (#2926) 2023-06-29 16:15:44 +00:00
LongYinan
8021efd81a build: affine Node.js server charts (#2895) 2023-06-29 14:02:46 +00:00
Qi
d7fcad2d0d feat: add and modify test case for new settings modal (#2925) 2023-06-29 12:54:45 +00:00
Alex Yang
b1d2d77263 docs: set nodejs version to 18.16.1 2023-06-29 20:00:57 +08:00
Alex Yang
2c772bd81b v0.7.0-canary.24 2023-06-29 18:50:48 +08:00
JimmFly
7f00011542 chore: update changelog link and remove obsolete changelog components (#2918) 2023-06-29 10:19:26 +00:00
Alex Yang
f76d8b8818 chore: bump blocksuite to 0.0.0-20230629084521-542de4e8-nightly (#2921) 2023-06-29 09:42:47 +00:00
Alex Yang
1d6b39dec9 ci: allow codecov upload failure (#2922) 2023-06-29 09:39:16 +00:00
Qi
5cfdf6c7e2 fix: a serise of ui issues of new setting (#2920)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-06-29 09:25:42 +00:00
Alex Yang
8410d83744 refactor: rootWorkspacesMetadataAtom loading logic (#2882) 2023-06-29 08:48:12 +00:00
DarkSky
8a2dac9718 fix: incorrect formatting (#2917) 2023-06-29 08:25:43 +00:00
JimmFly
5ad2908760 chore: update translation (#2916)
Co-authored-by: zuozijian3720 <zuozijian1994@gmail.com>
2023-06-29 08:20:25 +00:00
Alex Yang
5b8771485e docs: add apps/README.md 2023-06-29 16:07:30 +08:00
Alex Yang
ed8480caf0 ci: split migration test 2023-06-29 15:11:16 +08:00
Alex Yang
42ef3c0fc2 test: migration test in real world (#2885) 2023-06-29 06:50:26 +00:00
Alex Yang
e08ee9b7ff ci: add prettier format check (#2908) 2023-06-29 04:13:35 +00:00
liuyi
2c95bfcc3d feat(storage): binding jwst storage to node (#2808) 2023-06-29 01:45:45 +00:00
Alex Yang
86616e152d build: disable sqlite provider in canary 2023-06-29 10:00:41 +08:00
Peng Xiao
b1f478ee5e fix: updater color updates (#2913) 2023-06-28 17:21:07 +00:00
DarkSky
6b0f9fbdad feat: add deployment guide & fix pod label (#2912) 2023-06-28 17:12:23 +00:00
Alex Yang
da3f2b784a ci: fix output variable 2023-06-29 01:20:35 +08:00
Alex Yang
acb140ab78 v0.7.0-canary.23 2023-06-29 00:40:50 +08:00
Alex Yang
0b74bd9bfe ci: use production environment 2023-06-29 00:40:50 +08:00
Alex Yang
acfc030d16 ci: fix package version output 2023-06-29 00:40:50 +08:00
Alex Yang
d0d04ce376 v0.7.0-canary.22 2023-06-29 00:27:17 +08:00
Alex Yang
2250f42d2a ci: fix tag version 2023-06-29 00:26:48 +08:00
Alex Yang
887434fea4 v0.7.0-canary.21 2023-06-29 00:23:06 +08:00
Alex Yang
9b817c4b79 ci: automatically build canary release (#2911) 2023-06-28 15:53:32 +00:00
Alex Yang
ea03bbfb2d ci: add codeql check to merge group (#2909) 2023-06-28 15:07:27 +00:00
Qi
db40cd35c6 feat: migrate workspace setting with new design to setting modal (#2900)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-06-28 14:45:33 +00:00
Alex Yang
aabac9e921 chore: bump typescript version (#2906) 2023-06-28 12:57:33 +00:00
Alex Yang
0a91c41e0a chore: codesandbox setup (#2907) 2023-06-28 12:32:56 +00:00
DarkSky
d6addc0d0b docs: improve helm ci & document (#2902) 2023-06-28 12:30:02 +00:00
Alex Yang
91d3b76be5 refactor(storybook): move to apps folder (#2901) 2023-06-28 12:29:52 +00:00
Alex Yang
3eed009270 feat: add rule 'sonarjs/no-identical-functions' (#2905) 2023-06-28 12:29:12 +00:00
Alex Yang
bc14d54cfa chore: update pre-commit hook (#2904) 2023-06-28 11:24:37 +00:00
Alex Yang
5496969e58 refactor: environment setup (#2898)
Co-authored-by: Simon He <57086651+Simon-He95@users.noreply.github.com>
2023-06-28 11:19:19 +00:00
Alex Yang
80c2a78273 fix(web): bypass adapter list error (#2903) 2023-06-28 11:06:13 +00:00
Alex Yang
92f378aefc test(server): watch mode (#2893) 2023-06-28 10:00:06 +00:00
Alex Yang
877ceee698 ci: enable merge group (#2899) 2023-06-28 09:56:02 +00:00
Alex Yang
7960b6a22e feat: update migration test page (#2871) 2023-06-28 16:46:08 +08:00
Alex Yang
fa45d8a718 build: unify build flags (#2891) 2023-06-28 16:45:05 +08:00
Alex Yang
87574c9993 build: fix i18n output (#2896) 2023-06-28 16:40:41 +08:00
Alex Yang
2dd62f7603 v0.7.0-canary.20 2023-06-28 16:03:21 +08:00
Peng Xiao
79b3b1dabc fix: disable sqlite provider (#2888)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-06-28 15:01:15 +08:00
regischen
fd0aa4a2ee fix: migration props:elements (#2889) 2023-06-28 14:24:14 +08:00
3720
da57fbeadd fix: database migration (#2887) 2023-06-28 13:44:11 +08:00
JimmFly
3f12e4925f style: remove switch button shadow (#2890) 2023-06-28 05:07:33 +00:00
Alex Yang
21cb05a30c build(web): fix debug local (#2886) 2023-06-28 11:43:13 +08:00
Kushagra Singh
7a8ff2c489 docs: update CLA.md (#2884) 2023-06-28 03:12:15 +08:00
Alex Yang
d108434881 fix: preloading page (#2876)
Co-authored-by: Mirone <Saul-Mirone@outlook.com>
2023-06-28 03:11:14 +08:00
Alex Yang
20fd9b6574 feat: upload 0.7.0-canary.18 static output (#2883) 2023-06-28 03:10:08 +08:00
Alex Yang
26ac56e163 test: remove deprecated test (#2880) 2023-06-28 00:53:04 +08:00
Alex Yang
78b74d5b15 feat(docs): update document (#2877) 2023-06-28 00:52:42 +08:00
DarkSky
1556167262 feat: add helm releaser (#2875) 2023-06-28 00:16:40 +08:00
Alex Yang
5186710f84 v0.7.0-canary.19 2023-06-27 23:13:01 +08:00
JimmFly
c7f25e8fe3 fix: incorrect scrollbar position when opening full width layout (#2869)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-06-27 14:15:34 +00:00
Alex Yang
ab703fe3ae test: fix image preview (#2874) 2023-06-27 21:05:24 +08:00
DarkSky
5275ff5493 feat: add affine cloud helm config (#2870) 2023-06-27 21:00:41 +08:00
Alex Yang
4fad21fe5c fix: remove preloading page (#2873) 2023-06-27 20:00:06 +08:00
JimmFly
eec2074b88 style: add hover style for filter item (#2868) 2023-06-27 19:02:46 +08:00
LongYinan
dd58b1bbf6 build: docker images (#2860) 2023-06-27 17:23:19 +08:00
Peng Xiao
05452bb297 feat: sqlite subdocument (#2816)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-06-27 07:40:37 +00:00
danielchim
4307e1eb6b fix: image preview (#2818) 2023-06-27 15:26:57 +08:00
JimmFly
10c7f93a85 style: add hover style for scrollbar (#2867) 2023-06-27 15:26:13 +08:00
Alex Yang
adca2a7225 chore: bump version (#2866) 2023-06-27 13:23:54 +08:00
Alex Yang
eb3f160a64 chore: bump version (#2862) 2023-06-27 11:32:24 +08:00
Alex Yang
53488a1498 build: remove image preview config (#2861) 2023-06-27 10:59:24 +08:00
DarkSky
d46b6c4863 feat: new workspace apis (#2825) 2023-06-26 22:12:58 +08:00
Alex Yang
e3ffd04804 feat(docs): bootstrapping using blocksuite (#2859) 2023-06-26 21:39:07 +08:00
Alex Yang
bddcfe1b8b chore: bump version (#2858) 2023-06-26 17:58:24 +08:00
Believerd
f18d07a4a2 docs: added note for building native dependencies (#2851) 2023-06-26 17:34:48 +08:00
Alex Yang
44166f7256 fix(docs): defer entry js (#2856) 2023-06-26 16:59:42 +08:00
Alex Yang
8e82d1e02c feat: support migration (#2852) 2023-06-26 15:55:44 +08:00
JimmFly
002e64c819 style: add scrollbar (#2826) 2023-06-26 15:12:44 +08:00
Alex Yang
773d92760e feat: add migration test page (#2855) 2023-06-26 13:42:07 +08:00
Mirone
84c8828e8c feat: add migration script for database (#2854) 2023-06-26 12:16:30 +08:00
himself65
fb6de18b2f feat(docs): update home page 2023-06-25 22:25:13 +08:00
Alex Yang
d525bd9113 feat: init @affine/docs (#2849) 2023-06-25 21:18:23 +08:00
Alex Yang
d8bb51a222 chore: bump version (#2848) 2023-06-25 18:37:20 +08:00
Alex Yang
da4d89275f chore: bump version (#2847) 2023-06-25 17:47:48 +08:00
Alex Yang
9bf5ea3e56 chore: bump version (#2846) 2023-06-25 17:16:03 +08:00
Alex Yang
7fcc5e599e feat!: upgrade blocksuite version (#2833) 2023-06-25 01:16:46 +08:00
Qi
aa86d3a2ee feat: new setting modal (#2834)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-06-21 19:57:59 +08:00
LongYinan
9a90ce694c chore(server): commit server generated gql file to prevent build fail (#2835) 2023-06-21 07:22:47 +00:00
LongYinan
9b3fa43b81 feat(server): auth server (#2773) 2023-06-21 06:08:32 +00:00
himself65
2698e7fd0d fix(y-indexeddb): remove .js suffix 2023-06-21 11:25:14 +08:00
Alex Yang
58fd3857c0 fix(y-indexeddb): test cases (#2832) 2023-06-20 22:01:47 +08:00
Peng Xiao
3755661ff6 fix: incorrect bookmark toast text (#2815)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-06-20 19:14:15 +08:00
himself65
c649995a7a build: update changelogUrl 2023-06-20 18:58:05 +08:00
himself65
448d3731e5 build: update nx.json 2023-06-20 18:08:48 +08:00
3720
019a2f57cb fix: e2e test (#2828)
Co-authored-by: Alex Yang <himself65@outlook.com>
2023-06-20 17:15:49 +08:00
himself65
6f9bb024be build: update nx.json 2023-06-20 13:41:58 +08:00
Mirone
707d585698 feat: add subdoc migration script (#2820)
Co-authored-by: himself65 <himself65@outlook.com>
2023-06-20 11:20:12 +08:00
Alex Yang
b73c75182f refactor: simplify rpc code (#2823) 2023-06-19 23:27:27 +08:00
Alex Yang
775d6212d3 build: fix nx config (#2824) 2023-06-19 23:07:40 +08:00
Alex Yang
357ff9853d fix: native build (#2822) 2023-06-19 18:21:34 +08:00
DarkSky
cd7892b7ed chore: update nx cloud read only token (#2821) 2023-06-19 17:38:26 +08:00
himself65
9512964366 build: fix publish.sh 2023-06-19 11:18:54 +08:00
Alex Yang
5473a12c0e build: fix nx output (#2817) 2023-06-19 11:13:59 +08:00
Alex Yang
c249cdf76a build: enable nx cloud (#2812) 2023-06-17 19:36:55 +08:00
Alex Yang
0e01094ffd ci: use nx on rust build (#2811) 2023-06-17 17:49:07 +08:00
Alex Yang
c68220166a feat(y-indexeddb): remove id (#2810) 2023-06-17 13:58:48 +08:00
Alex Yang
deeafb3a12 chore: bump version (#2799) 2023-06-17 13:52:07 +08:00
himself65
4d44542ca6 ci: update BUG-REPORT.yml 2023-06-16 15:18:18 +08:00
JimmFly
f83c92cb87 style: temporarily adjust the style of the co-pilot (#2804) 2023-06-16 15:12:59 +08:00
himself65
03c0b6b364 build: fix publish.sh 2023-06-16 15:00:06 +08:00
himself65
c5eb16139f build: update nx.json 2023-06-16 14:50:42 +08:00
himself65
bfb9e9b5c5 ci: update release-desktop-app.yml 2023-06-16 14:44:45 +08:00
himself65
af4de0b14f ci: update nightly-build.yml 2023-06-16 14:38:15 +08:00
Peng Xiao
0553ca3c02 docs: update building.md for electron (#2800) 2023-06-16 13:15:42 +08:00
himself65
9422b93857 fix(copilot): idb upgrade 2023-06-16 11:15:51 +08:00
himself65
951f5540a3 v0.7.0-canary.18 2023-06-15 21:56:22 +08:00
himself65
2b9929222c build: update change log url 2023-06-15 21:54:06 +08:00
Peng Xiao
b1c64a5f7e fix: missing updater (#2796) 2023-06-15 20:48:10 +08:00
Himself65
5164c8c1f9 chore: bump version (#2787) 2023-06-15 15:03:20 +08:00
himself65
18fad62f5c v0.7.0-canary.17 2023-06-15 14:34:11 +08:00
JimmFly
7eaff644e3 fix: electron cannot be started in Windows (#2784) 2023-06-15 06:16:27 +00:00
JimmFly
9fd4818d81 fix: window control not work (#2790) 2023-06-15 06:09:46 +00:00
himself65
d144c9f6f5 build(y-indexeddb): update package.json 2023-06-15 14:04:39 +08:00
JimmFly
a6752bb49c test: add basic test for link page and database (#2775) 2023-06-15 13:58:43 +08:00
danielchim
ae7da1b018 fix: image preview (#2786)
Co-authored-by: himself65 <himself65@outlook.com>
2023-06-15 13:55:17 +08:00
JimmFly
3819342ff2 fix: add guide to the other page (#2779) 2023-06-15 12:46:56 +08:00
himself65
3058c56394 v0.7.0-canary.16 2023-06-15 01:14:45 +08:00
himself65
afad85f4a4 ci: enable image preview 2023-06-15 01:13:58 +08:00
himself65
557a7c3360 v0.7.0-canary.15 2023-06-15 00:44:08 +08:00
Himself65
44580f6af0 fix(electron): bookmark plugin wound not work (#2776) 2023-06-15 00:43:28 +08:00
Himself65
5d75ceeeb5 feat: support sub-doc feature (#2774) 2023-06-14 23:22:35 +08:00
himself65
8d5330df74 v0.7.0-canary.14 2023-06-14 18:41:11 +08:00
Himself65
761965240d fix: build layer (#2769) 2023-06-14 18:40:13 +08:00
danielchim
ad32ed5dd5 feat: image-preview (#2720)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-06-14 04:20:29 +00:00
LongYinan
6a4f70cf43 fix(electron): install missing dependencies (#2765) 2023-06-14 11:11:45 +08:00
LongYinan
3996955e3b fix: add eslint-plugin-sonarjs and rules (#2767) 2023-06-14 10:45:14 +08:00
LongYinan
1c8f1a05d0 fix: add @typescript-eslint/no-floating-promises rule (#2764)
Co-authored-by: himself65 <himself65@outlook.com>
2023-06-13 06:55:23 +00:00
Flrande
bbac03107e fix: preloading gif order (#2760)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-06-13 14:46:52 +08:00
himself65
32f064c2de v0.7.0-canary.13 2023-06-13 14:13:38 +08:00
himself65
39704bc812 build: fix generate-assets.mjs 2023-06-13 14:12:08 +08:00
Himself65
a421265483 fix: remove unused hooks (#2762) 2023-06-13 12:18:32 +08:00
himself65
e6214cb6ec v0.7.0-canary.12 2023-06-13 11:00:39 +08:00
himself65
ba7d34bce5 docs: update thanks section in README.md 2023-06-13 10:45:52 +08:00
Himself65
ace3c37fcc feat: improve copilot (#2758) 2023-06-13 10:29:04 +08:00
Peng Xiao
5ba2dff008 feat: add helper process (#2753) 2023-06-13 10:01:43 +08:00
Himself65
dff8a0db7d fix: nx build input (#2755) 2023-06-12 13:06:23 +08:00
himself65
ccda45bdd2 build: fix nx.json 2023-06-12 12:05:00 +08:00
Himself65
eeb536d460 feat: use nx to manage monorepo (#2748) 2023-06-10 00:46:24 +08:00
Peng Xiao
1e6e0336c3 fix: electron dev crash (#2746) 2023-06-09 08:47:14 +00:00
Himself65
f2ac2e5b84 feat: isolated plugin system (#2742) 2023-06-09 16:43:46 +08:00
Himself65
af6f431c15 fix: replace noop function (#2744) 2023-06-09 16:00:44 +08:00
Peng Xiao
01ae21e1fa feat: add kalam font (#2743) 2023-06-09 15:48:30 +08:00
LongYinan
34141958eb style: remove some verbose codes (#2741) 2023-06-09 14:55:41 +08:00
JimmFly
c194cff0bd chore: remove en.json code owner (#2740) 2023-06-09 13:24:25 +08:00
Himself65
6b6f2d6910 chore: upgrade yarn (#2739) 2023-06-09 12:33:52 +08:00
LongYinan
2e975e79dd style: add ban-ts-comment rule (#2738) 2023-06-09 11:55:23 +08:00
Himself65
c5a295a87b chore: bump typescript to 5.1.3 (#2735)
Co-authored-by: LongYinan <lynweklm@gmail.com>
2023-06-09 11:42:54 +08:00
himself65
119b4cdf10 v0.7.0-canary.11 2023-06-09 11:30:51 +08:00
Himself65
bf6af934f6 fix: regression on the database and bookmark block (#2737) 2023-06-09 11:29:52 +08:00
Himself65
1971749449 test: add test cases for page setting atom (#2736) 2023-06-09 02:00:09 +08:00
Himself65
b383ce36cd build: enhance tsconfig type check (#2732) 2023-06-09 01:42:58 +08:00
Himself65
fc9a9f479b fix: page meta is undefined (#2734) 2023-06-09 01:19:16 +08:00
himself65
227174db1b build: fix eslint config 2023-06-09 01:11:53 +08:00
Himself65
9f129075dd feat: add page setting atom (#2725) 2023-06-09 00:58:46 +08:00
Peng Xiao
935b4f847c fix: potential flaky issues (#2733) 2023-06-09 00:20:12 +08:00
Whitewater
ec99a0ce05 feat: update desc for empty page (#2710) 2023-06-08 20:28:37 +08:00
Himself65
7ba5f82aef chore: bump blocksuite to 0.0.0-20230607055421-9b20fcaf-nightly (#2731) 2023-06-08 20:27:12 +08:00
Peng Xiao
546d5764e6 fix: a potential crash on fav list (#2716) 2023-06-08 20:06:15 +08:00
himself65
6f411bd459 v0.7.0-canary.10 2023-06-08 18:33:14 +08:00
JimmFly
29d8f61c90 feat: add date picker (#2644)
Co-authored-by: himself65 <himself65@outlook.com>
2023-06-08 17:55:16 +08:00
Peng Xiao
bedf838fe5 feat: add new rule for floating promise (#2726)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-06-08 17:54:25 +08:00
Qi
fda89b05e7 feat: replace electron to puppeteer (#2700)
Co-authored-by: himself65 <himself65@outlook.com>
2023-06-08 17:51:45 +08:00
himself65
de8af5f114 revert: page jump once 2023-06-08 16:54:42 +08:00
himself65
14db45ae95 build: fix the directory path on webstorm 2023-06-08 16:26:09 +08:00
Himself65
27b14af388 test: fix flaky on local-first-workspace-list.spec.ts (#2727) 2023-06-08 16:18:10 +08:00
LongYinan
18dc427bc3 style: enable no-non-null-assertion rule (#2723)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-06-08 07:23:20 +00:00
Himself65
1ad2e629ac refactor: project tsconfig & abstract infra type (#2721) 2023-06-08 12:41:47 +08:00
Himself65
05288be934 fix: flaky when drag workspace list (#2724) 2023-06-08 11:51:02 +08:00
Himself65
05b73a59be fix: first page default mode (#2719)
Co-authored-by: tzhangchi <c@affine.pro>
2023-06-08 10:17:27 +08:00
Himself65
f3fd5ff76b feat: add infra code (#2718) 2023-06-08 09:41:20 +08:00
Himself65
4958d096b0 fix: move workspace to top level (#2717) 2023-06-07 23:20:35 +08:00
Himself65
7f2006488e fix: type import (#2715) 2023-06-07 22:47:02 +08:00
Peng Xiao
008a05a470 fix(electron): should not continue pull when db closed (#2709) 2023-06-07 18:01:59 +08:00
himself65
3d7721d59d v0.7.0-canary.9 2023-06-07 17:59:55 +08:00
Flrande
35fb10c95b feat: add preloading template (#2655)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-06-07 17:31:54 +08:00
Himself65
c4c4ec6a67 refactor: split storybook (#2706) 2023-06-07 16:55:06 +08:00
Himself65
f4be15baec fix: package affine/env modules (#2707) 2023-06-07 16:31:05 +08:00
himself65
17b40b68df docs: update README.md 2023-06-07 16:29:37 +08:00
Himself65
cd5c4b5cb7 fix: remove dependencies in @affine/debug (#2708) 2023-06-07 15:41:42 +08:00
LongYinan
d28c887237 feat(native): move sqlite operation into Rust (#2497)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-06-07 14:52:19 +08:00
himself65
541011ba90 build: remove unused reference 2023-06-07 14:21:21 +08:00
wonderl17
fc658f4a95 fix: add bookmark operation flag for ts check (#2699) 2023-06-07 10:18:19 +08:00
Peng Xiao
84f68fc2c0 fix: import workspace may only show default preload page (#2685) 2023-06-06 14:42:50 +08:00
JimmFly
f78760cb83 fix: empty svg color missing (#2692) 2023-06-06 04:45:34 +00:00
Himself65
8f6db00402 feat: init window.affine (#2682) 2023-06-06 11:43:34 +08:00
Peng Xiao
d00d0bd951 fix: the top padding should be draggable (#2688) 2023-06-06 11:12:00 +08:00
Peng Xiao
8f5cd13e78 fix: do not show deleted reference (#2689) 2023-06-06 10:36:58 +08:00
Whitewater
3b4cfc642f fix: overflow in radio button group (#2687) 2023-06-05 10:18:53 +00:00
JimmFly
5807f34935 fix: empty icon color error (#2686) 2023-06-05 10:06:17 +00:00
Whitewater
efae4cccd6 feat: sticky table head in page list (#2668)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-06-05 07:43:24 +00:00
Himself65
b461a684ad chore: bump version (#2681) 2023-06-05 01:00:41 +08:00
3720
b95808a052 test: add some e2e tests for all pages filter (#2674) 2023-06-04 23:34:16 +08:00
Himself65
1716e7a397 fix: use react-resizable-panels (#2679) 2023-06-04 23:33:36 +08:00
Himself65
acda594cba refactor: use esbuild instead of vite (#2672) 2023-06-02 13:22:09 +00:00
Himself65
94d20f1bdc feat: plugin system with isolated bundles (#2660) 2023-06-02 16:28:47 +08:00
Vlad Cuciureanu
f9079bb681 fix: README typo 2023-06-02 15:47:09 +08:00
himself65
0d07ff2390 v0.7.0-canary.8 2023-06-02 13:02:48 +08:00
xiaodong zuo
42bab6990e fix: update version bump-blocksuite (#2658) 2023-06-02 11:16:31 +08:00
fourdim
89a566a645 fix: pdf export in client and hide png export (#2604) 2023-06-01 13:26:57 +00:00
LongYinan
7af5bd3894 v0.7.0-canary.7 2023-06-01 19:11:12 +08:00
Peng Xiao
a57c27679d chore: bump blocksuite (#2652) 2023-06-01 10:55:10 +00:00
JimmFly
68a72b2dfc chore: update whats new link (#2651) 2023-06-01 17:59:30 +08:00
LongYinan
602f795133 build: prevent tsconfig includes sources outside (#2643) 2023-06-01 17:08:14 +08:00
himself65
5df89a925b v0.7.0-canary.6 2023-06-01 15:34:08 +07:00
Whitewater
23126e1ff6 fix: show table head when no item in page list (#2642) 2023-06-01 16:31:51 +08:00
xiaodong zuo
e1f715f837 chore: update blocksuite to 0.0.0-20230601062752-68dbf1a4-nightly (#2641) 2023-06-01 16:25:54 +08:00
himself65
fbcaed40e7 fix: block hub not working in the editor 2023-06-01 14:32:41 +08:00
JimmFly
88757ce488 chore: update all page style (#2638) 2023-06-01 12:38:14 +08:00
Simon He
fc9462eee9 perf: getEnvironment() -> env (#2636) 2023-06-01 03:23:38 +00:00
Qi
e1314730be feat: support get dynamic page meta data (#2632) 2023-06-01 11:03:16 +08:00
Peng Xiao
36978dbed6 fix: plugin bootstrap (#2631)
Co-authored-by: himself65 <himself65@outlook.com>
2023-06-01 01:14:37 +08:00
Whitewater
53d1991211 chore: update page group naming (#2628) 2023-05-31 16:41:25 +00:00
LongYinan
1ea445ab15 build: perform TypeCheck for all packages (#2573)
Co-authored-by: himself65 <himself65@outlook.com>
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-05-31 12:49:56 +00:00
Himself65
78410f531a chore: bump version (#2627) 2023-05-31 18:16:18 +08:00
himself65
96c0321696 v0.7.0-canary.5 2023-05-31 17:34:21 +08:00
himself65
0895f1fb30 ci: enable bookmark block in canary 2023-05-31 17:33:11 +08:00
himself65
b6188f4b11 docs: update logo in README.md 2023-05-31 17:23:01 +08:00
JimmFly
2ed1a7b219 chore: update filter style (#2625) 2023-05-31 17:20:18 +08:00
Himself65
9bee6bd5cc docs: update logo (#2626) 2023-05-31 17:16:50 +08:00
himself65
198f30c86d docs: update README.md 2023-05-31 17:12:27 +08:00
Himself65
454f1887cf feat: add @affine/bookmark-block plugin (#2618) 2023-05-31 17:08:03 +08:00
himself65
4e1e4e9435 v0.7.0-canary.4 2023-05-31 16:47:16 +08:00
3720
f7768563e1 fix: wrong use of dayjs (#2624) 2023-05-31 16:46:36 +08:00
Himself65
6aa0e71b84 chore: bump blocksuite to 0.0.0-20230531080915-ca9c55a2-nightly (#2622) 2023-05-31 16:32:35 +08:00
himself65
f1b3a10969 test: fix mouse click down timeout 2023-05-31 16:22:43 +08:00
Whitewater
90e70ed986 fix: drag delay (#2621) 2023-05-31 16:21:50 +08:00
xiaodong zuo
094a479c2a fix: remove the feature of exporting pdf/png (#2619)
Co-authored-by: himself65 <himself65@outlook.com>
2023-05-31 16:20:42 +08:00
Whitewater
20f1d487c8 feat: add page preview (#2620) 2023-05-31 08:18:48 +00:00
himself65
4c9bda1406 v0.7.0-canary.3 2023-05-31 15:41:52 +08:00
JimmFly
d5debc0bf5 chore: update filter style (#2617)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-31 15:41:16 +08:00
Peng Xiao
f5aee7c360 fix: unify sidebar switch (#2616) 2023-05-31 07:06:13 +00:00
Himself65
248cd9a8ab chore: prohibit import package itself (#2612)
Co-authored-by: Whitewater <me@waterwater.moe>
2023-05-31 15:00:50 +08:00
Himself65
06abb702f5 refactor: remove deprecated atoms (#2615) 2023-05-31 14:54:59 +08:00
Himself65
ee289706ec refactor: move affine utils into @affine/workspace (#2611) 2023-05-31 13:13:59 +08:00
Himself65
6cbf310a5a chore: bump blocksuite to 0.0.0-20230531040027-44cd9d8e-nightly (#2610) 2023-05-31 13:10:41 +08:00
Whitewater
855fd8a73a feat: page list supports preview (#2606) 2023-05-31 04:24:55 +00:00
Himself65
8dbd354659 fix: logic after delete all workspaces (#2587)
Co-authored-by: JimmFly <yangjinfei001@gmail.com>
2023-05-31 12:24:14 +08:00
Himself65
1c7ae04f4f feat: update filter button (#2609) 2023-05-31 11:26:20 +08:00
Whitewater
0bb6e362bf feat: add page mode filter (#2601)
Co-authored-by: himself65 <himself65@outlook.com>
2023-05-31 11:15:23 +08:00
Peng Xiao
617350fc7d fix: optimize DB pull (#2589) 2023-05-31 11:09:18 +08:00
Hyden Liu
2713340532 fix(web): header div props error (#2607) 2023-05-31 10:34:42 +08:00
Whitewater
31d552ab7e fix: update breakpoint in all page (#2602) 2023-05-30 18:27:42 +08:00
Himself65
e11326f05f feat: add hook useBlockSuitePagePreview (#2603) 2023-05-30 18:26:13 +08:00
Himself65
6648fe4dcc feat: init @affine/copilot (#2511) 2023-05-30 18:02:49 +08:00
Peng Xiao
f669164674 fix: popover may not be closable (#2598) 2023-05-30 17:29:00 +08:00
JimmFly
c6d8904ca2 fix: quick search result missing title (#2594) 2023-05-30 16:45:00 +08:00
3720
8c5a1e2de3 test: add some tests for page filter (#2593) 2023-05-30 16:39:14 +08:00
himself65
395414c336 v0.7.0-canary.2 2023-05-30 15:17:35 +08:00
xiaodong zuo
96f653ea19 chore: bump blocksuit to 0.0.0-20230530061436-d0702cc0-nightly (#2590) 2023-05-30 15:13:54 +08:00
fourdim
fa089de40d feat: add support for exporting pdf and png (#2588)
This closes #2583.
2023-05-30 14:04:35 +08:00
Doma
4175f5391e feat(web): drag page to trash folder (#2385)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-30 13:14:10 +08:00
Himself65
61c417992a feat: init support for multiple tiles (#2585) 2023-05-30 12:27:38 +08:00
Himself65
befae6bc9b feat: page view persistence (#2581) 2023-05-30 00:21:21 +08:00
himself65
e7eb13e966 v0.7.0-canary.1 2023-05-30 00:19:05 +08:00
Whitewater
88eaaf9ce4 feat: add radio group (#2572) 2023-05-29 23:15:22 +08:00
Himself65
20cc082a02 refactor: abstract header adapter (#2580) 2023-05-29 22:52:04 +08:00
Qi
402d12a0e1 fix: bookmark popper menu only display after pasted (#2578) 2023-05-29 14:25:30 +00:00
Himself65
58ba11e13c refactor: ui adapter (#2577) 2023-05-29 21:56:00 +08:00
Horus
cb6ca52b03 fix: replace windows installer loading gif (#2575) 2023-05-29 21:36:08 +08:00
Himself65
cd2ab73e5d chore: bump blocksuite to 0.0.0-20230529102007-5ac37643-nightly (#2569) 2023-05-29 18:51:33 +08:00
JimmFly
b16e725514 chore: adjust switch style (#2570) 2023-05-29 18:40:47 +08:00
JimmFly
004fcc8e80 fix: updater button text overflow (#2571) 2023-05-29 18:39:47 +08:00
Hyden Liu
a01a3ef011 fix: dropdown menu entire right can be pulled down (#2568)
Co-authored-by: Whitewater <me@waterwater.moe>
2023-05-29 07:03:26 +00:00
Peng Xiao
20cf45270d refactor(electron): sqlite db data workflow (remove symlink & fs watcher) (#2491) 2023-05-29 12:53:15 +08:00
3720
f3ac12254c feat: headless filter in all pages tab (#2566)
Co-authored-by: himself65 <himself65@outlook.com>
2023-05-29 04:06:40 +00:00
himself65
e0eb216b9b chore: revert @vanilla-extract/next-plugin to 2.1.2 2023-05-27 21:36:24 +08:00
Himself65
90afed1e74 feat: add build flag enableAllPageFilter (#2562) 2023-05-27 16:35:07 +08:00
Himself65
83d2ed8ace chore: bump version (#2559) 2023-05-27 16:08:07 +08:00
himself65
a0b64ca3e3 docs: update releases.md 2023-05-26 16:12:53 +08:00
himself65
b9fc5ad769 v0.7.0-canary.0 2023-05-26 15:50:00 +08:00
Himself65
ef1a44a413 chore: bump version (#2542) 2023-05-26 15:47:45 +08:00
xiaodong zuo
798dc49da4 feat: the UI of importing Html/Markdown/Notion (#2533)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-26 15:30:39 +08:00
himself65
902081d44e ci: remove concurrency in languages-sync.yml 2023-05-26 15:26:12 +08:00
Whitewater
7969b73979 chore: tweak all page styles (#2540) 2023-05-26 15:13:50 +08:00
Himself65
c8734bd6ee chore: bump blocksuite to 0.0.0-20230526024755-74df4d56-nightly (#2541) 2023-05-26 15:13:00 +08:00
Qi
6d3c273ffd feat: support bookmark (#2458)
Co-authored-by: himself65 <himself65@outlook.com>
2023-05-26 06:52:36 +00:00
Himself65
f4b3830a0e feat(component): init notification center (#2426)
Co-authored-by: JimmFly <yangjinfei001@gmail.com>
2023-05-26 14:32:01 +08:00
Whitewater
36534f1915 feat: add storybook i18n decorator (#2538)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-26 14:28:11 +08:00
Whitewater
7dcbe64d4e feat: group all page by date (#2532)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-26 05:23:51 +00:00
Himself65
60057c666d fix: cannot delete last workspace (#2537) 2023-05-26 13:04:20 +08:00
JimmFly
60a83f4907 chore: update user guide style (#2536) 2023-05-26 12:55:06 +08:00
Horus
b11ce2c8d2 docs: add native build command to readme (#2535) 2023-05-26 10:29:30 +08:00
Whitewater
3b8f2c1ac3 refactor: use date obj in all pages (#2523) 2023-05-25 18:22:57 +08:00
Whitewater
be065e2de3 fix: sort in desc based update date by default (#2510) 2023-05-25 15:33:02 +08:00
Horus
675c737e48 fix: replace new windows install loading gif (#2513) 2023-05-25 14:30:52 +08:00
himself65
1255384cab v0.6.0-canary.8 2023-05-25 14:13:32 +08:00
Himself65
3d423c3299 fix: dispose on editor props.onInit (#2521) 2023-05-25 14:13:06 +08:00
ShortCipher5
ad4737850d chore: update pre-load content (#2518) 2023-05-25 05:41:49 +00:00
Himself65
9dcacd413c chore: bump blocksuite to 0.0.0-20230525011821-20259c76-nightly (#2515) 2023-05-25 13:04:18 +08:00
JimmFly
c1998eddf3 chore: bump electron (#2516) 2023-05-25 03:46:34 +00:00
himself65
db3f63e8f2 v0.6.0-canary.7 2023-05-25 09:17:21 +08:00
JimmFly
e562ca1011 chore: update download tip link (#2509) 2023-05-24 16:43:45 +08:00
fourdim
f6adf93f90 feat: add simple support for pdf (#2503) 2023-05-24 16:40:20 +08:00
Chi Zhang
053eba5d98 docs: update README.md (#2506) 2023-05-24 14:46:26 +08:00
Himself65
49f1ba676f fix: regression on toast component (#2502) 2023-05-24 13:10:25 +08:00
Aditya Sharma
48c109e149 feat(component): keyboard navigation for image-viewer (#2334)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-23 09:35:11 +00:00
LongYinan
259d7988d9 chore(native): upgrade notify to v6 (#2489) 2023-05-22 22:45:43 +08:00
fourdim
0a49258ddd docs: update build guideline (#2434)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-22 12:18:43 +00:00
himself65
fd35d3427e fix: make editor width to 800px
Fixes: https://github.com/toeverything/AFFiNE/issues/2486
2023-05-22 17:40:51 +08:00
Himself65
ef0a20b358 fix: use data-testid (#2487) 2023-05-22 17:36:52 +08:00
Himself65
f01997f8ee refactor: remove unused code (#2484) 2023-05-22 17:11:18 +08:00
Whitewater
281a068cfb chore(i18n): remove unused dependencies (#2485) 2023-05-22 17:03:55 +08:00
Whitewater
fe5be0cb47 fix: flatten i18n keys (#2483) 2023-05-22 08:08:43 +00:00
himself65
8aab1d6459 docs: add comment on legacy affine adapter 2023-05-22 16:02:05 +08:00
Himself65
2eaaeef4a7 fix: use hook with first render (#2481) 2023-05-22 15:58:13 +08:00
Himself65
5fbfabb3b2 refactor: rename plugins to adapters (#2480) 2023-05-22 15:48:01 +08:00
himself65
ec64260b6a v0.6.0-canary.6 2023-05-22 14:25:20 +08:00
LongYinan
2e23a4830b ci: add circular import detect (#2475)
Co-authored-by: himself65 <himself65@outlook.com>
2023-05-22 04:53:55 +00:00
Himself65
41a3d6f62f fix: wrap all workspaces with Suspense (#2477) 2023-05-22 12:39:07 +08:00
Peng Xiao
752bc9ca0e fix: fav reference style issue (#2476) 2023-05-22 12:01:03 +08:00
Himself65
c08f6fdba4 chore: update blocksuite to 0.0.0-20230519102837-01acd96b-nightly (#2472) 2023-05-22 02:27:03 +00:00
Geoffrey Biggs
b23b7e896b docs: correct spelling (#2469) 2023-05-22 07:26:30 +08:00
Whitewater
d68b421a4b feat: add responvise page view (#2453) 2023-05-22 07:25:25 +08:00
Horus
1f510799e2 fix: add windows install loading gif (#2462) 2023-05-21 16:03:48 +08:00
Peng Xiao
66ea97c7c9 fix: adjust some windows style issues (#2454) 2023-05-19 09:39:51 -07:00
Shishu
ee300e7b60 docs: sign CLA (#2457) 2023-05-19 08:40:59 -07:00
Peng Xiao
ef2d135e9b fix: optimize app updater (#2452) 2023-05-19 00:07:07 -07:00
JimmFly
c82fb89d57 chore: remove unused i18n key (#2451) 2023-05-19 03:38:48 +00:00
himself65
725bf63a32 ci: remove add-to-project.yml 2023-05-18 18:35:19 -07:00
himself65
c1ca578f7d docs: add download count 2023-05-18 13:12:26 -07:00
Whitewater
530dd5ff7f feat: add new page button (#2417) 2023-05-18 13:07:05 -07:00
Himself65
11370bc07e chore: bump version (#2444) 2023-05-18 11:43:45 -07:00
JimmFly
1c53daf1c4 chore: bump icon version (#2441) 2023-05-18 10:37:40 -07:00
Peng Xiao
b2556db33b fix: adjust some styles (#2438) 2023-05-18 09:24:23 +00:00
JimmFly
89310c9b97 chore: adjust delete description style (#2437) 2023-05-18 09:17:38 +00:00
JimmFly
8e09af910f fix: create workspace card responsive (#2435) 2023-05-18 09:11:15 +00:00
himself65
885aea3425 v0.6.0-canary.5 2023-05-18 01:21:25 -07:00
ShortCipher5
a616150f2d chore: update pre-load content (#2432) 2023-05-18 00:08:35 -07:00
Himself65
d80dae8a89 fix: open non-trash page when open (#2431) 2023-05-17 23:22:31 -07:00
Himself65
34ff08b92b chore: bump blocksuite to 0.0.0-20230518051344-45970a96-nightly (#2430) 2023-05-17 22:30:45 -07:00
Peng Xiao
2f7b51d7ff feat: fav page references (#2422)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-17 22:18:40 -07:00
ShortCipher5
b7cee3185e chore: update pre-loading page (#2429) 2023-05-17 22:16:19 -07:00
JimmFly
1c5455e6ed chore: adjust copywriting for onboarding (#2428) 2023-05-17 22:15:01 -07:00
himself65
2d303fd5d3 v0.6.0-canary.4 2023-05-17 17:46:39 -07:00
himself65
fbe2543c03 fix: version check 2023-05-17 17:44:58 -07:00
Himself65
d6b640726e refactor: remove unused code (#2425) 2023-05-17 17:15:12 -07:00
Peng Xiao
f875b37641 fix: configurable changelog url (#2418) 2023-05-17 16:16:22 -07:00
Himself65
53c4fc6dfa fix: sidebar fallback ui position (#2424) 2023-05-17 15:49:55 -07:00
Himself65
6c310249d9 chore: bump version (#2423) 2023-05-17 15:02:55 -07:00
Horus
02e1f528bf fix: add workflow to check release version match with package.json (#2420) 2023-05-17 10:37:28 -07:00
Peng Xiao
c870104370 chore: bump blocksuite to 0.0.0-20230517102216-36bda4ab-nightly (#2411) 2023-05-17 10:09:29 -07:00
himself65
627d8ef787 v0.6.0-canary.3 2023-05-17 09:48:51 -07:00
LongYinan
5563823a7a build: missing build native step in nightly build (#2421) 2023-05-17 23:52:32 +08:00
JimmFly
d6804bb0fd chore: update prompt (#2410) 2023-05-17 17:52:57 +08:00
LongYinan
1350633690 build: fix electron release build process (#2408) 2023-05-17 17:22:49 +08:00
JimmFly
50196d8fde chore: update preloading page (#2409) 2023-05-17 09:16:07 +00:00
Peng Xiao
2e0ccb53ec feat: update button enhancements (#2401) 2023-05-17 16:58:14 +08:00
Whitewater
1498ee405b feat: add dropdown button (#2407) 2023-05-17 16:32:37 +08:00
Peng Xiao
cb863c4afa chore: disable image modal by default (#2400) 2023-05-16 23:14:31 -07:00
Himself65
2629d39501 fix: infinite reloading (#2405) 2023-05-17 13:58:34 +08:00
Himself65
38305cd984 fix: hydration error (#2404) 2023-05-17 05:23:55 +00:00
LongYinan
93116c24f2 feat(electron): use affine native (#2329) 2023-05-17 12:36:51 +08:00
Whitewater
017b9c8615 feat: add block card component (#2398) 2023-05-16 18:19:28 +08:00
Whitewater
9ce3a96862 fix: unexpected undefined class in popup (#2394) 2023-05-16 10:01:27 +00:00
Peng Xiao
a0ff520ba4 fix: some style updates (#2396) 2023-05-16 09:46:51 +00:00
Whitewater
a8b8986d89 chore: disable confused storybook backgrounds addon (#2395) 2023-05-16 17:46:35 +08:00
JimmFly
8ffc096fee fix: text overflows in the header option menu (#2393) 2023-05-16 17:35:57 +08:00
JimmFly
7e457f7b4c chore: add responsive styles for workspace card (#2390) 2023-05-16 16:51:46 +08:00
xiaodong zuo
aedf2d339e Update jobs.md
Added a job posting for a full-time or internship engineer.
2023-05-16 15:35:23 +08:00
JimmFly
ffd5ae52b3 feat: add Japanese support and update translation (#2388) 2023-05-16 14:21:51 +08:00
DiamondThree
3093194da8 docs: update jobs.md (#2389) 2023-05-15 22:24:27 -07:00
Horus
68b4f792f0 fix: app updater not working for internal release (#2377) 2023-05-15 20:34:54 -07:00
himself65
e2c6e4f9fc ci: use samver 2023-05-15 09:34:04 -07:00
Whitewater
9ff7dbffb7 feat: supports sort all page (#2356) 2023-05-15 08:50:43 -07:00
JimmFly
0c561da061 chore: remove favorite page (#2372) 2023-05-15 08:41:38 -07:00
JimmFly
06951319a6 chore: remove quick search tips (#2375) 2023-05-15 08:41:10 -07:00
JimmFly
0bfcab4067 chore: add animation for tour modal (#2365) 2023-05-15 16:48:52 +08:00
himself65
2c4db4fa16 v0.6.0-canary.2 2023-05-14 23:14:36 -07:00
Himself65
23b4f9ee12 feat(electron): track router history (#2336)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-05-14 23:13:30 -07:00
himself65
e5330b1917 build: add app bundle id for internal 2023-05-14 22:35:40 -07:00
Peng Xiao
183611a556 fix: some style updates (#2348) 2023-05-14 21:58:13 -07:00
Himself65
7786456ba4 chore: update blocksuite to 0.0.0-20230514141009-705c0fac-nightly (#2357) 2023-05-14 19:32:27 -07:00
Ikko Eltociear Ashimine
f4bf7e3ddf fix: typo in AFFiNE-Docs.md (#2355) 2023-05-13 22:37:42 -07:00
Doma
05d88215d1 feat(electron): app menu item and hotkey for creating new page (#2267)
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
2023-05-13 15:45:12 +00:00
Himself65
b240a70e51 chore: update blocksuite to 0.0.0-20230512192655-e61e272b-nightly (#2352) 2023-05-12 15:39:05 -05:00
LongYinan
00fd468e9b chore(server): remove bcrypt to avoid node-gyp usage (#2349) 2023-05-12 13:48:38 -05:00
Himself65
b5a7f8b7eb chore: bump version (#2331) 2023-05-12 13:47:14 -05:00
himself65
f03277fd17 v0.6.0-canary.1 2023-05-12 01:30:54 -05:00
himself65
ee93071149 chore: update icons 2023-05-12 01:06:05 -05:00
Himself65
21fdced2bd fix: correct router logic (#2342) 2023-05-12 00:55:45 -05:00
Peng Xiao
10b4558947 feat: new sidebar (app shell) styles (#2303) 2023-05-11 22:13:51 -05:00
Himself65
0fbed5d9d6 ci: collect test coverage on electron (#2335) 2023-05-11 20:51:13 -05:00
Himself65
8d117123d7 fix: remove useEffect on router sync with atoms (#2241) 2023-05-11 16:37:42 -05:00
Himself65
063ffda09d refactor: rename WorkspacePlugin to WorkspaceAdapter (#2330) 2023-05-11 12:43:39 -05:00
Himself65
39c83bd25b fix: delay setAom on rootWorkspacesMetadataAtom (#2271) 2023-05-11 15:03:11 +00:00
Peng Xiao
4444c3d1a6 fix: updater issue 2023-05-11 14:44:54 +08:00
LongYinan
717dd93f37 fix(electron): close db before move db file 2023-05-11 14:41:51 +08:00
LongYinan
c58673c55f chore(native): license 2023-05-11 14:41:51 +08:00
LongYinan
768e55072d ci: rust build config 2023-05-11 14:41:51 +08:00
LongYinan
8c84daec2b feat(native): NotifyEvent types 2023-05-11 14:41:51 +08:00
LongYinan
e54a5b6128 feat(native): provide FSWatcher 2023-05-11 14:41:51 +08:00
LongYinan
ee1e50f391 refactor(native): rename folder name 2023-05-11 14:41:51 +08:00
himself65
268636c440 v0.6.0-canary.0 2023-05-11 01:09:21 -05:00
Peng Xiao
06fa0cdb60 fix: should not show open folder if it is not moved (#2299) 2023-05-11 05:36:22 +00:00
Himself65
73dbb39009 feat(component): improve fallback skeleton (#2323) 2023-05-11 00:35:42 -05:00
JimmFly
47848cb5da fix: delete modal on confirm does not close (#2322) 2023-05-11 05:19:11 +00:00
JimmFly
eff6a03a51 chore: update AFFiNE Cloud prompt (#2321) 2023-05-11 00:18:12 -05:00
himself65
08f6a41ef4 ci: fix set version scripts 2023-05-10 23:00:36 -05:00
himself65
6d1345ffe5 build: replace version 2023-05-10 22:24:34 -05:00
Himself65
689f615b11 chore: bump version (#2310) 2023-05-10 21:43:14 -05:00
Himself65
f82ea5d9c4 build(electron): add internal release channel (#2309) 2023-05-10 21:42:56 -05:00
himself65
dc4979a80c fix(electron): remove unused code 2023-05-10 15:04:13 -05:00
JimmFly
1f48bc4301 refactor: tour modal (#2297) 2023-05-10 08:11:42 +00:00
himself65
beabd1e050 v0.5.4-canary.31 2023-05-10 00:56:04 -05:00
Himself65
19e20a6a20 fix(component): toast too many times when switch page mode (#2296) 2023-05-10 00:50:51 -05:00
Peng Xiao
e4f13ddae4 fix: try to fix updater not working (#2294)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-10 00:40:22 -05:00
Himself65
752d0545ca feat: enhance root div styles (#2295) 2023-05-10 00:39:51 -05:00
himself65
08341d3d6c ci: remove master branch build 2023-05-09 23:11:46 -05:00
himself65
ef665df330 ci: add nightly-build.yml 2023-05-09 23:04:24 -05:00
Himself65
b38017cd23 feat(component): add skeleton in page detail (#2292) 2023-05-09 22:38:30 -05:00
Peng Xiao
0c550a2827 fix: theme not being persisted issue (#2283) 2023-05-09 22:04:36 -05:00
Chi Zhang
87ffdad862 docs: update README.md (#2291) 2023-05-09 21:51:44 -05:00
himself65
c6e8024e16 ci: disable fall-test in desktop-test 2023-05-09 21:13:33 -05:00
himself65
4200b3c3e5 ci: build staging and release branches 2023-05-09 20:27:07 -05:00
Himself65
10976a9257 chore: bump version (#2287) 2023-05-09 15:40:36 -05:00
himself65
b81b5439ae v0.5.4-canary.30 2023-05-09 15:02:14 -05:00
Himself65
a84ca43ce2 fix(component): input style (#2285) 2023-05-09 15:01:29 -05:00
JimmFly
b978bb171a feat: add download tips banner (#2151) 2023-05-09 11:07:34 -05:00
JimmFly
b937c1b5f6 chore: replace lang icon (#2281) 2023-05-09 15:27:05 +00:00
himself65
3c97e01513 v0.5.4-canary.29 2023-05-09 02:30:43 -05:00
Peng Xiao
7c2574b1ca feat: create workspace from loading existing exported file (#2122)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-09 02:30:01 -05:00
himself65
5432aae85c v0.5.4-canary.28 2023-05-09 01:58:58 -05:00
Himself65
be41c99602 chore: bump version (#2279) 2023-05-09 01:35:49 -05:00
Himself65
c41718e80d feat(component): support image preview by double click (#2198) 2023-05-09 01:09:39 -05:00
Himself65
242e074ae6 feat: add suspense fallback for editor (#2278) 2023-05-08 23:57:36 -05:00
Himself65
793b689b81 fix(component): updated at in page meta (#2277) 2023-05-09 03:54:07 +00:00
Himself65
53db6a6e9d refactor(component): input component (#2275) 2023-05-09 02:39:39 +00:00
Fangdun Tsai
cba3293326 fix: width of cmd-item button on quick-search modal (#2273) 2023-05-08 21:13:11 -05:00
Fangdun Tsai
11d1d773ff fix: vertical alignment of item on share menu (#2274) 2023-05-08 21:12:19 -05:00
Fangdun Tsai
f071361347 fix: kebab-case warning for CSS properties in dev mode (#2276) 2023-05-08 21:03:32 -05:00
himself65
2c18fadb2d build: commit after the set version 2023-05-08 18:31:16 -05:00
Himself65
1e8c5a4482 fix(electron): self-update is pending (#2272) 2023-05-08 18:16:07 -05:00
Himself65
4f99ad2db4 feat: forced file naming format (#2270) 2023-05-08 17:37:07 -05:00
Himself65
95bc5cac49 refactor: remove sync storage (#2269) 2023-05-08 17:21:42 -05:00
himself65
3a6be4510b v0.5.4-canary.27 2023-05-08 16:33:44 -05:00
Horus
41d4af1dc1 feat: implement latest version updater for macos (#2214)
Co-authored-by: himself65 <himself65@outlook.com>
2023-05-08 13:21:15 -05:00
Doma
d1457075b3 feat(web): improve keyboard navigation in RootAppSidebar (#2256)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-08 09:57:14 -05:00
Fangdun Tsai
d040a7fb50 fix: background color on shortcuts header (#2264) 2023-05-08 09:53:53 -05:00
Himself65
f1c3d575ad fix: dispatch workspace change event (#2261) 2023-05-08 14:47:47 +08:00
Fangdun Tsai
a942add87a fix: width of new page button (#2258) 2023-05-08 01:06:00 -05:00
himself65
d408a8bbb1 v0.5.4-canary.26 2023-05-07 23:44:02 -05:00
Himself65
4298ff7c7c chore: bump version (#2255) 2023-05-07 23:43:33 -05:00
Himself65
c55bfcc1fc refactor: remove @toeverything/theme (#2254) 2023-05-08 03:41:29 +00:00
Himself65
d795fb6b37 chore: bump version (#2253) 2023-05-08 03:23:55 +00:00
JimmFly
29cbbf5c97 chore: add border for header when in edgeless page (#2239) 2023-05-06 19:00:04 -05:00
JimmFly
aaa4b4f0cb fix: wrong menu position (#2238) 2023-05-06 18:58:41 -05:00
himself65
10cd000822 v0.5.4-canary.25 2023-05-05 23:57:10 -05:00
Himself65
496225a92e chore: bump version (#2249) 2023-05-05 23:41:51 -05:00
JimmFly
1ef408c9ad chore: update the style of help island in edgeless mode (#2244) 2023-05-05 15:35:05 -05:00
JimmFly
8d8119b39b chore: update theme color (#2242) 2023-05-05 15:34:01 -05:00
JimmFly
80c1f9e546 chore: disable navigation path (#2243) 2023-05-05 15:33:36 -05:00
Whitewater
dbd3249ae5 chore: clean all page list (#2245) 2023-05-05 14:46:58 -05:00
himself65
fbbcb4bad9 v0.5.4-canary.24 2023-05-04 23:30:02 -05:00
himself65
33069c87d0 build(theme): generate css file 2023-05-04 23:29:32 -05:00
himself65
637b8203d3 v0.5.4-canary.23 2023-05-04 23:20:02 -05:00
阿良仔
92859bf8b9 perf: remove data-testid in production (#2228)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-05 04:18:54 +00:00
夏宇航
8a617f91e6 style: fix popover z-index (#2215) 2023-05-05 04:13:56 +00:00
Whitewater
84b36c1d35 refactor: clean all pages component (#2176)
Co-authored-by: himself65 <himself65@outlook.com>
2023-05-04 22:59:16 -05:00
三咲智子 Kevin Deng
2c49c774af feat(y-indexeddb): add connected (#2208)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-05 03:42:49 +00:00
JimmFly
de0b300aca chore: optimize onboarding component style (#2235) 2023-05-04 22:26:40 -05:00
Himself65
4a50fe584c fix(electron): system theme (#2237) 2023-05-05 03:22:53 +00:00
Himself65
f7d1d922fa fix: cleanup page id in time (#2236) 2023-05-04 22:22:11 -05:00
Himself65
1b12972afd fix(electron): theme sync (#2231) 2023-05-04 21:00:05 -05:00
himself65
33c48eed79 v0.5.4-canary.22 2023-05-04 18:50:20 -05:00
Himself65
9631c99f7b chore: bump version (#2229) 2023-05-04 18:49:08 -05:00
Himself65
097cce34b5 fix: reduce useState and useEffect (#2223) 2023-05-04 17:53:52 -05:00
三咲智子 Kevin Deng
52b9734a7b feat(y-indexeddb): cleanup (#2207)
Co-authored-by: himself65 <himself65@outlook.com>
2023-05-04 20:25:58 +00:00
JimmFly
6d7f06c1c3 feat: add onboarding for client (#2144)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-04 15:29:16 +08:00
Fangdun Tsai
238f69b4e7 fix(component): click area of the item (#2221)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-05-04 05:46:56 +00:00
Himself65
3d43e61087 feat(i18n): static type on i18n (#2225) 2023-05-04 05:35:09 +00:00
Himself65
66c3b09c67 fix(hooks): reduce unused assertExists (#2224) 2023-05-04 03:55:45 +00:00
Himself65
1e84ad1484 fix: reduce pageMeta instance (#2222) 2023-05-03 22:09:43 -05:00
himself65
b3a3911cea v0.5.4-canary.21 2023-05-03 18:58:22 -05:00
Himself65
86988bd6e8 fix: dock to blocksuite latest API (#2219) 2023-05-03 18:57:59 -05:00
Himself65
9096ac2960 refactor: workspace provider (#2218) 2023-05-03 18:16:22 -05:00
himself65
ec39c23fb7 fix(web): add meta description 2023-05-03 18:15:52 -05:00
himself65
b036fe8502 chore: add codecov.yml 2023-05-03 00:47:43 -05:00
himself65
71142a3f1d v0.5.4-canary.20 2023-05-03 00:29:58 -05:00
Himself65
aace740df5 fix: prohibit delete last workspace (#2212) 2023-05-03 04:31:04 +00:00
Horus
f42d656cfa feat: add mac release zip file and release info yml (#2185) 2023-05-03 12:13:40 +08:00
Himself65
88124994e1 chore: bump version (#2211) 2023-05-02 22:40:53 -05:00
Fangdun Tsai
5a881ec223 fix(electron): ignore .DS_Store on MacOS (#2203) 2023-05-03 03:00:09 +00:00
Himself65
12b61d34c3 chore: bump version (#2210) 2023-05-02 16:50:58 -05:00
三咲智子 Kevin Deng
4eff5f3c38 chore: upgrade jotai devtools (#2209) 2023-05-02 21:27:01 +00:00
Himself65
648fad65e0 chore: bump version (#2206) 2023-04-30 20:03:40 -05:00
himself65
a2844e54d2 chore(y-indexeddb): add types fields 2023-04-30 18:40:34 -05:00
Fangdun Tsai
850cfe1187 fix: theme button width (#2202) 2023-04-30 01:51:33 -05:00
himself65
9030767d16 v0.5.4-canary.19 2023-04-29 05:23:48 -05:00
LongYinan
a4e7d0d0c3 fix(electron): remove disableHardwareAcceleration (#2199) 2023-04-29 05:22:59 -05:00
himself65
99898b2260 v0.5.4-canary.18 2023-04-28 16:00:57 -05:00
Himself65
1031fbc7ec refactor: guide atoms (#2196) 2023-04-28 15:59:59 -05:00
Himself65
31cccafb40 fix: sidebar regression (#2195) 2023-04-28 15:02:47 -05:00
Himself65
73a7c01580 revert: resize in app sidebar (#2193) 2023-04-28 05:41:17 -05:00
Whitewater
f9b012cac9 feat: add breakpoints (#2191) 2023-04-28 05:21:14 -05:00
himself65
101cd18067 v0.5.4-canary.17 2023-04-28 04:31:29 -05:00
Himself65
2c466617de fix: remove shake in first render (#2190) 2023-04-28 04:31:01 -05:00
JimmFly
2ff5ef9d5d feat: move theme switch and language switch to editor option menu (#2025)
Co-authored-by: himself65 <himself65@outlook.com>
2023-04-28 04:28:51 -05:00
Himself65
903b6eaf30 revert: lastVersionAtom atom (#2188) 2023-04-28 08:53:23 +00:00
Himself65
fd4b664e4f chore: bump version (#2187) 2023-04-28 02:39:21 -05:00
himself65
51a4bdc5e4 fix: state in lastVersionAtom 2023-04-28 02:27:31 -05:00
Himself65
ee695bbcb9 fix: shadow theme (#2186) 2023-04-28 01:53:20 -05:00
Himself65
ef0521fa2a test(electron): theme check (#2182) 2023-04-28 06:40:44 +00:00
Himself65
73d5b2081a feat(electron): enable disable cloud alert (#2184) 2023-04-28 06:26:14 +00:00
Himself65
70fbbb39c1 chore: enable no-unused vars (#2181) 2023-04-28 00:41:06 -05:00
JimmFly
b6ca2aa063 chore: update menu placement (#2183) 2023-04-28 00:40:37 -05:00
himself65
b3c1434055 v0.5.4-canary.16 2023-04-28 00:37:43 -05:00
himself65
4599a9a601 fix: remove min width in the main container 2023-04-28 00:34:05 -05:00
himself65
549dddc65f v0.5.4-canary.15 2023-04-27 23:50:26 -05:00
himself65
9f8b38f9f3 fix(electron): drag window behavior in header 2023-04-27 23:18:00 -05:00
Himself65
3a5a66a5a3 feat: init auth service (#2180) 2023-04-27 22:49:44 -05:00
liuyi
b4bb57b2a5 feat(server): port resolvers to node server (#2026)
Co-authored-by: Himself65 <himself65@outlook.com>
2023-04-27 18:02:05 -05:00
Himself65
3df3498523 chore: bump version (#2178) 2023-04-27 17:59:54 -05:00
himself65
567092a1ff v0.5.4-canary.14 2023-04-27 16:54:12 -05:00
himself65
f3e1c1eb08 docs: update releases.md 2023-04-27 16:53:20 -05:00
himself65
a04cfe2b68 chore: update desktop icons 2023-04-27 16:52:21 -05:00
Himself65
c1a65b6b76 feat(component): init app sidebar (#2135) 2023-04-27 16:46:08 -05:00
JimmFly
f3cbe54625 chore: update menu background color (#2170) 2023-04-27 18:06:17 +00:00
JimmFly
dcf7e83eec chore: update shadow and color (#2171) 2023-04-27 12:57:25 -05:00
JimmFly
50006efb57 chore: update workspace setting button color (#2169) 2023-04-27 12:55:58 -05:00
Himself65
606f6652ac chore: bump version (#2162) 2023-04-27 00:23:34 -05:00
himself65
afff15c435 fix: background warning color syntax 2023-04-26 22:30:33 -05:00
himself65
f7b8797bb2 v0.5.4-canary.13 2023-04-26 19:33:41 -05:00
Whitewater
2b05a1254b chore: hide pinboard (#2149)
Co-authored-by: himself65 <himself65@outlook.com>
2023-04-26 19:31:01 -05:00
himself65
40e7074475 fix(component): remove css import from blocksuite 2023-04-26 02:29:34 -05:00
himself65
e1ad3e38b9 v0.5.4-canary.12 2023-04-26 01:55:32 -05:00
himself65
f03fdde770 chore(electron): update canary icons 2023-04-26 01:55:05 -05:00
Himself65
d2eba54550 chore: bump version (#2146) 2023-04-26 01:54:44 -05:00
himself65
fa7baaf5c1 docs: add the ecosystem section in README.md 2023-04-25 19:22:47 -05:00
himself65
a4d8b65eef v0.5.4-canary.11 2023-04-25 19:00:03 -05:00
himself65
83dafa149c build: add set-version.sh 2023-04-25 18:59:37 -05:00
himself65
3a25f13734 docs: download page redirect to affine.pro 2023-04-25 18:48:39 -05:00
Himself65
db52c63d25 feat: init @toeverything/theme (#2136) 2023-04-25 18:44:17 -05:00
himself65
80f4578f76 v0.5.4-canary.10 2023-04-25 11:44:23 -05:00
JimmFly
15a7e93058 fix: text overflow problem in <a> tag (#2126) 2023-04-25 11:40:14 -05:00
JimmFly
1c41731b4e fix: theme color (#2124) 2023-04-25 11:37:22 -05:00
Himself65
a807647639 fix(component): editor component style (#2120) 2023-04-25 01:58:30 -05:00
JimmFly
3f1293ca3c chore: add changeLog to storybook (#2118)
Co-authored-by: himself65 <himself65@outlook.com>
2023-04-25 06:24:46 +00:00
Himself65
ad58b4d1e9 feat: improve build config (#2115) 2023-04-24 22:33:09 -05:00
Himself65
7e61708850 test: move playwright test suite to top level (#2113) 2023-04-24 22:12:48 -05:00
LongYinan
5c673a8ffc feat(graphql): generate types from graphql files (#2014)
Co-authored-by: forehalo <forehalo@gmail.com>
Co-authored-by: Himself65 <himself65@outlook.com>
2023-04-25 10:13:52 +08:00
1111 changed files with 77577 additions and 26844 deletions

20
.codesandbox/task.json Normal file
View File

@@ -0,0 +1,20 @@
{
"$schema": "https://codesandbox.io/schemas/tasks.json",
"setupTasks": [
{
"name": "Install Dependencies",
"command": "yarn install"
}
],
"tasks": {
"start-web": {
"name": "Start Web",
"command": "yarn nx dev @affine/web --port 8080",
"runAtStart": true,
"preview": {
"port": 8080
}
}
}
}

View File

@@ -9,17 +9,20 @@
"server",
"web",
"docs",
"storybook",
"component",
"workspace",
"env",
"graphql",
"cli",
"hooks",
"i18n",
"jotai",
"octobase-node",
"native",
"templates",
"y-indexeddb",
"debug"
"debug",
"storage"
]
]
}

View File

@@ -5,3 +5,7 @@ out
storybook-static
affine-out
_next
lib
.eslintrc.js
packages/i18n/src/i18n-generated.ts
e2e-dist-*

View File

@@ -1,3 +1,56 @@
const { resolve } = require('node:path');
const createPattern = packageName => [
{
group: ['**/dist', '**/dist/**'],
message: 'Do not import from dist',
allowTypeImports: false,
},
{
group: ['**/src', '**/src/**'],
message: 'Do not import from src',
allowTypeImports: false,
},
{
group: [`@affine/${packageName}`],
message: 'Do not import package itself',
allowTypeImports: false,
},
{
group: [`@toeverything/${packageName}`],
message: 'Do not import package itself',
allowTypeImports: false,
},
{
group: ['@blocksuite/store'],
message: "Import from '@blocksuite/global/utils'",
importNames: ['assertExists', 'assertEquals'],
},
];
const allPackages = [
'packages/cli',
'packages/component',
'packages/debug',
'packages/env',
'packages/graphql',
'packages/hooks',
'packages/i18n',
'packages/jotai',
'packages/native',
'packages/plugin-infra',
'packages/templates',
'packages/theme',
'packages/workspace',
'packages/y-indexeddb',
'apps/web',
'apps/server',
'apps/electron',
'apps/storybook',
'plugins/copilot',
'plugins/bookmark-block',
];
/**
* @type {import('eslint').Linter.Config}
*/
@@ -17,6 +70,7 @@ const config = {
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:@typescript-eslint/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
@@ -27,29 +81,50 @@ const config = {
},
ecmaVersion: 'latest',
sourceType: 'module',
project: resolve(__dirname, './tsconfig.eslint.json'),
},
plugins: [
'react',
'@typescript-eslint',
'simple-import-sort',
'import',
'sonarjs',
'i',
'unused-imports',
'unicorn',
],
rules: {
'array-callback-return': 'error',
'no-undef': 'off',
'no-empty': 'off',
'no-func-assign': 'off',
'no-cond-assign': 'off',
'no-constant-binary-expression': 'error',
'no-constructor-return': 'error',
'react/prop-types': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'unused-imports/no-unused-imports': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': true,
'ts-nocheck': true,
'ts-check': false,
},
],
'@typescript-eslint/no-restricted-imports': [
'error',
{
@@ -64,9 +139,37 @@ const config = {
message: "Don't import from src",
allowTypeImports: false,
},
{
group: ['@blocksuite/store'],
message: "Import from '@blocksuite/global/utils'",
importNames: ['assertExists', 'assertEquals'],
},
],
},
],
'unicorn/filename-case': [
'error',
{
case: 'kebabCase',
ignore: ['^\\[[a-zA-Z0-9-_]+\\]\\.tsx$'],
},
],
'sonarjs/no-all-duplicated-branches': 'error',
'sonarjs/no-element-overwrite': 'error',
'sonarjs/no-empty-collection': 'error',
'sonarjs/no-extra-arguments': 'error',
'sonarjs/no-identical-conditions': 'error',
'sonarjs/no-identical-expressions': 'error',
'sonarjs/no-ignored-return': 'error',
'sonarjs/no-one-iteration-loop': 'error',
'sonarjs/no-use-of-empty-return-value': 'error',
'sonarjs/non-existent-operator': 'error',
'sonarjs/no-collapsible-if': 'error',
'sonarjs/no-same-line-conditional': 'error',
'sonarjs/no-duplicated-branches': 'error',
'sonarjs/no-collection-size-mischeck': 'error',
'sonarjs/no-useless-catch': 'error',
'sonarjs/no-identical-functions': 'error',
},
overrides: [
{
@@ -75,6 +178,58 @@ const config = {
'@typescript-eslint/consistent-type-imports': 0,
},
},
{
files: '*.cjs',
rules: {
'@typescript-eslint/no-var-requires': 0,
},
},
...allPackages.map(pkg => ({
files: [`${pkg}/src/**/*.ts`, `${pkg}/src/**/*.tsx`],
parserOptions: {
project: resolve(__dirname, './tsconfig.eslint.json'),
},
rules: {
'@typescript-eslint/no-restricted-imports': [
'error',
{
patterns: createPattern(pkg),
},
],
'@typescript-eslint/no-floating-promises': [
'error',
{
ignoreVoid: false,
ignoreIIFE: false,
},
],
},
})),
{
files: [
'**/__tests__/**/*',
'**/*.stories.tsx',
'**/*.spec.ts',
'**/tests/**/*',
'scripts/**/*',
'**/benchmark/**/*',
'**/__debug__/**/*',
'**/e2e/**/*',
],
rules: {
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': false,
'ts-ignore': true,
'ts-nocheck': true,
'ts-check': false,
},
],
'@typescript-eslint/no-floating-promises': 0,
},
},
],
};

4
.github/CLA.md vendored
View File

@@ -56,5 +56,7 @@ Example:
- Skye Sun, @skyesun, 2023/04/14
- Jordy Delgado, @Jdelgad8, 2023/04/17
- Howard Do, @howarddo2208, 2023/04/20
- Kevin Deng, @sxzz, 2023/04/21
- 三咲智子 Kevin Deng, @sxzz, 2023/04/21
- Moeyua, @moeyua, 2023/04/22
- Shishu, @shishudesu, 2023/05/19
- Kushagra Singh, @kush002, 2023/06/28

1
.github/CODEOWNERS vendored
View File

@@ -1 +0,0 @@
**/en.json @JimmFly

View File

@@ -18,22 +18,22 @@ body:
- type: dropdown
id: version
attributes:
label: Version
description: What version of our software are you running?
label: Distribution version
description: What version of AFFiNE are you using?
options:
- app.affine.pro
- stage.affine.pro
- dev.affine.live
- affine-preview.vercel.app
- macOS x64
- macOS ARM 64
- Windows x64
- Linux
- Web (app.affine.pro)
- Web (stage.affine.pro)
- Web (dev.affine.live)
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
label: What browsers are you seeing the problem on if you're using web version?
multiple: true
options:
- Chrome

60
.github/actions/build-rust/action.yml vendored Normal file
View File

@@ -0,0 +1,60 @@
name: 'AFFiNE Rust build'
description: 'Rust build setup, including cache configuration'
inputs:
target:
description: 'Cargo target'
required: true
nx_token:
description: 'Nx Cloud access token'
required: false
runs:
using: 'composite'
steps:
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ inputs.target }}
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
target/${{ inputs.target }}
key: stable-${{ inputs.target }}-cargo-cache
- name: Build
if: ${{ inputs.target != 'x86_64-unknown-linux-gnu' && inputs.target != 'aarch64-unknown-linux-gnu' }}
shell: bash
run: |
yarn nx build @affine/native --target ${{ inputs.target }}
env:
NX_CLOUD_ACCESS_TOKEN: ${{ inputs.nx_token }}
- name: Build
if: ${{ inputs.target == 'x86_64-unknown-linux-gnu' }}
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
options: --user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build -e NX_CLOUD_ACCESS_TOKEN=${{ inputs.nx_token }}
run: |
export CC=x86_64-unknown-linux-gnu-gcc
export CC_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-gcc
yarn nx build @affine/native --target ${{ inputs.target }}
chmod -R 777 node_modules/.cache
chmod -R 777 target
- name: Build
if: ${{ inputs.target == 'aarch64-unknown-linux-gnu' }}
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
options: --user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build -e NX_CLOUD_ACCESS_TOKEN=${{ inputs.nx_token }}
run: |
yarn nx build @affine/native --target ${{ inputs.target }}
chmod -R 777 node_modules/.cache
chmod -R 777 target

View File

@@ -13,10 +13,18 @@ inputs:
description: 'Run the install step for Playwright.'
required: false
default: 'false'
electron-install:
description: 'Download the Electron binary'
required: false
default: 'true'
npm-token:
description: 'The NPM token to use for private packages.'
required: false
default: ''
hard-link-nm:
description: 'set nmMode to hardlinks-local in .yarnrc.yml'
required: false
default: 'true'
runs:
using: 'composite'
@@ -29,33 +37,10 @@ runs:
scope: '@toeverything'
cache: 'yarn'
- name: Expose yarn config as "$GITHUB_OUTPUT"
id: yarn-config
- name: Set nmMode
if: ${{ inputs.hard-link-nm == 'true' }}
shell: bash
run: |
echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- name: Restore yarn cache
uses: actions/cache@v3
id: yarn-download-cache
with:
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
key: yarn-download-cache-${{ hashFiles('yarn.lock') }}
restore-keys: |
yarn-download-cache-
- name: Restore node_modules cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Restore yarn install state
id: yarn-install-state-cache
uses: actions/cache@v3
with:
path: .yarn/ci-cache/
key: ${{ runner.os }}-yarn-install-state-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }}
run: yarn config set nmMode hardlinks-local
- name: yarn install
if: ${{ inputs.package-install == 'true' }}
@@ -64,9 +49,9 @@ runs:
run: yarn install ${{ inputs.extra-flags }}
env:
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
YARN_ENABLE_GLOBAL_CACHE: 'false'
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz
HUSKY: '0'
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
- name: yarn install (try again)
if: ${{ steps.install.outcome == 'failure' }}
@@ -74,15 +59,15 @@ runs:
run: yarn install ${{ inputs.extra-flags }}
env:
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
YARN_ENABLE_GLOBAL_CACHE: 'false'
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz
HUSKY: '0'
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
- name: Get installed Playwright version
id: playwright-version
if: ${{ inputs.playwright-install == 'true' }}
shell: bash
run: echo "version=$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://')" >> $GITHUB_OUTPUT
run: echo "version=$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://' | head -n 1)" >> $GITHUB_OUTPUT
# Attempt to restore the correct Playwright browser binaries based on the
# currently installed version of Playwright (The browser binary versions
@@ -113,3 +98,30 @@ runs:
shell: bash
if: inputs.playwright-install == 'true' && steps.playwright-cache.outputs.cache-hit != 'true'
run: yarn playwright install --with-deps
- name: Get installed Electron version
id: electron-version
if: ${{ inputs.electron-install == 'true' }}
shell: bash
run: |
echo "version=$(yarn why --json electron | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://' | head -n 1)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: electron-cache
if: ${{ inputs.electron-install == 'true' }}
with:
path: 'node_modules/.cache/electron'
key: '${{ runner.os }}-electron-${{ steps.electron-version.outputs.version }}'
restore-keys: |
${{ runner.os }}-electron-
- name: Install Electron binary
shell: bash
if: inputs.electron-install == 'true'
run: node apps/electron/node_modules/electron/install.js
env:
ELECTRON_OVERRIDE_DIST_PATH: ./node_modules/.cache/electron
- name: Build Infra
shell: bash
run: yarn run build:infra

31
.github/actions/setup-rust/action.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: 'AFFiNE Rust setup'
description: 'Rust setup, including cache configuration'
inputs:
target:
description: 'Cargo target'
required: true
toolchain:
description: 'Rustup toolchain'
required: false
default: 'stable'
runs:
using: 'composite'
steps:
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ inputs.toolchain }}
targets: ${{ inputs.target }}
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: cargo-cache-${{ runner.os }}-${{ inputs.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-cache-${{ runner.os }}-${{ inputs.toolchain }}-

View File

@@ -1,40 +0,0 @@
:80 {
root /* ./dist
file_server {
# precompressed br
}
encode {
zstd
gzip 9
}
header {
# 7 days
Cache-Control "public, max-age=86400, must-revalidate"
}
handle /api/* {
reverse_proxy {$API_SERVER} {
health_uri /api/healthz
@error status 500 502 503 503
handle_response @error {
root * /dist
rewrite * /50x.html
file_server
}
}
}
@notStatic {
not path /_next/static/*
}
handle @notStatic {
header {
Cache-Control "no-cache, no-store, must-revalidate"
}
try_files {path} /index.html
}
}

View File

@@ -1,13 +0,0 @@
FROM node:16-alpine as relocate
WORKDIR /app
COPY ./apps/web/out ./dist
COPY ./.github/deployment/Caddyfile ./Caddyfile
FROM caddy:2.6.2-alpine
ARG API_SERVER
WORKDIR /app
COPY --from=relocate /app .
EXPOSE 80
ENV API_SERVER=$API_SERVER
CMD ["caddy", "run"]

11
.github/deployment/front/Dockerfile vendored Normal file
View File

@@ -0,0 +1,11 @@
FROM openresty/openresty:1.21.4.1-0-buster
WORKDIR /app
COPY ./apps/web/out ./dist
COPY ./.github/deployment/front/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
COPY ./.github/deployment/front/affine.nginx.conf /etc/nginx/conf.d/affine.nginx.conf
RUN mkdir -p /var/log/nginx && \
rm /etc/nginx/conf.d/default.conf
EXPOSE 8080
CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]

View File

@@ -0,0 +1,13 @@
server {
listen 8080;
root /app/dist;
location / {
try_files $uri $uri/index.html $uri.html =404;
}
error_page 404 /404.html;
location = /404.html {
internal;
}
}

14
.github/deployment/front/nginx.conf vendored Normal file
View File

@@ -0,0 +1,14 @@
worker_processes 4;
error_log /var/log/nginx/error.log warn;
pcre_jit on;
events {
worker_connections 1024;
}
http {
include mime.types;
log_format main '$remote_addr [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
include /etc/nginx/conf.d/*.conf;
}

10
.github/deployment/node/Dockerfile vendored Normal file
View File

@@ -0,0 +1,10 @@
FROM node:18-bookworm-slim
COPY ./apps/server /app
WORKDIR /app
RUN apt-get update && \
apt-get install -y --no-install-recommends openssl && \
rm -rf /var/lib/apt/lists/*
CMD ["node", "--es-module-specifier-resolution=node", "./dist/index.js"]

1
.github/helm/affine-cloud/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
charts/

23
.github/helm/affine-cloud/.helmignore vendored Normal file
View File

@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

6
.github/helm/affine-cloud/Chart.lock vendored Normal file
View File

@@ -0,0 +1,6 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 12.5.8
digest: sha256:c91c0dc1370e879538dc9d6e435e731a726ef99d6a3b081372318483792b48a7
generated: "2023-06-27T18:34:12.683806+08:00"

12
.github/helm/affine-cloud/Chart.yaml vendored Normal file
View File

@@ -0,0 +1,12 @@
apiVersion: v2
name: affine-cloud
description: A Helm chart for AFFiNE Cloud
type: application
version: 0.6.1
appVersion: '0.6.1'
dependencies:
- name: postgresql
version: 12.5.8
repository: https://charts.bitnami.com/bitnami

30
.github/helm/affine-cloud/readme.md vendored Normal file
View File

@@ -0,0 +1,30 @@
# Helm Chart Configuration
The following table lists the configurable parameters of this Helm chart and their default values.
## AFFiNE Cloud Server parameters
| Parameter | Description | Default |
| ------------------------------ | -------------------------------------------------- | ------------------ |
| `affineCloud.tag` | The Docker tag of the AffineCloud image to be used | `'nightly-latest'` |
| `affineCloud.resources.cpu` | The CPU resources allocated for AffineCloud | `'250m'` |
| `affineCloud.resources.memory` | The memory resources allocated for AffineCloud | `'0.5Gi'` |
| `affineCloud.signKey` | The key used to sign the JWT tokens | `'c2VjcmV0'` |
| `affineCloud.service.type` | The type of the Kubernetes service | `'ClusterIP'` |
| `affineCloud.service.port` | The port of the Kubernetes service | `'http'` |
| `affineCloud.mail.account` | The email account used to send emails | `''` |
| `affineCloud.mail.password` | The password of the email account | `''` |
## PostgreSQL parameters
| Parameter | Description | Default |
| -------------------------------------------- | ------------------------------------------------------------------------------------- | ------------ |
| `postgresql.auth.username` | Username for the PostgreSQL database | `'affine'` |
| `postgresql.auth.password` | Password for the PostgreSQL database. Please change this for production environments. | `'password'` |
| `postgresql.auth.database` | The name of the default database that will be created on image startup | `'affine'` |
| `postgresql.primary.resources.limits.cpu` | The CPU resources allocated for the PostgreSQL primary node | `'500m'` |
| `postgresql.primary.resources.limits.memory` | The memory resources allocated for the PostgreSQL primary node | `'0.5Gi'` |
For more postgres parameters, please refer to: https://artifacthub.io/packages/helm/bitnami/postgresql
Please note that for the `postgresql.auth.password`, you should provide your own password for production environments. The default value is provided only for demonstration purposes.

View File

@@ -0,0 +1,51 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "affine-cloud.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "affine-cloud.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "affine-cloud.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "affine-cloud.labels" -}}
helm.sh/chart: {{ include "affine-cloud.chart" . }}
{{ include "affine-cloud.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "affine-cloud.selectorLabels" -}}
app.kubernetes.io/name: {{ include "affine-cloud.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

View File

@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ include "affine-cloud.fullname" . }}"
labels:
{{- include "affine-cloud.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "affine-cloud.selectorLabels" . | nindent 6 }}
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 2
template:
metadata:
labels:
{{- include "affine-cloud.selectorLabels" . | nindent 8 }}
spec:
restartPolicy: Always
containers:
- name: affine-cloud
image: "ghcr.io/toeverything/cloud-self-hosted:{{ .Values.affineCloud.tag | default .Chart.AppVersion }}"
env:
- name: PG_USER
value: "{{ .Values.postgresql.auth.username }}"
- name: PG_PASS
value: "{{ .Values.postgresql.auth.password }}"
- name: PG_DATABASE
value: "{{ .Values.postgresql.auth.database }}"
- name: PG_HOST
value: "{{ .Values.postgresql.fullnameOverride | default (printf "%s-postgresql" .Release.Name) }}"
- name: DATABASE_URL
value: "{{ .Values.affineCloud.databaseUrl | default "postgresql://$(PG_USER):$(PG_PASS)@$(PG_HOST)/$(PG_DATABASE)" }}"
envFrom:
- secretRef:
name: affine-cloud-secret
ports:
- containerPort: 3000
livenessProbe:
httpGet:
path: /api/healthz
port: 3000
failureThreshold: 1
initialDelaySeconds: 10
periodSeconds: 10
resources:
limits:
cpu: "{{ .Values.affineCloud.resources.cpu }}"
memory: "{{ .Values.affineCloud.resources.memory }}"

View File

@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: affine-cloud-secret
type: Opaque
data:
SIGN_KEY: "{{ .Values.affineCloud.signKey }}"
MAIL_ACCOUNT: "{{ .Values.affineCloud.mail.account }}"
MAIL_PASSWORD: "{{ .Values.affineCloud.mail.password }}"

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ include "affine-cloud.fullname" . }}"
labels:
{{- include "affine-cloud.labels" . | nindent 4 }}
spec:
type: "{{ .Values.affineCloud.service.type }}"
ports:
- name: http
protocol: TCP
port: {{ .Values.affineCloud.service.port }}
targetPort: 3000
selector:
{{- include "affine-cloud.selectorLabels" . | nindent 4 }}

30
.github/helm/affine-cloud/values.yaml vendored Normal file
View File

@@ -0,0 +1,30 @@
affineCloud:
tag: 'canary-5e0d5e0cc65ea46f326fdde12658bfac59b38c9f-0949'
# databaseUrl: 'postgresql://affine:password@affine-cloud-postgresql:5432/affine'
signKey: TUFtdFdzQTJhdGJuem01TA==
mail:
account: ''
password: ''
service:
type: ClusterIP
port: 80
resources:
cpu: '250m'
memory: 0.5Gi
postgresql:
fullnameOverride: tcp-postgresql
auth:
# only for demo, please modify it at prod env
username: affine
password: password
database: affine
primary:
initdb:
scripts:
01-init.sql: |
CREATE DATABASE affine_binary;
GRANT ALL PRIVILEGES ON DATABASE affine_binary TO affine;
resources:
limits:
cpu: '500m'
memory: 0.5Gi

23
.github/helm/affine/.helmignore vendored Normal file
View File

@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

6
.github/helm/affine/Chart.yaml vendored Normal file
View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: affine
description: AFFiNE cloud chart
type: application
version: 0.0.0
appVersion: '0.7.0-canary.18'

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: graphql
description: AFFiNE GraphQL server
type: application
version: 0.0.0
appVersion: '0.7.0-canary.18'

View File

@@ -0,0 +1,16 @@
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "graphql.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "graphql.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "graphql.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "graphql.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}

View File

@@ -0,0 +1,132 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "graphql.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "graphql.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "graphql.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "graphql.labels" -}}
helm.sh/chart: {{ include "graphql.chart" . }}
{{ include "graphql.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "graphql.selectorLabels" -}}
app.kubernetes.io/name: {{ include "graphql.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "graphql.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "graphql.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{- define "jwt.key" -}}
{{- $secret := lookup "v1" "Secret" .Release.Namespace .Values.app.jwt.secretName -}}
{{- if and $secret $secret.data.private -}}
{{/*
Reusing existing secret data
*/}}
key: {{ $secret.data.private }}
{{- else -}}
{{/*
Generate new data
*/}}
key: {{ genPrivateKey "ecdsa" | b64enc }}
{{- end -}}
{{- end -}}
{{- define "objectStorage.r2" -}}
{{- $secret := lookup "v1" "Secret" .Release.Namespace .Values.app.objectStorage.r2.secretName -}}
{{- if $secret -}}
{{/*
Reusing existing secret data
*/}}
accountId: {{ $secret.data.accountId }}
accessKeyId: {{ $secret.data.accessKeyId }}
secretAccessKey: {{ $secret.data.secretAccessKey }}
bucket: {{ $secret.data.bucket }}
{{- else -}}
{{/*
Generate new data
*/}}
accountId: {{ .Values.app.objectStorage.r2.accountId | b64enc }}
accessKeyId: {{ .Values.app.objectStorage.r2.accessKeyId | b64enc }}
secretAccessKey: {{ .Values.app.objectStorage.r2.secretAccessKey | b64enc }}
bucket: {{ .Values.app.objectStorage.r2.bucket | b64enc }}
{{- end -}}
{{- end -}}
{{- define "objectStorage.oauth.google" -}}
{{- $secret := lookup "v1" "Secret" .Release.Namespace .Values.app.oauth.google.secretName -}}
{{- if $secret -}}
{{/*
Reusing existing secret data
*/}}
clientId: {{ $secret.data.clientId }}
clientSecret: {{ $secret.data.clientSecret }}
{{- else -}}
{{/*
Generate new data
*/}}
clientId: "{{ .Values.app.oauth.google.clientId | b64enc }}"
clientSecret: "{{ .Values.app.oauth.google.clientSecret | b64enc }}"
{{- end -}}
{{- end -}}
{{- define "objectStorage.oauth.github" -}}
{{- $secret := lookup "v1" "Secret" .Release.Namespace .Values.app.oauth.github.secretName -}}
{{- if $secret -}}
{{/*
Reusing existing secret data
*/}}
clientId: {{ $secret.data.clientId }}
clientSecret: {{ $secret.data.clientSecret }}
{{- else -}}
{{/*
Generate new data
*/}}
clientId: "{{ .Values.app.oauth.github.clientId | b64enc }}"
clientSecret: "{{ .Values.app.oauth.github.clientSecret | b64enc }}"
{{- end -}}
{{- end -}}

View File

@@ -0,0 +1,126 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "graphql.fullname" . }}
labels:
{{- include "graphql.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "graphql.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "graphql.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "graphql.serviceAccountName" . }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: AUTH_PRIVATE_KEY
valueFrom:
secretKeyRef:
name: "{{ .Values.app.jwt.secretName }}"
key: key
- name: NODE_ENV
value: "{{ .Values.env }}"
- name: DATABSE_PASSWORD
valueFrom:
secretKeyRef:
name: pg-postgresql
key: postgres-password
- name: DATABASE_URL
value: postgres://{{ .Values.database.user }}:$(DATABSE_PASSWORD)@{{ .Values.database.url }}:{{ .Values.database.port }}/{{ .Values.database.name }}
- name: AFFINE_SERVER_PORT
value: "{{ .Values.service.port }}"
- name: AFFINE_SERVER_SUB_PATH
value: "{{ .Values.app.path }}"
- name: AFFINE_SERVER_HOST
value: "{{ .Values.app.host }}"
- name: ENABLE_R2_OBJECT_STORAGE
value: "{{ .Values.app.objectStorage.r2.enabled }}"
{{ if .Values.app.objectStorage.r2.enabled }}
- name: R2_OBJECT_STORAGE_ACCOUNT_ID
valueFrom:
secretKeyRef:
name: "{{ .Values.app.objectStorage.r2.secretName }}"
key: accountId
- name: R2_OBJECT_STORAGE_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: "{{ .Values.app.objectStorage.r2.secretName }}"
key: accessKeyId
- name: R2_OBJECT_STORAGE_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: "{{ .Values.app.objectStorage.r2.secretName }}"
key: secretAccessKey
- name: R2_OBJECT_STORAGE_BUCKET
valueFrom:
secretKeyRef:
name: "{{ .Values.app.objectStorage.r2.secretName }}"
key: bucket
{{ end }}
{{ if .Values.app.oauth.google.enabled }}
- name: OAUTH_GOOGLE_CLIENT_ID
valueFrom:
secretKeyRef:
name: "{{ .Values.app.oauth.google.secretName }}"
key: clientId
- name: OAUTH_GOOGLE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: "{{ .Values.app.oauth.google.secretName }}"
key: clientSecret
{{ end }}
{{ if .Values.app.oauth.github.enabled }}
- name: OAUTH_GITHUB_CLIENT_ID
valueFrom:
secretKeyRef:
name: "{{ .Values.app.oauth.github.secretName }}"
key: clientId
- name: OAUTH_GITHUB_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: "{{ .Values.app.oauth.github.secretName }}"
key: clientSecret
{{ end }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: {{ .Values.probe.initialDelaySeconds }}
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: {{ .Values.probe.initialDelaySeconds }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: "{{ .Values.app.jwt.secretName }}"
type: Opaque
data:
{{- ( include "jwt.key" . ) | indent 2 -}}

View File

@@ -0,0 +1,34 @@
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "graphql.fullname" . }}-database-migration
labels:
{{- include "graphql.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": pre-install,pre-upgrade
"helm.sh/hook-weight": "-1"
"helm.sh/hook-delete-policy": before-hook-creation
spec:
template:
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command: ["yarn", "prisma", "migrate", "deploy"]
env:
- name: NODE_ENV
value: "{{ .Values.env }}"
- name: DATABSE_PASSWORD
valueFrom:
secretKeyRef:
name: pg-postgresql
key: postgres-password
- name: DATABASE_URL
value: postgres://{{ .Values.database.user }}:$(DATABSE_PASSWORD)@{{ .Values.database.url }}:{{ .Values.database.port }}/{{ .Values.database.name }}
resources:
requests:
cpu: '100m'
memory: '200Mi'
restartPolicy: Never
backoffLimit: 1

View File

@@ -0,0 +1,10 @@
{{- if .Values.app.oauth.github.enabled -}}
apiVersion: v1
kind: Secret
metadata:
name: "{{ .Values.app.oauth.github.secretName }}"
type: Opaque
data:
{{- ( include "objectStorage.oauth.github" . ) | indent 2 -}}
{{- end }}

View File

@@ -0,0 +1,10 @@
{{- if .Values.app.oauth.google.enabled -}}
apiVersion: v1
kind: Secret
metadata:
name: "{{ .Values.app.oauth.google.secretName }}"
type: Opaque
data:
{{- ( include "objectStorage.oauth.google" . ) | indent 2 -}}
{{- end }}

View File

@@ -0,0 +1,9 @@
{{- if .Values.app.objectStorage.r2.enabled -}}
apiVersion: v1
kind: Secret
metadata:
name: "{{ .Values.app.objectStorage.r2.secretName }}"
type: Opaque
data:
{{- ( include "objectStorage.r2" . ) | indent 2 -}}
{{- end }}

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "graphql.fullname" . }}
labels:
{{- include "graphql.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "graphql.selectorLabels" . | nindent 4 }}

View File

@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "graphql.serviceAccountName" . }}
labels:
{{- include "graphql.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "graphql.fullname" . }}-test-connection"
labels:
{{- include "graphql.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "graphql.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never

View File

@@ -0,0 +1,69 @@
replicaCount: 1
image:
repository: ghcr.io/toeverything/affine-graphql
pullPolicy: IfNotPresent
tag: ''
imagePullSecrets: []
nameOverride: ''
fullnameOverride: ''
# map to NODE_ENV environment variable
env: 'production'
database:
user: 'postgres'
url: 'pg-postgresql'
port: '5432'
name: 'affine'
app:
# AFFINE_SERVER_SUB_PATH
path: ''
# AFFINE_SERVER_HOST
host: '0.0.0.0'
jwt:
secretName: jwt-private-key
# base64 encoded ecdsa private key
privateKey: ''
objectStorage:
r2:
enabled: false
secretName: r2
accountId: ''
accessKeyId: ''
secretAccessKey: ''
bucket: ''
oauth:
google:
enabled: false
secretName: oauth-google
clientId: ''
clientSecret: ''
github:
enabled: false
secretName: oauth-github
clientId: ''
clientSecret: ''
serviceAccount:
create: true
annotations: {}
name: 'affine-graphql'
podAnnotations: {}
podSecurityContext:
fsGroup: 2000
resources:
limits:
cpu: '2000m'
memory: 4Gi
requests:
cpu: '1000m'
memory: 2Gi
probe:
initialDelaySeconds: 20
nodeSelector: {}
tolerations: []
affinity: {}

View File

@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@@ -0,0 +1,6 @@
apiVersion: v2
name: web
description: A Helm chart for Kubernetes
type: application
version: 0.0.0
appVersion: "0.7.0-canary.18"

View File

@@ -0,0 +1,16 @@
1. Get the application URL by running these commands:
{{- if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "web.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "web.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "web.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "web.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}

View File

@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "web.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "web.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "web.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "web.labels" -}}
helm.sh/chart: {{ include "web.chart" . }}
{{ include "web.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "web.selectorLabels" -}}
app.kubernetes.io/name: {{ include "web.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "web.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "web.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,57 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "web.fullname" . }}
labels:
{{- include "web.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "web.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "web.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "web.serviceAccountName" . }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: {{ .Values.probe.initialDelaySeconds }}
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: {{ .Values.probe.initialDelaySeconds }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "web.fullname" . }}
labels:
{{- include "web.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "web.selectorLabels" . | nindent 4 }}

View File

@@ -0,0 +1,12 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "web.serviceAccountName" . }}
labels:
{{- include "web.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "web.fullname" . }}-test-connection"
labels:
{{- include "web.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "web.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never

View File

@@ -0,0 +1,37 @@
replicaCount: 1
image:
repository: ghcr.io/toeverything/affine-front
pullPolicy: IfNotPresent
tag: ""
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
create: true
annotations: {}
name: "affine-web"
podAnnotations: {}
podSecurityContext:
fsGroup: 2000
resources:
limits:
cpu: '500m'
memory: 2Gi
requests:
cpu: '500m'
memory: 2Gi
nodeSelector: {}
tolerations: []
affinity: {}
probe:
initialDelaySeconds: 1

View File

@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "affine.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "affine.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "affine.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "affine.labels" -}}
helm.sh/chart: {{ include "affine.chart" . }}
{{ include "affine.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "affine.selectorLabels" -}}
app.kubernetes.io/name: {{ include "affine.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "affine.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "affine.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,64 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "affine.fullname" . -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "affine.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: "{{ .Values.ingress.host }}"
http:
paths:
- path: /graphql
pathType: Prefix
backend:
service:
name: affine-graphql
port:
number: {{ .Values.graphql.service.port }}
- path: /api
pathType: Prefix
backend:
service:
name: affine-graphql
port:
number: {{ .Values.graphql.service.port }}
- path: /
pathType: Prefix
backend:
service:
name: affine-web
port:
number: {{ .Values.web.service.port }}
{{- end }}

17
.github/helm/affine/values.yaml vendored Normal file
View File

@@ -0,0 +1,17 @@
ingress:
enabled: false
className: ''
annotations:
kubernetes.io/ingress.class: nginx
host: affine.pro
tls: []
graphql:
service:
type: ClusterIP
port: 3000
web:
service:
type: ClusterIP
port: 8080

60
.github/helm/deployment_guide.md vendored Normal file
View File

@@ -0,0 +1,60 @@
# Cluster Deployment Guide
This document provides a step-by-step guide for developers on how to deploy services in a Kubernetes cluster. The following content assumes that the reader already has a basic understanding of Kubernetes concepts and operations.
### 1. Configure Service Mesh (Optional)
In the Kubernetes cluster, we optionally use Service Mesh (like Istio and Anthos Service Mesh) to manage the network interactions of microservices. If Service Mesh is already deployed on your cluster or do not need to use the service network, you can skip this step. In this step, we assume that you are using Google Kubernetes Engine (GKE) and have already installed Anthos Service Mesh on your cluster, if you wish to use another Ingress Controller, please refer to the relevant documentation.
To configure your kubectl context to interact with your Kubernetes cluster using the gcloud tool, you need to execute the following commands:
```sh
export CLUSTER_NAME=your_cluster_name
export REGION=your_cluster_region
export PROJECT=your_project_id
gcloud container clusters get-credentials $CLUSTER_NAME --region $REGION --project $PROJECT
```
In this command, you should replace `CLUSTER_NAME`, `REGION` and `PROJECT` with the actual name, region and project id of your Kubernetes cluster. This command retrieves the access credentials for your Kubernetes cluster and automatically configures kubectl to use these credentials.
Now, to inject Service Mesh for a specific Namespace, first, set the environment variable `NAMESPACE` that should correspond to your target Kubernetes Namespace. In this example, we use `prod` as the target Namespace:
```sh
export NAMESPACE=prod
```
Then, we label the Namespace which will enable Istio to automatically inject the sidecar container for all new Pods under this Namespace:
```sh
kubectl label namespace $NAMESPACE istio-injection- istio.io/rev=asm-managed --overwrite
```
Finally, we trigger the Kubernetes Deployment restart mechanism to allow existing Pods to also obtain sidecar container injection:
```sh
kubectl rollout restart deployment -n $NAMESPACE
```
### 2. Deploying the Application
Next, we will deploy our application in the Kubernetes cluster through Helm. First, set relevant environment variables:
```sh
export NAMESPACE=prod
export RELEASE=affine-cloud-prod
export PATH=.github/helm/affine-cloud
```
- `NAMESPACE` should be consistent with the first step, indicating your target Kubernetes Namespace.
- `RELEASE` is the name of your Helm release.
- `PATH` is the location of your Helm chart in your file system.
Finally, use the `helm upgrade --install` command to deploy or upgrade your application:
```sh
helm upgrade --namespace $NAMESPACE --create-namespace --install $RELEASE $PATH
```
This command creates (if it doesn't already exist) and deploys your Helm chart in the specified Namespace. If the release already exists, it will be upgraded.
The above are the complete steps for deploying an application in a Kubernetes cluster. Make sure all prerequisites are met before deploying, and also ensure that you have the correct permissions for operations in Kubernetes.

2
.github/helm/releaser.yaml vendored Normal file
View File

@@ -0,0 +1,2 @@
owner: toeverything
git-repo: helm-charts

18
.github/labeler.yml vendored
View File

@@ -13,6 +13,18 @@ mod:dev:
- 'packages/cli/**/*'
- 'packages/debug/**/*'
mod:plugin:
- 'plugins/**/*'
plugin:bookmark-block:
- 'plugins/bookmark-block/**/*'
plugin:copilot:
- 'plugins/copilot/**/*'
mod:plugin-infra:
- 'packages/plugin-infra/**/*'
mod:workspace: 'packages/workspace/**/*'
mod:i18n: 'packages/i18n/**/*'
@@ -23,6 +35,10 @@ mod:hooks: 'packages/hooks/**/*'
mod:component: 'packages/component/**/*'
mod:storage: 'packages/storage/**/*'
mod:native: 'packages/native/**/*'
mod:store:
- 'packages/jotai/**/*'
- '**/atoms/**/*'
@@ -42,3 +58,5 @@ app:web: 'apps/web/**/*'
app:electron: 'apps/electron/**/*'
app:server: 'apps/server/**/*'
app:docs: 'apps/docs/**/*'

View File

@@ -1,24 +0,0 @@
name: Add to GitHub projects
on:
issues:
types:
- opened
pull_request_target:
types:
- opened
- reopened
jobs:
add-to-project:
name: Add issues and pull requests
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.4.0
with:
# You can target a repository in a different organization
# to the issue
project-url: https://github.com/orgs/toeverything/projects/10
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
# labeled: bug, needs-triage
# label-operator: OR

View File

@@ -4,9 +4,34 @@ on:
push:
branches:
- master
- v[0-9]+.[0-9]+.x-staging
- v[0-9]+.[0-9]+.x
paths-ignore:
- README.md
- .github/**
- '!.github/workflows/build.yml'
- '!.github/actions/build-rust/action.yml'
- '!.github/actions/setup-node/action.yml'
pull_request:
merge_group:
branches:
- master
- v[0-9]+.[0-9]+.x-staging
- v[0-9]+.[0-9]+.x
paths-ignore:
- README.md
- .github/**
- '!.github/workflows/build.yml'
- '!.github/actions/build-rust/action.yml'
- '!.github/actions/setup-node/action.yml'
env:
DEBUG: napi:*
BUILD_TYPE: canary
APP_NAME: affine
COVERAGE: true
MACOSX_DEPLOYMENT_TARGET: '10.13'
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
jobs:
lint:
@@ -18,7 +43,42 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- run: yarn lint --max-warnings=0
with:
electron-install: false
- name: Run i18n codegen
run: yarn i18n-codegen gen
- name: Run Type Check
run: yarn typecheck
- name: Run ESLint
run: yarn lint:eslint --max-warnings=0
- name: Run Prettier
# Set nmMode in `actions/setup-node` will modify the .yarnrc.yml
run: |
git checkout .yarnrc.yml
yarn lint:prettier
- name: Run circular
run: yarn circular
- name: Upload server dist
uses: actions/upload-artifact@v3
with:
name: server-dist
path: ./apps/server/dist
if-no-files-found: error
build-docs:
name: Build Docs
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
electron-install: false
- run: yarn nx build @affine/docs
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
build-storybook:
name: Build Storybook
@@ -29,32 +89,19 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- run: yarn build:storybook
with:
electron-install: false
- run: yarn nx build @affine/storybook
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Upload storybook artifact
uses: actions/upload-artifact@v3
with:
name: storybook
path: ./packages/component/storybook-static
path: ./apps/storybook/storybook-static
if-no-files-found: error
build-electron:
name: Build @affine/electron
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build Electron
working-directory: apps/electron
run: yarn exec ts-node-esm ./scripts/build-ci.mts
- name: Upload Ubuntu desktop artifact
uses: actions/upload-artifact@v3
with:
name: affine-ubuntu
path: ./apps/electron/dist
build:
build-web:
name: Build @affine/web
runs-on: ubuntu-latest
environment: development
@@ -63,33 +110,13 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Cache Next.js
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/apps/web/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
- name: Build
run: yarn build
env:
NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}
NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }}
NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}
API_SERVER_PROFILE: local
ENABLE_DEBUG_PAGE: true
COVERAGE: true
- name: Build Web
run: yarn nx build @affine/web
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: next-js
path: ./apps/web/.next
name: next-js-static
path: ./apps/web/out
if-no-files-found: error
server-test:
@@ -131,11 +158,24 @@ jobs:
working-directory: apps/server
env:
DATABASE_URL: postgresql://affine:affine@localhost:5432/affine
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
target: 'x86_64-unknown-linux-gnu'
- name: Build Storage
run: yarn build:storage
- name: Run server tests
run: yarn test:coverage
working-directory: apps/server
env:
CARGO_TARGET_DIR: '${{ github.workspace }}/target'
DATABASE_URL: postgresql://affine:affine@localhost:5432/affine
- name: Upload storage.node
uses: actions/upload-artifact@v3
with:
name: storage.node
path: ./packages/storage/storage.node
if-no-files-found: error
- name: Upload server test coverage results
uses: codecov/codecov-action@v3
with:
@@ -143,7 +183,7 @@ jobs:
files: ./apps/server/.coverage/lcov.info
flags: server-test
name: affine
fail_ci_if_error: true
fail_ci_if_error: false
storybook-test:
name: Storybook Test
@@ -156,23 +196,16 @@ jobs:
uses: ./.github/actions/setup-node
with:
playwright-install: true
electron-install: false
- name: Download storybook artifact
uses: actions/download-artifact@v3
with:
name: storybook
path: ./packages/component/storybook-static
path: ./apps/storybook/storybook-static
- name: Run storybook tests
working-directory: ./packages/component
working-directory: ./apps/storybook
run: |
yarn exec concurrently -k -s first -n "SB,TEST" -c "magenta,blue" "yarn exec serve ./storybook-static -l 6006" "yarn exec wait-on tcp:6006 && yarn test-storybook --coverage"
- name: Upload storybook test coverage results
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./packages/component/coverage/storybook/coverage-storybook.json
flags: storybook-test
name: affine
fail_ci_if_error: true
yarn exec concurrently -k -s first -n "SB,TEST" -c "magenta,blue" "yarn exec serve ./storybook-static -l 6006" "yarn exec wait-on tcp:6006 && yarn test"
e2e-test:
name: E2E Test
@@ -180,18 +213,9 @@ jobs:
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
shard: [1, 2, 3, 4, 5]
environment: development
needs: [build, build-storybook]
services:
octobase:
image: ghcr.io/toeverything/cloud-self-hosted:nightly-latest
ports:
- 3000:3000
env:
SIGN_KEY: 'test123'
RUST_LOG: 'debug'
JWST_DEV: '1'
needs: build-web
steps:
- uses: actions/checkout@v3
@@ -199,24 +223,15 @@ jobs:
uses: ./.github/actions/setup-node
with:
playwright-install: true
electron-install: false
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: next-js
path: ./apps/web/.next
- name: Download storybook artifact
uses: actions/download-artifact@v3
with:
name: storybook
path: ./packages/component/storybook-static
- name: Wait for Octobase Ready
run: |
node ./scripts/wait-3000-healthz.mjs
name: next-js-static
path: ./apps/web/out
- name: Run playwright tests
run: yarn test --forbid-only --shard=${{ matrix.shard }}/${{ strategy.job-total }}
run: yarn e2e --forbid-only --shard=${{ matrix.shard }}/${{ strategy.job-total }}
env:
COVERAGE: true
@@ -230,55 +245,167 @@ jobs:
files: ./.coverage/lcov.info
flags: e2etest
name: affine
fail_ci_if_error: true
fail_ci_if_error: false
- name: Upload test results
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: test-results-e2e-${{ matrix.shard }}
path: ./test-results
if-no-files-found: ignore
dekstop-test:
name: Desktop Test
e2e-migration-test:
name: E2E Migration Test
runs-on: ubuntu-latest
environment: development
needs: [build, build-electron]
needs: [build-web]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
playwright-install: true
- name: Download Ubuntu desktop artifact
electron-install: false
- name: Download next static
uses: actions/download-artifact@v3
with:
name: affine-ubuntu
path: ./apps/electron/dist
name: next-js-static
path: ./apps/web/out
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: next-js
path: ./apps/web/.next
- name: Unzip
run: yarn unzip
working-directory: ./tests/affine-legacy/0.7.0-canary.18
- name: Generate static files
run: yarn export
working-directory: ./apps/web
- name: Run legacy playwright tests
run: yarn e2e --forbid-only
working-directory: ./tests/affine-legacy/0.7.0-canary.18
- name: Move static files to electron
run: mv ./apps/web/out ./apps/electron/resources/web-static
- name: Run desktop tests
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test
working-directory: apps/electron
- name: Run vitest
run: yarn test
working-directory: ./tests/affine-legacy/0.7.0-canary.18
- name: Upload test results
if: ${{ failure() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: test-results-e2e-${{ matrix.shard }}
name: test-results-e2e-migration
path: ./tests/affine-legacy/0.7.0-canary.18/test-results
if-no-files-found: ignore
desktop-test:
name: Desktop Test
runs-on: ${{ matrix.spec.os }}
environment: development
strategy:
fail-fast: false
# all combinations: macos-latest x64, macos-latest arm64, windows-latest x64, ubuntu-latest x64
matrix:
spec:
- {
os: macos-latest,
platform: macos,
arch: x64,
target: x86_64-apple-darwin,
test: true,
}
- {
os: macos-latest,
platform: macos,
arch: arm64,
target: aarch64-apple-darwin,
test: false,
}
- {
os: ubuntu-latest,
platform: linux,
arch: x64,
target: x86_64-unknown-linux-gnu,
test: true,
}
- {
os: windows-latest,
platform: windows,
arch: x64,
target: x86_64-pc-windows-msvc,
test: true,
}
needs: [build-web]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
playwright-install: true
hard-link-nm: false
- name: Build AFFiNE native
uses: ./.github/actions/build-rust
with:
target: ${{ matrix.spec.target }}
nx_token: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Run unit tests
if: ${{ matrix.spec.test }}
shell: bash
run: yarn nx test @affine/monorepo
env:
NATIVE_TEST: 'true'
- name: Download static resource artifact
uses: actions/download-artifact@v3
with:
name: next-js-static
path: apps/electron/resources/web-static
- name: Build Plugins
run: yarn run build:plugins
- name: Build Desktop Layers
run: yarn workspace @affine/electron build
- name: Run desktop tests
if: ${{ matrix.spec.test && matrix.spec.os == 'ubuntu-latest' }}
run: xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn workspace @affine/electron test
env:
COVERAGE: true
- name: Run desktop tests
if: ${{ matrix.spec.test && matrix.spec.os != 'ubuntu-latest' }}
run: yarn workspace @affine/electron test
env:
COVERAGE: true
- name: Make bundle
if: ${{ matrix.spec.os == 'macos-latest' && matrix.spec.arch == 'arm64' }}
run: yarn workspace @affine/electron make --platform=darwin --arch=arm64
- name: Bundle output check
if: ${{ matrix.spec.os == 'macos-latest' && matrix.spec.arch == 'arm64' }}
run: |
./scripts/unzip-macos-arm64.sh
yarn ts-node-esm ./scripts/macos-arm64-output-check.mts
working-directory: apps/electron
- name: Collect code coverage report
if: ${{ matrix.spec.test }}
run: yarn exec nyc report -t .nyc_output --report-dir .coverage --reporter=lcov
- name: Upload e2e test coverage results
if: ${{ matrix.spec.test }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./.coverage/lcov.info
flags: e2etest-${{ matrix.spec.os }}-${{ matrix.spec.arch }}
name: affine
fail_ci_if_error: false
- name: Upload test results
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: test-results-e2e-${{ matrix.spec.os }}-${{ matrix.spec.arch }}
path: ./test-results
if-no-files-found: ignore
@@ -286,23 +413,15 @@ jobs:
name: Unit Test
runs-on: ubuntu-latest
environment: development
services:
octobase:
image: ghcr.io/toeverything/cloud-self-hosted:nightly-latest
ports:
- 3000:3000
env:
SIGN_KEY: 'test123'
RUST_LOG: 'debug'
JWST_DEV: '1'
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
electron-install: false
- name: Unit Test
run: yarn run test:unit:coverage
run: yarn nx test:coverage @affine/monorepo
- name: Upload unit test coverage results
uses: codecov/codecov-action@v3
@@ -311,4 +430,80 @@ jobs:
files: ./.coverage/store/lcov.info
flags: unittest
name: affine
fail_ci_if_error: true
fail_ci_if_error: false
build-docker:
if: github.ref == 'refs/heads/master'
name: Build Docker
needs:
- lint
- desktop-test
- server-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download next static
uses: actions/download-artifact@v3
with:
name: next-js-static
path: ./apps/web/out
- name: Download server dist
uses: actions/download-artifact@v3
with:
name: server-dist
path: ./apps/server/dist
- name: Download storage.node
uses: actions/download-artifact@v3
with:
name: storage.node
path: ./apps/server
- name: Setup Git short hash
run: |
echo "GIT_SHORT_HASH=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
logout: false
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build front Dockerfile
uses: docker/build-push-action@v4
with:
context: .
push: true
pull: true
platforms: linux/amd64,linux/arm64
provenance: true
file: .github/deployment/front/Dockerfile
tags: ghcr.io/toeverything/affine-front:${{ env.GIT_SHORT_HASH }},ghcr.io/toeverything/affine-front:latest
# setup node without cache configuration
# Prisma cache is not compatible with docker build cache
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: https://npm.pkg.github.com
scope: '@toeverything'
- name: Install Node.js dependencies
run: yarn workspaces focus @affine/server --production
- name: Generate Prisma client
run: yarn workspace @affine/server prisma generate
- name: Build graphql Dockerfile
uses: docker/build-push-action@v4
with:
context: .
push: true
pull: true
platforms: linux/amd64,linux/arm64
provenance: true
file: .github/deployment/node/Dockerfile
tags: ghcr.io/toeverything/affine-graphql:${{ env.GIT_SHORT_HASH }},ghcr.io/toeverything/affine-graphql:latest

18
.github/workflows/cancel.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Cancel
on:
pull_request_target:
types:
- edited
- synchronize
jobs:
cancel:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: styfle/cancel-workflow-action@0.11.0
with:
# See https://api.github.com/repos/toeverything/AFFiNE/actions/workflows
workflow_id: 44038251, 61883931
access_token: ${{ github.token }}

View File

@@ -15,6 +15,7 @@ on:
push:
branches: [master]
pull_request:
merge_group:
# The branches below must be a subset of the branches above
branches: [master]

66
.github/workflows/helm-releaser.yml vendored Normal file
View File

@@ -0,0 +1,66 @@
name: Release Charts
on:
push:
branches: [master]
paths:
- '.github/helm/**/Chart.yml'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout Helm chart repo
uses: actions/checkout@v3
with:
repository: toeverything/helm-charts
path: .helm-chart-repo
ref: gh-pages
token: ${{ secrets.HELM_RELEASER_TOKEN }}
- name: Install Helm
uses: azure/setup-helm@v3
- name: Install chart releaser
run: |
set -e
arch="$(dpkg --print-architecture)"
curl -s https://api.github.com/repos/helm/chart-releaser/releases/latest \
| yq --indent 0 --no-colors --input-format json --unwrapScalar \
".assets[] | select(.name | test("\""^chart-releaser_.+_linux_${arch}\.tar\.gz$"\"")) | .browser_download_url" \
| xargs curl -SsL \
| tar zxf - -C /usr/local/bin
- name: Package charts
working-directory: .helm-chart-repo
run: |
mkdir -p .cr-index
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm dependencies build ../.github/helm/affine
helm dependencies build ../.github/helm/affine-cloud
cr package ../.github/helm/affine
cr package ../.github/helm/affine-cloud
- name: Publish charts
working-directory: .helm-chart-repo
run: |
set -ex
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
owner=$(cut -d '/' -f 1 <<< '${{ github.repository }}')
repo=helm-charts
git_hash=$(git rev-parse HEAD)
cr upload --commit "$git_hash" \
--git-repo "$repo" --owner "$owner" \
--token '${{ secrets.HELM_RELEASER_TOKEN }}' \
--skip-existing
cr index --git-repo "$repo" --owner "$owner" \
--token '${{ secrets.HELM_RELEASER_TOKEN }}' \
--index-path .cr-index --push

View File

@@ -6,21 +6,15 @@ on:
paths:
- 'packages/i18n/**'
- '.github/workflows/languages-sync.yml'
- '!.github/actions/setup-node/action.yml'
pull_request_target:
branches: ['master']
paths:
- 'packages/i18n/**'
- '.github/workflows/languages-sync.yml'
- '!.github/actions/setup-node/action.yml'
workflow_dispatch:
# Cancels all previous workflow runs for pull requests that have not completed.
# See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# The concurrency group contains the workflow name and the branch name for
# pull requests or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
main:
runs-on: ubuntu-latest

225
.github/workflows/nightly-build.yml vendored Normal file
View File

@@ -0,0 +1,225 @@
name: Build Canary Desktop App on Staging Branch
on:
push:
branches:
# 0.6.x-staging
- v[0-9]+.[0-9]+.x-staging
# 0.6.1-staging
- v[0-9]+.[0-9]+.[0-9]+-staging
paths-ignore:
- README.md
- .github/**
- '!.github/workflows/nightly-build.yml'
- '!.github/actions/build-rust/action.yml'
- '!.github/actions/setup-rust/action.yml'
- '!.github/actions/setup-node/action.yml'
permissions:
actions: write
contents: write
security-events: write
concurrency:
# The concurrency group contains the workflow name and the branch name for
# pull requests or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
BUILD_TYPE: internal
jobs:
set-build-version:
runs-on: ubuntu-latest
environment: production
outputs:
version: 0.0.0-${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v3
- uses: toeverything/set-build-version@latest
- id: version
run: echo ::set-output name=version::${{ env.BUILD_VERSION }}
before-make:
runs-on: ubuntu-latest
environment: production
needs:
- set-build-version
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Replace Version
run: ./scripts/set-version.sh ${{ needs.set-build-version.outputs.version }}
- name: generate-assets
working-directory: apps/electron
run: yarn generate-assets
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
- name: Upload Artifact (web-static)
uses: actions/upload-artifact@v3
with:
name: before-make-web-static
path: apps/electron/resources/web-static
make-distribution:
environment: production
strategy:
# all combinations: macos-latest x64, macos-latest arm64, windows-latest x64, ubuntu-latest x64
matrix:
spec:
- {
os: macos-latest,
platform: darwin,
arch: x64,
target: x86_64-apple-darwin,
}
- {
os: macos-latest,
platform: darwin,
arch: arm64,
target: aarch64-apple-darwin,
}
- {
os: ubuntu-latest,
platform: linux,
arch: x64,
target: x86_64-unknown-linux-gnu,
}
- {
os: windows-latest,
platform: win32,
arch: x64,
target: x86_64-pc-windows-msvc,
}
runs-on: ${{ matrix.spec.os }}
needs:
- before-make
- set-build-version
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
SKIP_GENERATE_ASSETS: 1
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build AFFiNE native
uses: ./.github/actions/build-rust
with:
target: ${{ matrix.spec.target }}
nx_token: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- name: Replace Version
run: ./scripts/set-version.sh ${{ needs.set-build-version.outputs.version }}
- uses: actions/download-artifact@v3
with:
name: before-make-web-static
path: apps/electron/resources/web-static
- name: Build Plugins
run: yarn run build:plugins
- name: Build Desktop Layers
run: yarn workspace @affine/electron build
- name: Signing By Apple Developer ID
if: ${{ matrix.spec.platform == 'darwin' }}
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: make
run: yarn workspace @affine/electron make --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
- name: Save artifacts (mac)
if: ${{ matrix.spec.platform == 'darwin' }}
run: |
mkdir -p builds
mv apps/electron/out/*/make/*.dmg ./builds/affine-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.dmg
mv apps/electron/out/*/make/zip/darwin/${{ matrix.spec.arch }}/*.zip ./builds/affine-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.zip
- name: Save artifacts (windows)
if: ${{ matrix.spec.platform == 'win32' }}
run: |
mkdir -p builds
mv apps/electron/out/*/make/zip/win32/x64/AFFiNE*-win32-x64-*.zip ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.zip
mv apps/electron/out/*/make/squirrel.windows/x64/*.exe ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.exe
mv apps/electron/out/*/make/squirrel.windows/x64/*.msi ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.msi
mv apps/electron/out/*/make/squirrel.windows/x64/*.nupkg ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.nupkg
- name: Save artifacts (linux)
if: ${{ matrix.spec.platform == 'linux' }}
run: |
mkdir -p builds
mv apps/electron/out/*/make/zip/linux/x64/*.zip ./builds/affine-${{ env.BUILD_TYPE }}-linux-x64.zip
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: affine-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}-builds
path: builds
release:
needs:
- make-distribution
- set-build-version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Artifacts (macos-x64)
uses: actions/download-artifact@v3
with:
name: affine-darwin-x64-builds
path: ./
- name: Download Artifacts (macos-arm64)
uses: actions/download-artifact@v3
with:
name: affine-darwin-arm64-builds
path: ./
- name: Download Artifacts (windows-x64)
uses: actions/download-artifact@v3
with:
name: affine-win32-x64-builds
path: ./
- name: Download Artifacts (linux-x64)
uses: actions/download-artifact@v3
with:
name: affine-linux-x64-builds
path: ./
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Generate Release yml
run: |
cp ./apps/electron/scripts/generate-yml.js .
node generate-yml.js
env:
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
- name: Create Release Draft
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
repository: 'toeverything/AFFiNE-Releases'
name: ${{ needs.set-build-version.outputs.version }}
tag_name: ${{ needs.set-build-version.outputs.version }}
prerelease: true
files: |
./VERSION
./*.zip
./*.dmg
./*.exe
./*.nupkg
./RELEASES
./*.AppImage
./*.apk
./*.yml

54
.github/workflows/nx.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: NX
on:
push:
branches:
- master
- v[0-9]+.[0-9]+.x-staging
- v[0-9]+.[0-9]+.x
paths-ignore:
- README.md
- .github/**
- '!.github/workflows/nx.yml'
- '!.github/actions/build-rust/action.yml'
- '!.github/actions/setup-node/action.yml'
pull_request:
merge_group:
branches:
- master
- v[0-9]+.[0-9]+.x-staging
- v[0-9]+.[0-9]+.x
paths-ignore:
- README.md
- .github/**
- '!.github/workflows/nx.yml'
- '!.github/actions/build-rust/action.yml'
- '!.github/actions/setup-node/action.yml'
jobs:
main:
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.13.0
with:
runs-on: macos-latest
main-branch-name: master
number-of-agents: 5
init-commands: |
yarn exec nx-cloud start-ci-run --stop-agents-after="build" --agent-count=5
environment-variables: |
BUILD_TYPE=canary
# parallel-commands: |
# yarn exec nx-cloud record -- yarn exec nx format:check
parallel-commands-on-agents: |
yarn exec nx affected --target=build --parallel=5
timeout: 60
agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.13.0
with:
runs-on: macos-latest
number-of-agents: 5
environment-variables: |
BUILD_TYPE=canary
timeout: 60

View File

@@ -1,6 +1,9 @@
name: Release Desktop App
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
workflow_dispatch:
inputs:
version:
@@ -28,41 +31,40 @@ permissions:
contents: write
security-events: write
concurrency:
# The concurrency group contains the workflow name and the branch name for
# pull requests or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
BUILD_TYPE: ${{ github.event.inputs.build-type }}
BUILD_TYPE: ${{ github.event.inputs.build-type || (github.ref_type == 'tag' && contains(github.ref, 'canary') && 'canary') }}
DEBUG: napi:*
APP_NAME: affine
MACOSX_DEPLOYMENT_TARGET: '10.13'
jobs:
before-make:
runs-on: ubuntu-latest
environment: ${{ github.ref_name == 'master' && 'production' || 'development' }}
environment: production
outputs:
RELEASE_VERSION: ${{ steps.get-canary-version.outputs.RELEASE_VERSION }}
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Get canary version
id: get-canary-version
if: ${{ github.ref_type == 'tag' }}
run: |
TAG_VERSION=${GITHUB_REF#refs/tags/v}
PACKAGE_VERSION=$(node -p "require('./apps/electron/package.json').version")
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
exit 1
fi
echo "RELEASE_VERSION=$(node -p "require('./apps/electron/package.json').version")" >> $GITHUB_OUTPUT
- name: generate-assets
working-directory: apps/electron
run: yarn generate-assets
run: yarn workspace @affine/electron generate-assets
env:
NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }}
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }}
NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }}
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }}
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }}
NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }}
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID }}
AFFINE_GOOGLE_CLIENT_ID: ${{ secrets.AFFINE_GOOGLE_CLIENT_ID }}
AFFINE_GOOGLE_CLIENT_SECRET: ${{ secrets.AFFINE_GOOGLE_CLIENT_SECRET }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
API_SERVER_PROFILE: prod
RELEASE_VERSION: ${{ github.event.inputs.version || steps.get-canary-version.outputs.RELEASE_VERSION }}
- name: Upload Artifact (web-static)
uses: actions/upload-artifact@v3
@@ -70,22 +72,36 @@ jobs:
name: before-make-web-static
path: apps/electron/resources/web-static
- name: Upload Artifact (electron dist)
uses: actions/upload-artifact@v3
with:
name: before-make-electron-dist
path: apps/electron/dist
make-distribution:
environment: ${{ github.ref_name == 'master' && 'production' || 'development' }}
environment: production
strategy:
# all combinations: macos-latest x64, macos-latest arm64, windows-latest x64, ubuntu-latest x64
matrix:
spec:
- { os: macos-latest, platform: macos, arch: x64 }
- { os: macos-latest, platform: macos, arch: arm64 }
- { os: ubuntu-latest, platform: linux, arch: x64 }
- { os: windows-latest, platform: windows, arch: x64 }
- {
os: macos-latest,
platform: darwin,
arch: x64,
target: x86_64-apple-darwin,
}
- {
os: macos-latest,
platform: darwin,
arch: arm64,
target: aarch64-apple-darwin,
}
- {
os: ubuntu-latest,
platform: linux,
arch: x64,
target: x86_64-unknown-linux-gnu,
}
- {
os: windows-latest,
platform: win32,
arch: x64,
target: x86_64-pc-windows-msvc,
}
runs-on: ${{ matrix.spec.os }}
needs: before-make
env:
@@ -97,34 +113,40 @@ jobs:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Build AFFiNE native
uses: ./.github/actions/build-rust
with:
target: ${{ matrix.spec.target }}
nx_token: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
- uses: actions/download-artifact@v3
with:
name: before-make-web-static
path: apps/electron/resources/web-static
- uses: actions/download-artifact@v3
with:
name: before-make-electron-dist
path: apps/electron/dist
- name: Build Plugins
run: yarn run build:plugins
- name: Build Desktop Layers
run: yarn workspace @affine/electron build
- name: Signing By Apple Developer ID
if: ${{ matrix.spec.platform == 'macos' }}
if: ${{ matrix.spec.platform == 'darwin' }}
uses: apple-actions/import-codesign-certs@v2
with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
- name: make
run: yarn make-${{ matrix.spec.platform }}-${{ matrix.spec.arch }}
working-directory: apps/electron
run: yarn workspace @affine/electron make --platform=${{ matrix.spec.platform }} --arch=${{ matrix.spec.arch }}
- name: Save artifacts (mac)
if: ${{ matrix.spec.platform == 'macos' }}
if: ${{ matrix.spec.platform == 'darwin' }}
run: |
mkdir -p builds
mv apps/electron/out/*/make/*.dmg ./builds/affine-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.dmg
mv apps/electron/out/*/make/zip/darwin/${{ matrix.spec.arch }}/*.zip ./builds/affine-${{ env.BUILD_TYPE }}-macos-${{ matrix.spec.arch }}.zip
- name: Save artifacts (windows)
if: ${{ matrix.spec.platform == 'windows' }}
if: ${{ matrix.spec.platform == 'win32' }}
run: |
mkdir -p builds
mv apps/electron/out/*/make/zip/win32/x64/AFFiNE*-win32-x64-*.zip ./builds/affine-${{ env.BUILD_TYPE }}-windows-x64.zip
@@ -145,40 +167,49 @@ jobs:
path: builds
release:
needs: make-distribution
needs: [before-make, make-distribution]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download Artifacts (macos-x64)
uses: actions/download-artifact@v3
with:
name: affine-macos-x64-builds
name: affine-darwin-x64-builds
path: ./
- name: Download Artifacts (macos-arm64)
uses: actions/download-artifact@v3
with:
name: affine-macos-arm64-builds
name: affine-darwin-arm64-builds
path: ./
- name: Download Artifacts (windows-x64)
uses: actions/download-artifact@v3
with:
name: affine-windows-x64-builds
name: affine-win32-x64-builds
path: ./
- name: Download Artifacts (linux-x64)
uses: actions/download-artifact@v3
with:
name: affine-linux-x64-builds
path: ./
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Generate Release yml
run: |
cp ./apps/electron/scripts/generate-yml.js .
node generate-yml.js
env:
RELEASE_VERSION: ${{ github.event.inputs.version || needs.before-make.outputs.RELEASE_VERSION }}
- name: Create Release Draft
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
name: Desktop APP ${{ github.event.inputs.version }}
body: 'TODO: Add release notes here'
draft: ${{ github.event.inputs.is-draft }}
prerelease: ${{ github.event.inputs.is-pre-release }}
name: ${{ github.event.inputs.version || needs.before-make.outputs.RELEASE_VERSION }}
body: ''
draft: ${{ github.event.inputs.is-draft || true }}
prerelease: ${{ github.event.inputs.is-pre-release || needs.before-make.outputs.version }}
files: |
./VERSION
./*.zip
@@ -188,3 +219,4 @@ jobs:
./RELEASES
./*.AppImage
./*.apk
./*.yml

21
.github/workflows/workers.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Deploy Cloudflare Worker
on:
push:
branches:
- master
paths:
- packages/workers/**
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
environment: production
steps:
- uses: actions/checkout@v2
- name: Publish
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
workingDirectory: 'packages/workers'

14
.gitignore vendored
View File

@@ -28,9 +28,9 @@ node_modules
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/settings.template.json
!.vscode/launch.template.json
!.vscode/extensions.json
# misc
@@ -55,8 +55,10 @@ Thumbs.db
.history
.next
.vercel
out/
storybook-static
i18n-generated.ts
/test-results/
/playwright-report/
@@ -65,3 +67,11 @@ storybook-static
# Cache
.eslintcache
next-env.d.ts
.rollup.cache
# Rust
target
*.node
tsconfig.node.tsbuildinfo
lib
affine.db

View File

@@ -2,7 +2,22 @@
. "$(dirname -- "$0")/_/husky.sh"
# check lockfile is up to date
yarn install
yarn install --mode=skip-build --inline-builds --immutable
# build infra code
yarn -T run build:infra
# generate prisma client type
yarn workspace @affine/server prisma generate
# generate i18n
yarn i18n-codegen gen
# lint staged files
yarn exec lint-staged
# type check
yarn typecheck
# circular dependency check
yarn circular

21
.i18n-codegen.json Normal file
View File

@@ -0,0 +1,21 @@
{
"$schema": "./node_modules/@magic-works/i18n-codegen/schema.json",
"version": 1,
"list": [
{
"input": "./packages/i18n/src/resources/en.json",
"output": "./packages/i18n/src/i18n-generated",
"parser": {
"type": "i18next",
"contextSeparator": "$",
"pluralSeparator": "_"
},
"generator": {
"type": "i18next/react-hooks",
"hooks": "useAFFiNEI18N",
"emitTS": true,
"shouldUnescape": true
}
}
]
}

1
.npmrc
View File

@@ -1,2 +1,3 @@
shell-emulator=true
electron_mirror="https://cdn.npmmirror.com/binaries/electron/"
engine-strict=true

View File

@@ -1 +1,14 @@
pnpm-lock.yaml
yarn.lock
target
lib
test-results
packages/i18n/src/i18n-generated.ts
packages/graphql/src/graphql/index.ts
.next
out
dist
.yarn
tests/affine-legacy/0.7.0-canary.18/static
.github/helm
_next
storybook-static

9
.taplo.toml Normal file
View File

@@ -0,0 +1,9 @@
exclude = ["node_modules/**/*.toml"]
[[rule]]
keys = ["dependencies", "*-dependencies"]
[rule.formatting]
align_entries = true
indent_tables = true
reorder_keys = true

View File

@@ -6,6 +6,12 @@
"name": "Run Dev",
"request": "launch",
"type": "node-terminal"
},
{
"command": "yarn run dev:local",
"name": "Run Dev Locally",
"request": "launch",
"type": "node-terminal"
}
]
}

View File

@@ -26,8 +26,19 @@
"[toml]": {
"editor.defaultFormatter": "tamasfe.even-better-toml"
},
"rust-analyzer.linkedProjects": ["packages/octobase-node/Cargo.toml"],
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"vitest.include": [
"packages/**/*.spec.ts",
"packages/**/*.spec.tsx",
"apps/web/**/*.spec.ts",
"apps/web/**/*.spec.tsx",
"apps/electron/src/**/*.spec.ts",
"tests/unit/**/*.spec.ts",
"tests/unit/**/*.spec.tsx"
],
"rust-analyzer.check.extraEnv": {
"DATABASE_URL": "sqlite:affine.db"
}
}

File diff suppressed because one or more lines are too long

View File

@@ -16,4 +16,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: '@yarnpkg/plugin-workspace-tools'
yarnPath: .yarn/releases/yarn-3.5.0.cjs
yarnPath: .yarn/releases/yarn-3.6.0.cjs

2122
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

11
Cargo.toml Normal file
View File

@@ -0,0 +1,11 @@
[workspace]
members = ["./packages/native", "./packages/native/schema"]
[profile.dev.package.sqlx-macros]
opt-level = 3
[profile.release]
lto = true
codegen-units = 1
opt-level = 3
strip = "symbols"

View File

@@ -2,13 +2,13 @@
<h1 style="border-bottom: none">
<b><a href="https://affine.pro">AFFiNE.PRO</a></b><br />
The Next-Gen Collaborative Knowledge Base
Write, Draw and Plan All at Once
<br>
</h1>
<p>
AFFiNE is a next-gen knowledge base that brings planning, sorting and creating all together.<br />
Privacy first, open-source, customizable and ready to use - a free replacement for Notion & Miro. <br />
One hyper-fused platform for wildly creative minds. <br />
A privacy-focussed, local-first, open-source, and ready-to-use alternative for Notion & Miro.
</p>
</div>
@@ -24,12 +24,13 @@ See https://github.com/all-?/all-contributors/issues/361#issuecomment-637166066
<!-- ALL-CONTRIBUTORS-BADGE:END -->
[![AFFiNE Web](<https://img.shields.io/badge/-Try%20It%20Online%20%E2%86%92-rgb(84,56,255)?style=flat-square&logoColor=white&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAADAAAAAwAEwd99eAAABjElEQVRYhe1W0U3DMBB9RfyTDeoNyAYNG2QDOgJsECYgGxA26AZ4hIxgJqCZ4PjIGV+tUxK7raqiPsmKdXe5e3fOs7IiIlwSdxetfiNw7QRKAD0Ax/ssrI5QgQOw5v03AJOTJHcCL1x84LVmWzJyJlBg7P4BwCvb3pmIAbBPykZEqaulEU7YHNva1HypxUsKqIS9EvbynASs0n3ss+ciUIsuO8VvhL9emjdFBa3YO8XvALwpsZNYSqBB0PwUWgRZNksSL5GhlN0ngGd+dkpsD6AG8IGlslxwTh2fa09EBc3Dir32rRysuQlUAL54/wTAcpePPAXHPsOTGXhSEv69rAlYpZOt6DSO29J4D/TRRLJk6AvtaZSY9PkCFYVLqI9i/NF5YkkECgrXa6P4fVEn4iolrhNxRQqBZu7FqMNdZiMqAUPj2KdGZyicu1dHzlGqBHxn2sdTR53bmeJ+ebJd7LtXhGH4uQEwd0ttAPzMxGi5/6BdxTuMej41Bs59gGP+CU+Cq/4tvxH4HwR+Ab3Uqr/VGbqEAAAAAElFTkSuQmCC>)](https://app.affine.pro)
[![AFFiNE macOS M1/M2 Chip](https://img.shields.io/badge/-macOS_M_Chip%20%E2%86%92-black?style=flat-square&logo=apple&logoColor=white)](https://github.com/toeverything/AFFiNE/releases/latest)
[![AFFiNE macOS x64](https://img.shields.io/badge/-macOS_x86%20%E2%86%92-black?style=flat-square&logo=apple&logoColor=white)](https://github.com/toeverything/AFFiNE/releases/latest)
[![AFFiNE Window x64](https://img.shields.io/badge/-Windows%20%E2%86%92-blue?style=flat-square&logo=windows&logoColor=white)](https://github.com/toeverything/AFFiNE/releases/latest)
[![AFFiNE Linux](https://img.shields.io/badge/-Linux%20%E2%86%92-yellow?style=flat-square&logo=linux&logoColor=white)](https://github.com/toeverything/AFFiNE/releases/latest)
[![AFFiNE Web](<https://img.shields.io/badge/-Try%20It%20Online%20%E2%86%92-rgb(84,56,255)?style=flat-square&logoColor=white&logo=affine>)](https://app.affine.pro)
[![AFFiNE macOS M1/M2 Chip](https://img.shields.io/badge/-macOS_M_Chip%20%E2%86%92-black?style=flat-square&logo=apple&logoColor=white)](https://affine.pro/download)
[![AFFiNE macOS x64](https://img.shields.io/badge/-macOS_x86%20%E2%86%92-black?style=flat-square&logo=apple&logoColor=white)](https://affine.pro/download)
[![AFFiNE Window x64](https://img.shields.io/badge/-Windows%20%E2%86%92-blue?style=flat-square&logo=windows&logoColor=white)](https://affine.pro/download)
[![AFFiNE Linux](https://img.shields.io/badge/-Linux%20%E2%86%92-yellow?style=flat-square&logo=linux&logoColor=white)](https://affine.pro/download)
[![Releases](https://img.shields.io/github/downloads/toeverything/AFFiNE/total)](https://github.com/toeverything/AFFiNE/releases/latest)
[![stars-icon]](https://github.com/toeverything/AFFiNE)
[![All Contributors][all-contributors-badge]](#contributors)
[![codecov]](https://codecov.io/gh/toeverything/AFFiNE)
@@ -44,7 +45,7 @@ See https://github.com/all-?/all-contributors/issues/361#issuecomment-637166066
---
<div align="center">
<a href="http://affine.pro"><img src="https://img.shields.io/badge/-AFFiNE-06449d?style=social&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAMAAAAPkIrYAAAAP1BMVEU8b9w8b9w+b947cNw7b9w6b908b909b9w8b9w7b9w8b9w7cN08b9w7b908b9w7b9w8b907cNw8b9w8b91HcEx3NJCJAAAAFXRSTlP/3QWSgA+lHPlu6Di4XtIrxk/xRADGudUoAAAB9UlEQVR42tWYwbKjIBREG0GJKkRj/v9bZ1ZvRC99rzib11tTB9qqnKoW3/+X38vy7ifzQ1b/wk/8Q1bCv3y6Z6wFh2x2llIRGB6xRhzz6p+wVhRJD1gRZZYHrADYSyqsjFPGZtYbuFESesUysZXlcMnYyJpxTW5keQh5N7G6CUJCE2uHFNfEGiBmbmB1H4jxDawNcqbuPmtAJTtj6RZ0lpIwiR5jNmgfNtHHwLXPWfFYcS2NMdxkjac/dNaNCJPo3yf9pFuseHbDrBsRFguGs8te8Q4rXzTjVSPCIHp3FePKWbzi30xE+4zlBMmoJaGLfpLUmAmLiN4Xyibahy76WZRQMLJ2WX27on2oFvQVac8yi4p+J2forA0V8W1c++AVS1f1H6p9KKLHxk9RWKmsyB+VLC76gV65DLjokdg5KmsEMXsiDwXWSmTc9ezSoKJHoi9zUVihbMHfQOSsXB7Mrz1S1huKPde69sEsiKgNt8hYTjiWlAyENeu7IFe1D15RSEBN+yCiXw17K1RZm/w7UtJVWYN8f1ZyLlkVb2bT4vIVVrINH1dqX2YttkHmIWsfVWs646wcRFYis6fIVGpfYq1kjpGSW8kSRD+xYSmXRM0Ang9eSZioVdy/5pWaLqzIRyIpuVxYozvGf1m67I7pf/s3UXv+AP61NI2Y+BbSAAAAAElFTkSuQmCC" height=25></a>
<a href="http://affine.pro"><img src="https://img.shields.io/badge/-AFFiNE-06449d?style=social&logo=affine" height=25></a>
&nbsp;
<a href="https://community.affine.pro"><img src="https://img.shields.io/badge/-Community-424549?style=social&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAXNJREFUWEftlitLRUEURtdVEVExWUx2qxgNVouoXYtNDP4Tw20WtftAsItZrHaTYBJREZ98MAc248wcZxi4CGfSeezHmm/23kyPAa/egPPTAXQK/FsFBP7ldVDRZoqcgO9I+2bHy3ZIJBfTCPCZM1tqAxwBmzUBrNQNbEx+5b0B5oEN4NCBrAMnMaiUAuPAs3HU82TLEZwBqwGbaJ4UgKQ8CFR6SoEl4LIWwCJwZQCegKkWBWLHVKSActvdzgG3DqitDf3/VQBskBDALrDnAKXUo3ueAF5KinAf2DKOmnzD7l214bdbA6hC1XHZNQa8hSBC0hwDa57xDHDvvvWB7ciOZoE79+8CWPbsBGc769eFxJdWIKcuyIdRoG3W7AAC1dJkHDIOo8B78+4rEBo8r4AkLFk6Jk3HaeDBBTgHVmIAfpJUz+cAFXVBreQCvQYW/lqEjV1NAMUMqpAaxQMHyDnjYtuS+0BxstwaqJooFqxToFPgB5FuPCEB6XK2AAAAAElFTkSuQmCC" height=25></a>
&nbsp;
@@ -59,7 +60,7 @@ See https://github.com/all-?/all-contributors/issues/361#issuecomment-637166066
<br />
<div align="center">
<em>See docs, canvas and tables are hyper merged with AFFiNE - just like the word affine (əˈɪn | a-fine).</em>
<em>Docs, canvas and tables are hyper-merged with AFFiNE - just like the word affine (əˈɪn | a-fine).</em>
</div>
<br />
@@ -69,11 +70,11 @@ See https://github.com/all-?/all-contributors/issues/361#issuecomment-637166066
Before we tell you how to get started with AFFiNE, we'd like to shamelessly plug our awesome user and developer communities across [official social platforms](https://community.affine.pro/c/start-here/)! Once youre familiar with using the software, maybe you will share your wisdom with others and even consider joining the [AFFiNE Ambassador program](https://community.affine.pro/c/start-here/affine-ambassador) to help spread AFFiNE to the world.
## Getting started & Stay tunned with us.
## Getting started & staying tuned with us.
⚠️ Please note that AFFiNE is still under active development and is not yet ready for production use. ⚠️
[![affine.pro](https://img.shields.io/static/v1?label=Try%20it%20Online&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAhpJREFUWEdjZEACtnl3MxgY/0YzMjAaMzAwcCLLUYH9/T/D/7MM/5mXHp6kPANmHiOI4Zx9Xfg3C+tKBob/zlSwiAgjGPey/vkdvneq5luwA+zy7+yhn+Vwv+89NFHFhREU7IyM/6YT4WyqK/n/nymT0Tb/1mFGBkYbqptOhIH/Gf4fYbTLv/2NBgmOCOvBSr6DHPCfWNW0UEe2A2x1uRlakiXBbtpx6jND+7KXZLmPbAdURokzeJjxwi31rrzH8OX7P5IdQbYDtnUoMXBzMMEt7Fj2imH7qU/0cQBy8MNsPHL5K0P13Of0cQB68MNsJScaSI4CHk4mhq3tSnCf3n36k0FZmh3Mn7L+DcPqgx9ICgWSHeBpxsdQESUGtgRk+eqDH+H8O09/MiR3P6atA1qTJRlsdLnhPgYlPOQQCW96wPDi3R+iHUFSCKAHP8wydEeREg0kOQA9+JOgwR1qL8CQEygC9jWp0UCSA+aVysIT3JqDHxgmr38DtlRCiIVhZZ0CPNhB6QDkEGIA0Q4gZAkuxxFyBNEOQA7ml+/+MIQ1PUAxG1kelAhB6YMYQLQDCPmQUAjhcgxRDiDWcEKOxOYIohyQGyjCEGIvANaPLfhhBiNHA6hmBBXNhABRDgCV/aBQAAFQpYMrn4PUgNTCACiXEMoNRDmAkC8okR8UDhjYRumAN8sHvGMCSkAD2jUDOWDAO6ewbDQQ3XMAy/oxKownQR0AAAAASUVORK5CYII=&message=%E2%86%92&style=for-the-badge)](https://app.affine.pro) No installation or registration required! Head over to our website and try it out now.
[![affine.pro](https://img.shields.io/static/v1?label=Try%20it%20Online&logo=affine&message=%E2%86%92&style=for-the-badge)](https://app.affine.pro) No installation or registration required! Head over to our website and try it out now.
[![community.affine.pro](https://img.shields.io/static/v1?label=Join%20the%20community&message=%E2%86%92&style=for-the-badge)](https://community.affine.pro) Our wonderful community, where you can meet and engage with the team, developers and other like-minded enthusiastic user of AFFiNE.
@@ -82,7 +83,7 @@ Star us, and you will receive all releases notifications from GitHub without any
## Features
- **Hyper merged** — Write, draw and plan all at once. Assemble any blocks you love on any canvas you like to enjoy seamless transitions bewtween workflows with AFFiNE.
- **Hyper merged** — Write, draw and plan all at once. Assemble any blocks you love on any canvas you like to enjoy seamless transitions between workflows with AFFiNE.
- **Privacy focussed** — AFFiNE is built with your privacy in mind and is one of our key concerns. We want you to keep control of your data, allowing you to store it as you like, where you like while still being able to freely edit and view your data on-demand.
- **Offline-first** - With your privacy in mind we also decided to go offline-first. This means that AFFiNE can be used offline, whether you want to view or edit, with support for conflict-free merging when you are back online.
- **Clean, intuitive design** — With AFFiNE you can concentrate on editing with a clean and modern interface. Which is responsive, so it looks great on tablets too, and mobile support is coming in the future.
@@ -111,18 +112,38 @@ Looking for **others ways to contribute** and wondering where to start? Check ou
If you have questions, you are welcome to contact us. One of the best places to get more info and learn more is in the [AFFiNE Community](https://community.affine.pro) where you can engage with other like-minded individuals.
## Ecosystem
| Name | | |
| --------------------------------------------------------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [@affine/component](https://affine-storybook.vercel.app/) | AFFiNE Component Resources | [![](https://img.shields.io/codecov/c/github/toeverything/affine?style=flat-square)](https://affine-storybook.vercel.app/) |
| [@toeverything/y-indexeddb](packages/y-indexeddb) | IndexedDB database adapter for Yjs | [![](https://img.shields.io/npm/dm/@toeverything/y-indexeddb?style=flat-square&color=eee)](https://www.npmjs.com/package/@toeverything/y-indexeddb) |
| [@toeverything/theme](packages/theme) | AFFiNE theme | [![](https://img.shields.io/npm/dm/@toeverything/theme?style=flat-square&color=eee)](https://www.npmjs.com/package/@toeverything/theme) |
## Plugins
> Plugins are a way to extend the functionality of AFFiNE.
>
> (Currently, plugins are under heavy development, and the SDK is not yet available.)
| Name | |
| ------------------------------------------------ | ----------------------------------------- |
| [@affine/bookmark-block](plugins/bookmark-block) | A block for bookmarking a website |
| [@affine/copilot](plugins/copilot) | AI Copilot that help you document writing |
## Thanks
We would also like to give thanks to open-source projects that make AFFiNE possible:
- [BlockSuite](https://github.com/toeverything/BlockSuite) - 💠 BlockSuite is the open-source collaborative editor project behind AFFiNE.
- [OctoBase](https://github.com/toeverything/OctoBase) - 🐙 OctoBase is the open-source database behind AFFiNE, local-first, yet collaborative. A light-weight, scalable, data engine written in Rust.
- [Yjs](https://github.com/yjs/yjs) & [Yrs](https://github.com/y-crdt/y-crdt) - Fundamental support of CRDTs for our implementation on state management and data sync.
- [Next.js](https://github.com/vercel/next.js) - The React Framework.
- [Yjs](https://github.com/yjs/yjs) - Fundamental support of CRDTs for our implementation on state management and data sync.
- [Electron](https://github.com/electron/electron) - Build cross-platform desktop apps with JavaScript, HTML, and CSS.
- [React](https://github.com/facebook/react) - View layer support and web GUI framework.
- [Rust](https://github.com/rust-lang/rust) - High performance language that extends the ability and availability of our real-time backend, OctoBase.
- [Jotai](https://github.com/pmndrs/jotai) - Primitive and flexible state management for React.
- [MUI](https://github.com/mui/material-ui) - Our most used graphic UI component library.
- [async-call-rpc](https://github.com/Jack-Works/async-call-rpc) - A lightweight JSON RPC client & server.
- Other upstream [dependencies](https://github.com/toeverything/AFFiNE/network/dependencies).
Thanks a lot to the community for providing such powerful and simple libraries, so that we can focus more on the implementation of the product logic, and we hope that in the future our projects will also provide a more easy-to-use knowledge base for everyone.
@@ -132,12 +153,13 @@ Thanks a lot to the community for providing such powerful and simple libraries,
We would like to express our gratitude to all the individuals who have already contributed to AFFiNE! If you have any AFFiNE-related project, documentation, tool or template, please feel free to contribute it by submitting a pull request to our curated list on GitHub: [awesome-affine](https://github.com/toeverything/awesome-affine).
<a href="https://github.com/toeverything/affine/graphs/contributors">
<img src="https://user-images.githubusercontent.com/5910926/233382206-312428ca-094a-4579-ae06-213961ed7eab.svg" />
<img alt="contributors" src="https://opencollective.com/affine/contributors.svg?width=890&button=false" />
</a>
## Self-Host
Get started with Docker and deploy your own feature-rich, restriction-free deployment of AFFiNE - check the [latest packages].
Get started with Docker and deploy your own feature-rich, restriction-free deployment of AFFiNE.
We are working hard to get this updated to the latest version, you can keep an eye on the [latest packages].
## Hiring
@@ -178,7 +200,7 @@ See [LICENSE] for details.
[rust-version-icon]: https://img.shields.io/badge/Rust-1.70.0-dea584
[stars-icon]: https://img.shields.io/github/stars/toeverything/AFFiNE.svg?style=flat&logo=github&colorB=red&label=stars
[codecov]: https://codecov.io/gh/toeverything/affine/branch/master/graphs/badge.svg?branch=master
[node-version-icon]: https://img.shields.io/badge/node-%3E=18.16.0-success
[node-version-icon]: https://img.shields.io/badge/node-%3E=18.16.1-success
[typescript-version-icon]: https://img.shields.io/github/package-json/dependency-version/toeverything/affine/dev/typescript
[react-version-icon]: https://img.shields.io/github/package-json/dependency-version/toeverything/affine/dev/react?color=rgb%2897%2C%20218%2C%20251%29
[react-version-icon]: https://img.shields.io/github/package-json/dependency-version/toeverything/AFFiNE/react?filename=apps%2Fweb%2Fpackage.json&color=rgb(97%2C228%2C251)
[blocksuite-icon]: https://img.shields.io/github/package-json/dependency-version/toeverything/AFFiNE/@blocksuite/store?color=6880ff&filename=apps%2Fweb%2Fpackage.json&label=blocksuite

25
apps/README.md Normal file
View File

@@ -0,0 +1,25 @@
# Apps structure
> This is the structure of the `apps` directory.
## docs
AFFiNE Developer Documentation using [waku](https://github.com/dai-shi/waku).
## electron
> `web` needs to be built before electron.
AFFiNE Desktop (macOS, Linux and Windows Distribution) using [Electron](https://www.electronjs.org/).
## server
Server using [Nest.js](https://nestjs.com/).
## storybook
Storybook using [Storybook](https://storybook.js.org/).
## web
AFFiNE Core Application using [React.js](https://reactjs.org/).

17
apps/docs/entries.ts Normal file
View File

@@ -0,0 +1,17 @@
import { defineRouter } from 'waku/router/server';
export default defineRouter(
async id => {
switch (id) {
case 'index': {
const { default: AppCreator } = await import('./src/app.js');
return AppCreator(id);
}
default:
return null;
}
},
async () => {
return ['index'];
}
);

36
apps/docs/index.html Normal file
View File

@@ -0,0 +1,36 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>AFFiNE Developer Documentation</title>
<style>
@keyframes spinner {
to {
transform: rotate(360deg);
}
}
.spinner {
width: 36px;
height: 36px;
margin: auto;
border: 2px solid #ddd;
border-top-color: #222;
border-radius: 50%;
animation: spinner 1s linear infinite;
}
#root > .spinner {
margin-top: calc(50% - 18px);
}
</style>
</head>
<body>
<!--placeholder1-->
<div id="root">
<div class="spinner"></div>
</div>
<!--/placeholder1-->
<script src="./src/index.tsx" defer type="module"></script>
<!--placeholder2-->
<!--/placeholder2-->
</body>
</html>

35
apps/docs/package.json Normal file
View File

@@ -0,0 +1,35 @@
{
"name": "@affine/docs",
"version": "0.7.0-canary.41",
"type": "module",
"private": true,
"scripts": {
"dev": "waku dev",
"build": "waku build",
"build:vercel": "waku build && cp -Lr ./dist/.vercel/output ./.vercel/"
},
"dependencies": {
"@affine/component": "workspace:*",
"@blocksuite/block-std": "0.0.0-20230711103520-ce18dd84-nightly",
"@blocksuite/blocks": "0.0.0-20230711103520-ce18dd84-nightly",
"@blocksuite/editor": "0.0.0-20230711103520-ce18dd84-nightly",
"@blocksuite/global": "0.0.0-20230711103520-ce18dd84-nightly",
"@blocksuite/lit": "0.0.0-20230711103520-ce18dd84-nightly",
"@blocksuite/store": "0.0.0-20230711103520-ce18dd84-nightly",
"express": "^4.18.2",
"jotai": "^2.2.2",
"react": "18.3.0-canary-1fdacbefd-20230630",
"react-dom": "18.3.0-canary-1fdacbefd-20230630",
"react-server-dom-webpack": "18.3.0-canary-1fdacbefd-20230630",
"waku": "0.12.1"
},
"devDependencies": {
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"@vanilla-extract/css": "^1.12.0",
"@vanilla-extract/vite-plugin": "^3.8.2",
"autoprefixer": "^10.4.14",
"tailwindcss": "^3.3.2",
"typescript": "^5.1.6"
}
}

View File

@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

44
apps/docs/src/app.tsx Normal file
View File

@@ -0,0 +1,44 @@
/// <reference types="vite/client" />
'use server';
import { existsSync, readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import type { ReactElement } from 'react';
import { lazy } from 'react';
import { Sidebar } from './components/sidebar/index.js';
import { saveFile } from './server-fns.js';
const Editor = lazy(() =>
import('./components/editor.js').then(({ Editor }) => ({ default: Editor }))
);
const __dirname = fileURLToPath(new URL('.', import.meta.url));
const AppCreator = (pathname: string) =>
function App(): ReactElement {
let path = resolve(__dirname, 'pages', 'binary');
if (!existsSync(path)) {
path = resolve(__dirname, '..', '..', 'src', 'pages', 'binary');
}
const buffer = [...readFileSync(path)];
return (
<div className="flex flex-col-reverse sm:flex-row h-screen">
<nav className="w-full sm:w-64">
<Sidebar />
</nav>
<main className="flex-1 p-6 w-full sm:w-[calc(100%-16rem)] overflow-scroll">
<Editor
workspaceId={pathname}
pageId="1"
onSave={saveFile}
binary={buffer}
/>
</main>
</div>
);
};
export default AppCreator;

11
apps/docs/src/atom.ts Normal file
View File

@@ -0,0 +1,11 @@
import { __unstableSchemas, AffineSchemas } from '@blocksuite/blocks/models';
import { atom } from 'jotai/vanilla';
export const workspaceAtom = atom(async () => {
const { Workspace } = await import('@blocksuite/store');
return new Workspace({
id: 'test-workspace',
})
.register(AffineSchemas)
.register(__unstableSchemas);
});

View File

@@ -0,0 +1,53 @@
'use client';
import '@blocksuite/editor/themes/affine.css';
import { BlockSuiteEditor } from '@affine/component/block-suite-editor';
import type { Page } from '@blocksuite/store';
import { useAtomValue } from 'jotai/react';
import type { ReactElement } from 'react';
import { use } from 'react';
import { applyUpdate } from 'yjs';
import { workspaceAtom } from '../atom.js';
export type EditorProps = {
workspaceId: string;
pageId: string;
binary?: number[];
onSave: (binary: any) => Promise<void>;
};
export const Editor = (props: EditorProps): ReactElement => {
const workspace = useAtomValue(workspaceAtom);
let page = workspace.getPage('page0') as Page;
if (!page) {
page = workspace.createPage({
id: 'page0',
});
}
if (props.binary && !page.root) {
use(
page.waitForLoaded().then(() => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
applyUpdate(page._ySpaceDoc, new Uint8Array(props.binary as number[]));
})
);
if (import.meta.env.MODE !== 'development') {
page.awarenessStore.setReadonly(page, true);
}
} else if (!page.root) {
use(
page.waitForLoaded().then(() => {
const pageBlockId = page.addBlock('affine:page', {
title: new page.Text(''),
});
page.addBlock('affine:surface', {}, pageBlockId);
const noteBlockId = page.addBlock('affine:note', {}, pageBlockId);
page.addBlock('affine:paragraph', {}, noteBlockId);
})
);
}
return <BlockSuiteEditor page={page} mode="page" onInit={() => {}} />;
};

View File

@@ -0,0 +1,31 @@
'use server';
import { lazy } from 'react';
import { saveFile } from '../../server-fns.js';
const SaveToLocal = lazy(() =>
import('./save-to-local.js').then(({ SaveToLocal }) => ({
default: SaveToLocal,
}))
);
export const Sidebar = () => {
return (
<div
className="h-screen text-black overflow-y-auto"
style={{
backgroundColor: '#f9f7f7',
}}
>
<a href="/">
<div className="flex items-center justify-center h-16 font-bold">
AFFiNE
</div>
</a>
{import.meta.env.MODE === 'development' && (
<SaveToLocal saveFile={saveFile} />
)}
</div>
);
};

View File

@@ -0,0 +1,28 @@
'use client';
import { assertExists } from '@blocksuite/global/utils';
import { useAtomValue } from 'jotai/react';
import { useCallback } from 'react';
import { encodeStateAsUpdate } from 'yjs';
import { workspaceAtom } from '../../atom.js';
type SaveToLocalProps = {
saveFile: (update: number[]) => void;
};
export const SaveToLocal = (props: SaveToLocalProps) => {
const workspace = useAtomValue(workspaceAtom);
const saveFile = props.saveFile;
const onSave = useCallback(() => {
const page = workspace.getPage('page0');
assertExists(page);
saveFile([...encodeStateAsUpdate(page.spaceDoc)]);
}, [saveFile, workspace]);
return (
<div>
<div className="flex items-center justify-center h-16 font-bold">
<button onClick={onSave}>Save to Local</button>
</div>
</div>
);
};

3
apps/docs/src/index.css Normal file
View File

@@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

14
apps/docs/src/index.tsx Normal file
View File

@@ -0,0 +1,14 @@
import '@blocksuite/editor/themes/affine.css';
import './index.css';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { Router } from 'waku/router/client';
const root = createRoot(document.getElementById('root') as HTMLElement);
root.render(
<StrictMode>
<Router />
</StrictMode>
);

BIN
apps/docs/src/pages/binary Normal file

Binary file not shown.

View File

@@ -0,0 +1,10 @@
'use server';
import { writeFile } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
const __dirname = fileURLToPath(new URL('.', import.meta.url));
export async function saveFile(binary: any) {
const data = new Uint8Array(binary);
await writeFile(__dirname + 'pages' + '/binary', data);
}

View File

@@ -0,0 +1,8 @@
/** @type {import('tailwindcss').Config} */
export default {
content: ['./index.html', './src/**/*.{ts,tsx}'],
theme: {
extend: {},
},
plugins: [],
};

24
apps/docs/tsconfig.json Normal file
View File

@@ -0,0 +1,24 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"moduleResolution": "Node16",
"strict": true,
"target": "esnext",
"downlevelIteration": true,
"esModuleInterop": true,
"module": "NodeNext",
"skipLibCheck": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"jsx": "react-jsx"
},
"include": ["src", "entries.ts"],
"references": [
{
"path": "./tsconfig.node.json"
},
{
"path": "../../packages/component"
}
]
}

View File

@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"target": "ESNext",
"module": "ESNext",
"resolveJsonModule": true,
"moduleResolution": "Node16",
"allowSyntheticDefaultImports": true,
"outDir": "dist/scripts",
"rootDir": "."
},
"include": ["vite.config.ts", "vite.prod.config.ts"]
}

13
apps/docs/vite.config.ts Normal file
View File

@@ -0,0 +1,13 @@
import path from 'node:path';
import url from 'node:url';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
import { defineConfig } from 'waku/config';
export default defineConfig({
root: path.dirname(url.fileURLToPath(import.meta.url)),
plugins: [vanillaExtractPlugin()],
build: {
target: 'esnext',
},
});

View File

@@ -1,5 +1,6 @@
*.autogen.*
dist
e2e-dist-*
resources/web-static
@@ -12,3 +13,5 @@ resources/web-static
!.yarn/sdks
!.yarn/versions
dev.json
zip-out

View File

@@ -7,6 +7,7 @@ To run AFFiNE Desktop Client Application locally, run the following commands:
```sh
# in repo root
yarn install
yarn workspace @affine/native build
yarn dev
# in apps/electron
@@ -16,22 +17,6 @@ yarn dev # or yarn prod for production build
## Troubleshooting
### better-sqlite3 error
When running tests or starting electron, you may encounter the following error:
> Error: The module 'apps/electron/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
This is due to the fact that the `better-sqlite3` package is built for the Node.js version in Electron & in your machine. To fix this, run the following command based on different cases:
```sh
# for running unit tests, we are not using Electron's node:
yarn rebuild better-sqlite3
# for running Electron, we are using Electron's node:
yarn postinstall
```
## Credits
Most of the boilerplate code is generously borrowed from the following

View File

@@ -0,0 +1,4 @@
owner: toeverything
repo: AFFiNE
provider: github
private: false

Some files were not shown because too many files have changed in this diff Show More