unfold / heroku-buildpack-pnpm

Run PNPM install on Heroku
MIT License
38 stars 39 forks source link

Use `npm` to install `pnpm` #42

Closed Turbo87 closed 1 year ago

Turbo87 commented 1 year ago

https://www.npmjs.com/package/@pnpm/self-installer?activeTab=readme says:

WARNING: This installation method is not supported anymore.

so instead of using this outdated method to install pnpm this PR is switching the code over to using npm install --global instead (see https://pnpm.io/installation#using-npm).

I first tried using their standalone script (see https://pnpm.io/installation#using-a-standalone-script), but that would require us to source a bash script at a generated location which makes the installation a little brittle. Since installation via npm is also officially supported and fast enough we can use that instead. The "quiet" installation via npm is modeled after how it's done in the install_npm() function too.

I've also taken the opportunity to adjust the code so that it will also install pnpm if engines.pnpm is set, but there is no pnpm lockfile. This matches the behavior for yarn now.

Resolves https://github.com/unfold/heroku-buildpack-pnpm/issues/39

Turbo87 commented 1 year ago

@hampusborgos @TamoMaes any thoughts on this? :)

TamoMaes commented 1 year ago

LGTM, can't wait much longer to update the install script

hampusborgos commented 1 year ago

Looks good! :) Necessary improvement.