I have many web projects with redundant dependencies, like build tools and their plugins (grunt, gulp, etc.), and I recently learned of pnpm which looks like it would be both faster and more storage efficient for me. I read around, finding a lot of blog posts on starting a new pnpm project or comparing it to npm, but nothing that specified the exact steps to convert a git repo from npm to pnpm. This is what I'm doing:
#!/usr/bin/env bash
pnpm import
git rm package-lock.json
rm -rf node_modules
pnpm install \
&& git add pnpm-lock.yaml package.json && git commit -m "convert to pnpm"
It works, but am I missing anything? I already found one project where a missing peer dependency caused pnpm install to fail, but I can pnpm add that and then complete the rest of the steps. I'm just not sure if I'm missing something, if I should retain the package-lock.json for some reason, or if I'm implicitly making a choice that will cause me problems later on.