mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: calling user event from web (#4535)
* refactor: user manager * refactor: user manager * refactor: session location * refactor: user manager * chore: gen ts files * feat: implement indexeddb persistence * chore: integrate user manager * chore: update * chore: run on web thread * chore: run on web thread * chore: fix test * chore: add test * chore: add test * chore: add user & sign in with password * chore: fix test * chore: update docs * chore: fix warnings * chore: gen files * chore: add user * chore: add files * chore: update config * chore: update scirpt * chore: update scirpt * fix: build * chore: update command * fix: ci * ci: fix * fix: compile * fix: compile * fix: ci * fix: compile * fix: tauri build * chore: fix test * chore: fix test
This commit is contained in:
@ -5,15 +5,56 @@ script = [
|
||||
"""
|
||||
#!/bin/bash
|
||||
BASE_DIR=$(pwd)
|
||||
# crates=("lib-dispatch" "flowy-encrypt" "lib-infra" "flowy-notification" "flowy-date" "flowy-error" "collab-integrate" "flowy-document")
|
||||
crates=("flowy-document")
|
||||
crates=("lib-dispatch" "flowy-encrypt" "lib-infra" "flowy-notification" "flowy-date" "flowy-error" "collab-integrate" "flowy-document")
|
||||
|
||||
# Iterate over each crate and build it
|
||||
for crate in "${crates[@]}"; do
|
||||
echo "🔥🔥🔥 Building $crate with wasm-pack..."
|
||||
cd "$BASE_DIR/rust-lib/$crate" || { echo "Failed to enter directory $crate"; exit 1; }
|
||||
|
||||
wasm-pack build --features="wasm_build" || { echo "Build failed for $crate"; exit 1; }
|
||||
wasm-pack build --features="enable_wasm" || { echo "Build failed for $crate"; exit 1; }
|
||||
done
|
||||
"""
|
||||
]
|
||||
|
||||
|
||||
[tasks.web_clean]
|
||||
description = "Remove all the building artifacts"
|
||||
run_task = { name = [
|
||||
"rust_lib_clean",
|
||||
"rm_macro_build_cache",
|
||||
"rm_rust_generated_files",
|
||||
"rm_web_generated_protobuf_files",
|
||||
"rm_web_generated_event_files",
|
||||
] }
|
||||
|
||||
|
||||
[tasks.rm_web_generated_protobuf_files]
|
||||
private = true
|
||||
script = ["""
|
||||
protobuf_file_paths = glob_array ${WEB_BACKEND_SERVICE_PATH}/models
|
||||
if not array_is_empty ${protobuf_file_paths}
|
||||
echo Remove generated protobuf files:
|
||||
for path in ${protobuf_file_paths}
|
||||
echo remove ${path}
|
||||
rm -rf ${path}
|
||||
end
|
||||
end
|
||||
"""]
|
||||
script_runner = "@duckscript"
|
||||
|
||||
|
||||
|
||||
[tasks.rm_web_generated_event_files]
|
||||
private = true
|
||||
script = ["""
|
||||
event_file_paths = glob_array ${WEB_BACKEND_SERVICE_PATH}/events
|
||||
if not array_is_empty ${event_file_paths}
|
||||
echo Remove generated protobuf files:
|
||||
for path in ${event_file_paths}
|
||||
echo remove ${path}
|
||||
rm -rf ${path}
|
||||
end
|
||||
end
|
||||
"""]
|
||||
script_runner = "@duckscript"
|
@ -8,12 +8,12 @@ fi
|
||||
|
||||
NEW_REV="$1"
|
||||
echo "New revision: $NEW_REV"
|
||||
directories=("rust-lib" "appflowy_tauri/src-tauri")
|
||||
directories=("rust-lib" "appflowy_tauri/src-tauri" "appflowy_web/wasm-libs")
|
||||
|
||||
for dir in "${directories[@]}"; do
|
||||
echo "Updating $dir"
|
||||
pushd "$dir" > /dev/null
|
||||
|
||||
cd "$dir"
|
||||
sed -i.bak "/^client-api[[:alnum:]-]*[[:space:]]*=/s/rev = \"[a-fA-F0-9]\{6,40\}\"/rev = \"$NEW_REV\"/g" Cargo.toml
|
||||
|
||||
# Detect changed crates
|
||||
@ -25,6 +25,5 @@ for dir in "${directories[@]}"; do
|
||||
cargo update -p $crate
|
||||
done
|
||||
|
||||
cd ..
|
||||
popd > /dev/null
|
||||
done
|
||||
|
||||
|
@ -8,12 +8,12 @@ fi
|
||||
|
||||
NEW_REV="$1"
|
||||
echo "New revision: $NEW_REV"
|
||||
directories=("rust-lib" "appflowy_tauri/src-tauri")
|
||||
directories=("rust-lib" "appflowy_tauri/src-tauri" "appflowy_web/wasm-libs")
|
||||
|
||||
for dir in "${directories[@]}"; do
|
||||
echo "Updating $dir"
|
||||
pushd "$dir" > /dev/null
|
||||
|
||||
cd "$dir"
|
||||
sed -i.bak "/^collab[[:alnum:]-]*[[:space:]]*=/s/rev = \"[a-fA-F0-9]\{6,40\}\"/rev = \"$NEW_REV\"/g" Cargo.toml
|
||||
|
||||
# Detect changed crates
|
||||
@ -30,6 +30,6 @@ for dir in "${directories[@]}"; do
|
||||
echo "Updating crates: $crates_to_update"
|
||||
cargo update $crates_to_update
|
||||
|
||||
cd ..
|
||||
popd > /dev/null
|
||||
done
|
||||
|
||||
|
Reference in New Issue
Block a user