@@ -65,29 +65,24 @@ async function computeNightlyTarballURL(
6565 artifactCoordinate /*: string */ ,
6666 artifactName /*: string */ ,
6767) /*: Promise<string> */ {
68- const urlLog = createLogger ( 'NightlyURL' ) ;
6968 const xmlUrl = `https://central.sonatype.com/repository/maven-snapshots/com/facebook/react/${ artifactCoordinate } /${ version } -SNAPSHOT/maven-metadata.xml` ;
7069
71- urlLog ( `Attempting to download maven-metadata.xml from: ${ xmlUrl } ...` ) ;
7270 const response = await fetch ( xmlUrl ) ;
7371 if ( ! response . ok ) {
74- urlLog ( `Downloading maven-metadata.xml failed!` , 'error' ) ;
7572 return '' ;
7673 }
7774 const xmlText = await response . text ( ) ;
7875
7976 // Extract the <snapshot> block
8077 const snapshotMatch = xmlText . match ( / < s n a p s h o t > ( [ \s \S ] * ?) < \/ s n a p s h o t > / ) ;
8178 if ( ! snapshotMatch ) {
82- urlLog ( `Could not find a <snapshot> tag that matches the regex!` , 'error' ) ;
8379 return '' ;
8480 }
8581 const snapshotContent = snapshotMatch [ 1 ] ;
8682
8783 // Extract <timestamp> from the snapshot block
8884 const timestampMatch = snapshotContent . match ( / < t i m e s t a m p > ( .* ?) < \/ t i m e s t a m p > / ) ;
8985 if ( ! timestampMatch ) {
90- urlLog ( `Could not find a <timestamp> tag inside <snapshot> that matches the regex!` , 'error' ) ;
9186 return '' ;
9287 }
9388 const timestamp = timestampMatch [ 1 ] ;
@@ -97,14 +92,12 @@ async function computeNightlyTarballURL(
9792 / < b u i l d N u m b e r > ( .* ?) < \/ b u i l d N u m b e r > / ,
9893 ) ;
9994 if ( ! buildNumberMatch ) {
100- urlLog ( `Could not find a <buildNumber> tag that matches the regex!` , 'error' ) ;
10195 return '' ;
10296 }
10397 const buildNumber = buildNumberMatch [ 1 ] ;
10498
10599 const fullVersion = `${ version } -${ timestamp } -${ buildNumber } ` ;
106100 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 } ` ) ;
108101 return finalUrl ;
109102}
110103
0 commit comments