8
0

gulpfile.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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() + '/node_modules/ckeditor5-*/src/**/*.@(js|jsdoc)',
  20. '!' + process.cwd() + '/node_modules/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. }