Skip to content

Commit 7192f29

Browse files
feat(docs): Add publish_docs script to publish typedoc documentation to http://ui-router.github.io/
1 parent 58afc88 commit 7192f29

File tree

4 files changed

+198
-4
lines changed

4 files changed

+198
-4
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@
4141
"shx": "^0.2.2",
4242
"tmp": "^0.0.33",
4343
"tweak-sourcemap-paths": "0.0.3",
44+
"typedoc": "0.8.0",
45+
"typedoc-plugin-external-module-name": "1.1.1",
46+
"typedoc-plugin-internal-external": "1.0.10",
47+
"typedoc-plugin-ui-router": "1.0.6",
48+
"ui-router-typedoc-themes": "1.0.2",
4449
"yargs": "^9.0.1"
4550
}
4651
}

publish_docs.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env node
2+
3+
const publishYalcPackage = require('./publish_yalc_package');
4+
const util = require('./util');
5+
util.packageDir();
6+
7+
const fs = require('fs');
8+
const path = require('path');
9+
const _exec = util._exec;
10+
const sh = require('shelljs');
11+
const readlineSync = require('readline-sync');
12+
13+
const CONFIG = JSON.parse(fs.readFileSync('./typedoc.json'));
14+
const pkg = JSON.parse(fs.readFileSync('./package.json'));
15+
const version = pkg.version;
16+
17+
const GIT_URL = "git@github.com:ui-router/ui-router.github.io.git";
18+
const installTargetDir = path.join(".downstream_cache", "ui-router.gihub.io");
19+
const PAGES_DIR = path.join(installTargetDir, CONFIG.typedoc.publishDir);
20+
21+
publishYalcPackage(installTargetDir, GIT_URL, { noInstall: true, noBuild: true, noPublish: true });
22+
23+
util.packageDir();
24+
25+
sh.rm('-rf', path.join(PAGES_DIR, 'latest'));
26+
sh.cp('-r', CONFIG.typedoc.generateOptions.out, path.join(PAGES_DIR, 'latest'));
27+
28+
sh.rm('-rf', path.join(PAGES_DIR, version));
29+
sh.cp('-r', CONFIG.typedoc.generateOptions.out, path.join(PAGES_DIR, version));
30+
31+
sh.cd(PAGES_DIR);
32+
_exec("./process_docs.sh");
33+
_exec("git add .");
34+
35+
sh.echo("\n\nSpot check the docs, then run these commands to publish:\n\n");
36+
sh.echo("cd " + PAGES_DIR);
37+
sh.echo(`git commit -m 'publish docs for ${version}'`);
38+
sh.echo(`git push`);
39+
40+
if (readlineSync.keyInYN('Publish docs?')) {
41+
sh.cd(PAGES_DIR);
42+
_exec(`git commit -m 'publish docs for ${version}'`);
43+
_exec(`git push`);
44+
}

release.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,9 @@ if (githuburl) {
143143
console.log("Could not determine github URL from package.json")
144144
}
145145

146+
// Generate docs
147+
util.packageDir();
148+
if (fs.existsSync('typedoc.json') && readlineSync.keyInYN('Generate docs?')) {
149+
_exec('generate_docs');
150+
_exec('publish_docs');
151+
}

yarn.lock

Lines changed: 143 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,59 @@
22
# yarn lockfile v1
33

44

5+
"@types/events@*":
6+
version "1.1.0"
7+
resolved "https://registry.yarnpkg.com/@types/events/-/events-1.1.0.tgz#93b1be91f63c184450385272c47b6496fd028e02"
8+
9+
"@types/fs-extra@^4.0.0":
10+
version "4.0.7"
11+
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.7.tgz#02533262386b5a6b9a49797dc82feffdf269140a"
12+
dependencies:
13+
"@types/node" "*"
14+
15+
"@types/glob@*":
16+
version "5.0.35"
17+
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-5.0.35.tgz#1ae151c802cece940443b5ac246925c85189f32a"
18+
dependencies:
19+
"@types/events" "*"
20+
"@types/minimatch" "*"
21+
"@types/node" "*"
22+
23+
"@types/handlebars@^4.0.31":
24+
version "4.0.36"
25+
resolved "https://registry.yarnpkg.com/@types/handlebars/-/handlebars-4.0.36.tgz#ff57c77fa1ab6713bb446534ddc4d979707a3a79"
26+
27+
"@types/highlight.js@^9.1.8":
28+
version "9.12.2"
29+
resolved "https://registry.yarnpkg.com/@types/highlight.js/-/highlight.js-9.12.2.tgz#6ee7cd395effe5ec80b515d3ff1699068cd0cd1d"
30+
31+
"@types/lodash@^4.14.37":
32+
version "4.14.101"
33+
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.101.tgz#512f6c9e1749890f4d024e98cb995a63f562d458"
34+
35+
"@types/marked@0.0.28":
36+
version "0.0.28"
37+
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.0.28.tgz#44ba754e9fa51432583e8eb30a7c4dd249b52faa"
38+
39+
"@types/minimatch@*":
40+
version "3.0.3"
41+
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
42+
43+
"@types/minimatch@^2.0.29":
44+
version "2.0.29"
45+
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
46+
47+
"@types/node@*":
48+
version "9.4.1"
49+
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.4.1.tgz#0f636f7837e15d2d73a7f6f3ea0e322eb2a5ab65"
50+
51+
"@types/shelljs@^0.7.0":
52+
version "0.7.8"
53+
resolved "https://registry.yarnpkg.com/@types/shelljs/-/shelljs-0.7.8.tgz#4b4d6ee7926e58d7bca448a50ba442fd9f6715bd"
54+
dependencies:
55+
"@types/glob" "*"
56+
"@types/node" "*"
57+
558
JSONStream@^1.0.4:
659
version "1.3.1"
760
resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.1.tgz#707f761e01dae9e16f1bcf93703b78c70966579a"
@@ -415,6 +468,14 @@ from@~0:
415468
version "0.1.7"
416469
resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe"
417470

471+
fs-extra@^4.0.0:
472+
version "4.0.3"
473+
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
474+
dependencies:
475+
graceful-fs "^4.1.2"
476+
jsonfile "^4.0.0"
477+
universalify "^0.1.0"
478+
418479
fs.realpath@^1.0.0:
419480
version "1.0.0"
420481
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
@@ -490,7 +551,7 @@ glob@^7.0.0, glob@^7.1.2:
490551
once "^1.3.0"
491552
path-is-absolute "^1.0.0"
492553

493-
graceful-fs@^4.1.2:
554+
graceful-fs@^4.1.2, graceful-fs@^4.1.6:
494555
version "4.1.11"
495556
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658"
496557

@@ -504,6 +565,16 @@ handlebars@^4.0.2:
504565
optionalDependencies:
505566
uglify-js "^2.6"
506567

568+
handlebars@^4.0.6:
569+
version "4.0.11"
570+
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.11.tgz#630a35dfe0294bc281edae6ffc5d329fc7982dcc"
571+
dependencies:
572+
async "^1.4.0"
573+
optimist "^0.6.1"
574+
source-map "^0.4.4"
575+
optionalDependencies:
576+
uglify-js "^2.6"
577+
507578
has-flag@^2.0.0:
508579
version "2.0.0"
509580
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51"
@@ -514,6 +585,10 @@ has@^1.0.1:
514585
dependencies:
515586
function-bind "^1.0.2"
516587

588+
highlight.js@^9.0.0:
589+
version "9.12.0"
590+
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.12.0.tgz#e6d9dbe57cbefe60751f02af336195870c90c01e"
591+
517592
hosted-git-info@^2.1.4:
518593
version "2.5.0"
519594
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.5.0.tgz#6d60e34b3abbc8313062c3b798ef8d901a07af3c"
@@ -633,6 +708,12 @@ json-stringify-safe@^5.0.1:
633708
version "5.0.1"
634709
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
635710

711+
jsonfile@^4.0.0:
712+
version "4.0.0"
713+
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
714+
optionalDependencies:
715+
graceful-fs "^4.1.6"
716+
636717
jsonify@~0.0.0:
637718
version "0.0.0"
638719
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
@@ -704,7 +785,7 @@ lodash@^4.0.0, lodash@^4.2.1:
704785
version "4.17.4"
705786
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
706787

707-
lodash@^4.17.5:
788+
lodash@^4.13.1, lodash@^4.17.5:
708789
version "4.17.5"
709790
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.5.tgz#99a92d65c0272debe8c96b6057bc8fbfa3bed511"
710791

@@ -734,6 +815,10 @@ map-stream@~0.1.0:
734815
version "0.1.0"
735816
resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194"
736817

818+
marked@^0.3.5:
819+
version "0.3.12"
820+
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.12.tgz#7cf25ff2252632f3fe2406bde258e94eee927519"
821+
737822
mem@^1.1.0:
738823
version "1.1.0"
739824
resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76"
@@ -765,7 +850,7 @@ mimic-fn@^1.0.0:
765850
version "1.1.0"
766851
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18"
767852

768-
minimatch@^3.0.4:
853+
minimatch@^3.0.0, minimatch@^3.0.4:
769854
version "3.0.4"
770855
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
771856
dependencies:
@@ -937,6 +1022,10 @@ process-nextick-args@~1.0.6:
9371022
version "1.0.7"
9381023
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3"
9391024

1025+
progress@^2.0.0:
1026+
version "2.0.0"
1027+
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f"
1028+
9401029
ps-tree@^1.1.0:
9411030
version "1.1.0"
9421031
resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-1.1.0.tgz#b421b24140d6203f1ed3c76996b4427b08e8c014"
@@ -1080,7 +1169,7 @@ shell-quote@^1.6.1:
10801169
array-reduce "~0.0.0"
10811170
jsonify "~0.0.0"
10821171

1083-
shelljs@^0.7.3, shelljs@^0.7.8:
1172+
shelljs@^0.7.0, shelljs@^0.7.3, shelljs@^0.7.8:
10841173
version "0.7.8"
10851174
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3"
10861175
dependencies:
@@ -1255,6 +1344,48 @@ tweak-sourcemap-paths@0.0.3:
12551344
glob "^7.1.2"
12561345
yargs "^9.0.1"
12571346

1347+
typedoc-default-themes@^0.5.0:
1348+
version "0.5.0"
1349+
resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.5.0.tgz#6dc2433e78ed8bea8e887a3acde2f31785bd6227"
1350+
1351+
typedoc-plugin-external-module-name@^1.1.1:
1352+
version "1.1.1"
1353+
resolved "https://registry.yarnpkg.com/typedoc-plugin-external-module-name/-/typedoc-plugin-external-module-name-1.1.1.tgz#0ef2d6a760b42c703519c474258b6f062983aa83"
1354+
1355+
typedoc-plugin-internal-external@^1.0.10:
1356+
version "1.0.10"
1357+
resolved "https://registry.yarnpkg.com/typedoc-plugin-internal-external/-/typedoc-plugin-internal-external-1.0.10.tgz#df9fd6ee1743f009c39b8746a3c26edc36ce8bcd"
1358+
1359+
typedoc-plugin-ui-router@^1.0.6:
1360+
version "1.0.6"
1361+
resolved "https://registry.yarnpkg.com/typedoc-plugin-ui-router/-/typedoc-plugin-ui-router-1.0.6.tgz#6d452d499d1bd35701ebfdeb2beee670d8530e8b"
1362+
1363+
typedoc@0.8.0:
1364+
version "0.8.0"
1365+
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.8.0.tgz#d7172bc6a29964f451b7609c005beadadefe2361"
1366+
dependencies:
1367+
"@types/fs-extra" "^4.0.0"
1368+
"@types/handlebars" "^4.0.31"
1369+
"@types/highlight.js" "^9.1.8"
1370+
"@types/lodash" "^4.14.37"
1371+
"@types/marked" "0.0.28"
1372+
"@types/minimatch" "^2.0.29"
1373+
"@types/shelljs" "^0.7.0"
1374+
fs-extra "^4.0.0"
1375+
handlebars "^4.0.6"
1376+
highlight.js "^9.0.0"
1377+
lodash "^4.13.1"
1378+
marked "^0.3.5"
1379+
minimatch "^3.0.0"
1380+
progress "^2.0.0"
1381+
shelljs "^0.7.0"
1382+
typedoc-default-themes "^0.5.0"
1383+
typescript "2.4.1"
1384+
1385+
typescript@2.4.1:
1386+
version "2.4.1"
1387+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.1.tgz#c3ccb16ddaa0b2314de031e7e6fee89e5ba346bc"
1388+
12581389
uglify-js@^2.6:
12591390
version "2.8.29"
12601391
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"
@@ -1268,6 +1399,14 @@ uglify-to-browserify@~1.0.0:
12681399
version "1.0.2"
12691400
resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"
12701401

1402+
ui-router-typedoc-themes@^1.0.2:
1403+
version "1.0.2"
1404+
resolved "https://registry.yarnpkg.com/ui-router-typedoc-themes/-/ui-router-typedoc-themes-1.0.2.tgz#3274960b8ee61e026b405ce3afcd9a2925992861"
1405+
1406+
universalify@^0.1.0:
1407+
version "0.1.1"
1408+
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7"
1409+
12711410
util-deprecate@~1.0.1:
12721411
version "1.0.2"
12731412
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"

0 commit comments

Comments
 (0)