Merge pull request #187 from dolanmiu/feat/clean-imports

Feat/clean imports
This commit is contained in:
Dolan
2018-10-26 21:00:42 +01:00
committed by GitHub
6 changed files with 47 additions and 6 deletions

7
.gitignore vendored
View File

@ -58,5 +58,8 @@ yarn.lock
# Documents # Documents
My Document.docx My Document.docx
# Temporary folder # Temporary folder
tmp tmp
# nyc
.nyc_output

25
.nycrc Normal file
View File

@ -0,0 +1,25 @@
{
"check-coverage": true,
"lines": 84.56,
"functions": 77.50,
"branches": 71.40,
"statements": 84.30,
"include": [
"src/**/*.ts"
],
"exclude": [
"src/**/*.spec.ts"
],
"reporter": [
"lcov",
"text",
"json"
],
"extension": [
".ts"
],
"cache": true,
"all": true,
"instrument": false,
"sourceMap": true
}

View File

@ -6,7 +6,7 @@ install:
- npm install -g codecov - npm install -g codecov
script: script:
- npm run lint - npm run lint
- npm test - npm run test.coverage
- npm run style - npm run style
- npm run build - npm run build
- npm run ts-node -- ./demo/demo1.ts - npm run ts-node -- ./demo/demo1.ts

View File

@ -15,6 +15,7 @@
[![Known Vulnerabilities][snky-image]][snky-url] [![Known Vulnerabilities][snky-image]][snky-url]
[![Chat on Gitter][gitter-image]][gitter-url] [![Chat on Gitter][gitter-image]][gitter-url]
[![PRs Welcome][pr-image]][pr-url] [![PRs Welcome][pr-image]][pr-url]
[![codecov][codecov-image]][codecov-url]
<p align="center"> <p align="center">
<img src="https://i.imgur.com/H5FA1Qy.gif" alt="drawing" width="800"/> <img src="https://i.imgur.com/H5FA1Qy.gif" alt="drawing" width="800"/>
@ -81,3 +82,5 @@ Made with 💖
[gitter-url]: https://gitter.im/docx-lib/Lobby [gitter-url]: https://gitter.im/docx-lib/Lobby
[pr-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg [pr-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
[pr-url]: http://makeapullrequest.com [pr-url]: http://makeapullrequest.com
[codecov-image]: https://codecov.io/gh/dolanmiu/docx/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/dolanmiu/docx

View File

@ -6,17 +6,17 @@
"scripts": { "scripts": {
"pretest": "rimraf ./build", "pretest": "rimraf ./build",
"test": "mocha-webpack \"src/**/*.ts\"", "test": "mocha-webpack \"src/**/*.ts\"",
"test-watch": "mocha-webpack \"src/**/*.ts\" --watch", "test.coverage": "nyc npm test",
"test.watch": "npm test -- --watch",
"prepublishOnly": "npm run build", "prepublishOnly": "npm run build",
"lint": "tslint --project .", "lint": "tslint --project .",
"build": "npm run webpack && npm run fix-types", "build": "npm run webpack && npm run fix-types",
"tsc": "rimraf ./build && tsc -p .", "tsc": "rimraf ./build && tsc -p .",
"webpack": "rimraf ./build && webpack", "webpack": "rimraf ./build && webpack",
"build.web": "webpack --config webpack.web.config.js",
"demo": "npm run build && npm run ts-node ./demo", "demo": "npm run build && npm run ts-node ./demo",
"typedoc": "typedoc src/index.ts", "typedoc": "typedoc src/index.ts",
"style": "prettier -l \"src/**/*.ts\"", "style": "prettier -l \"src/**/*.ts\"",
"style.fix": "prettier \"src/**/*.ts\" --write", "style.fix": "npm run style -- --write",
"fix-types": "node types-absolute-fixer.js", "fix-types": "node types-absolute-fixer.js",
"ts-node": "ts-node" "ts-node": "ts-node"
}, },
@ -67,9 +67,11 @@
"awesome-typescript-loader": "^3.4.1", "awesome-typescript-loader": "^3.4.1",
"chai": "^3.5.0", "chai": "^3.5.0",
"glob": "^7.1.2", "glob": "^7.1.2",
"istanbul-instrumenter-loader": "^3.0.1",
"jszip": "^3.1.5", "jszip": "^3.1.5",
"mocha": "^5.2.0", "mocha": "^5.2.0",
"mocha-webpack": "^1.0.1", "mocha-webpack": "^1.0.1",
"nyc": "^13.1.0",
"pre-commit": "^1.2.2", "pre-commit": "^1.2.2",
"prettier": "^1.12.1", "prettier": "^1.12.1",
"prompt": "^1.0.0", "prompt": "^1.0.0",

View File

@ -20,6 +20,14 @@ module.exports = {
test: /\.ts$/, test: /\.ts$/,
loaders: ["awesome-typescript-loader"], loaders: ["awesome-typescript-loader"],
}, },
{
// For coverage testing
test: /\.(ts)/,
include: path.resolve("src"),
loader: "istanbul-instrumenter-loader",
enforce: "post",
exclude: [/node_modules/],
}
], ],
}, },