mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-07-14 18:15:56 -04:00
chore: dependency updates and minor refactors
- Bump `@tanstack/react-query` and related packages to 5.95.0 - Add `@orpc/json-schema`, `@orpc/openapi`, `@orpc/server`, `@orpc/zod` to catalog and use catalog refs in `apps/server` - Move `ORPCError` throws for backup not-found/invalid into `@sofa/core/backup` so the server procedure can simply `await deleteBackup()` without re-wrapping errors - Add `@orpc/server` dep to `packages/core` to support the above - Add `expo-updates` to native deps; switch `requireNativeModule` import to `expo` in `WidgetImagesModule` - Pin native `react`/`react-dom` to catalog to avoid duplicate copies - Add `@lingui/core` to web and `react` to i18n package deps
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@orpc/server": "catalog:",
|
||||
"@sofa/api": "workspace:*",
|
||||
"@sofa/config": "workspace:*",
|
||||
"@sofa/db": "workspace:*",
|
||||
|
||||
@@ -2,6 +2,9 @@ import { renameSync, unlinkSync } from "node:fs";
|
||||
import { mkdir, readdir } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
|
||||
import { ORPCError } from "@orpc/server";
|
||||
|
||||
import { AppErrorCode } from "@sofa/api/errors";
|
||||
import { BACKUP_DIR, DATABASE_URL } from "@sofa/config";
|
||||
import {
|
||||
closeDatabase,
|
||||
@@ -131,12 +134,18 @@ export async function listBackups(): Promise<BackupInfo[]> {
|
||||
|
||||
async function deleteBackupInternal(filename: string): Promise<void> {
|
||||
if (!isValidBackupFilename(filename)) {
|
||||
throw new Error("Invalid backup filename");
|
||||
throw new ORPCError("BAD_REQUEST", {
|
||||
message: "Invalid backup filename",
|
||||
data: { code: AppErrorCode.BACKUP_DELETE_FAILED },
|
||||
});
|
||||
}
|
||||
|
||||
const filePath = path.join(BACKUP_DIR, filename);
|
||||
if (!(await Bun.file(filePath).exists())) {
|
||||
throw new Error("Backup not found");
|
||||
throw new ORPCError("NOT_FOUND", {
|
||||
message: "Backup not found",
|
||||
data: { code: AppErrorCode.BACKUP_NOT_FOUND },
|
||||
});
|
||||
}
|
||||
|
||||
await Bun.file(filePath).delete();
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"@lingui/conf": "catalog:",
|
||||
"@lingui/format-po": "catalog:",
|
||||
"@types/bun": "catalog:",
|
||||
"react": "catalog:",
|
||||
"typescript": "catalog:"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user