Skip to content

Commit e6300f7

Browse files
committed
fix(types): adding typescript d.ts file into dist
fix #579
1 parent 9cbc27e commit e6300f7

File tree

2 files changed

+527
-53
lines changed

2 files changed

+527
-53
lines changed

Diff for: package.json

+20-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0-semantic-release",
44
"description": "react tooltip component",
55
"main": "dist/index.js",
6-
"types": "react-tooltip.d.ts",
6+
"types": "dist/react-tooltip.d.ts",
77
"module": "dist/index.es.js",
88
"jsnext:main": "dist/index.es.js",
99
"engines": {
@@ -15,11 +15,12 @@
1515
"test:unit": "mocha --require @babel/register --require ignore-styles 'test/*.spec.js'",
1616
"clean": "rimraf dist",
1717
"build:rollup": "rollup -c",
18-
"build": "npm-run-all test:unit build:rollup",
18+
"build": "npm-run-all clean copy:types build:rollup",
1919
"build:watch": "rollup -c -w",
2020
"start": "npm-run-all clean build:watch",
2121
"gh-pages": "gh-pages -d example",
2222
"github-changes": "github-changes -o wwayne -r react-tooltip -a --only-pulls --use-commit-body",
23+
"copy:types": "cpy './react-tooltip.d.ts' './dist' --parents --dot",
2324
"cm": "git cz",
2425
"semantic-release": "semantic-release"
2526
},
@@ -28,6 +29,11 @@
2829
"path": "node_modules/cz-conventional-changelog"
2930
}
3031
},
32+
"commitlint": {
33+
"extends": [
34+
"@commitlint/config-conventional"
35+
]
36+
},
3137
"repository": {
3238
"type": "git",
3339
"url": "https://github.com/wwayne/react-tooltip"
@@ -74,6 +80,9 @@
7480
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
7581
"@babel/plugin-syntax-import-meta": "^7.8.3",
7682
"@babel/register": "^7.8.3",
83+
"@commitlint/cli": "^8.3.5",
84+
"@commitlint/config-conventional": "^8.2.0",
85+
"@commitlint/travis-cli": "^8.3.5",
7786
"@rollup/plugin-commonjs": "^11.0.2",
7887
"@rollup/plugin-node-resolve": "^7.1.1",
7988
"@semantic-release/changelog": "^5.0.0",
@@ -93,6 +102,7 @@
93102
"chai-spies": "^1.0.0",
94103
"commitizen": "2.9.6",
95104
"concurrently": "^2.1.0",
105+
"cpy-cli": "^3.1.0",
96106
"cz-conventional-changelog": "2.1.0",
97107
"enzyme": "^2.3.0",
98108
"enzyme-adapter-react-16": "^1.15.2",
@@ -109,6 +119,7 @@
109119
"eslint-plugin-standard": "^4.0.1",
110120
"gh-pages": "1.1.0",
111121
"github-changes": "^1.1.2",
122+
"husky": "^3.1.0",
112123
"http-server": "^0.11.1",
113124
"ignore-styles": "5.0.1",
114125
"jsdom": "^9.2.1",
@@ -142,5 +153,11 @@
142153
},
143154
"files": [
144155
"dist"
145-
]
156+
],
157+
"husky": {
158+
"hooks": {
159+
"pre-commit": "yarn test:unit",
160+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
161+
}
162+
}
146163
}

0 commit comments

Comments
 (0)