function getImportSourceFromAst(astPath, identifierName) {
  let source;
  let importedIdentifierName;

  // TODO: use (smth like) getReferencedDeclaration if we want to catch renamed variables
  const binding = astPath.scope.getBinding(identifierName);

  let bindingType = binding?.path.type;
  let bindingPath = binding?.path;
  const matchingTypes = ['ImportSpecifier', 'ImportDefaultSpecifier', 'ExportSpecifier'];

  if (bindingType && matchingTypes.includes(bindingType)) {
    source = nameOf(binding?.path?.parentPath?.node?.source);
  } else {
    // no binding
    [source, bindingType, bindingPath] = getBindingAndSourceReexports(astPath, identifierName);
  }

  const shouldLookForDefaultExport = bindingType === 'ImportDefaultSpecifier';
  if (shouldLookForDefaultExport) {
    importedIdentifierName = '[default]';
  } else if (source) {
    const { node } = bindingPath;
    importedIdentifierName = nameOf(importedOf(node)) || nameOf(node.local);
  }

  return { source, importedIdentifierName };
}
Retrieves source (like '@lion/core') and importedIdentifierName (like 'lit') from ast for
current file.
We might be an import that was locally renamed.
Since we are traversing, we are interested in the imported name. Or in case of a re-export,
the local name.
@param {SwcPath} astPath Babel ast traversal path
@param {string} identifierName the name that should be tracked (and that exists inside scope of astPath)
@returns {{ source:string, importedIdentifierName:string }}