|
|
@@ -19,6 +19,8 @@ gulp.task( 'pre-commit', [ 'lint-staged' ] );
|
|
|
// Documentation. -------------------------------------------------------------
|
|
|
|
|
|
gulp.task( 'docs', () => {
|
|
|
+ assertIsInstalled( '@ckeditor/ckeditor5-dev-docs' );
|
|
|
+
|
|
|
return require( '@ckeditor/ckeditor5-dev-docs' )
|
|
|
.build( {
|
|
|
readmePath: path.join( process.cwd(), 'README.md' ),
|
|
|
@@ -50,20 +52,28 @@ function getTestOptions() {
|
|
|
// Translations. --------------------------------------------------------------
|
|
|
|
|
|
gulp.task( 'translations:collect', () => {
|
|
|
+ assertIsInstalled( '@ckeditor/ckeditor5-dev-env' );
|
|
|
+
|
|
|
return require( '@ckeditor/ckeditor5-dev-env' ).collectTranslations();
|
|
|
} );
|
|
|
|
|
|
gulp.task( 'translations:upload', () => {
|
|
|
+ assertIsInstalled( '@ckeditor/ckeditor5-dev-env' );
|
|
|
+
|
|
|
return require( '@ckeditor/ckeditor5-dev-env' ).uploadTranslations();
|
|
|
} );
|
|
|
|
|
|
gulp.task( 'translations:download', () => {
|
|
|
+ assertIsInstalled( '@ckeditor/ckeditor5-dev-env' );
|
|
|
+
|
|
|
return require( '@ckeditor/ckeditor5-dev-env' ).downloadTranslations();
|
|
|
} );
|
|
|
|
|
|
// Releasing. -----------------------------------------------------------------
|
|
|
|
|
|
gulp.task( 'changelog:dependencies', () => {
|
|
|
+ assertIsInstalled( '@ckeditor/ckeditor5-dev-env' );
|
|
|
+
|
|
|
return require( '@ckeditor/ckeditor5-dev-env' )
|
|
|
.generateChangelogForDependencies( {
|
|
|
cwd: process.cwd(),
|
|
|
@@ -72,9 +82,23 @@ gulp.task( 'changelog:dependencies', () => {
|
|
|
} );
|
|
|
|
|
|
gulp.task( 'release:dependencies', () => {
|
|
|
+ assertIsInstalled( '@ckeditor/ckeditor5-dev-env' );
|
|
|
+
|
|
|
return require( '@ckeditor/ckeditor5-dev-env' )
|
|
|
.releaseDependencies( {
|
|
|
cwd: process.cwd(),
|
|
|
packages: 'packages'
|
|
|
} );
|
|
|
} );
|
|
|
+
|
|
|
+function assertIsInstalled( packageName ) {
|
|
|
+ try {
|
|
|
+ require( packageName + '/package.json' );
|
|
|
+ } catch ( err ) {
|
|
|
+ console.error( `Error: Cannot find package '${ packageName }'.\n` );
|
|
|
+ console.error( `You need to install optional dependencies.` );
|
|
|
+ console.error( `Run: 'npm run install-optional-dependencies'.` );
|
|
|
+
|
|
|
+ process.exit( 1 );
|
|
|
+ }
|
|
|
+}
|