feat(alpha): support-pnpm-package-manager [ZEND-6808] #2654
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.
This PR is based on this one here, and adds a few changes - mostly around how we will detect the fallback package manager.
This PR adds support for the
--pnpm
CLI option, and pnpm support in general, for thecreate-contentful-app
tool. This PR does not convert the entire monorepo to use pnpm.Why is this needed?
For third party apps using pnpm as a package manage, trying to create Contentful apps with
create-contentful-app
via a custom npm script (or any kind of script, really) can end up erroring out when the new app's dependencies are installed because of how different local versions of pnpm and npm are handled.The commands given in console for installing dependencies, and for creating app definitions, are misleading in this case. There was also some ambiguity and unexpected behavior in the handling of when both
--yarn
and--npm
flags were passed, and npm would be preferred even if it wasn't the current package manager. With this change, multiple package manager flags are ignored and the currently active package manager will be used; this is the same behavior as omitting a package manager flag at all.This PR updates all areas that package managers are referenced, including the Segment.io analytics track call. Comprehensive test coverage is provided.