|
5 | 5 |
|
6 | 6 | ## Development Setup |
7 | 7 |
|
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. |
10 | 10 | 3. Copy the `.env.example` file as `.env` and set the variable `REACT_APP_IVLE_KEY` |
11 | 11 | 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 |
13 | 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. |
14 | 15 |
|
15 | 16 | ## IVLE LAPI Key |
16 | 17 | For NUS students, you can access your IVLE LAPI key [here](https://ivle.nus.edu.sg/LAPI/default.aspx). |
17 | 18 |
|
18 | 19 | ## For Windows Users |
19 | | -In package.json, change line 19:\ |
20 | | -"start-js": "rm -r coverage; BROWSER=none PORT=80 react-scripts-ts start",\ |
21 | | -to:\ |
22 | | -"start-js": "set PORT=80 & react-scripts-ts start",\ |
23 | 20 |
|
24 | | -## For Testing of js-slang |
| 21 | +### Running cadet-frontend |
| 22 | +Run `npm run win-start` |
25 | 23 |
|
26 | | -### Alpha version |
| 24 | +### Dealing with hooks |
| 25 | +In package.json, change line 28:\ |
| 26 | +"pre-push": "bash scripts/test.sh",\ |
| 27 | +to an empty line. |
27 | 28 |
|
28 | | -Use branch js-slang-alpha-preview to see the new changes (native and verbose errors). |
| 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 |
29 | 32 |
|
30 | | -Have `"enable verbose";` as the first line of your program to activate verbose messages. |
| 33 | +## js-slang |
| 34 | + |
| 35 | +Currently using a version of js-slang with native and verbose errors. |
31 | 36 |
|
32 | 37 | Edit https://github.com/source-academy/cadet-frontend/blob/57ba44f6b55c214d0f20339cd45bece57f24f48c/src/sagas/index.ts#L260 |
33 | 38 |
|
34 | | -to toggle native. |
| 39 | +to toggle native (default is native enabled). |
35 | 40 |
|
36 | 41 | ### To run local copy of js-slang |
37 | 42 |
|
38 | 43 | 1. Follow the instructions on the js-slang repository to transpile your own copy |
39 | | -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`: |
40 | 45 |
|
41 | 46 | `"js-slang": "file:path/to/js-slang",` |
42 | 47 |
|
43 | 48 | Note that this copies your files over, any future changes will not be reflected. |
44 | 49 |
|
45 | 50 | You may try [this](https://medium.com/@alexishevia/the-magic-behind-npm-link-d94dcb3a81af) for a smoother experience. |
46 | 51 |
|
47 | | -## For Previewing Local XML Missions Only |
| 52 | +## For Editing And Creating New Local XML Missions |
48 | 53 |
|
49 | | -1. Use the branch 'mission-testing' in cadet-frontend |
50 | | -2. Run in browser with yarn start |
51 | | -2. Go to Missions page, and upload xml file to preview |
| 54 | +1. Use the branch 'mission-editing' in cadet-frontend |
| 55 | +2. Run in browser with npm start |
| 56 | +2. Go to Incubator tab. |
52 | 57 |
|
53 | 58 | ## Application Structure |
54 | 59 |
|
|
0 commit comments