create-single-spa icon indicating copy to clipboard operation
create-single-spa copied to clipboard

Instructions for contributing not working for me

Open tamslinn opened this issue 2 years ago • 2 comments

I'm trying to prepare a pull request for issue #341 but I can't commit it. Even if I do a fresh checkout of the project and try to commit a minor change I have the same problem.

I’ve run pnpm install --frozen-lockfile When I try to commit my changes, it runs the pre-commit hook, which runs pnpx pretty-quick --staged But this fails with the message

.
└─┬ pretty-quick
  └── ✕ missing peer prettier@>=2.0.0
Peer dependencies that should be installed:
  prettier@>=2.0.0  

I can see that prettier 2.3.2 is installed in the node_modules directory (and it is in package,json). I’ve also tried doing pnpm add -g prettier but it doesn’t help.

Sorry if I am missing something obvious but I am not familiar with pnpm which is making it hard for me to contribute. I am wondering if there is something missing from the contribution instructions?

tamslinn avatar May 24 '22 15:05 tamslinn

This appears to be a compat problem with pnpm 7 and husky 7. Migrating to husky 8 should fix it per https://github.com/pnpm/pnpm/issues/4657

I also had this same issue in the single-spa-react repo so if anyone comes across this elsewhere, that might be helpful to update in that repo as well.

filoxo avatar Jul 26 '22 17:07 filoxo

I started seeing this again even after upgrading. I solved this by replacing pnpx with pnpm here

https://github.com/single-spa/create-single-spa/blob/0ca13bb8de64b2329bae04f7bf92b1e9fcb5c47a/.husky/pre-commit#L4

so that the command would use the locally installed pretty-quick dependency rather than from the pnpx cache.

filoxo avatar Jul 26 '22 18:07 filoxo