Skip to content

Commit

Permalink
fix: add declaration files for esm and cjs (#19)
Browse files Browse the repository at this point in the history
This fix prevents the error `TS7016: Could not find a declaration file for module 'used-pm'.`

Resolves #17
  • Loading branch information
mheob authored May 5, 2023
1 parent 03504ad commit f724043
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 514 deletions.
30 changes: 12 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "used-pm",
"version": "1.0.0",
"version": "1.0.1",
"description": "Detects what package manager executes the process",
"keywords": [
"npm",
Expand All @@ -13,16 +13,22 @@
"license": "MIT",
"author": "Alexander Böhm <[email protected]>",
"exports": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
}
},
"types": "./dist/index.d.ts",
"files": [
"./dist/"
],
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"build": "tsc -b ./tsconfig.cjs.json ./tsconfig.esm.json",
"format": "prettier --write \"**/*.{cjs,js,mjs,ts,json,md,mdx,yaml,yml}\"",
"lint": "eslint . --ext .cjs,.js,.mjs,.ts --fix --ignore-path .gitignore",
"prepare": "ts-node ./scripts/prepare.ts && husky install"
Expand All @@ -49,21 +55,9 @@
"lint-staged": "^13.2.2",
"prettier": "^2.8.8",
"ts-node": "^10.9.1",
"tsup": "^6.7.0",
"typescript": "^5.0.4"
},
"publishConfig": {
"access": "public"
},
"tsup": {
"clean": true,
"entry": [
"src/index.ts"
],
"format": [
"cjs",
"esm"
],
"dts": true
}
}
Loading

0 comments on commit f724043

Please sign in to comment.