diff --git a/.gitignore b/.gitignore index ac659d1..971d914 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -lib/**/*.d.ts +types node_modules .nyc_output coverage diff --git a/package.json b/package.json index db2bbd1..6e05b9c 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,10 @@ "type": "commonjs", "main": "lib/index.js", "files": [ - "lib/**/*" + "lib/**/*", + "types/**/*" ], + "types": "types/index.d.ts", "engines": { "node": ">=16" }, @@ -38,7 +40,7 @@ "typescript": "^5.0.2" }, "scripts": { - "build": "rm -f lib/**/*.d.ts && tsc", + "build": "tsc", "test": "node --test", "format-code": "prettier --write \"*.js\" \"(test|lib)/*.js\"", "format-code-staged": "pretty-quick --staged --pattern \"*.js\" --pattern \"(test|lib)/*.js\"", diff --git a/tsconfig.json b/tsconfig.json index ae7ca1a..dd38069 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,6 +2,7 @@ "include": ["lib/**/*.js"], "exclude": ["coverage/", "node_modules/", "test/"], "compilerOptions": { + "outDir": "types", "checkJs": true, "declaration": true, "emitDeclarationOnly": true,