Skip to content

Commit

Permalink
Merge pull request #23 from onaio/902-vulnerability-fixes-for-opensrp…
Browse files Browse the repository at this point in the history
…-web-image
  • Loading branch information
machariamuguku authored Feb 28, 2022
2 parents a2b26eb + d487dad commit 49a9d0c
Show file tree
Hide file tree
Showing 25 changed files with 4,500 additions and 4,255 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
build:
docker:
# specify the version you desire here
- image: circleci/node:12.13.0
- image: cimg/node:16.14.0

environment:
SKIP_PREFLIGHT_CHECK: "true"
SKIP_PREFLIGHT_CHECK: 'true'

working_directory: ~/repo

Expand Down Expand Up @@ -43,4 +43,4 @@ jobs:

- run:
name: Run coveralls
command: cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js
command: cat coverage/lcov.info | node_modules/coveralls/bin/coveralls.js
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules
dist
dist
coverage
.eslintrc.js
jest.config.js
90 changes: 63 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,65 @@
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"prettier"
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'airbnb-base',
'airbnb-typescript/base',
'plugin:prettier/recommended',
'typestrict',
],
"rules":{
"prettier/prettier": 1
}
};
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: './tsconfig.json',
},
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'prettier/prettier': 2,
'consistent-return': 0,
'max-classes-per-file': 0,
'@typescript-eslint/naming-convention': [
'error',
// variableLike - matches the same as variable, function and parameter
{
selector: 'variableLike',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
},
// typeLike - matches the same as class, interface, typeAlias, enum, typeParameter
{
selector: 'typeLike',
format: ['PascalCase'],
},
],
//ignore extensions for importing files with .js and .ts extensions
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
ts: 'never',
},
],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.ts'],
moduleDirectory: ['src', 'node_modules'],
},
project: './tsconfig.json',
},
},
};
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn tsc --noEmit && yarn test
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
semi: true,
trailingComma: "all",
trailingComma: 'all',
singleQuote: true,
printWidth: 120,
tabWidth: 4,
tabWidth: 2,
};
16 changes: 8 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
process.env.TZ = 'EAT';

module.exports = {
roots: ['<rootDir>/src'],
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
testEnvironment: 'node',
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/tests/', '!src/index.ts'],
coverageReporters: ['lcov', 'html'],
roots: ['<rootDir>/src'],
testMatch: ['**/__tests__/**/*.+(ts|tsx|js)', '**/?(*.)+(spec|test).+(ts|tsx|js)'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
testEnvironment: 'node',
collectCoverageFrom: ['src/**/*.{ts,tsx}', '!src/**/tests/', '!src/index.ts'],
coverageReporters: ['lcov', 'html'],
};
170 changes: 89 additions & 81 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,91 @@
{
"license": "Apache-2.0",
"scripts": {
"clean": "rimraf dist/* logs",
"tsc": "tsc",
"build": "npm-run-all clean tsc",
"dev:start": "npm-run-all build start",
"dev": "nodemon --watch src -e ts,ejs --exec npm run dev:start",
"start": "node dist",
"test": "jest",
"test:coverage": "jest --coverage --no-cache",
"lint": "tsc --noEmit && eslint src/**/*.{js,ts} --quiet"
},
"husky": {
"hooks": {
"pre-commit": "tsc --noEmit && lint-staged"
}
},
"lint-staged": {
"*.{js,ts}": [
"eslint --fix"
],
"*.{json,md}": [
"prettier --write"
]
},
"dependencies": {
"@onaio/gatekeeper": "^0.1.1",
"compression": "^1.7.4",
"cookie-parser": "^1.4.4",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-session": "^1.17.0",
"helmet": "^3.21.2",
"morgan": "^1.10.0",
"node-fetch": "^2.6.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-redux": "^7.2.0",
"react-router": "^5.1.2",
"react-router-dom": "^5.1.2",
"redux": "^4.0.5",
"request": "^2.88.0",
"seamless-immutable": "^7.1.4",
"session-file-store": "^1.3.1",
"typescript": "^3.7.5",
"winston": "^3.3.3"
},
"devDependencies": {
"@types/compression": "^1.0.1",
"@types/cookie-parser": "^1.4.2",
"@types/express": "^4.17.2",
"@types/express-session": "^1.15.16",
"@types/helmet": "^0.0.45",
"@types/jest": "^25.1.3",
"@types/lodash": "^4.14.149",
"@types/morgan": "^1.9.2",
"@types/node": "^13.5.0",
"@types/node-fetch": "^2.5.8",
"@types/react": "^16.9.32",
"@types/react-redux": "7.1.7",
"@types/react-router": "^5.1.5",
"@types/request": "^2.48.4",
"@types/seamless-immutable": "^7.1.11",
"@types/session-file-store": "^1.2.1",
"@types/supertest": "^2.0.8",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"coveralls": "^3.0.11",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"jest": "^25.1.0",
"mockdate": "^3.0.2",
"nock": "^12.0.1",
"nodemon": "^2.0.2",
"npm-run-all": "^4.1.5",
"prettier": "^2.0.4",
"rimraf": "^3.0.1",
"supertest": "^4.0.2",
"ts-jest": "^25.2.1"
}
"license": "Apache-2.0",
"scripts": {
"clean": "rimraf dist/* logs",
"tsc": "tsc",
"build": "npm-run-all clean tsc",
"dev:start": "npm-run-all build start",
"dev": "nodemon --watch src -e ts,ejs --exec npm run dev:start",
"start": "node dist",
"test": "jest",
"test:coverage": "jest --coverage --no-cache",
"lint": "eslint . --max-warnings 0",
"prepare": "husky install"
},
"lint-staged": {
"*.{js,ts}": [
"yarn lint --fix"
],
"*.{json,md,js,ts}": [
"prettier --write"
],
"*.{snap, test.ts}": [
"yarn lint"
]
},
"dependencies": {
"@onaio/gatekeeper": "^0.1.2",
"client-oauth2": "^4.3.3",
"compression": "^1.7.4",
"cookie-parser": "^1.4.6",
"dotenv": "^16.0.0",
"express": "^4.17.3",
"express-session": "^1.17.2",
"helmet": "^5.0.2",
"lodash": "^4.17.21",
"morgan": "^1.10.0",
"node-fetch": "2.6.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.6",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1",
"redux": "^4.1.2",
"request": "^2.88.0",
"seamless-immutable": "^7.1.4",
"session-file-store": "^1.5.0",
"typescript": "^4.5.5",
"winston": "^3.6.0"
},
"devDependencies": {
"@types/compression": "^1.7.2",
"@types/cookie-parser": "^1.4.2",
"@types/express": "^4.17.13",
"@types/express-session": "^1.17.4",
"@types/helmet": "^4.0.0",
"@types/jest": "^27.4.1",
"@types/lodash": "^4.14.178",
"@types/morgan": "^1.9.3",
"@types/node": "^17.0.21",
"@types/node-fetch": "^2.6.1",
"@types/react": "^17.0.39",
"@types/react-redux": "7.1.22",
"@types/react-router": "^5.1.18",
"@types/request": "^2.48.8",
"@types/seamless-immutable": "^7.1.16",
"@types/session-file-store": "^1.2.2",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"coveralls": "^3.1.1",
"eslint": "^8.9.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.4.0",
"eslint-config-typestrict": "^1.0.2",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-sonarjs": "^0.12.0",
"husky": "^7.0.4",
"jest": "^27.5.1",
"lint-staged": "^12.3.4",
"mockdate": "^3.0.5",
"nock": "^13.2.4",
"nodemon": "^2.0.15",
"npm-run-all": "^4.1.5",
"prettier": "^2.5.1",
"rimraf": "^3.0.1",
"supertest": "^6.2.2",
"ts-jest": "^27.1.3"
}
}
Loading

0 comments on commit 49a9d0c

Please sign in to comment.