-
Notifications
You must be signed in to change notification settings - Fork 96
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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
let packageManifest:PackageManifest = new PackageManifest(sfpPackage.mdapiDir); | ||
sfpPackage._payload = await packageManifest.getManifest(); | ||
const packageManifest:PackageManifest = await PackageManifest.create(sfpPackage.mdapiDir); | ||
sfpPackage._payload = packageManifest.manifest; | ||
sfpPackage._triggers = packageManifest.fetchTriggers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a const here, cant we just short circuit it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore me :)
Change method of instantiation of
PackageManifest
to factory method. This allowsthe package.xml to be parsed when
PackageManifest
is 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