Skip to content

Commit 7d046f9

Browse files
committed
feat: build typings as well
1 parent 6a80a40 commit 7d046f9

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
lib/
22
node_modules/
33
renovate.json
4+
tsconfig.types.json

package.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@
2121
},
2222
"license": "MIT",
2323
"author": "Vitalii Sikora",
24+
"files": [
25+
"lib"
26+
],
2427
"main": "lib/index.js",
28+
"types": "./lib/index.d.ts",
2529
"scripts": {
26-
"build": "rm -rf lib/ && babel src --out-dir lib --ignore '**/*.test.ts' --extensions '.ts'",
30+
"build": "rm -rf lib/ && yarn build:types && babel src --out-dir lib --ignore '**/*.test.ts,**/*.mock.ts' --extensions '.ts'",
31+
"build:types": "tsc -p tsconfig.types.json",
2732
"lint": "eslint . --fix --ext .js,.json,.ts --quiet",
2833
"lint:ci": "eslint . --ext .js,.json,.ts --quiet",
2934
"prepack": "npm run build",
@@ -37,11 +42,11 @@
3742
}
3843
},
3944
"lint-staged": {
40-
"*.ts": [
45+
"*.ts,*.json": [
4146
"eslint --fix",
4247
"git add"
4348
],
44-
"*.{html,json,md,yml}": [
49+
"*.{html,md,yml}": [
4550
"prettier --write",
4651
"git add"
4752
]

tsconfig.types.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "./tsconfig",
3+
"exclude": ["node_modules", "src/**/*.test.ts"],
4+
"include": ["src"],
5+
"compilerOptions": {
6+
"allowJs": false,
7+
"declaration": true,
8+
"declarationDir": "lib",
9+
"emitDeclarationOnly": true,
10+
"isolatedModules": false
11+
}
12+
}

0 commit comments

Comments
 (0)