Skip to content

Commit

Permalink
[#777] Add typedoc build command (#782)
Browse files Browse the repository at this point in the history
Related #777

## Changes:

- Update grunt-ts for TS 2.2.2
- Add rimraf package
- Update specs for new Node typings
- Add `apidocs` Grunt task that builds Typedoc docs

See a2a78b6 for the actual real changes.

This is in preparation for allowing the excaliburjs/excaliburjs.github.io repository to build docs from the core repo and use those, instead of us always having to update that repo with the current Typedoc commands.
  • Loading branch information
kamranayub authored and eonarheim committed Apr 15, 2017
1 parent 63bff8a commit bb9dae0
Show file tree
Hide file tree
Showing 73 changed files with 575 additions and 347 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coverage/
.grunt/
.tscache/
tscommand*
/docs/api/

# Logs and databases #
######################
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "typedoc-default-themes"]
path = typedoc-default-themes
url = https://github.com/excaliburjs/typedoc-default-themes.git
ignore = dirty
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ script:
- node_modules/.bin/grunt travis
after_success:
- node deploy-docs.js
- if [ "$TRAVIS_BRANCH" = "master" ]; then node_modules/.bin/grunt bumpup dists; fi
- if [ "$TRAVIS_BRANCH" = "master" ]; then node_modules/.bin/grunt dists; fi
notifications:
slack:
secure: aQXFk2/MxX5eR2JM90xWAA9YX03QArY1ejUmnP/NkFHbB4zzKZblACjEeDTDTDCThZpXhrganX2nDWrWFrrXbOG28wKrRhEZSULPAgyiWGpfkMoT44fKmgh+eZ5C/isMF2eeQCrYo3EQCMxfCKxNaBhyLc+jr/Sm232zU2LaXo8=
49 changes: 46 additions & 3 deletions GruntFile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/*********************************
/* Excalibur.js Grunt Build File
/*********************************/
var path = require('path');
const path = require('path');
const fs = require('fs');
const child_process = require('child_process');
const rimraf = require('rimraf');
const TYPEDOC_CMD = path.join('node_modules', '.bin', 'typedoc');

var appveyorBuild = process.env.APPVEYOR_BUILD_NUMBER || '';

if (appveyorBuild) {
Expand All @@ -17,7 +22,7 @@ module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
version: '<%= pkg.version %>' + appveyorBuild,
tscCmd: path.join('node_modules', '.bin', 'tsc'),

//
// Clean dists and tests
//
Expand Down Expand Up @@ -341,5 +346,43 @@ module.exports = function (grunt) {
grunt.registerTask('appveyor', ['default', 'shell:nuget']);

// CI task to deploy dists
grunt.registerTask('dists', ['buildcontrol']);
grunt.registerTask('dists', ['bumpup', 'buildcontrol']);

// CI task to build API docs
// Typically called by excaliburjs.github.io CI job to generate versioned docs
grunt.registerTask('apidocs', 'Build API documentation', function (version) {
version = version || "Edge";

console.log("Removing existing docs...");

rimraf.sync('docs/api/');

console.log("Compiling default template (default)...");
try {
if (!fs.existsSync('./typedoc-default-themes/node_modules')) {
child_process.execSync("npm install", { cwd: "./typedoc-default-themes", stdio: [0,1,2] });
}
} catch (e) {
// fails to execute Linux commands, OK
}

console.log("Executing typedoc...");

child_process.execSync(TYPEDOC_CMD +
' --name "Excalibur.js ' + version + ' API Documentation"' +
' --mode modules' +
' --readme src/engine/Docs/Index.md' +
' --includes src/engine/Docs' +
' --out docs/api' +
' --theme typedoc-default-themes/bin/default' +
' --hideGenerator' +
' --excludePrivate' +
' --listInvalidSymbolLinks' +
' --gaID UA-46390208-1' +
' --gaSite excaliburjs.com' +
' --tsconfig src/engine/tsconfig.json' +
' src/engine', {
stdio: [0,1,2]
});
});
};
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ npm run tests

# Compile HTML visual tests
npm run visual

# Compile API docs
npm run apidocs
```

Advanced users can optionally install `grunt-cli` and run the grunt tasks (same task names).
Expand Down
Binary file added node_shrinkwrap/@types-fs-extra-0.0.33.tar
Binary file not shown.
Binary file added node_shrinkwrap/@types-handlebars-4.0.32.tar
Binary file not shown.
Binary file added node_shrinkwrap/@types-highlight.js-9.1.9.tar
Binary file not shown.
Binary file added node_shrinkwrap/@types-lodash-4.14.62.tar
Binary file not shown.
Binary file added node_shrinkwrap/@types-marked-0.0.28.tar
Binary file not shown.
Binary file added node_shrinkwrap/@types-minimatch-2.0.29.tar
Binary file not shown.
Binary file added node_shrinkwrap/@types-node-7.0.12.tar
Binary file not shown.
Binary file added node_shrinkwrap/@types-shelljs-0.3.33.tar
Binary file not shown.
Binary file added node_shrinkwrap/bcrypt-pbkdf-1.0.1.tar
Binary file not shown.
Binary file added node_shrinkwrap/ecc-jsbn-0.1.1.tar
Binary file not shown.
Binary file not shown.
Binary file removed node_shrinkwrap/for-own-0.1.4.tar
Binary file not shown.
Binary file added node_shrinkwrap/for-own-0.1.5.tar
Binary file not shown.
Binary file added node_shrinkwrap/fs-extra-2.1.2.tar
Binary file not shown.
Binary file not shown.
Binary file added node_shrinkwrap/handlebars-4.0.5.tar
Binary file not shown.
Binary file added node_shrinkwrap/highlight.js-9.10.0.tar
Binary file not shown.
Binary file added node_shrinkwrap/interpret-1.0.2.tar
Binary file not shown.
Binary file added node_shrinkwrap/jodid25519-1.0.2.tar
Binary file not shown.
Binary file added node_shrinkwrap/jsbn-0.1.1.tar
Binary file not shown.
Binary file added node_shrinkwrap/jsmin2-1.2.1.tar
Binary file not shown.
Binary file added node_shrinkwrap/marked-0.3.6.tar
Binary file not shown.
Binary file not shown.
Binary file added node_shrinkwrap/rechoir-0.6.2.tar
Binary file not shown.
Binary file not shown.
Binary file added node_shrinkwrap/rimraf-2.6.1.tar
Binary file not shown.
Binary file added node_shrinkwrap/shelljs-0.7.7.tar
Binary file not shown.
Binary file added node_shrinkwrap/source-map-0.2.0.tar
Binary file not shown.
Binary file added node_shrinkwrap/tweetnacl-0.14.5.tar
Binary file not shown.
Binary file added node_shrinkwrap/typedoc-0.5.10.tar
Binary file not shown.
Binary file added node_shrinkwrap/typedoc-default-themes-0.4.3.tar
Binary file not shown.
Loading

0 comments on commit bb9dae0

Please sign in to comment.