function getPackageVersion(packageName) {
  const projectPackageJson = JSON.parse(
    fs.readFileSync(`./package.json`, `utf-8`)
  )
  const { dependencies = {}, devDependencies = {} } = projectPackageJson
  const version = dependencies[packageName] || devDependencies[packageName]
  return version || `latest`
}
Compare dependencies of installed packages and monorepo package.
It will skip dependencies that are removed in monorepo package.

If local package is not installed, it will check unpkg.com.
This allow gatsby-dev to skip publishing unnecesairly and
let install packages from public npm repository if nothing changed.