Skip to content

Commit

Permalink
Removes enquirer from the initial load
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis committed Mar 27, 2024
1 parent faedd6c commit 24caa2d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/plugin-npm/sources/npmHttpUtils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {Configuration, Ident, formatUtils, httpUtils, nodeUtils, StreamReport, structUtils, hashUtils, Project, miscUtils, Cache} from '@yarnpkg/core';
import {MessageName, ReportError} from '@yarnpkg/core';
import {Filename, PortablePath, ppath, xfs} from '@yarnpkg/fslib';
import {prompt} from 'enquirer';
import semver from 'semver';

import {Hooks} from './index';
Expand Down Expand Up @@ -509,6 +508,8 @@ async function askForOtp(error: any, {configuration}: {configuration: Configurat
if (!process.env.YARN_IS_TEST_ENV) {
const autoOpen = notice.match(/open (https?:\/\/\S+)/i);
if (autoOpen && nodeUtils.openUrl) {
const {prompt} = await import(`enquirer`);

const {openNow} = await prompt<{openNow: boolean}>({
type: `confirm`,
name: `openNow`,
Expand All @@ -534,6 +535,8 @@ async function askForOtp(error: any, {configuration}: {configuration: Configurat
if (process.env.YARN_IS_TEST_ENV)
return process.env.YARN_INJECT_NPM_2FA_TOKEN || ``;

const {prompt} = await import(`enquirer`);

const {otp} = await prompt<{otp: string}>({
type: `password`,
name: `otp`,
Expand Down

0 comments on commit 24caa2d

Please sign in to comment.