Skip to content

Commit 9fd4d8a

Browse files
committed
Merge branch 'leaderboard' of https://github.com/source-academy/frontend into leaderboard
2 parents 6a123b6 + c63c423 commit 9fd4d8a

File tree

85 files changed

+21003
-14885
lines changed

Some content is hidden

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

85 files changed

+21003
-14885
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ REACT_APP_DEPLOYMENT_NAME=Source Academy
22

33
REACT_APP_BACKEND_URL=http://localhost:4000
44
REACT_APP_USE_BACKEND=TRUE
5+
REACT_APP_USE_EMPTY_ASSET_PREFIX=FALSE
56
REACT_APP_PLAYGROUND_ONLY=FALSE
67
REACT_APP_SHOW_RESEARCH_PROMPT=FALSE
78

.github/workflows/build-development.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
steps:
1212
- name: Checkout repository
1313
uses: actions/checkout@v4
14+
# Has to be run before actions/setup-node.
15+
# See: https://github.com/actions/setup-node/issues/480
16+
- name: Enable corepack for Yarn
17+
run: corepack enable
1418
- name: Setup node
1519
uses: actions/setup-node@v4
1620
with:
@@ -23,7 +27,7 @@ jobs:
2327
run: echo "time=$(date -Iseconds)" >> $GITHUB_OUTPUT
2428
- name: yarn install and build
2529
run: |
26-
yarn install --frozen-lockfile
30+
yarn install --immutable
2731
yarn run build
2832
env:
2933
REACT_APP_URL_SHORTENER_SIGNATURE: ${{ secrets.REACT_APP_URL_SHORTENER_SIGNATURE }}

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ jobs:
2626
steps:
2727
- name: Checkout repository
2828
uses: actions/checkout@v4
29+
# Has to be run before actions/setup-node.
30+
# See: https://github.com/actions/setup-node/issues/480
31+
- name: Enable corepack for Yarn
32+
run: corepack enable
2933
- name: Setup node
3034
uses: actions/setup-node@v4
3135
with:
3236
node-version: 20
3337
cache: yarn
3438
- name: Install dependencies
35-
run: yarn install --frozen-lockfile
39+
run: yarn install --immutable
3640
- name: Run command
3741
run: yarn run ${{ matrix.commands }}
3842
- name: Coveralls - Upload test coverage report

.gitignore

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ terraform*
2424
.env.test.local
2525
.env.production.local
2626
.idea/
27-
.vscode/
28-
cadet-frontend.iml
2927

3028
npm-debug.log*
3129
.eslintcache
@@ -34,3 +32,22 @@ yarn-error.log
3432
# emacs backup files
3533

3634
*~
35+
36+
# yarn files
37+
38+
.yarn/*
39+
!.yarn/patches
40+
!.yarn/plugins
41+
!.yarn/releases
42+
!.yarn/sdks
43+
!.yarn/versions
44+
45+
# Swap the comments on the following lines if you wish to use zero-installs
46+
# In that case, don't forget to run `yarn config set enableGlobalCache false`!
47+
# Documentation here: https://yarnpkg.com/features/caching#zero-installs
48+
49+
#!.yarn/cache
50+
.pnp.*
51+
52+
# We use .node-version
53+
/.tool-versions

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"eslint.useFlatConfig": true,
4+
"files.insertFinalNewline": true,
5+
"liveServer.settings.file": "/index.html",
6+
"liveServer.settings.NoBrowser": true,
7+
"liveServer.settings.root": "/build"
8+
}

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ The Source Academy (<https://sourceacademy.org/>) is an immersive online experie
2222

2323
1. Install the version of Node.js as specified in the `.node-version` file
2424

25-
1. Install Python (known working versions: `2.7`, `3.8`, `3.9`, `3.10`) – **Note: Python `3.11` does not work**
26-
2725
1. Clone this repository and navigate to it using your command line
2826

27+
1. Install the version of `yarn` as specified in `package.json`, `packageManager`.
28+
29+
> We recommend using `corepack` to manage the version of `yarn`, you may simply run `corepack enable` to complete this step.
30+
2931
1. Run `yarn install` to install dependencies.
3032

3133
- If you are on Ubuntu and encounter the error message: `No such file or directory: 'install'`, you might be running the incorrect "yarn" from the cmdtest testing suite instead of the JavaScript package manager of the same name. Refer to this [StackOverflow post](https://stackoverflow.com/questions/46013544/yarn-install-command-error-no-such-file-or-directory-install).

craco.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ const cracoConfig = {
139139
'split-on-first',
140140
'filter-obj',
141141
'@sourceacademy/c-slang',
142-
'java-parser'
142+
'java-parser',
143+
'conductor'
143144
),
144145
'^.+\\.module\\.(css|sass|scss)$'
145146
];

eslint.config.js renamed to eslint.config.mjs

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

3-
// Todo: Use ES module
4-
const eslint = require('@eslint/js');
5-
const tseslint = require('typescript-eslint');
6-
const reactRefresh = require('eslint-plugin-react-refresh');
3+
// import eslint from '@eslint/js';
4+
import { config, configs } from 'typescript-eslint';
5+
import reactPlugin from 'eslint-plugin-react';
6+
import reactHooksPlugin from 'eslint-plugin-react-hooks';
7+
import simpleImportSort from 'eslint-plugin-simple-import-sort'
8+
// import reactRefresh from 'eslint-plugin-react-refresh';
79

8-
const FlatCompat = require('@eslint/eslintrc').FlatCompat;
9-
const compat = new FlatCompat({
10-
baseDirectory: `${__dirname}`
11-
});
12-
13-
module.exports = tseslint.config(
14-
{ ignores: ['eslint.config.js'] },
10+
export default config(
11+
{ ignores: ['eslint.config.mjs'] },
1512
// eslint.configs.recommended,
16-
...tseslint.configs.recommended,
13+
...configs.recommended,
1714
// TODO: Enable when ready
1815
// {
1916
// plugins: {
@@ -23,14 +20,15 @@ module.exports = tseslint.config(
2320
// 'react-refresh/only-export-components': 'warn'
2421
// }
2522
// },
26-
...compat.config({
27-
extends: [
28-
'plugin:react-hooks/recommended'
29-
// "plugin:react/recommended",
30-
// "plugin:react/jsx-runtime"
31-
],
32-
plugins: ['simple-import-sort'],
23+
{
24+
files: ['**/*.ts*'],
25+
plugins: {
26+
'react-hooks': reactHooksPlugin,
27+
'react': reactPlugin,
28+
'simple-import-sort': simpleImportSort
29+
},
3330
rules: {
31+
...reactHooksPlugin.configs['recommended-latest'].rules,
3432
'no-restricted-imports': [
3533
'error',
3634
{
@@ -73,5 +71,5 @@ module.exports = tseslint.config(
7371
],
7472
'simple-import-sort/imports': 'error'
7573
}
76-
})
74+
}
7775
);

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"private": true,
33
"name": "frontend",
4+
"packageManager": "[email protected]",
45
"version": "1.4.3",
56
"scripts-info": {
67
"analyze": "Analyze bundle size breakdown",
@@ -47,24 +48,26 @@
4748
"array-move": "^4.0.0",
4849
"browserfs": "^1.4.3",
4950
"classnames": "^2.3.2",
51+
"conductor": "https://github.com/source-academy/conductor.git#0.2.1",
5052
"dayjs": "^1.11.13",
51-
"dompurify": "^3.1.6",
53+
"dompurify": "^3.2.4",
5254
"flexboxgrid": "^6.3.1",
5355
"flexboxgrid-helpers": "^1.1.3",
5456
"hastscript": "^9.0.0",
5557
"i18next": "^23.11.2",
5658
"i18next-browser-languagedetector": "^8.0.0",
5759
"java-slang": "^1.0.13",
5860
"js-cookie": "^3.0.5",
59-
"js-slang": "^1.0.76",
61+
"js-slang": "^1.0.81",
6062
"js-yaml": "^4.1.0",
6163
"konva": "^9.2.0",
64+
"language-directory": "https://github.com/source-academy/language-directory.git",
6265
"lodash": "^4.17.21",
6366
"lz-string": "^1.4.4",
6467
"mdast-util-from-markdown": "^2.0.0",
6568
"mdast-util-to-hast": "^13.0.0",
6669
"normalize.css": "^8.0.1",
67-
"phaser": "^3.55.2",
70+
"phaser": "~3.87.0",
6871
"query-string": "^9.0.0",
6972
"re-resizable": "^6.9.9",
7073
"react": "^18.3.1",
@@ -138,15 +141,16 @@
138141
"cross-env": "^7.0.3",
139142
"eslint": "^9.9.0",
140143
"eslint-plugin-react": "^7.35.0",
141-
"//": "See: https://github.com/facebook/react/issues/28313#issuecomment-2076798972, https://github.com/t3-oss/create-t3-turbo/issues/984#issuecomment-2076413457",
142-
"eslint-plugin-react-hooks": "5.1.0-canary-cb151849e1-20240424",
144+
"eslint-plugin-react-hooks": "^5.2.0",
143145
"eslint-plugin-react-refresh": "^0.4.9",
144146
"eslint-plugin-simple-import-sort": "^12.1.1",
145147
"https-browserify": "^1.0.0",
146148
"husky": "^9.0.0",
147149
"npm-run-all2": "^7.0.0",
148150
"os-browserify": "^0.3.0",
151+
"path": "^0.12.7",
149152
"path-browserify": "^1.0.1",
153+
"phaser3spectorjs": "^0.0.8",
150154
"prettier": "^3.3.3",
151155
"process": "^0.11.10",
152156
"react-error-overlay": "^6.0.11",
@@ -163,9 +167,6 @@
163167
"url": "^0.11.1",
164168
"webpack-bundle-analyzer": "^4.9.0"
165169
},
166-
"resolutions": {
167-
"**/gl": "^8.0.2"
168-
},
169170
"browserslist": {
170171
"production": [
171172
"Firefox ESR",

0 commit comments

Comments
 (0)