changelog.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. // yarn 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. skipMainRepository: true
  21. } );
  22. const optionsForBuilds = Object.assign( {}, commonOptions, {
  23. scope: editorBuildsGlob
  24. } );
  25. Promise.resolve()
  26. .then( () => devEnv.generateChangelogForSubRepositories( optionsForDependencies ) )
  27. .then( () => devEnv.generateSummaryChangelog( optionsForBuilds ) )
  28. .then( () => {
  29. console.log( 'Done!' );
  30. } )
  31. .catch( err => {
  32. console.error( err.stack );
  33. } );