Skip to content

Commit 0c6f820

Browse files
committed
update dependencies, move to react functional components and es modules for server
1 parent f8b5322 commit 0c6f820

Some content is hidden

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

60 files changed

+5577
-5600
lines changed

.eslintrc.js

-52
This file was deleted.

.eslintrc.json

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"extends": [
3+
"airbnb",
4+
"naat",
5+
"prettier"
6+
],
7+
"parserOptions": {
8+
"ecmaVersion": 2022,
9+
"sourceType": "module"
10+
},
11+
"rules": {
12+
// Enable additional rules
13+
"no-throw-literal": "warn",
14+
"semi": "error",
15+
// Disable rule incompatible with eslint-plugin-import rule import/order
16+
"sort-imports": "off",
17+
// Disables rules we choose not to apply
18+
// "import/prefer-default-export": "off",
19+
// "react/forbid-prop-types": "off",
20+
// "react/sort-comp": "off",
21+
"react/jsx-filename-extension": [
22+
"error",
23+
{
24+
"extensions": [
25+
".jsx"
26+
]
27+
}
28+
],
29+
// "no-underscore-dangle": "off",
30+
// Rewrite airbnb rule to allow ForOfStatement
31+
"no-restricted-syntax": [
32+
"error",
33+
"ForInStatement",
34+
"LabeledStatement",
35+
"WithStatement"
36+
],
37+
// disable import/extensions rule as node requires to specify the extension on es module imports
38+
"import/extensions": "off"
39+
},
40+
"overrides": [
41+
{
42+
"files": [
43+
"bin/**"
44+
],
45+
"rules": {
46+
"no-console": "off"
47+
}
48+
}
49+
],
50+
"globals": {
51+
"it": "readonly",
52+
"describe": "readonly"
53+
},
54+
"settings": {
55+
"import/resolver": {
56+
"node": {
57+
"extensions": [
58+
".js",
59+
".jsx"
60+
]
61+
}
62+
}
63+
},
64+
"env": {
65+
"browser": false,
66+
"node": true,
67+
"jest": true
68+
}
69+
}

babel.config.js

-20
This file was deleted.

babel.config.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"useBuiltIns": "entry",
7+
"corejs": "3.0.0"
8+
}
9+
],
10+
"@babel/preset-react"
11+
],
12+
"plugins": [
13+
"@babel/plugin-proposal-class-properties"
14+
],
15+
"env": {
16+
"development": {
17+
"compact": true
18+
}
19+
}
20+
}

jest-mongodb-config.cjs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
mongodbMemoryServerOptions: {
3+
instance: {
4+
port: 46347,
5+
ip: 'localhost'
6+
},
7+
binary: {
8+
version: '3.6.10',
9+
skipMD5: true,
10+
},
11+
autoStart: false,
12+
},
13+
};

package.json

+43-42
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "connect",
33
"version": "1.0.0",
4+
"type": "module",
45
"description": "An open platform to save anonymous data coming from any application using this API",
56
"scripts": {
67
"start": "node src/index.js",
7-
"te": "node app.js",
88
"dev": "cross-env NODE_ENV=development node src/index.js",
99
"build": "webpack --node-env production",
1010
"build.dev": "webpack --node-env development",
1111
"eslint.check": "eslint --ext js,jsx .",
1212
"eslint.fix": "eslint --ext js,jsx --fix .",
1313
"prettier.check": "prettier --list-different .",
1414
"prettier.fix": "prettier --write .",
15-
"test": "jest --config spec/jest.config.js -i --forceExit --detectOpenHandles",
15+
"test": "cross-env MONGO_MEMORY_SERVER_FILE=jest-mongodb-config.cjs yarn node --experimental-vm-modules $(yarn bin jest) --config spec/jest.config.js -i --forceExit --detectOpenHandles",
1616
"performance": "node bin/performance.js"
1717
},
1818
"eslintConfig": {
@@ -38,71 +38,72 @@
3838
"dependencies": {
3939
"@material-ui/core": "^4.2.1",
4040
"@material-ui/icons": "^4.2.1",
41-
"axios": "^0.21.1",
41+
"axios": "^1.3.4",
42+
"body-parser": "^1.20.2",
4243
"copy-webpack-plugin": "^11.0.0",
4344
"cors": "^2.8.5",
4445
"cross-env": "^7.0.3",
45-
"dotenv": "^8.0.0",
46+
"dotenv": "^16.0.3",
4647
"express": "^4.17.1",
47-
"glob": "^7.1.4",
48+
"glob-promise": "^6.0.3",
4849
"jsonschema": "^1.2.6",
4950
"lodash.flow": "^3.5.0",
5051
"moment": "^2.24.0",
51-
"mongoose": "^5.7.5",
52+
"mongoose": "^7.0.3",
5253
"nodemailer": "^6.9.1",
5354
"oauth2-server": "git+https://github.com/oauthjs/node-oauth2-server#4.x",
54-
"parse": "^3.5.1",
55+
"parse": "^4.0.1",
5556
"parse-dashboard": "^5.0.0",
56-
"parse-server": "^5.4.0",
57+
"parse-server": "^6.0.0",
5758
"parse-server-api-mail-adapter": "^2.2.0",
5859
"prop-types": "^15.7.2",
59-
"react": "^16.8.6",
60-
"react-dom": "^16.8.6",
61-
"react-moment": "^0.9.2",
62-
"react-router": "^5.0.1",
63-
"react-router-dom": "^5.0.1",
60+
"react": "^18.2.0",
61+
"react-dom": "^18.2.0",
62+
"react-moment": "^1.1.3",
63+
"react-router": "5.1",
64+
"react-router-dom": "5.1",
6465
"request": "^2.88.2",
6566
"request-promise": "^4.2.6",
66-
"swagger-ui-express": "^4.0.7",
67+
"swagger-ui-express": "^4.6.2",
6768
"uuid": "^9.0.0",
6869
"validate.js": "^0.13.1",
6970
"winston": "^3.2.1"
7071
},
7172
"devDependencies": {
72-
"@babel/core": "^7.5.0",
73+
"@babel/core": "^7.21.4",
7374
"@babel/plugin-proposal-class-properties": "^7.5.0",
7475
"@babel/polyfill": "^7.4.4",
75-
"@babel/preset-env": "^7.5.0",
76+
"@babel/preset-env": "^7.21.4",
7677
"@babel/preset-react": "^7.0.0",
77-
"@shelf/jest-mongodb": "^4.1.3",
78-
"babel-loader": "^8.0.6",
79-
"connect-history-api-fallback": "^1.6.0",
80-
"core-js": "^3.1.4",
81-
"css-loader": "^5.0.1",
82-
"eslint": "^7.10.0",
83-
"eslint-config-airbnb": "^18.2.0",
78+
"@shelf/jest-mongodb": "^4.1.7",
79+
"babel-loader": "^9.1.2",
80+
"connect-history-api-fallback": "^2.0.0",
81+
"core-js": "^3.30.0",
82+
"css-loader": "^6.7.3",
83+
"eslint": "^8.37.0",
84+
"eslint-config-airbnb": "^19.0.4",
8485
"eslint-config-naat": "git+https://github.com/neuroanatomy/eslint-config-naat",
85-
"eslint-config-prettier": "^8.3.0",
86-
"eslint-plugin-import": "^2.22.1",
87-
"eslint-plugin-jsx-a11y": "^6.3.1",
88-
"eslint-plugin-react": "^7.21.3",
86+
"eslint-config-prettier": "^8.8.0",
87+
"eslint-plugin-import": "^2.27.5",
88+
"eslint-plugin-jsx-a11y": "^6.7.1",
89+
"eslint-plugin-react": "^7.32.2",
8990
"eslint-plugin-react-hooks": "^4",
9091
"html-webpack-plugin": "^5",
91-
"husky": "^4.0.0",
92-
"jest": "^29.2.2",
93-
"json2csv": "^4.5.2",
94-
"lint-staged": ">=10",
95-
"mini-css-extract-plugin": "^1.3.3",
96-
"mongodb": "^3",
97-
"nock": "^13.0.5",
98-
"prettier": "^2",
99-
"qs": "^6.10.1",
100-
"sass": "^1.34.0",
101-
"sass-loader": "^10.1.0",
102-
"style-loader": "^0.23.1",
92+
"husky": "^8.0.3",
93+
"jest": "^29.5.0",
94+
"json2csv": "^6.0.0-alpha.2",
95+
"lint-staged": ">=13.2.0",
96+
"mini-css-extract-plugin": "^2.7.5",
97+
"mongodb": "^5.1.0",
98+
"nock": "^13.3.0",
99+
"prettier": "^2.8.7",
100+
"qs": "^6.11.1",
101+
"sass": "^1.60.0",
102+
"sass-loader": "^13.2.2",
103+
"style-loader": "^3.3.2",
103104
"url-loader": "^4.1.1",
104-
"webpack": "^5.12.3",
105-
"webpack-cli": "^4.3.1",
106-
"webpack-dev-middleware": "^6.0.1"
105+
"webpack": "^5.77.0",
106+
"webpack-cli": "4",
107+
"webpack-dev-middleware": "^6.0.2"
107108
}
108109
}

spec/__mock__/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
PUBLIC_URL: 'http://localhost:3000',
33
API_URL: 'http://localhost:3000',
44
APP_PORT: '3000',

0 commit comments

Comments
 (0)