Skip to content

Commit ea2095f

Browse files
committed
Merge branch 'master' of github.com:source-academy/frontend into eugene-grading-comment-selector
2 parents 837e4ea + ef84ba5 commit ea2095f

File tree

374 files changed

+15374
-8927
lines changed

Some content is hidden

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

374 files changed

+15374
-8927
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
commands: [tsc, 'format:ci', eslint, build, test, test-coveralls]
25+
commands: [tsc, 'format:ci', eslint, build, 'test --bail=1', test-coveralls]
2626
steps:
2727
- name: Checkout repository
2828
uses: actions/checkout@v4
@@ -43,5 +43,5 @@ jobs:
4343
if: matrix.commands == 'test-coveralls'
4444
uses: coverallsapp/github-action@master
4545
with:
46-
path-to-lcov: lcov.info
46+
path-to-lcov: coverage/lcov.info
4747
github-token: ${{ secrets.GITHUB_TOKEN }}

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"singleQuote": true,
44
"printWidth": 100,
55
"arrowParens": "avoid",
6-
"trailingComma": "none"
6+
"trailingComma": "none",
7+
"endOfLine": "auto"
78
}

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ To start contributing, create a fork from our repo and send a PR. Refer to [this
1616

1717
The frontend comes with an extensive test suite. To run the tests after you made your modifications, run
1818
`yarn test`. Regression tests are run automatically when you want to push changes to this repository.
19-
The regression tests are generated using `jest` and stored as snapshots in `src/\_\_tests\_\_`. After modifying the frontend, carefully inspect any failing regression tests reported in red in the command line. If you are convinced that the regression tests and not your changes are at fault, you can update the regression tests by running:
19+
The regression tests are generated using `vitest` and stored as snapshots in `src/\_\_tests\_\_`. After modifying the frontend, carefully inspect any failing regression tests reported in red in the command line. If you are convinced that the regression tests and not your changes are at fault, you can update the regression tests by running:
2020

2121
```bash
22-
yarn test --updateSnapshot
22+
yarn test --update
2323
```
2424

2525
## Manually testing the frontend

eslint.config.mjs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
// @ts-check
22

3-
// import eslint from '@eslint/js';
4-
import { config, configs } from 'typescript-eslint';
3+
import eslint from '@eslint/js';
54
import reactPlugin from 'eslint-plugin-react';
65
import reactHooksPlugin from 'eslint-plugin-react-hooks';
76
import simpleImportSort from 'eslint-plugin-simple-import-sort';
8-
// import reactRefresh from 'eslint-plugin-react-refresh';
7+
import tseslint from 'typescript-eslint';
8+
import reactRefresh from 'eslint-plugin-react-refresh';
99

10-
export default config(
11-
{ ignores: ['eslint.config.mjs'] },
12-
// eslint.configs.recommended,
13-
...configs.recommended,
10+
export default tseslint.config(
11+
{ ignores: ['eslint.config.mjs', '**/*.snap'] },
12+
eslint.configs.recommended,
13+
tseslint.configs.recommended,
1414
// TODO: Enable when ready
15-
// {
16-
// plugins: {
17-
// 'react-refresh': reactRefresh
18-
// },
19-
// rules: {
20-
// 'react-refresh/only-export-components': 'warn'
21-
// }
22-
// },
15+
{
16+
plugins: {
17+
'react-refresh': reactRefresh
18+
},
19+
rules: {
20+
'react-refresh/only-export-components': 'warn'
21+
}
22+
},
2323
{
2424
files: ['**/*.ts*'],
2525
plugins: {
@@ -29,6 +29,7 @@ export default config(
2929
},
3030
rules: {
3131
...reactHooksPlugin.configs['recommended-latest'].rules,
32+
'no-empty': 'warn',
3233
'no-restricted-imports': [
3334
'error',
3435
{

jest.config.js

Lines changed: 0 additions & 104 deletions
This file was deleted.

jsdom-env.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,63 +21,68 @@
2121
"format:scss": "prettier --list-different --parser scss \"src/**/*.scss\"",
2222
"format:ci": "yarn run format:tsx && yarn run format:scss",
2323
"start": "rsbuild dev",
24-
"test": "cross-env TZ=Asia/Singapore jest",
24+
"test": "cross-env TZ=Asia/Singapore vitest run",
25+
"test:watch": "cross-env TZ=Asia/Singapore vitest",
26+
"test:ui": "cross-env TZ=Asia/Singapore vitest --ui --no-open",
2527
"test-coveralls": "./scripts/test-coveralls.sh",
26-
"update-ui-snapshots": "jest --updateSnapshot",
28+
"update-ui-snapshots": "vitest run --update",
2729
"eslint": "eslint src",
2830
"prepare": "husky",
2931
"preview": "rsbuild preview"
3032
},
3133
"dependencies": {
32-
"@blueprintjs/core": "^5.10.1",
33-
"@blueprintjs/datetime2": "^2.3.3",
34-
"@blueprintjs/icons": "^5.9.0",
35-
"@blueprintjs/select": "^5.1.3",
34+
"@blueprintjs/core": "^6.0.0",
35+
"@blueprintjs/datetime": "^6.0.0",
36+
"@blueprintjs/icons": "^6.0.0",
37+
"@blueprintjs/select": "^6.0.0",
38+
"@convergencelabs/ace-collab-ext": "^0.6.0",
3639
"@mantine/hooks": "^7.11.2",
37-
"@octokit/rest": "^20.0.0",
40+
"@octokit/rest": "^22.0.0",
3841
"@reduxjs/toolkit": "^1.9.7",
39-
"@sentry/browser": "^8.33.0",
42+
"@sentry/react": "^10.5.0",
4043
"@sourceacademy/c-slang": "^1.0.21",
41-
"@sourceacademy/sharedb-ace": "^2.0.3",
44+
"@sourceacademy/conductor": "https://github.com/source-academy/conductor.git#0.2.1",
45+
"@sourceacademy/language-directory": "https://github.com/source-academy/language-directory.git#0.0.4",
46+
"@sourceacademy/plugin-directory": "https://github.com/source-academy/plugin-directory.git#0.0.2",
47+
"@sourceacademy/sharedb-ace": "2.1.1",
4248
"@sourceacademy/sling-client": "^0.1.0",
4349
"@szhsin/react-menu": "^4.0.0",
4450
"@tanstack/react-table": "^8.9.3",
4551
"@tremor/react": "^1.8.2",
46-
"ace-builds": "^1.36.3",
52+
"ace-builds": "^1.42.1",
4753
"acorn": "^8.9.0",
48-
"ag-grid-community": "^32.3.1",
49-
"ag-grid-react": "^32.3.1",
54+
"ag-grid-community": "^34.1.1",
55+
"ag-grid-react": "^34.1.1",
5056
"array-move": "^4.0.0",
5157
"browserfs": "^1.4.3",
5258
"classnames": "^2.3.2",
53-
"conductor": "https://github.com/source-academy/conductor.git#0.2.1",
5459
"dayjs": "^1.11.13",
5560
"dompurify": "^3.2.4",
5661
"flexboxgrid": "^6.3.1",
5762
"flexboxgrid-helpers": "^1.1.3",
5863
"hastscript": "^9.0.0",
5964
"i18next": "^25.0.0",
6065
"i18next-browser-languagedetector": "^8.0.0",
66+
"immer": "^9.0.21",
6167
"java-slang": "^1.0.13",
6268
"js-cookie": "^3.0.5",
63-
"js-slang": "^1.0.84",
69+
"js-slang": "^1.0.85",
6470
"js-yaml": "^4.1.0",
6571
"konva": "^9.2.0",
66-
"language-directory": "https://github.com/source-academy/language-directory.git",
6772
"lodash": "^4.17.21",
6873
"lz-string": "^1.4.4",
6974
"mdast-util-from-markdown": "^2.0.0",
7075
"mdast-util-to-hast": "^13.0.0",
7176
"normalize.css": "^8.0.1",
72-
"phaser": "~3.87.0",
77+
"phaser": "~3.90.0",
7378
"query-string": "^9.0.0",
7479
"re-resizable": "^6.9.9",
7580
"react": "^18.3.1",
7681
"react-ace": "^14.0.0",
7782
"react-copy-to-clipboard": "^5.1.0",
7883
"react-debounce-render": "^8.0.2",
7984
"react-dom": "^18.3.1",
80-
"react-drag-drop-files": "^2.3.10",
85+
"react-drag-drop-files": "^3.0.0",
8186
"react-draggable": "^4.4.5",
8287
"react-dropzone": "^14.2.3",
8388
"react-i18next": "^15.0.0",
@@ -87,7 +92,7 @@
8792
"react-papaparse": "^4.0.2",
8893
"react-qr-reader": "^3.0.0-beta-1",
8994
"react-redux": "^8.1.1",
90-
"react-router-dom": "^6.14.1",
95+
"react-router": "^7.6.2",
9196
"react-select": "^5.7.3",
9297
"react-simple-keyboard": "^3.6.27",
9398
"react-sortable-hoc": "^2.0.0",
@@ -99,7 +104,7 @@
99104
"showdown": "^2.1.0",
100105
"sourceror": "^0.8.5",
101106
"unified": "^11.0.0",
102-
"uuid": "^11.0.2",
107+
"uuid": "^13.0.0",
103108
"workbox-core": "^7.3.0",
104109
"workbox-precaching": "^7.3.0",
105110
"workbox-routing": "^7.3.0",
@@ -108,11 +113,11 @@
108113
"yareco": "^0.1.5"
109114
},
110115
"devDependencies": {
116+
"@aaroon/workbox-rspack-plugin": "^0.3.2",
111117
"@babel/core": "^7.24.5",
112118
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
113119
"@babel/preset-typescript": "^7.24.1",
114120
"@babel/runtime": "^7.24.5",
115-
"@convergencelabs/ace-collab-ext": "^0.6.0",
116121
"@rsbuild/core": "^1.3.12",
117122
"@rsbuild/plugin-eslint": "^1.1.1",
118123
"@rsbuild/plugin-node-polyfill": "^1.3.0",
@@ -121,19 +126,17 @@
121126
"@rsbuild/plugin-svgr": "^1.2.0",
122127
"@svgr/webpack": "^8.0.0",
123128
"@swc/core": "^1.11.22",
124-
"@swc/jest": "^0.2.38",
129+
"@testing-library/dom": "^10.4.0",
125130
"@testing-library/jest-dom": "^6.0.0",
126-
"@testing-library/react": "^15.0.6",
127-
"@testing-library/user-event": "^14.4.3",
128-
"@types/dompurify": "^3.0.5",
131+
"@testing-library/react": "^16.0.0",
132+
"@testing-library/user-event": "^14.6.0",
129133
"@types/estree": "^1.0.5",
130-
"@types/gapi": "^0.0.44",
131-
"@types/gapi.auth2": "^0.0.57",
134+
"@types/gapi": "^0.0.47",
135+
"@types/gapi.auth2": "^0.0.61",
132136
"@types/gapi.client": "^1.0.5",
133137
"@types/gapi.client.drive-v3": "^0.0.5",
134-
"@types/google.picker": "^0.0.39",
138+
"@types/google.picker": "^0.0.51",
135139
"@types/identity-obj-proxy": "^3",
136-
"@types/jest": "^29.0.0",
137140
"@types/js-cookie": "^3.0.6",
138141
"@types/js-yaml": "^4.0.5",
139142
"@types/lodash": "^4.14.195",
@@ -146,12 +149,14 @@
146149
"@types/redux-mock-store": "^1.0.3",
147150
"@types/showdown": "^2.0.1",
148151
"@types/xml2js": "^0.4.11",
149-
"babel-jest": "^29.7.0",
152+
"@vitejs/plugin-react-swc": "^4.0.0",
153+
"@vitest/coverage-v8": "3.2.4",
154+
"@vitest/ui": "^3.2.4",
150155
"buffer": "^6.0.3",
151156
"canvas": "^3.1.0",
152157
"constants-browserify": "^1.0.0",
153158
"coveralls": "^3.1.1",
154-
"cross-env": "^7.0.3",
159+
"cross-env": "^10.0.0",
155160
"eslint": "^9.9.0",
156161
"eslint-plugin-react": "^7.35.0",
157162
"eslint-plugin-react-hooks": "^5.2.0",
@@ -160,8 +165,7 @@
160165
"https-browserify": "^1.0.0",
161166
"husky": "^9.0.0",
162167
"identity-obj-proxy": "^3.0.0",
163-
"jest": "^29.7.0",
164-
"jest-environment-jsdom": "^29.7.0",
168+
"jsdom": "^26.0.0",
165169
"npm-run-all2": "^8.0.0",
166170
"os-browserify": "^0.3.0",
167171
"path": "^0.12.7",
@@ -180,6 +184,7 @@
180184
"typescript": "^5.8.2",
181185
"typescript-eslint": "^8.1.0",
182186
"url": "^0.11.1",
187+
"vitest": "^3.2.4",
183188
"webpack-bundle-analyzer": "^4.9.0"
184189
},
185190
"browserslist": {

public/assets/Sample_Profile_1.jpg

6.84 KB
Loading

public/assets/Sample_Profile_2.jpg

8.79 KB
Loading

public/assets/Sample_Profile_3.jpg

10.8 KB
Loading

0 commit comments

Comments
 (0)