From 3cd75269e6ba3bbaa980eef2f1e466441f261c0b Mon Sep 17 00:00:00 2001 From: Borewit Date: Sun, 25 Nov 2018 21:36:36 +0100 Subject: [PATCH 1/2] Normalise tsconfig structure --- package.json | 17 +- src/tsconfig.json | 7 +- test/tsconfig.json | 9 +- tsconfig.json | 9 + yarn.lock | 478 +++++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 479 insertions(+), 41 deletions(-) create mode 100644 tsconfig.json diff --git a/package.json b/package.json index e0d5d57e..19f6899c 100644 --- a/package.json +++ b/package.json @@ -7,18 +7,18 @@ "url": "https://github.com/Borewit" }, "scripts": { - "build": "yarn run compile", + "clean": "del-cli lib/** src/**/*.js src/**/*.js.map src/**/*.d.ts test/**/*.js test/**/*.js.map", + "build": "npm run clean && npm run compile", "compile-src": "tsc -p src", "compile-test": "tsc -p test", - "compile": "yarn run compile-src && yarn run compile-test", - "prepare": "yarn run compile", + "compile": "npm run compile-src && yarn run compile-test", "lint-ts": "tslint 'src/**/*.ts' --exclude 'src/**/*.d.ts' 'test/**/*.ts' --exclude 'test/**/*.d.ts'", "lint-md": "remark -u preset-lint-recommended .", "lint": "npm run lint-md && npm run lint-ts", "test": "mocha --require ts-node/register test", "cover-test": "nyc npm run test", - "coveralls": "yarn run cover-test && nyc report --reporter=text-lcov | coveralls", - "start": "yarn run compile && yarn run lint && npm run cover-test" + "coveralls": "npm run cover-test && nyc report --reporter=text-lcov | coveralls", + "start": "npm run compile && npm run lint && npm run cover-test" }, "engines": { "node": ">=0.1.98" @@ -35,16 +35,17 @@ }, "devDependencies": { "@types/mocha": "^5.2.5", - "@types/node": "^10.12.0", + "@types/node": "^10.12.10", "chai": "^4.2.0", "coveralls": "^3.0.2", + "del-cli": "^1.1.0", "mocha": "^5.2.0", "nyc": "^13.1.0", - "remark-cli": "^6.0.0", + "remark-cli": "^6.0.1", "remark-preset-lint-recommended": "^3.0.2", "ts-node": "^7.0.1", "tslint": "^5.11.0", - "typescript": "^3.1.3" + "typescript": "^3.1.6" }, "keywords": [ "readable", diff --git a/src/tsconfig.json b/src/tsconfig.json index a2756074..67a6778c 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -1,12 +1,7 @@ { + "extends": "../tsconfig.json", "compilerOptions": { "sourceMap": false, - "inlineSources": false, - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "target": "es6", "outDir": "../lib" } } - diff --git a/test/tsconfig.json b/test/tsconfig.json index 5f281b26..e82a7a7c 100644 --- a/test/tsconfig.json +++ b/test/tsconfig.json @@ -1,11 +1,6 @@ { + "extends": "../tsconfig.json", "compilerOptions": { - "sourceMap": true, - "inlineSources": true, - "module": "commonjs", - "moduleResolution": "node", - "declaration": false, - "target": "es6" + "sourceMap": true } } - diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..32ed5988 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "inlineSources": false, + "module": "commonjs", + "moduleResolution": "node", + "target": "es6" + } +} + diff --git a/yarn.lock b/yarn.lock index 42688e5c..3b7b1518 100644 --- a/yarn.lock +++ b/yarn.lock @@ -84,9 +84,9 @@ version "5.2.5" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.5.tgz#8a4accfc403c124a0bafe8a9fc61a05ec1032073" -"@types/node@^10.12.0": - version "10.12.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.0.tgz#ea6dcbddbc5b584c83f06c60e82736d8fbb0c235" +"@types/node@^10.12.10": + version "10.12.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.10.tgz#4fa76e6598b7de3f0cb6ec3abacc4f59e5b3a2ce" abbrev@1: version "1.1.1" @@ -113,6 +113,12 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +ansi-align@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-2.0.0.tgz#c36aeccba563b89ceb556f3690f0b1d9e3547f7f" + dependencies: + string-width "^2.0.0" + ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -177,6 +183,20 @@ arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" +array-find-index@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" + +array-union@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" + dependencies: + array-uniq "^1.0.1" + +array-uniq@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" + array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" @@ -263,6 +283,18 @@ binary-extensions@^1.0.0: version "1.12.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.12.0.tgz#c2d780f53d45bba8317a8902d4ceeaf3a6385b14" +boxen@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/boxen/-/boxen-1.3.0.tgz#55c6c39a8ba58d9c61ad22cd877532deb665a20b" + dependencies: + ansi-align "^2.0.0" + camelcase "^4.0.0" + chalk "^2.0.1" + cli-boxes "^1.0.0" + string-width "^2.0.0" + term-size "^1.2.0" + widest-line "^2.0.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -320,11 +352,22 @@ caching-transform@^2.0.0: package-hash "^2.0.0" write-file-atomic "^2.0.0" +camelcase-keys@^2.0.0: + version "2.1.0" + resolved "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" + dependencies: + camelcase "^2.0.0" + map-obj "^1.0.0" + camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^4.1.0: +camelcase@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" + +camelcase@^4.0.0, camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" @@ -332,6 +375,10 @@ camelcase@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.0.0.tgz#03295527d58bd3cd4aa75363f35b2e8d97be2f42" +capture-stack-trace@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz#a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d" + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -368,7 +415,7 @@ chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.3.0: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" dependencies: @@ -419,6 +466,10 @@ chownr@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" +ci-info@^1.5.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" + class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -428,6 +479,10 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" +cli-boxes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" + cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -512,6 +567,17 @@ concat-stream@^1.5.1: readable-stream "^2.2.2" typedarray "^0.0.6" +configstore@^3.0.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" + dependencies: + dot-prop "^4.1.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + unique-string "^1.0.0" + write-file-atomic "^2.0.0" + xdg-basedir "^3.0.0" + console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -541,6 +607,12 @@ coveralls@^3.0.2: minimist "^1.2.0" request "^2.85.0" +create-error-class@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/create-error-class/-/create-error-class-3.0.2.tgz#06be7abef947a3f14a30fd610671d401bca8b7b6" + dependencies: + capture-stack-trace "^1.0.0" + cross-spawn@^4: version "4.0.2" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" @@ -556,6 +628,16 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" +crypto-random-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" + +currently-unhandled@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" + dependencies: + array-find-index "^1.0.1" + dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -578,7 +660,7 @@ debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: dependencies: ms "2.0.0" -decamelize@^1.0.0, decamelize@^1.1.1: +decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -621,6 +703,25 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" +del-cli@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/del-cli/-/del-cli-1.1.0.tgz#27557d69a0b7df99dcbaa1e34a09e6ac6591d2c4" + dependencies: + del "^3.0.0" + meow "^3.6.0" + update-notifier "^2.1.0" + +del@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" + dependencies: + globby "^6.1.0" + is-path-cwd "^1.0.0" + is-path-in-cwd "^1.0.0" + p-map "^1.1.1" + pify "^3.0.0" + rimraf "^2.2.8" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -637,13 +738,23 @@ diff@3.5.0, diff@^3.1.0, diff@^3.2.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" +dot-prop@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57" + dependencies: + is-obj "^1.0.0" + +duplexer3@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" + ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" dependencies: jsbn "~0.1.0" -error-ex@^1.3.1: +error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" dependencies: @@ -762,6 +873,13 @@ find-cache-dir@^2.0.0: make-dir "^1.0.0" pkg-dir "^3.0.0" +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" @@ -849,6 +967,10 @@ get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" +get-stdin@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -892,10 +1014,42 @@ glob@^7.0.3, glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" +global-dirs@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-0.1.1.tgz#b319c0dd4607f353f3be9cca4c72fc148c49f445" + dependencies: + ini "^1.3.4" + globals@^11.1.0: version "11.7.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" +globby@^6.1.0: + version "6.1.0" + resolved "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" + dependencies: + array-union "^1.0.1" + glob "^7.0.3" + object-assign "^4.0.1" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +got@^6.7.1: + version "6.7.1" + resolved "http://registry.npmjs.org/got/-/got-6.7.1.tgz#240cd05785a9a18e561dc1b44b41c763ef1e8db0" + dependencies: + create-error-class "^3.0.0" + duplexer3 "^0.1.4" + get-stream "^3.0.0" + is-redirect "^1.0.0" + is-retry-allowed "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + safe-buffer "^5.0.1" + timed-out "^4.0.0" + unzip-response "^2.0.1" + url-parse-lax "^1.0.0" + graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -998,10 +1152,20 @@ ignore@^3.2.0: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" +import-lazy@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" +indent-string@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-2.1.0.tgz#8e2d48348742121b4a8218b7a137e9a52049dc80" + dependencies: + repeating "^2.0.0" + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1013,7 +1177,7 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" -ini@~1.3.0: +ini@^1.3.4, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" @@ -1076,6 +1240,12 @@ is-builtin-module@^1.0.0: dependencies: builtin-modules "^1.0.0" +is-ci@^1.0.10: + version "1.2.1" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" + dependencies: + ci-info "^1.5.0" + is-data-descriptor@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" @@ -1126,6 +1296,12 @@ is-extglob@^2.1.0, is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" +is-finite@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" + dependencies: + number-is-nan "^1.0.0" + is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -1156,16 +1332,47 @@ is-hidden@^1.0.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-hidden/-/is-hidden-1.1.1.tgz#82ee6a93aeef3fb007ad5b9457c0584d45329f38" +is-installed-globally@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.1.0.tgz#0dfd98f5a9111716dd535dda6492f67bf3d25a80" + dependencies: + global-dirs "^0.1.0" + is-path-inside "^1.0.0" + +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" dependencies: kind-of "^3.0.2" +is-obj@^1.0.0: + version "1.0.1" + resolved "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + is-object@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.1.tgz#8952688c5ec2ffd6b03ecc85e769e02903083470" +is-path-cwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" + +is-path-in-cwd@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" + dependencies: + is-path-inside "^1.0.0" + +is-path-inside@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-1.0.1.tgz#8ef5b7de50437a3fdca6b4e865ef7aa55cb48036" + dependencies: + path-is-inside "^1.0.1" + is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -1176,7 +1383,15 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" -is-stream@^1.1.0: +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + +is-retry-allowed@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz#11a060568b67339444033d0125a61a20d564fb34" + +is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -1184,6 +1399,10 @@ is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + is-whitespace-character@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-whitespace-character/-/is-whitespace-character-1.0.2.tgz#ede53b4c6f6fb3874533751ec9280d01928d03ed" @@ -1338,6 +1557,12 @@ kind-of@^6.0.0, kind-of@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" +latest-version@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-3.1.0.tgz#a205383fea322b33b5ae3b18abee0dc2f356ee15" + dependencies: + package-json "^4.0.0" + lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" @@ -1352,6 +1577,16 @@ lcov-parse@^0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/lcov-parse/-/lcov-parse-0.0.10.tgz#1b0b8ff9ac9c7889250582b70b71315d9da6d9a3" +load-json-file@^1.0.0: + version "1.1.0" + resolved "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" + load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" @@ -1406,6 +1641,17 @@ longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" +loud-rejection@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f" + dependencies: + currently-unhandled "^0.4.1" + signal-exit "^3.0.0" + +lowercase-keys@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f" + lru-cache@^4.0.1: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" @@ -1427,6 +1673,10 @@ map-cache@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" +map-obj@^1.0.0, map-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-1.0.1.tgz#d933ceb9205d82bdcf4886f6742bdc2b4dea146d" + map-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" @@ -1479,6 +1729,21 @@ mem@^1.1.0: dependencies: mimic-fn "^1.0.0" +meow@^3.6.0: + version "3.7.0" + resolved "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" + dependencies: + camelcase-keys "^2.0.0" + decamelize "^1.1.2" + loud-rejection "^1.0.0" + map-obj "^1.0.1" + minimist "^1.1.3" + normalize-package-data "^2.3.4" + object-assign "^4.0.1" + read-pkg-up "^1.0.1" + redent "^1.0.0" + trim-newlines "^1.0.0" + merge-source-map@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.1.0.tgz#2fdde7e6020939f70906a68f2d7ae685e4c8c646" @@ -1527,7 +1792,7 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@^1.2.0: +minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -1631,7 +1896,7 @@ nopt@^4.0.1: abbrev "1" osenv "^0.1.4" -normalize-package-data@^2.3.2: +normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" dependencies: @@ -1718,7 +1983,7 @@ oauth-sign@~0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^4.1.0: +object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -1806,6 +2071,10 @@ p-locate@^3.0.0: dependencies: p-limit "^2.0.0" +p-map@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" + p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" @@ -1823,6 +2092,15 @@ package-hash@^2.0.0: md5-hex "^2.0.0" release-zalgo "^1.0.0" +package-json@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" + dependencies: + got "^6.7.1" + registry-auth-token "^3.0.1" + registry-url "^3.0.3" + semver "^5.1.0" + parse-entities@^1.0.2, parse-entities@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.0.tgz#9deac087661b2e36814153cb78d7e54a4c5fd6f4" @@ -1834,6 +2112,12 @@ parse-entities@^1.0.2, parse-entities@^1.1.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" @@ -1849,6 +2133,12 @@ path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -1857,6 +2147,10 @@ path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" +path-is-inside@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + path-key@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -1865,6 +2159,14 @@ path-parse@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" @@ -1879,10 +2181,24 @@ performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" +pify@^2.0.0: + version "2.3.0" + resolved "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + pify@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + pkg-dir@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" @@ -1899,6 +2215,10 @@ posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" +prepend-http@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" @@ -1915,7 +2235,7 @@ qs@~6.5.1: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" -rc@^1.1.0, rc@^1.2.7: +rc@^1.0.1, rc@^1.1.0, rc@^1.1.6, rc@^1.2.7: version "1.2.8" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" dependencies: @@ -1924,6 +2244,13 @@ rc@^1.1.0, rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" + dependencies: + find-up "^1.0.0" + read-pkg "^1.0.0" + read-pkg-up@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" @@ -1931,6 +2258,14 @@ read-pkg-up@^4.0.0: find-up "^3.0.0" read-pkg "^3.0.0" +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + read-pkg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" @@ -1959,6 +2294,13 @@ readdirp@^2.0.0: micromatch "^3.1.10" readable-stream "^2.0.2" +redent@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" + dependencies: + indent-string "^2.1.0" + strip-indent "^1.0.1" + regex-not@^1.0.0, regex-not@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" @@ -1966,15 +2308,28 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +registry-auth-token@^3.0.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.3.2.tgz#851fd49038eecb586911115af845260eec983f20" + dependencies: + rc "^1.1.6" + safe-buffer "^5.0.1" + +registry-url@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + dependencies: + rc "^1.0.1" + release-zalgo@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" dependencies: es6-error "^4.0.1" -remark-cli@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/remark-cli/-/remark-cli-6.0.0.tgz#4d5044862610970be1e627662f1d703f1c61fc08" +remark-cli@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/remark-cli/-/remark-cli-6.0.1.tgz#ace67b94c05df0516b6be8dd70f326b6fa9c3770" dependencies: markdown-extensions "^1.1.0" remark "^10.0.0" @@ -2210,6 +2565,12 @@ repeat-string@^1.5.0, repeat-string@^1.5.2, repeat-string@^1.5.4, repeat-string@ version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + dependencies: + is-finite "^1.0.0" + replace-ext@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" @@ -2271,7 +2632,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@^2.6.1, rimraf@^2.6.2: +rimraf@^2.2.8, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -2295,10 +2656,20 @@ sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + dependencies: + semver "^5.0.3" + "semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" +semver@^5.0.3, semver@^5.1.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -2516,6 +2887,12 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -2524,6 +2901,12 @@ strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" +strip-indent@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/strip-indent/-/strip-indent-1.0.1.tgz#0c7962a6adefa7bbd4ac366460a638552ae1a0a2" + dependencies: + get-stdin "^4.0.1" + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -2550,6 +2933,12 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" +term-size@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/term-size/-/term-size-1.2.0.tgz#458b83887f288fc56d6fffbfad262e26638efa69" + dependencies: + execa "^0.7.0" + test-exclude@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.0.0.tgz#cdce7cece785e0e829cd5c2b27baf18bc583cfb7" @@ -2563,6 +2952,10 @@ text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +timed-out@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -2602,6 +2995,10 @@ tough-cookie@~2.3.3: dependencies: punycode "^1.4.1" +trim-newlines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" + trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" @@ -2676,9 +3073,9 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.3.tgz#01b70247a6d3c2467f70c45795ef5ea18ce191d5" +typescript@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.6.tgz#b6543a83cfc8c2befb3f4c8fba6896f5b0c9be68" uglify-js@^2.6: version "2.8.29" @@ -2771,6 +3168,12 @@ union-value@^1.0.0: is-extendable "^0.1.1" set-value "^0.4.3" +unique-string@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-1.0.0.tgz#9e1057cca851abb93398f8b33ae187b99caec11a" + dependencies: + crypto-random-string "^1.0.0" + unist-util-generated@^1.1.0: version "1.1.2" resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.2.tgz#8b993f9239d8e560be6ee6e91c3f7b7208e5ce25" @@ -2824,14 +3227,39 @@ untildify@^2.1.0: dependencies: os-homedir "^1.0.0" +unzip-response@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" + upath@^1.0.5: version "1.1.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" +update-notifier@^2.1.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-2.5.0.tgz#d0744593e13f161e406acb1d9408b72cad08aff6" + dependencies: + boxen "^1.2.1" + chalk "^2.0.1" + configstore "^3.0.0" + import-lazy "^2.1.0" + is-ci "^1.0.10" + is-installed-globally "^0.1.0" + is-npm "^1.0.0" + latest-version "^3.0.0" + semver-diff "^2.0.0" + xdg-basedir "^3.0.0" + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" +url-parse-lax@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-1.0.0.tgz#7af8f303645e9bd79a272e7a14ac68bc0609da73" + dependencies: + prepend-http "^1.0.1" + use@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" @@ -2908,6 +3336,12 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.2 || 2" +widest-line@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-2.0.1.tgz#7438764730ec7ef4381ce4df82fb98a53142a3fc" + dependencies: + string-width "^2.1.1" + window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" @@ -2950,6 +3384,10 @@ x-is-string@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" +xdg-basedir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" + xtend@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" From 3ae44a910cdfc61db2eee9475f0b057fef132914 Mon Sep 17 00:00:00 2001 From: Borewit Date: Sun, 25 Nov 2018 21:25:03 +0100 Subject: [PATCH 2/2] Use async/await --- .travis.yml | 6 ++- README.md | 2 + package.json | 8 +-- src/index.ts | 44 +++++++-------- test/test.ts | 148 +++++++++++++++++++++++++-------------------------- test/util.ts | 6 +-- tslint.json | 2 +- 7 files changed, 111 insertions(+), 105 deletions(-) diff --git a/.travis.yml b/.travis.yml index 309f9486..060744fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,5 +17,9 @@ script: jobs: include: - stage: after_success - script: yarn run coveralls + script: + - yarn install + - yarn run compile + - yarn run test-coverage + - yarn run send-coveralls node_js: 9 diff --git a/README.md b/README.md index 70c69918..6de5ef5a 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/8a89b90858734a6da07570eaf2e89849)](https://www.codacy.com/app/Borewit/then-read-stream?utm_source=github.com&utm_medium=referral&utm_content=Borewit/then-read-stream&utm_campaign=Badge_Grade) [![Known Vulnerabilities](https://snyk.io/test/github/Borewit/then-read-stream/badge.svg?targetFile=package.json)](https://snyk.io/test/github/Borewit/then-read-stream?targetFile=package.json) +# then-read-stream + A promise based asynchronous stream reader, which makes reading from a stream easy. Allows to read from a [Readable Stream](https://nodejs.org/api/stream.html#stream_readable_streams) diff --git a/package.json b/package.json index 19f6899c..547cfe5c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://github.com/Borewit" }, "scripts": { - "clean": "del-cli lib/** src/**/*.js src/**/*.js.map src/**/*.d.ts test/**/*.js test/**/*.js.map", + "clean": "del-cli lib/** src/**/*.js src/**/*.js.map src/**/*.d.ts test/**/*.js test/**/*.js.map coverage .nyc_output", "build": "npm run clean && npm run compile", "compile-src": "tsc -p src", "compile-test": "tsc -p test", @@ -16,8 +16,8 @@ "lint-md": "remark -u preset-lint-recommended .", "lint": "npm run lint-md && npm run lint-ts", "test": "mocha --require ts-node/register test", - "cover-test": "nyc npm run test", - "coveralls": "npm run cover-test && nyc report --reporter=text-lcov | coveralls", + "test-coverage": "nyc npm run test", + "send-coveralls": "nyc report --reporter=text-lcov | coveralls", "start": "npm run compile && npm run lint && npm run cover-test" }, "engines": { @@ -28,7 +28,7 @@ "url": "https://github.com/Borewit/then-read-stream" }, "license": "MIT", - "main": "./lib/index.js", + "main": "./lib/index", "typings": "lib/index", "bugs": { "url": "https://github.com/Borewit/then-read-stream/issues" diff --git a/src/index.ts b/src/index.ts index 8022ced3..0a3ba1bc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ -import * as assert from "assert"; -import * as stream from "stream"; +import * as assert from 'assert'; +import * as stream from 'stream'; interface IReadRequest { buffer: Buffer | Uint8Array, @@ -26,7 +26,7 @@ class Deferred { /** * Error message */ -export const endOfStream = "End-Of-Stream"; +export const endOfStream = 'End-Of-Stream'; export class StreamReader { @@ -45,9 +45,9 @@ export class StreamReader { public constructor(private s: stream.Readable) { if (!s.read || !s.once) { - throw new Error("Expected an instance of stream.Readable"); + throw new Error('Expected an instance of stream.Readable'); } - this.s.once("end", () => { + this.s.once('end', () => { this.endOfStream = true; if (this.request) { this.request.deferred.reject(new Error(endOfStream)); @@ -64,11 +64,10 @@ export class StreamReader { * @param position Source offset * @returns {any} */ - public peek(buffer: Buffer | Uint8Array, offset: number, length: number): Promise { - return this.read(buffer, offset, length).then(bytesRead => { - this.peekQueue.unshift(buffer.slice(offset, bytesRead) as Buffer); - return bytesRead; - }); + public async peek(buffer: Buffer | Uint8Array, offset: number, length: number): Promise { + const bytesRead = await this.read(buffer, offset, length); + this.peekQueue.unshift(buffer.slice(offset, bytesRead) as Buffer); + return bytesRead; } /** @@ -78,9 +77,9 @@ export class StreamReader { * @param length Number of bytes to read * @returns {any} */ - public read(buffer: Buffer | Uint8Array, offset: number, length: number): Promise { + public async read(buffer: Buffer | Uint8Array, offset: number, length: number): Promise { if (length === 0) { - return Promise.resolve(0); + return 0; } if (this.peekQueue.length > 0) { const peekData = this.peekQueue.shift(); @@ -89,16 +88,17 @@ export class StreamReader { if (length < peekData.length) { this.peekQueue.unshift(peekData.slice(length)); } - return Promise.resolve(length); + return length; } else { peekData.copy(buffer as Buffer, offset); - return this.read(buffer, offset + peekData.length, length - peekData.length).then(bytesRead => { + try { + const bytesRead = await this.read(buffer, offset + peekData.length, length - peekData.length); return peekData.length + bytesRead; - }).catch(err => { + } catch (err) { if (err.message === endOfStream) { return peekData.length; // Return partial read } else throw err; - }); + } } } else { return this._read(buffer, offset, length); @@ -112,19 +112,19 @@ export class StreamReader { * @param length Number of bytes to read * @returns {any} */ - private _read(buffer: Buffer | Uint8Array, offset: number, length: number): Promise { + private async _read(buffer: Buffer | Uint8Array, offset: number, length: number): Promise { - assert.ok(!this.request, "Concurrent read operation?"); + assert.ok(!this.request, 'Concurrent read operation?'); if (this.endOfStream) { - return Promise.reject(new Error(endOfStream)); + throw new Error(endOfStream); } const readBuffer = this.s.read(length); if (readBuffer) { readBuffer.copy(buffer, offset); - return Promise.resolve(readBuffer.length); + return readBuffer.length; } else { this.request = { buffer, @@ -132,7 +132,7 @@ export class StreamReader { length, deferred: new Deferred() }; - this.s.once("readable", () => { + this.s.once('readable', () => { this.tryRead(); }); return this.request.deferred.promise.then(n => { @@ -151,7 +151,7 @@ export class StreamReader { readBuffer.copy(this.request.buffer, this.request.offset); this.request.deferred.resolve(readBuffer.length); } else { - this.s.once("readable", () => { + this.s.once('readable', () => { this.tryRead(); }); } diff --git a/test/test.ts b/test/test.ts index f8a2e677..996ab333 100644 --- a/test/test.ts +++ b/test/test.ts @@ -1,14 +1,14 @@ -import {assert, expect} from "chai"; -import {EventEmitter} from "events"; -import * as fs from "fs"; -import * as Path from "path"; -import {Readable} from "stream"; -import {endOfStream, StreamReader} from "../src"; -import {SourceStream} from "./util"; +import { assert, expect } from 'chai'; +import { EventEmitter } from 'events'; +import * as fs from 'fs'; +import * as Path from 'path'; +import { Readable } from 'stream'; +import { endOfStream, StreamReader } from '../src'; +import { SourceStream } from './util'; -describe("StreamReader", () => { +describe('StreamReader', () => { - it("should throw an exception if constructor argument is not a stream", () => { + it('should throw an exception if constructor argument is not a stream', () => { class MyEmitter extends EventEmitter { } @@ -17,55 +17,55 @@ describe("StreamReader", () => { expect(() => { const s = new StreamReader(not_a_stream as any); - }).to.throw("Expected an instance of stream.Readable"); + }).to.throw('Expected an instance of stream.Readable'); }); - it("should be able to handle 0 byte read request", () => { + it('should be able to handle 0 byte read request', () => { - const streamReader = new StreamReader(new SourceStream("abcdefg")); + const streamReader = new StreamReader(new SourceStream('abcdefg')); const buf = Buffer.alloc(0); return streamReader.read(buf, 0, 0).then(bytesRead => { - assert.equal(bytesRead, 0, "Should return"); + assert.equal(bytesRead, 0, 'Should return'); }); }); - describe("read from a streamed data chunk", () => { + describe('read from a streamed data chunk', () => { - const sourceStream = new SourceStream("\x05peter"); + const sourceStream = new SourceStream('\x05peter'); const streamReader = new StreamReader(sourceStream); - it("read only one byte from the chunk", () => { + it('read only one byte from the chunk', () => { const buf = Buffer.alloc(1); return streamReader.read(buf, 0, 1).then(bytesRead => { - assert.equal(bytesRead, 1, "Should read exactly one byte"); - assert.equal(buf[0], 5, "0x05 == 5"); + assert.equal(bytesRead, 1, 'Should read exactly one byte'); + assert.equal(buf[0], 5, '0x05 == 5'); }); }); - it("should decode string from chunk", () => { + it('should decode string from chunk', () => { const buf = Buffer.alloc(5); return streamReader.read(buf, 0, 5).then(bytesRead => { - assert.equal(bytesRead, 5, "Should read 5 bytes"); - assert.equal(buf.toString(), "peter"); + assert.equal(bytesRead, 5, 'Should read 5 bytes'); + assert.equal(buf.toString(), 'peter'); }); }); - it("should should reject at the end of the stream", () => { + it('should should reject at the end of the stream', () => { const buf = Buffer.alloc(1); return streamReader.read(buf, 0, 1).then(() => { - assert.fail("Should reject due to end-of-stream"); + assert.fail('Should reject due to end-of-stream'); }).catch(err => { assert.equal(err.message, endOfStream); }); }); }); - describe("concurrent reads", () => { + describe('concurrent reads', () => { function readByteAsNumber(sr: StreamReader): Promise { const buf = Buffer.alloc(1); @@ -74,9 +74,9 @@ describe("StreamReader", () => { }); } - it("should support concurrent reads", () => { + it('should support concurrent reads', () => { - const sourceStream = new SourceStream("\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09"); + const sourceStream = new SourceStream('\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09'); const streamReader = new StreamReader(sourceStream); const prom: Array> = []; @@ -94,7 +94,7 @@ describe("StreamReader", () => { }); }); - describe("disjoint", () => { + describe('disjoint', () => { const TESTTAB = [ [1, 1, 1, 1], @@ -126,11 +126,11 @@ describe("StreamReader", () => { this.nvals = Math.floor(len / 4); - let data = ""; + let data = ''; for (let i = 0; i < this.nvals + 1; i++) { - data += "\x01\x02\x03\x04"; + data += '\x01\x02\x03\x04'; } - this.buf = Buffer.from(data, "binary"); + this.buf = Buffer.from(data, 'binary'); } public _read() { @@ -164,80 +164,80 @@ describe("StreamReader", () => { }); }; - it("should parse disjoint", () => { + it('should parse disjoint', () => { return run(); }); }); - describe("peek", () => { + describe('peek', () => { - it("should be able to read a peeked chunk", () => { + it('should be able to read a peeked chunk', () => { - const sourceStream = new SourceStream("\x05peter"); + const sourceStream = new SourceStream('\x05peter'); const streamReader = new StreamReader(sourceStream); const buf = Buffer.alloc(1); return streamReader.peek(buf, 0, 1) .then(bytesRead => { - assert.equal(bytesRead, 1, "Should peek exactly one byte"); - assert.equal(buf[0], 5, "0x05 == 5"); + assert.equal(bytesRead, 1, 'Should peek exactly one byte'); + assert.equal(buf[0], 5, '0x05 == 5'); return streamReader.read(buf, 0, 1); }) .then(bytesRead => { - assert.equal(bytesRead, 1, "Should re-read the peaked byte"); - assert.equal(buf[0], 5, "0x05 == 5"); + assert.equal(bytesRead, 1, 'Should re-read the peaked byte'); + assert.equal(buf[0], 5, '0x05 == 5'); }); }); - it("should be able to read a larger chunk overlapping the peeked chunk", () => { + it('should be able to read a larger chunk overlapping the peeked chunk', () => { - const sourceStream = new SourceStream("\x05peter"); + const sourceStream = new SourceStream('\x05peter'); const streamReader = new StreamReader(sourceStream); const buf = Buffer.alloc(6).fill(0); return streamReader.peek(buf, 0, 1) .then(bytesRead => { - assert.equal(bytesRead, 1, "Should peek exactly one byte"); - assert.equal(buf[0], 5, "0x05 == 5"); + assert.equal(bytesRead, 1, 'Should peek exactly one byte'); + assert.equal(buf[0], 5, '0x05 == 5'); return streamReader.read(buf, 0, 6); }) .then(bytesRead => { - assert.equal(bytesRead, 6, "Should overlap the peaked byte"); - assert.equal(buf, "\x05peter"); + assert.equal(bytesRead, 6, 'Should overlap the peaked byte'); + assert.equal(buf, '\x05peter'); }); }); - it("should be able to read a smaller chunk then the overlapping peeked chunk", () => { + it('should be able to read a smaller chunk then the overlapping peeked chunk', () => { - const sourceStream = new SourceStream("\x05peter"); + const sourceStream = new SourceStream('\x05peter'); const streamReader = new StreamReader(sourceStream); const buf = Buffer.alloc(6).fill(0); return streamReader.peek(buf, 0, 2) .then(bytesRead => { - assert.equal(bytesRead, 2, "Should peek 2 bytes"); - assert.equal(buf[0], 5, "0x05 == 5"); + assert.equal(bytesRead, 2, 'Should peek 2 bytes'); + assert.equal(buf[0], 5, '0x05 == 5'); return streamReader.read(buf, 0, 1); }) .then(bytesRead => { - assert.equal(bytesRead, 1, "Should read only 1 byte"); - assert.equal(buf[0], 5, "0x05 == 5"); + assert.equal(bytesRead, 1, 'Should read only 1 byte'); + assert.equal(buf[0], 5, '0x05 == 5'); return streamReader.read(buf, 1, 5); }) .then(bytesRead => { - assert.equal(bytesRead, 5, "Should read remaining 5 byte"); - assert.equal(buf, "\x05peter"); + assert.equal(bytesRead, 5, 'Should read remaining 5 byte'); + assert.equal(buf, '\x05peter'); }); }); - it("should be able to handle overlapping peeks", () => { + it('should be able to handle overlapping peeks', () => { - const sourceStream = new SourceStream("\x01\x02\x03\x04\x05"); + const sourceStream = new SourceStream('\x01\x02\x03\x04\x05'); const streamReader = new StreamReader(sourceStream); const peekBufferShort = Buffer.alloc(1); @@ -247,48 +247,48 @@ describe("StreamReader", () => { return streamReader.peek(peekBuffer, 0, 3) // Peek #1 .then(len => { assert.equal(3, len); - assert.deepEqual(peekBuffer, Buffer.from("\x01\x02\x03", "binary"), "Peek #1"); + assert.deepEqual(peekBuffer, Buffer.from('\x01\x02\x03', 'binary'), 'Peek #1'); return streamReader.peek(peekBufferShort, 0, 1); // Peek #2 }).then(len => { assert.equal(1, len); - assert.deepEqual(peekBufferShort, Buffer.from("\x01", "binary"), "Peek #2"); + assert.deepEqual(peekBufferShort, Buffer.from('\x01', 'binary'), 'Peek #2'); return streamReader.read(readBuffer, 0, 1); // Read #1 }).then(len => { assert.equal(len, 1); - assert.deepEqual(readBuffer, Buffer.from("\x01", "binary"), "Read #1"); + assert.deepEqual(readBuffer, Buffer.from('\x01', 'binary'), 'Read #1'); return streamReader.peek(peekBuffer, 0, 3); // Peek #3 }).then(len => { assert.equal(len, 3); - assert.deepEqual(peekBuffer, Buffer.from("\x02\x03\x04", "binary"), "Peek #3"); + assert.deepEqual(peekBuffer, Buffer.from('\x02\x03\x04', 'binary'), 'Peek #3'); return streamReader.read(readBuffer, 0, 1); // Read #2 }).then(len => { assert.equal(len, 1); - assert.deepEqual(readBuffer, Buffer.from("\x02", "binary"), "Read #2"); + assert.deepEqual(readBuffer, Buffer.from('\x02', 'binary'), 'Read #2'); return streamReader.peek(peekBuffer, 0, 3); // Peek #3 }).then(len => { assert.equal(len, 3); - assert.deepEqual(peekBuffer, Buffer.from("\x03\x04\x05", "binary"), "Peek #3"); + assert.deepEqual(peekBuffer, Buffer.from('\x03\x04\x05', 'binary'), 'Peek #3'); return streamReader.read(readBuffer, 0, 1); // Read #3 }).then(len => { assert.equal(len, 1); - assert.deepEqual(readBuffer, Buffer.from("\x03", "binary"), "Read #3"); + assert.deepEqual(readBuffer, Buffer.from('\x03', 'binary'), 'Read #3'); return streamReader.peek(peekBuffer, 0, 3); // Peek #4 }).then(len => { - assert.equal(len, 2, "3 bytes requested to peek, only 2 bytes left"); - assert.deepEqual(peekBuffer, Buffer.from("\x04\x05\x05", "binary"), "Peek #4"); + assert.equal(len, 2, '3 bytes requested to peek, only 2 bytes left'); + assert.deepEqual(peekBuffer, Buffer.from('\x04\x05\x05', 'binary'), 'Peek #4'); return streamReader.read(readBuffer, 0, 1); // Read #4 }).then(len => { assert.equal(len, 1); - assert.deepEqual(readBuffer, Buffer.from("\x04", "binary"), "Read #4"); + assert.deepEqual(readBuffer, Buffer.from('\x04', 'binary'), 'Read #4'); }); }); }); - describe("EndOfStream Error", () => { + describe('EndOfStream Error', () => { - it("should not throw an EndOfStream Error if we read exactly until the end of the stream", () => { + it('should not throw an EndOfStream Error if we read exactly until the end of the stream', () => { - const sourceStream = new SourceStream("\x89\x54\x40"); + const sourceStream = new SourceStream('\x89\x54\x40'); const streamReader = new StreamReader(sourceStream); const res = Buffer.alloc(3); @@ -299,31 +299,31 @@ describe("StreamReader", () => { }); }); - it("should return a partial result from a stream if EOF is reached", () => { + it('should return a partial result from a stream if EOF is reached', () => { - const sourceStream = new SourceStream("\x89\x54\x40"); + const sourceStream = new SourceStream('\x89\x54\x40'); const streamReader = new StreamReader(sourceStream); const res = Buffer.alloc(4); return streamReader.peek(res, 0, 4) .then(len => { - assert.equal(3, len, "should indicate only 3 bytes are actually peeked"); + assert.equal(3, len, 'should indicate only 3 bytes are actually peeked'); return streamReader.read(res, 0, 4); }).then(len => { - assert.equal(3, len, "should indicate only 3 bytes are actually read"); + assert.equal(3, len, 'should indicate only 3 bytes are actually read'); }); }); }); - describe("file-stream", () => { + describe('file-stream', () => { - const path_test3 = Path.join(__dirname, "resources", "test3.dat"); + const path_test3 = Path.join(__dirname, 'resources', 'test3.dat'); const fileSize = 5; const buf = Buffer.alloc(17); - it("should return a partial size, if full length cannot be read", () => { + it('should return a partial size, if full length cannot be read', () => { const fileReadStream = fs.createReadStream(path_test3); const streamReader = new StreamReader(fileReadStream); return streamReader.read(buf, 0, 17).then(actualRead => { diff --git a/test/util.ts b/test/util.ts index 9a3aaf60..21478b38 100644 --- a/test/util.ts +++ b/test/util.ts @@ -1,6 +1,6 @@ // Utilities for testing -import {Readable} from "stream"; +import { Readable } from 'stream'; /** * A mock readable-stream, using string to read from @@ -9,10 +9,10 @@ export class SourceStream extends Readable { private buf: Buffer; - constructor(private str: string = "") { + constructor(private str: string = '') { super(); - this.buf = Buffer.from(str, "binary"); + this.buf = Buffer.from(str, 'binary'); } public _read() { diff --git a/tslint.json b/tslint.json index ad95ae3a..3e11d91a 100644 --- a/tslint.json +++ b/tslint.json @@ -4,7 +4,7 @@ "curly": false, "max-classes-per-file": [false], "semicolon": [true, "always", "ignore-interfaces"], - "quotemark": [true, "double", "avoid-escape"], + "quotemark": [true, "single", "avoid-escape"], "no-bitwise": false, "trailing-comma": [true, {"multiline": "never", "singleline": "never"}], "object-literal-key-quotes": [true, "as-needed"],