dotenv-vault icon indicating copy to clipboard operation
dotenv-vault copied to clipboard

detect package manager and offer commands using the correct one

Open mnbf9rca opened this issue 2 years ago • 3 comments

I'm using Yarn, which, since v2, offers yarn dlx as an equivalent of npx. The scripts and VS Code plugin should recognise the package manager in use and format commands to use the correct one.

mnbf9rca avatar Jan 03 '23 09:01 mnbf9rca

Not sure how to go about this. @mnbf9rca, any ideas?

motdotla avatar Nov 04 '23 06:11 motdotla

I haven’t looked in detail but perhaps these have pointers to which api exposes the information?

https://github.com/microsoft/vscode-eslint/pull/1646 https://github.com/prettier/prettier-vscode/pull/1700

On Sat, 4 Nov 2023 at 06:26, Mot @.***> wrote:

Not sure how to go about this. @mnbf9rca https://github.com/mnbf9rca, any ideas?

— Reply to this email directly, view it on GitHub https://github.com/dotenv-org/dotenv-vault/issues/215#issuecomment-1793359013, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH5VUULXDZ4ABUYDKEB2MLYCXNYFAVCNFSM6AAAAAATPPHY6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGM2TSMBRGM . You are receiving this because you were mentioned.Message ID: @.***>

mnbf9rca avatar Nov 04 '23 07:11 mnbf9rca

@motdotla I know of two ways:

  1. The antfu/ni package does this by checking the lock file's presence (yarn.lock for yarn, pnpm-lock.yaml for pnpm and package-lock.json for npm.)
  2. I created a small task runner that checks the packageManager field in package.json since I am using corepack.

CamilleHbp avatar Dec 11 '23 09:12 CamilleHbp