gulpfile.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. } );
  23. } );
  24. gulp.task( 'umberto', () => {
  25. return require( 'umberto' )
  26. .buildSingleProject( {
  27. configDir: 'docs',
  28. clean: true
  29. } );
  30. } );
  31. // Tests. ---------------------------------------------------------------------
  32. gulp.task( 'test', () => {
  33. return require( '@ckeditor/ckeditor5-dev-tests' )
  34. .runAutomatedTests( getTestOptions() );
  35. } );
  36. gulp.task( 'test:manual', () => {
  37. return require( '@ckeditor/ckeditor5-dev-tests' )
  38. .runManualTests( getTestOptions() );
  39. } );
  40. function getTestOptions() {
  41. return require( '@ckeditor/ckeditor5-dev-tests' )
  42. .parseArguments( process.argv.slice( 2 ) );
  43. }
  44. // Translations. --------------------------------------------------------------
  45. gulp.task( 'translations:collect', () => {
  46. return require( '@ckeditor/ckeditor5-dev-env' ).collectTranslations();
  47. } );
  48. gulp.task( 'translations:upload', () => {
  49. return require( '@ckeditor/ckeditor5-dev-env' ).uploadTranslations();
  50. } );
  51. gulp.task( 'translations:download', () => {
  52. return require( '@ckeditor/ckeditor5-dev-env' ).downloadTranslations();
  53. } );
  54. // Releasing. -----------------------------------------------------------------
  55. gulp.task( 'changelog:dependencies', () => {
  56. return require( '@ckeditor/ckeditor5-dev-env' )
  57. .generateChangelogForDependencies( {
  58. cwd: process.cwd(),
  59. packages: 'packages'
  60. } );
  61. } );
  62. gulp.task( 'release:dependencies', () => {
  63. return require( '@ckeditor/ckeditor5-dev-env' )
  64. .releaseDependencies( {
  65. cwd: process.cwd(),
  66. packages: 'packages'
  67. } );
  68. } );