diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap index 04c9b6fcc..bbdce4280 100644 --- a/__tests__/__snapshots__/bin.js.snap +++ b/__tests__/__snapshots__/bin.js.snap @@ -2,16 +2,16 @@ exports[`--config 1`] = ` " - +
- +A function that triggers the case where the autolinker doesn't find the referenced class type
- -This method takes a Buffer object that will be linked to nodejs.org
- - - @@ -601,6 +548,10 @@ the referenced class type + + + +This method takes an array of buffers and counts them
- - - @@ -665,6 +613,8 @@ the referenced class type + +A magic number that identifies this Klass.
- -Get this Klass's foo
- -this shows you how to getFoo
@@ -797,6 +749,8 @@ k.isArrayOfBuffers(); + + @@ -816,10 +770,7 @@ k.isArrayOfBuffers();A function with an options parameter
- - - @@ -898,6 +849,10 @@ k.isArrayOfBuffers(); + + + + @@ -917,10 +872,7 @@ k.isArrayOfBuffers();A function with a deep options parameter
- -Klass event
- -a typedef with nested properties
- -Rest property function
- - - - + @@ -1266,8 +1227,13 @@ like a klass + + + + +Col 1 | +Col 2 | +Col 3 | +
---|---|---|
Dat 1 | +Dat 2 | +Dat 3 | +
Dat 4 | +Dat 5 | +Dat 6 | +
\d+\.\d+\.\d+(-\w+(\.\d+)?)?<\/code>/g, '')
- )
- .join('\n');
+ .replace(/documentation \d+\.\d+\.\d+(-\w+(\.\d+)?)?/g, '')
+ .replace(/\d+\.\d+\.\d+(-\w+(\.\d+)?)?<\/code>/g, '');
+
expect(clean).toMatchSnapshot();
});
});
diff --git a/package-lock.json b/package-lock.json
index e23d0eb29..c29bc179b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1199,14 +1199,6 @@
"picomatch": "^2.0.4"
}
},
- "append-buffer": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/append-buffer/-/append-buffer-1.0.2.tgz",
- "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=",
- "requires": {
- "buffer-equal": "^1.0.0"
- }
- },
"arg": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
@@ -1402,11 +1394,6 @@
"node-int64": "^0.4.0"
}
},
- "buffer-equal": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.0.tgz",
- "integrity": "sha1-WWFrSYME1Var1GaWayLu2j7KX74="
- },
"buffer-from": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
@@ -2360,14 +2347,6 @@
"integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==",
"dev": true
},
- "define-properties": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
- "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
- "requires": {
- "object-keys": "^1.0.12"
- }
- },
"defined": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz",
@@ -2547,46 +2526,6 @@
}
}
},
- "duplexify": {
- "version": "3.7.1",
- "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz",
- "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==",
- "requires": {
- "end-of-stream": "^1.0.0",
- "inherits": "^2.0.1",
- "readable-stream": "^2.0.0",
- "stream-shift": "^1.0.0"
- },
- "dependencies": {
- "process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
- },
- "readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
- "requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
- "string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "requires": {
- "safe-buffer": "~5.1.0"
- }
- }
- }
- },
"electron-to-chromium": {
"version": "1.3.867",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.867.tgz",
@@ -2603,14 +2542,6 @@
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
- "end-of-stream": {
- "version": "1.4.4",
- "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
- "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
- "requires": {
- "once": "^1.4.0"
- }
- },
"enquirer": {
"version": "2.3.6",
"resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
@@ -3156,44 +3087,6 @@
"integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==",
"dev": true
},
- "flush-write-stream": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz",
- "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==",
- "requires": {
- "inherits": "^2.0.3",
- "readable-stream": "^2.3.6"
- },
- "dependencies": {
- "process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
- },
- "readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
- "requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
- "string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "requires": {
- "safe-buffer": "~5.1.0"
- }
- }
- }
- },
"form-data": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
@@ -3242,15 +3135,6 @@
}
}
},
- "fs-mkdirp-stream": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz",
- "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=",
- "requires": {
- "graceful-fs": "^4.1.11",
- "through2": "^2.0.3"
- }
- },
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@@ -3448,69 +3332,6 @@
"is-glob": "^4.0.1"
}
},
- "glob-stream": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-6.1.0.tgz",
- "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=",
- "requires": {
- "extend": "^3.0.0",
- "glob": "^7.1.1",
- "glob-parent": "^3.1.0",
- "is-negated-glob": "^1.0.0",
- "ordered-read-streams": "^1.0.0",
- "pumpify": "^1.3.5",
- "readable-stream": "^2.1.5",
- "remove-trailing-separator": "^1.0.1",
- "to-absolute-glob": "^2.0.0",
- "unique-stream": "^2.0.2"
- },
- "dependencies": {
- "glob-parent": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz",
- "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=",
- "requires": {
- "is-glob": "^3.1.0",
- "path-dirname": "^1.0.0"
- }
- },
- "is-glob": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz",
- "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=",
- "requires": {
- "is-extglob": "^2.1.0"
- }
- },
- "process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
- },
- "readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
- "requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
- "string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "requires": {
- "safe-buffer": "~5.1.0"
- }
- }
- }
- },
"global-dirs": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz",
@@ -4038,11 +3859,6 @@
"resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.0.tgz",
"integrity": "sha512-vGOtYkiaxwIiR0+Ng/zNId+ZZehGfINwTzdrDqc6iubbnQWhnPuYymOzOKUDqa2cSl59yHnEh2h6MvRLQsyNug=="
},
- "is-negated-glob": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz",
- "integrity": "sha1-aRC8pdqMleeEtXUbl2z1oQ/uNtI="
- },
"is-number": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
@@ -4117,12 +3933,8 @@
"is-utf8": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
- "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
- },
- "is-valid-glob": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-1.0.0.tgz",
- "integrity": "sha1-Kb8+/3Ab4tTTFdusw5vDn+j2Aao="
+ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
+ "dev": true
},
"is-windows": {
"version": "1.0.2",
@@ -4859,7 +4671,8 @@
"json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
- "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE="
+ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+ "dev": true
},
"json-stringify-safe": {
"version": "5.0.1",
@@ -4908,51 +4721,6 @@
"@babel/traverse": "^7.10.5"
}
},
- "lazystream": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz",
- "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=",
- "requires": {
- "readable-stream": "^2.0.5"
- },
- "dependencies": {
- "process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
- },
- "readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
- "requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
- "string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "requires": {
- "safe-buffer": "~5.1.0"
- }
- }
- }
- },
- "lead": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/lead/-/lead-1.0.0.tgz",
- "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=",
- "requires": {
- "flush-write-stream": "^1.0.2"
- }
- },
"leven": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
@@ -6268,14 +6036,6 @@
"resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz",
"integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A=="
},
- "now-and-later": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/now-and-later/-/now-and-later-2.0.1.tgz",
- "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==",
- "requires": {
- "once": "^1.3.2"
- }
- },
"npm-run-path": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz",
@@ -6306,22 +6066,6 @@
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
"integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg=="
},
- "object-keys": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
- "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="
- },
- "object.assign": {
- "version": "4.1.2",
- "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz",
- "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==",
- "requires": {
- "call-bind": "^1.0.0",
- "define-properties": "^1.1.3",
- "has-symbols": "^1.0.1",
- "object-keys": "^1.1.1"
- }
- },
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@@ -6359,43 +6103,6 @@
"word-wrap": "^1.2.3"
}
},
- "ordered-read-streams": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-1.0.1.tgz",
- "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=",
- "requires": {
- "readable-stream": "^2.0.1"
- },
- "dependencies": {
- "process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
- },
- "readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
- "requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
- "string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "requires": {
- "safe-buffer": "~5.1.0"
- }
- }
- }
- },
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
@@ -6533,11 +6240,6 @@
"integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==",
"dev": true
},
- "path-dirname": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",
- "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA="
- },
"path-exists": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
@@ -6721,25 +6423,6 @@
"integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==",
"dev": true
},
- "pump": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
- "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==",
- "requires": {
- "end-of-stream": "^1.1.0",
- "once": "^1.3.1"
- }
- },
- "pumpify": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz",
- "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==",
- "requires": {
- "duplexify": "^3.6.0",
- "inherits": "^2.0.3",
- "pump": "^2.0.0"
- }
- },
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
@@ -7063,32 +6746,6 @@
"unified": "^10.0.0"
}
},
- "remove-bom-buffer": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/remove-bom-buffer/-/remove-bom-buffer-3.0.0.tgz",
- "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==",
- "requires": {
- "is-buffer": "^1.1.5",
- "is-utf8": "^0.2.1"
- },
- "dependencies": {
- "is-buffer": {
- "version": "1.1.6",
- "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
- "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
- }
- }
- },
- "remove-bom-stream": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/remove-bom-stream/-/remove-bom-stream-1.2.0.tgz",
- "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=",
- "requires": {
- "remove-bom-buffer": "^3.0.0",
- "safe-buffer": "^5.1.0",
- "through2": "^2.0.3"
- }
- },
"remove-trailing-separator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
@@ -7148,14 +6805,6 @@
"global-dirs": "^0.1.1"
}
},
- "resolve-options": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/resolve-options/-/resolve-options-1.1.0.tgz",
- "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=",
- "requires": {
- "value-or-function": "^3.0.0"
- }
- },
"restore-cursor": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
@@ -7563,11 +7212,6 @@
}
}
},
- "stream-shift": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz",
- "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ=="
- },
"strict-uri-encode": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
@@ -7831,15 +7475,6 @@
}
}
},
- "through2-filter": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz",
- "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==",
- "requires": {
- "through2": "~2.0.0",
- "xtend": "~4.0.0"
- }
- },
"tiny-lr": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/tiny-lr/-/tiny-lr-2.0.0.tgz",
@@ -7878,15 +7513,6 @@
"integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==",
"dev": true
},
- "to-absolute-glob": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz",
- "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=",
- "requires": {
- "is-absolute": "^1.0.0",
- "is-negated-glob": "^1.0.0"
- }
- },
"to-fast-properties": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
@@ -7900,14 +7526,6 @@
"is-number": "^7.0.0"
}
},
- "to-through": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/to-through/-/to-through-2.0.0.tgz",
- "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=",
- "requires": {
- "through2": "^2.0.3"
- }
- },
"totalist": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/totalist/-/totalist-2.0.0.tgz",
@@ -8047,15 +7665,6 @@
}
}
},
- "unique-stream": {
- "version": "2.3.1",
- "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz",
- "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==",
- "requires": {
- "json-stable-stringify-without-jsonify": "^1.0.1",
- "through2-filter": "^3.0.0"
- }
- },
"unist-builder": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/unist-builder/-/unist-builder-2.0.3.tgz",
@@ -8176,11 +7785,6 @@
"spdx-expression-parse": "^3.0.0"
}
},
- "value-or-function": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz",
- "integrity": "sha1-HCQ6ULWVwb5Up1S/7OhWO5/42BM="
- },
"vfile": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/vfile/-/vfile-5.1.1.tgz",
@@ -8347,83 +7951,6 @@
"replace-ext": "^1.0.0"
}
},
- "vinyl-fs": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-3.0.3.tgz",
- "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==",
- "requires": {
- "fs-mkdirp-stream": "^1.0.0",
- "glob-stream": "^6.1.0",
- "graceful-fs": "^4.0.0",
- "is-valid-glob": "^1.0.0",
- "lazystream": "^1.0.0",
- "lead": "^1.0.0",
- "object.assign": "^4.0.4",
- "pumpify": "^1.3.5",
- "readable-stream": "^2.3.3",
- "remove-bom-buffer": "^3.0.0",
- "remove-bom-stream": "^1.2.0",
- "resolve-options": "^1.1.0",
- "through2": "^2.0.0",
- "to-through": "^2.0.0",
- "value-or-function": "^3.0.0",
- "vinyl": "^2.0.0",
- "vinyl-sourcemap": "^1.1.0"
- },
- "dependencies": {
- "process-nextick-args": {
- "version": "2.0.1",
- "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
- "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
- },
- "readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
- "requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
- }
- },
- "string_decoder": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
- "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
- "requires": {
- "safe-buffer": "~5.1.0"
- }
- }
- }
- },
- "vinyl-sourcemap": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/vinyl-sourcemap/-/vinyl-sourcemap-1.1.0.tgz",
- "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=",
- "requires": {
- "append-buffer": "^1.0.2",
- "convert-source-map": "^1.5.0",
- "graceful-fs": "^4.1.6",
- "normalize-path": "^2.1.1",
- "now-and-later": "^2.0.0",
- "remove-bom-buffer": "^3.0.0",
- "vinyl": "^2.0.0"
- },
- "dependencies": {
- "normalize-path": {
- "version": "2.1.1",
- "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
- "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=",
- "requires": {
- "remove-trailing-separator": "^1.0.1"
- }
- }
- }
- },
"vue-template-compiler": {
"version": "2.6.14",
"resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.6.14.tgz",
diff --git a/package.json b/package.json
index 2481c3479..dc1be9959 100644
--- a/package.json
+++ b/package.json
@@ -54,7 +54,6 @@
"vfile-reporter": "^7.0.2",
"vfile-sort": "^3.0.0",
"vinyl": "^2.1.0",
- "vinyl-fs": "^3.0.2",
"yargs": "^17.2.1"
},
"optionalDependencies": {
diff --git a/src/commands/build.js b/src/commands/build.js
index 48eebe12c..264b1205e 100644
--- a/src/commands/build.js
+++ b/src/commands/build.js
@@ -1,8 +1,6 @@
-import streamArray from 'stream-array';
import { sharedOutputOptions, sharedInputOptions } from './shared_options.js';
import path from 'path';
import fs from 'fs';
-import vfs from 'vinyl-fs';
import chokidar from 'chokidar';
import * as documentation from '../index.js';
import _ from 'lodash';
@@ -79,6 +77,10 @@ const handler = function build(argv) {
updateWatcher();
}
+ if (!output) {
+ return;
+ }
+
if (argv.output === 'stdout') {
if (argv.watch) {
// In watch mode, clear the screen first to make updated outputs
@@ -86,8 +88,6 @@ const handler = function build(argv) {
process.stdout.write('\u001b[2J');
}
process.stdout.write(output);
- } else if (Array.isArray(output)) {
- streamArray(output).pipe(vfs.dest(argv.output));
} else {
fs.writeFileSync(argv.output, output);
}
diff --git a/src/default_theme/index.js b/src/default_theme/index.js
index 169d66e62..dcd7ded70 100644
--- a/src/default_theme/index.js
+++ b/src/default_theme/index.js
@@ -1,11 +1,8 @@
-import fs from 'fs';
+import fs from 'fs/promises';
import path from 'path';
-import File from 'vinyl';
-import vfs from 'vinyl-fs';
-import _ from 'lodash';
-import concat from 'concat-stream';
+import template from 'lodash/template.js';
import GithubSlugger from 'github-slugger';
-import { util } from '../index';
+import { util } from '../index.js';
import hljs from 'highlight.js';
import { fileURLToPath } from 'url';
@@ -14,6 +11,20 @@ const __dirname = path.dirname(__filename);
const { LinkerStack, createFormatters } = util;
+async function copyDir(sorce, dest) {
+ await fs.mkdir(dest, { recursive: true });
+ let entries = await fs.readdir(sorce, { withFileTypes: true });
+
+ for (let entry of entries) {
+ let srcPath = path.join(sorce, entry.name);
+ let destPath = path.join(dest, entry.name);
+
+ entry.isDirectory()
+ ? await copyDir(srcPath, destPath)
+ : await fs.copyFile(srcPath, destPath);
+ }
+}
+
function isFunction(section) {
return (
section.kind === 'function' ||
@@ -24,7 +35,7 @@ function isFunction(section) {
);
}
-export default function (comments, config) {
+export default async function (comments, config) {
var linkerStack = new LinkerStack(config).namespaceResolver(
comments,
function (namespace) {
@@ -90,47 +101,34 @@ export default function (comments, config) {
}
};
- sharedImports.imports.renderSectionList = _.template(
- fs.readFileSync(path.join(__dirname, 'section_list._'), 'utf8'),
+ sharedImports.imports.renderSectionList = template(
+ await fs.readFile(path.join(__dirname, 'section_list._'), 'utf8'),
sharedImports
);
- sharedImports.imports.renderSection = _.template(
- fs.readFileSync(path.join(__dirname, 'section._'), 'utf8'),
+ sharedImports.imports.renderSection = template(
+ await fs.readFile(path.join(__dirname, 'section._'), 'utf8'),
sharedImports
);
- sharedImports.imports.renderNote = _.template(
- fs.readFileSync(path.join(__dirname, 'note._'), 'utf8'),
+ sharedImports.imports.renderNote = template(
+ await fs.readFile(path.join(__dirname, 'note._'), 'utf8'),
sharedImports
);
- sharedImports.imports.renderParamProperty = _.template(
- fs.readFileSync(path.join(__dirname, 'paramProperty._'), 'utf8'),
+ sharedImports.imports.renderParamProperty = template(
+ await fs.readFile(path.join(__dirname, 'paramProperty._'), 'utf8'),
sharedImports
);
- var pageTemplate = _.template(
- fs.readFileSync(path.join(__dirname, 'index._'), 'utf8'),
+ var pageTemplate = template(
+ await fs.readFile(path.join(__dirname, 'index._'), 'utf8'),
sharedImports
);
- // push assets into the pipeline as well.
- return new Promise(resolve => {
- vfs.src([__dirname + '/assets/**'], { base: __dirname }).pipe(
- concat(function (files) {
- resolve(
- files.concat(
- new File({
- path: 'index.html',
- contents: Buffer.from(
- pageTemplate({
- docs: comments,
- config
- }),
- 'utf8'
- )
- })
- )
- );
- })
- );
- });
+ const string = pageTemplate({ docs: comments, config });
+
+ if (!config.output) {
+ return string;
+ }
+
+ await copyDir(__dirname + '/assets/', config.output + '/assets/');
+ await fs.writeFile(config.output + '/index.html', string, 'utf8');
}
diff --git a/src/extractors/comments.js b/src/extractors/comments.js
index 6f609f167..2ab7dc884 100644
--- a/src/extractors/comments.js
+++ b/src/extractors/comments.js
@@ -1,7 +1,7 @@
import babelTraverse from '@babel/traverse';
import isJSDocComment from '../is_jsdoc_comment.js';
-const traverse = babelTraverse.default;
+const traverse = babelTraverse.default || babelTraverse;
/**
* Iterate through the abstract syntax tree, finding a different kind of comment
diff --git a/src/extractors/exported.js b/src/extractors/exported.js
index 6e681dc76..4470cb452 100644
--- a/src/extractors/exported.js
+++ b/src/extractors/exported.js
@@ -8,7 +8,7 @@ import findTarget from '../infer/finders.js';
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
-const traverse = babelTraverse.default;
+const traverse = babelTraverse.default || babelTraverse;
/**
* Iterate through the abstract syntax tree, finding ES6-style exports,
diff --git a/src/flow_doctrine.js b/src/flow_doctrine.js
index 909676032..f81f2ffc8 100644
--- a/src/flow_doctrine.js
+++ b/src/flow_doctrine.js
@@ -1,5 +1,5 @@
import generator from '@babel/generator';
-const generate = generator.default;
+const generate = generator.default || generator;
const namedTypes = {
NumberTypeAnnotation: 'number',
diff --git a/src/infer/augments.js b/src/infer/augments.js
index b9556f905..f310c167b 100644
--- a/src/infer/augments.js
+++ b/src/infer/augments.js
@@ -1,7 +1,7 @@
import babelGenerate from '@babel/generator';
import findTarget from './finders.js';
-const generate = babelGenerate.default;
+const generate = babelGenerate.default || babelGenerate;
/**
* Infers an `augments` tag from an ES6 class declaration
diff --git a/src/infer/implements.js b/src/infer/implements.js
index 82208308c..26240898e 100644
--- a/src/infer/implements.js
+++ b/src/infer/implements.js
@@ -1,7 +1,7 @@
import babelGenerate from '@babel/generator';
import findTarget from './finders.js';
-const generate = babelGenerate.default;
+const generate = babelGenerate.default || babelGenerate;
/**
* Infers an `augments` tag from an ES6 class declaration
diff --git a/src/infer/params.js b/src/infer/params.js
index afc328185..2103af6df 100644
--- a/src/infer/params.js
+++ b/src/infer/params.js
@@ -4,7 +4,7 @@ import _ from 'lodash';
import findTarget from './finders.js';
import typeAnnotation from '../type_annotation.js';
-const generate = babelGenerate.default;
+const generate = babelGenerate.default || babelGenerate;
/**
* Infers param tags by reading function parameter names
diff --git a/src/output/html.js b/src/output/html.js
index 485c2b27b..ead58f67d 100644
--- a/src/output/html.js
+++ b/src/output/html.js
@@ -23,9 +23,10 @@ import mergeConfig from '../merge_config.js';
*/
export default async function html(comments, localConfig = {}) {
const config = await mergeConfig(localConfig);
- const themePath =
- (config.theme && path.resolve(process.cwd(), config.theme)) ||
- '../default_theme/index.js';
+ const themePath = config.theme && path.resolve(process.cwd(), config.theme);
+ if (themePath) {
+ return (await import(themePath)).default(comments, config);
+ }
- return (await import(themePath)).default(comments, config);
+ return (await import('../default_theme/index.js')).default(comments, config);
}
diff --git a/src/ts_doctrine.js b/src/ts_doctrine.js
index 43c38b07f..d31a0a50b 100644
--- a/src/ts_doctrine.js
+++ b/src/ts_doctrine.js
@@ -1,5 +1,5 @@
import generator from '@babel/generator';
-const generate = generator.default;
+const generate = generator.default || generator;
const namedTypes = {
TSBigIntKeyword: 'bigint',