From aec7dc77890d9f5a4f673423783e169628fad190 Mon Sep 17 00:00:00 2001 From: Petri Lehtinen Date: Wed, 16 Mar 2022 21:08:17 +0200 Subject: [PATCH] Include all TS files in tsconfig.json This enhances editor experience. --- package.json | 2 +- tests/middlewares.ts | 6 +++++- tsconfig.build.json | 9 +++++++++ tsconfig.json | 9 +++------ 4 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 tsconfig.build.json diff --git a/package.json b/package.json index 2ae4ae1a..089d33e5 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "typera-openapi": "./dist/cli.js" }, "scripts": { - "build": "tsc", + "build": "tsc -p tsconfig.build.json", "clean": "rm -rf dist", "lint": "eslint --max-warnings 0 '**/*.ts' && prettier --check \"**/*.{json,md}\"", "lint:fix": "eslint --fix '**/*.ts' && prettier --write '**/*.{json,md}'", diff --git a/tests/middlewares.ts b/tests/middlewares.ts index 9add4d6b..c84d7214 100644 --- a/tests/middlewares.ts +++ b/tests/middlewares.ts @@ -1,5 +1,9 @@ import { Middleware } from 'typera-express' import { urlencoded } from 'body-parser' + export const formUrlEncodedMiddleware = Middleware.wrapNative< Record<'contentType', 'application/x-www-form-urlencoded'> ->(urlencoded()) +>( + // TODO: typera's typings don't like connect middleware + urlencoded() as any +) diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 00000000..5201f0b8 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "outDir": "dist", + "noEmit": false, + "declaration": true + }, + "extends": "./tsconfig.json", + "include": ["src/**/*.ts"] +} diff --git a/tsconfig.json b/tsconfig.json index 1177f2f9..0992d57e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,13 +1,10 @@ { "compilerOptions": { - "outDir": "dist", + "noEmit": true, "module": "commonjs", "target": "es6", "lib": ["es2019"], "skipLibCheck": true, - "strict": true, - "declaration": true - }, - "include": ["src/*.ts"], - "exclude": [] + "strict": true + } }