import { Tagger } from "@atomist/sdm-pack-aspect" ; import { NpmDeps } from "@atomist/sdm-pack-fingerprint" ; import { TsLintType } from "../aspect/node/TsLint" ; import { TypeScriptVersion } from "../aspect/node/TypeScriptVersion" ; export const Node = { name : "node" , description : "Node" , test : async ( repo ) => repo . analysis . fingerprints . some ( fp => fp . type === NpmDeps . name ) , } ; export const TypeScript = { name : "typescript" , description : "TypeScript version" , test : async ( repo ) => repo . analysis . fingerprints . some ( fp => fp . type === TypeScriptVersion . name ) , } ; export const TsLint = { name : "tslint" , description : "tslint (TypeScript)" , test : async ( repo ) => repo . analysis . fingerprints . some ( fp => fp . type === TsLintType ) , } ; export function usesNodeLibrary ( opts ) { return usesNodeLibraryWhen ( { name : opts . name || opts . library , test : ( lib , version ) => lib === opts . library && ( opts . version ? version === opts . version : true ) , description : `Uses node library ${ opts . library }` , } ) ; } export function usesNodeLibraryWhen ( opts ) { return { name : opts . name , description : opts . description , test : async ( repo ) => repo . analysis . fingerprints . some ( fp => fp . type === NpmDeps . name && opts . test ( fp . data [ 0 ] , fp . data [ 1 ] ) ) , } ; }