Skip to content

Commit

Permalink
feat: build typings as well
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed Sep 7, 2019
1 parent 6a80a40 commit 7d046f9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
lib/
node_modules/
renovate.json
tsconfig.types.json
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@
},
"license": "MIT",
"author": "Vitalii Sikora",
"files": [
"lib"
],
"main": "lib/index.js",
"types": "./lib/index.d.ts",
"scripts": {
"build": "rm -rf lib/ && babel src --out-dir lib --ignore '**/*.test.ts' --extensions '.ts'",
"build": "rm -rf lib/ && yarn build:types && babel src --out-dir lib --ignore '**/*.test.ts,**/*.mock.ts' --extensions '.ts'",
"build:types": "tsc -p tsconfig.types.json",
"lint": "eslint . --fix --ext .js,.json,.ts --quiet",
"lint:ci": "eslint . --ext .js,.json,.ts --quiet",
"prepack": "npm run build",
Expand All @@ -37,11 +42,11 @@
}
},
"lint-staged": {
"*.ts": [
"*.ts,*.json": [
"eslint --fix",
"git add"
],
"*.{html,json,md,yml}": [
"*.{html,md,yml}": [
"prettier --write",
"git add"
]
Expand Down
12 changes: 12 additions & 0 deletions tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig",
"exclude": ["node_modules", "src/**/*.test.ts"],
"include": ["src"],
"compilerOptions": {
"allowJs": false,
"declaration": true,
"declarationDir": "lib",
"emitDeclarationOnly": true,
"isolatedModules": false
}
}

0 comments on commit 7d046f9

Please sign in to comment.