gulpTasks-typedoc.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Import Dependencies.
  2. var gulp = require("gulp");
  3. var typedoc = require("gulp-typedoc");
  4. // Import Tools.
  5. var validateTypedoc = require("../helpers/gulp-validateTypedoc");
  6. // Read the full config.
  7. var config = require("../config.json");
  8. /**
  9. * Generate the TypeDoc JSON output in order to create code metadata.
  10. */
  11. gulp.task("typedoc-generate", function() {
  12. return gulp
  13. .src([
  14. "../../dist/preview release/babylon.d.ts",
  15. "../../dist/preview release/gui/babylon.gui.d.ts",
  16. "../../dist/preview release/loaders/babylon.glTF2FileLoader.d.ts",
  17. "../../dist/preview release/serializers/babylon.glTF2Serializer.d.ts",
  18. "../../dist/preview release/glTF2Interface/babylon.glTF2Interface.d.ts"])
  19. .pipe(typedoc({
  20. // TypeScript options (see typescript docs)
  21. mode: "modules",
  22. module: "commonjs",
  23. target: "es5",
  24. includeDeclarations: true,
  25. // Output options (see typedoc docs)
  26. json: config.build.typedocJSON,
  27. // TypeDoc options (see typedoc docs)
  28. ignoreCompilerErrors: true,
  29. readme: "none",
  30. excludeExternals: true,
  31. excludePrivate: true,
  32. excludeProtected: true,
  33. entryPoint: ["\"babylon.d\"", "BABYLON"]
  34. }));
  35. });
  36. /**
  37. * Validate the TypeDoc JSON output against the current baselin to ensure our code is correctly documented.
  38. * (in the newly introduced areas)
  39. */
  40. gulp.task("typedoc-validate", function() {
  41. return gulp.src(config.build.typedocJSON)
  42. .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, false));
  43. });
  44. /**
  45. * Generate the validation reference to ensure our code is correctly documented.
  46. */
  47. gulp.task("typedoc-generateValidationBaseline", function() {
  48. return gulp.src(config.build.typedocJSON)
  49. .pipe(validateTypedoc(config.build.typedocValidationBaseline, "BABYLON", true, true));
  50. });
  51. /**
  52. * Validate the code comments and style case convention through typedoc and
  53. * generate the new baseline.
  54. */
  55. gulp.task("typedoc-all", gulp.series("typedoc-generate", "typedoc-validate", "typedoc-generateValidationBaseline"));