A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix(ci): generate locale and channel files before typecheck (#2320)
Hampus2d77f36a0ba5
diff --git a/.devcontainer/verify.sh b/.devcontainer/verify.shindex af121f106..bcee96460 100755--- a/.devcontainer/verify.sh+++ b/.devcontainer/verify.sh@@ -70,6 +70,7 @@ stage "app: typecheck" pnpm --filter fluxer_app typecheckstage "app: unit tests" pnpm --filter fluxer_app exec vitest runif [ "$QUICK" -eq 0 ]; then+ stage "desktop: typecheck" pnpm --filter fluxer_desktop typecheckstage "app: production build" pnpm --filter fluxer_app buildfidiff --git a/fluxer_app/package.json b/fluxer_app/package.jsonindex f43461b71..cbb5b8be5 100644--- a/fluxer_app/package.json+++ b/fluxer_app/package.json@@ -22,7 +22,7 @@"bench:gif-picker": "vitest bench --run src/features/channel/components/pickers/gif/GifPickerStateMachine.bench.ts src/features/channel/components/pickers/gif/GifPickerGridData.bench.ts src/features/channel/components/pickers/gif/GifPickerLoadingSkeletonGridLayout.bench.ts src/features/channel/components/pickers/shared/TileFlowSolver.bench.ts","bench:messages": "vitest bench --run src/features/messaging/utils/MessageGroupingUtils.bench.ts src/features/channel/components/ChannelMessageStreamUtils.bench.ts src/features/messaging/components/markdown/MarkdownRendering.bench.ts src/features/channel/components/MessageAttachmentUtils.bench.ts src/features/messaging/utils/MessagePaginationUtils.bench.ts src/features/platform/utils/ScrollPosition.bench.ts src/features/messaging/state/ReactionStateMachine.bench.ts","test:watch": "vitest",- "typecheck": "pnpm wasm:codegen && pnpm generate:colors && pnpm generate:message-layout && pnpm generate:theme-variables && pnpm generate:masks && pnpm generate:css-types && tsgo --noEmit",+ "typecheck": "pnpm wasm:codegen && pnpm generate:colors && pnpm generate:message-layout && pnpm generate:theme-variables && pnpm generate:masks && pnpm generate:css-types && pnpm lingui:compile && tsgo --noEmit","typecheck:only": "tsgo --noEmit","check:message-layout": "pnpm tsx scripts/GenerateMessageLayoutCss.ts --check","generate:colors": "pnpm tsx scripts/GenerateColorSystem.ts",diff --git a/fluxer_desktop/package.json b/fluxer_desktop/package.jsonindex 5a164b012..89bfb45fd 100644--- a/fluxer_desktop/package.json+++ b/fluxer_desktop/package.json@@ -12,7 +12,7 @@"build": "node scripts/build.mjs","set-channel": "../tools/ci/run.sh build-desktop --step set_build_channel","test": "cargo test --manifest-path native/rust/Cargo.toml",- "typecheck": "tsgo --noEmit"+ "typecheck": "pnpm set-channel && tsgo --noEmit"},"dependencies": {"@fluxer/voice_engine_v2": "workspace:*",diff --git a/tools/ci/src/ci_workflow.rs b/tools/ci/src/ci_workflow.rsindex ef5ab79b3..cf53cbf9c 100644--- a/tools/ci/src/ci_workflow.rs+++ b/tools/ci/src/ci_workflow.rs@@ -43,7 +43,6 @@ pub async fn run_ci(args: CiArgs) -> Result<()> {.current_dir(root),),CiStep::Typecheck => {- ensure_desktop_build_channel_file(&root)?;run_generators(&root, true)?;run_app_test_artifact_generators(&root, AppWasm::Build)?;run_command(@@ -155,8 +154,9 @@ fn generator_commands(for_typecheck: bool) -> Vec<CommandSpec> {"@fluxer/i18n","generate:types",]));+ } else {+ commands.push(CommandSpec::new("pnpm").args(["--filter", "fluxer_app", "i18n:compile"]));}- commands.push(CommandSpec::new("pnpm").args(["--filter", "fluxer_app", "i18n:compile"]));commands}@@ -226,7 +226,7 @@ mod tests {use super::*;#[test]- fn generator_commands_include_i18n_types_only_for_typecheck() {+ fn generator_commands_split_i18n_types_and_compile_by_step() {let typecheck = generator_commands(true).into_iter().map(|command| command.args)@@ -246,6 +246,16 @@ mod tests {OsString::from("@fluxer/i18n"),OsString::from("generate:types"),]));+ assert!(!typecheck.contains(&vec![+ OsString::from("--filter"),+ OsString::from("fluxer_app"),+ OsString::from("i18n:compile"),+ ]));+ assert!(test.contains(&vec![+ OsString::from("--filter"),+ OsString::from("fluxer_app"),+ OsString::from("i18n:compile"),+ ]));}#[test]diff --git a/tools/dev/src/tasks.rs b/tools/dev/src/tasks.rsindex 45d70bf20..5c782b369 100644--- a/tools/dev/src/tasks.rs+++ b/tools/dev/src/tasks.rs@@ -45,7 +45,7 @@ fn run_generators(for_typecheck: bool) -> Result<()> {task_run(&["pnpm", "--filter", "@fluxer/config", "generate"])?;task_run(&["pnpm", "--filter", "@fluxer/schema", "generate"])?;if for_typecheck {- task_run(&["pnpm", "--filter", "@fluxer/i18n", "generate:types"])?;+ return task_run(&["pnpm", "--filter", "@fluxer/i18n", "generate:types"]);}task_run(&["pnpm", "--filter", "fluxer_app", "i18n:compile"])}