import { Aspect , fingerprintOf , } from "@atomist/sdm-pack-fingerprint" ; import { setSpringBootVersionTransform , SpringBootVersionInspection , } from "@atomist/sdm-pack-spring" ; const SpringBootVersionType = "spring-boot-version" ; export const SpringBootVersion = { name : SpringBootVersionType , displayName : "Spring Boot Version" , extract : async ( p ) => { const versions = await SpringBootVersionInspection ( p , undefined ) ; if ( ! versions || versions . versions . length === 0 ) { return undefined ; } return fingerprintOf ( { type : SpringBootVersionType , data : versions , } ) ; } , apply : async ( p , papi ) => { const fp = papi . parameters . fp ; if ( fp . data . length !== 1 ) { return p ; } await setSpringBootVersionTransform ( fp . data [ 0 ] ) ( p , undefined , undefined ) ; return p ; } , toDisplayableFingerprintName : ( ) => "Spring Boot version" , toDisplayableFingerprint : fp => fp . data . versions . map ( v => v . version ) . join ( "," ) , } ;