1
0
mirror of synced 2025-11-08 12:57:47 +00:00

feat(gh-pages): add package script for publishing docs to gh-pages

Closes #14
This commit is contained in:
Jason Dreyzehner
2017-03-01 18:56:43 -05:00
parent 0d8665fd96
commit 1dfe83059f
3 changed files with 76 additions and 6 deletions

View File

@@ -81,10 +81,18 @@ The src folder is analyzed and documentation is automatically generated using [t
```bash
yarn docs
```
This command generates API documentation for your library in HTML format.
This command generates API documentation for your library in HTML format and opens it in a browser.
Since types are tracked by Typescript, there's no need to indicate types in JSDoc format. For more information, see the [typedoc documentation](http://typedoc.org/guides/doccomments/).
To generate and publish your documentation to [GitHub Pages](https://pages.github.com/) use the following command:
```bash
yarn docs:publish
```
Once published, your documentation should be available at the proper GitHub Pages URL for your repo. See [this repo's GitHub Pages](https://bitjson.github.io/typescript-starter/) for an example.
<p align="center">
<img height="500" alt="typedoc documentation example" src="https://cloud.githubusercontent.com/assets/904007/22909419/085b9e38-f222-11e6-996e-c7a86390478c.png">
</p>

View File

@@ -27,8 +27,10 @@
"cov": "yarn unit && yarn html-coverage && opn coverage/index.html",
"html-coverage": "nyc report --reporter=html",
"send-coverage": "nyc report --reporter=lcov > coverage.lcov && codecov",
"docs": "typedoc src/index.ts --excludePrivate --mode file --theme minimal --out build/docs && opn build/docs/index.html",
"docs": "yarn docs:html && opn build/docs/index.html",
"docs:html": "typedoc src/index.ts --excludePrivate --mode file --theme minimal --out build/docs",
"docs:json": "typedoc --mode file --json build/docs/typedoc.json src/index.ts",
"docs:publish": "yarn docs:html && gh-pages -d build/docs",
"release": "standard-version"
},
"scripts-info": {
@@ -57,6 +59,7 @@
"codecov": "^1.0.1",
"concurrently": "^3.3.0",
"cpx": "^1.5.0",
"gh-pages": "^0.12.0",
"hash.js": "^1.0.3",
"mkdirp": "^0.5.1",
"npm-scripts-info": "^0.3.6",

View File

@@ -263,6 +263,12 @@ async-each@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
async@2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/async/-/async-2.1.2.tgz#612a4ab45ef42a70cde806bad86ee6db047e8385"
dependencies:
lodash "^4.14.0"
async@^1.4.0, async@^1.4.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
@@ -1090,6 +1096,12 @@ codecov@^1.0.1:
request ">=2.42.0"
urlgrey ">=0.4.0"
collections@^0.2.0:
version "0.2.2"
resolved "https://registry.yarnpkg.com/collections/-/collections-0.2.2.tgz#1f23026b2ef36f927eecc901e99c5f0d48fa334e"
dependencies:
weak-map "1.0.0"
colors@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
@@ -1113,7 +1125,7 @@ commander@2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d"
commander@^2.9.0:
commander@2.9.0, commander@^2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
dependencies:
@@ -1975,6 +1987,18 @@ getpass@^0.1.1:
dependencies:
assert-plus "^1.0.0"
gh-pages@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/gh-pages/-/gh-pages-0.12.0.tgz#d951e3ed98b85699d4b0418eb1a15b1a04988dc1"
dependencies:
async "2.1.2"
commander "2.9.0"
globby "^6.1.0"
graceful-fs "4.1.10"
q "1.4.1"
q-io "1.13.2"
rimraf "^2.5.4"
git-latest-semver-tag@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/git-latest-semver-tag/-/git-latest-semver-tag-1.0.2.tgz#061130cbf4274111cc6be4612b3ff3a6d93e2660"
@@ -2060,7 +2084,7 @@ globals@^9.0.0:
version "9.14.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
globby@^6.0.0:
globby@^6.0.0, globby@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
dependencies:
@@ -2106,6 +2130,10 @@ got@^6.7.1:
unzip-response "^2.0.1"
url-parse-lax "^1.0.0"
graceful-fs@4.1.10:
version "4.1.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.10.tgz#f2d720c22092f743228775c75e3612632501f131"
graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6, graceful-fs@^4.1.9:
version "4.1.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
@@ -2779,7 +2807,7 @@ lodash.templatesettings@^4.0.0:
dependencies:
lodash._reinterpolate "~3.0.0"
lodash@^4.0.0, lodash@^4.13.1, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.5.1:
lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.5.1:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
@@ -2907,6 +2935,14 @@ mime-types@^2.1.12, mime-types@~2.1.7:
dependencies:
mime-db "~1.26.0"
mime@^1.2.11:
version "1.3.4"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53"
mimeparse@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/mimeparse/-/mimeparse-0.1.4.tgz#dafb02752370fd226093ae3152c271af01ac254a"
mimic-fn@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18"
@@ -3447,10 +3483,25 @@ punycode@^1.3.2, punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
q@^1.4.1:
q-io@1.13.2:
version "1.13.2"
resolved "https://registry.yarnpkg.com/q-io/-/q-io-1.13.2.tgz#eea130d481ddb5e1aa1bc5a66855f7391d06f003"
dependencies:
collections "^0.2.0"
mime "^1.2.11"
mimeparse "^0.1.4"
q "^1.0.1"
qs "^1.2.1"
url2 "^0.0.0"
q@1.4.1, q@^1.0.1, q@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e"
qs@^1.2.1:
version "1.2.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-1.2.2.tgz#19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88"
qs@~6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442"
@@ -4423,6 +4474,10 @@ url-parse-lax@^1.0.0:
dependencies:
prepend-http "^1.0.1"
url2@^0.0.0:
version "0.0.0"
resolved "https://registry.yarnpkg.com/url2/-/url2-0.0.0.tgz#4eaabd1d5c3ac90d62ab4485c998422865a04b1a"
url@~0.11.0:
version "0.11.0"
resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
@@ -4479,6 +4534,10 @@ vm-browserify@~0.0.1:
dependencies:
indexof "0.0.1"
weak-map@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/weak-map/-/weak-map-1.0.0.tgz#b66e56a9df0bd25a76bbf1b514db129080614a37"
which-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"