function getDependencies(packageDir, includeDevDeps) {
  const packageJsonPath = path.join(packageDir, 'package.json')
  const rawPackageJson = readFileSync(packageJsonPath, 'utf8')
  const packageJson = JSON.parse(rawPackageJson)
  const depsToWalk = [
    ...Object.keys(packageJson.dependencies || {}),
    ...Object.keys(packageJson.optionalDependencies || {}),
    ...Object.keys(packageJson.peerDependencies || {}),
    ...Object.keys(includeDevDeps ? packageJson.devDependencies || {} : {}),
  ].sort(comparePreferredPackageName)
  return depsToWalk
}
@param {string} packageDir
@param {boolean} includeDevDeps
@returns {string[]}