-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make release tools asynchronous #878
Conversation
packages/ckeditor5-dev-release-tools/lib/tasks/cleanuppackages.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-release-tools/lib/tasks/updatedependencies.js
Outdated
Show resolved
Hide resolved
packages/ckeditor5-dev-release-tools/lib/tasks/updateversions.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎉
|
||
const counter = tools.createSpinner( processDescription, { total: packages.length } ); | ||
counter.start(); | ||
const onPackageDone = progressFactory( listrTask, packages.length ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like progressFactory
could be passed as an argument to executeInParallel
. This way executeInParallel
would be independent of the task runner if we chose to use a different one in the future for other use cases.
The api could look somewhat like this
executeInParallel( {
packagesDirectory: 'packages',
progressFactory,
taskToExecute: () => {}
} );
function progressFactory( totalPackages ) {
let done = 0;
return () => {
done++;
listrTask.output = 'task finished. Total: ' + done + '/' + totalPackages;
};
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, but it's hard to predict what arguments it should receive. I would keep it in mind in the future to refactor it.
Suggested merge commit message (convention)
Internal: Make release tools asynchronous. Closes ckeditor/ckeditor5#14135.