Switch from yarn v1 to vanilla npm and add npm tab completion #100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofyarn <script>
and expect the lock file changes to be inpackage-lock.json
insted ofyarn.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 butnpm add -D <package>
works,npm uninstall <package>
andnpm 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.