Lerna is not rendering inquirer prompt properly

60 views Asked by At

I am using lerna to handle the monorepo project structure.

When I run below code

const question = [{
       type: 'input',
       name: 'permission',
       message: chalk.red(logMessages.deleteFeatureReleaseBranch.permissionMessage),
       filter: (input: string) => {
            return input.trim();
       },
       validate: (input: string) => {
         if (!validatePermissionInput(input)) return logMessages.deleteFeatureReleaseBranch.permissionValidationFailedMessage;
              return true;
          }
}];

const permission:string = (await inquirer.prompt(question)).permission;
  • from the perticular project directory with simple node.js command node dist/src/index.js delete-feature -r
    It is showing the proper output as
    Are you sure you want to delete these branches(Y|N):

  • But when i run the command from the root directory as lerna command like lerna run start --scope=cli-app -- delete-feature -r
    It is not showing the prompt question like above. But when I force close the application or give random input which is failing validation, then it is showing the prompt question.

I don't know whether the issue is with inquirer (like extra configuration for lerna support) or it is the lerna not supporting inquirer prompt question.

0

There are 0 answers