Add auto-import for the package.json imports field (#55015)

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Andrew Branch <andrew@wheream.io>
This commit is contained in:
Emma Hamilton
2023-12-22 03:48:03 +10:00
committed by GitHub
parent 93e6b9da0c
commit fbcdb8cf4f
35 changed files with 2298 additions and 69 deletions

View File

@@ -915,6 +915,11 @@ export function isPackageJsonInfo(entry: PackageJsonInfoCacheEntry | undefined):
return !!(entry as PackageJsonInfo | undefined)?.contents;
}
/** @internal */
export function isMissingPackageJsonInfo(entry: PackageJsonInfoCacheEntry | undefined): entry is MissingPackageJsonInfo {
return !!entry && !(entry as PackageJsonInfo).contents;
}
export interface PackageJsonInfoCache {
/** @internal */ getPackageJsonInfo(packageJsonPath: string): PackageJsonInfoCacheEntry | undefined;
/** @internal */ setPackageJsonInfo(packageJsonPath: string, info: PackageJsonInfoCacheEntry): void;