Selaa lähdekoodia

Merge pull request #270 from ckeditor/t/217

Removed dev tasks and moved to separate repository.
Piotrek Koszuliński 9 vuotta sitten
vanhempi
commit
be2677c64d

+ 0 - 78
dev/tasks/dev/tasks.js

@@ -1,78 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const gulp = require( 'gulp' );
-const minimist = require( 'minimist' );
-const statusTask = require( './tasks/status' );
-const initTask = require( './tasks/init' );
-const installTask = require( './tasks/install' );
-const pluginCreateTask = require( './tasks/create-package' );
-const updateTask = require( './tasks/update' );
-const relinkTask = require( './tasks/relink' );
-
-module.exports = ( config ) => {
-	const ckeditor5Path = process.cwd();
-	const packageJSON = require( '../../../package.json' );
-	const tasks = {
-		updateRepositories() {
-			const options = minimist( process.argv.slice( 2 ), {
-				boolean: [ 'npm-update' ],
-				default: {
-					'npm-update': false
-				}
-			} );
-
-			return updateTask( installTask, ckeditor5Path, packageJSON, config.WORKSPACE_DIR, options[ 'npm-update' ] );
-		},
-
-		checkStatus() {
-			return statusTask( ckeditor5Path, packageJSON, config.WORKSPACE_DIR );
-		},
-
-		initRepository() {
-			return initTask( installTask, ckeditor5Path, packageJSON, config.WORKSPACE_DIR );
-		},
-
-		createPackage( done ) {
-			pluginCreateTask( ckeditor5Path, config.WORKSPACE_DIR )
-				.then( done )
-				.catch( ( error ) => done( error ) );
-		},
-
-		relink() {
-			return relinkTask( ckeditor5Path, packageJSON, config.WORKSPACE_DIR );
-		},
-
-		installPackage() {
-			const options = minimist( process.argv.slice( 2 ), {
-				string: [ 'package' ],
-				default: {
-					plugin: ''
-				}
-			} );
-
-			if ( options.package ) {
-				return installTask( ckeditor5Path, config.WORKSPACE_DIR, options.package );
-			} else {
-				throw new Error( 'Please provide a package to install: gulp dev-install --plugin <path|GitHub URL|name>' );
-			}
-		},
-
-		register() {
-			gulp.task( 'init', tasks.initRepository );
-			gulp.task( 'create-package', tasks.createPackage );
-			gulp.task( 'update', tasks.updateRepositories );
-			gulp.task( 'pull', tasks.updateRepositories );
-			gulp.task( 'status', tasks.checkStatus );
-			gulp.task( 'st', tasks.checkStatus );
-			gulp.task( 'relink', tasks.relink );
-			gulp.task( 'install', tasks.installPackage );
-		}
-	};
-
-	return tasks;
-};

+ 0 - 129
dev/tasks/dev/tasks/create-package.js

@@ -1,129 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const inquiries = require( '../utils/inquiries' );
-const path = require( 'path' );
-const { git, tools, log } = require( 'ckeditor5-dev-utils' );
-
-/**
- * 1. Ask for new package name.
- * 2. Ask for initial version.
- * 3. Ask for GitHub path.
- * 4. Initialize repository.
- * 5. Add remote.
- * 6. Copy files to new repository.
- * 7. Update package.json file in new package's repository.
- * 8. Update package.json file in CKEditor5 repository.
- * 9. Create initial commit.
- * 10. Link new package.
- * 11. Call `npm install` in package repository.
- *
- * @param {String} ckeditor5Path Path to main CKEditor5 repository.
- * @param {String} workspaceRoot Relative path to workspace root.
- * @returns {Promise} Returns promise fulfilled after task is done.
- */
-module.exports = ( ckeditor5Path, workspaceRoot ) => {
-	const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
-	const fileStructure = {
-		'./': [
-			'.editorconfig',
-			'.jshintrc',
-			'.jscsrc',
-			'.gitattributes',
-			'dev/tasks/dev/templates/.gitignore',
-			'dev/tasks/dev/templates/CHANGES.md',
-			'dev/tasks/dev/templates/CONTRIBUTING.md',
-			'dev/tasks/dev/templates/gulpfile.js',
-			'dev/tasks/dev/templates/LICENSE.md',
-			'dev/tasks/dev/templates/package.json',
-			'dev/tasks/dev/templates/README.md'
-		],
-		'tests/': [
-			'tests/.jshintrc'
-		],
-		'dev/': [
-			'dev/.jshintrc'
-		]
-	};
-
-	let packageName;
-	let packageFullName;
-	let repositoryPath;
-	let packageVersion;
-	let gitHubPath;
-	let packageDescription;
-
-	return inquiries.getPackageName()
-		.then( result => {
-			packageName = result;
-			repositoryPath = path.join( workspaceAbsolutePath, packageName );
-
-			return inquiries.getApplicationName();
-		} )
-		.then( result => {
-			packageFullName = result;
-
-			return inquiries.getPackageVersion();
-		} )
-		.then( result => {
-			packageVersion = result;
-
-			return inquiries.getPackageGitHubPath( packageName );
-		} )
-		.then( result => {
-			gitHubPath = result;
-
-			return inquiries.getPackageDescription();
-		} )
-		.then( result => {
-			packageDescription = result;
-
-			log.out( `Initializing repository ${ repositoryPath }...` );
-			git.initializeRepository( repositoryPath );
-
-			log.out( `Adding remote ${ repositoryPath }...` );
-			git.addRemote( repositoryPath, gitHubPath );
-
-			log.out( `Copying files into ${ repositoryPath }...` );
-
-			for ( let destination in fileStructure ) {
-				tools.copyTemplateFiles( fileStructure[ destination ], path.join( repositoryPath, destination ), {
-					'{{AppName}}': packageFullName,
-					'{{GitHubRepositoryPath}}': gitHubPath,
-					'{{ProjectDescription}}': packageDescription
-				} );
-			}
-
-			log.out( `Updating package.json files...` );
-			tools.updateJSONFile( path.join( repositoryPath, 'package.json' ), ( json ) => {
-				json.name = packageName;
-				json.version = packageVersion;
-				json.description = packageDescription;
-
-				return json;
-			} );
-
-			tools.updateJSONFile( path.join( ckeditor5Path, 'package.json' ), ( json ) => {
-				if ( !json.dependencies ) {
-					json.dependencies = {};
-				}
-				json.dependencies[ packageName ] = gitHubPath;
-				json.dependencies = tools.sortObject( json.dependencies );
-
-				return json;
-			} );
-
-			log.out( `Creating initial commit...` );
-			git.initialCommit( packageName, repositoryPath );
-
-			log.out( `Linking ${ packageName } to node_modules...` );
-			tools.linkDirectories( repositoryPath, path.join( ckeditor5Path, 'node_modules', packageName ) );
-
-			log.out( `Running npm install in ${ packageName }.` );
-			tools.npmInstall( repositoryPath );
-		} );
-};

+ 0 - 32
dev/tasks/dev/tasks/init.js

@@ -1,32 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const { workspace, log } = require( 'ckeditor5-dev-utils' );
-
-/**
- * 1. Get CKEditor5 dependencies from package.json file.
- * 2. Run install task on each dependency.
- *
- * @param {Function} installTask Install task to use on each dependency.
- * @param {String} ckeditor5Path Path to main CKEditor5 repository.
- * @param {Object} packageJSON Parsed package.json file from CKEditor5 repository.
- * @param {String} workspaceRoot Relative path to workspace root.
- */
-module.exports = ( installTask, ckeditor5Path, packageJSON, workspaceRoot ) => {
-	// Get all CKEditor dependencies from package.json.
-	const dependencies = workspace.getDependencies( packageJSON.dependencies );
-
-	if ( dependencies ) {
-		for ( let dependency in dependencies ) {
-			const repositoryURL = dependencies[ dependency ];
-			log.out( `\x1b[1m\x1b[36m${ dependency }\x1b[0m` );
-			installTask( ckeditor5Path, workspaceRoot, repositoryURL );
-		}
-	} else {
-		log.out( 'No CKEditor5 dependencies (ckeditor5-) found in package.json file.' );
-	}
-};

+ 0 - 103
dev/tasks/dev/tasks/install.js

@@ -1,103 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const path = require( 'path' );
-const { git, tools, log } = require( 'ckeditor5-dev-utils' );
-
-/**
- * This tasks install specified package in development mode. It can be executed by typing:
- * 		grunt dev-install --package <git_hub_url|npm_name|path_on_disk>
- *
- *
- * It performs following steps:
- * 1. If GitHub URL is provided - clones the repository.
- * 2. If NPM module name is provided - gets GitHub URL from NPM and clones the repository.
- * 3. If path on disk is provided - it is used directly.
- * 4. Runs `npm install` in package repository.
- * 5. Links package directory into `ckeditor5/node_modules/`.
- * 6. Adds dependency to `ckeditor5/package.json`.
- *
- * @param {String} ckeditor5Path Absolute path to `ckeditor5` repository.
- * @param {String} workspaceRoot Relative path to workspace root directory.
- * @param {String} name Name of the NPM package or GitHub URL.
- */
-module.exports = ( ckeditor5Path, workspaceRoot, name ) => {
-	const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
-	let repositoryPath;
-	let dependency;
-	let urlInfo;
-
-	// First check if name is local path to repository.
-	repositoryPath = path.isAbsolute( name ) ? name : path.resolve( name );
-
-	if ( tools.isDirectory( repositoryPath ) ) {
-		const packageName = tools.readPackageName( repositoryPath );
-
-		if ( packageName ) {
-			log.out( `Plugin located at ${ repositoryPath }.` );
-			urlInfo = {
-				name: packageName
-			};
-
-			dependency = repositoryPath;
-		}
-	}
-
-	// Check if name is repository URL.
-	if ( !urlInfo ) {
-		urlInfo = git.parseRepositoryUrl( name );
-		dependency = name;
-	}
-
-	// Check if name is NPM package.
-	if ( !urlInfo ) {
-		log.out( `Not a GitHub URL. Trying to get GitHub URL from NPM package...` );
-		const url = tools.getGitUrlFromNpm( name );
-
-		if ( url ) {
-			urlInfo = git.parseRepositoryUrl( url );
-			dependency  = url;
-		}
-	}
-
-	if ( urlInfo ) {
-		repositoryPath = path.join( workspaceAbsolutePath, urlInfo.name );
-
-		if ( tools.isDirectory( repositoryPath ) ) {
-			log.out( `Directory ${ repositoryPath } already exists.` );
-		} else {
-			log.out( `Cloning ${ urlInfo.name } into ${ repositoryPath }...` );
-			git.cloneRepository( urlInfo, workspaceAbsolutePath );
-		}
-
-		// Checkout to specified branch if one is provided.
-		if ( urlInfo.branch ) {
-			log.out( `Checking ${ urlInfo.name } to ${ urlInfo.branch }...` );
-			git.checkout( repositoryPath, urlInfo.branch );
-		}
-
-		// Run `npm install` in new repository.
-		log.out( `Running "npm install" in ${ urlInfo.name }...` );
-		tools.npmInstall( repositoryPath );
-
-		const linkPath = path.join( ckeditor5Path, 'node_modules', urlInfo.name );
-
-		log.out( `Linking ${ linkPath } to ${ repositoryPath }...` );
-		tools.linkDirectories( repositoryPath, linkPath );
-
-		log.out( `Adding ${ urlInfo.name } dependency to CKEditor5 package.json...` );
-		tools.updateJSONFile( path.join( ckeditor5Path, 'package.json' ), ( json ) => {
-			json.dependencies = json.dependencies || {};
-			json.dependencies[ urlInfo.name ] = dependency;
-			json.dependencies = tools.sortObject( json.dependencies );
-
-			return json;
-		} );
-	} else {
-		throw new Error( 'Please provide valid GitHub URL, NPM module name or path.' );
-	}
-};

+ 0 - 50
dev/tasks/dev/tasks/relink.js

@@ -1,50 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const path = require( 'path' );
-const { workspace, tools, log } = require( 'ckeditor5-dev-utils' );
-
-/**
- * 1. Get CKEditor5 dependencies from package.json file.
- * 2. Scan workspace for repositories that match dependencies from package.json file.
- * 3. Link repositories to node_modules in CKEditor5 repository.
- *
- * @param {String} ckeditor5Path Path to main CKEditor5 repository.
- * @param {Object} packageJSON Parsed package.json file from CKEditor5 repository.
- * @param {String} workspaceRoot Relative path to workspace root.
- */
-module.exports = ( ckeditor5Path, packageJSON, workspaceRoot ) => {
-	const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
-
-	// Get all CKEditor dependencies from package.json.
-	const dependencies = workspace.getDependencies( packageJSON.dependencies );
-
-	if ( dependencies ) {
-		const directories = workspace.getDirectories( workspaceAbsolutePath );
-
-		if ( directories.length ) {
-			for ( let dependency in dependencies ) {
-				const repositoryAbsolutePath = path.join( workspaceAbsolutePath, dependency );
-				const repositoryURL = dependencies[ dependency ];
-
-				// Check if repository's directory exists.
-				if ( directories.indexOf( dependency ) > -1 ) {
-					try {
-						log.out( `Linking ${ repositoryURL }...` );
-						tools.linkDirectories( repositoryAbsolutePath, path.join( ckeditor5Path, 'node_modules', dependency ) );
-					} catch ( error ) {
-						log.err( error );
-					}
-				}
-			}
-		} else {
-			log.out( 'No CKEditor5 plugins in development mode.' );
-		}
-	} else {
-		log.out( 'No CKEditor5 dependencies found in package.json file.' );
-	}
-};

+ 0 - 50
dev/tasks/dev/tasks/status.js

@@ -1,50 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const path = require( 'path' );
-const { workspace, git, log } = require( 'ckeditor5-dev-utils' );
-
-/**
- * 1. Get CKEditor5 dependencies from package.json file.
- * 2. Scan workspace for repositories that match dependencies from package.json file.
- * 3. Print GIT status using `git status --porcelain -sb` command.
- *
- * @param {String} ckeditor5Path Path to main CKEditor5 repository.
- * @param {Object} packageJSON Parsed package.json file from CKEditor5 repository.
- * @param {String} workspaceRoot Relative path to workspace root.
- */
-module.exports = ( ckeditor5Path, packageJSON, workspaceRoot ) => {
-	const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
-
-	// Get all CKEditor dependencies from package.json.
-	const dependencies = workspace.getDependencies( packageJSON.dependencies );
-
-	if ( dependencies ) {
-		const directories = workspace.getDirectories( workspaceAbsolutePath );
-
-		if ( directories.length ) {
-			for ( let dependency in dependencies ) {
-				const repositoryAbsolutePath = path.join( workspaceAbsolutePath, dependency );
-				let status;
-
-				// Check if repository's directory already exists.
-				if ( directories.indexOf( dependency ) > -1 ) {
-					try {
-						status = git.getStatus( repositoryAbsolutePath );
-						log.out( `\x1b[1m\x1b[36m${ dependency }\x1b[0m\n${ status.trim() }` );
-					} catch ( error ) {
-						log.err( error );
-					}
-				}
-			}
-		} else {
-			log.out( 'No CKEditor5 plugins in development mode.' );
-		}
-	} else {
-		log.out( 'No CKEditor5 dependencies found in package.json file.' );
-	}
-};

+ 0 - 94
dev/tasks/dev/tasks/update.js

@@ -1,94 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const path = require( 'path' );
-const { tools, workspace, git, log } = require( 'ckeditor5-dev-utils' );
-
-/**
- * 1. Fetch all branches from each origin in main CKEditor 5 repository.
- * 2. Get CKEditor 5 dependencies from package.json in main CKEditor 5 repository.
- * 3. If dependency's repository is already cloned in workspace:
- *		3.1. Fetch all branches from each origin.
- *		3.2. Checkout to specified branch.
- *		3.3. Pull changes to that branch.
- *		3.4. if --npm-update was specified run npm update --dev in that repository.
- *		3.5. Recreate symbolic link between repo and main node_modules.
- * 4. If dependency's repository is not cloned yet - run gulp install on this dependency.
- * 5. Remove symbolic links to dependencies that are not used in current package.json configuration.
- * 6. if --npm-update was specified run npm update --dev in main CKEditor 5 repository.
- *
- * @param {Function} installTask Install task to use on each dependency that is missing from workspace.
- * @param {String} ckeditor5Path Path to main CKEditor5 repository.
- * @param {Object} packageJSON Parsed package.json file from CKEditor5 repository.
- * @param {String} workspaceRoot Relative path to workspace root.
- * @param {Boolean} runNpmUpdate When set to true `npm update` will be executed inside each plugin repository
- * and inside CKEditor 5 repository.
- */
-module.exports = ( installTask, ckeditor5Path, packageJSON, workspaceRoot, runNpmUpdate ) => {
-	const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
-
-	// Fetch main repository
-	log.out( `Fetching branches from ${ packageJSON.name }...` );
-	git.fetchAll( ckeditor5Path );
-
-	// Get all CKEditor dependencies from package.json.
-	const dependencies = workspace.getDependencies( packageJSON.dependencies );
-
-	if ( dependencies ) {
-		const directories = workspace.getDirectories( workspaceAbsolutePath );
-
-		for ( let dependency in dependencies ) {
-			const repositoryURL = dependencies[ dependency ];
-			const urlInfo = git.parseRepositoryUrl( repositoryURL );
-			const repositoryAbsolutePath = path.join( workspaceAbsolutePath, dependency );
-
-			// Check if repository's directory already exists.
-			if ( directories.indexOf( urlInfo.name ) > -1 ) {
-				log.out( `Fetching branches from ${ urlInfo.name }...` );
-				git.fetchAll( repositoryAbsolutePath );
-
-				log.out( `Checking out ${ urlInfo.name } to ${ urlInfo.branch }...` );
-				git.checkout( repositoryAbsolutePath, urlInfo.branch );
-
-				log.out( `Pulling changes to ${ urlInfo.name }...` );
-				git.pull( repositoryAbsolutePath, urlInfo.branch );
-
-				if ( runNpmUpdate ) {
-					log.out( `Running "npm update" in ${ urlInfo.name }...` );
-					tools.npmUpdate( repositoryAbsolutePath );
-				}
-
-				try {
-					log.out( `Linking ${ repositoryURL }...` );
-					tools.linkDirectories( repositoryAbsolutePath, path.join( ckeditor5Path, 'node_modules', dependency ) );
-				} catch ( error ) {
-					log.err( error );
-				}
-			} else {
-				// Directory does not exits in workspace - install it.
-				installTask( ckeditor5Path, workspaceRoot, repositoryURL );
-			}
-		}
-
-		if ( runNpmUpdate ) {
-			log.out( `Running "npm update" in CKEditor5 repository...` );
-			tools.npmUpdate( ckeditor5Path );
-		}
-	} else {
-		log.out( 'No CKEditor5 dependencies found in package.json file.' );
-	}
-
-	// Remove symlinks not used in this configuration.
-	const nodeModulesPath = path.join( ckeditor5Path, 'node_modules' );
-	const symlinks = workspace.getSymlinks( nodeModulesPath );
-	symlinks
-		.filter( dir => typeof dependencies[ dir ] == 'undefined' )
-		.forEach( dir => {
-			log.out( `Removing symbolic link to ${ dir }.` );
-			tools.removeSymlink( path.join( nodeModulesPath, dir ) );
-		} );
-};

+ 0 - 10
dev/tasks/dev/templates/.gitignore

@@ -1,10 +0,0 @@
-# These files will be ignored by Git and by our linting tools:
-#	grunt jshint
-#	grunt jscs
-#
-# Be sure to append /** to folders to have everything inside them ignored.
-
-# All "dot directories".
-.*/**
-
-node_modules/**

+ 0 - 25
dev/tasks/dev/templates/CHANGES.md

@@ -1,25 +0,0 @@
-{{AppName}} Changelog
-========================================
-
-## {{AppName}} 0.0.2
-
-**Major|Minor|Patch Release** - Build Date: yyyy-mm-dd
-
-New Features:
-
-* [#Issue Number](http://issue/url): Item 1.
-* Item 2
-
-Fixed Issues:
-
-* [#Issue Number](http://issue/url): Item 1.
-* Item 2
-
-Other Changes:
-
-* Item 1
-* Item 2
-
-## {{AppName}} 0.0.1
-
-...

+ 0 - 4
dev/tasks/dev/templates/CONTRIBUTING.md

@@ -1,4 +0,0 @@
-Contributing
-========================================
-
-Information about contributing can be found on the following page: <https://github.com/ckeditor/ckeditor5/blob/master/CONTRIBUTING.md>.

+ 0 - 23
dev/tasks/dev/templates/LICENSE.md

@@ -1,23 +0,0 @@
-Software License Agreement
-==========================
-
-**{{AppName}}** – https://github.com/{{GitHubRepositoryPath}} <br>
-Copyright (c) 2003-2016, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
-
-Licensed under the terms of any of the following licenses at your choice:
-
-* [GNU General Public License Version 2 or later (the "GPL")](http://www.gnu.org/licenses/gpl.html)
-* [GNU Lesser General Public License Version 2.1 or later (the "LGPL")](http://www.gnu.org/licenses/lgpl.html)
-* [Mozilla Public License Version 1.1 or later (the "MPL")](http://www.mozilla.org/MPL/MPL-1.1.html)
-
-You are not required to, but if you want to explicitly declare the license you have chosen to be bound to when using, reproducing, modifying and distributing this software, just include a text file titled "legal.txt" in your version of this software, indicating your license choice. In any case, your choice will not restrict any recipient of your version of this software to use, reproduce, modify and distribute this software under any of the above licenses.
-
-Sources of Intellectual Property Included in CKEditor
------------------------------------------------------
-
-Where not otherwise indicated, all CKEditor content is authored by CKSource engineers and consists of CKSource-owned intellectual property. In some specific instances, CKEditor will incorporate work done by developers outside of CKSource with their express permission.
-
-Trademarks
-----------
-
-**CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.

+ 0 - 10
dev/tasks/dev/templates/README.md

@@ -1,10 +0,0 @@
-{{AppName}}
-========================================
-
-[![devDependency Status](https://david-dm.org/{{GitHubRepositoryPath}}/dev-status.svg)](https://david-dm.org/{{GitHubRepositoryPath}}#info=devDependencies)
-
-{{ProjectDescription}} More information about the project can be found at the following URL: <https://github.com/{{GitHubRepositoryPath}}>.
-
-## License
-
-Licensed under the GPL, LGPL and MPL licenses, at your choice. For full details about the license, please check the `LICENSE.md` file.

+ 0 - 21
dev/tasks/dev/templates/gulpfile.js

@@ -1,21 +0,0 @@
-/* jshint browser: false, node: true, strict: true */
-
-'use strict';
-
-const gulp = require( 'gulp' );
-
-const config = {
-	ROOT_DIR: '.',
-	WORKSPACE_DIR: '..',
-
-	// Files ignored by jshint and jscs tasks. Files from .gitignore will be added automatically during tasks execution.
-	IGNORED_FILES: [
-		'src/lib/**'
-	]
-};
-
-const ckeditor5Lint = require( 'ckeditor5-dev-lint' )( config );
-
-gulp.task( 'lint', ckeditor5Lint.lint );
-gulp.task( 'lint-staged', ckeditor5Lint.lintStaged );
-gulp.task( 'pre-commit', [ 'lint-staged' ] );

+ 0 - 28
dev/tasks/dev/templates/package.json

@@ -1,28 +0,0 @@
-{
-  "name": "",
-  "version": "",
-  "description": "",
-  "keywords": [],
-  "dependencies": {},
-  "devDependencies": {
-    "git-guppy": "^1.1.0",
-    "gulp": "^3.9.0",
-    "gulp-filter": "^3.0.1",
-    "gulp-jscs": "^3.0.2",
-    "gulp-jshint": "^2.0.0",
-    "gulp-util": "^3.0.7",
-    "guppy-pre-commit": "^0.3.0",
-    "jshint": "^2.9.1",
-    "jshint-reporter-jscs": "^0.1.0",
-    "ckeditor5-dev-lint": "ckeditor/ckeditor5-dev-lint"
-  },
-  "engines": {
-    "node": ">=5.0.0",
-    "npm": ">=3.0.0"
-  },
-  "author": "CKSource (http://cksource.com/)",
-  "license": "See LICENSE.md",
-  "homepage": "",
-  "bugs": "",
-  "repository": ""
-}

+ 0 - 78
dev/tasks/dev/utils/inquiries.js

@@ -1,78 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const inquirer = require( 'inquirer' );
-const sanitize = require( './sanitize' );
-const DEFAULT_PLUGIN_NAME_PREFIX = 'ckeditor5-';
-const DEFAULT_PLUGIN_VERSION = '0.0.1';
-const DEFAULT_GITHUB_PATH_PREFIX = 'ckeditor/';
-
-module.exports = {
-	getPackageName() {
-		return new Promise( ( resolve ) => {
-			inquirer.prompt( [ {
-				name: 'packageName',
-				message: 'Enter package name without ' + DEFAULT_PLUGIN_NAME_PREFIX + ' prefix:',
-				validate: ( input ) => {
-					const regexp = /^[\w-]+$/;
-
-					return regexp.test( input ) ? true : 'Please provide a valid package name.';
-				}
-			} ], ( answers ) => {
-				resolve( DEFAULT_PLUGIN_NAME_PREFIX + answers.packageName );
-			} );
-		} );
-	},
-
-	getApplicationName() {
-		return new Promise( ( resolve ) => {
-			inquirer.prompt( [ {
-				name: 'applicationName',
-				message: 'Enter application full name:'
-			} ], ( answers ) => {
-				resolve( answers.applicationName );
-			} );
-		} );
-	},
-
-	getPackageVersion( ) {
-		return new Promise( ( resolve ) => {
-			inquirer.prompt( [ {
-				name: 'version',
-				message: 'Enter package\'s initial version:',
-				default: DEFAULT_PLUGIN_VERSION
-			} ], ( answers ) => {
-				resolve( answers.version );
-			} );
-		} );
-	},
-
-	getPackageGitHubPath( packageName ) {
-		const defaultGitHubPath = DEFAULT_GITHUB_PATH_PREFIX + packageName;
-
-		return new Promise( ( resolve ) => {
-			inquirer.prompt( [ {
-				name: 'gitHubPath',
-				message: 'Enter package\'s GitHub path:',
-				default: defaultGitHubPath
-			} ], ( answers ) => {
-				resolve( answers.gitHubPath );
-			} );
-		} );
-	},
-
-	getPackageDescription( ) {
-		return new Promise( ( resolve ) => {
-			inquirer.prompt( [ {
-				name: 'description',
-				message: 'Package description (one sentence, must end with period):'
-			} ], ( answers ) => {
-				resolve( sanitize.appendPeriodIfMissing( answers.description || '' ) );
-			} );
-		} );
-	}
-};

+ 0 - 18
dev/tasks/dev/utils/sanitize.js

@@ -1,18 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-module.exports = {
-	appendPeriodIfMissing( text ) {
-		text = text.trim();
-
-		if ( text.length > 0 && !text.endsWith( '.' ) ) {
-			text += '.';
-		}
-
-		return text;
-	}
-};

+ 0 - 38
dev/tasks/exec/functions/bump-year.js

@@ -1,38 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const gulp = require( 'gulp' );
-const path = require( 'path' );
-const replace = require( 'gulp-replace' );
-const filterGitignore = require( '../utils/filtergitignore' );
-
-// Change this to correct year.
-const year = '2017';
-
-/**
- * Replaces license date in source files with new date.
- *
- * Example (remember to change the year harcoded in the module):
- *
- *		gulp exec --task bump-year
- *
- * @param {String} workdir
- * @returns {Stream}
- */
-module.exports = function executeBumpYear( workdir ) {
-	const licenseRegexp = /(@license Copyright \(c\) 2003-)[0-9]{4}(, CKSource - Frederico Knabben\.)/g;
-	const glob = path.join( workdir, '**/*' );
-
-	return gulp.src( glob )
-		.pipe( filterGitignore() )
-		.pipe( replace(
-			licenseRegexp,
-			`$1${ year }$2`,
-			{ skipBinary: true }
-		) )
-		.pipe( gulp.dest( workdir ) );
-};

+ 0 - 28
dev/tasks/exec/functions/git-commit.js

@@ -1,28 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const { git } = require( 'ckeditor5-dev-utils' );
-
-/**
- * Adds only modified files to git repository and commits them with provided message.
- *
- * Example:
- *
- *		gulp exec --task git-commit --message "Commit message."
- *
- * @param {String} workdir
- * @param {Object} params
- */
-module.exports = function executeGitCommit( workdir, params ) {
-	const message = params.message;
-
-	if ( !message ) {
-		throw new Error( 'You must provide commit message with parameter: --message' );
-	}
-
-	git.commit( message, workdir );
-};

+ 0 - 21
dev/tasks/exec/functions/git-push.js

@@ -1,21 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const { git } = require( 'ckeditor5-dev-utils' );
-
-/**
- * Pushes changes of current branch in repository to default origin.
- *
- * Example:
- *
- *		gulp exec --task git-push
- *
- * @param {String} workdir
- */
-module.exports = function executeGitPush( workdir ) {
-	git.push( workdir );
-};

+ 0 - 92
dev/tasks/exec/functions/remove-use-strict.js

@@ -1,92 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const gulp = require( 'gulp' );
-const path = require( 'path' );
-const replace = require( 'gulp-replace' );
-const filterGitignore = require( '../utils/filtergitignore' );
-const filter = require( 'gulp-filter' );
-const { tools } = require( 'ckeditor5-dev-utils' );
-
-/**
- * Removes lines with `'use strict';` directive.
- *
- * Example:
- *
- *		gulp exec --task remove-use-strict --include-root
- *
- * @param {String} workdir
- * @returns {Stream}
- */
-module.exports = function executeRemoveUseStrict( workdir ) {
-	updateJshintrc( workdir );
-	reformatOtherConfigs( workdir );
-
-	return removeUseStrict( workdir );
-};
-
-// Updates .jshintrc file's `strict` option with `implied` value.
-//
-// @param {String} workdir Path of directory to be processed.
-function updateJshintrc( workdir ) {
-	[ '/', 'tests/' ].forEach(
-		dir => {
-			const jshintrcPath = path.join( workdir, dir, '.jshintrc' );
-
-			tools.updateJSONFile( jshintrcPath, json => {
-				json.strict = 'implied';
-
-				return json;
-			} );
-		}
-	);
-}
-
-// Reformats (to match other .jshintrc files and package.json code style) the .jshintrc from dev/ and main .jscsrc.
-//
-// @param {String} workdir Path of directory to be processed.
-function reformatOtherConfigs( workdir ) {
-	tools.updateJSONFile( path.join( workdir, 'dev', '.jshintrc' ), json => json );
-	tools.updateJSONFile( path.join( workdir, '.jscsrc' ), json => json );
-}
-
-// Removes `'use strict';` directive from project's source files. Omits files listed in `.gitignore`.
-//
-// @param {String} workdir Path of directory to be processed.
-// @returns {Stream}
-function removeUseStrict( workdir ) {
-	const glob = path.join( workdir, '**/*.js' );
-	const filterDev = filter( '@(src|tests)/**/*.js', { restore: true } );
-	const filterGulpfileAndBender = filter(
-		[ 'gulpfile.js', 'dev/tasks/dev/templates/gulpfile.js', 'bender.js' ],
-		{ restore: true }
-	);
-
-	const useStrictRegex = /^\s*'use strict';\s*$/gm;
-	const jshintInlineConfigRegex = /\/\* jshint( browser: false,)? node: true \*\//;
-
-	return gulp.src( glob )
-		.pipe( filterGitignore() )
-
-		// Remove use strict from src/ and tests/.
-		.pipe( filterDev )
-		.pipe( replace(
-			useStrictRegex,
-			''
-		) )
-		.pipe( filterDev.restore )
-
-		// Fix gulpfile.js and bender.js.
-		.pipe( filterGulpfileAndBender )
-		.pipe( replace(
-			jshintInlineConfigRegex,
-			'/* jshint browser: false, node: true, strict: true */'
-		) )
-		.pipe( filterGulpfileAndBender.restore )
-
-		.pipe( gulp.dest( workdir ) );
-}

+ 0 - 30
dev/tasks/exec/functions/sh.js

@@ -1,30 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const { tools } = require( 'ckeditor5-dev-utils' );
-
-/**
- * Runs custom shell command over each package.
- *
- * Example:
- *
- *		gulp exec --task sh --cmd "sed 's/find/replace' file.js"
- *
- * @param {String} workdir
- * @param {Object} params
- */
-module.exports = function executeShellCommand( workdir, params ) {
-	// Needed to see results of commands printing to stdout/stderr.
-	const shouldLogOutput = true;
-	const cmd = params.cmd;
-
-	if ( !cmd ) {
-		throw new Error( 'You must provide command to execute with parameter: --cmd "command"' );
-	}
-
-	tools.shExec( cmd, shouldLogOutput );
-};

+ 0 - 106
dev/tasks/exec/tasks.js

@@ -1,106 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const gulp = require( 'gulp' );
-const minimist = require( 'minimist' );
-const path = require( 'path' );
-const merge = require( 'merge-stream' );
-const { log, workspace } = require( 'ckeditor5-dev-utils' );
-
-/**
- * Run task over `ckeditor5-*` repositories.
- *
- * Example:
- *
- *		gulp exec --task task-name
- *
- * Example of running task just for one repository:
- *
- *		gulp exec --task task-name --repository ckeditor5-utils
- *
- * Example of running task including root `ckeditor5` package
- *
- *		gulp exec --task task-name --include-root
- *
- * @param {Object} config Task runner configuration.
- * @returns {Stream} Stream with processed files.
- */
-module.exports = ( config ) => {
-	const ckeditor5Path = process.cwd();
-	const packageJSON = require( '../../../package.json' );
-
-	const tasks = {
-		execOnRepositories() {
-			// Omit `gulp exec` part of arguments
-			const params = minimist( process.argv.slice( 3 ), {
-				stopEarly: false,
-			} );
-			let task;
-
-			try {
-				if ( params.task ) {
-					task = require( `./functions/${ params.task }` );
-				} else {
-					throw new Error( 'Missing task parameter: --task task-name' );
-				}
-			} catch ( err ) {
-				log.err( err );
-
-				return;
-			}
-
-			return execute( task, ckeditor5Path, packageJSON, config.WORKSPACE_DIR, params );
-		},
-
-		register() {
-			gulp.task( 'exec', tasks.execOnRepositories );
-		}
-	};
-
-	return tasks;
-};
-
-/**
- * Execute given task with provided options and command-line parameters.
- *
- * @param {Function} execTask Task to use on each dependency.
- * @param {String} ckeditor5Path Path to main CKEditor5 repository.
- * @param {Object} packageJSON Parsed `package.json` file from CKEditor 5 repository.
- * @param {String} workspaceRoot Relative path to workspace root.
- * @param {Object} params Parameters provided to the task via command-line.
- * @returns {Stream} Merged stream of processed files.
- */
-function execute( execTask, ckeditor5Path, packageJSON, workspaceRoot, params ) {
-	const workspacePath = path.join( ckeditor5Path, workspaceRoot );
-	const mergedStream = merge();
-	const specificRepository = params.repository;
-	const includeRoot = !!params[ 'include-root' ];
-
-	let devDirectories = workspace.getDevDirectories( workspacePath, packageJSON, ckeditor5Path, includeRoot );
-
-	if ( specificRepository ) {
-		devDirectories = devDirectories.filter( ( dir ) => {
-			return dir.repositoryURL === `ckeditor/${ specificRepository }`;
-		} );
-	}
-
-	for ( const dir of devDirectories ) {
-		try {
-			log.out( `Executing task on ${ dir.repositoryURL }...` );
-
-			const result = execTask( dir.repositoryPath, params );
-
-			if ( result ) {
-				mergedStream.add( result );
-			}
-		} catch ( err ) {
-			log.err( err );
-		}
-	}
-
-	return mergedStream;
-}

+ 0 - 28
dev/tasks/exec/utils/filtergitignore.js

@@ -1,28 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-'use strict';
-
-const fs = require( 'fs' );
-const filter = require( 'gulp-filter' );
-const parseGitignore = require( 'parse-gitignore' );
-const PassThrough = require( 'stream' ).PassThrough;
-
-module.exports = function filterGitignore() {
-	const fileName = '.gitignore';
-
-	if ( !fs.existsSync( fileName ) ) {
-		return new PassThrough( { objectMode: true } );
-	}
-
-	const gitignoreGlob =
-		parseGitignore( fileName )
-			// Invert '!foo' -> 'foo' and 'foo' -> '!foo'.
-			.map( pattern => pattern.startsWith( '!' ) ? pattern.slice( 1 ) : '!' + pattern );
-
-	gitignoreGlob.unshift( '**/*' );
-
-	return filter( gitignoreGlob );
-};

+ 0 - 94
dev/tests/dev/create-package.js

@@ -1,94 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* global describe, it, beforeEach, afterEach */
-
-'use strict';
-
-const chai = require( 'chai' );
-const sinon = require( 'sinon' );
-const expect = chai.expect;
-const inquiries = require( '../../tasks/dev/utils/inquiries' );
-const path = require( 'path' );
-const { tools, git } = require( 'ckeditor5-dev-utils' );
-
-describe( 'dev-create-package', () => {
-	let spies;
-
-	const mainRepositoryPath = '/path/to/repository';
-	const workspaceRoot = '..';
-	const workspacePath = path.join( mainRepositoryPath, workspaceRoot );
-	const packageName = 'package-name';
-	const applicationName = 'Full application name';
-	const packageVersion = '0.0.1';
-	const gitHubPath = 'ckeditor5/package-name';
-	const packageDescription = 'Package description.';
-
-	beforeEach( () => createSpies() );
-	afterEach( () => restoreSpies() );
-
-	function createSpies() {
-		spies = {
-			linkDirectories: sinon.stub( tools, 'linkDirectories' ),
-			npmInstall: sinon.stub( tools, 'npmInstall' ),
-			getPackageName: sinon.stub( inquiries, 'getPackageName' ).returns( new Promise( ( r ) => r( packageName ) ) ),
-			getApplicationName: sinon.stub( inquiries, 'getApplicationName' ).returns( new Promise( ( r ) => r( applicationName ) ) ),
-			getPackageVersion: sinon.stub( inquiries, 'getPackageVersion' ).returns( new Promise( ( r ) => r( packageVersion ) ) ),
-			getPackageGitHubPath: sinon.stub( inquiries, 'getPackageGitHubPath' ).returns( new Promise( ( r ) => r( gitHubPath ) ) ),
-			getPackageDescription: sinon.stub( inquiries, 'getPackageDescription' ).returns( new Promise( ( r ) => r( packageDescription ) ) ),
-			initializeRepository: sinon.stub( git, 'initializeRepository' ),
-			updateJSONFile: sinon.stub( tools, 'updateJSONFile' ),
-			copy: sinon.stub( tools, 'copyTemplateFiles' ),
-			initialCommit: sinon.stub( git, 'initialCommit' ),
-			addRemote: sinon.stub( git, 'addRemote' )
-		};
-	}
-
-	function restoreSpies() {
-		for ( let spy in spies ) {
-			spies[ spy ].restore();
-		}
-	}
-
-	const packageCreateTask = require( '../../tasks/dev/tasks/create-package' );
-	const repositoryPath = path.join( workspacePath, packageName );
-
-	it( 'should exist', () => expect( packageCreateTask ).to.be.a( 'function' ) );
-
-	it( 'should create a package', () => {
-		return packageCreateTask( mainRepositoryPath, workspaceRoot ).then( () => {
-			expect( spies.getPackageName.calledOnce ).to.equal( true );
-			expect( spies.getApplicationName.calledOnce ).to.equal( true );
-			expect( spies.getPackageVersion.calledOnce ).to.equal( true );
-			expect( spies.getPackageGitHubPath.calledOnce ).to.equal( true );
-			expect( spies.getPackageDescription.calledOnce ).to.equal( true );
-			expect( spies.initializeRepository.calledOnce ).to.equal( true );
-			expect( spies.initializeRepository.firstCall.args[ 0 ] ).to.equal( repositoryPath );
-			expect( spies.addRemote.calledOnce ).to.equal( true );
-			expect( spies.addRemote.firstCall.args[ 0 ] ).to.equal( repositoryPath );
-			expect( spies.addRemote.firstCall.args[ 1 ] ).to.equal( gitHubPath );
-			expect( spies.copy.called ).to.equal( true );
-			expect( spies.updateJSONFile.calledTwice ).to.equal( true );
-			expect( spies.updateJSONFile.firstCall.args[ 0 ] ).to.equal( path.join( repositoryPath, 'package.json' ) );
-			let updateFn = spies.updateJSONFile.firstCall.args[ 1 ];
-			let json = updateFn( {} );
-			expect( json.name ).to.equal( packageName );
-			expect( json.version ).to.equal( packageVersion );
-			expect( spies.updateJSONFile.secondCall.args[ 0 ] ).to.equal( path.join( mainRepositoryPath, 'package.json' ) );
-			updateFn = spies.updateJSONFile.secondCall.args[ 1 ];
-			json = updateFn( {} );
-			expect( json.dependencies ).to.be.an( 'object' );
-			expect( json.dependencies[ packageName ] ).to.equal( gitHubPath );
-			expect( spies.initialCommit.calledOnce ).to.equal( true );
-			expect( spies.initialCommit.firstCall.args[ 0 ] ).to.equal( packageName );
-			expect( spies.initialCommit.firstCall.args[ 1 ] ).to.equal( repositoryPath );
-			expect( spies.linkDirectories.calledOnce ).to.equal( true );
-			expect( spies.linkDirectories.firstCall.args[ 0 ] ).to.equal( repositoryPath );
-			expect( spies.linkDirectories.firstCall.args[ 1 ] ).to.equal( path.join( mainRepositoryPath, 'node_modules', packageName ) );
-			expect( spies.npmInstall.calledOnce ).to.equal( true );
-			expect( spies.npmInstall.firstCall.args[ 0 ] ).to.equal( repositoryPath );
-		} );
-	} );
-} );

+ 0 - 56
dev/tests/dev/init.js

@@ -1,56 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* global describe, it */
-
-'use strict';
-
-const sinon = require( 'sinon' );
-const { workspace } = require( 'ckeditor5-dev-utils' );
-
-describe( 'dev-init', () => {
-	const initTask = require( '../../tasks/dev/tasks/init' );
-	const ckeditor5Path = 'path/to/ckeditor5';
-	const workspaceRoot = '..';
-
-	it( 'should get all ckedtior5- dependencies and execute dev-install on them', () => {
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const installSpy = sinon.spy();
-		const JSON = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-code',
-				'non-ckeditor-plugin': '^2.0.0',
-				'ckeditor5-plugin-devtest': 'ckeditor/ckeditor5-plugin-devtest'
-			}
-		};
-		const deps = JSON.dependencies;
-
-		initTask( installSpy, ckeditor5Path, JSON, workspaceRoot );
-
-		getDependenciesSpy.restore();
-
-		sinon.assert.calledOnce( getDependenciesSpy );
-		sinon.assert.calledWithExactly( getDependenciesSpy, deps );
-		sinon.assert.calledTwice( installSpy );
-		sinon.assert.calledWithExactly( installSpy.firstCall, ckeditor5Path, workspaceRoot, deps[ 'ckeditor5-core' ] );
-		sinon.assert.calledWithExactly( installSpy.secondCall, ckeditor5Path, workspaceRoot, deps[ 'ckeditor5-plugin-devtest' ] );
-	} );
-
-	it( 'should not call dev-install if no ckedtior5- dependencies', () => {
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const installSpy = sinon.spy();
-		const JSON = {
-			dependencies: {}
-		};
-
-		initTask( installSpy, ckeditor5Path, JSON, workspaceRoot );
-
-		getDependenciesSpy.restore();
-
-		sinon.assert.calledOnce( getDependenciesSpy );
-		sinon.assert.calledWithExactly( getDependenciesSpy, JSON.dependencies );
-		sinon.assert.notCalled( installSpy );
-	} );
-} );

+ 0 - 167
dev/tests/dev/install.js

@@ -1,167 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* global describe, it, beforeEach, afterEach */
-
-'use strict';
-
-const chai = require( 'chai' );
-const sinon = require( 'sinon' );
-const installTask = require( '../../tasks/dev/tasks/install' );
-const expect = chai.expect;
-const path = require( 'path' );
-const { tools, git } = require( 'ckeditor5-dev-utils' );
-
-describe( 'dev-install', () => {
-	const moduleName = 'ckeditor5-core';
-	const repositoryUrl = 'git@github.com:ckeditor/ckeditor5-core';
-	const ckeditor5Path = '/path/to/ckeditor';
-	const workspacePath = '..';
-	const workspaceAbsolutePath = path.join( ckeditor5Path, workspacePath );
-	const spies = {};
-
-	beforeEach( () => {
-		spies.parseUrl = sinon.spy( git, 'parseRepositoryUrl' );
-		spies.isDirectory = sinon.stub( tools, 'isDirectory' );
-		spies.cloneRepository = sinon.stub( git, 'cloneRepository' );
-		spies.linkDirectories = sinon.stub( tools, 'linkDirectories' );
-		spies.updateJSON = sinon.stub( tools, 'updateJSONFile' );
-		spies.npmInstall = sinon.stub( tools, 'npmInstall' );
-		spies.checkout = sinon.stub( git, 'checkout' );
-		spies.getGitUrlFromNpm = sinon.stub( tools, 'getGitUrlFromNpm' );
-		spies.readPackageName = sinon.stub( tools, 'readPackageName' );
-	} );
-
-	afterEach( () => {
-		Object.keys( spies ).forEach( ( spy ) => spies[ spy ].restore() );
-	} );
-
-	it( 'should use GitHub URL', () => {
-		spies.isDirectory.onFirstCall().returns( false );
-		spies.isDirectory.onSecondCall().returns( false );
-		spies.isDirectory.onThirdCall().returns( true );
-
-		installTask( ckeditor5Path, workspacePath, repositoryUrl );
-
-		sinon.assert.calledTwice( spies.isDirectory );
-		sinon.assert.calledOnce( spies.parseUrl );
-		sinon.assert.calledWithExactly( spies.parseUrl, repositoryUrl );
-
-		const urlInfo = spies.parseUrl.firstCall.returnValue;
-		const repositoryPath = path.join( workspaceAbsolutePath, urlInfo.name );
-
-		sinon.assert.calledWithExactly( spies.isDirectory.secondCall, repositoryPath );
-		sinon.assert.calledOnce( spies.cloneRepository );
-		sinon.assert.calledWithExactly( spies.cloneRepository, urlInfo, workspaceAbsolutePath );
-		sinon.assert.calledOnce( spies.checkout );
-		sinon.assert.calledWithExactly( spies.checkout, repositoryPath, urlInfo.branch );
-
-		sinon.assert.calledOnce( spies.npmInstall );
-		sinon.assert.calledWithExactly( spies.npmInstall, repositoryPath );
-
-		const linkPath = path.join( ckeditor5Path, 'node_modules', urlInfo.name );
-
-		sinon.assert.calledOnce( spies.linkDirectories );
-		sinon.assert.calledWithExactly( spies.linkDirectories, repositoryPath, linkPath );
-
-		const packageJsonPath = path.join( ckeditor5Path, 'package.json' );
-
-		sinon.assert.calledOnce( spies.updateJSON );
-		expect( spies.updateJSON.firstCall.args[ 0 ] ).to.equal( packageJsonPath );
-		const updateFn = spies.updateJSON.firstCall.args[ 1 ];
-		const json = updateFn( {} );
-		expect( json.dependencies ).to.be.a( 'object' );
-		expect( json.dependencies[ urlInfo.name ] ).to.equal( repositoryUrl );
-	} );
-
-	it( 'should use npm module name', () => {
-		spies.isDirectory.onFirstCall().returns( false );
-		spies.isDirectory.onSecondCall().returns( true );
-		spies.getGitUrlFromNpm.returns( repositoryUrl );
-
-		installTask( ckeditor5Path, workspacePath, moduleName );
-
-		sinon.assert.calledTwice( spies.isDirectory );
-		sinon.assert.calledTwice( spies.parseUrl );
-		sinon.assert.calledWithExactly( spies.parseUrl.firstCall, moduleName );
-		expect( spies.parseUrl.firstCall.returnValue ).to.equal( null );
-		sinon.assert.calledOnce( spies.getGitUrlFromNpm );
-		sinon.assert.calledWithExactly( spies.getGitUrlFromNpm, moduleName );
-		sinon.assert.calledWithExactly( spies.parseUrl.secondCall, repositoryUrl );
-		const urlInfo = spies.parseUrl.secondCall.returnValue;
-		const repositoryPath = path.join( workspaceAbsolutePath, urlInfo.name );
-
-		sinon.assert.calledWithExactly( spies.isDirectory.secondCall, repositoryPath );
-		sinon.assert.notCalled( spies.cloneRepository );
-		sinon.assert.calledOnce( spies.checkout );
-		sinon.assert.calledWithExactly( spies.checkout, repositoryPath, urlInfo.branch );
-
-		sinon.assert.calledOnce( spies.npmInstall );
-		sinon.assert.calledWithExactly( spies.npmInstall, repositoryPath );
-
-		const linkPath = path.join( ckeditor5Path, 'node_modules', urlInfo.name );
-
-		sinon.assert.calledOnce( spies.linkDirectories );
-		sinon.assert.calledWithExactly( spies.linkDirectories, repositoryPath, linkPath );
-
-		const packageJsonPath = path.join( ckeditor5Path, 'package.json' );
-
-		sinon.assert.calledOnce( spies.updateJSON );
-		expect( spies.updateJSON.firstCall.args[ 0 ] ).to.equal( packageJsonPath );
-		const updateFn = spies.updateJSON.firstCall.args[ 1 ];
-		const json = updateFn( {} );
-		expect( json.dependencies ).to.be.a( 'object' );
-		expect( json.dependencies[ urlInfo.name ] ).to.equal( repositoryUrl );
-	} );
-
-	it( 'should use local relative path', () => {
-		spies.isDirectory.onFirstCall().returns( true );
-		spies.isDirectory.onSecondCall().returns( true );
-		spies.readPackageName.returns( moduleName );
-
-		installTask( ckeditor5Path, workspacePath, '../ckeditor5-core' );
-
-		sinon.assert.calledTwice( spies.isDirectory );
-		sinon.assert.calledOnce( spies.readPackageName );
-	} );
-
-	it( 'should use local absolute path if provided', () => {
-		spies.isDirectory.onFirstCall().returns( true );
-		spies.isDirectory.onSecondCall().returns( true );
-		spies.readPackageName.returns( moduleName );
-
-		installTask( ckeditor5Path, workspacePath, '/ckeditor5-core' );
-
-		sinon.assert.calledTwice( spies.isDirectory );
-		sinon.assert.calledOnce( spies.readPackageName );
-	} );
-
-	it( 'should throw an exception when invalid name is provided', () => {
-		spies.isDirectory.onFirstCall().returns( false );
-		spies.isDirectory.onSecondCall().returns( true );
-
-		expect( () => {
-			installTask( ckeditor5Path, workspacePath, moduleName );
-		} ).to.throw();
-
-		sinon.assert.calledOnce( spies.parseUrl );
-		sinon.assert.calledWithExactly( spies.parseUrl.firstCall, moduleName );
-		expect( spies.parseUrl.firstCall.returnValue ).to.equal( null );
-	} );
-
-	it( 'should throw an exception when package.json is not present', () => {
-		spies.isDirectory.onFirstCall().returns( true );
-		spies.isDirectory.onSecondCall().returns( true );
-		spies.readPackageName.returns( null );
-
-		expect( () => {
-			installTask( ckeditor5Path, workspacePath, moduleName );
-		} ).to.throw();
-
-		sinon.assert.calledOnce( spies.parseUrl );
-		sinon.assert.calledWithExactly( spies.parseUrl.firstCall, moduleName );
-		expect( spies.parseUrl.firstCall.returnValue ).to.equal( null );
-	} );
-} );

+ 0 - 111
dev/tests/dev/relink.js

@@ -1,111 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* global describe, it */
-
-'use strict';
-
-const sinon = require( 'sinon' );
-const path = require( 'path' );
-const { tools, workspace } = require( 'ckeditor5-dev-utils' );
-
-describe( 'dev-relink', () => {
-	const task = require( '../../tasks/dev/tasks/relink' );
-	const ckeditor5Path = 'path/to/ckeditor5';
-	const modulesPath = path.join( ckeditor5Path, 'node_modules' );
-	const workspaceRoot = '..';
-	const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
-
-	it( 'should link dev repositories', () => {
-		const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const getDirectoriesStub = sinon.stub( workspace, 'getDirectories' ).returns( dirs );
-		const linkStub = sinon.stub( tools, 'linkDirectories' );
-		const json = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-core',
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		task( ckeditor5Path, json, workspaceRoot );
-
-		getDependenciesSpy.restore();
-		getDirectoriesStub.restore();
-		linkStub.restore();
-
-		sinon.assert.calledTwice( linkStub );
-		sinon.assert.calledWithExactly( linkStub.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ), path.join( modulesPath, dirs[ 0 ] ) );
-		sinon.assert.calledWithExactly( linkStub.secondCall, path.join( workspaceAbsolutePath, dirs[ 1 ] ), path.join( modulesPath, dirs[ 1 ] ) );
-	} );
-
-	it( 'should not link when no dependencies are found', () => {
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const getDirectoriesStub = sinon.stub( workspace, 'getDirectories' );
-		const linkStub = sinon.stub( tools, 'linkDirectories' );
-		const json = {
-			dependencies: {
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		task( ckeditor5Path, json, workspaceRoot );
-
-		getDependenciesSpy.restore();
-		getDirectoriesStub.restore();
-		linkStub.restore();
-
-		sinon.assert.notCalled( linkStub );
-	} );
-
-	it( 'should not link when no plugins in dev mode', () => {
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const getDirectoriesStub = sinon.stub( workspace, 'getDirectories' ).returns( [] );
-		const linkStub = sinon.stub( tools, 'linkDirectories' );
-		const json = {
-			dependencies: {
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		task( ckeditor5Path, json, workspaceRoot );
-
-		getDependenciesSpy.restore();
-		getDirectoriesStub.restore();
-		linkStub.restore();
-
-		sinon.assert.notCalled( linkStub );
-	} );
-
-	it( 'should write error message when linking is unsuccessful', () => {
-		const dirs = [ 'ckeditor5-core' ];
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const getDirectoriesStub = sinon.stub( workspace, 'getDirectories' ).returns( dirs );
-		const error = new Error( 'Error message.' );
-		const linkStub = sinon.stub( tools, 'linkDirectories' ).throws( error );
-		const json = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-core',
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-		const writeErrorSpy = sinon.spy();
-		const { log } = require( 'ckeditor5-dev-utils' );
-		log.configure( () => {}, writeErrorSpy );
-
-		task( ckeditor5Path, json, workspaceRoot );
-
-		getDependenciesSpy.restore();
-		getDirectoriesStub.restore();
-		linkStub.restore();
-
-		sinon.assert.calledOnce( linkStub );
-		sinon.assert.calledOnce( writeErrorSpy );
-		sinon.assert.calledWithExactly( writeErrorSpy, error );
-	} );
-} );

+ 0 - 44
dev/tests/dev/sanitize.js

@@ -1,44 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* global describe, it */
-
-'use strict';
-
-const sanitize = require( '../../tasks/dev/utils/sanitize' );
-const chai = require( 'chai' );
-const expect = chai.expect;
-
-describe( 'utils', () => {
-	describe( 'sanitize', () => {
-		describe( 'appendPeriodIfMissing', () => {
-			it( 'should be defined', () => expect( sanitize.appendPeriodIfMissing ).to.be.a( 'function' ) );
-
-			it( 'should trim whitespace/new lines to empty string', () => {
-				const sanitized = sanitize.appendPeriodIfMissing( '\n\t\r ' );
-
-				expect( sanitized ).to.equal( '' );
-			} );
-
-			it( 'should add period at the end if missing ', () => {
-				const sanitized = sanitize.appendPeriodIfMissing( 'sometext' );
-
-				expect( sanitized ).to.equal( 'sometext.' );
-			} );
-
-			it( 'should not add period at the end if present', () => {
-				const sanitized = sanitize.appendPeriodIfMissing( 'sometext.' );
-
-				expect( sanitized ).to.equal( 'sometext.' );
-			} );
-
-			it( 'should leave empty string as is', () => {
-				const sanitized = sanitize.appendPeriodIfMissing( '' );
-
-				expect( sanitized ).to.equal( '' );
-			} );
-		} );
-	} );
-} );

+ 0 - 129
dev/tests/dev/status.js

@@ -1,129 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* global describe, it */
-
-'use strict';
-
-const sinon = require( 'sinon' );
-const path = require( 'path' );
-const chai = require( 'chai' );
-const expect = chai.expect;
-const gulp = require( 'gulp' );
-const { workspace, git } = require( 'ckeditor5-dev-utils' );
-
-describe( 'dev-status', () => {
-	const statusTask = require( '../../tasks/dev/tasks/status' );
-	const ckeditor5Path = 'path/to/ckeditor5';
-	const workspaceRoot = '..';
-	const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
-
-	it( 'should show status of dev repositories', () => {
-		const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const getDirectoriesStub = sinon.stub( workspace, 'getDirectories' ).returns( dirs );
-		const statusStub = sinon.stub( git, 'getStatus' );
-		const json = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-core',
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		statusTask( ckeditor5Path, json, workspaceRoot );
-
-		getDependenciesSpy.restore();
-		getDirectoriesStub.restore();
-		statusStub.restore();
-
-		sinon.assert.calledTwice( statusStub );
-		sinon.assert.calledWithExactly( statusStub.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
-		sinon.assert.calledWithExactly( statusStub.secondCall, path.join( workspaceAbsolutePath, dirs[ 1 ] ) );
-	} );
-
-	it( 'should not get status when no dependencies are found', () => {
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const getDirectoriesStub = sinon.stub( workspace, 'getDirectories' );
-		const statusStub = sinon.stub( git, 'getStatus' );
-		const json = {
-			dependencies: {
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		statusTask( ckeditor5Path, json, workspaceRoot );
-
-		getDependenciesSpy.restore();
-		getDirectoriesStub.restore();
-		statusStub.restore();
-
-		sinon.assert.notCalled( statusStub );
-	} );
-
-	it( 'should not get status when no plugins in dev mode', () => {
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const getDirectoriesStub = sinon.stub( workspace, 'getDirectories' ).returns( [] );
-		const statusStub = sinon.stub( git, 'getStatus' );
-		const json = {
-			dependencies: {
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		statusTask( ckeditor5Path, json, workspaceRoot );
-
-		getDependenciesSpy.restore();
-		getDirectoriesStub.restore();
-		statusStub.restore();
-
-		sinon.assert.notCalled( statusStub );
-	} );
-
-	it( 'should write error message when getStatus is unsuccessful', () => {
-		const dirs = [ 'ckeditor5-core' ];
-		const getDependenciesSpy = sinon.spy( workspace, 'getDependencies' );
-		const getDirectoriesStub = sinon.stub( workspace, 'getDirectories' ).returns( dirs );
-		const error = new Error( 'Error message.' );
-		const statusStub = sinon.stub( git, 'getStatus' ).throws( error );
-		const json = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-core',
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-		const writeErrorSpy = sinon.spy();
-		const { log } = require( 'ckeditor5-dev-utils' );
-		log.configure( () => {}, writeErrorSpy );
-
-		statusTask( ckeditor5Path, json, workspaceRoot );
-
-		getDependenciesSpy.restore();
-		getDirectoriesStub.restore();
-		statusStub.restore();
-
-		sinon.assert.calledOnce( statusStub );
-		sinon.assert.calledOnce( writeErrorSpy );
-		sinon.assert.calledWithExactly( writeErrorSpy, error );
-	} );
-} );
-
-describe( 'gulp task status', () => {
-	const tasks = gulp.tasks;
-
-	it( 'should be available', () => {
-		expect( tasks ).to.have.property( 'status' );
-		expect( tasks.status.fn ).to.be.a( 'function' );
-	} );
-
-	it( 'should have an alias', () => {
-		expect( tasks ).to.have.property( 'st' );
-		expect( tasks.st.fn ).to.be.a( 'function' );
-
-		expect( tasks.st.fn ).to.equal( tasks.status.fn );
-	} );
-} );

+ 0 - 256
dev/tests/dev/update.js

@@ -1,256 +0,0 @@
-/**
- * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* global describe, it, beforeEach, afterEach */
-
-'use strict';
-
-const sinon = require( 'sinon' );
-const path = require( 'path' );
-const chai = require( 'chai' );
-const expect = chai.expect;
-const gulp = require( 'gulp' );
-const { tools, workspace, git } = require( 'ckeditor5-dev-utils' );
-
-describe( 'dev-update', () => {
-	const updateTask = require( '../../tasks/dev/tasks/update' );
-	const ckeditor5Path = 'path/to/ckeditor5';
-	const workspaceRoot = '..';
-	const workspaceAbsolutePath = path.join( ckeditor5Path, workspaceRoot );
-	const spies = {};
-
-	beforeEach( () => {
-		spies.getDependencies = sinon.spy( workspace, 'getDependencies' );
-		spies.checkout = sinon.stub( git, 'checkout' );
-		spies.pull = sinon.stub( git, 'pull' );
-		spies.fetchAll = sinon.stub( git, 'fetchAll' );
-		spies.npmUpdate = sinon.stub( tools, 'npmUpdate' );
-		spies.linkDirectories = sinon.stub( tools, 'linkDirectories' );
-		spies.removeSymlink = sinon.stub( tools, 'removeSymlink' );
-	} );
-
-	afterEach( () => {
-		Object.keys( spies ).forEach( ( spy ) => spies[ spy ].restore() );
-	} );
-
-	it( 'should update dev repositories', () => {
-		const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
-		const installTask = sinon.spy();
-		spies.getDirectories = sinon.stub( workspace, 'getDirectories' ).returns( dirs );
-		spies.getSymlinks = sinon.stub( workspace, 'getSymlinks' ).returns( [] );
-
-		const json = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-core',
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		updateTask( installTask, ckeditor5Path, json, workspaceRoot, true );
-
-		const repoPath1 = path.join( workspaceAbsolutePath, dirs[ 0 ] );
-		const repoPath2 = path.join( workspaceAbsolutePath, dirs[ 1 ] );
-
-		sinon.assert.calledThrice( spies.fetchAll );
-		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
-		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
-		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
-		sinon.assert.calledTwice( spies.checkout );
-		sinon.assert.calledWithExactly( spies.checkout.firstCall, repoPath1, 'master' );
-		sinon.assert.calledWithExactly( spies.checkout.secondCall, repoPath2, 'new-branch' );
-		sinon.assert.calledTwice( spies.pull );
-		sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
-		sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
-
-		sinon.assert.calledThrice( spies.npmUpdate );
-		sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
-		sinon.assert.calledWithExactly( spies.npmUpdate.secondCall, path.join( workspaceAbsolutePath, dirs[ 1 ] ) );
-		sinon.assert.calledWithExactly( spies.npmUpdate.thirdCall, ckeditor5Path );
-
-		sinon.assert.calledOnce( spies.getSymlinks );
-		sinon.assert.notCalled( spies.removeSymlink );
-		sinon.assert.notCalled( installTask );
-	} );
-
-	it( 'should install missing dependencies', () => {
-		const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
-		const installTask = sinon.spy();
-		spies.getDirectories = sinon.stub( workspace, 'getDirectories' ).returns( dirs );
-		spies.getSymlinks = sinon.stub( workspace, 'getSymlinks' ).returns( [] );
-
-		const json = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-core',
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'ckeditor5-ui': 'ckeditor/ckeditor5-ui',
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		updateTask( installTask, ckeditor5Path, json, workspaceRoot, true );
-
-		const repoPath1 = path.join( workspaceAbsolutePath, dirs[ 0 ] );
-		const repoPath2 = path.join( workspaceAbsolutePath, dirs[ 1 ] );
-
-		sinon.assert.calledThrice( spies.fetchAll );
-		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
-		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
-		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
-		sinon.assert.calledTwice( spies.checkout );
-		sinon.assert.calledWithExactly( spies.checkout.firstCall, repoPath1, 'master' );
-		sinon.assert.calledWithExactly( spies.checkout.secondCall, repoPath2, 'new-branch' );
-		sinon.assert.calledTwice( spies.pull );
-		sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
-		sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
-
-		sinon.assert.calledThrice( spies.npmUpdate );
-		sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
-		sinon.assert.calledWithExactly( spies.npmUpdate.secondCall, path.join( workspaceAbsolutePath, dirs[ 1 ] ) );
-		sinon.assert.calledWithExactly( spies.npmUpdate.thirdCall, ckeditor5Path );
-
-		sinon.assert.calledOnce( installTask );
-		sinon.assert.calledWithExactly( installTask, ckeditor5Path, workspaceRoot, 'ckeditor/ckeditor5-ui' );
-
-		sinon.assert.calledOnce( spies.getSymlinks );
-		sinon.assert.notCalled( spies.removeSymlink );
-	} );
-
-	it( 'should remove symlinks that are not needed', () => {
-		const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
-		const installTask = sinon.spy();
-		spies.getDirectories = sinon.stub( workspace, 'getDirectories' ).returns( dirs );
-		spies.getSymlinks = sinon.stub( workspace, 'getSymlinks' ).returns( [ 'ckeditor5-unused' ] );
-
-		const json = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-core',
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		updateTask( installTask, ckeditor5Path, json, workspaceRoot, true );
-
-		const repoPath1 = path.join( workspaceAbsolutePath, dirs[ 0 ] );
-		const repoPath2 = path.join( workspaceAbsolutePath, dirs[ 1 ] );
-
-		sinon.assert.calledThrice( spies.fetchAll );
-		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
-		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
-		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
-		sinon.assert.calledTwice( spies.checkout );
-		sinon.assert.calledWithExactly( spies.checkout.firstCall, repoPath1, 'master' );
-		sinon.assert.calledWithExactly( spies.checkout.secondCall, repoPath2, 'new-branch' );
-		sinon.assert.calledTwice( spies.pull );
-		sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
-		sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
-
-		sinon.assert.calledThrice( spies.npmUpdate );
-		sinon.assert.calledWithExactly( spies.npmUpdate.firstCall, path.join( workspaceAbsolutePath, dirs[ 0 ] ) );
-		sinon.assert.calledWithExactly( spies.npmUpdate.secondCall, path.join( workspaceAbsolutePath, dirs[ 1 ] ) );
-		sinon.assert.calledWithExactly( spies.npmUpdate.thirdCall, ckeditor5Path );
-
-		sinon.assert.calledOnce( spies.getSymlinks );
-		sinon.assert.notCalled( installTask );
-
-		sinon.assert.calledOnce( spies.removeSymlink );
-		sinon.assert.calledWithExactly( spies.removeSymlink, path.join( ckeditor5Path, 'node_modules', 'ckeditor5-unused' ) );
-	} );
-
-	it( 'should catch linking errors', () => {
-		const { log } = require( 'ckeditor5-dev-utils' );
-		const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
-		const installTask = sinon.spy();
-		const outSpy = sinon.spy();
-		const errSpy = sinon.spy();
-		spies.getDirectories = sinon.stub( workspace, 'getDirectories' ).returns( dirs );
-		spies.getSymlinks = sinon.stub( workspace, 'getSymlinks' ).returns( [ 'ckeditor5-unused' ] );
-		spies.linkDirectories.throws();
-
-		log.configure( outSpy, errSpy );
-
-		const json = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-core',
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		updateTask( installTask, ckeditor5Path, json, workspaceRoot, false );
-
-		const repoPath1 = path.join( workspaceAbsolutePath, dirs[ 0 ] );
-		const repoPath2 = path.join( workspaceAbsolutePath, dirs[ 1 ] );
-
-		sinon.assert.calledThrice( spies.fetchAll );
-		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
-		sinon.assert.calledWithExactly( spies.fetchAll.secondCall, repoPath1 );
-		sinon.assert.calledWithExactly( spies.fetchAll.thirdCall, repoPath2 );
-		sinon.assert.calledTwice( spies.checkout );
-		sinon.assert.calledWithExactly( spies.checkout.firstCall, repoPath1, 'master' );
-		sinon.assert.calledWithExactly( spies.checkout.secondCall, repoPath2, 'new-branch' );
-		sinon.assert.calledTwice( spies.pull );
-		sinon.assert.calledWithExactly( spies.pull.firstCall, repoPath1, 'master' );
-		sinon.assert.calledWithExactly( spies.pull.secondCall, repoPath2, 'new-branch' );
-
-		sinon.assert.notCalled( spies.npmUpdate );
-
-		sinon.assert.calledOnce( spies.getSymlinks );
-		sinon.assert.notCalled( installTask );
-
-		sinon.assert.calledOnce( spies.removeSymlink );
-		sinon.assert.calledWithExactly( spies.removeSymlink, path.join( ckeditor5Path, 'node_modules', 'ckeditor5-unused' ) );
-		sinon.assert.calledTwice( errSpy );
-	} );
-
-	it( 'should skip updating if no dependencies found and fetch only main repository', () => {
-		spies.getDependencies.restore();
-		spies.getDependencies = sinon.stub( workspace, 'getDependencies' ).returns( null );
-		const dirs = [ 'ckeditor5-core', 'ckeditor5-devtest' ];
-		const installTask = sinon.spy();
-		spies.getDirectories = sinon.stub( workspace, 'getDirectories' ).returns( dirs );
-		spies.getSymlinks = sinon.stub( workspace, 'getSymlinks' ).returns( [] );
-
-		const json = {
-			dependencies: {
-				'ckeditor5-core': 'ckeditor/ckeditor5-core',
-				'ckeditor5-devtest': 'ckeditor/ckeditor5-devtest#new-branch',
-				'other-plugin': '1.2.3'
-			}
-		};
-
-		updateTask( installTask, ckeditor5Path, json, workspaceRoot, false );
-
-		sinon.assert.calledOnce( spies.fetchAll );
-		sinon.assert.calledWithExactly( spies.fetchAll.firstCall, ckeditor5Path );
-
-		sinon.assert.notCalled( spies.checkout );
-		sinon.assert.notCalled( spies.pull );
-
-		sinon.assert.notCalled( spies.npmUpdate );
-
-		sinon.assert.calledOnce( spies.getSymlinks );
-		sinon.assert.notCalled( installTask );
-
-		sinon.assert.notCalled( spies.removeSymlink );
-	} );
-} );
-
-describe( 'gulp task update', () => {
-	const tasks = gulp.tasks;
-
-	it( 'should be available', () => {
-		expect( tasks ).to.have.property( 'update' );
-		expect( tasks.update.fn ).to.be.a( 'function' );
-	} );
-
-	it( 'should have an alias', () => {
-		expect( tasks ).to.have.property( 'pull' );
-		expect( tasks.pull.fn ).to.be.a( 'function' );
-
-		expect( tasks.pull.fn ).to.equal( tasks.update.fn );
-	} );
-} );

+ 0 - 158
dev/tests/exec/tasks.js

@@ -1,158 +0,0 @@
-/**
- * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
-
-/* global describe, it, beforeEach, afterEach */
-
-'use strict';
-
-const mockery = require( 'mockery' );
-const sinon = require( 'sinon' );
-const chai = require( 'chai' );
-const expect = chai.expect;
-
-describe( 'exec-tasks', () => {
-	let sandbox;
-	const config = {
-		WORKSPACE_DIR: '/path/exec/'
-	};
-	const getDevDirectoriesResult = [
-		{
-			repositoryPath: '/path/1',
-			repositoryURL: 'ckeditor/test1'
-		},
-		{
-			repositoryPath: '/path/2',
-			repositoryURL: 'ckeditor/test2'
-		}
-	];
-
-	beforeEach( () => {
-		mockery.enable( {
-			useCleanCache: true,
-			warnOnReplace: false,
-			warnOnUnregistered: false
-		} );
-		sandbox = sinon.sandbox.create();
-	} );
-
-	afterEach( () => {
-		mockery.disable();
-		sandbox.restore();
-	} );
-
-	describe( 'execOnRepositories', () => {
-		it( 'should throw error when there is no specified task', () => {
-			const errorMessage = 'Missing task parameter: --task task-name';
-			const { log } = require( 'ckeditor5-dev-utils' );
-			const logErrSpy = sandbox.stub( log, 'err' );
-
-			mockery.registerMock( 'minimist', () => {
-				return { };
-			} );
-			const tasks = require( '../../tasks/exec/tasks' )( config );
-
-			tasks.execOnRepositories();
-
-			sinon.assert.calledOnce( logErrSpy );
-			expect( logErrSpy.firstCall.args[ 0 ] ).to.be.an( 'error' );
-			expect( logErrSpy.firstCall.args[ 0 ].message ).to.equal( errorMessage );
-		} );
-
-		it( 'should throw error when task cannot be found', () => {
-			const { log } = require( 'ckeditor5-dev-utils' );
-			const logErrSpy = sandbox.stub( log, 'err' );
-
-			mockery.registerMock( 'minimist', () => {
-				return { task: 'task-to-run' };
-			} );
-			const tasks = require( '../../tasks/exec/tasks' )( config );
-
-			tasks.execOnRepositories();
-
-			sinon.assert.calledOnce( logErrSpy );
-			expect( logErrSpy.firstCall.args[ 0 ] ).to.be.an( 'error' );
-			expect( logErrSpy.firstCall.args[ 0 ].code ).to.equal( 'MODULE_NOT_FOUND' );
-		} );
-
-		it( 'should load task module', () => {
-			const { workspace, log } = require( 'ckeditor5-dev-utils' );
-			const logErrSpy = sandbox.stub( log, 'err' );
-
-			sandbox.stub( workspace, 'getDevDirectories' ).returns( [] );
-			mockery.registerMock( 'minimist', () => {
-				return { task: 'task-to-run' };
-			} );
-			mockery.registerMock( './functions/task-to-run', () => {} );
-			const tasks = require( '../../tasks/exec/tasks' )( config );
-
-			tasks.execOnRepositories();
-
-			sinon.assert.notCalled( logErrSpy );
-		} );
-
-		it( 'should log error when task is throwing exceptions', () => {
-			const { workspace, log } = require( 'ckeditor5-dev-utils' );
-			const taskStub = sinon.stub();
-			const logErrSpy = sandbox.stub( log, 'err' );
-
-			taskStub.onSecondCall().throws();
-
-			mockery.registerMock( 'minimist', () => {
-				return { task: 'task-to-run' };
-			} );
-			sandbox.stub( workspace, 'getDevDirectories' ).returns( getDevDirectoriesResult );
-			mockery.registerMock( './functions/task-to-run', taskStub );
-			const tasks = require( '../../tasks/exec/tasks' )( config );
-
-			tasks.execOnRepositories();
-
-			sinon.assert.calledOnce( logErrSpy );
-			expect( logErrSpy.firstCall.args[ 0 ] ).to.be.an( 'error' );
-			sinon.assert.calledTwice( taskStub );
-			sinon.assert.calledWith( taskStub, '/path/1', { task: 'task-to-run' } );
-			sinon.assert.calledWith( taskStub, '/path/2', { task: 'task-to-run' } );
-		} );
-
-		it( 'should execute task over directories', () => {
-			const { workspace } = require( 'ckeditor5-dev-utils' );
-			const taskStub = sinon.stub();
-
-			mockery.registerMock( 'minimist', () => {
-				return { task: 'task-to-run' };
-			} );
-			sandbox.stub( workspace, 'getDevDirectories' ).returns( getDevDirectoriesResult );
-			mockery.registerMock( './functions/task-to-run', taskStub );
-			const tasks = require( '../../tasks/exec/tasks' )( config );
-
-			tasks.execOnRepositories();
-
-			sinon.assert.calledTwice( taskStub );
-			sinon.assert.calledWith( taskStub, '/path/1', { task: 'task-to-run' } );
-			sinon.assert.calledWith( taskStub, '/path/2', { task: 'task-to-run' } );
-		} );
-
-		it( 'should execute task over specific directory', () => {
-			const Stream = require( 'stream' );
-			const { workspace } = require( 'ckeditor5-dev-utils' );
-			const taskStub = sinon.stub().returns( new Stream() );
-
-			mockery.registerMock( 'minimist', () => {
-				return {
-					task: 'task-to-run',
-					repository: 'test1'
-				};
-			} );
-			sandbox.stub( workspace, 'getDevDirectories' ).returns( getDevDirectoriesResult );
-			mockery.registerMock( './functions/task-to-run', taskStub );
-			const tasks = require( '../../tasks/exec/tasks' )( config );
-
-			tasks.execOnRepositories();
-
-			sinon.assert.calledOnce( taskStub );
-			sinon.assert.calledWith( taskStub, '/path/1', { task: 'task-to-run', repository: 'test1' } );
-			sinon.assert.neverCalledWith( taskStub, '/path/2', { task: 'task-to-run', repository: 'test1' } );
-		} );
-	} );
-} );

+ 14 - 4
gulpfile.js

@@ -21,16 +21,26 @@ const config = {
 	]
 };
 
-const ckeditor5Lint = require( 'ckeditor5-dev-lint' )( config );
-
 require( './dev/tasks/build/tasks' )( config ).register();
 require( './dev/tasks/bundle/tasks' )( config ).register();
-require( './dev/tasks/dev/tasks' )( config ).register();
 require( './dev/tasks/test/tasks' )( config ).register();
 require( './dev/tasks/docs/tasks' )( config ).register();
-require( './dev/tasks/exec/tasks' )( config ).register();
 
+// Lint tasks.
+const ckeditor5Lint = require( 'ckeditor5-dev-lint' )( config );
 gulp.task( 'lint', ckeditor5Lint.lint );
 gulp.task( 'lint-staged', ckeditor5Lint.lintStaged );
 gulp.task( 'default', [ 'build' ] );
 gulp.task( 'pre-commit', [ 'lint-staged' ] );
+
+// Development environment tasks.
+const ckeditor5DevEnv = require( 'ckeditor5-dev-env' )( config );
+gulp.task( 'init', ckeditor5DevEnv.initRepository );
+gulp.task( 'create-package', ckeditor5DevEnv.createPackage );
+gulp.task( 'update', ckeditor5DevEnv.updateRepositories );
+gulp.task( 'pull', ckeditor5DevEnv.updateRepositories );
+gulp.task( 'status', ckeditor5DevEnv.checkStatus );
+gulp.task( 'st', ckeditor5DevEnv.checkStatus );
+gulp.task( 'relink', ckeditor5DevEnv.relink );
+gulp.task( 'install', ckeditor5DevEnv.installPackage );
+gulp.task( 'exec', ckeditor5DevEnv.execOnRepositories );

+ 1 - 2
package.json

@@ -34,6 +34,7 @@
     "benderjs-promise": "^0.1.0",
     "benderjs-sinon": "^0.3.0",
     "chai": "^3.4.0",
+    "ckeditor5-dev-env": "ckeditor/ckeditor5-dev-env",
     "ckeditor5-dev-lint": "ckeditor/ckeditor5-dev-lint",
     "ckeditor5-dev-utils": "ckeditor/ckeditor5-dev-utils",
     "gulp": "^3.9.0",
@@ -55,13 +56,11 @@
     "gulp-watch": "^4.3.7",
     "guppy-pre-commit": "^0.3.0",
     "gzip-size": "^3.0.0",
-    "inquirer": "^0.11.0",
     "jsdoc": "^3.4.0",
     "merge-stream": "^1.0.0",
     "minimist": "^1.2.0",
     "mkdirp": "^0.5.1",
     "mockery": "^1.4.0",
-    "parse-gitignore": "^0.2.0",
     "pretty-bytes": "^3.0.1",
     "regenerator-runtime": "^0.9.5",
     "rollup": "^0.33.0",