This repository was archived by the owner on Mar 18, 2024. It is now read-only.
Refactor PackageManifest class#743
Merged
Merged
Conversation
Change method of instantiation of PackageManifest to factory method. This allows the package.xml to be parsed when PackageManifest is instantiated, as constructors cannot be asynchronous. By enforcing the xml to be parsed at object creation, the instance methods are guaranteed to have access to the manifest. Fix bug where 'types' is undefined and causes an error trying to reference a property on type undefined.
Codecov Report
@@ Coverage Diff @@
## develop #743 +/- ##
===========================================
+ Coverage 64.59% 64.81% +0.21%
===========================================
Files 44 44
Lines 1466 1475 +9
Branches 264 268 +4
===========================================
+ Hits 947 956 +9
Misses 519 519
Continue to review full report at Codecov.
|
azlam-abdulsalam
approved these changes
Oct 28, 2021
| sfpPackage._payload = await packageManifest.getManifest(); | ||
| const packageManifest:PackageManifest = await PackageManifest.create(sfpPackage.mdapiDir); | ||
| sfpPackage._payload = packageManifest.manifest; | ||
| sfpPackage._triggers = packageManifest.fetchTriggers(); |
Contributor
There was a problem hiding this comment.
Do we need a const here, cant we just short circuit it?
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.
Change method of instantiation of
PackageManifestto factory method. This allowsthe package.xml to be parsed when
PackageManifestis instantiated, asconstructors cannot be asynchronous. By enforcing the xml to be parsed at the time of object
creation, the instance methods are guaranteed to have access to the manifest.
Fix bug where 'types' is undefined and causes an error trying to reference a
property on type undefined.
Fixes https://github.com/dxatscale/sfp-cli/issues/47