Conversation
|
Most modern ember projects rely on the Given that, I've confirmed the PR works to successfully install and run our projects regarding COREPACK_ENABLE_DOWNLOAD_PROMPT: definitely turn it off, it becomes annoying very quickly |
|
Thank you for the PR and the solid description with links to upstream documentation. Reading into corepack based on the links provided it seems this will install any version specified at runtime, defaulting to latest. One of the benefits of Docker Ember is to have the static set of dependencies so we have the same stable environment to run against each time. Installing the core dependency at runtime conflicts with that. Our aim is to have a streamlined environment which is shared rather than a situation where each project chooses a solution with slightly different upsides and downsides. Perhaps corepack can be used in such a setting. The PR itself removes Yarn because it could now be manually installed through corepack (it is unnecessarily breaking because it removes yarn but doesn't add it through corepack AFAICT). At this point corepack supports yarn and pnpm. It being experimental and lacking support for npm itself, I guess those will be the only ones supported in the future. Do you see path forward in which the versions are locked in? What would that look like? Is corepack the optimal approach when we're aiming for a shared environment used across projects? Installing a specific version up front through corepack does look clean to me with the added risk that projects rolls their own instead of using a shared standard. Would appreciate your input. |
|
Corepack will indeed (by default) install and use the latest version of the specified package manager. This can however be controlled through the Additonally, a project can indeed pin/specify which package manager + version to use. This can ensure consistency when developing the app/addon. To adjust this logic, you can specify the While this PR indeed removes So to provide the option to lock in versions of both
I do however also like that projects themselves may specific which package manager they use (especially if that project is also used outside a Corepack indeed does not (weirdly enough) support |
Overview
This PR includes support for corepack. Corepack is a tool to easily manage package managers like
pnpmandyarn. It also allows you to manage different versions of these package managers.By enabling corepack support, it should be straightforward for a user to utilize both
pnpmandyarn. The package manager/version that is used depends on thepackageManagerfield of thepackage.jsonfile (https://nodejs.org/api/packages.html#packagemanager).How to test/reproduce
docker-emberedicommand and ensure you have access to bothpnpmandyarnpackageManagersetting. Otherwise, the latest stable version should be used.Challenges/uncertainties
Unsure if we should set
COREPACK_ENABLE_DOWNLOAD_PROMPTto 0. This environment variable controls whether a prompt is shown if the packagemanager version is not yet installed.