Skip to content

Commit 1dfe830

Browse files
committed
feat(gh-pages): add package script for publishing docs to gh-pages
Closes #14
1 parent 0d8665f commit 1dfe830

File tree

3 files changed

+76
-6
lines changed

3 files changed

+76
-6
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,18 @@ The src folder is analyzed and documentation is automatically generated using [t
8181
```bash
8282
yarn docs
8383
```
84-
This command generates API documentation for your library in HTML format.
84+
This command generates API documentation for your library in HTML format and opens it in a browser.
8585

8686
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/).
8787

88+
To generate and publish your documentation to [GitHub Pages](https://pages.github.com/) use the following command:
89+
90+
```bash
91+
yarn docs:publish
92+
```
93+
94+
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.
95+
8896
<p align="center">
8997
<img height="500" alt="typedoc documentation example" src="https://cloud.githubusercontent.com/assets/904007/22909419/085b9e38-f222-11e6-996e-c7a86390478c.png">
9098
</p>

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
"cov": "yarn unit && yarn html-coverage && opn coverage/index.html",
2828
"html-coverage": "nyc report --reporter=html",
2929
"send-coverage": "nyc report --reporter=lcov > coverage.lcov && codecov",
30-
"docs": "typedoc src/index.ts --excludePrivate --mode file --theme minimal --out build/docs && opn build/docs/index.html",
30+
"docs": "yarn docs:html && opn build/docs/index.html",
31+
"docs:html": "typedoc src/index.ts --excludePrivate --mode file --theme minimal --out build/docs",
3132
"docs:json": "typedoc --mode file --json build/docs/typedoc.json src/index.ts",
33+
"docs:publish": "yarn docs:html && gh-pages -d build/docs",
3234
"release": "standard-version"
3335
},
3436
"scripts-info": {
@@ -57,6 +59,7 @@
5759
"codecov": "^1.0.1",
5860
"concurrently": "^3.3.0",
5961
"cpx": "^1.5.0",
62+
"gh-pages": "^0.12.0",
6063
"hash.js": "^1.0.3",
6164
"mkdirp": "^0.5.1",
6265
"npm-scripts-info": "^0.3.6",

yarn.lock

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ async-each@^1.0.0:
263263
version "1.0.1"
264264
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
265265

266+
async@2.1.2:
267+
version "2.1.2"
268+
resolved "https://registry.yarnpkg.com/async/-/async-2.1.2.tgz#612a4ab45ef42a70cde806bad86ee6db047e8385"
269+
dependencies:
270+
lodash "^4.14.0"
271+
266272
async@^1.4.0, async@^1.4.2:
267273
version "1.5.2"
268274
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
@@ -1090,6 +1096,12 @@ codecov@^1.0.1:
10901096
request ">=2.42.0"
10911097
urlgrey ">=0.4.0"
10921098

1099+
collections@^0.2.0:
1100+
version "0.2.2"
1101+
resolved "https://registry.yarnpkg.com/collections/-/collections-0.2.2.tgz#1f23026b2ef36f927eecc901e99c5f0d48fa334e"
1102+
dependencies:
1103+
weak-map "1.0.0"
1104+
10931105
colors@^1.1.2:
10941106
version "1.1.2"
10951107
resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63"
@@ -1113,7 +1125,7 @@ commander@2.6.0:
11131125
version "2.6.0"
11141126
resolved "https://registry.yarnpkg.com/commander/-/commander-2.6.0.tgz#9df7e52fb2a0cb0fb89058ee80c3104225f37e1d"
11151127

1116-
commander@^2.9.0:
1128+
commander@2.9.0, commander@^2.9.0:
11171129
version "2.9.0"
11181130
resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4"
11191131
dependencies:
@@ -1975,6 +1987,18 @@ getpass@^0.1.1:
19751987
dependencies:
19761988
assert-plus "^1.0.0"
19771989

1990+
gh-pages@^0.12.0:
1991+
version "0.12.0"
1992+
resolved "https://registry.yarnpkg.com/gh-pages/-/gh-pages-0.12.0.tgz#d951e3ed98b85699d4b0418eb1a15b1a04988dc1"
1993+
dependencies:
1994+
async "2.1.2"
1995+
commander "2.9.0"
1996+
globby "^6.1.0"
1997+
graceful-fs "4.1.10"
1998+
q "1.4.1"
1999+
q-io "1.13.2"
2000+
rimraf "^2.5.4"
2001+
19782002
git-latest-semver-tag@^1.0.0:
19792003
version "1.0.2"
19802004
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:
20602084
version "9.14.0"
20612085
resolved "https://registry.yarnpkg.com/globals/-/globals-9.14.0.tgz#8859936af0038741263053b39d0e76ca241e4034"
20622086

2063-
globby@^6.0.0:
2087+
globby@^6.0.0, globby@^6.1.0:
20642088
version "6.1.0"
20652089
resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
20662090
dependencies:
@@ -2106,6 +2130,10 @@ got@^6.7.1:
21062130
unzip-response "^2.0.1"
21072131
url-parse-lax "^1.0.0"
21082132

2133+
graceful-fs@4.1.10:
2134+
version "4.1.10"
2135+
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.10.tgz#f2d720c22092f743228775c75e3612632501f131"
2136+
21092137
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:
21102138
version "4.1.11"
21112139
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
@@ -2779,7 +2807,7 @@ lodash.templatesettings@^4.0.0:
27792807
dependencies:
27802808
lodash._reinterpolate "~3.0.0"
27812809

2782-
lodash@^4.0.0, lodash@^4.13.1, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.5.1:
2810+
lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.5.1:
27832811
version "4.17.4"
27842812
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
27852813

@@ -2907,6 +2935,14 @@ mime-types@^2.1.12, mime-types@~2.1.7:
29072935
dependencies:
29082936
mime-db "~1.26.0"
29092937

2938+
mime@^1.2.11:
2939+
version "1.3.4"
2940+
resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53"
2941+
2942+
mimeparse@^0.1.4:
2943+
version "0.1.4"
2944+
resolved "https://registry.yarnpkg.com/mimeparse/-/mimeparse-0.1.4.tgz#dafb02752370fd226093ae3152c271af01ac254a"
2945+
29102946
mimic-fn@^1.0.0:
29112947
version "1.1.0"
29122948
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:
34473483
version "1.4.1"
34483484
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
34493485

3450-
q@^1.4.1:
3486+
q-io@1.13.2:
3487+
version "1.13.2"
3488+
resolved "https://registry.yarnpkg.com/q-io/-/q-io-1.13.2.tgz#eea130d481ddb5e1aa1bc5a66855f7391d06f003"
3489+
dependencies:
3490+
collections "^0.2.0"
3491+
mime "^1.2.11"
3492+
mimeparse "^0.1.4"
3493+
q "^1.0.1"
3494+
qs "^1.2.1"
3495+
url2 "^0.0.0"
3496+
3497+
q@1.4.1, q@^1.0.1, q@^1.4.1:
34513498
version "1.4.1"
34523499
resolved "https://registry.yarnpkg.com/q/-/q-1.4.1.tgz#55705bcd93c5f3673530c2c2cbc0c2b3addc286e"
34533500

3501+
qs@^1.2.1:
3502+
version "1.2.2"
3503+
resolved "https://registry.yarnpkg.com/qs/-/qs-1.2.2.tgz#19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88"
3504+
34543505
qs@~6.3.0:
34553506
version "6.3.0"
34563507
resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442"
@@ -4423,6 +4474,10 @@ url-parse-lax@^1.0.0:
44234474
dependencies:
44244475
prepend-http "^1.0.1"
44254476

4477+
url2@^0.0.0:
4478+
version "0.0.0"
4479+
resolved "https://registry.yarnpkg.com/url2/-/url2-0.0.0.tgz#4eaabd1d5c3ac90d62ab4485c998422865a04b1a"
4480+
44264481
url@~0.11.0:
44274482
version "0.11.0"
44284483
resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1"
@@ -4479,6 +4534,10 @@ vm-browserify@~0.0.1:
44794534
dependencies:
44804535
indexof "0.0.1"
44814536

4537+
weak-map@1.0.0:
4538+
version "1.0.0"
4539+
resolved "https://registry.yarnpkg.com/weak-map/-/weak-map-1.0.0.tgz#b66e56a9df0bd25a76bbf1b514db129080614a37"
4540+
44824541
which-module@^1.0.0:
44834542
version "1.0.0"
44844543
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"

0 commit comments

Comments
 (0)