gulpfile.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. 'use strict';
  6. const path = require( 'path' );
  7. const gulp = require( 'gulp' );
  8. // Lint tasks. ---------------------------------------------------------------
  9. const ckeditor5Lint = require( '@ckeditor/ckeditor5-dev-lint' )();
  10. gulp.task( 'lint', ckeditor5Lint.lint );
  11. gulp.task( 'lint-staged', ckeditor5Lint.lintStaged );
  12. gulp.task( 'pre-commit', [ 'lint-staged' ] );
  13. // Documentation. -------------------------------------------------------------
  14. gulp.task( 'docs', () => {
  15. return require( '@ckeditor/ckeditor5-dev-docs' )
  16. .build( {
  17. readmePath: path.join( process.cwd(), 'README.md' ),
  18. sourceFiles: [
  19. process.cwd() + '/packages/ckeditor5-*/src/**/*.@(js|jsdoc)',
  20. '!' + process.cwd() + '/packages/ckeditor5-*/src/lib/**/*.js'
  21. ],
  22. destinationPath: path.join( process.cwd(), 'build', 'docs' )
  23. } );
  24. } );
  25. // Tests. ---------------------------------------------------------------------
  26. gulp.task( 'test', () => {
  27. return require( '@ckeditor/ckeditor5-dev-tests' )
  28. .runAutomatedTests( getTestOptions() );
  29. } );
  30. gulp.task( 'test:manual', () => {
  31. return require( '@ckeditor/ckeditor5-dev-tests' )
  32. .runManualTests( getTestOptions() );
  33. } );
  34. function getTestOptions() {
  35. return require( '@ckeditor/ckeditor5-dev-tests' )
  36. .parseArguments( process.argv.slice( 2 ) );
  37. }
  38. // Releasing. -----------------------------------------------------------------
  39. gulp.task( 'changelog:dependencies', () => {
  40. return require( '@ckeditor/ckeditor5-dev-env' )
  41. .generateChangelogForDependencies( {
  42. cwd: process.cwd(),
  43. packages: 'packages'
  44. } );
  45. } );
  46. gulp.task( 'release:dependencies', () => {
  47. return require( '@ckeditor/ckeditor5-dev-env' )
  48. .releaseDependencies( {
  49. cwd: process.cwd(),
  50. packages: 'packages'
  51. } );
  52. } );