Skip to content

Commit f08b6e4

Browse files
committed
Light theme improvements, upgrade dependencies, upgrade to apollo server 3, v0.0.100
1 parent 6e01155 commit f08b6e4

File tree

21 files changed

+598
-774
lines changed

21 files changed

+598
-774
lines changed

electron/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "electron",
33
"description": "All-in-one chat and forums for communities.",
4-
"version": "0.0.99",
4+
"version": "0.0.100",
55
"private": true,
66
"repository": "github:joincomet/comet",
77
"homepage": "https://joincomet.app",

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "comet",
3-
"version": "0.0.99",
3+
"version": "0.0.100",
44
"private": true,
55
"license": "MPL-2.0",
66
"author": {
@@ -32,12 +32,12 @@
3232
"@graphql-codegen/typescript": "^1.23.0",
3333
"@graphql-codegen/typescript-operations": "^1.18.4",
3434
"@graphql-codegen/typescript-react-apollo": "^2.3.1",
35-
"@types/node": "^16.3.2",
36-
"@typescript-eslint/eslint-plugin": "^4.28.3",
37-
"@typescript-eslint/parser": "^4.28.3",
35+
"@types/node": "^16.4.0",
36+
"@typescript-eslint/eslint-plugin": "^4.28.4",
37+
"@typescript-eslint/parser": "^4.28.4",
3838
"concurrently": "^6.2.0",
3939
"cross-env": "^7.0.3",
40-
"eslint": "^7.30.0",
40+
"eslint": "^7.31.0",
4141
"eslint-config-prettier": "^8.3.0",
4242
"eslint-plugin-prettier": "^3.4.0",
4343
"prettier": "^2.3.2",

server/package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "server",
3-
"version": "0.0.99",
3+
"version": "0.0.100",
44
"private": true,
55
"engines": {
66
"node": "16.x.x"
@@ -18,17 +18,17 @@
1818
"@n1ru4l/graphql-live-query": "^0.7.1",
1919
"@n1ru4l/in-memory-live-query-store": "^0.6.5",
2020
"add": "^2.0.6",
21-
"apollo-server-express": "^2.25.2",
21+
"apollo-server-express": "^3.0.2",
2222
"argon2": "^0.28.2",
23-
"aws-sdk": "^2.947.0",
23+
"aws-sdk": "^2.951.0",
2424
"class-validator": "^0.13.1",
2525
"cors": "^2.8.5",
2626
"cross-env": "^7.0.3",
2727
"dataloader": "^2.0.0",
2828
"dayjs": "^1.10.6",
2929
"express": "^4.17.1",
3030
"faker": "^5.5.3",
31-
"file-type": "^16.5.1",
31+
"file-type": "^16.5.2",
3232
"got": "^11.8.2",
3333
"graphql": "^15.4.0-experimental-stream-defer.1",
3434
"graphql-redis-subscriptions": "^2.4.0",
@@ -38,17 +38,17 @@
3838
"graphql-ws": "^5.3.0",
3939
"ioredis": "^4.27.6",
4040
"jsonwebtoken": "^8.5.1",
41-
"metascraper": "^5.22.10",
42-
"metascraper-author": "^5.22.10",
43-
"metascraper-clearbit": "^5.22.9",
44-
"metascraper-date": "^5.22.9",
45-
"metascraper-description": "^5.22.9",
46-
"metascraper-image": "^5.22.9",
47-
"metascraper-logo": "^5.22.9",
48-
"metascraper-publisher": "^5.22.10",
49-
"metascraper-title": "^5.22.9",
50-
"metascraper-url": "^5.22.9",
51-
"metascraper-youtube": "^5.22.9",
41+
"metascraper": "^5.22.11",
42+
"metascraper-author": "^5.22.11",
43+
"metascraper-clearbit": "^5.22.11",
44+
"metascraper-date": "^5.22.11",
45+
"metascraper-description": "^5.22.11",
46+
"metascraper-image": "^5.22.11",
47+
"metascraper-logo": "^5.22.11",
48+
"metascraper-publisher": "^5.22.11",
49+
"metascraper-title": "^5.22.11",
50+
"metascraper-url": "^5.22.11",
51+
"metascraper-youtube": "^5.22.11",
5252
"mikro-orm-cache-adapter-redis": "^1.1.1",
5353
"mime": "^2.5.2",
5454
"mudder": "^1.0.10",
@@ -59,7 +59,7 @@
5959
"sharp": "^0.28.3",
6060
"type-graphql": "^1.1.1",
6161
"typescript": "^4.3.5",
62-
"user-agents": "^1.0.713",
62+
"user-agents": "^1.0.719",
6363
"validator": "^13.6.0",
6464
"ws": "^7.5.3",
6565
"xss": "^1.0.9"
@@ -70,7 +70,7 @@
7070
"@types/express": "^4.17.13",
7171
"@types/faker": "^5.5.7",
7272
"@types/graphql-upload": "^8.0.6",
73-
"@types/ioredis": "^4.26.5",
73+
"@types/ioredis": "^4.26.6",
7474
"@types/jsonwebtoken": "^8.5.4",
7575
"@types/mime": "^2.0.3",
7676
"@types/sanitize-html": "^2.3.2",

server/src/bootstrap.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ import cors from 'cors'
1616
import { InMemoryLiveQueryStore } from '@n1ru4l/in-memory-live-query-store'
1717
import { Disposable } from 'graphql-ws'
1818
import { seed } from '@/seed/seed'
19+
import { createServer } from 'http'
1920

2021
const validationRules = [...specifiedRules, NoLiveMixedWithDeferStreamRule]
2122

22-
const RESET = true // set TRUE to WIPE AND RESET DATABASE in dev
23+
const RESET = false // set TRUE to WIPE AND RESET DATABASE in dev
2324

2425
export async function bootstrap() {
2526
console.log(`Initializing database connection...`)
@@ -43,7 +44,7 @@ export async function bootstrap() {
4344
const schema = await buildSchema(typeGraphQLConf)
4445

4546
const app = express()
46-
47+
const httpServer = createServer(app)
4748
app.use(cors({ origin: true }))
4849
app.use(
4950
graphqlUploadExpress({
@@ -52,7 +53,6 @@ export async function bootstrap() {
5253
})
5354
)
5455
const apolloServer = new ApolloServer({
55-
uploads: false,
5656
schema,
5757
validationRules,
5858
context: ({ req }) => {
@@ -69,12 +69,13 @@ export async function bootstrap() {
6969
} as Context
7070
}
7171
})
72+
await apolloServer.start()
7273
apolloServer.applyMiddleware({ app })
7374

7475
const port = +process.env.PORT || 4000
7576

7677
let graphqlWs: Disposable
77-
const server = app.listen(port, () => {
78+
const server = httpServer.listen(port, () => {
7879
console.log(`Listening on port ${port}`)
7980
// create and use the websocket server
8081
const wsServer = new ws.Server({
@@ -118,11 +119,13 @@ export async function bootstrap() {
118119
)
119120
})
120121

121-
process.once('SIGINT', () => {
122-
console.log('Received SIGINT. Shutting down HTTP and Websocket server.')
123-
graphqlWs?.dispose()
124-
server.close()
125-
orm.close()
122+
;['SIGINT', 'SIGTERM'].forEach(signal => {
123+
process.on(signal, () => {
124+
console.log('Received SIGINT. Shutting down HTTP and Websocket server.')
125+
graphqlWs?.dispose()
126+
server.close()
127+
orm.close()
128+
})
126129
})
127130

128131
await seed(orm.em.fork())

web/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "web",
33
"description": "All-in-one chat and forums for communities.",
4-
"version": "0.0.99",
4+
"version": "0.0.100",
55
"private": true,
66
"repository": "github:joincomet/comet",
77
"homepage": "https://joincomet.app",
@@ -45,17 +45,17 @@
4545
"fuse.js": "^6.4.6",
4646
"graphql": "^15.4.0-experimental-stream-defer.1",
4747
"graphql-ws": "^5.3.0",
48-
"i18next": "^20.3.3",
48+
"i18next": "^20.3.4",
4949
"i18next-browser-languagedetector": "^6.1.2",
5050
"react-contenteditable": "^3.3.5",
5151
"react-dnd": "^14.0.2",
5252
"react-dnd-html5-backend": "^14.0.0",
5353
"react-dnd-touch-backend": "^14.0.0",
5454
"react-dropzone": "^11.3.4",
5555
"react-helmet-async": "^1.0.9",
56-
"react-hook-form": "^7.11.0",
56+
"react-hook-form": "^7.11.1",
5757
"react-hot-toast": "^2.0.0",
58-
"react-i18next": "^11.11.2",
58+
"react-i18next": "^11.11.3",
5959
"react-icons": "^4.2.0",
6060
"react-intersection-observer": "^8.32.0",
6161
"react-player": "^2.9.0",
@@ -66,7 +66,7 @@
6666
"react-twitter-widgets": "^1.10.0",
6767
"react-use": "^17.2.4",
6868
"react-virtual": "^2.8.0",
69-
"react-virtuoso": "^1.9.3",
69+
"react-virtuoso": "^1.9.6",
7070
"react-youtube": "^7.13.1",
7171
"tippy.js": "^6.3.1",
7272
"twemoji": "^13.1.0",
@@ -91,14 +91,14 @@
9191
"graphiql": "^1.4.2",
9292
"graphql-tag": "^2.12.5",
9393
"meros": "^1.1.4",
94-
"postcss": "^8.3.5",
94+
"postcss": "^8.3.6",
9595
"react": "^17.0.2",
9696
"react-dom": "^17.0.2",
9797
"sass": "^1.35.2",
9898
"string-hash": "^1.1.3",
9999
"tailwind-scrollbar": "^1.3.1",
100-
"tailwindcss": "^2.2.4",
101-
"vite": "^2.4.2",
100+
"tailwindcss": "^2.2.6",
101+
"vite": "^2.4.3",
102102
"vite-plugin-pwa": "^0.8.1"
103103
},
104104
"resolutions": {

web/src/components/BottomBar.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ export default function BottomBar() {
172172
<>
173173
<Tippy content="Notifications" offset={offset}>
174174
<Link to="/inbox">
175-
<IconBell className="w-4.5 h-4.5 cursor-pointer" />
175+
<IconBell className="w-4.5 h-4.5 cursor-pointer text-tertiary" />
176176
</Link>
177177
</Tippy>
178178

179179
<Tippy content="Settings" offset={offset}>
180180
<div onClick={() => setOpen(true)}>
181-
<IconSettings className="w-4.5 h-4.5 cursor-pointer" />
181+
<IconSettings className="w-4.5 h-4.5 cursor-pointer text-tertiary" />
182182
</div>
183183
</Tippy>
184184
</>

web/src/components/comment/Comment.jsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ export default function Comment({
4646
])
4747
const isReplying = replyingCommentId === comment.id
4848

49-
if(comment.isDeleted && !comment.childCount) return null
49+
if (comment.isDeleted && !comment.childCount) return null
5050

5151
return (
5252
<div
53-
className={`relative md:rounded dark:bg-gray-800 bg-white ${
53+
className={`relative md:rounded dark:bg-gray-800 bg-gray-200 ${
5454
level === 0 ? '' : 'pl-4'
5555
}`}
5656
>
@@ -66,15 +66,19 @@ export default function Comment({
6666
<UserPopup user={comment.author} role={comment.serverUser?.role}>
6767
<UserAvatar
6868
size={7}
69-
className={`cursor-pointer transition ${!comment.author ? 'opacity-40 dark:bg-gray-700' : 'hover:opacity-90'}`}
69+
className={`cursor-pointer transition ${
70+
!comment.author
71+
? 'opacity-40 dark:bg-gray-700'
72+
: 'hover:opacity-90'
73+
}`}
7074
user={comment.author}
7175
/>
7276
</UserPopup>
7377
</ContextMenuTrigger>
7478

7579
<div
7680
className={`pl-3 pb-3 w-full ${
77-
(!!comment.childCount) && !collapse
81+
!!comment.childCount && !collapse
7882
? 'border-b dark:border-gray-750'
7983
: ''
8084
}`}
@@ -93,7 +97,9 @@ export default function Comment({
9397
}`}
9498
style={{ color: comment.serverUser?.role?.color }}
9599
>
96-
{comment.author?.username ?? <span className="text-mid">[deleted]</span>}
100+
{comment.author?.username ?? (
101+
<span className="text-mid">[deleted]</span>
102+
)}
97103
</div>
98104
</UserPopup>
99105
</ContextMenuTrigger>
@@ -265,7 +271,7 @@ export default function Comment({
265271

266272
<div className="pl-3">
267273
{!collapse &&
268-
comment.childComments.map((childComment) => (
274+
comment.childComments.map(childComment => (
269275
<Comment
270276
key={childComment.id}
271277
comment={childComment}

web/src/components/comment/CreateCommentCard.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default function CreateCommentCard({ postId }) {
1414
{!open ? (
1515
<div
1616
onClick={() => setOpen(true)}
17-
className="dark:bg-gray-700 h-13 flex items-center rounded transition dark:hover:bg-gray-650 cursor-pointer bg-gray-50"
17+
className="dark:bg-gray-700 h-13 flex items-center rounded transition dark:hover:bg-gray-650 cursor-pointer bg-gray-200"
1818
>
1919
<div className="px-3 border-r dark:border-gray-650 h-7">
2020
<UserAvatar user={user} size={7} />
@@ -24,7 +24,7 @@ export default function CreateCommentCard({ postId }) {
2424
</div>
2525
</div>
2626
) : (
27-
<div className="dark:bg-gray-800 pt-3 pb-3 px-3 rounded flex">
27+
<div className="dark:bg-gray-800 bg-gray-200 pt-3 pb-3 px-3 rounded flex">
2828
<div className="pr-3 mr-3 border-r dark:border-gray-750 inline-block h-7">
2929
<UserAvatar user={user} size={7} />
3030
</div>

web/src/components/message/Message.jsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ export default memo(function Message({
3939
[message]
4040
)
4141

42-
const showUser =
43-
index === 0 ||
44-
(prevMessage &&
45-
(!prevMessage.text || prevMessage.author.id !== message.author.id))
46-
4742
const day = Math.floor(
4843
new Date(message.createdAt).getTime() / (1000 * 60 * 60 * 24)
4944
)
@@ -54,6 +49,12 @@ export default memo(function Message({
5449
)
5550
: null
5651

52+
const showUser =
53+
index === 0 ||
54+
(prevMessage &&
55+
(!prevMessage.text || prevMessage.author.id !== message.author.id)) ||
56+
day > prevDay
57+
5758
if (message.type === MessageType.Initial) {
5859
return <MessagesStart channel={channel} group={group} user={user} />
5960
}
@@ -92,7 +93,7 @@ export default memo(function Message({
9293
}}
9394
>
9495
<UserPopup user={message.author} role={message.serverUser?.role}>
95-
<span className="ml-2 text-white cursor-pointer hover:underline">
96+
<span className="ml-2 text-primary font-medium cursor-pointer hover:underline">
9697
{message.author.username}
9798
</span>
9899
</UserPopup>
@@ -111,9 +112,9 @@ export default memo(function Message({
111112
return (
112113
<div className={`${showUser ? 'pt-4' : ''}`}>
113114
{day > prevDay && (
114-
<div className="pt-1 pb-4">
115-
<div className="text-mid text-xs font-medium h-0 border-t border-gray-700 flex items-center justify-center">
116-
<span className="dark:bg-gray-750 px-1 py-0.5">
115+
<div className="pt-1 pb-4 px-4">
116+
<div className="text-mid text-xs font-medium h-0 border-t dark:border-gray-700 border-gray-200 flex items-center justify-center">
117+
<span className="dark:bg-gray-750 bg-white px-1 py-0.5">
117118
{format(new Date(message.createdAt), 'MMMM d, y')}
118119
</span>
119120
</div>

web/src/components/message/input/MessageInput.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,13 @@ export default function MessageInput({ channel, server, group, user, users }) {
210210
return () => {
211211
instance.destroy()
212212
}
213-
}, [canSendMessage, placeholder, variables?.channelId, variables?.groupId, variables?.userId])
213+
}, [
214+
canSendMessage,
215+
placeholder,
216+
variables?.channelId,
217+
variables?.groupId,
218+
variables?.userId
219+
])
214220

215221
// const editor = useEditor(editorOptions)
216222

@@ -394,11 +400,9 @@ export default function MessageInput({ channel, server, group, user, users }) {
394400
}}
395401
className={`${canSendMessage ? 'px-14' : 'px-4 opacity-50'} ${
396402
currentUser ? '' : 'cursor-pointer'
397-
} min-h-[3rem] max-h-[20rem] overflow-y-auto scrollbar-light dark:bg-gray-700 py-3 w-full rounded-lg text-base focus:outline-none text-secondary border-none bg-gray-100`}
403+
} min-h-[3rem] max-h-[20rem] overflow-y-auto scrollbar-light dark:bg-gray-700 py-3 w-full rounded-lg text-base focus:outline-none text-secondary border-none bg-gray-200`}
398404
>
399-
{!editor?.isDestroyed && (
400-
<EditorContent editor={editor} />
401-
)}
405+
{!editor?.isDestroyed && <EditorContent editor={editor} />}
402406
</div>
403407
</div>
404408

0 commit comments

Comments
 (0)