From 21274bd1f1d1c1c3ae64fa1c8168648c941f5138 Mon Sep 17 00:00:00 2001 From: chimurai <655241+chimurai@users.noreply.github.com> Date: Sat, 7 May 2022 13:34:18 +0200 Subject: [PATCH 1/4] build(tsc): fix incremental build --- .gitignore | 1 + package.json | 5 ++--- tsconfig.json | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 4c6d8505..a665286c 100644 --- a/.gitignore +++ b/.gitignore @@ -87,3 +87,4 @@ typings/ # End of https://www.gitignore.io/api/node dist +tsconfig.tsbuildinfo diff --git a/package.json b/package.json index 4d8a0f95..ffb42408 100644 --- a/package.json +++ b/package.json @@ -8,19 +8,18 @@ "dist" ], "scripts": { - "clean": "rm -rf dist coverage", + "clean": "rm -rf dist coverage tsconfig.tsbuildinfo", "lint": "yarn prettier && yarn eslint", "lint:fix": "yarn prettier:fix && yarn eslint:fix", "eslint": "eslint '{src,test}/**/*.ts'", "eslint:fix": "yarn eslint --fix", "prettier": "prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"", "prettier:fix": "prettier --write \"**/*.{js,ts,md,yml,json,html}\"", - "prebuild": "yarn clean", "build": "tsc", "test": "jest", "coverage": "jest --coverage --coverageReporters=lcov", "prepare": "husky install", - "prepack": "yarn build && rm dist/tsconfig.tsbuildinfo", + "prepack": "yarn clean && yarn build", "spellcheck": "npx --yes cspell --show-context --show-suggestions '**/*.*'" }, "repository": { diff --git a/tsconfig.json b/tsconfig.json index 3eda4a1c..4073e3a4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "rootDir": "./src", "outDir": "./dist", "lib": ["es2019", "es2020.bigint", "es2020.string", "es2020.symbol.wellknown"], "module": "commonjs", From 6b7be500853dd95c0a465587c4bb9ee9e83dcbee Mon Sep 17 00:00:00 2001 From: chimurai <655241+chimurai@users.noreply.github.com> Date: Sat, 7 May 2022 19:26:27 +0200 Subject: [PATCH 2/4] build(tsc): enable smart incremental builds --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ffb42408..0d6d6391 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "eslint:fix": "yarn eslint --fix", "prettier": "prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"", "prettier:fix": "prettier --write \"**/*.{js,ts,md,yml,json,html}\"", - "build": "tsc", + "build": "tsc --build", "test": "jest", "coverage": "jest --coverage --coverageReporters=lcov", "prepare": "husky install", From 3fbe7c2a18569b227f55da29f396219dd1aafa51 Mon Sep 17 00:00:00 2001 From: chimurai <655241+chimurai@users.noreply.github.com> Date: Sat, 7 May 2022 19:32:04 +0200 Subject: [PATCH 3/4] ci(eslint): enable cache --- .lintstagedrc | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.lintstagedrc b/.lintstagedrc index db077db5..3adbe9d6 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,4 +1,4 @@ { "**/*.{js,ts,md,yml,json,html}": "prettier --write", - "**/*.{js,ts}": "eslint --fix", + "**/*.{js,ts}": "eslint --cache --fix" } diff --git a/package.json b/package.json index 0d6d6391..66fa6ea0 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,10 @@ "dist" ], "scripts": { - "clean": "rm -rf dist coverage tsconfig.tsbuildinfo", + "clean": "rm -rf dist coverage tsconfig.tsbuildinfo .eslintcache", "lint": "yarn prettier && yarn eslint", "lint:fix": "yarn prettier:fix && yarn eslint:fix", - "eslint": "eslint '{src,test}/**/*.ts'", + "eslint": "eslint '{src,test}/**/*.ts' --cache", "eslint:fix": "yarn eslint --fix", "prettier": "prettier --list-different \"**/*.{js,ts,md,yml,json,html}\"", "prettier:fix": "prettier --write \"**/*.{js,ts,md,yml,json,html}\"", From fcacc0ea0ac84f542957945f465947e7e6783fab Mon Sep 17 00:00:00 2001 From: chimurai <655241+chimurai@users.noreply.github.com> Date: Sat, 7 May 2022 19:36:21 +0200 Subject: [PATCH 4/4] build(package): run tests before creating package --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 66fa6ea0..98fafab9 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "test": "jest", "coverage": "jest --coverage --coverageReporters=lcov", "prepare": "husky install", - "prepack": "yarn clean && yarn build", + "prepack": "yarn clean && yarn test && yarn build", "spellcheck": "npx --yes cspell --show-context --show-suggestions '**/*.*'" }, "repository": {