MCPcopy Create free account
hub / github.com/arktypeio/arktype / ModuleGraph

Class ModuleGraph

ark/aot/graph.ts:1165–6253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1163}
1164
1165export class ModuleGraph {
1166 host: PrecompileHost
1167 cwd: string | undefined
1168 private modulesById: Record<string, SourceModule | ImportTarget> =
1169 Object.create(null)
1170 private kindsByKey = new Map<Key, KindBits>()
1171 private kindsByNode = new Map<Node, KindBits>()
1172 private localTypesByModule = new WeakMap<
1173 SourceModule,
1174 Record<string, LocalType | null>
1175 >()
1176 private exportedTypesByModule = new WeakMap<
1177 SourceModule,
1178 Map<string, ExportedType>
1179 >()
1180 private declaredTypeKinds = new Map<
1181 LocalType,
1182 Map<string, KindBits | undefined>
1183 >()
1184 // a helper's parameters as one call passes them
1185 // the .d.ts beside each JS module, or null where its build wrote none
1186 private declarationsById: Record<string, SourceModule | null> =
1187 Object.create(null)
1188
1189 private bindingKindOfKeys = new WeakSet<KindOfKey>()
1190 private applicationsByFn = new Map<FunctionNode, Map<string, Application>>()
1191 private membersByOwner = new Map<Node | Binding, Map<unknown, Member>>()
1192 private resolving = new Set<Node>()
1193 private heldKindsByNode = new Map<Node, KindBits>()
1194 private writesByBinding = new WeakMap<Binding, Node[]>()
1195 // what mayWritesOf finds of each binding by how it holds a value
1196 private followsByBinding = new WeakMap<Binding, Map<string, Follow>>()
1197 // where a value reaches code the build doesn't follow, which may write it
1198 private escapes = new WeakSet<Node>()
1199 private holdings: Holding[] | undefined
1200 // how a function's calls are being followed, which its own calls aren't again
1201 private returning = new WeakMap<FunctionNode, Set<string>>()
1202 // what each method may write through `this`, by how it holds a value
1203 private thisWritesByFn = new WeakMap<FunctionNode, Map<string, Node[]>>()
1204 // each module of a package the build reads only for what a callee may
1205 // write, or null for one it can't read
1206 private packageModulesById = new Map<string, SourceModule | null>()
1207 view: ProgramView | undefined
1208 private importersById: Map<string, ImporterEdge[]> | undefined
1209 private elsewhereByHolder = new WeakMap<
1210 object,
1211 Map<number | string, Elsewhere | null>
1212 >()
1213 private importsById: Record<string, string[]> = Object.create(null)
1214 private optsInByPackage: Record<string, boolean> = Object.create(null)
1215 dependencies: DependencyModes
1216 // where Node runs each dependency as published, as for --emit
1217 leavesDependencies = false
1218 private packageNamesByDir: Record<string, string | undefined> =
1219 Object.create(null)
1220 private workspaceNamesByDir: PackageNamesByDir = Object.create(null)
1221
1222 constructor(

Callers

nothing calls this directly

Calls 2

solveMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected