Skip to content

Commit

Permalink
Delay visibility propagation until deps are known (#1739)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovelypuppy0607 committed Nov 11, 2016
1 parent baa6b32 commit 6174a6a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/package-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,6 @@ export default class PackageRequest {
invariant(ref, 'Resolved package info has no package reference');
ref.addRequest(this);
ref.addPattern(this.pattern, resolved);
ref.addOptional(this.optional);
ref.addVisibility(this.visibility);
return;
}

Expand Down Expand Up @@ -280,6 +278,12 @@ export default class PackageRequest {

await Promise.all(promises);
ref.addDependencies(deps);

// Now that we have all dependencies, it's safe to propagate optional & visibility
for (const otherRequest of ref.requests.slice(1)) {
ref.addOptional(otherRequest.optional);
ref.addVisibility(otherRequest.visibility);
}
}

/**
Expand Down

0 comments on commit 6174a6a

Please sign in to comment.