Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/monkey-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Monkey CI

env:
PNPM_VERSION: "9.6.0"
NODE_VERSION: "20.19.4"
NODE_VERSION: "24.10.0"
RECAPTCHA_SITE_KEY: "6Lc-V8McAAAAAJ7s6LGNe7MBZnRiwbsbiWts87aj"

permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pretty-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Prettier Check

env:
PNPM_VERSION: "9.6.0"
NODE_VERSION: "20.19.4"
NODE_VERSION: "24.10.0"

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pretty-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Prettier Fix

env:
PNPM_VERSION: "9.6.0"
NODE_VERSION: "20.19.4"
NODE_VERSION: "24.10.0"

permissions:
contents: write
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ dist/
frontend/public/
backend/globalConfig.json
backend/server.version
backend/src/server.version
vite-build/

#cloudflare y
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.19.4
24.10.0
2 changes: 1 addition & 1 deletion backend/docker/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ services:
container_name: monkeytype-api-server
build:
dockerfile_inline: |
FROM node:20.19.4
FROM node:24.10.0
RUN npm i -g pnpm@9.6.0
RUN mkdir /pnpm-store && chown -R 1000:1000 /pnpm-store
user: "node" ##this works as long as your local user has uid=1000
Expand Down
8 changes: 4 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"gen-docs": "tsx scripts/openapi.ts dist/static/api/openapi.json && redocly build-docs -o dist/static/api/internal.html internal@v2 && redocly bundle -o dist/static/api/public.json public-filter && redocly build-docs -o dist/static/api/public.html public@v2"
},
"engines": {
"node": "20.19.4"
"node": "24.10.0"
},
"dependencies": {
"@date-fns/utc": "1.2.0",
Expand Down Expand Up @@ -75,7 +75,7 @@
"@types/lodash": "4.14.178",
"@types/mjml": "4.7.4",
"@types/mustache": "4.2.2",
"@types/node": "20.14.11",
"@types/node": "24.9.1",
"@types/nodemailer": "6.4.15",
"@types/object-hash": "3.0.6",
"@types/readline-sync": "1.4.8",
Expand All @@ -84,7 +84,7 @@
"@types/swagger-stats": "0.95.11",
"@types/ua-parser-js": "0.7.36",
"@types/uuid": "10.0.0",
"@vitest/coverage-v8": "3.2.4",
"@vitest/coverage-v8": "4.0.4",
"concurrently": "8.2.2",
"eslint": "8.57.1",
"eslint-watch": "8.0.0",
Expand All @@ -95,6 +95,6 @@
"testcontainers": "11.4.0",
"tsx": "4.16.2",
"typescript": "5.5.4",
"vitest": "3.2.4"
"vitest": "4.0.4"
}
}
4 changes: 2 additions & 2 deletions docker/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.19.4-alpine3.19 AS builder
FROM node:24.10.0-alpine3.22 AS builder

WORKDIR /app

Expand All @@ -18,7 +18,7 @@ RUN pnpm deploy --filter backend --prod /prod/backend
#---------------------------------

## target image
FROM node:20.19.4-alpine3.19
FROM node:24.10.0-alpine3.22

## get server_version from build-arg, default to UNKNOWN
ARG server_version=UNKNOWN
Expand Down
2 changes: 1 addition & 1 deletion docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.19.4-alpine3.19 AS builder
FROM node:24.10.0-alpine3.22 AS builder
WORKDIR /app

#ENV
Expand Down
6 changes: 3 additions & 3 deletions docs/CONTRIBUTING_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

## Prerequisites

This contribution guide is for cases in which you need to test the functionality of your changes, or if you need to take screenshots of your changes. You will need a computer with a stable internet connection, a text editor, Git, and NodeJS with version 20.19.4. There are some additional requirements depending on what you're looking to contribute, such as Firebase for authentication, and Mongo and Docker for the backend. Read the below sections to understand how to set up each of these tools.
This contribution guide is for cases in which you need to test the functionality of your changes, or if you need to take screenshots of your changes. You will need a computer with a stable internet connection, a text editor, Git, and NodeJS with version 24.10.0. There are some additional requirements depending on what you're looking to contribute, such as Firebase for authentication, and Mongo and Docker for the backend. Read the below sections to understand how to set up each of these tools.

### Git

Expand All @@ -33,9 +33,9 @@ Git is optional but we recommend you utilize it. Monkeytype uses the Git source

### NodeJS and PNPM

Currently, the project is using version `20.19.4 LTS`.
Currently, the project is using version `24.10.0 LTS`.

If you use `nvm` (if you use Windows, use [nvm-windows](https://github.com/coreybutler/nvm-windows)) then you can run `nvm install` and `nvm use` (you might need to specify the exact version eg: `nvm install 20.19.4` then `nvm use 20.19.4`) to use the version of Node.js in the `.nvmrc` file.
If you use `nvm` (if you use Windows, use [nvm-windows](https://github.com/coreybutler/nvm-windows)) then you can run `nvm install` and `nvm use` (you might need to specify the exact version eg: `nvm install 24.10.0` then `nvm use 24.10.0`) to use the version of Node.js in the `.nvmrc` file.

Alternatively, you can navigate to the NodeJS [website](https://nodejs.org/en/) to download it from there.

Expand Down
22 changes: 12 additions & 10 deletions frontend/__tests__/utils/date-and-time.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ describe("date-and-time", () => {
it.for(testCases)(`$locale`, ({ locale, firstDayOfWeek }) => {
//GIVEN
languageMock.mockReturnValue(locale);
localeMock.mockImplementationOnce(
() => ({ weekInfo: { firstDay: firstDayOfWeek } } as any)
);
localeMock.mockImplementation(function (this: any) {
return { weekInfo: { firstDay: firstDayOfWeek } } as any;
});

//WHEN/THEN
expect(DateAndTime.getFirstDayOfTheWeek()).toEqual(firstDayOfWeek);
Expand All @@ -46,18 +46,18 @@ describe("date-and-time", () => {
describe("with getWeekInfo", () => {
it("with getWeekInfo on monday", () => {
languageMock.mockReturnValue("en-US");
localeMock.mockImplementationOnce(
() => ({ getWeekInfo: () => ({ firstDay: 1 }) } as any)
);
localeMock.mockImplementationOnce(function (this: any) {
return { getWeekInfo: () => ({ firstDay: 1 }) } as any;
});

//WHEN/THEN
expect(DateAndTime.getFirstDayOfTheWeek()).toEqual(1);
});
it("with getWeekInfo on sunday", () => {
languageMock.mockReturnValue("en-US");
localeMock.mockImplementationOnce(
() => ({ getWeekInfo: () => ({ firstDay: 7 }) } as any)
);
localeMock.mockImplementationOnce(function (this: any) {
return { getWeekInfo: () => ({ firstDay: 7 }) } as any;
});

//WHEN/THEN
expect(DateAndTime.getFirstDayOfTheWeek()).toEqual(0);
Expand All @@ -66,7 +66,9 @@ describe("date-and-time", () => {

describe("without weekInfo (firefox)", () => {
beforeEach(() => {
localeMock.mockImplementationOnce(() => ({} as any));
localeMock.mockImplementation(function (this: any) {
return {} as any;
});
});

it.for(testCases)(
Expand Down
2 changes: 1 addition & 1 deletion frontend/docker/compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
container_name: monkeytype-frontend
build:
dockerfile_inline: |
FROM node:20.19.4
FROM node:24.10.0
RUN npm i -g pnpm@9.6.0
RUN mkdir /pnpm-store && chown -R 1000:1000 /pnpm-store
user: "node" ##this works as long as your local user has uid=1000
Expand Down
19 changes: 9 additions & 10 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"docker": "docker compose -f docker/compose.dev.yml up"
},
"engines": {
"node": "20.19.4"
"node": "24.10.0"
},
"browserslist": [
"defaults",
Expand All @@ -41,11 +41,11 @@
"@types/damerau-levenshtein": "1.0.0",
"@types/howler": "2.2.7",
"@types/jquery": "3.5.14",
"@types/node": "20.14.11",
"@types/node": "24.9.1",
"@types/object-hash": "3.0.6",
"@types/subset-font": "1.4.3",
"@types/throttle-debounce": "5.0.2",
"@vitest/coverage-v8": "3.2.4",
"@vitest/coverage-v8": "4.0.4",
"autoprefixer": "10.4.20",
"concurrently": "8.2.2",
"dotenv": "16.4.5",
Expand All @@ -64,16 +64,15 @@
"tsx": "4.16.2",
"typescript": "5.5.4",
"unplugin-inject-preload": "3.0.0",
"vite": "6.3.6",
"vite-bundle-visualizer": "1.0.1",
"vite-plugin-checker": "0.7.2",
"vite": "7.1.12",
"vite-bundle-visualizer": "1.2.1",
"vite-plugin-checker": "0.11.0",
"vite-plugin-filter-replace": "0.1.14",
"vite-plugin-html-inject": "1.1.2",
"vite-plugin-inspect": "11.0.0",
"vite-plugin-inspect": "11.3.3",
"vite-plugin-minify": "2.1.0",
"vite-plugin-oxlint": "1.3.1",
"vite-plugin-pwa": "1.0.0",
"vitest": "3.2.4"
"vite-plugin-pwa": "1.1.0",
"vitest": "4.0.4"
},
"dependencies": {
"@date-fns/utc": "1.2.0",
Expand Down
85 changes: 44 additions & 41 deletions frontend/src/ts/elements/account/result-filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,14 @@ export function updateTagsDropdownOptions(): void {

let buttonsAppended = false;

export async function appendButtons(
export async function appendDropdowns(
selectChangeCallback: () => void
): Promise<void> {
//snapshot at this point is guaranteed to exist
const snapshot = DB.getSnapshot() as Snapshot;

tagDropdownUpdate(snapshot);

if (buttonsAppended) return;

selectChangeCallbackFn = selectChangeCallback;
Expand Down Expand Up @@ -864,60 +869,58 @@ export async function appendButtons(
},
});

//snapshot at this point is guaranteed to exist
const snapshot = DB.getSnapshot() as Snapshot;
void updateFilterPresets();
buttonsAppended = true;
}

function tagDropdownUpdate(snapshot: Snapshot): void {
const tagsSection = $(
".pageAccount .content .filterButtons .buttonsAndTitle.tags"
);

if (snapshot.tags.length === 0) {
tagsSection.addClass("hidden");
if (groupSelects["tags"]) {
groupSelects["tags"].destroy();
delete groupSelects["tags"];
}
setFilter("tags", "none", true);
} else {
tagsSection.removeClass("hidden");

updateTagsDropdownOptions();
const selectEl = document.querySelector(
".pageAccount .content .filterButtons .buttonsAndTitle.tags .select .tagsSelect"
);
if (selectEl) {
groupSelects["tags"] = new SlimSelect({
select: selectEl,
settings: {
showSearch: true,
placeholderText: "select a tag",
allowDeselect: true,
closeOnSelect: false,
},
events: {
beforeChange: (selectedOptions, oldSelectedOptions): boolean => {
return selectBeforeChangeFn(
"tags",
selectedOptions,
oldSelectedOptions
);

// Only create SlimSelect if it doesn't exist yet
if (!groupSelects["tags"]) {
const selectEl = document.querySelector(
".pageAccount .content .filterButtons .buttonsAndTitle.tags .select .tagsSelect"
);

if (selectEl) {
groupSelects["tags"] = new SlimSelect({
select: selectEl,
settings: {
showSearch: true,
placeholderText: "select a tag",
allowDeselect: true,
closeOnSelect: false,
},
beforeOpen: (): void => {
adjustScrollposition("tags");
events: {
beforeChange: (selectedOptions, oldSelectedOptions): boolean => {
return selectBeforeChangeFn(
"tags",
selectedOptions,
oldSelectedOptions
);
},
beforeOpen: (): void => {
adjustScrollposition("tags");
},
},
},
});
});
}
}
}

void updateFilterPresets();
buttonsAppended = true;
}

export function removeButtons(): void {
$(
".pageAccount .content .filterButtons .buttonsAndTitle.languages .buttons"
).empty();
$(
".pageAccount .content .filterButtons .buttonsAndTitle.funbox .buttons"
).empty();
$(
".pageAccount .content .filterButtons .buttonsAndTitle.tags .buttons"
).empty();
}

$(".group.presetFilterButtons .filterBtns").on(
Expand Down
Loading
Loading