Skip to content

Commit c2e24d3

Browse files
authored
Merge changes from master onto Sound_Improvements (#543)
* Updated dependencies. Added CORS/windows scripts. (#488) * Updated dependencies from primordial edition to dinosaur edition. -Also added convenience scripts for CORS preflight and windows. * Removed yarn.lock, README.md: Removed references to yarn. * clean up all references to yarn * add tslint to scripts * remove npm cache from travis * update all deps * CRITICAL FIX (rollback bumping deps) (#522) * critical fix (rollback bumping deps) * Update travis to build cadet-frontend * Add template reset feature (#526) * Added Template Reset Feature * Revert "Added Template Reset Feature" This reverts commit 3c1457e. * Revert "Revert "Added Template Reset Feature"" This reverts commit d59f4c9. * Resolved merge conflicts * Fix package.json (#528) * Updated package.json * Reverted edit to start-js script * Changed from & to && * Collaborative Editing Feature (#530) * Add collaborative-editing feature using sharedb-ace * Allow multiple sessions by implementing session id * Add auto-completion, and change info annotation to error * Add notifications for autorun and websocket connection * Allow detection on invalid session id * Update snapshot and pass test * Add working connection checks and remove autocompletion * Add leave button and color indicator, remove status button * Change server url from ip address to domain name * Get client to ping server instead of the other way round * Sync editorValue after inviting * Remove console-log, reset ts-config * Reset css back to original * Stored api URL in constant, changed invite icon * Fixed bug with invite not working * Mission editing master (#519) * update js-slang imports, and use null for empty list * pass tests * pass tests * format all external libraries with prettier * Update README.md * missionOverviews missionOverviews can now be added * minorOverviewChanges * minorOverviewChanges1 * AddedAssignmentSupport * minorOverviewChanges2 * placed xmlpharser in alt file * update js-slang to version 0.2.0 * update acorn, fix order of imports * update readme * created editing folder copy of assessment, may be merged later * added interface * library parsing * Local storage Missions are now loaded in local storage * packages fixed * export library * Added Template Reset Feature * Added UI to edit assessmentsOverview * Moved edititngOverviewCard logic new file edititngOverviewCard * export added * minor debugging * fixed xmlParser * added autofocus * sync stuff * Added EditAssessment component * Bug fixes * More bug fixes * move importfilecomponents * localretrive functions added * Added EditingAssessmentForm to edit missions * Bug fixes and added MakeMission button * Use alpha version of js-slang, with verbose messages and native enabled * Update js-slang to alpha-3 * Bug fixes * Added toggle editing mode * Edited style * Bug fixes * overhaulStuff * click to edit added mcq not working * mcq question tabs added * added incubator * code refactoring editing content tab * cleanup unused code * minor clean * code refactoring assessment templates * Added manageQuestion tab * enzyme update * add example xml * library selection added * code clean moved new stuff to incubator folder setup new tests * removed editing from assessment * Update NavigationBar.tsx.snap * Prettify * Update index.tsx * yarn format * bug fixes * yarn format * Mission editing slang (#479) * bug fixes * yarn format * moved editing side content tabs * Update EditingWorkspace.tsx * seperated question template tab * update question template tab * tab clean up * added ManageQuestionTab * complete split up of editingContentsTab * yarn format * Update QuestionTemplateTab.tsx * signal unsavedChanges * GlobalDeployment Added * yarn format * Update GlobalDeploymentTab.tsx nicer symbol editing * nicer buttons * Mission editing slang (#483) * Update GlobalDeploymentTab.tsx nicer symbol editing * nicer buttons * made local deployment and added globals editing * yarn format * Merge branch 'pr/486' into mission-editing * minor bug fix * Mission editing update (#486) * Update GlobalDeploymentTab.tsx nicer symbol editing * nicer buttons * made local deployment and added globals editing * yarn format * minor bug fix * Auto update overview maxGrade/Xp * xp bug fix * Update NavigationBar.tsx.snap * Update EditingWorkspace.tsx * Reset button added * fixed bugs globals fixed previous button fixed new template fixed added manual library refresh fixed graderdeployment * yarn format * Mission editing slang (#489) * Added Template Reset Feature * Update GlobalDeploymentTab.tsx nicer symbol editing * nicer buttons * made local deployment and added globals editing * yarn format * minor bug fix * Auto update overview maxGrade/Xp * xp bug fix * Update NavigationBar.tsx.snap * Update EditingWorkspace.tsx * Reset button added * fixed bugs globals fixed previous button fixed new template fixed added manual library refresh fixed graderdeployment * yarn format * placeholder for overview card * Mission editing slang (#496) * Added Template Reset Feature * Update GlobalDeploymentTab.tsx nicer symbol editing * nicer buttons * made local deployment and added globals editing * yarn format * minor bug fix * Auto update overview maxGrade/Xp * xp bug fix * Update NavigationBar.tsx.snap * Update EditingWorkspace.tsx * Reset button added * fixed bugs globals fixed previous button fixed new template fixed added manual library refresh fixed graderdeployment * yarn format * placeholder for overview card * better placeholders * Merge pull request #12 from source-academy/mission-editing (#498) * fix import for firefox (#499) * Mission editing slang (#500) * fix import for firefox * increase abstraction removed numberRange from textArea Reduced save frequency of solutionTemplate * an update (#501) * Removed previous button on first question, added divider * Yarn format * Changeded help description * fix import for firefox * max width for globals * symbols aligned * increase abstraction removed numberRange from textArea Reduced save frequency of solutionTemplate * manage questions give warning * UI change for deployment tab * Mission editing slang (#502) * Removed previous button on first question, added divider * Yarn format * Changeded help description * fix import for firefox * max width for globals * symbols aligned * increase abstraction removed numberRange from textArea Reduced save frequency of solutionTemplate * manage questions give warning * UI change for deployment tab * fixed maxGrade and maxXP calculation * added local/global switch * adjust mcq options * split question template tab added suggested answer editing * swap answer and solutionTemplate internal change * add reading * add grading deployment * Mission editing slang (#503) * Removed previous button on first question, added divider * Yarn format * Changeded help description * fix import for firefox * max width for globals * symbols aligned * increase abstraction removed numberRange from textArea Reduced save frequency of solutionTemplate * manage questions give warning * UI change for deployment tab * fixed maxGrade and maxXP calculation * added local/global switch * adjust mcq options * split question template tab added suggested answer editing * swap answer and solutionTemplate internal change * add reading * add grading deployment * clone question shift question added * fixed symbol formating * Mission editing slang (#505) * Removed previous button on first question, added divider * Yarn format * Changeded help description * fix import for firefox * max width for globals * symbols aligned * increase abstraction removed numberRange from textArea Reduced save frequency of solutionTemplate * manage questions give warning * UI change for deployment tab * fixed maxGrade and maxXP calculation * added local/global switch * adjust mcq options * split question template tab added suggested answer editing * swap answer and solutionTemplate internal change * add reading * add grading deployment * clone question shift question added * fixed symbol formating * changed manage questions ui * yarn format * added more overview options * add editing persist * Update ManageQuestionTab.tsx * Mission editing slang (#512) * Removed previous button on first question, added divider * Yarn format * Changeded help description * fix import for firefox * max width for globals * symbols aligned * increase abstraction removed numberRange from textArea Reduced save frequency of solutionTemplate * manage questions give warning * UI change for deployment tab * fixed maxGrade and maxXP calculation * added local/global switch * adjust mcq options * split question template tab added suggested answer editing * swap answer and solutionTemplate internal change * add reading * add grading deployment * clone question shift question added * fixed symbol formating * changed manage questions ui * yarn format * added more overview options * add editing persist * Update ManageQuestionTab.tsx * small updates editor value now saved * temp remove editor functionalites * yarn format * Mission editing slang (#517) * Removed previous button on first question, added divider * Yarn format * Changeded help description * fix import for firefox * max width for globals * symbols aligned * increase abstraction removed numberRange from textArea Reduced save frequency of solutionTemplate * manage questions give warning * UI change for deployment tab * fixed maxGrade and maxXP calculation * added local/global switch * adjust mcq options * split question template tab added suggested answer editing * swap answer and solutionTemplate internal change * add reading * add grading deployment * clone question shift question added * fixed symbol formating * changed manage questions ui * yarn format * added more overview options * add editing persist * Update ManageQuestionTab.tsx * small updates editor value now saved * temp remove editor functionalites * yarn format * remove edit persist * Update context.ts * super refactoring * screenshot update * more refactor * Merge master into mission-editing * Update README.md * remove Carriage Return * Update test.sh * fix merge compatibility Compatibility with collab editing fixed. Local storage methods are now mostly abstracted to xml parse helper. * Use onChange instead of ref for forms (#535) * INSPECT (#506) * update js-slang imports, and use null for empty list * pass tests * pass tests * format all external libraries with prettier * Update README.md * update js-slang to version 0.2.0 * update acorn, fix order of imports * update readme * unbump enzyme * just adding compatability with js slang debugger * overlooked something minor * pulled in upgrades from wkk * added primitive inspector features * enabled the execution of commands in the REPL * polished inspector output table now filters builtins, and formats into individual frames * changed icons according to feedback * added alert animation for sidecontent icons * fixed some small issue with alerted icons not turning off * added multiple features: 1. Breakpoints can now be set from the gutter. 2. When the debugger hits a breakpoint, the last statement to be executed will be highlighted. This will require the modified js-slang from the debugger branch to work. * minor fix to pass test * changed highlighting to match new slang also fixed minor compile blocker that was somehow overlooked * Basic ENV visualizer integration * Removed working "console.log" * added minor cosmetic tweaks * changed which line was highlighted to suit new model * filtered some noise from the inspector also updated to work with newest slang * updated readme * moving env visualizer to its own branch also changed draw_list to draw_data * Fixed repl error with executing while paused, enabled pausing arbitrarily in any program. also removed useless files from git mergetool * prevent inspector dying from undefined context * fix highlighting issue * use official js-slang * fixed spurious output in inspector for things like lists * fix prettier * Env visualiser (#541) * Env visualiser * fixed formatting
1 parent 94d7fa7 commit c2e24d3

File tree

84 files changed

+16821
-14748
lines changed

Some content is hidden

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

84 files changed

+16821
-14748
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,3 @@ terraform*
2222
.env.production.local
2323

2424
npm-debug.log*
25-
yarn-debug.log*
26-
yarn-error.log*

.travis.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
language: node_js
22
node_js:
33
- 9
4-
cache: yarn
54
branches:
65
except:
76
- /^no-ci.*$/
87
script:
9-
- yarn format:ci
10-
- yarn build-css
11-
- yarn tslint -p .
12-
- yarn test-coveralls
8+
- npm run format:ci
9+
- npm run build
10+
- npm run tslint
11+
- npm run test-coveralls

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,21 @@
55

66
## Development Setup
77

8-
1. Install a stable version of Yarn and NodeJS (use node version 4-9 with nvm).
9-
2. Run `yarn` to install dependencies.
8+
1. Install a stable version of NodeJS (tested: Node 10.15.0).
9+
2. Run `npm install` to install dependencies.
1010
3. Copy the `.env.example` file as `.env` and set the variable `REACT_APP_IVLE_KEY`
1111
to contain your IVLE Lapi key.
12-
4. Run `yarn start` to start the server at `localhost:80`. Admin permissions may
12+
4. Run `npm start` to start the server at `localhost:80`. Admin permissions may
1313
be required for your OS to serve at port 80.
14+
5. If running cadet without ngix, `npm run cors-proxy` to solve CORS problems.
1415

1516
## IVLE LAPI Key
1617
For NUS students, you can access your IVLE LAPI key [here](https://ivle.nus.edu.sg/LAPI/default.aspx).
1718

1819
## For Windows Users
1920

2021
### Running cadet-frontend
21-
In package.json, change line 19:\
22-
"start-js": "rm -r coverage; BROWSER=none PORT=80 react-scripts-ts start",\
23-
to:\
24-
"start-js": "set PORT=80 & react-scripts-ts start",\
22+
Run `npm run win-start`
2523

2624
### Dealing with hooks
2725
In package.json, change line 28:\
@@ -43,18 +41,35 @@ to toggle native (default is native enabled).
4341
### To run local copy of js-slang
4442

4543
1. Follow the instructions on the js-slang repository to transpile your own copy
46-
2. Edit line 41 of package.json in this project to link to the directory of your js-slang and then run `yarn`:
44+
2. Edit line 41 of package.json in this project to link to the directory of your js-slang and then run `npm install`:
4745

4846
`"js-slang": "file:path/to/js-slang",`
4947

5048
Note that this copies your files over, any future changes will not be reflected.
5149

5250
You may try [this](https://medium.com/@alexishevia/the-magic-behind-npm-link-d94dcb3a81af) for a smoother experience.
5351

52+
## Inspector
53+
This requires the use of the `debugger` branch of js-slang to work. Clone both the frontend and the `debugger` slang to the same directory. You would want to `yarn build` the slang you just obtained and then `yarn && sudo yarn start` in the frontend and it should just work. The merge over there is still ongoing. Meanwhile, please try to break this.
54+
55+
The mental model we are using is: A breakpoint means that the interpreter will stop right before it. Whatever is highlighted is going to be evaluated next. If you meet any inconsistencies with this, also please raise it up for discussion.
56+
57+
### What you can do
58+
- Set breakpoints by clicking on the gutter
59+
- `debugger;` just like ECMAScript
60+
- Inspect!
61+
- Run stuff in the context of the paused program!
62+
63+
### Usage
64+
Here's what happens: After you click run, if there the interpreter meets a breakpoint, the first thing you're going to notice is that the REPL feedbacks to you it hit a breakpoint, the line is highlighted, and one of the icons on the right pane is going to start blinking. If you click on the icon, it reveals the inspector. All the variables in every frame is exposed here. The REPL is also now in the context of where ever you are. So you can evaluate anything you would normally be able to in the REPL. It is all quite simple really.
65+
66+
### Note
67+
Because we use a local version of `js-slang`, the CI just breaks all the time.
68+
5469
## For Editing And Creating New Local XML Missions
5570

5671
1. Use the branch 'mission-editing' in cadet-frontend
57-
2. Run in browser with yarn start
72+
2. Run in browser with npm start
5873
2. Go to Incubator tab.
5974

6075
## Application Structure

README.md.orig

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Cadet Frontend
2+
3+
[![Build Status](https://travis-ci.org/source-academy/cadet-frontend.svg?branch=master)](https://travis-ci.org/source-academy/cadet-frontend)
4+
[![Coverage Status](https://coveralls.io/repos/github/source-academy/cadet-frontend/badge.svg?branch=travis)](https://coveralls.io/github/source-academy/cadet-frontend?branch=travis)
5+
6+
## Development Setup
7+
8+
1. Install a stable version of NodeJS (tested: Node 10.15.0).
9+
2. Run `npm install` to install dependencies.
10+
3. Copy the `.env.example` file as `.env` and set the variable `REACT_APP_IVLE_KEY`
11+
to contain your IVLE Lapi key.
12+
4. Run `npm start` to start the server at `localhost:80`. Admin permissions may
13+
be required for your OS to serve at port 80.
14+
5. If running cadet without ngix, `npm run cors-proxy` to solve CORS problems.
15+
16+
## IVLE LAPI Key
17+
For NUS students, you can access your IVLE LAPI key [here](https://ivle.nus.edu.sg/LAPI/default.aspx).
18+
19+
## For Windows Users
20+
21+
### Running cadet-frontend
22+
Run `npm run win-start`
23+
24+
### Dealing with hooks
25+
In package.json, change line 28:\
26+
"pre-push": "bash scripts/test.sh",\
27+
to an empty line.
28+
29+
Please note that doing this will disable the test suite, so you will need to run the tests manually instead. Using Git Bash (or any other UNIX-based command line), run the following:\
30+
cd scripts\
31+
bash test.sh
32+
33+
## js-slang
34+
35+
Currently using a version of js-slang with native and verbose errors.
36+
37+
Edit https://github.com/source-academy/cadet-frontend/blob/57ba44f6b55c214d0f20339cd45bece57f24f48c/src/sagas/index.ts#L260
38+
39+
to toggle native (default is native enabled).
40+
41+
### To run local copy of js-slang
42+
43+
1. Follow the instructions on the js-slang repository to transpile your own copy
44+
2. Edit line 41 of package.json in this project to link to the directory of your js-slang and then run `npm install`:
45+
46+
`"js-slang": "file:path/to/js-slang",`
47+
48+
Note that this copies your files over, any future changes will not be reflected.
49+
50+
You may try [this](https://medium.com/@alexishevia/the-magic-behind-npm-link-d94dcb3a81af) for a smoother experience.
51+
52+
<<<<<<< HEAD
53+
## Inspector
54+
This requires the use of the `debugger` branch of js-slang to work. Clone both the frontend and the `debugger` slang to the same directory. You would want to `yarn build` the slang you just obtained and then `yarn && sudo yarn start` in the frontend and it should just work. The merge over there is still ongoing. Meanwhile, please try to break this.
55+
56+
The mental model we are using is: A breakpoint means that the interpreter will stop right before it. Whatever is highlighted is going to be evaluated next. If you meet any inconsistencies with this, also please raise it up for discussion.
57+
58+
### What you can do
59+
- Set breakpoints by clicking on the gutter
60+
- `debugger;` just like ECMAScript
61+
- Inspect!
62+
- Run stuff in the context of the paused program!
63+
64+
### Usage
65+
Here's what happens: After you click run, if there the interpreter meets a breakpoint, the first thing you're going to notice is that the REPL feedbacks to you it hit a breakpoint, the line is highlighted, and one of the icons on the right pane is going to start blinking. If you click on the icon, it reveals the inspector. All the variables in every frame is exposed here. The REPL is also now in the context of where ever you are. So you can evaluate anything you would normally be able to in the REPL. It is all quite simple really.
66+
67+
### Note
68+
Because we use a local version of `js-slang`, the CI just breaks all the time.
69+
70+
## For Editing And Creating New Local XML Missions
71+
72+
1. Use the branch 'mission-editing' in cadet-frontend
73+
2. Run in browser with npm start
74+
2. Go to Incubator tab.
75+
76+
=======
77+
>>>>>>> master
78+
## Application Structure
79+
80+
1. `actions` contains action creators, one file per reducer, combined in index.
81+
2. `assets` contains static assets.
82+
3. `components` contains all react components.
83+
4. `containers` contains HOC that inject react components with Redux state.
84+
5. `mocks` contains mock data structures for testing
85+
6. `reducers` contains all Redux reducers and their state, combined in index.
86+
7. `sagas` contains all Redux sagas, combined in index.
87+
8. `slang` contains the source interpreter.
88+
9. `styles` contains all SCSS styles.
89+
10. `utils` contains utility modules.
90+
91+
## TypeScript Coding Conventions
92+
93+
We reference [this guide](https://github.com/piotrwitek/react-redux-typescript-guide).

0 commit comments

Comments
 (0)