@@ -90,13 +90,14 @@ const main = defineCommand({
9090 } ,
9191 } ,
9292 run : async ( { args } ) => {
93- const paths = args . _ . length > 0
94- ? await glob ( args . _ , {
95- expandDirectories : false ,
96- onlyDirectories : true ,
97- absolute : true ,
98- } )
99- : [ process . cwd ( ) ] ;
93+ const paths =
94+ args . _ . length > 0
95+ ? await glob ( args . _ , {
96+ expandDirectories : false ,
97+ onlyDirectories : true ,
98+ absolute : true ,
99+ } )
100+ : [ process . cwd ( ) ] ;
100101
101102 const templates = await glob ( args . template ?? [ ] , {
102103 expandDirectories : false ,
@@ -329,22 +330,21 @@ const main = defineCommand({
329330 ) ;
330331
331332 shasums [ pJson . name ] = shasum ;
332- console . warn ( `shasum for ${ pJson . name } (${ filename } ): ${ shasum } ` ) ;
333333
334334 const outputPkg = outputMetadata . packages . find (
335335 ( p ) => p . name === pJson . name ,
336336 ) ! ;
337337 outputPkg . shasum = shasum ;
338338
339- const filePath = path . resolve ( p , filename )
339+ const filePath = path . resolve ( p , filename ) ;
340340 const buffer = await fs . readFile ( filePath ) ;
341341
342342 const blob = new Blob ( [ buffer ] , {
343343 type : "application/octet-stream" ,
344344 } ) ;
345345 formData . append ( `package:${ pJson . name } ` , blob , filename ) ;
346346
347- await fs . rm ( filePath )
347+ await fs . rm ( filePath ) ;
348348 } finally {
349349 await restoreMap . get ( p ) ?.( ) ;
350350 }
@@ -376,8 +376,11 @@ const main = defineCommand({
376376 console . error ( await createMultipartRes . text ( ) ) ;
377377 continue ;
378378 }
379- const { key : uploadKey , id : uploadId , ...data } =
380- await createMultipartRes . json ( ) ;
379+ const {
380+ key : uploadKey ,
381+ id : uploadId ,
382+ ...data
383+ } = await createMultipartRes . json ( ) ;
381384
382385 interface R2UploadedPart {
383386 partNumber : number ;
@@ -432,7 +435,9 @@ const main = defineCommand({
432435 }
433436
434437 const packageManager = await detect ( ) ;
435- const agent = packageManager . agent . includes ( '@' ) ? packageManager . agent . split ( '@' ) [ 0 ] : packageManager . agent ;
438+ const agent = packageManager . agent . includes ( "@" )
439+ ? packageManager . agent . split ( "@" ) [ 0 ]
440+ : packageManager . agent ;
436441 const res = await fetch ( publishUrl , {
437442 method : "POST" ,
438443 headers : {
@@ -454,15 +459,22 @@ const main = defineCommand({
454459 ) ;
455460
456461 console . warn ( "\n" ) ;
457- console . warn (
458- `⚡️ Your npm packages are published.\n${ [ ...formData . keys ( ) ]
459- . filter ( ( k ) => k . startsWith ( "package:" ) )
460- . map (
461- ( name , i ) =>
462- `${ name . slice ( "package:" . length ) } : npm i ${ laterRes . urls [ i ] } ` ,
463- )
464- . join ( "\n" ) } `,
465- ) ;
462+ console . warn ( "⚡️ Your npm packages are published.\n" ) ;
463+
464+ const packageLogs = [ ...formData . keys ( ) ]
465+ . filter ( ( k ) => k . startsWith ( "package:" ) )
466+ . map ( ( name , i ) => {
467+ const packageName = name . slice ( "package:" . length ) ;
468+ const url = new URL ( laterRes . urls [ i ] )
469+ const publintUrl = new URL ( `/pkg.pr.new${ url . pathname } ` , "https://publint.dev" )
470+ return `${ packageName } :
471+ - sha: ${ shasums [ packageName ] }
472+ - publint: ${ publintUrl }
473+ - npm: npm i ${ url } ` ;
474+ } )
475+ . join ( "\n\n" ) ;
476+
477+ console . warn ( packageLogs ) ;
466478
467479 const output = JSON . stringify ( outputMetadata , null , 2 ) ;
468480 if ( printJson ) {
@@ -542,7 +554,7 @@ function hijackDeps(
542554}
543555
544556function getFormEntrySize ( entry : FormDataEntryValue ) {
545- if ( typeof entry === ' string' ) {
557+ if ( typeof entry === " string" ) {
546558 return entry . length ;
547559 }
548560 return entry . size ;
0 commit comments