select method

Future<ProfileSelection> select(
  1. String bundle, {
  2. String? configPath,
  3. String? projectRoot,
})

Validation's selection: the bundle's binding, its chain from the lock, each package from the local cache, composed. Never runs Git, never fetches, never writes, and reports every failure as exactly one diagnostic. A chain member's skill that get has not installed at the locked commit is a warning, so the rules still run. Without configPath it binds through the nearest wayfinder.json above bundle, never above projectRoot when one is given (WayfinderProjectConfig.bind).

Implementation

Future<ProfileSelection> select(
  String bundle, {
  String? configPath,
  String? projectRoot,
}) async {
  final BoundBundle bound;
  try {
    bound = await WayfinderProjectConfig.bind(
      bundle,
      configPath: configPath,
      projectRoot: projectRoot,
    );
  } on BundleBindingException catch (error) {
    return UnselectedProfile([error.diagnostic]);
  }
  final (:status, :selection) = await _assess(
    projectRoot: bound.projectRoot,
    raw: bound.source,
    lock: await _readProjectLock(bound.projectRoot),
    binding: bound.binding,
    config: bound.config,
  );
  return selection ?? UnselectedProfile([status.diagnostic!]);
}