Skip to content

Revert TS fixes temporarily #509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/actions/organization/check-domain.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use server";
'use server';

import { getCurrentUser } from "@cap/database/auth/session";
import { organizations } from "@cap/database/schema";
Expand Down
2 changes: 2 additions & 0 deletions apps/web/app/dashboard/shared-caps/SharedCaps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ type SharedVideoData = {
export const SharedCaps = ({
data,
count,
activeOrganizationId,
}: {
data: SharedVideoData;
count: number;
activeOrganizationId: string;
}) => {
const params = useSearchParams();
const page = Number(params.get("page")) || 1;
Expand Down
14 changes: 9 additions & 5 deletions apps/web/app/s/[videoId]/_components/ShareHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ export const ShareHeader = ({
userOrganizations = [],
}: {
data: typeof videos.$inferSelect;
user?: typeof userSelectProps | null;
customDomain?: string | null;
domainVerified?: boolean;
user: typeof userSelectProps | null;
customDomain: string | null;
domainVerified: boolean;
sharedOrganizations?: { id: string; name: string }[];
userOrganizations?: { id: string; name: string }[];
}) => {
Expand All @@ -40,7 +40,7 @@ export const ShareHeader = ({
const [currentSharedOrganizations, setCurrentSharedOrganizations] =
useState(sharedOrganizations);

const isOwner = user?.id?.toString() === data.ownerId;
const isOwner = user !== null && user.id.toString() === data.ownerId;

const { webUrl } = usePublicEnv();

Expand Down Expand Up @@ -157,8 +157,12 @@ export const ShareHeader = ({
<h1
className="text-xl sm:text-2xl"
onClick={() => {
if (user?.id.toString() === data.ownerId)
if (
user !== null &&
user.id.toString() === data.ownerId
) {
setIsEditing(true);
}
}}
>
{title}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/tools/convert/[conversionPath]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function ConversionPage({ params }: ConversionPageProps) {
const { sourceFormat, targetFormat } = parseFormats(conversionPath);
const config = CONVERSION_CONFIGS[conversionPath];

const pageContent = {
const pageContent: ToolPageContent = {
title: config.title(sourceFormat, targetFormat),
description: config.description(sourceFormat, targetFormat),
featuresTitle: "Features",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/tools/trim/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { trimVideoContent } from "@/components/tools/content";
export const metadata: Metadata = {
title: trimVideoContent.title,
description: trimVideoContent.description,
keywords: trimVideoContent.tags?.join(", "),
keywords: trimVideoContent.tags.join(", "),
openGraph: {
title: trimVideoContent.title,
description: trimVideoContent.description,
type: "website",
},
};
};
53 changes: 27 additions & 26 deletions apps/web/components/tools/content.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { ToolPageContent } from "@/components/tools/types";

export const webmToMp4Content: ToolPageContent = {
slug: "webm-to-mp4",
title: "WEBM to MP4 Converter",
description:
"Convert WEBM to MP4 online for free. No watermark, no registration required.",
publishedAt: "2023-11-19",
category: "Tool",
author: "Cap",
tags: ["webm to mp4", "video converter", "free", "online"],

cta: {
Expand Down Expand Up @@ -74,9 +78,13 @@ export const webmToMp4Content: ToolPageContent = {
};

export const mp4ToWebmContent: ToolPageContent = {
slug: "mp4-to-webm",
title: "MP4 to WEBM Converter",
description:
"Convert MP4 to WEBM online for free. No watermark, no registration required.",
publishedAt: "2023-11-19",
category: "Tool",
author: "Cap",
tags: ["mp4 to webm", "video converter", "free", "online"],

cta: {
Expand Down Expand Up @@ -147,16 +155,14 @@ export const mp4ToWebmContent: ToolPageContent = {
};

export const videoSpeedControllerContent: ToolPageContent = {
slug: "video-speed-controller",
title: "Video Speed Controller",
description:
"Speed up or slow down videos online for free. No watermark, no quality loss.",
tags: [
"video speed control",
"speed up video",
"slow motion",
"free",
"online",
],
publishedAt: "2023-11-20",
category: "Tool",
author: "Cap",
tags: ["video speed control", "speed up video", "slow motion", "free", "online"],

cta: {
title: "Need advanced screen recording with effects?",
Expand Down Expand Up @@ -226,67 +232,62 @@ export const videoSpeedControllerContent: ToolPageContent = {
};

export const trimVideoContent: ToolPageContent = {
slug: "trim-video-online",
title: "Trim Video Online",
description:
"Cut unwanted sections from MP4, WebM, MOV and more. Instantly in your browser with zero quality loss.",
publishedAt: "2023-11-21",
category: "Tools",
author: "Cap",
tags: ["Video Trimming", "Online Tools", "Browser", "Free"],

cta: {
title: "The open source Loom alternative",
description:
"Cap is lightweight, powerful, and cross-platform. Record and share securely in seconds with custom S3 bucket support..",
description: "Cap is lightweight, powerful, and cross-platform. Record and share securely in seconds with custom S3 bucket support..",
buttonText: "Download Cap Free",
},

featuresTitle: "Why Use Cap's Online Video Trimmer?",
featuresDescription:
"Our local-first trimmer does one thing stupid-fast: cut video. No sign-ups, no waiting.",
featuresDescription: "Our local-first trimmer does one thing stupid-fast: cut video. No sign-ups, no waiting.",
features: [
{
title: "Instant & Private",
description:
"All processing happens on-device. Nothing ever touches our servers.",
description: "All processing happens on-device. Nothing ever touches our servers.",
},
{
title: "Lossless Export",
description:
"We snip at keyframes, so quality stays identical to the original.",
description: "We snip at keyframes, so quality stays identical to the original.",
},
{
title: "Any Format",
description:
"MP4, WebM, MOV, MKV, GIF. If your browser plays it, we can trim it.",
description: "MP4, WebM, MOV, MKV, GIF. If your browser plays it, we can trim it.",
},
{
title: "No Watermarks",
description: "Free means free. Your clip stays clean.",
},
{
title: "Works Offline",
description:
"Once the page loads you can trim even without internet. Perfect on planes.",
description: "Once the page loads you can trim even without internet. Perfect on planes.",
},
],

faqs: [
{
question: "What's the maximum file size?",
answer:
"Browser memory is the only limit. Works fine up to ~500MB in Chrome.",
answer: "Browser memory is the only limit. Works fine up to ~500MB in Chrome.",
},
{
question: "Can I trim Zoom or Loom recordings?",
answer: "Absolutely. Export the MP4/WebM first, then drag it in here.",
},
{
question: "How does the online trimmer work?",
answer:
"Our trimmer uses the MediaRecorder API to capture the portion of video you selected, then saves it as a new file. This all happens locally in your browser.",
answer: "Our trimmer uses the MediaRecorder API to capture the portion of video you selected, then saves it as a new file. This all happens locally in your browser.",
},
{
question: "Which browsers work best?",
answer:
"Chrome, Edge, and Firefox provide the best performance and compatibility. Safari has some limitations with video processing in the browser.",
answer: "Chrome, Edge, and Firefox provide the best performance and compatibility. Safari has some limitations with video processing in the browser.",
},
],
};
};
6 changes: 5 additions & 1 deletion apps/web/components/tools/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
export interface ToolPageContent {
slug: string;
title: string;
description: string;
tags?: string[];
publishedAt: string;
category: string;
author: string;
tags: string[];

cta: {
title: string;
Expand Down
8 changes: 4 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"lodash": "^4.17.21",
"lucide-react": "^0.294.0",
"moment": "^2.30.1",
"next": "^14.2.28",
"next-auth": "^4.24.11",
"next": "14.2.3",
"next-auth": "^4.24.5",
"next-contentlayer2": "^0.5.3",
"next-mdx-remote": "^4.4.1",
"nextjs-cors": "^2.2.0",
Expand All @@ -90,7 +90,7 @@
"tailwind-merge": "^2.1.0",
"uuid": "^9.0.1",
"video.js": "^8.17.3",
"zod": "^3.24.3"
"zod": "^3.24.2"
},
"devDependencies": {
"@types/file-saver": "^2.0.7",
Expand All @@ -110,4 +110,4 @@
"engines": {
"node": "20"
}
}
}
49 changes: 36 additions & 13 deletions apps/web/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": true,
Expand All @@ -17,21 +21,40 @@
"noEmit": true,
"jsx": "preserve",
"incremental": true,
"plugins": [{ "name": "next" }],
"plugins": [
{
"name": "next"
}
],
"baseUrl": ".",
"paths": {
"@/app/*": ["app/*"],
"@/components/*": ["components/*"],
"@/pages/*": ["components/pages/*"],
"@/utils/*": ["utils/*"],
"@/lib/*": ["lib/*"],
"@/actions/*": ["actions/*"]
"@/app/*": [
"app/*"
],
"@/components/*": [
"components/*"
],
"@/pages/*": [
"components/pages/*"
],
"@/utils/*": [
"utils/*"
],
"@/lib/*": [
"lib/*"
],
"@/actions/*": [
"actions/*"
]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"],
"references": [
{ "path": "../../packages/database" },
{ "path": "../../packages/web-api-contract" }
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
10 changes: 10 additions & 0 deletions apps/web/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
1 change: 0 additions & 1 deletion apps/web/types/index.d.ts

This file was deleted.

Loading
Loading