MCPcopy Create free account
hub / github.com/expo/expo / buildWorkspacesInfo

Function buildWorkspacesInfo

tools/src/Workspace.ts:58–72  ·  view source on GitHub ↗
(packages: Package[])

Source from the content-addressed store, hash-verified

56}
57
58export function buildWorkspacesInfo(packages: Package[]): WorkspacesInfo {
59 const packagesByName = new Map<string, Package>();
60 for (const pkg of packages) {
61 packagesByName.set(pkg.packageName, pkg);
62 }
63
64 const result: WorkspacesInfo = {};
65 for (const pkg of packages) {
66 result[pkg.packageName] = {
67 location: path.relative(EXPO_DIR, pkg.path),
68 ...classifyDependencies(pkg, packagesByName),
69 };
70 }
71 return result;
72}
73
74function classifyDependencies(pkg: Package, byName: Map<string, Package>) {
75 const workspaceDependencies: string[] = [];

Callers 2

Workspace.test.tsFile · 0.90
getInfoAsyncFunction · 0.85

Calls 3

classifyDependenciesFunction · 0.85
setMethod · 0.65
relativeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…