@@ -21,8 +21,12 @@ interface PublishOptions {
2121const NPM_REQUEST_CONCURRENCY_LIMIT = 40 ;
2222const NPM_PUBLISH_CONCURRENCY_LIMIT = 10 ;
2323
24- const npmRequestQueue = createPromiseQueue ( NPM_REQUEST_CONCURRENCY_LIMIT ) ;
25- const npmPublishQueue = createPromiseQueue ( NPM_PUBLISH_CONCURRENCY_LIMIT ) ;
24+ export const npmRequestQueue = createPromiseQueue (
25+ NPM_REQUEST_CONCURRENCY_LIMIT
26+ ) ;
27+ export const npmPublishQueue = createPromiseQueue (
28+ NPM_PUBLISH_CONCURRENCY_LIMIT
29+ ) ;
2630
2731function jsonParse ( input : string ) {
2832 try {
@@ -204,7 +208,7 @@ async function internalPublish(
204208 [ scope ? `npm_config_${ scope } :registry` : "npm_config_registry" ] : registry ,
205209 } ;
206210
207- if ( await requiresDelegatedAuth ( twoFactorState ) ) {
211+ if ( requiresDelegatedAuth ( twoFactorState ) ) {
208212 const result =
209213 publishTool . name === "pnpm"
210214 ? spawnSync ( "pnpm" , [ "publish" , ...publishFlags ] , {
@@ -271,9 +275,9 @@ async function internalPublish(
271275 process . stdin . isTTY
272276 ) {
273277 // the current otp code must be invalid since it errored
274- twoFactorState . token = null ;
278+ twoFactorState . token = undefined ;
275279 // just in case this isn't already true
276- twoFactorState . isRequired = Promise . resolve ( true ) ;
280+ twoFactorState . isRequired = true ;
277281 twoFactorState . allowConcurrency = false ;
278282 npmPublishQueue . setConcurrency ( 1 ) ;
279283 return {
@@ -303,10 +307,6 @@ export function publish(
303307 twoFactorState : TwoFactorState
304308) : Promise < { published : boolean } > {
305309 return npmRequestQueue . add ( async ( ) => {
306- if ( await requiresDelegatedAuth ( twoFactorState ) ) {
307- npmPublishQueue . setConcurrency ( 1 ) ;
308- }
309-
310310 let result : { published : boolean ; allowRetry ?: boolean } ;
311311 do {
312312 result = await npmPublishQueue . add ( ( ) =>
0 commit comments