PackageGraph is a Map, its nodes store relationship Sets#1260
Merged
Conversation
This was referenced Feb 12, 2018
825bf16 to
fa5733b
Compare
464ea38 to
29fa7c6
Compare
29fa7c6 to
8f30f81
Compare
evocateur
added a commit
that referenced
this pull request
Feb 13, 2018
This builds on #1260, utilizing the new `Map`-and-`Set`-based `PackageGraph` idioms. In the process, some algorithms were dramatically simplified, and performance improved noticeably (especially in the integration tests). ### `PublishCommand` * Literally every callback except the superclass lifecycle replaced with Promise-based patterns. * Integration test now actually tests `--conventional-commits` completely, shaving off a few seconds of execution time on average. ### `ConventionalCommitUtilities` * Use programmatic (async) `conventional-commits` APIs instead of synchronous CLI calls. * Now supports presets for `conventional-recommended-bump`, as long as they support the [new preset API](conventional-changelog/conventional-changelog#262). * Only the default (`conventional-commits-angular`) is included as a dependency, anything custom will need to be installed by the consumer.
evocateur
added a commit
that referenced
this pull request
Feb 13, 2018
|
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sorry this is so big
A lot of existing code was re-calculating stuff that should live inside the PackageGraph; namely, the relationships between packages (localDependencies and localDependents). I made PackageGraph a subclass of Map, mostly because it already had a
.get()method, and now it can be iterated and such. It's a lot more elegant, overall.A big piece of the new relationship logic is based on
npm-package-argparsing, which resolves a lot of previously half-baked logic. It's no longer necessary to pass the git version parser to the graph constructor, for example.npm-package-argwill also facilitate future graph manipulations, such as recognizing relativefile:specifiers correctly.Packagebinfield now properly resolves an object when the original value is a string shorthand.Packageproperties are immutable now, and very few are actually enumerable.PackageGraph--force-localevaluation has been moved intoPackageGraph's constructor, simplifying the existing evaluation of local dependencies during symlink creation inLinkCommand.PackageGraphinstance method, making the topological batching algogrithm much easier to read.PackageGraphNodes no longer have a confusingly-named "dependencies" list, but distinctMapinstances.localDependenciesand.localDependents.PackageGraphNodes themselves now forward most of the interestingPackageproperties, so the potential is there to use them directly, instead of the myriad places we pluck a (renamed)pkgproperty from various containers.UpdatedPackagesCollectorPackageGraphinstead of blithely duplicating it.PackageUtilitiestopologicallyBatchPackages()tobatchPackages(), because ain't nobody got time for that many syllables.