Remove resolvePm2 and fix pm2 types
#2174
Open
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.
Related issues
Proposed Changes
This PR changes how we import pm2. pm2 exports two members:
default(an instantiatedAPI) andcustom(the originalAPIclass). By importingcustomand passing thepm2_homeconfig prop, we can remove theresolvePm2logic.The only problem is that the
custommember isn't accounted for in the pm2 type definitions. I've submitted a PR Unitech/pm2#6064 to pm2 to fix this. Until that's merged, I've updated our pm2 patch to include my changes from that PR.Tip
View the upstream PR diff with whitespace changes hidden to see that I haven't actually changed all that much in
types/index.d.tsTesting Instructions
npm run cli:buildnode dist/cli/main.js site listPre-merge Checklist