Feat/view map database (#1885)

* refactor: rename structs

* chore: read database id from view

* chore: fix open database error because of create a database view for database id

* chore: fix tests

* chore: rename datbase id to view id in flutter

* refactor: move grid and board to database view folder

* refactor: rename functions

* refactor: move calender to datbase view folder

* refactor: rename app_flowy to appflowy_flutter

* chore: reanming

* chore: fix freeze gen

* chore: remove todos

* refactor: view process events

* chore: add link database test

* chore: just open view if there is opened database
This commit is contained in:
Nathan.fooo
2023-02-26 16:27:17 +08:00
committed by GitHub
parent 6877607c5e
commit 61fd608200
2213 changed files with 43935 additions and 45507 deletions

View File

@ -36,7 +36,7 @@ cargo install --force duckscript_cli && \
cargo make appflowy-flutter-deps-tools && \
cargo make -p production-linux-x86_64 appflowy-linux
CMD ["/home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle/app_flowy"]
CMD ["/home/makepkg/appflowy/frontend/appflowy_flutter/build/linux/x64/release/bundle/appflowy_flutter"]
#################
FROM archlinux/archlinux
@ -58,6 +58,6 @@ RUN useradd --create-home --uid $uid --gid $gid $user
USER $user
WORKDIR /home/$user
COPY --from=builder /home/makepkg/appflowy/frontend/app_flowy/build/linux/x64/release/bundle/ .
COPY --from=builder /home/makepkg/appflowy/frontend/appflowy_flutter/build/linux/x64/release/bundle/ .
CMD ["./app_flowy"]
CMD ["./appflowy_flutter"]

View File

@ -2,6 +2,6 @@
Type=Application
Name=AppFlowy
Icon=io.appflowy.AppFlowy
Exec=env GDK_GL=gles app_flowy %U
Exec=env GDK_GL=gles appflowy_flutter %U
Categories=Network;Productivity;
Keywords=Notes

View File

@ -2,7 +2,7 @@ app-id: io.appflowy.AppFlowy
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
command: app_flowy
command: appflowy_flutter
separate-locales: false
finish-args:
- --share=ipc
@ -18,10 +18,10 @@ modules:
build-commands:
# - ls .
- cp -r appflowy /app/appflowy
- chmod +x /app/appflowy/app_flowy
- chmod +x /app/appflowy/appflowy_flutter
- install -Dm644 logo.svg /app/share/icons/hicolor/scalable/apps/io.appflowy.AppFlowy.svg
- mkdir /app/bin
- ln -s /app/appflowy/app_flowy /app/bin/app_flowy
- ln -s /app/appflowy/appflowy_flutter /app/bin/appflowy_flutter
- install -Dm644 io.appflowy.AppFlowy.desktop /app/share/applications/io.appflowy.AppFlowy.desktop
sources:
- type: archive

View File

@ -1,5 +1,5 @@
echo 'Generating language files'
cd app_flowy
cd appflowy_flutter
call flutter pub run easy_localization:generate -S assets/translations/
call flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations/ -s en.json

View File

@ -1,6 +1,6 @@
#!/bin/sh
#!/usr/bin/env fish
echo 'Generating language files'
cd app_flowy
cd appflowy_flutter
flutter pub run easy_localization:generate -S assets/translations/
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json

View File

@ -3,5 +3,5 @@ if [ -e /usr/local/bin/appflowy ]; then
echo "Symlink already exists, skipping."
else
echo "Creating Symlink in /usr/local/bin/appflowy"
ln -s /opt/AppFlowy/app_flowy /usr/local/bin/appflowy
ln -s /opt/AppFlowy/appflowy_flutter /usr/local/bin/appflowy
fi

View File

@ -78,7 +78,7 @@ script = [
armv7-linux-androideabi \
i686-linux-android \
x86_64-linux-android
DEST=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/android/app/src/main/jniLibs
DEST=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/android/app/src/main/jniLibs
rm -rf $DEST/arm64-v8a \
$DEST/armeabi-v7a \
$DEST/x86 \
@ -139,7 +139,7 @@ private = true
script = [
"""
echo "🚀 🚀 🚀 AppFlowy-Core build success"
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/packages/appflowy_backend/${TARGET_OS}
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/packages/appflowy_backend/${TARGET_OS}
lib = set lib${LIB_NAME}.${LIB_EXT}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${RUST_COMPILE_TARGET}/${BUILD_FLAG}/${lib} \
@ -156,7 +156,7 @@ private = true
script = [
"""
echo "🚀 🚀 🚀 AppFlowy-Core build success"
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/windows/flutter/dart_ffi
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/windows/flutter/dart_ffi
lib = set ${LIB_NAME}.${LIB_EXT}
# copy dll
@ -175,7 +175,7 @@ private = true
script = [
"""
echo "🚀 🚀 🚀 AppFlowy-Core build success"
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/linux/flutter/dart_ffi
dart_ffi_dir= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/linux/flutter/dart_ffi
lib = set lib${LIB_NAME}.${LIB_EXT}
# copy dll
@ -241,7 +241,7 @@ script = [
"""
# Copy the appflowy_backend lib to system temp directory for flutter unit test.
lib = set ${LIB_NAME}.${TEST_LIB_EXT}
dest = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/.sandbox/${lib}
dest = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/.sandbox/${lib}
rm ${dest}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${TEST_COMPILE_TARGET}/${TEST_BUILD_FLAG}/${lib} \
${dest}
@ -255,7 +255,7 @@ script = [
"""
# Copy the appflowy_backend lib to system temp directory for flutter unit test.
lib = set lib${LIB_NAME}.${TEST_LIB_EXT}
dest = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/.sandbox/${lib}
dest = set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/.sandbox/${lib}
rm ${dest}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/target/${TEST_COMPILE_TARGET}/${TEST_BUILD_FLAG}/${lib} \
${dest}

View File

@ -75,7 +75,7 @@ linux_alias = "copy-to-product-linux"
[tasks.copy-to-product-macos]
script = [
"""
product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION}
product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}
output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR}
if [ -d "${output_path}" ]; then
rm -rf ${output_path}/
@ -83,7 +83,7 @@ script = [
mkdir -p ${output_path}
product=${PRODUCT_NAME}.${PRODUCT_EXT}
cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/Build/Products/${FLUTTER_OUTPUT_DIR}/${product} \
cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/build/${TARGET_OS}/Build/Products/${FLUTTER_OUTPUT_DIR}/${product} \
${output_path}/${product}
""",
]
@ -92,7 +92,7 @@ script_runner = "@shell"
[tasks.copy-to-product-linux]
script = [
"""
product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION}
product_path=${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}
output_path=${product_path}/${TARGET_OS}/${FLUTTER_OUTPUT_DIR}
if [ -d "${output_path}" ]; then
rm -rf ${output_path}/
@ -100,11 +100,11 @@ script = [
mkdir -p ${output_path}
product=${PRODUCT_NAME}
cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/${LINUX_ARCH}/${BUILD_FLAG}/bundle \
cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/build/${TARGET_OS}/${LINUX_ARCH}/${BUILD_FLAG}/bundle \
${output_path}/${product}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/linux/appflowy.desktop.temp ${output_path}/${product}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/assets/images/flowy_logo.svg ${output_path}/${product}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/linux/appflowy.desktop.temp ${output_path}/${product}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/assets/images/flowy_logo.svg ${output_path}/${product}
""",
]
script_runner = "@shell"
@ -112,7 +112,7 @@ script_runner = "@shell"
[tasks.copy-to-product-windows]
script = [
"""
product_path= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION}
product_path= set ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}
output_path= set ${product_path}/${TARGET_OS}
if is_path_exists ${output_path}
rm -r ${output_path}/
@ -120,7 +120,7 @@ script = [
mkdir ${output_path}
product= set ${PRODUCT_NAME}
glob_cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/build/${TARGET_OS}/runner/${FLUTTER_OUTPUT_DIR}/**/* \
glob_cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/build/${TARGET_OS}/runner/${FLUTTER_OUTPUT_DIR}/**/* \
${output_path}/${product}
""",
]
@ -146,27 +146,27 @@ linux_alias = "create-release-archive-linux"
[tasks.create-release-archive-linux]
script = [
"cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${APP_VERSION}/${TARGET_OS}/Release",
"cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}/${TARGET_OS}/Release",
"tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *",
]
[tasks.create-release-archive-windows]
script = [
# TODO
# "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}/${TARGET_OS}/Release/${PRODUCT_NAME}",
# "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${VERSION}/${TARGET_OS}/Release/${PRODUCT_NAME}",
# "tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *"
]
[tasks.create-release-archive-macos]
script = [
# TODO
# "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/app_flowy/product/${VERSION}/${TARGET_OS}/Release/${PRODUCT_NAME}",
# "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${VERSION}/${TARGET_OS}/Release/${PRODUCT_NAME}",
# "tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *"
]
[tasks.flutter-build]
script = ["""
cd app_flowy/
cd appflowy_flutter/
flutter clean
flutter pub get
flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${APP_VERSION}
@ -175,7 +175,7 @@ script_runner = "@shell"
[tasks.flutter-build.windows]
script = ["""
cd app_flowy
cd appflowy_flutter
exec cmd.exe /c flutter clean
exec cmd.exe /c flutter pub get
exec cmd.exe /c flutter build ${TARGET_OS} --${BUILD_FLAG} --build-name=${APP_VERSION}
@ -186,7 +186,7 @@ script_runner = "@duckscript"
script_runner = "@shell"
script = [
"""
cd app_flowy
cd appflowy_flutter
flutter clean
flutter packages pub get
flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
@ -198,7 +198,7 @@ script = [
script_runner = "@duckscript"
script = [
"""
cd ./app_flowy/
cd ./appflowy_flutter/
exec cmd.exe /c flutter clean
exec cmd.exe /c flutter packages pub get
exec cmd.exe /c flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
@ -210,7 +210,7 @@ script = [
script_runner = "@shell"
script = [
"""
cd app_flowy
cd appflowy_flutter
flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
flutter packages pub run build_runner build --delete-conflicting-outputs
""",
@ -220,7 +220,7 @@ script = [
script_runner = "@duckscript"
script = [
"""
cd ./app_flowy/
cd ./appflowy_flutter/
exec cmd.exe /c flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
exec cmd.exe /c flutter packages pub run build_runner build --delete-conflicting-outputs
""",

View File

@ -22,7 +22,7 @@ env = { RUST_LOG = "info", TEST_RUST_LOG = "info" }
dependencies = ["build-test-lib"]
description = "Run flutter unit tests"
script = '''
cd app_flowy
cd appflowy_flutter
flutter test --dart-define=RUST_LOG=${TEST_RUST_LOG} -j, --concurrency=1
'''

View File

@ -46,7 +46,7 @@ run_task = { name = "remove_files_with_pattern" }
#Dart Clean
[tasks.rm_dart_generated_files]
env = { "dart_flowy_sdk_path" = "./app_flowy/packages/appflowy_backend/" }
env = { "dart_flowy_sdk_path" = "./appflowy_flutter/packages/appflowy_backend/" }
run_task = { name = [
"rm_dart_generated_protobuf_files",
"rm_dart_generated_event_files",

View File

@ -7,15 +7,15 @@ SolidCompression=yes
DefaultDirName={autopf}\AppFlowy\
DefaultGroupName=AppFlowy
SetupIconFile=flowy_logo.ico
UninstallDisplayIcon={app}\app_flowy.exe
UninstallDisplayIcon={app}\appflowy_flutter.exe
UninstallDisplayName=AppFlowy
AppPublisher=AppFlowy-IO
VersionInfoVersion={#AppVersion}
[Files]
Source: "AppFlowy\app_flowy.exe";DestDir: "{app}";DestName: "app_flowy.exe"
Source: "AppFlowy\AppFlowy.exe";DestDir: "{app}";DestName: "appflowy_flutter.exe"
Source: "AppFlowy\*";DestDir: "{app}"
Source: "AppFlowy\data\*";DestDir: "{app}\data\"; Flags: recursesubdirs
[Icons]
Name: "{group}\AppFlowy";Filename: "{app}\app_flowy.exe"
Name: "{group}\AppFlowy";Filename: "{app}\appflowy_flutter.exe"