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

Work out how to get typesync to run automatically #333

Open
josephjclark opened this issue Jul 27, 2023 · 1 comment
Open

Work out how to get typesync to run automatically #333

josephjclark opened this issue Jul 27, 2023 · 1 comment
Labels
good first issue Good for newcomers tech debt Non-critical, invisible code issues that ought to be addressed

Comments

@josephjclark
Copy link
Collaborator

josephjclark commented Jul 27, 2023

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 typesync before committing or pushing ,failing if types are not synced. But this is dogmatic and annoying.
@josephjclark josephjclark mentioned this issue Jul 27, 2023
@josephjclark josephjclark added the tech debt Non-critical, invisible code issues that ought to be addressed label Aug 8, 2023
@josephjclark josephjclark added the good first issue Good for newcomers label Oct 25, 2024
@josephjclark
Copy link
Collaborator Author

Be mindful of #756

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers tech debt Non-critical, invisible code issues that ought to be addressed
Projects
Status: Icebox
Development

No branches or pull requests

1 participant