@109cafe/label / BazelLikeSpec
An abstract spec for Bazel-like build systems
• Target extends BazelTarget
Spec<Target>
new BazelLikeSpec<
Target>():BazelLikeSpec<Target>
BazelLikeSpec<Target>
extract(
targets,target):null|string|string[]
Extract targets from a package
• targets: Record<string, Target>
the map returned by load
• target: string
the target name in a label
null | string | string[]
the matched target names or null if not found
abstractload(pkg):Promise<Record<string,Target>>
Load targets from a package
• pkg: ExactLabel
the label that is returned by lookup
Promise<Record<string, Target>>
a <TargetName, Target> map for the package
abstractlookup(label):Promise<ExactLabel[]>
Lookup packages by label. Typically, it should return a list label for the BUILD files of these packages.
• label: Label
the label to lookup
Promise<ExactLabel[]>
a list of matched packages presented by ExactLabel
validate(
label):undefined| "`...` can only be used with wildcard targets"
Validate a label
• label: Label
the label to validate
undefined | "`...` can only be used with wildcard targets"
a string or an Error for invalid label, and falsy values for valid label