Skip to content

Commit 207d47b

Browse files
authored
revert ts fixes (#509)
1 parent 72af2c1 commit 207d47b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+453
-934
lines changed

apps/web/actions/organization/check-domain.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"use server";
1+
'use server';
22

33
import { getCurrentUser } from "@cap/database/auth/session";
44
import { organizations } from "@cap/database/schema";

apps/web/app/dashboard/shared-caps/SharedCaps.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ type SharedVideoData = {
2222
export const SharedCaps = ({
2323
data,
2424
count,
25+
activeOrganizationId,
2526
}: {
2627
data: SharedVideoData;
2728
count: number;
29+
activeOrganizationId: string;
2830
}) => {
2931
const params = useSearchParams();
3032
const page = Number(params.get("page")) || 1;

apps/web/app/s/[videoId]/_components/ShareHeader.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export const ShareHeader = ({
2525
userOrganizations = [],
2626
}: {
2727
data: typeof videos.$inferSelect;
28-
user?: typeof userSelectProps | null;
29-
customDomain?: string | null;
30-
domainVerified?: boolean;
28+
user: typeof userSelectProps | null;
29+
customDomain: string | null;
30+
domainVerified: boolean;
3131
sharedOrganizations?: { id: string; name: string }[];
3232
userOrganizations?: { id: string; name: string }[];
3333
}) => {
@@ -40,7 +40,7 @@ export const ShareHeader = ({
4040
const [currentSharedOrganizations, setCurrentSharedOrganizations] =
4141
useState(sharedOrganizations);
4242

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

4545
const { webUrl } = usePublicEnv();
4646

@@ -157,8 +157,12 @@ export const ShareHeader = ({
157157
<h1
158158
className="text-xl sm:text-2xl"
159159
onClick={() => {
160-
if (user?.id.toString() === data.ownerId)
160+
if (
161+
user !== null &&
162+
user.id.toString() === data.ownerId
163+
) {
161164
setIsEditing(true);
165+
}
162166
}}
163167
>
164168
{title}

apps/web/app/tools/convert/[conversionPath]/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default function ConversionPage({ params }: ConversionPageProps) {
6969
const { sourceFormat, targetFormat } = parseFormats(conversionPath);
7070
const config = CONVERSION_CONFIGS[conversionPath];
7171

72-
const pageContent = {
72+
const pageContent: ToolPageContent = {
7373
title: config.title(sourceFormat, targetFormat),
7474
description: config.description(sourceFormat, targetFormat),
7575
featuresTitle: "Features",

apps/web/app/tools/trim/metadata.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { trimVideoContent } from "@/components/tools/content";
44
export const metadata: Metadata = {
55
title: trimVideoContent.title,
66
description: trimVideoContent.description,
7-
keywords: trimVideoContent.tags?.join(", "),
7+
keywords: trimVideoContent.tags.join(", "),
88
openGraph: {
99
title: trimVideoContent.title,
1010
description: trimVideoContent.description,
1111
type: "website",
1212
},
13-
};
13+
};

apps/web/components/tools/content.ts

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { ToolPageContent } from "@/components/tools/types";
22

33
export const webmToMp4Content: ToolPageContent = {
4+
slug: "webm-to-mp4",
45
title: "WEBM to MP4 Converter",
56
description:
67
"Convert WEBM to MP4 online for free. No watermark, no registration required.",
8+
publishedAt: "2023-11-19",
9+
category: "Tool",
10+
author: "Cap",
711
tags: ["webm to mp4", "video converter", "free", "online"],
812

913
cta: {
@@ -74,9 +78,13 @@ export const webmToMp4Content: ToolPageContent = {
7478
};
7579

7680
export const mp4ToWebmContent: ToolPageContent = {
81+
slug: "mp4-to-webm",
7782
title: "MP4 to WEBM Converter",
7883
description:
7984
"Convert MP4 to WEBM online for free. No watermark, no registration required.",
85+
publishedAt: "2023-11-19",
86+
category: "Tool",
87+
author: "Cap",
8088
tags: ["mp4 to webm", "video converter", "free", "online"],
8189

8290
cta: {
@@ -147,16 +155,14 @@ export const mp4ToWebmContent: ToolPageContent = {
147155
};
148156

149157
export const videoSpeedControllerContent: ToolPageContent = {
158+
slug: "video-speed-controller",
150159
title: "Video Speed Controller",
151160
description:
152161
"Speed up or slow down videos online for free. No watermark, no quality loss.",
153-
tags: [
154-
"video speed control",
155-
"speed up video",
156-
"slow motion",
157-
"free",
158-
"online",
159-
],
162+
publishedAt: "2023-11-20",
163+
category: "Tool",
164+
author: "Cap",
165+
tags: ["video speed control", "speed up video", "slow motion", "free", "online"],
160166

161167
cta: {
162168
title: "Need advanced screen recording with effects?",
@@ -226,67 +232,62 @@ export const videoSpeedControllerContent: ToolPageContent = {
226232
};
227233

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

234244
cta: {
235245
title: "The open source Loom alternative",
236-
description:
237-
"Cap is lightweight, powerful, and cross-platform. Record and share securely in seconds with custom S3 bucket support..",
246+
description: "Cap is lightweight, powerful, and cross-platform. Record and share securely in seconds with custom S3 bucket support..",
238247
buttonText: "Download Cap Free",
239248
},
240249

241250
featuresTitle: "Why Use Cap's Online Video Trimmer?",
242-
featuresDescription:
243-
"Our local-first trimmer does one thing stupid-fast: cut video. No sign-ups, no waiting.",
251+
featuresDescription: "Our local-first trimmer does one thing stupid-fast: cut video. No sign-ups, no waiting.",
244252
features: [
245253
{
246254
title: "Instant & Private",
247-
description:
248-
"All processing happens on-device. Nothing ever touches our servers.",
255+
description: "All processing happens on-device. Nothing ever touches our servers.",
249256
},
250257
{
251258
title: "Lossless Export",
252-
description:
253-
"We snip at keyframes, so quality stays identical to the original.",
259+
description: "We snip at keyframes, so quality stays identical to the original.",
254260
},
255261
{
256262
title: "Any Format",
257-
description:
258-
"MP4, WebM, MOV, MKV, GIF. If your browser plays it, we can trim it.",
263+
description: "MP4, WebM, MOV, MKV, GIF. If your browser plays it, we can trim it.",
259264
},
260265
{
261266
title: "No Watermarks",
262267
description: "Free means free. Your clip stays clean.",
263268
},
264269
{
265270
title: "Works Offline",
266-
description:
267-
"Once the page loads you can trim even without internet. Perfect on planes.",
271+
description: "Once the page loads you can trim even without internet. Perfect on planes.",
268272
},
269273
],
270274

271275
faqs: [
272276
{
273277
question: "What's the maximum file size?",
274-
answer:
275-
"Browser memory is the only limit. Works fine up to ~500MB in Chrome.",
278+
answer: "Browser memory is the only limit. Works fine up to ~500MB in Chrome.",
276279
},
277280
{
278281
question: "Can I trim Zoom or Loom recordings?",
279282
answer: "Absolutely. Export the MP4/WebM first, then drag it in here.",
280283
},
281284
{
282285
question: "How does the online trimmer work?",
283-
answer:
284-
"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.",
286+
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.",
285287
},
286288
{
287289
question: "Which browsers work best?",
288-
answer:
289-
"Chrome, Edge, and Firefox provide the best performance and compatibility. Safari has some limitations with video processing in the browser.",
290+
answer: "Chrome, Edge, and Firefox provide the best performance and compatibility. Safari has some limitations with video processing in the browser.",
290291
},
291292
],
292-
};
293+
};

apps/web/components/tools/types.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
export interface ToolPageContent {
2+
slug: string;
23
title: string;
34
description: string;
4-
tags?: string[];
5+
publishedAt: string;
6+
category: string;
7+
author: string;
8+
tags: string[];
59

610
cta: {
711
title: string;

apps/web/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
"lodash": "^4.17.21",
6868
"lucide-react": "^0.294.0",
6969
"moment": "^2.30.1",
70-
"next": "^14.2.28",
71-
"next-auth": "^4.24.11",
70+
"next": "14.2.3",
71+
"next-auth": "^4.24.5",
7272
"next-contentlayer2": "^0.5.3",
7373
"next-mdx-remote": "^4.4.1",
7474
"nextjs-cors": "^2.2.0",
@@ -90,7 +90,7 @@
9090
"tailwind-merge": "^2.1.0",
9191
"uuid": "^9.0.1",
9292
"video.js": "^8.17.3",
93-
"zod": "^3.24.3"
93+
"zod": "^3.24.2"
9494
},
9595
"devDependencies": {
9696
"@types/file-saver": "^2.0.7",
@@ -110,4 +110,4 @@
110110
"engines": {
111111
"node": "20"
112112
}
113-
}
113+
}

apps/web/tsconfig.json

+36-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
"compilerOptions": {
33
"target": "ESNext",
44
"useDefineForClassFields": true,
5-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
5+
"lib": [
6+
"DOM",
7+
"DOM.Iterable",
8+
"ESNext"
9+
],
610
"allowJs": false,
711
"skipLibCheck": true,
812
"esModuleInterop": true,
@@ -17,21 +21,40 @@
1721
"noEmit": true,
1822
"jsx": "preserve",
1923
"incremental": true,
20-
"plugins": [{ "name": "next" }],
24+
"plugins": [
25+
{
26+
"name": "next"
27+
}
28+
],
2129
"baseUrl": ".",
2230
"paths": {
23-
"@/app/*": ["app/*"],
24-
"@/components/*": ["components/*"],
25-
"@/pages/*": ["components/pages/*"],
26-
"@/utils/*": ["utils/*"],
27-
"@/lib/*": ["lib/*"],
28-
"@/actions/*": ["actions/*"]
31+
"@/app/*": [
32+
"app/*"
33+
],
34+
"@/components/*": [
35+
"components/*"
36+
],
37+
"@/pages/*": [
38+
"components/pages/*"
39+
],
40+
"@/utils/*": [
41+
"utils/*"
42+
],
43+
"@/lib/*": [
44+
"lib/*"
45+
],
46+
"@/actions/*": [
47+
"actions/*"
48+
]
2949
}
3050
},
31-
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
32-
"exclude": ["node_modules"],
33-
"references": [
34-
{ "path": "../../packages/database" },
35-
{ "path": "../../packages/web-api-contract" }
51+
"include": [
52+
"next-env.d.ts",
53+
"**/*.ts",
54+
"**/*.tsx",
55+
".next/types/**/*.ts"
56+
],
57+
"exclude": [
58+
"node_modules"
3659
]
3760
}

apps/web/tsconfig.node.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"skipLibCheck": true,
5+
"module": "ESNext",
6+
"moduleResolution": "bundler",
7+
"allowSyntheticDefaultImports": true
8+
},
9+
"include": ["vite.config.ts"]
10+
}

apps/web/types/index.d.ts

-1
This file was deleted.

0 commit comments

Comments
 (0)