diff --git a/apps/relay/Dockerfile b/apps/relay/Dockerfile index 263f7c00a..a693459e6 100644 --- a/apps/relay/Dockerfile +++ b/apps/relay/Dockerfile @@ -4,21 +4,16 @@ ENV PATH="$BUN_HOME:$PATH" FROM base AS builder WORKDIR /app -RUN bun install -g turbo COPY . . # Generate a partial monorepo with a pruned lockfile for the relay workspace -RUN turbo prune @evolu/relay --docker +RUN bunx turbo@2.8.2 prune @evolu/relay --docker # ------------------------------------------------------------ # Installer stage - build the pruned workspace FROM base AS installer WORKDIR /app -# Install pnpm and turbo (Wait, we want bun) -# RUN corepack enable pnpm # Removed -RUN bun install -g turbo - # Install dependencies from pruned lockfile COPY --from=builder /app/out/json/ . RUN bun install --frozen-lockfile @@ -27,7 +22,7 @@ RUN bun install --frozen-lockfile COPY --from=builder /app/out/full/ . # Ensure README.md is available at the root for the build process COPY --from=builder /app/README.md ./README.md -RUN turbo run build +RUN bunx turbo@2.8.2 run build # Prune dev dependencies to create a production-ready environment RUN bun install --production diff --git a/apps/web/src/components/Search.tsx b/apps/web/src/components/Search.tsx index 00d6dfc6e..d18f03006 100644 --- a/apps/web/src/components/Search.tsx +++ b/apps/web/src/components/Search.tsx @@ -302,12 +302,13 @@ const SearchDialog = ({ setOpen(false); }, }); - const _pathname = usePathname(); - const _searchParams = useSearchParams(); + const pathname = usePathname(); + const searchParams = useSearchParams(); + // biome-ignore lint/correctness/useExhaustiveDependencies: Effect should trigger on navigation changes to close dialog useEffect(() => { setOpen(false); - }, [setOpen]); + }, [pathname, searchParams, setOpen]); useEffect(() => { if (open) { diff --git a/apps/web/src/components/SectionProvider.tsx b/apps/web/src/components/SectionProvider.tsx index df6fd43a8..8c6fb1219 100644 --- a/apps/web/src/components/SectionProvider.tsx +++ b/apps/web/src/components/SectionProvider.tsx @@ -128,6 +128,8 @@ const useVisibleSections = (sectionStore: StoreApi) => { const SectionStoreContext = createContext | null>(null); +const emptyStore = createSectionStore([]); + const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect; @@ -157,9 +159,5 @@ export const useSectionStore = ( selector: (state: SectionState) => T, ): T => { const store = useContext(SectionStoreContext); - if (!store) { - return {} as T; - } - // biome-ignore lint/correctness/useHookAtTopLevel: intentional - return useStore(store, selector); + return useStore(store ?? emptyStore, selector); }; diff --git a/packages/common/src/Task.ts b/packages/common/src/Task.ts index 90bb7f711..fe199fb2d 100644 --- a/packages/common/src/Task.ts +++ b/packages/common/src/Task.ts @@ -436,14 +436,15 @@ export type InferTaskDone> = /** * A {@link Task} suitable for use with platform-specific `runMain` functions. * - * Returns `Disposable`, `AsyncDisposable`, or `undefined`. Returning a disposable + * Returns `Disposable`, `AsyncDisposable`, `void`, or `undefined`. Returning a disposable * (typically via `stack.move()`) transfers resource ownership to `runMain`, * main tasks must handle all errors internally. * * @group Core Types */ export type MainTask = Task< - Disposable | AsyncDisposable | undefined, + // biome-ignore lint/suspicious/noConfusingVoidType: void | undefined allows both ok() and ok(undefined) + Disposable | AsyncDisposable | void | undefined, never, RunnerDeps & D >; @@ -3358,7 +3359,7 @@ function pool( stopped = result; abortWorkers( isErr(result) && AbortError.is(result.error) - ? (result.error as any).reason + ? result.error.reason : abortReason, ); stopSignal?.resolve(); diff --git a/packages/common/src/local-first/Schema.ts b/packages/common/src/local-first/Schema.ts index e053ee3c6..497554930 100644 --- a/packages/common/src/local-first/Schema.ts +++ b/packages/common/src/local-first/Schema.ts @@ -52,7 +52,7 @@ import type { AppOwner } from "./Owner.js"; import { OwnerId } from "./Owner.js"; import type { Query, Row } from "./Query.js"; import type { CrdtMessage, DbChange } from "./Storage.js"; -import { Timestamp, type TimestampBytes } from "./Timestamp.js"; +import type { TimestampBytes } from "./Timestamp.js"; /** * Defines the schema of an Evolu database.