From ce237232e0eacf4ffce1653dcf83cc16d349dbc2 Mon Sep 17 00:00:00 2001 From: Bryan Lee <38807139+liby@users.noreply.github.com> Date: Tue, 17 Oct 2023 14:53:23 +0800 Subject: [PATCH] chore: update TypeScript config --- packages/date-helpers/package.json | 5 ++--- packages/date-helpers/tsconfig.build.json | 9 +++++++++ packages/date-helpers/tsconfig.json | 10 +++------- packages/exceptions/package.json | 5 ++--- packages/exceptions/tsconfig.build.json | 8 ++++++++ tsconfig.json | 1 - 6 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 packages/date-helpers/tsconfig.build.json create mode 100644 packages/exceptions/tsconfig.build.json diff --git a/packages/date-helpers/package.json b/packages/date-helpers/package.json index 19e3110..a736855 100644 --- a/packages/date-helpers/package.json +++ b/packages/date-helpers/package.json @@ -19,14 +19,13 @@ "main": "lib/date-helpers.js", "typings": "lib/date-helpers.d.ts", "directories": { - "lib": "lib", - "test": "__tests__" + "lib": "lib" }, "files": [ "lib" ], "scripts": { - "build": "tsc", + "build": "tsc --build tsconfig.build.json", "docs": "pnpm exec typedoc --plugin typedoc-plugin-markdown --out docs src/date-helpers.ts", "eslint": "eslint --cache 'src/**/*.ts*'", "lint": "pnpm prettier && pnpm eslint", diff --git a/packages/date-helpers/tsconfig.build.json b/packages/date-helpers/tsconfig.build.json new file mode 100644 index 0000000..741e122 --- /dev/null +++ b/packages/date-helpers/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + }, + "references": [{ "path": "../exceptions" }], + "include": ["./src"] +} diff --git a/packages/date-helpers/tsconfig.json b/packages/date-helpers/tsconfig.json index c21f583..3af3e71 100644 --- a/packages/date-helpers/tsconfig.json +++ b/packages/date-helpers/tsconfig.json @@ -1,13 +1,9 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src", + "rootDir": ".", "outDir": "./lib" }, - "references": [ - { - "path": "../exceptions" - } - ], - "include": ["./src"] + "references": [{ "path": "../exceptions" }], + "include": ["src", "__tests__"] } diff --git a/packages/exceptions/package.json b/packages/exceptions/package.json index a332a65..6dd9ba8 100644 --- a/packages/exceptions/package.json +++ b/packages/exceptions/package.json @@ -14,14 +14,13 @@ "main": "lib/index.js", "typings": "lib/index.d.ts", "directories": { - "lib": "lib", - "test": "__tests__" + "lib": "lib" }, "files": [ "lib" ], "scripts": { - "build": "tsc", + "build": "tsc --build tsconfig.build.json", "docs": "pnpm exec typedoc --plugin typedoc-plugin-markdown --out docs src/index.ts", "eslint": "eslint --cache 'src/**/*.ts*'", "lint": "pnpm prettier && pnpm eslint", diff --git a/packages/exceptions/tsconfig.build.json b/packages/exceptions/tsconfig.build.json new file mode 100644 index 0000000..8e029ab --- /dev/null +++ b/packages/exceptions/tsconfig.build.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./lib" + }, + "include": ["./src"] +} diff --git a/tsconfig.json b/tsconfig.json index b5744fd..c52b9c4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,5 @@ "sourceMap": true, "skipLibCheck": true }, - "include": ["packages/**/__tests__/**/*.ts"], "exclude": ["node_modules"] }