Skip to content

Commit

Permalink
Merge pull request #17214 from ckeditor/i/3827-esm
Browse files Browse the repository at this point in the history
Internal: Improved the `listr2` due to the recent ESM changes.
  • Loading branch information
pomek authored Oct 3, 2024
2 parents fde9037 + 18fa16f commit 0802874
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
"@ckeditor/ckeditor5-slash-command": "43.2.0",
"@ckeditor/ckeditor5-template": "43.2.0",
"@ckeditor/ckeditor5-track-changes": "43.2.0",
"@inquirer/prompts": "^6.0.0",
"@listr2/prompt-adapter-inquirer": "^2.0.16",
"@ocular-d/vale-bin": "^2.29.1",
"@webspellchecker/wproofreader-ckeditor5": "^3.0.0",
"@wiris/mathtype-ckeditor5": "^8.10.0",
Expand Down
10 changes: 6 additions & 4 deletions scripts/release/preparepackages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { EventEmitter } from 'events';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';
import { tools } from '@ckeditor/ckeditor5-dev-utils';
import { Listr } from 'listr2';
import { ListrInquirerPromptAdapter } from '@listr2/prompt-adapter-inquirer';
import { confirm } from '@inquirer/prompts';
import updateVersionReferences from './utils/updateversionreferences.mjs';
import buildPackageUsingRollupCallback from './utils/buildpackageusingrollupcallback.mjs';
import buildTsAndDllForCKEditor5Root from './utils/buildtsanddllforckeditor5root.mjs';
Expand Down Expand Up @@ -97,10 +99,10 @@ const tasks = new Listr( [
return fs.emptyDir( RELEASE_DIRECTORY );
}

const shouldContinue = await task.prompt( {
type: 'Confirm',
message: 'The release directory must be empty. Continue and remove all files?'
} );
const shouldContinue = await task.prompt( ListrInquirerPromptAdapter )
.run( confirm, {
message: 'The release directory must be empty. Continue and remove all files?'
} );

if ( !shouldContinue ) {
return Promise.reject( 'Aborting as requested.' );
Expand Down
5 changes: 4 additions & 1 deletion scripts/release/publishpackages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import upath from 'upath';
import fs from 'fs-extra';
import * as releaseTools from '@ckeditor/ckeditor5-dev-release-tools';
import { Listr } from 'listr2';
import { ListrInquirerPromptAdapter } from '@listr2/prompt-adapter-inquirer';
import { confirm } from '@inquirer/prompts';
import validateDependenciesVersions from './utils/validatedependenciesversions.mjs';
import parseArguments from './utils/parsearguments.mjs';
import { CKEDITOR5_ROOT_PATH } from '../constants.mjs';
Expand Down Expand Up @@ -47,7 +49,8 @@ const tasks = new Listr( [
return true;
}

return task.prompt( { type: 'Confirm', message: 'Do you want to continue?' } );
return task.prompt( ListrInquirerPromptAdapter )
.run( confirm, { message: 'Do you want to continue?' } );
},
optionalEntries: {
// The `#default` key is used for all packages that do not have own definition.
Expand Down

0 comments on commit 0802874

Please sign in to comment.