function normalizeThemePath (resolved) {
  const { entry, fromDep } = resolved
  if (fromDep) {
    return parse(require.resolve(entry)).dir
  } else if (entry.endsWith('.js') || entry.endsWith('.vue')) {
    return parse(entry).dir
  } else {
    return entry
  }
}
Resolve theme.

  Resolving Priority:

  1. If the theme was a absolute path and that path exists, respect it
     as the theme directory.
  2. If 'theme' directory located at vuepressDir exists, respect it as
     the theme directory.
  3. If 'theme' was a shortcut string, resolve it from deps.

@param {string} theme
@param {string} sourceDir
@param {string} vuepressDir
@returns {ThemeAPI}