You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just added typesync, which is a super cool package that ensures you have matching @types packages for all your packages.
The only problem is that in pnpm, we have to run it manually.
One day, I'd like to be able to automatically run typesync after pnpm add, pnpm remove and pnpm update (but not pnpm install).
Typesync provides docs to autorun in npm, but this simply doesn't work in pnpm
Options and ideas:
pnpm does provide some postinstall hooks through a .pnnpmfile.cjs, but a) it'll run on install as well as add, and b) they don't let do you very much. We can't run pnpm commands from these hooks, we can only hack the lockfile
pnpm has an option to enable npm-style pre/post script hooks. If we enable this, we could probably add postadd, postremove and postupdate scripts. But I think you can only do this on pnpm run, and it has to be passed into the CLI.
We could use a git hook and run typescript before commiting or pushing ,failing if types are not synced. But this is dogmatic and annoying.
The text was updated successfully, but these errors were encountered:
I've just added typesync, which is a super cool package that ensures you have matching @types packages for all your packages.
The only problem is that in pnpm, we have to run it manually.
One day, I'd like to be able to automatically run typesync after
pnpm add
,pnpm remove
andpnpm update
(but notpnpm install
).Typesync provides docs to autorun in npm, but this simply doesn't work in pnpm
Options and ideas:
pnpm
does provide some postinstall hooks through a.pnnpmfile.cjs
, but a) it'll run oninstall
as well asadd
, and b) they don't let do you very much. We can't run pnpm commands from these hooks, we can only hack the lockfilepnpm
has an option to enable npm-stylepre/post
script hooks. If we enable this, we could probably addpostadd
,postremove
andpostupdate
scripts. But I think you can only do this onpnpm run
, and it has to be passed into the CLI.The text was updated successfully, but these errors were encountered: