Permalink
Browse files

Post-merge; Repo now includes a restructured version of tsd-jsdoc wit…

…h our changes incorporated for issues/prs, see #550
  • Loading branch information...
dcodeIO committed Dec 15, 2016
1 parent 82e8dd4 commit 8f407a18607334185afcc85ee98dc1478322bd01
@@ -51,7 +51,8 @@ exports.main = function(args) {
// There is no proper API for jsdoc, so this executes the CLI and pipes the output
var basedir = path.join(__dirname, "..");
var child = child_process.exec("node \"" + basedir + "/node_modules/jsdoc/jsdoc.js\" -c \"" + basedir + "/jsdoc.types.json\" " + files.map(function(file) { return '"' + file + '"'; }).join(' '), {
var moduleName = argv.name || "mymodule";
var child = child_process.exec("node \"" + basedir + "/node_modules/jsdoc/jsdoc.js\" -c \"" + basedir + "/jsdoc.types.json\" -q \"module=" + encodeURIComponent(moduleName) + "\" " + files.map(function(file) { return '"' + file + '"'; }).join(' '), {
cwd: process.cwd(),
argv0: "node",
stdio: "pipe"
@@ -69,23 +70,15 @@ exports.main = function(args) {
return;
}
var dts = out.join('').replace(/{$/mg, "{\n").trim();
var header = [
var output = [
"// $> pbts " + process.argv.slice(2).join(' '),
"// Generated " + (new Date()).toUTCString().replace(/GMT/, "UTC"),
""
];
// Remove declare statements and wrap everything in a module
dts = dts.replace(/\bdeclare\s/g, "");
dts = dts.replace(/^/mg, " ");
dts = header.join('\n')+"\ndeclare module " + JSON.stringify(argv.name || "mymodule") + " {\n\n" + dts + "\n\n}\n";
].join('\n') + "\n" + out.join('');
if (argv.out)
fs.writeFileSync(argv.out, dts);
fs.writeFileSync(argv.out, output);
else
process.stdout.write(dts, "utf8");
process.stdout.write(output, "utf8");
});
return undefined;
@@ -7,17 +7,14 @@
"includePattern": ".+\\.js(doc)?$",
"excludePattern": "(^|\\/|\\\\)_"
},
"templates": {
"jsdoc2tsd": {
"interfacePrefix" : ""
}
},
"opts": {
"encoding" : "utf8",
"recurse" : true,
"private" : false,
"lenient" : true,
"destination" : "console",
"template" : "./node_modules/tsd-jsdoc"
"template" : "./lib/tsd-jsdoc",
"private" : false,
"comments" : true,
"destination" : false
}
}
@@ -0,0 +1,23 @@
protobuf.js fork of tsd-jsdoc
=============================
This is a slightly modified and restructured version of [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc) for use with protobuf.js, parked here so we can process issues and pull requests.
Options
-------
* **module: `string`**<br />
Wraps everything in a module of the specified name.
* **private: `boolean`**<br />
Skips private members when set to `false`.
* **comments: `boolean`**<br />
Skips any comments when set to `false`.
* **destination: `string|boolean`**<br />
Saves to the specified destination file or to console when set to `false`.
Setting options on the command line
-----------------------------------
Providing `-q, --query <queryString>` on the command line will set respectively override existing options.
Oops, something went wrong.

0 comments on commit 8f407a1

Please sign in to comment.