Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from yarn v1 to vanilla npm and add npm tab completion #100

Merged
merged 5 commits into from
Apr 1, 2024

Conversation

sangaline
Copy link
Contributor

@sangaline sangaline commented Mar 31, 2024

This was inspired by wanting to add tab completion inside the development container for our miscellaneous development scripts. Reading through the issue on it (yarnpkg/yarn#609), it really drove home the fact that yarn v1 is unmaintained and slowly dying. In the meantime, npm has more than caught up with the main innovations that yarn originally introduced while yarn v3 has made extremely opinionated choices around PnP, package patching, etc. that I disagree with. I've always really liked pnpm too, but their linking strategy with the global store doesn't really adapt well to the docker volume mount approach we use here.

This PR switches us over to using vanilla npm as the package manager. The changes are fairly straightforward from a developer perspective. You mainly do npm run <script> instead of yarn <script> and expect the lock file changes to be in package-lock.json insted of yarn.lock. The canonical forms for some other commands are different, but npm provides aliases that make the yarn forms work for the most common stuff: npm install --save-dev <package> is canonical but npm add -D <package> works, npm uninstall <package> and npm remove <package> both work, etc. I additionally added tab completion in the docker container, so you can tab complete any of the npm commands/arguments including our own scripts.

We manually exit from child processes because they hang otherwise (which
is a bug in ava). Ava previously still exited with a status code of zero
when this happened across all node versions, but now exits with a status
code of one in node 18.
@sangaline sangaline changed the title Switch from yarn v1 to vanilla npm Switch from yarn v1 to vanilla npm and add npm tab completion Mar 31, 2024
@sangaline sangaline requested a review from jason-sindri March 31, 2024 17:33
Copy link

@jason-sindri jason-sindri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sangaline sangaline merged commit c9c7254 into main Apr 1, 2024
5 checks passed
@sangaline sangaline deleted the ews-switch-to-npm branch April 1, 2024 15:23
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.

2 participants