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

🛠 Tooling: dist/ updates aren't committed in pre-commit hook #183

Open
3 tasks done
JoshuaKGoldberg opened this issue Jan 6, 2024 · 1 comment
Open
3 tasks done
Labels
area: tooling Managing the repository's maintenance status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(

Comments

@JoshuaKGoldberg
Copy link
Owner

Bug Report Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have pulled the latest main branch of the repository.
  • I have searched for related issues and found none that matched my issue.

Overview

#171 added pnpm build:release to the .husky/pre-commit file run on a Git pre-commit hook. But changes to dist/ caused by that script aren't committed. So you get end up with commits like b506e60 where I realized I also needed to push built files...

Additional Info

cc @johnnyreilly - I bet there's a better solution than what I did in #171. Maybe something with lint-staged? Or maybe it's as simple as a git add dist in .husky/pre-commit? I haven't looked into this.

@JoshuaKGoldberg JoshuaKGoldberg added area: tooling Managing the repository's maintenance status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :( labels Jan 6, 2024
@johnnyreilly
Copy link

johnnyreilly commented Jan 6, 2024

Here's how I handled it in Schemar: https://github.com/johnnyreilly/schemar/blob/main/.husky/pre-commit

lint-staged runs after the build and add - credit to @jakebailey for the idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tooling Managing the repository's maintenance status: accepting prs Please, send a pull request to resolve this! type: bug Something isn't working :(
Projects
None yet
Development

No branches or pull requests

2 participants