Make npm install -g . work
This commit is contained in:
parent
e80b28c10d
commit
143ac3399c
3 changed files with 27 additions and 5 deletions
|
@ -8,10 +8,9 @@
|
|||
"typescript-doctest": "dist/src/main.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc src/main.ts",
|
||||
"test": "ts-node test/*ts src/*doctest.ts | tap-diff",
|
||||
"avatest": "tsc && ava dist/test/*js dist/src/*doctest.js",
|
||||
"avatest:watch": "tsc --watch & ava --watch dist/test dist/src/*doctest*",
|
||||
"build": "tsc",
|
||||
"test": "tsc && ts-node src/main.ts --ava src/*ts && ava dist/test/*js dist/src/*doctest.js",
|
||||
"test:watch": "tsc --watch & ts-node src/main.ts --watch --ava src/*ts & tsc --watch & ava --watch dist/test dist/src/*doctest*",
|
||||
"coverage": "tsc && nyc ava dist/test",
|
||||
"prettier": "prettier --list-different --write src/*ts* test/*ts*"
|
||||
},
|
||||
|
@ -32,6 +31,7 @@
|
|||
"homepage": "https://github.com/danr/typescript-doctest#readme",
|
||||
"dependencies": {
|
||||
"chokidar": "^2.0.1",
|
||||
"global": "^4.3.2",
|
||||
"minimist": "^1.2.0",
|
||||
"typescript": "^2.7.1"
|
||||
},
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env node
|
||||
import * as fs from 'fs'
|
||||
import * as chokidar from 'chokidar'
|
||||
import * as minimist from 'minimist'
|
||||
|
@ -175,7 +176,7 @@ function instrument(d: ShowScript, file: string): void {
|
|||
const tests = Doctests(d, buffer)
|
||||
const outfile = path.format({...u, ext: '.doctest' + ext})
|
||||
console.log('Writing', outfile)
|
||||
fs.writeFileSync(outfile, d.showImports + '\n' + buffer + '\n' + tests)
|
||||
fs.writeFileSync(outfile, buffer + '\n' + d.showImports + '\n' + tests)
|
||||
}
|
||||
|
||||
function Doctests(d: ShowScript, buffer: string): string {
|
||||
|
|
21
yarn.lock
21
yarn.lock
|
@ -1140,6 +1140,10 @@ diff@^2.2.1:
|
|||
version "2.2.3"
|
||||
resolved "https://registry.npmjs.org/diff/-/diff-2.2.3.tgz#60eafd0d28ee906e4e8ff0a52c1229521033bf99"
|
||||
|
||||
dom-walk@^0.1.0:
|
||||
version "0.1.1"
|
||||
resolved "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.1.tgz#672226dc74c8f799ad35307df936aba11acd6018"
|
||||
|
||||
dot-prop@^4.1.0:
|
||||
version "4.2.0"
|
||||
resolved "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz#1f19e0c2e1aa0e32797c49799f2837ac6af69c57"
|
||||
|
@ -1537,6 +1541,13 @@ global-dirs@^0.1.0:
|
|||
dependencies:
|
||||
ini "^1.3.4"
|
||||
|
||||
global@^4.3.2:
|
||||
version "4.3.2"
|
||||
resolved "https://registry.npmjs.org/global/-/global-4.3.2.tgz#e76989268a6c74c38908b1305b10fc0e394e9d0f"
|
||||
dependencies:
|
||||
min-document "^2.19.0"
|
||||
process "~0.5.1"
|
||||
|
||||
globals@^9.18.0:
|
||||
version "9.18.0"
|
||||
resolved "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"
|
||||
|
@ -2333,6 +2344,12 @@ mimic-fn@^1.0.0:
|
|||
version "1.2.0"
|
||||
resolved "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022"
|
||||
|
||||
min-document@^2.19.0:
|
||||
version "2.19.0"
|
||||
resolved "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685"
|
||||
dependencies:
|
||||
dom-walk "^0.1.0"
|
||||
|
||||
minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
|
||||
|
@ -2765,6 +2782,10 @@ process-nextick-args@~2.0.0:
|
|||
version "2.0.0"
|
||||
resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa"
|
||||
|
||||
process@~0.5.1:
|
||||
version "0.5.2"
|
||||
resolved "https://registry.npmjs.org/process/-/process-0.5.2.tgz#1638d8a8e34c2f440a91db95ab9aeb677fc185cf"
|
||||
|
||||
pseudomap@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
|
||||
|
|
Loading…
Add table
Reference in a new issue