From 2ae878be6c3cc4e487d8cc3a1a166071fc5ff76a Mon Sep 17 00:00:00 2001 From: Alex Wallen Date: Wed, 5 Apr 2023 10:17:31 -1000 Subject: [PATCH] Revert "feat: Create a "view" for all database references in a document (#2083)" This reverts commit e2009c063bf896ef63408ff9520aefe6ea1b3b08. --- .github/workflows/integration_test.yml | 7 +- .github/workflows/release.yml | 30 +- frontend/.vscode/tasks.json | 446 +++++++++--------- frontend/appflowy_flutter/.gitignore | 4 +- .../assets/test/workspaces/board.zip | Bin 9394 -> 0 bytes .../assets/test/workspaces/empty_document.zip | Bin 7906 -> 0 bytes .../assets/translations/en.json | 6 +- .../integration_test/board_test.dart | 43 -- .../integration_test/empty_document_test.dart | 120 ----- .../integration_test/runner.dart | 19 - .../integration_test/switch_folder_test.dart | 135 ++++++ .../integration_test/util/data.dart | 66 --- .../integration_test/util/keyboard.dart | 12 - .../integration_test/util/util.dart | 1 - .../application/database_service.dart | 2 +- .../plugins/base/insert_page_command.dart | 50 +- frontend/appflowy_flutter/pubspec.yaml | 31 +- .../flutter_release_build/build_flowy.dart | 28 -- .../scripts/flutter_release_build/tool.dart | 115 ----- 19 files changed, 401 insertions(+), 714 deletions(-) delete mode 100644 frontend/appflowy_flutter/assets/test/workspaces/board.zip delete mode 100644 frontend/appflowy_flutter/assets/test/workspaces/empty_document.zip delete mode 100644 frontend/appflowy_flutter/integration_test/board_test.dart delete mode 100644 frontend/appflowy_flutter/integration_test/empty_document_test.dart delete mode 100644 frontend/appflowy_flutter/integration_test/runner.dart delete mode 100644 frontend/appflowy_flutter/integration_test/util/data.dart delete mode 100644 frontend/appflowy_flutter/integration_test/util/keyboard.dart delete mode 100644 frontend/scripts/flutter_release_build/build_flowy.dart delete mode 100644 frontend/scripts/flutter_release_build/tool.dart diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 76aed8da9bcfd..084018f7471d1 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -105,11 +105,11 @@ jobs: working-directory: frontend/appflowy_flutter run: | if [ "$RUNNER_OS" == "Linux" ]; then - flutter test integration_test/runner.dart -d Linux --coverage + flutter test integration_test -d Linux --coverage elif [ "$RUNNER_OS" == "macOS" ]; then - flutter test integration_test/runner.dart -d macOS --coverage + flutter test integration_test -d macOS --coverage elif [ "$RUNNER_OS" == "Windows" ]; then - flutter test integration_test/runner.dart -d Windows --coverage + flutter test integration_test -d Windows --coverage fi shell: bash @@ -120,3 +120,4 @@ jobs: # env_vars: ${{ matrix.os }} # fail_ci_if_error: true # verbose: true + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88e40585f4e56..c971bb30acf13 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: release on: push: tags: - - "*" + - '*' env: FLUTTER_VERSION: "3.7.5" @@ -136,11 +136,7 @@ jobs: fail-fast: false matrix: job: - - { - target: x86_64-apple-darwin, - os: macos-10.15, - extra-build-args: "", - } + - { target: x86_64-apple-darwin, os: macos-10.15, extra-build-args: "" } steps: - name: Checkout source code uses: actions/checkout@v3 @@ -176,7 +172,7 @@ jobs: working-directory: frontend run: | flutter config --enable-macos-desktop - dart ./scripts/flutter_release_build/build_flowy.dart . ${{ github.ref_name }} + cargo make --env APP_VERSION=${{ github.ref_name }} --profile production-mac-x86_64 appflowy - name: Create macOS dmg run: | @@ -229,21 +225,9 @@ jobs: fail-fast: false matrix: job: - - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-20.04, - extra-build-args: "", - flutter_profile: production-linux-x86_64, - } + - { arch: x86_64, target: x86_64-unknown-linux-gnu, os: ubuntu-20.04, extra-build-args: "", flutter_profile: production-linux-x86_64 } # - { arch: aarch64, target: aarch64-unknown-linux-gnu, os: ubuntu-20.04, extra-build-args: "", flutter_profile: production-linux-aarch64 } - - { - arch: x86_64, - target: x86_64-unknown-linux-gnu, - os: ubuntu-18.04, - extra-build-args: "", - flutter_profile: production-linux-x86_64, - } + - { arch: x86_64, target: x86_64-unknown-linux-gnu, os: ubuntu-18.04, extra-build-args: "", flutter_profile: production-linux-x86_64} steps: - name: Checkout source code uses: actions/checkout@v3 @@ -291,7 +275,7 @@ jobs: working-directory: frontend run: | flutter config --enable-linux-desktop - dart ./scripts/flutter_release_build/build_flowy.dart . ${{ github.ref_name }} + cargo make --env APP_VERSION=${{ github.ref_name }} --profile ${{ matrix.job.flutter_profile}} appflowy - name: Archive Assert working-directory: ${{ env.LINUX_APP_RELEASE_PATH }} @@ -377,4 +361,4 @@ jobs: - name: Notify Discord run: | curl -H "Content-Type: application/json" -d '{"username": "release@appflowy", "content": "🎉 AppFlowy ${{ github.ref_name }} is available. https://github.com/AppFlowy-IO/AppFlowy/releases/tag/'${{ github.ref_name }}'"}' "https://discord.com/api/webhooks/${{ secrets.DISCORD }}" - shell: bash + shell: bash \ No newline at end of file diff --git a/frontend/.vscode/tasks.json b/frontend/.vscode/tasks.json index 4f8a52c95ceec..227a5cbfba5ea 100644 --- a/frontend/.vscode/tasks.json +++ b/frontend/.vscode/tasks.json @@ -1,225 +1,223 @@ { - "version": "2.0.0", - // https://code.visualstudio.com/docs/editor/tasks - // https://gist.github.com/deadalusai/9e13e36d61ec7fb72148 - // ${workspaceRoot}: the root folder of the team - // ${file}: the current opened file - // ${fileBasename}: the current opened file's basename - // ${fileDirname}: the current opened file's dirname - // ${fileExtname}: the current opened file's extension - // ${cwd}: the current working directory of the spawned process - "tasks": [ - { - "label": "AF: Clean + Rebuild All", - "type": "shell", - "dependsOrder": "sequence", - "dependsOn": [ - "AF: Dart Clean", - "AF: Flutter Clean", - "AF: Build Appflowy Core", - "AF: Flutter Pub Get", - "AF: Flutter Package Get", - "AF: Generate Language Files", - "AF: Generate Freezed Files" - ], - "presentation": { - "reveal": "always", - "panel": "new" - } - }, - { - "label": "AF: Clean + Rebuild All (Android)", - "type": "shell", - "dependsOrder": "sequence", - "dependsOn": [ - "AF: Dart Clean", - "AF: Flutter Clean", - "AF: Build Appflowy Core_for_android", - "AF: Flutter Pub Get", - "AF: Flutter Package Get", - "AF: Generate Language Files", - "AF: Generate Freezed Files" - ], - "presentation": { - "reveal": "always", - "panel": "new" - } - }, - { - "label": "AF: Build Appflowy Core_for_android", - "type": "shell", - "command": "cargo make --profile development-android appflowy-core-dev-android", - "group": "build", - "options": { - "cwd": "${workspaceFolder}" - } - }, - { - "label": "AF: Build Appflowy Core", - "type": "shell", - "windows": { - "command": "cargo make --profile development-windows-x86 appflowy-core-dev" - }, - "linux": { - "command": "cargo make --profile \"development-linux-$(uname -m)\" appflowy-core-dev" - }, - "osx": { - "command": "cargo make --profile \"development-mac-$(uname -m)\" appflowy-core-dev" - }, - "group": "build", - "options": { - "cwd": "${workspaceFolder}" - } - }, - { - "label": "AF: Code Gen", - "type": "shell", - "dependsOrder": "sequence", - "dependsOn": [ - "AF: Flutter Clean", - "AF: Flutter Pub Get", - "AF: Flutter Package Get", - "AF: Generate Language Files", - "AF: Generate Freezed Files" - ], - "group": { - "kind": "build", - "isDefault": true - }, - "presentation": { - "reveal": "always", - "panel": "new" - } - }, - { - "label": "AF: Flutter Clean", - "type": "shell", - "command": "flutter clean", - "options": { - "cwd": "${workspaceFolder}/appflowy_flutter" - } - }, - { - "label": "AF: Flutter Pub Get", - "type": "shell", - "command": "flutter pub get", - "options": { - "cwd": "${workspaceFolder}/appflowy_flutter" - } - }, - { - "label": "AF: Flutter Package Get", - "type": "shell", - "command": "flutter packages pub get", - "options": { - "cwd": "${workspaceFolder}/appflowy_flutter" - } - }, - { - "label": "AF: Generate Freezed Files", - "type": "shell", - "command": "flutter pub run build_runner build --delete-conflicting-outputs", - "options": { - "cwd": "${workspaceFolder}/appflowy_flutter" - } - }, - { - "label": "AF: Generate Language Files", - "type": "shell", - "command": "sh ./scripts/generate_language_files.sh", - "windows": { - "options": { - "shell": { - "executable": "cmd.exe", - "args": [ - "/d", - "/c", - ".\\scripts\\generate_language_files.cmd" - ] - } - } - }, - "group": "build", - "options": { - "cwd": "${workspaceFolder}" - } - }, - { - "label": "AF: Flutter Clean", - "type": "shell", - "command": "cargo make flutter_clean", - "group": "build", - "options": { - "cwd": "${workspaceFolder}" - } - }, - { - "label": "AF: flutter build aar", - "type": "flutter", - "command": "flutter", - "args": [ - "build", - "aar" - ], - "group": "build", - "problemMatcher": [], - "detail": "appflowy_flutter" - }, - { - "label": "AF: Tauri UI Dev", - "type": "shell", - "isBackground": true, - "command": "yarn", - "args": [ - "dev" - ], - "options": { - "cwd": "${workspaceFolder}/appflowy_tauri" - } - }, - { - "label": "AF: Tauri UI Build", - "type": "shell", - "command": "npm run build", - "options": { - "cwd": "${workspaceFolder}/appflowy_tauri" - } - }, - { - "label": "AF: Tauri Dev", - "type": "shell", - "command": "npm run tauri:dev", - "options": { - "cwd": "${workspaceFolder}/appflowy_tauri" - } - }, - { - "label": "AF: Tauri Clean", - "type": "shell", - "command": "cargo make tauri_clean", - "options": { - "cwd": "${workspaceFolder}" - } - }, - { - "label": "AF: Tauri Clean + Dev", - "type": "shell", - "dependsOrder": "sequence", - "dependsOn": [ - "AF: Tauri Clean", - "AF: Tauri UI Dev" - ], - "options": { - "cwd": "${workspaceFolder}" - } - }, - { - "label": "AF: Tauri ESLint", - "type": "shell", - "command": "npx eslint --fix src", - "options": { - "cwd": "${workspaceFolder}/appflowy_tauri" - } - }, - ] -} + "version": "2.0.0", + // https://code.visualstudio.com/docs/editor/tasks + // https://gist.github.com/deadalusai/9e13e36d61ec7fb72148 + // ${workspaceRoot}: the root folder of the team + // ${file}: the current opened file + // ${fileBasename}: the current opened file's basename + // ${fileDirname}: the current opened file's dirname + // ${fileExtname}: the current opened file's extension + // ${cwd}: the current working directory of the spawned process + "tasks": [ + { + "label": "AF: Clean + Rebuild All", + "type": "shell", + "dependsOrder": "sequence", + "dependsOn": [ + "AF: Dart Clean", + "AF: Flutter Clean", + "AF: Build Appflowy Core", + "AF: Flutter Pub Get", + "AF: Flutter Package Get", + "AF: Generate Language Files", + "AF: Generate Freezed Files" + ], + "presentation": { + "reveal": "always", + "panel": "new" + } + }, + { + "label": "AF: Clean + Rebuild All (Android)", + "type": "shell", + "dependsOrder": "sequence", + "dependsOn": [ + "AF: Dart Clean", + "AF: Flutter Clean", + "AF: Build Appflowy Core_for_android", + "AF: Flutter Pub Get", + "AF: Flutter Package Get", + "AF: Generate Language Files", + "AF: Generate Freezed Files" + ], + "presentation": { + "reveal": "always", + "panel": "new" + } + }, + { + "label": "AF: Build Appflowy Core_for_android", + "type": "shell", + "command": "cargo make --profile development-android appflowy-core-dev-android", + "group": "build", + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "AF: Build Appflowy Core", + "type": "shell", + "windows": { + "command": "cargo make --profile development-windows-x86 appflowy-core-dev" + }, + "linux": { + "command": "cargo make --profile \"development-linux-$(uname -m)\" appflowy-core-dev" + }, + "osx": { + "command": "cargo make --profile \"development-mac-$(uname -m)\" appflowy-core-dev" + }, + "group": "build", + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "AF: Code Gen", + "type": "shell", + "dependsOrder": "sequence", + "dependsOn": [ + "AF: Flutter Clean", + "AF: Flutter Pub Get", + "AF: Flutter Package Get", + "AF: Generate Language Files", + "AF: Generate Freezed Files" + ], + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "reveal": "always", + "panel": "new" + } + }, + { + "label": "AF: Flutter Clean", + "type": "shell", + "command": "flutter clean", + "options": { + "cwd": "${workspaceFolder}/appflowy_flutter" + } + }, + { + "label": "AF: Flutter Pub Get", + "type": "shell", + "command": "flutter pub get", + "options": { + "cwd": "${workspaceFolder}/appflowy_flutter" + } + }, + { + "label": "AF: Flutter Package Get", + "type": "shell", + "command": "flutter packages pub get", + "options": { + "cwd": "${workspaceFolder}/appflowy_flutter" + } + }, + { + "label": "AF: Generate Freezed Files", + "type": "shell", + "command": "flutter pub run build_runner build --delete-conflicting-outputs", + "options": { + "cwd": "${workspaceFolder}/appflowy_flutter" + } + }, + { + "label": "AF: Generate Language Files", + "type": "shell", + "command": "sh ./scripts/generate_language_files.sh", + "windows": { + "options": { + "shell": { + "executable": "cmd.exe", + "args": [ + "/d", + "/c", + ".\\scripts\\generate_language_files.cmd" + ] + } + } + }, + "group": "build", + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "AF: Flutter Clean", + "type": "shell", + "command": "cargo make flutter_clean", + "group": "build", + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "AF: flutter build aar", + "type": "flutter", + "command": "flutter", + "args": [ + "build", + "aar" + ], + "group": "build", + "problemMatcher": [], + "detail": "appflowy_flutter" + }, + { + "label": "AF: Tauri UI Dev", + "type": "shell", + "isBackground": true, + "command": "yarn", + "args": ["dev"], + "options": { + "cwd": "${workspaceFolder}/appflowy_tauri" + } + }, + { + "label": "AF: Tauri UI Build", + "type": "shell", + "command": "npm run build", + "options": { + "cwd": "${workspaceFolder}/appflowy_tauri" + } + }, + { + "label": "AF: Tauri Dev", + "type": "shell", + "command": "npm run tauri:dev", + "options": { + "cwd": "${workspaceFolder}/appflowy_tauri" + } + }, + { + "label": "AF: Tauri Clean", + "type": "shell", + "command": "cargo make tauri_clean", + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "AF: Tauri Clean + Dev", + "type": "shell", + "dependsOrder": "sequence", + "dependsOn": [ + "AF: Tauri Clean", + "AF: Tauri UI Dev" + ], + "options": { + "cwd": "${workspaceFolder}" + } + }, + { + "label": "AF: Tauri ESLint", + "type": "shell", + "command": "npx eslint --fix src", + "options": { + "cwd": "${workspaceFolder}/appflowy_tauri" + } + }, + ] +} \ No newline at end of file diff --git a/frontend/appflowy_flutter/.gitignore b/frontend/appflowy_flutter/.gitignore index 82c35e91cdf0a..e77b1c9f0f234 100644 --- a/frontend/appflowy_flutter/.gitignore +++ b/frontend/appflowy_flutter/.gitignore @@ -40,7 +40,7 @@ lib/generated_plugin_registrant.dart lib/generated/ # Freezed generated files -*.g.dart +*.g.dart *.freezed.dart # Symbolication related @@ -67,4 +67,4 @@ windows/flutter/dart_ffi/ **/**/*.so **/**/Brewfile.lock.json **/.sandbox -**/.vscode/ +**/.vscode/ \ No newline at end of file diff --git a/frontend/appflowy_flutter/assets/test/workspaces/board.zip b/frontend/appflowy_flutter/assets/test/workspaces/board.zip deleted file mode 100644 index 1a8f6b0dd4c00ccad1154addbfc8829cae953731..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9394 zcmb_?WmFtnw=Eb0t+ET#2mqs~Qv+z96$)&)ibO2-@T5`DX&EE!{E zn_JJ;<73apeKO7WFmu{$`k8hN!#LhQFk{>wpikQ3LLth)P30?5GNm>tQW+$HaY_ut%&OCkP z{v?lLNYh*{AIcQ?h6()+_2gAbUG6clk^yy!&xd};mXAyqAVNR5Sv2O~W0ATg$qK>` z;fSBz;bLwGzIVOg(jirAi0uF-UDffvTs<5%C6LKF z-NBmbntqL6=E8xWeUEj~+>07(nZ-Y#N!=@ORL9gRF1Qxl_mK zW%7kt?`!M^kj98_IJF3f<8Ai1=4JP(f-GYn%cMEjwT5t8@C#paR$rO75x9;}IbXw$ zs6$$#$(s)}wURv&HCLhf&Yh}}=_`ES>wZ}#qhO9;Qk4TU#!=0Z6Umg`tvn!W^t8nU zB<8IN(oGmrb=1ugYf_k#8T2?!PJ_r$d0reFjFZe5Dxosc|GP4w^bOCud1L{DIFGbS zRjTaF_ldzu2Jr>Iykbz#ljYSXv#^9hmnJ7rvYT^Qir=ROA@VG^$+3Pfr+tI~-Hqmo z!s}G;Sq|vVP}!7CO}#xeRzg_2ic+~uTME#d6Pc1voAcP;uuEDHZ=h;PkXy`~vjrd8 zcJ#?bW+~niC0AhlPR9v5AF%uUVNxDog+)yry#el36r%ZDq~=v*duo~CAgU)blos!y zkLWr3iqg5e2cX5Z6g&^DY4a(Movi0j@p=u_v0BP>YuT{IFb4@P*Z36=tNJSTVf9yvb<#!QjN&VSKh=Fnh`9{3 z{fO;Id=C3yyY$Cvu68C11Idtp|Cefj`YizR$>sob-Xf|a*el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blfT>?wX$w+gVd3 z?o=e+J=Gm=1iB=qK`^*|MXTIc7cAbv?pp9K7P46|3?fv-HgG4eaqhFQMjcZprEusv_z&L_iK@4JSZwr>dA=rh(QK zAT^2}p9CFIZFjb8-r7ZBCEA4+I8^&8w?=L~e(B@DajXtVgxRF=I)ZIh`Nj`8kH6La3lsD z>kOBwo3xe?Isa3QDUzFQ=Li&veOJdQ-m0I?_1XC`!J8Q}VM$|D+94hy_Bo%I4MljimPD)~JgV`OZX?HM90&1^$cFT% zowbl}i;L=`Tc5R6_!ro4|M&lG{zwscxQ~Bk%KyvXH~;qdKkK#sa`o=H!+iZWMEuX{ z?Y~3&L-_r#`t2W%{uP?^|L*9&sk#3S@n6dDf5okTdoF$^?*BkBd1-{_so>yVJs*JQ KT(lzlWAq<&!L$JY diff --git a/frontend/appflowy_flutter/assets/test/workspaces/empty_document.zip b/frontend/appflowy_flutter/assets/test/workspaces/empty_document.zip deleted file mode 100644 index 1399d640ad8685e174663104cdf739243dff09e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7906 zcma)>1z1~4xA%cUfnvoe+EOU)?u7!yLUDI1!QG{W;_eMv+#QM&C?!xFQY5$*O_AVw zIns09d){-u=Sz0>&OCeOKYRAGX3cNbQc-+>N`&;=rym%o_4}VcPjvTJOM53bZ(|Eb zb9Z}72R9CG3lBSKO%*{|pqh$+6|a`Mjh8Kl%AX1tzbm|Sf?Okr@0-3vLE`)WRIsvh z^z>%4Fm*FEGj+9Ow=mnwGPI+Bx%UYrORLo}&MwA92<&<(?aQjM&Rr)mmcrbaKoiWV z7N8e!KCJQ&%5a3}vUYtjkrP%}GwtNKdPy zg{{oV8E3}GJU?V4jT>T>ZTTTQAMX2(M~j6=6j zsuS5dQ?^1NhkC>V!G#^hI%`T0ZLev=VeX<7pNYYDo4~azeIvary+=|}!-m;rb%JRnnsSQ>HNm=6S@?-e@)SMoQL8k?9#L?z zLWyS^6u!Q){4O{PJTuUvPXJ>VY4-8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w5AlDZ8DaeOJ# zJ8*GQaPjn6B?f6fdyhr3j20&puB$(cArvl#C4rwxJ7(FF*W|{+BBY71z`@Kc7neLH$7=J8x%~i+@IWUa)n#ePYfD3< zpr;sr9@o1DXBe-{;K?Dp1J+45cmQbtQRtWVPT&Urt9+@)sFJ@Q7c{lLO=Ir|iyT$dwIj@@Qd)~Ll2xFS?ts!V zt41r($WMsW>xlBn%GOOUYSo=o?Q*pwW|C6df-0ZvI(>t!9d|&m9lNt_k!gDBPn~7@ zSlbKg@#~#WDuN&1sho`TFa(<;fMX*3emA>G(~hAyIU&?BZ@FEK)CC$Jym9Dn!q}*z zoRD)U`QdjqV&>f&(nvYU!#iDFS|+QZ?a3zN%4=rbx+ZUCy8jI0RpJCH?kD7qca|d* zKRo?|#azR(27>)^PlXugxV0JrL%m?lCO zQ#lCc$?c){)={aHK>OP0C_~#KN)uUl#hbKQIgZ z0vBAB?(hx%&3v!ENdfrDuwDRaCBTMZkUFr6_!fZ`0?y=^Pht5F~;A zP4s8ZMsw{&-G>Y+ipVHLzt7Hp&%OS^!H@sA{Bs8XADP%+ivOOA{Y?rP>FNDh>i+i+ zpYX4W|CO2j`=K$A{%xVY*Zs4LaFYM(;{UyD|5N&(KJ0Jl{wMz>{kum~QAB(ATP@W4 OuiAYYz=!I$(*FPoSld_t diff --git a/frontend/appflowy_flutter/assets/translations/en.json b/frontend/appflowy_flutter/assets/translations/en.json index dd3435c19a590..a00a49ceb8e86 100644 --- a/frontend/appflowy_flutter/assets/translations/en.json +++ b/frontend/appflowy_flutter/assets/translations/en.json @@ -326,8 +326,7 @@ "checklist": { "panelTitle": "Add an item" }, - "menuName": "Grid", - "referencedGridPrefix": "View of" + "menuName": "Grid" }, "document": { "menuName": "Document", @@ -391,8 +390,7 @@ "column": { "create_new_card": "New" }, - "menuName": "Board", - "referencedBoardPrefix": "View of" + "menuName": "Board" }, "calendar": { "menuName": "Calendar", diff --git a/frontend/appflowy_flutter/integration_test/board_test.dart b/frontend/appflowy_flutter/integration_test/board_test.dart deleted file mode 100644 index 3900843207d68..0000000000000 --- a/frontend/appflowy_flutter/integration_test/board_test.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:appflowy_board/appflowy_board.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:integration_test/integration_test.dart'; -import 'util/util.dart'; - -/// Integration tests for an empty board. The [TestWorkspaceService] will load -/// a workspace from an empty board `assets/test/workspaces/board.zip` for all -/// tests. -/// -/// To create another integration test with a preconfigured workspace. -/// Use the following steps. -/// 1. Create a new workspace from the AppFlowy launch screen. -/// 2. Modify the workspace until it is suitable as the starting point for -/// the integration test you need to land. -/// 3. Use a zip utility program to zip the workspace folder that you created. -/// 4. Add the zip file under `assets/test/workspaces/` -/// 5. Add a new enumeration to [TestWorkspace] in `integration_test/utils/data.dart`. -/// For example, if you added a workspace called `empty_calendar.zip`, -/// then [TestWorkspace] should have the following value: -/// ```dart -/// enum TestWorkspace { -/// board('board'), -/// empty_calendar('empty_calendar'); -/// -/// /* code */ -/// } -/// ``` -/// 6. Double check that the .zip file that you added is included as an asset in -/// the pubspec.yaml file under appflowy_flutter. -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - const service = TestWorkspaceService(TestWorkspace.board); - - group('board', () { - setUpAll(() async => await service.setUpAll()); - setUp(() async => await service.setUp()); - - testWidgets('integration test unzips the proper workspace and loads it correctly.', (tester) async { - await tester.initializeAppFlowy(); - expect(find.byType(AppFlowyBoard), findsOneWidget); - }); - }); -} diff --git a/frontend/appflowy_flutter/integration_test/empty_document_test.dart b/frontend/appflowy_flutter/integration_test/empty_document_test.dart deleted file mode 100644 index 51f92c4c35042..0000000000000 --- a/frontend/appflowy_flutter/integration_test/empty_document_test.dart +++ /dev/null @@ -1,120 +0,0 @@ -import 'package:appflowy/plugins/document/presentation/plugins/base/built_in_page_widget.dart'; -import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:integration_test/integration_test.dart'; -import 'util/keyboard.dart'; -import 'util/util.dart'; - -/// Integration tests for an empty document. The [TestWorkspaceService] will load a workspace from an empty document `assets/test/workspaces/empty_document.zip` for all tests. -/// -/// To create another integration test with a preconfigured workspace. Use the following steps: -/// 1. Create a new workspace from the AppFlowy launch screen. -/// 2. Modify the workspace until it is suitable as the starting point for the integration test you need to land. -/// 3. Use a zip utility program to zip the workspace folder that you created. -/// 4. Add the zip file under `assets/test/workspaces/` -/// 5. Add a new enumeration to [TestWorkspace] in `integration_test/utils/data.dart`. For example, if you added a workspace called `empty_calendar.zip`, then [TestWorkspace] should have the following value: -/// ```dart -/// enum TestWorkspace { -/// board('board'), -/// empty_calendar('empty_calendar'); -/// -/// /* code */ -/// } -/// ``` -/// 6. Double check that the .zip file that you added is included as an asset in the pubspec.yaml file under appflowy_flutter. -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - const service = TestWorkspaceService(TestWorkspace.emptyDocument); - - group('Tests on a workspace with only an empty document', () { - setUpAll(() async => await service.setUpAll()); - setUp(() async => await service.setUp()); - - testWidgets('/board shortcut creates a new board and view of the board', (tester) async { - await tester.initializeAppFlowy(); - - // Needs tab to obtain focus for the app flowy editor. - // by default the tap appears at the center of the widget. - final Finder editor = find.byType(AppFlowyEditor); - await tester.tap(editor); - await tester.pumpAndSettle(); - - // tester.sendText() cannot be used since the editor - // does not contain any EditableText widgets. - // to interact with the app during an integration test, - // simulate physical keyboard events. - await FlowyTestKeyboard.simulateKeyDownEvent([ - LogicalKeyboardKey.slash, - LogicalKeyboardKey.keyB, - LogicalKeyboardKey.keyO, - LogicalKeyboardKey.keyA, - LogicalKeyboardKey.keyR, - LogicalKeyboardKey.keyD, - LogicalKeyboardKey.arrowDown, - ], tester: tester); - - // Checks whether the options in the selection menu - // for /board exist. - expect(find.byType(SelectionMenuItemWidget), findsAtLeastNWidgets(2)); - - // Finalizes the slash command that creates the board. - await FlowyTestKeyboard.simulateKeyDownEvent([ - LogicalKeyboardKey.enter, - ], tester: tester); - - // Checks whether new board is referenced and properly on the page. - expect(find.byType(BuiltInPageWidget), findsOneWidget); - - // Checks whether the new database was created - const newBoardLabel = "Untitled"; - expect(find.text(newBoardLabel), findsOneWidget); - - // Checks whether a view of the database was created - const viewOfBoardLabel = "View of Untitled"; - expect(find.text(viewOfBoardLabel), findsNWidgets(2)); - }); - - testWidgets('/grid shortcut creates a new grid and view of the grid', (tester) async { - await tester.initializeAppFlowy(); - - // Needs tab to obtain focus for the app flowy editor. - // by default the tap appears at the center of the widget. - final Finder editor = find.byType(AppFlowyEditor); - await tester.tap(editor); - await tester.pumpAndSettle(); - - // tester.sendText() cannot be used since the editor - // does not contain any EditableText widgets. - // to interact with the app during an integration test, - // simulate physical keyboard events. - await FlowyTestKeyboard.simulateKeyDownEvent([ - LogicalKeyboardKey.slash, - LogicalKeyboardKey.keyG, - LogicalKeyboardKey.keyR, - LogicalKeyboardKey.keyI, - LogicalKeyboardKey.keyD, - LogicalKeyboardKey.arrowDown, - ], tester: tester); - - // Checks whether the options in the selection menu - // for /grid exist. - expect(find.byType(SelectionMenuItemWidget), findsAtLeastNWidgets(2)); - - // Finalizes the slash command that creates the board. - await simulateKeyDownEvent(LogicalKeyboardKey.enter); - await tester.pumpAndSettle(); - - // Checks whether new board is referenced and properly on the page. - expect(find.byType(BuiltInPageWidget), findsOneWidget); - - // Checks whether the new database was created - const newTableLabel = "Untitled"; - expect(find.text(newTableLabel), findsOneWidget); - - // Checks whether a view of the database was created - const viewOfTableLabel = "View of Untitled"; - expect(find.text(viewOfTableLabel), findsNWidgets(2)); - }); - }); -} diff --git a/frontend/appflowy_flutter/integration_test/runner.dart b/frontend/appflowy_flutter/integration_test/runner.dart deleted file mode 100644 index 1592cccb9375f..0000000000000 --- a/frontend/appflowy_flutter/integration_test/runner.dart +++ /dev/null @@ -1,19 +0,0 @@ -import 'package:integration_test/integration_test.dart'; - -import 'board_test.dart' as board_test; -import 'switch_folder_test.dart' as switch_folder_test; -import 'empty_document_test.dart' as empty_document_test; - -/// The main task runner for all integration tests in AppFlowy. -/// -/// Having a single entrypoint for integration tests is necessary due to an -/// [issue caused by switching files with integration testing](https://github.com/flutter/flutter/issues/101031). -/// If flutter/flutter#101031 is resolved, this file can be removed completely. -/// Once removed, the integration_test.yaml must be updated to exclude this as -/// as the test target. -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - switch_folder_test.main(); - board_test.main(); - empty_document_test.main(); -} diff --git a/frontend/appflowy_flutter/integration_test/switch_folder_test.dart b/frontend/appflowy_flutter/integration_test/switch_folder_test.dart index 6dcd41b081644..555a5e41b1b37 100644 --- a/frontend/appflowy_flutter/integration_test/switch_folder_test.dart +++ b/frontend/appflowy_flutter/integration_test/switch_folder_test.dart @@ -1,5 +1,10 @@ +import 'package:appflowy/generated/locale_keys.g.dart'; +import 'package:appflowy/plugins/document/presentation/plugins/base/built_in_page_widget.dart'; import 'package:appflowy/user/presentation/folder/folder_widget.dart'; +import 'package:appflowy_editor/appflowy_editor.dart'; +import 'package:easy_localization/easy_localization.dart'; import 'package:flowy_infra_ui/style_widget/text_field.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; @@ -157,5 +162,135 @@ void main() { await TestFolder.currentLocation(), ); }); + + testWidgets('/board shortcut creates a new board', (tester) async { + const folderName = 'appflowy'; + await TestFolder.cleanTestLocation(folderName); + await TestFolder.setTestLocation(folderName); + + await tester.initializeAppFlowy(); + + // tap open button + await mockGetDirectoryPath(folderName); + await tester.tapOpenFolderButton(); + + await tester.wait(1000); + await tester.expectToSeeWelcomePage(); + + final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + // Necessary for being able to enterText when not in debug mode + binding.testTextInput.register(); + + // Needs tab to obtain focus for the app flowy editor. + // by default the tap appears at the center of the widget. + final Finder editor = find.byType(AppFlowyEditor); + await tester.tap(editor); + await tester.pumpAndSettle(); + + // tester.sendText() cannot be used since the editor + // does not contain any EditableText widgets. + // to interact with the app during an integration test, + // simulate physical keyboard events. + await simulateKeyDownEvent(LogicalKeyboardKey.enter); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.enter); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.arrowLeft); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.slash); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.keyB); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.keyO); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.keyA); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.keyR); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.keyD); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown); + await tester.pumpAndSettle(); + + // Checks whether the options in the selection menu + // for /board exist. + expect(find.byType(SelectionMenuItemWidget), findsAtLeastNWidgets(2)); + + // Finalizes the slash command that creates the board. + await simulateKeyDownEvent(LogicalKeyboardKey.enter); + await tester.pumpAndSettle(); + + // Checks whether new board is referenced and properly on the page. + expect(find.byType(BuiltInPageWidget), findsOneWidget); + + // Checks whether the new board is in the side bar. + final sidebarLabel = LocaleKeys.newPageText.tr(); + expect(find.text(sidebarLabel), findsOneWidget); + }); + + testWidgets('/grid shortcut creates a new grid', (tester) async { + const folderName = 'appflowy'; + await TestFolder.cleanTestLocation(folderName); + await TestFolder.setTestLocation(folderName); + + await tester.initializeAppFlowy(); + + // tap open button + await mockGetDirectoryPath(folderName); + await tester.tapOpenFolderButton(); + + await tester.wait(1000); + await tester.expectToSeeWelcomePage(); + + final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + + // Necessary for being able to enterText when not in debug mode + binding.testTextInput.register(); + + // Needs tab to obtain focus for the app flowy editor. + // by default the tap appears at the center of the widget. + final Finder editor = find.byType(AppFlowyEditor); + await tester.tap(editor); + await tester.pumpAndSettle(); + + // tester.sendText() cannot be used since the editor + // does not contain any EditableText widgets. + // to interact with the app during an integration test, + // simulate physical keyboard events. + await simulateKeyDownEvent(LogicalKeyboardKey.enter); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.enter); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.arrowLeft); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.slash); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.keyG); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.keyR); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.keyI); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.keyD); + await tester.pumpAndSettle(); + await simulateKeyDownEvent(LogicalKeyboardKey.arrowDown); + await tester.pumpAndSettle(); + + // Checks whether the options in the selection menu + // for /grid exist. + expect(find.byType(SelectionMenuItemWidget), findsAtLeastNWidgets(2)); + + // Finalizes the slash command that creates the board. + await simulateKeyDownEvent(LogicalKeyboardKey.enter); + await tester.pumpAndSettle(); + + // Checks whether new board is referenced and properly on the page. + expect(find.byType(BuiltInPageWidget), findsOneWidget); + + // Checks whether the new board is in the side bar. + final sidebarLabel = LocaleKeys.newPageText.tr(); + expect(find.text(sidebarLabel), findsOneWidget); + }); }); } diff --git a/frontend/appflowy_flutter/integration_test/util/data.dart b/frontend/appflowy_flutter/integration_test/util/data.dart deleted file mode 100644 index a527950489a14..0000000000000 --- a/frontend/appflowy_flutter/integration_test/util/data.dart +++ /dev/null @@ -1,66 +0,0 @@ -import 'dart:io'; - -import 'package:appflowy/workspace/application/settings/settings_location_cubit.dart'; -import 'package:archive/archive_io.dart'; -import 'package:flutter/services.dart'; -import 'package:path/path.dart' as p; -import 'package:path_provider/path_provider.dart'; -import 'package:shared_preferences/shared_preferences.dart'; - -enum TestWorkspace { - board("board"), - emptyDocument("empty_document"); - - const TestWorkspace(this._name); - - final String _name; - - Future get zip async { - final Directory parent = await TestWorkspace._parent; - final File out = File(p.join(parent.path, '$_name.zip')); - if (await out.exists()) return out; - await out.create(); - final ByteData data = await rootBundle.load(_asset); - await out.writeAsBytes(data.buffer.asUint8List()); - return out; - } - - Future get root async { - final Directory parent = await TestWorkspace._parent; - return Directory(p.join(parent.path, _name)); - } - - static Future get _parent async { - final Directory root = await getTemporaryDirectory(); - if (await root.exists()) return root; - await root.create(); - return root; - } - - String get _asset => 'assets/test/workspaces/$_name.zip'; -} - -class TestWorkspaceService { - const TestWorkspaceService(this.workspace); - - final TestWorkspace workspace; - - /// Instructs the application to read workspace data from the workspace found under this [TestWorkspace]'s path. - Future setUpAll() async { - SharedPreferences.setMockInitialValues( - { - kSettingsLocationDefaultLocation: - await workspace.root.then((value) => value.path), - }, - ); - } - - /// Workspaces that are checked into source are compressed. [TestWorkspaceService.setUp()] decompresses the file into an ephemeral directory that will be ignored by source control. - Future setUp() async { - final inputStream = - InputFileStream(await workspace.zip.then((value) => value.path)); - final archive = ZipDecoder().decodeBuffer(inputStream); - extractArchiveToDisk( - archive, await TestWorkspace._parent.then((value) => value.path)); - } -} diff --git a/frontend/appflowy_flutter/integration_test/util/keyboard.dart b/frontend/appflowy_flutter/integration_test/util/keyboard.dart deleted file mode 100644 index 02bbdb79f1fa2..0000000000000 --- a/frontend/appflowy_flutter/integration_test/util/keyboard.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart' as flutter_test; - -class FlowyTestKeyboard { - static Future simulateKeyDownEvent(List keys, - {required flutter_test.WidgetTester tester}) async { - for (final LogicalKeyboardKey key in keys) { - await flutter_test.simulateKeyDownEvent(key); - await tester.pumpAndSettle(); - } - } -} diff --git a/frontend/appflowy_flutter/integration_test/util/util.dart b/frontend/appflowy_flutter/integration_test/util/util.dart index 20606483d3d03..1b4b7c327221c 100644 --- a/frontend/appflowy_flutter/integration_test/util/util.dart +++ b/frontend/appflowy_flutter/integration_test/util/util.dart @@ -1,4 +1,3 @@ export 'base.dart'; export 'launch.dart'; export 'settings.dart'; -export 'data.dart'; diff --git a/frontend/appflowy_flutter/lib/plugins/database_view/application/database_service.dart b/frontend/appflowy_flutter/lib/plugins/database_view/application/database_service.dart index b6ca40b630a21..4d12cae83939c 100644 --- a/frontend/appflowy_flutter/lib/plugins/database_view/application/database_service.dart +++ b/frontend/appflowy_flutter/lib/plugins/database_view/application/database_service.dart @@ -5,7 +5,7 @@ import 'package:dartz/dartz.dart'; class DatabaseBackendService { static Future, FlowyError>> - getAllDatabases() { + getAllDatabase() { return DatabaseEventGetDatabases().send().then((result) { return result.fold((l) => left(l.items), (r) => right(r)); }); diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/base/insert_page_command.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/base/insert_page_command.dart index ff12cc9afde0d..8d4afd917e7b9 100644 --- a/frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/base/insert_page_command.dart +++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/plugins/base/insert_page_command.dart @@ -1,55 +1,20 @@ -import 'package:appflowy/generated/locale_keys.g.dart'; -import 'package:appflowy/plugins/database_view/application/database_view_service.dart'; import 'package:appflowy/plugins/document/presentation/plugins/board/board_node_widget.dart'; import 'package:appflowy/plugins/document/presentation/plugins/grid/grid_node_widget.dart'; -import 'package:appflowy/workspace/application/app/app_service.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/app.pb.dart'; import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart'; import 'package:appflowy_editor/appflowy_editor.dart'; -import 'package:easy_localization/easy_localization.dart'; const String kAppID = 'app_id'; const String kViewID = 'view_id'; extension InsertPage on EditorState { - Future insertPage(AppPB appPB, ViewPB viewPB) async { + void insertPage(AppPB appPB, ViewPB viewPB) { final selection = service.selectionService.currentSelection.value; final textNodes = service.selectionService.currentSelectedNodes.whereType(); if (selection == null || textNodes.isEmpty) { return; } - - // get the database that the view is associated with - final database = - await DatabaseViewBackendService(viewId: viewPB.id).openGrid().then( - (value) => value.getLeftOrNull(), - ); - - if (database == null) { - throw StateError( - 'The database associated with ${viewPB.id} could not be found while attempting to create a referenced ${viewPB.layout.name}.'); - } - - final prefix = referencedBoardPrefix(viewPB.layout); - - final ref = await AppBackendService().createView( - appId: appPB.id, - name: "$prefix ${viewPB.name}", - desc: appPB.desc, - layoutType: viewPB.layout, - ext: { - 'database_id': database.id, - }, - ).then( - (value) => value.getLeftOrNull(), - ); - - // TODO(a-wallen): Show error dialog here. - if (ref == null) { - return; - } - final transaction = this.transaction; transaction.insertNode( selection.end.path, @@ -57,24 +22,13 @@ extension InsertPage on EditorState { type: _convertPageType(viewPB), attributes: { kAppID: appPB.id, - kViewID: ref.id, + kViewID: viewPB.id, }, ), ); apply(transaction); } - String referencedBoardPrefix(ViewLayoutTypePB layout) { - switch (layout) { - case ViewLayoutTypePB.Grid: - return LocaleKeys.grid_referencedGridPrefix.tr(); - case ViewLayoutTypePB.Board: - return LocaleKeys.board_referencedBoardPrefix.tr(); - default: - throw UnimplementedError(); - } - } - String _convertPageType(ViewPB viewPB) { switch (viewPB.layout) { case ViewLayoutTypePB.Grid: diff --git a/frontend/appflowy_flutter/pubspec.yaml b/frontend/appflowy_flutter/pubspec.yaml index 613b205df16df..801a0625348b2 100644 --- a/frontend/appflowy_flutter/pubspec.yaml +++ b/frontend/appflowy_flutter/pubspec.yaml @@ -95,7 +95,6 @@ dependencies: http: ^0.13.5 json_annotation: ^4.7.0 path: ^1.8.2 - archive: ^3.3.0 dev_dependencies: flutter_lints: ^2.0.1 @@ -164,8 +163,30 @@ flutter: - assets/images/common/ - assets/images/grid/setting/ - assets/translations/ + # - images/a_dot_ham.jpeg - # The following assets will be excluded in release. - # BEGIN: EXCLUDE_IN_RELEASE - - assets/test/workspaces/ - # END: EXCLUDE_IN_RELEASE + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/frontend/scripts/flutter_release_build/build_flowy.dart b/frontend/scripts/flutter_release_build/build_flowy.dart deleted file mode 100644 index a7c2a9ada47d9..0000000000000 --- a/frontend/scripts/flutter_release_build/build_flowy.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'dart:io'; - -part 'tool.dart'; - -const excludeTagBegin = 'BEGIN: EXCLUDE_IN_RELEASE'; -const excludeTagEnd = 'END: EXCLUDE_IN_RELEASE'; - -Future main(List args) async { - const help = ''' -A build script that modifies build assets before building the release version of AppFlowy. - -args[0]: The directory that contains the AppFlowy git repository. Should be the parent to appflowy_flutter. (absolute path) -args[1]: The appflowy version to be built (github ref_name). -'''; - const numArgs = 2; - assert(args.length == numArgs, - 'Expected ${numArgs}, got ${args.length}. Read the following for instructions about how to use this script.\n\n$help'); - if (args[0] == '-h' || args[0] == '--help') { - stdout.write(help); - stdout.flush(); - } - final repositoryRoot = Directory(args[0]); - assert(await repositoryRoot.exists(), - '$repositoryRoot is an invalid directory. Please try again with a valid directory.\n\n$help'); - final appVersion = args[1]; - await _BuildTool(repositoryRoot: repositoryRoot.path, appVersion: appVersion) - .run(); -} diff --git a/frontend/scripts/flutter_release_build/tool.dart b/frontend/scripts/flutter_release_build/tool.dart deleted file mode 100644 index 36a0a2f177039..0000000000000 --- a/frontend/scripts/flutter_release_build/tool.dart +++ /dev/null @@ -1,115 +0,0 @@ -part of 'build_flowy.dart'; - -enum _ScanMode { - ignore, - target, -} - -enum _ModifyMode { - include, - exclude, -} - -class _BuildTool { - const _BuildTool({ - required this.repositoryRoot, - required this.appVersion, - }); - - final String repositoryRoot; - final String appVersion; - - String get projectRoot => - [repositoryRoot, 'appflowy_flutter'].join(Platform.pathSeparator); - - File get pubspec => - File([projectRoot, 'pubspec.yaml'].join(Platform.pathSeparator)); - - Future get _architecture async => - await Process.run('uname', ['-m']).then((value) => value.stdout.trim()); - - Future get _commandForOS async { - // Check the operating system and CPU architecture - var os = Platform.operatingSystem; - var arch = Platform.isMacOS ? await _architecture : Platform.localHostname; - - // Determine the appropriate command based on the OS and architecture - if (os == 'windows') { - return 'cargo make --env APP_VERSION=$appVersion --profile production-windows-x86 appflowy'; - } - - if (os == 'linux') { - return 'cargo make --env APP_VERSION=$appVersion --profile production-linux-x86_64 appflowy'; - } - - if (os == 'macos') { - if (arch == 'x86_64') { - return 'cargo make --env APP_VERSION=$appVersion --profile production-mac-x86_64 appflowy'; - } - if (arch == 'arm64') { - return 'cargo make --env APP_VERSION=$appVersion --profile production-mac-arm64 appflowy'; - } - throw 'Unsupported CPU architecture: $arch'; - } - - throw 'Unsupported operating system: $os'; - } - - /// Scans a file for lines between # BEGIN: EXCLUDE_IN_RELEASE and - /// END: EXCLUDE_IN_RELEASE. Will add a comment to remove those assets - /// from the build. - Future _process_directives( - File file, { - required _ModifyMode mode, - }) async { - // Read the contents of the file into a list - var lines = await file.readAsLines(); - - // Find the lines between BEGIN: EXCLUDE_IN_RELEASE and END: EXCLUDE_IN_RELEASE - var scanMode = _ScanMode.ignore; - for (var i = 0; i < lines.length; i++) { - var line = lines[i]; - if (line.contains(excludeTagBegin)) { - scanMode = _ScanMode.target; - } else if (line.contains(excludeTagEnd)) { - scanMode = _ScanMode.ignore; - } else if (scanMode == _ScanMode.target) { - lines[i] = _modify(line, mode: mode); - } - } - - // Write the modified contents back to the file - await file.writeAsString(lines.join('\n')); - } - - String _modify(String line, {required _ModifyMode mode}) { - switch (mode) { - case _ModifyMode.include: - return line.split('#').where((element) => element != '#').join(); - case _ModifyMode.exclude: - return '#$line'; - } - } - - Future _build() async { - final cwd = Directory.current; - Directory.current = repositoryRoot; - - final cmd = await _commandForOS; - // Run the command using the Process.run() function - // final build = await Process.run('echo', ['hello'], runInShell: true); - final build = - await Process.start(cmd.split(' ')[0], cmd.split(' ').sublist(1)); - await stdout.addStream(build.stdout); - await stderr.addStream(build.stderr); - Directory.current = cwd; - } - - Future run() async { - final pubspec = this.pubspec; - - await _process_directives(pubspec, mode: _ModifyMode.exclude); - await _build(); - await _process_directives(pubspec, mode: _ModifyMode.include); - } -}