@@ -65,24 +65,29 @@ async function computeNightlyTarballURL(
6565 artifactCoordinate /*: string */ ,
6666 artifactName /*: string */ ,
6767) /*: Promise<string> */ {
68+ const urlLog = createLogger ( 'NightlyURL' ) ;
6869 const xmlUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/react/${ artifactCoordinate } /${ version } -SNAPSHOT/maven-metadata.xml` ;
6970
71+ urlLog ( `Attempting to download maven-metadata.xml from: ${ xmlUrl } ...` ) ;
7072 const response = await fetch ( xmlUrl ) ;
7173 if ( ! response . ok ) {
74+ urlLog ( `Downloading maven-metadata.xml failed!` , 'error' ) ;
7275 return '' ;
7376 }
7477 const xmlText = await response . text ( ) ;
7578
7679 // Extract the <snapshot> block
7780 const snapshotMatch = xmlText . match ( / < s n a p s h o t > ( [ \s \S ] * ?) < \/ s n a p s h o t > / ) ;
7881 if ( ! snapshotMatch ) {
82+ urlLog ( `Could not find a <snapshot> tag that matches the regex!` , 'error' ) ;
7983 return '' ;
8084 }
8185 const snapshotContent = snapshotMatch [ 1 ] ;
8286
8387 // Extract <timestamp> from the snapshot block
8488 const timestampMatch = snapshotContent . match ( / < t i m e s t a m p > ( .* ?) < \/ t i m e s t a m p > / ) ;
8589 if ( ! timestampMatch ) {
90+ urlLog ( `Could not find a <timestamp> tag inside <snapshot> that matches the regex!` , 'error' ) ;
8691 return '' ;
8792 }
8893 const timestamp = timestampMatch [ 1 ] ;
@@ -92,12 +97,14 @@ async function computeNightlyTarballURL(
9297 / < b u i l d N u m b e r > ( .* ?) < \/ b u i l d N u m b e r > / ,
9398 ) ;
9499 if ( ! buildNumberMatch ) {
100+ urlLog ( `Could not find a <buildNumber> tag that matches the regex!` , 'error' ) ;
95101 return '' ;
96102 }
97103 const buildNumber = buildNumberMatch [ 1 ] ;
98104
99105 const fullVersion = `${ version } -${ timestamp } -${ buildNumber } ` ;
100106 const finalUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/react/${ artifactCoordinate } /${ version } -SNAPSHOT/${ artifactCoordinate } -${ fullVersion } -${ artifactName } ` ;
107+ urlLog ( `Final artifact URL found: ${ finalUrl } ` ) ;
101108 return finalUrl ;
102109}
103110
0 commit comments