Skip to content

Conversation

michaelpineirocontentful
Copy link
Contributor

@michaelpineirocontentful michaelpineirocontentful commented Aug 22, 2025

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 the create-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.

Based on [this PR](#2631) , with minor tweaks.
@michaelpineirocontentful michaelpineirocontentful force-pushed the feat-support-pnpm-package-manager branch from 91ce91f to bde44f7 Compare August 22, 2025 21:54
@michaelpineirocontentful michaelpineirocontentful marked this pull request as ready for review August 22, 2025 22:31
@michaelpineirocontentful michaelpineirocontentful merged commit bd0a6b6 into canary Aug 22, 2025
19 checks passed
@michaelpineirocontentful michaelpineirocontentful deleted the feat-support-pnpm-package-manager branch August 22, 2025 22:31
@michaelpineirocontentful michaelpineirocontentful restored the feat-support-pnpm-package-manager branch August 22, 2025 22:33
@michaelpineirocontentful michaelpineirocontentful changed the title feat: support-pnpm-package-manager [ZEND-6808] feat(alpha): support-pnpm-package-manager [ZEND-6808] Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants