Skip to content

Commit

Permalink
chore: switch back to build script for pre commit
Browse files Browse the repository at this point in the history
  • Loading branch information
aseerkt committed Jul 1, 2024
1 parent 36f0838 commit 97145f0
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 71 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/playwright.yml

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "pnpm run -r dev",
"build": "pnpm run -r build",
"lint": "pnpm run -r lint",
"prepare": "husky install",
"commitlint": "commitlint --edit"
},
Expand Down
10 changes: 10 additions & 0 deletions server/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const pluginJs = require('@eslint/js')
const globals = require('globals')
const tseslint = require('typescript-eslint')

module.exports = [
{ files: ['src/**/*.ts'], ignores: ['dist/**', 'drizzle', 'node_modules'] },
{ languageOptions: { globals: globals.node } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
]
10 changes: 0 additions & 10 deletions server/eslint.config.mjs

This file was deleted.

1 change: 1 addition & 0 deletions server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"start": "node dist/index.js",
"dev": "tsx watch src/index.ts",
"build": "tsc",
"lint": "tsc && eslint -c eslint.config.js",
"migrate:gen": "drizzle-kit generate",
"migrate:run": "tsx src/scripts/migrate.ts",
"seed": "tsx src/scripts/seed.ts"
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/group/components/GroupHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const RoomHeader = ({ groupId, showMembers }: RoomHeaderProps) => {
error,
} = useQuery({
queryKey: ['currentRoom', groupId],
queryFn: ({ queryKey }) => fetchRoom(queryKey[1]),
queryFn: ({ queryKey }) => fetchRoom(queryKey[1] as number),
})

let content
Expand Down
14 changes: 7 additions & 7 deletions web/src/features/group/components/JoinGroupItem.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { IGroup } from '../group.interface'

export const JoinRoomItem = ({
room,
group,
isChecked,
toggleRoomCheck,
}: {
room: IGroup
group: IGroup
isChecked: boolean
toggleRoomCheck: (id: number, isChecked: boolean) => void
}) => (
<li key={room.id}>
<li key={group.id}>
<label
className='inline-flex h-10 w-full cursor-pointer items-center justify-between px-3 font-bold hover:bg-gray-100'
htmlFor={room.id}
htmlFor={'group_' + group.id}
>
<span className='w-full'>{room.name}</span>
<span className='w-full'>{group.name}</span>
<input
id={room.id}
id={'group_' + group.id}
type='checkbox'
checked={isChecked}
onChange={e => {
toggleRoomCheck(room.id, e.target.checked)
toggleRoomCheck(group.id, e.target.checked)
}}
/>
</label>
Expand Down
2 changes: 1 addition & 1 deletion web/src/features/group/components/JoinGroupList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const JoinRoomList = ({
{page.data.map(group => (
<JoinRoomItem
key={group.id}
room={group}
group={group}
isChecked={isRoomChecked(group.id)}
toggleRoomCheck={toggleRoomCheck}
/>
Expand Down
24 changes: 11 additions & 13 deletions web/src/pages/ChatRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ import { useEffect } from 'react'
import { useParams } from 'react-router-dom'

export const Component = () => {
const params = useParams<{ groupId: number }>()
const params = useParams<{ groupId: string }>()

const groupId = Number(params.groupId)

const { isOpen, toggle } = useDisclosure()

useEffect(() => {
const socket = getSocketIO()
if (params.groupId) {
socket.emit('joinRoom', params.groupId)
if (groupId) {
socket.emit('joinRoom', Number(groupId))
}
}, [params.groupId])
}, [groupId])

if (!params.groupId) return null
if (!groupId) return null

return (
<>
Expand All @@ -30,16 +32,12 @@ export const Component = () => {
isOpen && 'hidden md:flex',
)}
>
<RoomHeader groupId={params.groupId} showMembers={toggle} />
<MessageList groupId={params.groupId} />
<RoomHeader groupId={groupId} showMembers={toggle} />
<MessageList groupId={groupId} />
<TypingIndicator />
<MessageComposer groupId={params.groupId} />
<MessageComposer groupId={groupId} />
</div>
<MembersSidebar
isOpen={isOpen}
onClose={toggle}
groupId={params.groupId}
/>
<MembersSidebar isOpen={isOpen} onClose={toggle} groupId={groupId} />
</>
)
}
Expand Down

0 comments on commit 97145f0

Please sign in to comment.