Skip to content

Commit

Permalink
fix(outdated): should work when the tarballs are hoisted on a differe…
Browse files Browse the repository at this point in the history
…nt domain

close #5492
  • Loading branch information
zkochan committed Oct 15, 2022
1 parent 51e5a87 commit f6a2573
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/outdated/src/outdated.ts
Expand Up @@ -93,10 +93,14 @@ export async function outdated (
const current = (currentRelative && dp.parse(currentRelative).version) ?? currentRef
const wanted = dp.parse(relativeDepPath).version ?? ref
const { name: packageName } = nameVerFromPkgSnapshot(relativeDepPath, pkgSnapshot)
const name = dp.parse(relativeDepPath).name ?? packageName

// It might be not the best solution to check for pkgSnapshot.name
// TODO: add some other field to distinct packages not from the registry
if (pkgSnapshot.resolution && (pkgSnapshot.resolution['type'] || pkgSnapshot.name)) {
if (
pkgSnapshot.resolution &&
(pkgSnapshot.resolution['type'] || pkgSnapshot.name && /^https?:\/\//.test(allDeps[name]))
) {
if (current !== wanted) {
outdated.push({
alias,
Expand All @@ -110,7 +114,6 @@ export async function outdated (
return
}

const name = dp.parse(relativeDepPath).name ?? packageName
const latestManifest = await opts.getLatestManifest(
name,
opts.compatible ? (allDeps[name] ?? 'latest') : 'latest'
Expand Down

0 comments on commit f6a2573

Please sign in to comment.