Skip to content

Commit 1c4ebaa

Browse files
committed
Adding dts generation
This makes the library usable by other TypeScript projects.
1 parent 5b162cd commit 1c4ebaa

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

package.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,21 @@
33
"version": "0.0.1",
44
"description": "A starter project for TypeScript libraries",
55
"main": "index.js",
6+
"files": [
7+
"typescript-starter.d.ts",
8+
"**/*.js",
9+
"!build/**/*.js",
10+
"!coverage/**/*.js",
11+
"!node_modules/**/*.js"
12+
],
613
"scripts": {
7-
"clean": "rm -rf build coverage",
14+
"prebundle": "npm run compile && mv build/src/** .",
15+
"bundle": "dts-generator --name $npm_package_name --main index.d.ts --baseDir . --exclude node_modules/dts-generator/node_modules/typescript/bin/lib.es6.d.ts -out ${npm_package_name}.d.ts *.d.ts",
16+
"clean": "rm -rf build coverage *.js *.d.ts",
817
"precompile": "npm run clean",
9-
"compile": "find src test tools typings -name \"*.ts\" | xargs tsc --declaration --module commonjs --target es5 --noImplicitAny --outDir build",
18+
"compile": "find src test typings -name \"*.ts\" | xargs tsc --declaration --module commonjs --target es5 --noImplicitAny --outDir build",
1019
"prelint": "npm run compile",
11-
"lint": "find src test tools -name \"*.ts\" | sed 's/^/--file=/g' | xargs tslint --rules-dir build/tools/rules",
20+
"lint": "find src test -name \"*.ts\" | sed 's/^/--file=/g' | xargs tslint",
1221
"pretest": "npm run lint",
1322
"test": "mocha --reporter ${MOCHA_REPORTER-nyan} --slow 10 --ui tdd --recursive build/**/*_test.js",
1423
"typings": "tsd reinstall && tsd rebundle"
@@ -33,5 +42,8 @@
3342
"tsd": "^0.6.0-beta.5",
3443
"tslint": "^2.1.1",
3544
"typescript": "^1.4.1"
45+
},
46+
"typescript": {
47+
"definition": "typescript-starter.d.ts"
3648
}
3749
}

0 commit comments

Comments
 (0)