This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
Detect package managers #13
Labels
type: feature
code contributing to the implementation of a feature and/or user facing functionality
Support detection of package managers such as
yarn
andnpm
based on project files and env variables set.See - https://github.com/netlify/build-image/blob/be42e453d6c8f171cc2f654acc29c0a8b60e6d93/run-build-functions.sh#L508-L521
This would require a couple of changes.
We would need to change the package API to receive the env var config object (in this case we're only interested in the
all
entry from the@netlify/config
output). In order for thebuildbot
to pass in this data we would need a new cli field (--config-env
?--env
?) which could be used to send a JSON serialized env object similar to - https://github.com/netlify/buildbot/blob/master/bot/configuration.go#L127.In terms of how we want to detect
package-managers
I would like to take a page out of theframework-info
book relying on an interface that's easy to extend with new package managers, by relying on a simple JSON format such as:Initially we could make the detection based on
env
vars ORconfigFiles
. With env vars taking precedence over files. This is probably somewhat of a simplistic approach for the future but I guess we can iterate later on if needed.The detected package managers would be outputted in a "priority" based array, similar to
framework-info
, e.g:Wondering what you all thinkg @ehmicky @erezrokah @eduardoboucas?
The text was updated successfully, but these errors were encountered: