Skip to content

Commit 6149f34

Browse files
committed
fix: blabsy build
1 parent 7a1dd63 commit 6149f34

Some content is hidden

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

47 files changed

+1297
-1329
lines changed

package.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,20 @@
2323
},
2424
"pnpm": {
2525
"onlyBuiltDependencies": [
26-
"@firebase/util",
27-
"@tailwindcss/oxide",
28-
"bufferutil",
29-
"core-js",
26+
"@biomejs/biome",
27+
"@parcel/watcher",
3028
"cpu-features",
29+
"es5-ext",
3130
"esbuild",
3231
"msw",
3332
"protobufjs",
34-
"sharp",
33+
"sqlite3",
3534
"ssh2",
36-
"svelte-preprocess",
37-
"unrs-resolver"
38-
]
35+
"svelte-preprocess"
36+
],
37+
"overrides": {
38+
"@types/react": "18.2.79",
39+
"@types/react-dom": "18.2.25"
40+
}
3941
}
4042
}

platforms/blabsy/package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"date-fns": "^4.1.0",
2323
"firebase": "^9.9.4",
2424
"firebase-admin": "^13.4.0",
25-
"framer-motion": "^7.2.1",
25+
"motion": "^12.0.0",
2626
"next": "^12.3.0",
2727
"react": "18.2.0",
2828
"react-dom": "18.2.0",
@@ -37,8 +37,8 @@
3737
"@testing-library/react": "^13.3.0",
3838
"@testing-library/user-event": "^13.5.0",
3939
"@types/node": "18.6.4",
40-
"@types/react": "18.0.16",
41-
"@types/react-dom": "18.0.6",
40+
"@types/react": "18.2.79",
41+
"@types/react-dom": "18.2.25",
4242
"@typescript-eslint/eslint-plugin": "^5.32.0",
4343
"@typescript-eslint/parser": "^5.32.0",
4444
"autoprefixer": "^10.4.8",
@@ -56,9 +56,15 @@
5656
"prettier-plugin-tailwindcss": "^0.1.13",
5757
"sass": "^1.54.4",
5858
"tailwindcss": "^3.2.4",
59-
"typescript": "4.7.4"
59+
"typescript": "5.0.4"
60+
},
61+
"pnpm": {
62+
"overrides": {
63+
"@types/react": "18.2.79",
64+
"@types/react-dom": "18.2.25"
65+
}
6066
},
6167
"lint-staged": {
6268
"**/*": "prettier --write --ignore-unknown"
6369
}
64-
}
70+
}

platforms/blabsy/src/components/aside/aside-trends.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Link from 'next/link';
2+
import React from 'react';
23
import cn from 'clsx';
3-
import { motion } from 'framer-motion';
4+
import { motion } from 'motion/react';
45
import { formatNumber } from '@lib/date';
56
import { preventBubbling } from '@lib/utils';
67
import { useTrends } from '@lib/api/trends';
@@ -9,9 +10,8 @@ import { HeroIcon } from '@components/ui/hero-icon';
910
import { Button } from '@components/ui/button';
1011
import { ToolTip } from '@components/ui/tooltip';
1112
import { Loading } from '@components/ui/loading';
12-
import type { MotionProps } from 'framer-motion';
1313

14-
export const variants: MotionProps = {
14+
export const variants = {
1515
initial: { opacity: 0 },
1616
animate: { opacity: 1 },
1717
transition: { duration: 0.8 }
@@ -21,7 +21,7 @@ type AsideTrendsProps = {
2121
inTrendsPage?: boolean;
2222
};
2323

24-
export function AsideTrends({ inTrendsPage }: AsideTrendsProps): JSX.Element {
24+
export function AsideTrends({ inTrendsPage }: AsideTrendsProps) {
2525
const { data, loading } = useTrends(1, inTrendsPage ? 100 : 10, {
2626
refreshInterval: 30000
2727
});
@@ -32,18 +32,20 @@ export function AsideTrends({ inTrendsPage }: AsideTrendsProps): JSX.Element {
3232
<section
3333
className={cn(
3434
!inTrendsPage &&
35-
'hover-animation rounded-2xl bg-main-sidebar-background'
35+
'hover-animation rounded-2xl bg-main-sidebar-background'
3636
)}
3737
>
3838
{loading ? (
3939
<Loading />
4040
) : trends ? (
4141
<motion.div
42+
initial={{ opacity: 0 }}
43+
animate={{ opacity: 1 }}
44+
transition={{ duration: 0.8 }}
4245
className={cn(
4346
'inner:px-4 inner:py-3',
4447
inTrendsPage && 'mt-0.5'
4548
)}
46-
{...variants}
4749
>
4850
{!inTrendsPage && (
4951
<h2 className='text-xl font-extrabold'>

platforms/blabsy/src/components/aside/suggestions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Link from 'next/link';
2-
import { motion } from 'framer-motion';
2+
import { motion } from 'motion/react';
33
import {
44
doc,
55
limit,

platforms/blabsy/src/components/chat/chat-window.tsx

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ function MessageItem({
3434
// Check if this is a system message
3535
const isSystemMessage = !message.senderId || message.text.startsWith('$$system-message$$');
3636
// Remove the prefix for display
37-
const displayText = isSystemMessage && message.text.startsWith('$$system-message$$')
38-
? message.text.replace('$$system-message$$', '').trim()
37+
const displayText = isSystemMessage && message.text.startsWith('$$system-message$$')
38+
? message.text.replace('$$system-message$$', '').trim()
3939
: message.text;
4040

4141

4242

43-
if (isSystemMessage) {
43+
if (isSystemMessage) {
4444
return (
4545
<div className="flex w-full justify-center my-4">
4646
<div className="max-w-[80%] text-center">
@@ -63,14 +63,12 @@ function MessageItem({
6363

6464
return (
6565
<div
66-
className={`flex w-full ${
67-
isOwnMessage ? 'justify-end' : 'justify-start'
68-
}`}
66+
className={`flex w-full ${isOwnMessage ? 'justify-end' : 'justify-start'
67+
}`}
6968
>
7069
<div
71-
className={`flex max-w-[70%] ${
72-
isOwnMessage ? 'flex-col items-end' : 'flex-col items-start'
73-
} gap-1`}
70+
className={`flex max-w-[70%] ${isOwnMessage ? 'flex-col items-end' : 'flex-col items-start'
71+
} gap-1`}
7472
>
7573
{/* User Avatar and Name - Above the message */}
7674
{!isOwnMessage && showUserInfo && (
@@ -100,18 +98,16 @@ function MessageItem({
10098

10199
{/* Message Bubble */}
102100
<div
103-
className={`rounded-2xl px-4 py-2 ${
104-
isOwnMessage
105-
? 'bg-[#333399] text-white'
106-
: 'bg-[#6600ff] text-white'
107-
} ${!isOwnMessage ? 'ml-8' : ''}`}
101+
className={`rounded-2xl px-4 py-2 ${isOwnMessage
102+
? 'bg-[#333399] text-white'
103+
: 'bg-[#6600ff] text-white'
104+
} ${!isOwnMessage ? 'ml-8' : ''}`}
108105
>
109106
<div className='break-words whitespace-pre-wrap' dangerouslySetInnerHTML={{ __html: displayText.replace(/<a href="([^"]+)">([^<]+)<\/a>/g, '<a href="$1" class="text-blue-600 hover:text-blue-800 underline">$2</a>') }} />
110107
{showTime && message.createdAt?.toDate && (
111108
<p
112-
className={`mt-1 text-xs ${
113-
isOwnMessage ? 'text-white/70' : 'text-white/70'
114-
}`}
109+
className={`mt-1 text-xs ${isOwnMessage ? 'text-white/70' : 'text-white/70'
110+
}`}
115111
>
116112
{formatDistanceToNow(message.createdAt.toDate(), {
117113
addSuffix: true
@@ -233,7 +229,7 @@ export function ChatWindow(): JSX.Element {
233229
try {
234230
await sendNewMessage(messageText);
235231
setMessageText('');
236-
} catch (error) {}
232+
} catch (error) { }
237233
};
238234

239235
return (
@@ -273,13 +269,13 @@ export function ChatWindow(): JSX.Element {
273269
<p className='font-medium'>
274270
{getChatType(currentChat) === 'direct'
275271
? otherUser?.name ||
276-
otherUser?.username ||
277-
otherParticipant
272+
otherUser?.username ||
273+
otherParticipant
278274
: currentChat.name}
279275
</p>
280276
<p className='text-sm text-gray-500 dark:text-gray-400'>
281277
{currentChat.type === 'direct'
282-
? otherUser?.username
278+
? otherUser?.username
283279
? `@${otherUser.username}`
284280
: 'Direct Message'
285281
: `${currentChat.participants.length} participants`}
@@ -330,7 +326,7 @@ export function ChatWindow(): JSX.Element {
330326
const showTime =
331327
!nextMessage ||
332328
nextMessage.senderId !==
333-
message.senderId;
329+
message.senderId;
334330

335331
// Show user info if:
336332
// 1. It's a group chat AND
@@ -341,22 +337,23 @@ export function ChatWindow(): JSX.Element {
341337
!isOwnMessage &&
342338
(!prevMessage ||
343339
prevMessage.senderId !==
344-
message.senderId ||
340+
message.senderId ||
345341
(prevMessage.createdAt
346342
?.toDate &&
347343
message.createdAt?.toDate &&
348344
Math.abs(
349345
prevMessage.createdAt
350346
.toDate()
351347
.getTime() -
352-
message.createdAt
353-
.toDate()
354-
.getTime()
348+
message.createdAt
349+
.toDate()
350+
.getTime()
355351
) >
356-
5 * 60 * 1000));
352+
5 * 60 * 1000));
357353

358-
const userData =
359-
participantsData[message.senderId];
354+
const userData = message.senderId
355+
? participantsData[message.senderId]
356+
: null;
360357

361358
return (
362359
<MessageItem

platforms/blabsy/src/components/input/image-preview.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { useEffect, useRef, useState, useMemo } from 'react';
2-
import { AnimatePresence, motion } from 'framer-motion';
1+
import React, { useEffect, useRef, useState, useMemo } from 'react';
2+
import { AnimatePresence, motion } from 'motion/react';
33
import cn from 'clsx';
44
import { useModal } from '@lib/hooks/useModal';
55
import { preventBubbling } from '@lib/utils';
@@ -10,7 +10,6 @@ import { NextImage } from '@components/ui/next-image';
1010
import { Button } from '@components/ui/button';
1111
import { HeroIcon } from '@components/ui/hero-icon';
1212
import { ToolTip } from '@components/ui/tooltip';
13-
import type { MotionProps } from 'framer-motion';
1413
import type { ImagesPreview, ImageData } from '@lib/types/file';
1514

1615
type ImagePreviewProps = {
@@ -21,15 +20,15 @@ type ImagePreviewProps = {
2120
removeImage?: (targetId: string) => () => void;
2221
};
2322

24-
const variants: MotionProps = {
23+
const variants = {
2524
initial: { opacity: 0, scale: 0.5 },
2625
animate: {
2726
opacity: 1,
2827
scale: 1,
2928
transition: { duration: 0.3 }
3029
},
3130
exit: { opacity: 0, scale: 0.5 },
32-
transition: { type: 'spring', duration: 0.5 }
31+
transition: { type: 'spring' as const, duration: 0.5 }
3332
};
3433

3534
type PostImageBorderRadius = Record<number, string[]>;
@@ -87,8 +86,8 @@ export function ImagePreview({
8786
? actualPreviewCount - 1
8887
: selectedIndex - 1
8988
: selectedIndex === actualPreviewCount - 1
90-
? 0
91-
: selectedIndex + 1;
89+
? 0
90+
: selectedIndex + 1;
9291

9392
setSelectedIndex(nextIndex);
9493
};
@@ -168,8 +167,8 @@ export function ImagePreview({
168167
hover:brightness-75 hover:duration-200`,
169168
isTweet
170169
? postImageBorderRadius[
171-
actualPreviewCount
172-
]?.[index] || 'rounded-2xl'
170+
actualPreviewCount
171+
]?.[index] || 'rounded-2xl'
173172
: 'rounded-2xl'
174173
)}
175174
src={src}
@@ -184,8 +183,8 @@ export function ImagePreview({
184183
imgClassName={cn(
185184
isTweet
186185
? postImageBorderRadius[
187-
actualPreviewCount
188-
]?.[index] || 'rounded-2xl'
186+
actualPreviewCount
187+
]?.[index] || 'rounded-2xl'
189188
: 'rounded-2xl'
190189
)}
191190
previewCount={actualPreviewCount}

platforms/blabsy/src/components/input/input-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useEffect } from 'react';
22
import TextArea from 'react-textarea-autosize';
3-
import { motion } from 'framer-motion';
3+
import { motion } from 'motion/react';
44
import { useModal } from '@lib/hooks/useModal';
55
import { Modal } from '@components/modal/modal';
66
import { ActionModal } from '@components/modal/action-modal';
@@ -13,7 +13,7 @@ import type {
1313
KeyboardEvent,
1414
ClipboardEvent
1515
} from 'react';
16-
import type { Variants } from 'framer-motion';
16+
import type { Variants } from 'motion/react';
1717

1818
type InputFormProps = {
1919
modal?: boolean;

platforms/blabsy/src/components/input/input-options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useRef } from 'react';
2-
import { motion } from 'framer-motion';
2+
import { motion } from 'motion/react';
33
import { Button } from '@components/ui/button';
44
import { HeroIcon } from '@components/ui/hero-icon';
55
import { ToolTip } from '@components/ui/tooltip';

platforms/blabsy/src/components/input/input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Link from 'next/link';
22
import { useState, useEffect, useRef, useId } from 'react';
3-
import { AnimatePresence, motion } from 'framer-motion';
3+
import { AnimatePresence, motion } from 'motion/react';
44
import cn from 'clsx';
55
import { toast } from 'react-hot-toast';
66
import { addDoc, getDoc, serverTimestamp } from 'firebase/firestore';
@@ -20,7 +20,7 @@ import { ImagePreview } from './image-preview';
2020
import { InputOptions } from './input-options';
2121
import type { ReactNode, FormEvent, ChangeEvent, ClipboardEvent } from 'react';
2222
import type { WithFieldValue } from 'firebase/firestore';
23-
import type { Variants } from 'framer-motion';
23+
import type { Variants } from 'motion/react';
2424
import type { User } from '@lib/types/user';
2525
import type { Tweet } from '@lib/types/tweet';
2626
import type { FilesWithId, ImagesPreview, ImageData } from '@lib/types/file';

platforms/blabsy/src/components/layout/user-follow-layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { motion } from 'framer-motion';
1+
import { motion } from 'motion/react';
22
import { useUser } from '@lib/context/user-context';
33
import { Loading } from '@components/ui/loading';
44
import { UserNav } from '@components/user/user-nav';

0 commit comments

Comments
 (0)