Skip to content

Commit

Permalink
Merge 07f2745 into ba219da
Browse files Browse the repository at this point in the history
  • Loading branch information
latin-1 committed Jun 6, 2024
2 parents ba219da + 07f2745 commit 1b523df
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/utils/devenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,26 @@ export default async function(dir: Path) {
};
}
await parse_well_formatted_node(node)
if (isString(json?.packageManager)) {
try {
const { project, constraint } = utils.pkg.parse(json.packageManager)
switch (project) {
case "yarn":
// TODO: find a better way to check the version
if (/@1(\.|$)/.test(json.packageManager)) {
pkgs.push({ project: 'classic.yarnpkg.com', constraint })
} else {
pkgs.push({ project: 'yarnpkg.com', constraint })
}
break
case "pnpm":
pkgs.push({ project: 'pnpm.io', constraint })
break
}
} catch {
// ignore unrecognized versions (for example, a url)
}
}
has_package_json = true
}

Expand Down

0 comments on commit 1b523df

Please sign in to comment.