Skip to content

Commit 0414f4b

Browse files
doc updates
1 parent 933dab0 commit 0414f4b

File tree

6 files changed

+1398
-1420
lines changed

6 files changed

+1398
-1420
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
_build
33
_download
44
_test
5+
node/*.d.ts
6+
node/*.js
7+
node/docs/temp
58

69
# Logs
710
logs

node/docs/genmd.js

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,18 @@ var os = require('os');
55

66
var mdpath = path.join(__dirname, 'vsts-task-lib.md');
77
var jsonpath = path.join(__dirname, 'task.json');
8-
var libpath = path.join(__dirname, '..', 'lib');
8+
var typingspath = path.join(__dirname, '..', 'typings', 'index.d.ts');
9+
10+
var srctemp = path.join(__dirname, 'temp');
11+
shell.rm('-rf', srctemp);
12+
shell.mkdir('-p', srctemp);
13+
shell.cp('../*.ts', srctemp);
14+
shell.cp('../tsconfig.json', srctemp);
15+
shell.cp('-r', '../typings', srctemp);
16+
shell.rm(path.join(srctemp, '*.d.ts'));
17+
//process.exit();
18+
19+
920

1021
//--------------------------------------------------------------
1122
// Util
@@ -19,8 +30,6 @@ var writeLine = function(line) {
1930
fs.appendFileSync(mdpath, (line || ' ') + os.EOL);
2031
}
2132

22-
var apiData = require(jsonpath);
23-
2433
var getChild = function(curr, parts) {
2534
if (!curr || !curr.children) {
2635
return null;
@@ -51,7 +60,12 @@ var getChild = function(curr, parts) {
5160
}
5261

5362
var cache = {};
63+
var apiData;
5464
var get = function(id) {
65+
if (!apiData) {
66+
apiData = require(jsonpath);
67+
}
68+
5569
if (cache.hasOwnProperty(id)) {
5670
return cache[id];
5771
}
@@ -73,13 +87,12 @@ var get = function(id) {
7387
//--------------------------------------------------------------
7488
header('Generating api json');
7589

76-
var tdpath = shell.which('typedoc');
77-
if (!tdpath) {
78-
console.error('could not find typedoc. install via npm globally');
79-
}
90+
var tdpath = path.join(__dirname, '..', 'node_modules', 'typedoc', 'bin', 'typedoc');
91+
console.log('using', tdpath);
8092

81-
shell.rm('-rf', jsonpath);
82-
var c = shell.exec(tdpath + " --module commonjs --json \"" + jsonpath + "\" \"" + libpath + "\"");
93+
shell.rm('-rf', jsonpath);
94+
// --moduleResolution node
95+
var c = shell.exec(tdpath + " --target ES5 --module commonjs --json \"" + jsonpath + "\" \"" + srctemp + "\"");
8396
if (c.code !== 0) {
8497
console.log('failed');
8598
process.exit(1);

0 commit comments

Comments
 (0)