Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Refactor error handling and optimize import list

Richie McIlroye668ed45eeac
diff --git a/apps/media-server/src/__tests__/lib/ffmpeg.integration.test.ts b/apps/media-server/src/__tests__/lib/ffmpeg.integration.test.ts
index d736cfc8a..9b440801e 100644
--- a/apps/media-server/src/__tests__/lib/ffmpeg.integration.test.ts
+++ b/apps/media-server/src/__tests__/lib/ffmpeg.integration.test.ts
@@ -27,9 +27,7 @@ describe("ffmpeg integration tests", () => {
expect(audioData.length).toBeGreaterThan(0);
const hasId3Tag =
- audioData[0] === 0x49 &&
- audioData[1] === 0x44 &&
- audioData[2] === 0x33;
+ audioData[0] === 0x49 && audioData[1] === 0x44 && audioData[2] === 0x33;
const hasMpegSync =
audioData[0] === 0xff && (audioData[1] & 0xe0) === 0xe0;
expect(hasId3Tag || hasMpegSync).toBe(true);
diff --git a/apps/web/lib/audio-extract.ts b/apps/web/lib/audio-extract.ts
index ae039a8ab..c790a1ceb 100644
--- a/apps/web/lib/audio-extract.ts
+++ b/apps/web/lib/audio-extract.ts
@@ -88,7 +88,9 @@ export async function extractAudioFromUrl(
});
} else {
fs.unlink(outputPath).catch(() => {});
- reject(new Error(`Audio extraction failed with code ${code}: ${stderr}`));
+ reject(
+ new Error(`Audio extraction failed with code ${code}: ${stderr}`),
+ );
}
});
});
@@ -131,7 +133,9 @@ export async function extractAudioToBuffer(videoUrl: string): Promise<Buffer> {
if (code === 0) {
resolve(Buffer.concat(chunks));
} else {
- reject(new Error(`Audio extraction failed with code ${code}: ${stderr}`));
+ reject(
+ new Error(`Audio extraction failed with code ${code}: ${stderr}`),
+ );
}
});
});
diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs
index 0ab888283..0d69a33d8 100644
--- a/apps/web/next.config.mjs
+++ b/apps/web/next.config.mjs
@@ -41,19 +41,11 @@ const nextConfig = {
optimizePackageImports: [
"@cap/ui",
"@cap/utils",
- "@cap/web-api-contract",
- "@cap/web-domain",
- "@cap/web-backend",
- "@cap/database",
"lucide-react",
"framer-motion",
"motion",
"@fortawesome/free-solid-svg-icons",
"@fortawesome/free-brands-svg-icons",
- "effect",
- "@effect/platform",
- "@effect/rpc",
- "@effect/sql-mysql2",
"@tanstack/react-query",
"recharts",
"@radix-ui/react-dialog",