Skip to content

Commit

Permalink
Reuse common scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorNadj committed Jun 24, 2022
1 parent e69ce79 commit 7ec1cb6
Show file tree
Hide file tree
Showing 34 changed files with 920 additions and 2,012 deletions.
26 changes: 24 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,41 @@
"package-json-lint": "npmPkgJsonLint --configFile .npmpackagejsonlintrc.json .",
"refresh-database": "yarn workspace @tupaia/database refresh-database --root ../../",
"test-all": "node ./scripts/node/testAll --silent",
"validate": "./scripts/bash/validate.sh"
"validate": "./scripts/bash/validate.sh",
"package:build:ts": "cd $INIT_CWD && tsc -p tsconfig-build.json",
"package:build:js": "cd $INIT_CWD && babel src --out-dir dist --source-maps --config-file \"../../babel.config.json\"",
"package:build:react-scripts": "cd $INIT_CWD && SKIP_PREFLIGHT_CHECK=true GENERATE_SOURCEMAP=false react-scripts build",
"package:build:types": "cd $INIT_CWD && tsc",
"package:lint:js": "cd $INIT_CWD && eslint --ignore-path ../../.gitignore .",
"package:lint:ts": "cd $INIT_CWD && eslint --ignore-path ../../.gitignore . --ext .ts",
"package:test": "cd $INIT_CWD && jest",
"package:test:withdb": "cd $INIT_CWD && yarn workspace @tupaia/database check-test-database-exists && DB_NAME=tupaia_test jest",
"package:start:react-scripts": "cd $INIT_CWD && SKIP_PREFLIGHT_CHECK=true react-scripts start",
"package:start:backend-start-dev": "cd $INIT_CWD && LOG_LEVEL=debug ../../scripts/bash/backendStartDev.sh",
"package:eject": "cd $INIT_CWD && react-scripts eject"
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "^4.18.0"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/node": "^7.10.5",
"@beyondessential/eslint-config-jest": "^1.0.0",
"@beyondessential/eslint-config-js": "^1.1.1",
"@beyondessential/eslint-config-ts": "^1.3.2",
"babel-jest": "^27.0.6",
"concurrently": "^5.2.0",
"cypress-dotenv": "^1.2.2",
"eslint": "^7.9.0",
"eslint-plugin-cypress": "^2.11.1",
"jest-extended": "^0.11.5"
"jest": "^27.0.6",
"jest-extended": "^0.11.5",
"nodemon": "^2.0.4",
"npm-package-json-lint": "5.1.0",
"react-scripts": "4.0.3",
"ts-jest": "^27.1.3",
"ts-node": "^10.7.0",
"typescript": "^4.2.0"
},
"engines": {
"node": "^14.19.3"
Expand Down
14 changes: 5 additions & 9 deletions packages/access-policy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf dist && run-p \"build:* {@}\" --",
"build:src": "babel src --out-dir dist --source-maps --config-file \"../../babel.config.json\"",
"build:types": "tsc",
"lint": "eslint --ignore-path ../../.gitignore .",
"build:src": "yarn package:build:js",
"build:types": "yarn package:build:types",
"lint": "yarn package:lint:js",
"lint:fix": "yarn lint --fix",
"test": "jest",
"test": "yarn package:test",
"test:coverage": "yarn test --coverage"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"eslint": "^7.9.0",
"jest": "^27.0.6",
"npm-run-all": "^4.1.5",
"typescript": "^4.2.0"
"npm-run-all": "^4.1.5"
}
}
20 changes: 7 additions & 13 deletions packages/admin-panel-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@
"types": "dist/index.d.ts",
"private": true,
"scripts": {
"build": "tsc -p tsconfig-build.json",
"lint": "eslint . --ext .ts",
"lint:all": "yarn lint \"src/**/*.{ts,jsx}\"",
"build": "yarn package:build:ts",
"lint": "yarn package:lint:ts",
"lint:fix": "yarn lint --fix",
"prestart": "yarn build",
"start": "node dist",
"start-dev": "LOG_LEVEL=debug ../../scripts/bash/backendStartDev.sh 9994 -ts",
"start-verbose": "LOG_LEVEL=debug yarn start-dev",
"test": "jest",
"test:coverage": "jest --coverage",
"test:watch": "jest --watch"
"start-dev": "yarn package:start:backend-start-dev 9994 -ts",
"test": "yarn package:test",
"test:coverage": "yarn test --coverage",
"test:watch": "yarn test --watch"
},
"dependencies": {
"@tupaia/access-policy": "3.0.0",
Expand All @@ -46,10 +44,6 @@
"winston": "^3.2.1"
},
"devDependencies": {
"@types/multer": "^1.4.7",
"eslint": "^7.9.0",
"jest": "^27.0.6",
"nodemon": "^2.0.4",
"typescript": "^4.2.0"
"@types/multer": "^1.4.7"
}
}
13 changes: 5 additions & 8 deletions packages/admin-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
"main": "dist/index.js",
"scripts": {
"build": "run-p -c \"build:* {@}\" --",
"build:src": "SKIP_PREFLIGHT_CHECK=true GENERATE_SOURCEMAP=false react-scripts build",
"build:src": "yarn package:build:react-scripts",
"build:library": "rollup -c",
"cypress:open": "cross-env NODE_ENV=test yarn cypress open",
"cypress:run": "cross-env NODE_ENV=test yarn cypress run",
"eject": "react-scripts eject",
"lint": "eslint --ignore-path ../../.gitignore .",
"eject": "yarn package:eject",
"lint": "yarn package:lint:js",
"lint:fix": "yarn lint --fix",
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
"start": "yarn package:start:react-scripts",
"start-dev": "yarn start",
"test": "echo Nothing to test"
"test": "echo No tests"
},
"browserslist": [
"defaults"
Expand Down Expand Up @@ -74,11 +74,8 @@
"@rollup/plugin-multi-entry": "^4.0.0",
"@tupaia/utils": "1.0.0",
"cross-env": "^7.0.2",
"cypress": "^6.6.0",
"cypress-file-upload": "^5.0.8",
"eslint": "^7.9.0",
"npm-run-all": "^4.1.5",
"react-scripts": "4.0.3",
"rollup": "^2.44.0",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-commonjs": "^10.1.0",
Expand Down
14 changes: 5 additions & 9 deletions packages/aggregator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf dist && run-p -c \"build:* {@}\" --",
"build:src": "babel src --out-dir dist --source-maps --ignore \"src/__tests__/**\" --config-file \"../../babel.config.json\"",
"build:types": "tsc",
"lint": "eslint --ignore-path ../../.gitignore .",
"build:src": "yarn package:build:js --ignore \"src/__tests__/**\"",
"build:types": "yarn package:build:types",
"lint": "yarn package:lint:js",
"lint:fix": "yarn lint --fix",
"test": "jest",
"test": "yarn package:test",
"test:coverage": "yarn test --coverage"
},
"dependencies": {
Expand All @@ -28,10 +28,6 @@
"winston": "^3.3.3"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"eslint": "^7.9.0",
"jest": "^27.0.6",
"npm-run-all": "^4.1.5",
"typescript": "^4.2.0"
"npm-run-all": "^4.1.5"
}
}
11 changes: 3 additions & 8 deletions packages/api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"types": "dist/index.d.ts",
"license": "SEE LICENSE IN LICENSE",
"scripts": {
"build": "tsc -p tsconfig-build.json",
"lint": "eslint . --ext .ts",
"build": "yarn package:build:ts",
"lint": "yarn package:lint:ts",
"lint:fix": "yarn lint --fix",
"test": "jest --runInBand",
"test": "yarn package:test --runInBand",
"test:coverage": "yarn test --coverage",
"publish:run": "yarn publish --no-git-tag-version --access public",
"prepublish:strict": "yarn lint && yarn build",
Expand All @@ -25,10 +25,5 @@
"dependencies": {
"node-fetch": "^1.7.3",
"qs": "^6.10.1"
},
"devDependencies": {
"eslint": "^7.9.0",
"jest": "^27.0.6",
"typescript": "^4.2.0"
}
}
14 changes: 5 additions & 9 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf dist && run-p \"build:* {@}\" --",
"build:src": "babel src --out-dir dist --source-maps --ignore \"src/__tests__/**\" --config-file \"../../babel.config.json\"",
"build:types": "tsc",
"lint": "eslint --ignore-path ../../.gitignore .",
"build:src": "yarn package:build:js --ignore \"src/__tests__/**\"",
"build:types": "yarn package:build:types",
"lint": "yarn package:lint:js",
"lint:fix": "yarn lint --fix",
"test": "yarn workspace @tupaia/database check-test-database-exists && DB_NAME=tupaia_test jest --runInBand",
"test": "yarn package:test:withdb --runInBand",
"test:coverage": "yarn test --coverage"
},
"dependencies": {
Expand All @@ -29,13 +29,9 @@
"sha256": "^0.2.0"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"@beyondessential/tupaia-access-policy": "^2.5.1",
"@tupaia/access-policy": "3.0.0",
"@tupaia/database": "1.0.0",
"eslint": "^7.9.0",
"jest": "^27.0.6",
"npm-run-all": "^4.1.5",
"typescript": "^4.2.0"
"npm-run-all": "^4.1.5"
}
}
15 changes: 5 additions & 10 deletions packages/central-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf dist && run-p -c \"build:* {@}\" --",
"build:src": "babel src -s --out-dir dist --source-maps --ignore \"**src/database/migrations\",\"src/tests/**\" --copy-files --no-copy-ignored --config-file \"../../babel.config.json\"",
"build:types": "tsc",
"lint": "eslint --ignore-path ../../.gitignore .",
"build:src": "yarn package:build:js --ignore \"**src/database/migrations\",\"src/tests/**\" --copy-files --no-copy-ignored",
"build:types": "yarn package:build:types",
"lint": "yarn package:lint:js",
"lint:fix": "yarn lint --fix",
"prestart": "yarn build",
"start": "node dist",
"start-dev": "../../scripts/bash/backendStartDev.sh 9999",
"start-dev": "yarn package:start:backend-start-dev 9999",
"start-verbose": "LOG_LEVEL=debug yarn start-dev",
"test": "yarn workspace @tupaia/database check-test-database-exists && DB_NAME=tupaia_test mocha",
"test:coverage": "cross-env NODE_ENV=test nyc mocha"
Expand Down Expand Up @@ -70,16 +70,11 @@
"xlsx": "^0.10.9"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/node": "^7.10.5",
"cross-env": "^7.0.2",
"deep-equal-in-any-order": "^1.0.21",
"eslint": "^7.9.0",
"mocha": "^8.1.3",
"nodemon": "^2.0.4",
"npm-run-all": "^4.1.5",
"sinon-test": "^3.0.0",
"supertest": "^3.1.0",
"typescript": "^4.2.0"
"supertest": "^3.1.0"
}
}
11 changes: 3 additions & 8 deletions packages/data-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsc -p tsconfig-build.json",
"lint": "eslint --ignore-path ../../.gitignore .",
"build": "yarn package:build:ts",
"lint": "yarn package:lint:ts",
"lint:fix": "yarn lint --fix",
"test": "yarn workspace @tupaia/database check-test-database-exists && DB_NAME=tupaia_test jest --runInBand",
"test": "yarn package:test:withdb --runInBand",
"test:coverage": "yarn test --coverage",
"install-mv-refresh": "scripts/installMvRefreshModule.sh",
"uninstall-mv-refresh": "scripts/uninstallMvRefreshModule.sh",
Expand All @@ -34,10 +34,5 @@
"dotenv": "^8.2.0",
"lodash.groupby": "^4.6.0",
"moment": "^2.24.0"
},
"devDependencies": {
"eslint": "^7.9.0",
"jest": "^27.0.6",
"typescript": "^4.2.0"
}
}
14 changes: 5 additions & 9 deletions packages/data-broker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf dist && run-p \"build:* {@}\" --",
"build:src": "babel src --out-dir dist --source-maps --ignore \"src/__tests__/**\" --config-file \"../../babel.config.json\"",
"build:types": "tsc",
"lint": "eslint --ignore-path ../../.gitignore .",
"build:src": "yarn package:build:js",
"build:types": "yarn package:build:types",
"lint": "yarn package:lint:js",
"lint:fix": "yarn lint --fix",
"test": "jest",
"test": "yarn package:test",
"test:coverage": "yarn test --coverage",
"test:debug": "yarn test --debug"
},
Expand All @@ -39,10 +39,6 @@
"winston": "^3.3.3"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"eslint": "^7.9.0",
"jest": "^27.0.6",
"npm-run-all": "^4.1.5",
"typescript": "^4.2.0"
"npm-run-all": "^4.1.5"
}
}
9 changes: 3 additions & 6 deletions packages/data-lake-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"author": "Beyond Essential Systems <[email protected]> (https://beyondessential.com.au)",
"main": "dist/index.js",
"scripts": {
"build": "tsc -p tsconfig-build.json",
"lint": "eslint . --ext .ts",
"lint:all": "yarn run lint \"src/**/*.{ts,jsx}\"",
"build": "yarn package:build:ts",
"lint": "yarn package:lint:ts",
"lint:fix": "yarn lint --fix",
"test": "yarn workspace @tupaia/data-lake-api check-test-data-lake-exists && DATA_LAKE_DB_NAME=data_lake_test jest --runInBand",
"test:coverage": "yarn test --coverage",
Expand All @@ -34,8 +33,6 @@
"pg": "8.5.1"
},
"devDependencies": {
"eslint": "^7.9.0",
"jest": "^27.0.6",
"typescript": "^4.2.0"
"jest": "^27.0.6"
}
}
11 changes: 4 additions & 7 deletions packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf dist && run-p \"build:* {@}\" --",
"build:src": "babel src --out-dir dist --source-maps --config-file \"../../babel.config.json\" --copy-files --no-copy-ignored",
"build:types": "tsc",
"build:src": "yarn package:build:js --copy-files --no-copy-ignored",
"build:types": "yarn package:build:types",
"dump-database": "./scripts/dumpDatabase.sh",
"lint": "eslint --ignore-path ../../.gitignore .",
"lint": "yarn package:lint:js",
"lint:fix": "yarn lint --fix",
"migrate": "babel-node ./src/migrate.js up --migrations-dir ./src/migrations -v --config-file \"../../babel.config.json\"",
"migrate-create": "read -p \"Enter migration name: \" MIGRATION_NAME && read -p \"Enter the scope of this migration ('schema' or 'data'): \" MIGRATION_SCOPE && babel-node ./src/migrate.js create ${MIGRATION_NAME}-modifies-${MIGRATION_SCOPE} --migrations-dir ./src/migrations -v --config-file \"../../babel.config.json\"",
Expand Down Expand Up @@ -49,14 +49,11 @@
"winston": "3.3.3"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"@babel/node": "^7.10.5",
"cross-env": "^7.0.2",
"deep-equal-in-any-order": "^1.0.27",
"eslint": "^7.9.0",
"mocha": "^8.1.3",
"npm-run-all": "^4.1.5",
"pluralize": "^8.0.0",
"typescript": "^4.2.0"
"pluralize": "^8.0.0"
}
}
14 changes: 5 additions & 9 deletions packages/dhis-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"types": "dist/index.d.ts",
"scripts": {
"build": "rm -rf dist && run-p \"build:* {@}\" --",
"build:src": "babel src --out-dir dist --source-maps --ignore \"src/__tests__/**\" --config-file \"../../babel.config.json\"",
"build:types": "tsc",
"lint": "eslint --ignore-path ../../.gitignore .",
"build:src": "yarn package:build:js",
"build:types": "yarn package:build:types",
"lint": "yarn package:lint:js",
"lint:fix": "yarn lint --fix",
"test": "jest",
"test": "yarn package:test",
"test:coverage": "jest --coverage"
},
"dependencies": {
Expand All @@ -32,10 +32,6 @@
"winston": "^3.3.3"
},
"devDependencies": {
"@babel/cli": "^7.11.6",
"eslint": "^7.9.0",
"jest": "^27.0.6",
"npm-run-all": "^4.1.5",
"typescript": "^4.2.0"
"npm-run-all": "^4.1.5"
}
}
Loading

0 comments on commit 7ec1cb6

Please sign in to comment.