Commit graph

662 commits

Author SHA1 Message Date
Jack
a067a32b7a
chore: move main linting to oxlint (@miodec) (#7144)
- main linting is now done by oxlint. eslint remains for linting json
files in the frontend (until oxlint adds support)
 - move type checking to the lint step (with --type-check)
this improves performance by removing a duplicated typescript parse task
(instead of parsing for linting then again for type checking, it parses
once for both)
- add a `lint-fast` npm script to get some fast fail behavior. it simply
lints with no type information
- oxc plugins are still in preview, so the custom plugin that checks for
`__testing` usage outside of tests runs outside the main linting job
until performance is improved
- fixes some type issues (and config issues) that were not visible due
to a missing type check on some files. now type checking will run on
every file that is linted
 - split up oxc config for easier management

waiting https://github.com/oxc-project/tsgolint/pull/494

seeing around 3x improvement in type aware linting
2025-12-15 22:16:16 +01:00
Miodec
2ee582a597 chore: configure eslint/curly rule 2025-12-09 22:41:45 +01:00
Jack
b5a03e0040
chore(linting): enable prefer-nullish-coalescing (@miodec) (#7209) 2025-12-09 20:37:04 +01:00
Jack
f910c8a567
chore: prettier upgrade (@miodec) (#7159) 2025-11-27 00:20:09 +01:00
Christian Fehmer
1009791915
refactor: remove lodash from backend (@fehmer) (#6953) 2025-11-17 12:51:40 +01:00
Christian Fehmer
949e2baa48
perf: optimize friend queries (@fehmer) (#7080)
Combine two queries (first get all friend UIDs, then call leaderboard)
into one query to reduce db roundtrips.

Use the same approach for the friends list in user dal.

Note: when updating mongodb to 6+ we could use unionWith in case we
don't need the metadata (lb use-case)
2025-11-13 15:31:55 +01:00
Christian Fehmer
8ee7e94d46
fix(leaderboards): show correct rank in friends weekly leaderboard (@fehmer) (#7104) 2025-11-12 15:33:32 +01:00
Christian Fehmer
d74051e878
feat(leaderboard): add friends filter to daily/weekly leaderboard (@fehmer) (#7084) 2025-11-12 14:41:22 +01:00
Christian Fehmer
9d64a57daf
feat(leaderboard): add friends filter to all-time leaderboard (@fehmer) (#7061) 2025-10-31 18:57:42 +01:00
Christian Fehmer
d885e70232
feat: add friend requests and list (@fehmer) (#6658)
make some friends on monkeytype

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-10-28 12:36:16 +01:00
Jack
8627235bef
feat(result): rename raw to burst, add raw line to result graph, add ability to hide chart data (@miodec) (#6907) 2025-09-02 11:06:15 +02:00
Jack
7487e53c67
refactor: result migration and tests cleanup (@miodec) (#6929)
move all legacy test value migration into a central place, update the
tests to only check if that was called, test replaceLegacyValues
2025-09-01 17:39:24 +02:00
Christian Fehmer
d9887cf37c
refactor: use findOne instead of limit(1) (@fehmer) (#6924) 2025-09-01 11:52:16 +02:00
Miodec
c8cf1eae54 refactor: optimise fetching last result timestamp when adding a result 2025-08-28 16:19:26 +02:00
Jack
e4c0c28150
chore: bump eslint typescript plugin (@miodec) (#6915) 2025-08-26 22:12:27 +02:00
Miodec
2a6bfbeefb chore: log high wpm results 2025-08-20 11:57:19 +02:00
Christian Fehmer
c5d43dd673
feat(profile): optionally include test activity on users public profile (@fehmer) (#6824)
Co-authored-by: Miodec <jack@monkeytype.com>
2025-08-15 14:31:58 +02:00
Christian Fehmer
f9b22ade56
chore: remove unused dependencies (@fehmer) (#6841)
- **remove chokidar**
- **remove path, node-fetch, ioredis-mock**
- **remove nodemon**
2025-08-07 15:02:19 +02:00
Christian Fehmer
cd99d5af16
test: add WeeklyXpLeaderboards integration tests (@fehmer) (#6843) 2025-08-07 14:48:14 +02:00
Christian Fehmer
01ed9322ec
test: update to vitest3 (@fehmer) (#6811)
- **test: use mongodb testcontainer (@fehmer)**
- **don't run integration tests in parallel**
- **fix premium test**
- **refactor, cleanup**
- **refactor, cleanup**
- **test: add integration tests for daily leaderboards (@fehmer)**
- **trigger**
- **trigger**
- **test: update to vitest3 (@fehmer)**
2025-08-04 15:55:10 +02:00
Christian Fehmer
d9009e51cc
test: use mongodb testcontainer (@fehmer) (#6808) 2025-08-04 15:10:41 +02:00
Cameron
2180e3b603
chore(deps): upgrade oxlint to 1.8.0, fix errors (@camc314) (#6776)
### Description

This PR updates oxlint to 1.8.0 and fixes the resulting errors in order
to keep oxlint's ecosystem CI green.

Thanks for using oxlint

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-07-24 14:32:12 +02:00
Jack
69cbbe4ab2
refactor(contracts / schemas): move schemas into their own package (@miodec) (#6754) 2025-07-21 14:55:54 +02:00
Miodec
255fd7f410 chore: only log daily changes 6 hours after the reset 2025-07-19 02:09:09 +02:00
Miodec
c6d9033005 chore: move result logging later, log top 10 daily 2025-07-17 09:37:06 +02:00
Miodec
c4590a2939 chore: log only up to 2 minute tests 2025-07-17 09:27:48 +02:00
Miodec
c9986bbc4c chore: slice long messages 2025-07-17 09:19:39 +02:00
Miodec
b15520f0b3 chore: add ability to log results 2025-07-17 01:24:47 +02:00
Christian Fehmer
a4de8dfda6
impr(leaderboard): daily mode/language buttons based on backend configuration (@fehmer) (#6713)
Co-authored-by: Miodec <jack@monkeytype.com>
2025-07-14 15:32:09 +02:00
Christian Fehmer
5aec2c9a17
fix(docker): use frontend url for firebase admin (@fehmer) (#6730)
fixes #6728

---------

Co-authored-by: Jack <jack@monkeytype.com>
2025-07-14 15:30:34 +02:00
Christian Fehmer
8be3a3cc9b
fix(leaderboard): use minTimeTyping from configuration (@fehmer) (#6710)
We added `minTimeTyping` to the configuration but it was only used to
create the indicies.
2025-07-09 12:09:49 +02:00
Christian Fehmer
9b26793a6d
chore: update express to 5.1.0 (@fehmer) (#6691) 2025-07-03 15:43:01 +02:00
Christian Fehmer
afbff1bcf6
fix(docker): Allow to self-host without firebase config (@fehmer) (#6685)
fixes #6505
2025-07-01 13:06:06 +02:00
Seif Soliman
e4a102ac64
impr(results): allow PBs with stop on letter if accuracy is 100% (@byseif21) (#6611) 2025-06-26 17:11:15 +02:00
Miodec
2d008461ed chore: catch firebase internal errors when trying to auth 2025-06-14 14:11:05 +02:00
Christian Fehmer
d6ae7cf7c4
fix: compatability check header shown if client is using cached responses (@fehmer) (#6602)
If frontend and backend are deployed with a new COMPATABILITY_CHECK
header frontend might show the backend version is lower because of the
http header of a cached response.

Adding the COMPATABILITY_CHECK version as part of the etag fixes this.
2025-05-27 16:59:49 +02:00
Jack
ea90e0a99e
refactor: dont allow nullable numbers (@miodec) (#6564)
Enables strict boolean expressions rule for nullable numbers
2025-05-16 16:04:19 +02:00
Miodec
8370de1fa4 impr: add function to clearstreakhouroffset
!nuf
2025-05-12 13:52:37 +02:00
Christian Fehmer
eb092cea1c
refactor: move languages to contracts (@fehmer) (#6497) 2025-05-07 14:02:27 +02:00
Miodec
255c4b944d fix: unable to link discord if user has no avatar 2025-04-30 18:41:03 +02:00
Miodec
c666d13c96 impr: parse response from discord api with zod
!nuf
2025-04-29 13:53:02 +02:00
Christian Fehmer
212b8d38cb
refactor: make funbox settings an array (@fehmer) (#6487)
change funbox from "hash separated values" to array.

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-29 11:31:44 +02:00
Miodec
ab9cef010e chore: swap monkeyerror for error to not expose actual error message to the frontend 2025-04-26 21:53:16 +02:00
Jack
e06f7f41cf
refactor: add trycatch util (@miodec) (#6492)
Adds trycatch util to cleanup try catch code.
2025-04-26 21:24:39 +02:00
Miodec
a59f99a533 refactor: protect against null, remove nullish coalescing 2025-04-26 18:56:58 +02:00
Seif Soliman
86383cf9ef
refactor(backend): improve redis and json.parse type safety with zod (@byseif21, @miodec) (#6481)
### Description

refactored backend files to enhance type safety and reliability using
Zod validation and Redis instead of JSON.parse , I tried to avoid the
files that isn't necessary tho so I hope I don't miss any or included
unnecessary ones!! didn't fully test only verified code compilation and
partial tests without Redis!!.


Should Close #5881 
Related to #6207

---------

Co-authored-by: Miodec <jack@monkeytype.com>
2025-04-24 16:25:43 +02:00
Miodec
a424f96480 chore: upgrade oxlint 2025-04-23 18:54:33 +02:00
Miodec
d3f3a834e3 refactor: remove unnecessary json parse 2025-04-23 18:43:38 +02:00
Miodec
0b05b3c2fd refactor: enable ban-ts-comment rule 2025-04-16 19:15:30 +02:00
Jack
cac8835c77
chore: add oxlint (@miodec) (#6455)
Use oxlint for general linting to provide much quicker feedback. Keep
eslint for type-aware rules. Fully switch to oxlint once it supports
type-aware.
2025-04-16 17:18:50 +02:00