Skip to content

Commit 9cf37dc

Browse files
chore: Improve tooling for dev/test/deploy (aws-amplify#3513)
* Remove package-lock.json * Remove pre-commit package * Add husky * Add --passWithNoTests to jest pkgs without tests * Add/rename link-all/unlink-all scripts * Remove linting from test * Remove test script from package with no tests * Fix credentials tests, use empty credentials * Add test script for amazon-cognito-identity-js (passWithNoTests) * Remove deprecated jest config mapCoverage * Use lerna run instead of lerna exec * Link and unlink in parallel * Upgrade lerna * Add test script, remove typescript formatter * Remove old prettier * code review comments
1 parent 1f2ea54 commit 9cf37dc

File tree

32 files changed

+1671
-9216
lines changed

32 files changed

+1671
-9216
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ packages/**/es/
1212
.idea
1313
*.log
1414
.npm/
15-
packages/**/cypress/videos/
15+
packages/**/cypress/videos/
16+
package-lock.json

lerna.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"lerna": "2.4.0",
32
"npmClient": "yarn",
43
"useWorkspaces": true,
54
"packages": [

package.json

+21-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
{
2-
"name": "aws-amplify",
2+
"name": "aws-amplify-monorepo",
3+
"private": true,
34
"version": "0.1.30",
45
"description": "",
56
"scripts": {
7+
"setup-dev": "yarn && yarn bootstrap && yarn link-all && yarn build",
68
"bootstrap": "lerna bootstrap",
7-
"pre-commit": "lerna exec yarn test --scope @aws-amplify/core",
8-
"test": "lerna exec yarn test",
9+
"test": "lerna run test",
10+
"cypress": "lerna run cypress",
11+
"cypress:open": "lerna run cypress:open",
912
"coverage": "codecov || exit 0",
1013
"docs": "typedoc packages/**/src --name amplify-js --hideGenerator --excludePrivate --ignoreCompilerErrors --mode file --out docs/api --theme docs/amplify-theme/typedoc/",
11-
"build": "lerna exec yarn build",
12-
"clean": "lerna run -- clean",
13-
"format": "lerna run -- format",
14-
"lint": "lerna run -- lint",
15-
"link": "lerna exec yarn link",
16-
"publish:master": "lerna publish --conventional-commits --cd-version=prerelease --yes --independent --npm-tag=unstable --preid=unstable --message 'chore(release): Publish [ci skip]' --exact",
17-
"publish:beta": "lerna publish --conventional-commits --cd-version=prerelease --yes --independent --npm-tag=beta --preid=beta --message 'chore(release): Publish [ci skip]' --exact",
18-
"publish:release": "lerna publish --conventional-commits --yes --independent --message 'chore(release): Publish [ci skip]'"
14+
"build": "lerna run build",
15+
"clean": "lerna run clean",
16+
"format": "lerna run format",
17+
"lint": "lerna run lint",
18+
"link-all": "yarn unlink-all && lerna exec --parallel yarn link",
19+
"unlink-all": "lerna exec --parallel --bail=false yarn unlink",
20+
"publish:master": "lerna publish --canary --yes --npm-tag=unstable --preid=unstable --exact",
21+
"publish:beta": "lerna publish --canary --yes --npm-tag=beta --preid=beta --exact",
22+
"publish:release": "lerna publish --conventional-commits --yes --message 'chore(release): Publish [ci skip]'"
23+
},
24+
"husky": {
25+
"hooks": {}
1926
},
20-
"pre-commit": [
21-
"pre-commit"
22-
],
23-
"private": true,
2427
"workspaces": [
2528
"packages/*"
2629
],
@@ -39,18 +42,18 @@
3942
"@types/node": "^8.9.5",
4043
"codecov": "^1.0.1",
4144
"compression-webpack-plugin": "^1.1.3",
45+
"cypress": "^3.2.0",
46+
"husky": "^1.3.1",
4247
"jest": "^22.4.3",
4348
"json-loader": "^0.5.7",
44-
"lerna": "2.11.0",
45-
"pre-commit": "^1.2.2",
49+
"lerna": "^3.13.1",
4650
"rimraf": "^2.6.2",
4751
"source-map-loader": "^0.2.1",
4852
"ts-jest": "^22.0.0",
4953
"tslint": "^5.7.0",
5054
"tslint-config-airbnb": "^5.8.0",
5155
"typedoc": "^0.11.0",
5256
"typescript": "^2.9.2",
53-
"typescript-formatter": "^6.0.0",
5457
"uglifyjs-webpack-plugin": "^0.4.6",
5558
"webpack": "^3.5.5"
5659
},

packages/amazon-cognito-identity-js/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@
4949
"build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:umd",
5050
"doc": "jsdoc src -d docs",
5151
"lint": "eslint src",
52-
"test": "eslint src",
53-
"lint2": "eslint enhance-rn.js"
52+
"lint2": "eslint enhance-rn.js",
53+
"test": "jest --passWithNoTests",
54+
"format": "echo \"Not implemented\""
5455
},
5556
"main": "lib/index.js",
5657
"react-native": {

packages/amplify-ui/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"access": "public"
88
},
99
"scripts": {
10+
"format": "echo \"Not implemented\"",
1011
"test": "webpack",
1112
"start": "webpack-dev-server",
1213
"clean": "rimraf dist lib",

packages/analytics/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build-with-test": "npm run clean && npm test && tsc && webpack",
1414
"build": "npm run clean && tsc && webpack",
1515
"clean": "rimraf lib lib-esm dist",
16-
"format": "tsfmt --useTsfmt tsfmt.json -r src/**/*.ts",
16+
"format": "echo \"Not implemented\"",
1717
"lint": "tslint 'src/**/*.ts'"
1818
},
1919
"react-native": {
@@ -42,13 +42,11 @@
4242
"jest": "^22.4.3",
4343
"json-loader": "^0.5.7",
4444
"prepend-file": "^1.3.1",
45-
"prettier": "^1.7.4",
4645
"rimraf": "^2.6.2",
4746
"source-map-loader": "^0.2.1",
4847
"ts-jest": "^22.0.0",
4948
"tslint": "^5.7.0",
5049
"tslint-config-airbnb": "^5.8.0",
51-
"typescript-formatter": "^6.0.0",
5250
"uglifyjs-webpack-plugin": "^0.4.6",
5351
"webpack": "^3.5.5"
5452
},
@@ -71,7 +69,6 @@
7169
],
7270
"testEnvironment": "jsdom",
7371
"testURL": "http://localhost/",
74-
"mapCoverage": true,
7572
"coverageThreshold": {
7673
"global": {
7774
"branches": 0,

packages/analytics/tsfmt.json

-23
This file was deleted.

packages/api/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build-with-test": "npm run clean && npm test && tsc && webpack",
1414
"build": "npm run clean && tsc && webpack",
1515
"clean": "rimraf lib lib-esm dist",
16-
"format": "tsfmt --useTsfmt tsfmt.json -r src/**/*.ts",
16+
"format": "echo \"Not implemented\"",
1717
"lint": "tslint 'src/**/*.ts'"
1818
},
1919
"repository": {
@@ -40,13 +40,11 @@
4040
"jest": "^22.4.3",
4141
"json-loader": "^0.5.7",
4242
"prepend-file": "^1.3.1",
43-
"prettier": "^1.7.4",
4443
"rimraf": "^2.6.2",
4544
"source-map-loader": "^0.2.1",
4645
"ts-jest": "^22.0.0",
4746
"tslint": "^5.7.0",
4847
"tslint-config-airbnb": "^5.8.0",
49-
"typescript-formatter": "^6.0.0",
5048
"uglifyjs-webpack-plugin": "^0.4.6",
5149
"webpack": "^3.5.5"
5250
},
@@ -73,7 +71,6 @@
7371
],
7472
"testEnvironment": "jsdom",
7573
"testURL": "http://localhost/",
76-
"mapCoverage": true,
7774
"coverageThreshold": {
7875
"global": {
7976
"branches": 0,

packages/api/tsfmt.json

-23
This file was deleted.

packages/auth/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"build": "npm run clean && tsc && webpack",
1616
"build:watch": "npm run clean && tsc --watch",
1717
"clean": "rimraf lib lib-esm dist",
18-
"format": "tsfmt --useTsfmt tsfmt.json -r src/**/*.ts",
18+
"format": "echo \"Not implemented\"",
1919
"lint": "tslint 'src/**/*.ts'"
2020
},
2121
"repository": {
@@ -41,13 +41,11 @@
4141
"jest": "^22.4.3",
4242
"json-loader": "^0.5.7",
4343
"prepend-file": "^1.3.1",
44-
"prettier": "^1.7.4",
4544
"rimraf": "^2.6.2",
4645
"source-map-loader": "^0.2.1",
4746
"ts-jest": "^22.0.0",
4847
"tslint": "^5.7.0",
4948
"tslint-config-airbnb": "^5.8.0",
50-
"typescript-formatter": "^6.0.0",
5149
"uglifyjs-webpack-plugin": "^0.4.6",
5250
"webpack": "^3.5.5"
5351
},
@@ -71,7 +69,6 @@
7169
],
7270
"testEnvironment": "jsdom",
7371
"testURL": "http://localhost/",
74-
"mapCoverage": true,
7572
"coverageThreshold": {
7673
"global": {
7774
"branches": 0,

packages/auth/tsfmt.json

-23
This file was deleted.

packages/aws-amplify-angular/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"package": "rollup -c rollup.config.js",
1414
"minify": "uglifyjs dist/bundles/aws-amplify-angular.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/aws-amplify-angular.umd.min.js",
1515
"build": "npm run transpile && npm run package && npm run minify && npm run declarations",
16+
"format": "echo \"Not implemented\"",
1617
"declarations": "ngc --p ./declarations/"
1718
},
1819
"jest": {

packages/aws-amplify-react-native/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
"description": "AWS Amplify is a JavaScript library for Frontend and mobile developers building cloud-enabled applications.",
55
"main": "dist/index.js",
66
"scripts": {
7-
"test": "jest --coverage --maxWorkers 2",
7+
"test": "jest --passWithNoTests --coverage --maxWorkers 2",
88
"build": "npm run clean && babel src --out-dir dist --copy-files",
99
"watch": "npm run clean && babel src --out-dir dist --copy-files --watch",
1010
"generate-docs": "rimraf docs && jsdoc -c ./jsDoc.config.json --readme ../../media/api_reference_home.md ./src -r -d ./docs",
11+
"format": "echo \"Not implemented\"",
1112
"clean": "rimraf dist"
1213
},
1314
"devDependencies": {

packages/aws-amplify-react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"cypress:open": "cypress open",
1313
"build-with-test": "npm run clean && npm test && npm run build",
1414
"clean": "rimraf dist",
15-
"format": "tsfmt --useTsfmt tsfmt.json -r src/**/*.ts",
15+
"format": "echo \"Not implemented\"",
1616
"lint": "tslint 'src/**/*.ts'"
1717
},
1818
"devDependencies": {

packages/aws-amplify-react/tsfmt.json

-23
This file was deleted.

0 commit comments

Comments
 (0)