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

@ -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",