How to use the @ckeditor/ckeditor5-dev-utils.tools.getDirectories function in @ckeditor/ckeditor5-dev-utils

To help you get started, we’ve selected a few @ckeditor/ckeditor5-dev-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / utils / getsubrepositoriespaths.js View on Github external
collection.skipped.add( options.cwd );
	} else {
		collection.matched.add( options.cwd );
	}

	if ( !options.packages ) {
		return collection;
	}

	const packagesPath = path.join( options.cwd, options.packages );
	const skipPackages = Array.isArray( options.skipPackages ) ? options.skipPackages : [ options.skipPackages ];

	const packageJson = getPackageJson( options.cwd );
	const dependencies = Object.keys( packageJson.dependencies || {} );

	for ( const directory of tools.getDirectories( packagesPath ) ) {
		const dependencyPath = path.join( packagesPath, directory );

		try {
			const dependencyName = getPackageJson( dependencyPath ).name;

			if ( isValidPackage( dependencyName ) ) {
				collection.matched.add( dependencyPath );
			} else {
				collection.skipped.add( dependencyPath );
			}
		} catch ( err ) {
			console.warn( `Missing "package.json file in "${ dependencyPath }". Skipping.` );
		}
	}

	return collection;
github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / utils / executeondependencies.js View on Github external
module.exports = function executeOnDependencies( options, functionToExecute ) {
	const packagesAbsolutePath = path.join( options.cwd, options.packages );
	const directories = tools.getDirectories( packagesAbsolutePath );
	const skipPackagesList = options.skipPackages || [];
	const skippedPackageNames = [];

	let promise = Promise.resolve();

	if ( !directories.length ) {
		return promise;
	}

	const packageJson = getPackageJson( options.cwd );
	const dependencies = Object.keys( packageJson.dependencies || {} );

	for ( const directory of directories ) {
		const dependencyPath = path.join( packagesAbsolutePath, directory );
		const dependencyName = getPackageJson( dependencyPath ).name;
github ckeditor / ckeditor5-dev / packages / ckeditor5-dev-env / lib / release-tools / utils / getsubpackagespaths.js View on Github external
module.exports = function getSubPackagesPaths( options ) {
	const packagesPath = path.join( options.cwd, options.packages );
	const skipPackages = Array.isArray( options.skipPackages ) ? options.skipPackages : [ options.skipPackages ];

	const pathsCollection = {
		matched: new Set(),
		skipped: new Set()
	};

	for ( const directory of tools.getDirectories( packagesPath ) ) {
		const dependencyPath = path.join( packagesPath, directory );
		const dependencyName = getPackageJson( dependencyPath ).name;

		if ( isValidPackage( dependencyName ) ) {
			pathsCollection.matched.add( dependencyPath );
		} else {
			pathsCollection.skipped.add( dependencyPath );
		}
	}

	return pathsCollection;

	function isValidPackage( packageName ) {
		for ( const skipPackageGlob of skipPackages ) {
			if ( minimatch( packageName, skipPackageGlob ) ) {
				return false;