From 5bdebe8f5d0888aa0a3c880e0e613cbdae0f99bd Mon Sep 17 00:00:00 2001 From: Guillaume GABOREL Date: Wed, 21 Aug 2024 10:22:37 +0200 Subject: [PATCH] build: add ts compile step before publishing --- .husky/pre-commit | 3 +++ package.json | 3 ++- tsconfig.json | 12 ++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 tsconfig.json diff --git a/.husky/pre-commit b/.husky/pre-commit index d6cb288..e06bae1 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,4 @@ +#!/bin/sh + +npm run compile npm run build diff --git a/package.json b/package.json index ebb97f3..a29d330 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,9 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "compile": "tsc --noEmit", "build": "esbuild dist/index.d.ts --platform=node --bundle --format=cjs --outfile=dist/index.js", - "prepublish": "npm run build", + "prepublish": "npm run compile && npm run build", "prepare": "husky", "release": "commit-and-tag-version -s" }, diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..a165a35 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "commonjs", + "noEmit": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipDefaultLibCheck": true, + "skipLibCheck": false + } +}