mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-10 16:58:55 -05:00
revert changes to npmView (#319352)
This commit is contained in:
committed by
GitHub
parent
1e5f330ffe
commit
a32f3aed02
@@ -323,18 +323,16 @@ export class PackageJSONContribution implements IJSONContribution {
|
||||
}
|
||||
|
||||
private async npmView(npmCommandPath: string, pack: string, resource: Uri | undefined): Promise<ViewPackageInfo | undefined> {
|
||||
// Request @latest to avoid fetching publish timestamps for all versions in the time field.
|
||||
const args = ['view', '--json', '--', `${pack}@latest`, 'description', 'homepage', 'version', 'time'];
|
||||
|
||||
const args = ['view', '--json', '--', pack, 'description', 'dist-tags.latest', 'homepage', 'version', 'time'];
|
||||
const stdout = await this.runNpmCommand(npmCommandPath, args, resource);
|
||||
if (stdout) {
|
||||
try {
|
||||
const content = JSON.parse(stdout);
|
||||
const version = content['version'];
|
||||
const version = content['dist-tags.latest'] || content['version'];
|
||||
return {
|
||||
description: content['description'],
|
||||
version: content['version'],
|
||||
time: version ? content['time']?.[version] : undefined,
|
||||
version,
|
||||
time: content.time?.[version],
|
||||
homepage: content['homepage']
|
||||
};
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user