Skip to content

Commit c7611a5

Browse files
authored
Merge branch 'source-academy:master' into master
2 parents bf3770d + 31ec331 commit c7611a5

File tree

443 files changed

+8124
-14430
lines changed

Some content is hidden

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

443 files changed

+8124
-14430
lines changed

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ REACT_APP_DEPLOYMENT_NAME=Source Academy
33
REACT_APP_BACKEND_URL=http://localhost:4000
44
REACT_APP_USE_BACKEND=TRUE
55
REACT_APP_PLAYGROUND_ONLY=FALSE
6-
REACT_APP_ENABLE_GITHUB_ASSESSMENTS=TRUE
76
REACT_APP_SHOW_RESEARCH_PROMPT=FALSE
87

98
REACT_APP_URL_SHORTENER_SIGNATURE=

.eslintrc.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22
"extends": ["react-app", "plugin:@typescript-eslint/recommended"],
33
"plugins": ["simple-import-sort"],
44
"rules": {
5+
"no-restricted-imports": [
6+
"error",
7+
{
8+
"paths": [
9+
{
10+
"name": "react-redux",
11+
"importNames": [
12+
// TODO: Create typed hook for useDispatch
13+
// "useDispatch",
14+
"useSelector"
15+
],
16+
"message": "Use the typed hook \"useTypedSelector\" instead."
17+
}
18+
]
19+
}
20+
],
521
"@typescript-eslint/no-empty-function": "off",
622
"@typescript-eslint/interface-name-prefix": "off",
723
"@typescript-eslint/camelcase": "off",
@@ -11,7 +27,19 @@
1127
"@typescript-eslint/no-explicit-any": "off",
1228
"@typescript-eslint/explicit-module-boundary-types": "off",
1329
"@typescript-eslint/ban-ts-comment": "warn",
14-
"@typescript-eslint/ban-types": "off",
30+
"@typescript-eslint/ban-types": [
31+
"error",
32+
{
33+
// TODO: Change this to true someday
34+
"extendDefaults": false,
35+
"types": {
36+
"React.FunctionComponent": {
37+
"message": "Use React.FC instead",
38+
"fixWith": "React.FC"
39+
}
40+
}
41+
}
42+
],
1543
"simple-import-sort/imports": "error"
1644
}
1745
}

.github/workflows/build-development.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
REACT_APP_GOOGLE_API_KEY: ${{ secrets.REACT_APP_GOOGLE_API_KEY }}
3939
REACT_APP_GOOGLE_APP_ID: ${{ secrets.REACT_APP_GOOGLE_APP_ID }}
4040
REACT_APP_PLAYGROUND_ONLY: 'TRUE'
41-
REACT_APP_ENABLE_GITHUB_ASSESSMENTS: 'TRUE'
4241
REACT_APP_VERSION: ${{ format('{0}-{1}', github.sha, steps.get-time.outputs.time) }}
4342
REACT_APP_ENVIRONMENT: 'pages'
4443
REACT_APP_MODULE_BACKEND_URL: https://source-academy.github.io/modules

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ See [here](https://github.com/source-academy/frontend/wiki/Google-Drive-Persiste
9090

9191
1. `REACT_APP_DEPLOYMENT_NAME`: The name of the Source Academy deployment. This will be shown in the `/welcome` route. Defaults to 'Source Academy'.
9292
1. `REACT_APP_PLAYGROUND_ONLY`: Whether to build the "playground-only" version, which disables the Academy components, so only the Playground is available. This is what we deploy onto [GitHub Pages](https://source-academy.github.io).
93-
1. `REACT_APP_ENABLE_GITHUB_ASSESSMENTS`: Whether to enable the GitHub Assessments feature. Off by default.
9493
1. `REACT_APP_SHOW_RESEARCH_PROMPT`: Whether to show the educational research consent prompt to users. This is mainly for instructors using their own deployment of Source Academy @ NUS to disable this prompt.
9594

9695
## Projects

craco.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ const cracoConfig = (module.exports = {
146146
'<rootDir>/node_modules/vfile/lib';
147147
return jestConfig;
148148
}
149+
},
150+
babel: {
151+
presets: [
152+
['@babel/preset-typescript']
153+
]
149154
}
150155
});
151156

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@blueprintjs/popover2": "^2.0.0",
3333
"@blueprintjs/select": "^5.0.0",
3434
"@octokit/rest": "^20.0.0",
35+
"@reduxjs/toolkit": "^1.9.7",
3536
"@sentry/browser": "^7.57.0",
3637
"@sourceacademy/sharedb-ace": "^2.0.2",
3738
"@sourceacademy/sling-client": "^0.1.0",
@@ -48,7 +49,7 @@
4849
"flexboxgrid": "^6.3.1",
4950
"flexboxgrid-helpers": "^1.1.3",
5051
"hastscript": "^9.0.0",
51-
"js-slang": "^1.0.42",
52+
"js-slang": "^1.0.48",
5253
"js-yaml": "^4.1.0",
5354
"konva": "^9.2.0",
5455
"lodash": "^4.17.21",
@@ -58,7 +59,7 @@
5859
"moment": "^2.29.4",
5960
"normalize.css": "^8.0.1",
6061
"phaser": "^3.55.2",
61-
"query-string": "^8.0.0",
62+
"query-string": "^9.0.0",
6263
"re-resizable": "^6.9.9",
6364
"react": "^18.2.0",
6465
"react-ace": "^10.1.0",
@@ -74,7 +75,7 @@
7475
"react-papaparse": "^4.0.2",
7576
"react-qr-reader": "^3.0.0-beta-1",
7677
"react-redux": "^8.1.1",
77-
"react-responsive": "^9.0.0-beta.10",
78+
"react-responsive": "^10.0.0",
7879
"react-router-dom": "^6.14.1",
7980
"react-simple-keyboard": "^3.6.27",
8081
"react-sortable-hoc": "^2.0.0",

src/assets/PortSvg.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import React from 'react';
2+
13
type Props = {
24
port: string;
35
};
46

5-
const PortSvg = ({ port }: Props) => (
7+
const PortSvg: React.FC<Props> = ({ port }) => (
68
<svg
79
xmlns="http://www.w3.org/2000/svg"
810
id="port-svg6348"

src/assets/SA.jpg

28.4 KB
Loading

src/commons/ControlButton.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ type ButtonOptions = {
1111
type?: 'submit' | 'reset' | 'button';
1212
};
1313

14-
type ControlButtonProps = {
15-
label?: string;
16-
icon?: IconName;
17-
onClick?: () => void;
18-
options?: Partial<ButtonOptions>;
19-
isDisabled?: boolean;
20-
};
21-
2214
const defaultOptions = {
2315
className: '',
2416
fullWidth: false,
@@ -27,7 +19,15 @@ const defaultOptions = {
2719
minimal: true
2820
};
2921

30-
const ControlButton: React.FC<ControlButtonProps> = ({
22+
type Props = {
23+
label?: string;
24+
icon?: IconName;
25+
onClick?: () => void;
26+
options?: Partial<ButtonOptions>;
27+
isDisabled?: boolean;
28+
};
29+
30+
const ControlButton: React.FC<Props> = ({
3131
label = '',
3232
icon,
3333
onClick,

src/commons/Markdown.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Classes } from '@blueprintjs/core';
22
import classNames from 'classnames';
3-
import * as React from 'react';
3+
import React from 'react';
44
import { Converter } from 'showdown';
55

6-
type MarkdownProps = {
6+
type Props = {
77
className?: string;
88
content: string;
99
openLinksInNewWindow?: boolean;
@@ -12,7 +12,7 @@ type MarkdownProps = {
1212
tasklists?: boolean;
1313
};
1414

15-
const Markdown: React.FC<MarkdownProps> = props => {
15+
const Markdown: React.FC<Props> = props => {
1616
const converter = new Converter({
1717
tables: true,
1818
simplifiedAutoLink: props.simplifiedAutoLink,

0 commit comments

Comments
 (0)