changelog.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/usr/bin/env node
  2. /**
  3. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  4. * For licensing, see LICENSE.md.
  5. */
  6. /* eslint-env node */
  7. 'use strict';
  8. // In order to use the same version for all packages (including builds and ckeditor5 itself), you can call:
  9. // npm run changelog [newVersion]
  10. const devEnv = require( '@ckeditor/ckeditor5-dev-env' );
  11. const commonOptions = {
  12. cwd: process.cwd(),
  13. packages: 'packages',
  14. // `newVersion` is mostly used for testing purposes. It allows generating changelog that contains the same version for all packages.
  15. newVersion: process.argv[ 2 ] || null
  16. };
  17. const editorBuildsGlob = '@ckeditor/ckeditor5-build-*';
  18. const optionsForDependencies = Object.assign( {}, commonOptions, {
  19. skipPackages: editorBuildsGlob
  20. } );
  21. const optionsForBuilds = Object.assign( {}, commonOptions, {
  22. scope: editorBuildsGlob
  23. } );
  24. Promise.resolve()
  25. .then( () => devEnv.generateChangelogForSubRepositories( optionsForDependencies ) )
  26. .then( () => devEnv.generateSummaryChangelog( optionsForBuilds ) )
  27. .then( () => {
  28. console.log( 'Done!' );
  29. } )
  30. .catch( err => {
  31. console.error( err.stack );
  32. } );