Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions packages/angular/cli/src/package-managers/package-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import { join } from 'node:path';
import npa from 'npm-package-arg';
import { maxSatisfying } from 'semver';
import { ErrorInfo, PackageManagerError } from './error';
import { PackageManagerError } from './error';
import { Host } from './host';
import { Logger } from './logger';
import { PackageManagerDescriptor } from './package-manager-descriptor';
Expand Down Expand Up @@ -407,11 +407,22 @@ export class PackageManager {

const cacheKey = options.registry ? `${specifier}|${options.registry}` : specifier;

return this.#fetchAndParse(
const manifest = await this.#fetchAndParse(
commandArgs,
(stdout, logger) => this.descriptor.outputParsers.getRegistryManifest(stdout, logger),
{ ...options, cache: this.#manifestCache, cacheKey },
);

// If the provided version was not a specific version, also cache the specific fetched version
if (manifest && manifest.version !== version) {
const manifestSpecifier = `${manifest.name}@${manifest.version}`;
const manifestCacheKey = options.registry
? `${manifestSpecifier}|${options.registry}`
: manifestSpecifier;
this.#manifestCache.set(manifestCacheKey, manifest);
}

return manifest;
}

/**
Expand Down