Skip to content

Commit 4a0234a

Browse files
blackeningmartin-henz
authored andcommitted
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
1 parent 6e18634 commit 4a0234a

File tree

28 files changed

+6022
-15750
lines changed

28 files changed

+6022
-15750
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-css
10+
- npm run tslint
11+
- npm run test-coveralls

README.md

Lines changed: 7 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,7 +41,7 @@ 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

@@ -54,7 +52,7 @@ You may try [this](https://medium.com/@alexishevia/the-magic-behind-npm-link-d94
5452
## For Editing And Creating New Local XML Missions
5553

5654
1. Use the branch 'mission-editing' in cadet-frontend
57-
2. Run in browser with yarn start
55+
2. Run in browser with npm start
5856
2. Go to Incubator tab.
5957

6058
## Application Structure

package-lock.json

Lines changed: 5853 additions & 5284 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@
1515
"build-js": "react-scripts-ts build",
1616
"coverage": "./scripts/coverage-fix.sh do && react-scripts-ts test --env=jsdom --coverage && ./scripts/coverage-fix.sh undo",
1717
"format": "prettier --write 'src/**/*.{ts,tsx}' 'externalLibs/**/*.js' '!externalLibs/assert_compiled.js'; prettier --write --parser scss 'src/**/*.scss'",
18-
"format:ci": "prettier --list-different 'src/**/*.{ts,tsx}' && prettier --list-different --parser scss 'src/**/*.scss'",
18+
"format:tsx": "prettier --list-different 'src/**/*.{ts,tsx}'",
19+
"format:scss": "prettier --list-different --parser scss 'src/**/*.scss'",
20+
"format:ci": "npm run format:tsx && npm run format:scss",
1921
"start-js": "rm -r coverage; BROWSER=none PORT=80 react-scripts-ts start",
22+
"win-start-js": "set PORT=80 & react-scripts-ts start",
2023
"start": "npm-run-all -p watch-css start-js",
24+
"win-start": "npm-run-all -p watch-css win-start-js",
2125
"test": "react-scripts-ts test --env=jsdom",
2226
"test-coveralls": "./scripts/coverage-fix.sh do && react-scripts-ts test --env=jsdom --coverage --coverageReporters=text-lcov | coveralls",
2327
"update-ui-snapshots": "jest --updateSnapshot",
24-
"watch-css": "node-sass-chokidar src/ -o src/ --watch --recursive"
28+
"watch-css": "node-sass-chokidar src/ -o src/ --watch --recursive",
29+
"tslint": "tslint -p .",
30+
"cors-proxy": "lcp --proxyUrl http://localhost:4000 --port 4001 --proxyPartial \"\""
2531
},
2632
"husky": {
2733
"hooks": {
@@ -32,79 +38,80 @@
3238
"acorn": "6.1.0",
3339
"ag-grid": "^18.0.1",
3440
"ag-grid-react": "^18.0.0",
35-
"astring": "^1.3.0",
41+
"astring": "^1.4.0",
3642
"common-tags": "^1.7.2",
3743
"draft-js": "^0.10.5",
3844
"flexboxgrid": "^6.3.1",
3945
"flexboxgrid-helpers": "^1.1.3",
4046
"js-slang": "0.2.1-alpha.4",
4147
"lodash": "^4.17.11",
4248
"lz-string": "^1.4.4",
43-
"moment": "^2.22.2",
49+
"moment": "^2.24.0",
4450
"node-sass-chokidar": "^1.3.4",
45-
"normalize.css": "^8.0.0",
51+
"normalize.css": "^8.0.1",
4652
"npm-run-all": "^4.1.5",
47-
"pixi-filters": "^2.6.1",
48-
"pixi.js": "^4.8.0",
49-
"query-string": "^6.1.0",
50-
"re-resizable": "^4.4.8",
51-
"react": "^16.6.0",
53+
"pixi-filters": "^2.7.1",
54+
"pixi.js": "^4.8.7",
55+
"query-string": "^6.4.2",
56+
"re-resizable": "^4.11.0",
57+
"react": "^16.8.6",
5258
"react-ace": "^6.4.0",
5359
"react-copy-to-clipboard": "^5.0.1",
54-
"react-dom": "^16.3.1",
60+
"react-dom": "^16.8.6",
5561
"react-dom-factories": "^1.0.2",
5662
"react-hotkeys": "^1.1.4",
5763
"react-mde": "^5.6.0",
58-
"react-redux": "^5.1.0",
64+
"react-redux": "^5.1.1",
5965
"react-router": "^4.2.0",
6066
"react-router-dom": "^4.2.2",
6167
"react-router-redux": "^5.0.0-alpha.9",
62-
"react-transition-group": "^2.3.1",
68+
"react-transition-group": "^2.9.0",
6369
"redux": "^3.7.2",
6470
"redux-mock-store": "^1.5.1",
6571
"redux-saga": "^0.15.6",
6672
"showdown": "^1.9.0",
67-
"typesafe-actions": "^3.2.1",
68-
"utility-types": "^2.0.0"
73+
"typesafe-actions": "^3.4.0",
74+
"utility-types": "^2.1.0"
6975
},
7076
"devDependencies": {
7177
"@blueprintjs/core": "^2.1.1",
72-
"@blueprintjs/icons": "^3.6.0",
78+
"@blueprintjs/icons": "^3.8.0",
7379
"@blueprintjs/select": "^2.0.1",
74-
"@types/acorn": "^4.0.3",
75-
"@types/classnames": "^2.2.3",
76-
"@types/common-tags": "^1.4.0",
80+
"@types/acorn": "^4.0.5",
81+
"@types/classnames": "^2.2.7",
82+
"@types/common-tags": "^1.8.0",
7783
"@types/dotenv": "^6.1.1",
78-
"@types/draft-js": "^0.10.23",
84+
"@types/draft-js": "^0.10.30",
7985
"@types/enzyme": "3.1.17",
80-
"@types/enzyme-adapter-react-16": "^1.0.2",
86+
"@types/enzyme-adapter-react-16": "^1.0.5",
8187
"@types/estree": "^0.0.39",
8288
"@types/invariant": "^2.2.29",
8389
"@types/jest": "^22.2.3",
8490
"@types/lodash": "^4.14.123",
85-
"@types/lz-string": "^1.3.32",
86-
"@types/node": "^11.13.0",
87-
"@types/pixi.js": "^4.7.3",
91+
"@types/lz-string": "^1.3.33",
92+
"@types/node": "^11.13.2",
93+
"@types/pixi.js": "^4.8.7",
8894
"@types/query-string": "^5.1.0",
89-
"@types/react": "^16.3.10",
95+
"@types/react": "^16.8.13",
9096
"@types/react-copy-to-clipboard": "^4.2.5",
91-
"@types/react-dom": "^16.0.5",
97+
"@types/react-dom": "^16.8.3",
9298
"@types/react-redux": "^5.0.16",
93-
"@types/react-router": "^4.0.24",
94-
"@types/react-router-dom": "^4.2.6",
95-
"@types/react-router-redux": "^5.0.13",
96-
"@types/react-test-renderer": "^16.0.1",
99+
"@types/react-router": "^4.4.5",
100+
"@types/react-router-dom": "^4.3.1",
101+
"@types/react-router-redux": "^5.0.18",
102+
"@types/react-test-renderer": "^16.8.1",
97103
"@types/redux-mock-store": "^0.0.13",
98-
"@types/showdown": "^1.7.5",
104+
"@types/showdown": "^1.9.2",
99105
"babel-core": "6",
100106
"babel-runtime": "^6.23.0",
101-
"coveralls": "^3.0.1",
102-
"enzyme": "^3.3.0",
103-
"enzyme-adapter-react-16": "^1.1.1",
107+
"coveralls": "^3.0.3",
108+
"enzyme": "^3.9.0",
109+
"enzyme-adapter-react-16": "^1.12.1",
104110
"husky": "^1.3.1",
105-
"prettier": "^1.12.0",
106-
"react-scripts-ts": "^2.16.0",
107-
"react-test-renderer": "^16.3.1",
108-
"typescript": "^2.8.1"
111+
"local-cors-proxy": "^1.0.2",
112+
"prettier": "^1.16.4",
113+
"react-scripts-ts": "^2.17.0",
114+
"react-test-renderer": "^16.8.6",
115+
"typescript": "^2.9.2"
109116
}
110117
}

scripts/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ main() {
77
echo " If you cancel this pre-push hook, use \`git stash pop\` to retrieve your"
88
echo " unstaged changes."
99

10-
prettier_ts="yarn prettier --list-different src/**/*.{ts,tsx}"
11-
prettier_scss="yarn prettier --list-different --parser scss src/**/*.scss"
12-
jest_ts="yarn test"
10+
prettier_ts="npm run format:tsx"
11+
prettier_scss="npm run format:scss"
12+
jest_ts="npm test"
1313

1414
run_cmd "${prettier_ts}"; prettier_ts_exit=$?
1515
run_cmd "${prettier_scss}"; prettier_scss_exit=$?

src/components/__tests__/__snapshots__/Login.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ exports[`Login renders correctly 1`] = `
2424
<Blueprint2.Button className=\\"pt-large\\" rightIcon=\\"log-in\\" onClick={[Function: handleLogin]}>
2525
Log in with IVLE
2626
</Blueprint2.Button>
27-
<NavLink to=\\"/playground\\" activeClassName=\\"active\\" ariaCurrent=\\"true\\">
27+
<NavLink to=\\"/playground\\" activeClassName=\\"active\\" aria-current=\\"page\\">
2828
<Blueprint2.Button className=\\"pt-large\\" rightIcon=\\"code\\">
2929
Try out the playground
3030
</Blueprint2.Button>

src/components/__tests__/__snapshots__/NavigationBar.tsx.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,27 @@
33
exports[`NavigationBar renders "Not logged in" correctly 1`] = `
44
"<Blueprint2.Navbar className=\\"NavigationBar primary-navbar pt-dark\\">
55
<Blueprint2.NavbarGroup align=\\"left\\">
6-
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" to=\\"/academy\\" ariaCurrent=\\"true\\">
6+
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" to=\\"/academy\\" aria-current=\\"page\\">
77
<Blueprint2.Icon icon=\\"symbol-diamond\\" />
88
<Blueprint2.NavbarHeading className=\\"hidden-xs\\">
99
Source Academy
1010
</Blueprint2.NavbarHeading>
1111
</NavLink>
12-
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" target=\\"_blank\\" to=\\"https://ivle.nus.edu.sg/v1/Module/Student/default.aspx?CourseID=a6579f36-4d7d-41fb-b394-92a00b78148b\\" ariaCurrent=\\"true\\">
12+
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" target=\\"_blank\\" to=\\"https://ivle.nus.edu.sg/v1/Module/Student/default.aspx?CourseID=a6579f36-4d7d-41fb-b394-92a00b78148b\\" aria-current=\\"page\\">
1313
<Blueprint2.Icon icon=\\"book\\" />
1414
<div className=\\"navbar-button-text hidden-xs\\">
1515
News &amp; Material
1616
</div>
1717
</NavLink>
18-
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" target=\\"_blank\\" to=\\"https://piazza.com/nus.edu.sg/fall2018/cs1101s\\" ariaCurrent=\\"true\\">
18+
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" target=\\"_blank\\" to=\\"https://piazza.com/nus.edu.sg/fall2018/cs1101s\\" aria-current=\\"page\\">
1919
<Blueprint2.Icon icon=\\"chat\\" />
2020
<div className=\\"navbar-button-text hidden-xs\\">
2121
Forum
2222
</div>
2323
</NavLink>
2424
</Blueprint2.NavbarGroup>
2525
<Blueprint2.NavbarGroup align=\\"right\\">
26-
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" to=\\"/playground\\" ariaCurrent=\\"true\\">
26+
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" to=\\"/playground\\" aria-current=\\"page\\">
2727
<Blueprint2.Icon icon=\\"code\\" />
2828
<div className=\\"navbar-button-text hidden-xs\\">
2929
Playground
@@ -43,27 +43,27 @@ exports[`NavigationBar renders "Not logged in" correctly 1`] = `
4343
exports[`NavigationBar renders correctly with username 1`] = `
4444
"<Blueprint2.Navbar className=\\"NavigationBar primary-navbar pt-dark\\">
4545
<Blueprint2.NavbarGroup align=\\"left\\">
46-
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" to=\\"/academy\\" ariaCurrent=\\"true\\">
46+
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" to=\\"/academy\\" aria-current=\\"page\\">
4747
<Blueprint2.Icon icon=\\"symbol-diamond\\" />
4848
<Blueprint2.NavbarHeading className=\\"hidden-xs\\">
4949
Source Academy
5050
</Blueprint2.NavbarHeading>
5151
</NavLink>
52-
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" target=\\"_blank\\" to=\\"https://ivle.nus.edu.sg/v1/Module/Student/default.aspx?CourseID=a6579f36-4d7d-41fb-b394-92a00b78148b\\" ariaCurrent=\\"true\\">
52+
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" target=\\"_blank\\" to=\\"https://ivle.nus.edu.sg/v1/Module/Student/default.aspx?CourseID=a6579f36-4d7d-41fb-b394-92a00b78148b\\" aria-current=\\"page\\">
5353
<Blueprint2.Icon icon=\\"book\\" />
5454
<div className=\\"navbar-button-text hidden-xs\\">
5555
News &amp; Material
5656
</div>
5757
</NavLink>
58-
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" target=\\"_blank\\" to=\\"https://piazza.com/nus.edu.sg/fall2018/cs1101s\\" ariaCurrent=\\"true\\">
58+
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" target=\\"_blank\\" to=\\"https://piazza.com/nus.edu.sg/fall2018/cs1101s\\" aria-current=\\"page\\">
5959
<Blueprint2.Icon icon=\\"chat\\" />
6060
<div className=\\"navbar-button-text hidden-xs\\">
6161
Forum
6262
</div>
6363
</NavLink>
6464
</Blueprint2.NavbarGroup>
6565
<Blueprint2.NavbarGroup align=\\"right\\">
66-
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" to=\\"/playground\\" ariaCurrent=\\"true\\">
66+
<NavLink activeClassName=\\"pt-active\\" className=\\"NavigationBar__link pt-button pt-minimal\\" to=\\"/playground\\" aria-current=\\"page\\">
6767
<Blueprint2.Icon icon=\\"code\\" />
6868
<div className=\\"navbar-button-text hidden-xs\\">
6969
Playground

0 commit comments

Comments
 (0)