gulpfile.js 2.3 KB

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