Skip to content

Commit

Permalink
refactor(resolve-dependencies): types
Browse files Browse the repository at this point in the history
  • Loading branch information
zkochan committed May 28, 2024
1 parent 5de89d8 commit 6820001
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg-manager/resolve-dependencies/src/resolveDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ const dependencyResolvedLogger = logger('_dependency_resolved')
const omitDepsFields = omit(['dependencies', 'optionalDependencies', 'peerDependencies', 'peerDependenciesMeta'])

export function getPkgsInfoFromIds (
ids: string[],
ids: PkgResolutionId[],
resolvedPkgsById: ResolvedPkgsById
): Array<{ id: string, name: string, version: string }> {
): Array<{ id: PkgResolutionId, name: string, version: string }> {
return ids
.slice(1)
.map((id) => {
Expand Down Expand Up @@ -98,7 +98,7 @@ NodeId,
DependenciesTreeNode<T>
>

export type ResolvedPkgsById = Record<string, ResolvedPackage>
export type ResolvedPkgsById = Record<PkgResolutionId, ResolvedPackage>

export interface LinkedDependency {
isLinkedDependency: true
Expand All @@ -122,7 +122,7 @@ export interface PendingNode {
}

export interface ChildrenByParentId {
[id: string]: Array<{
[id: PkgResolutionId]: Array<{
alias: string
id: PkgResolutionId
}>
Expand All @@ -142,7 +142,7 @@ export interface ResolutionContext {
forceFullResolution: boolean
ignoreScripts?: boolean
resolvedPkgsById: ResolvedPkgsById
outdatedDependencies: { [pkgId: string]: string }
outdatedDependencies: Record<PkgResolutionId, string>
childrenByParentId: ChildrenByParentId
patchedDependencies?: Record<string, PatchFile>
pendingNodes: PendingNode[]
Expand All @@ -165,7 +165,7 @@ export interface ResolutionContext {
virtualStoreDir: string
virtualStoreDirMaxLength: number
workspacePackages?: WorkspacePackages
missingPeersOfChildrenByPkgId: Record<string, { parentImporterId: string, missingPeersOfChildren: MissingPeersOfChildren }>
missingPeersOfChildrenByPkgId: Record<PkgResolutionId, { parentImporterId: string, missingPeersOfChildren: MissingPeersOfChildren }>
hoistPeers?: boolean
}

Expand Down Expand Up @@ -470,7 +470,7 @@ async function resolveDependenciesOfImporters (
}
}
const newParentPkgAliases = { ...importer.parentPkgAliases, ...currentParentPkgAliases }
const postponedResolutionOpts = {
const postponedResolutionOpts: PostponedResolutionOpts = {
preferredVersions: newPreferredVersions,
parentPkgAliases: newParentPkgAliases,
publishedBy,
Expand Down Expand Up @@ -600,7 +600,7 @@ export async function resolveDependencies (
...options.parentPkgAliases,
...currentParentPkgAliases,
}
const postponedResolutionOpts = {
const postponedResolutionOpts: PostponedResolutionOpts = {
preferredVersions: newPreferredVersions,
parentPkgAliases: newParentPkgAliases,
publishedBy: options.publishedBy,
Expand Down

0 comments on commit 6820001

Please sign in to comment.