-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Automating the doc schema generation using husky. #2851
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
Changes from 3 commits
9ccdecd
704cca4
20efc77
033db80
b30e9f4
ab75bf4
a6690d0
fc2bc5e
095e696
e4413ce
f376d03
b5a9d8b
cfd6882
4d55f8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,22 @@ | |
[ -n "$CI" ] && exit 0 | ||
|
||
# Change to the current directory | ||
npm run dev & | ||
SERVER_PID=$! | ||
|
||
# Checks code for typescript type errors and throws errors if found. | ||
npm run typecheck | ||
# Wait for server to be ready (adjust sleep time as needed) | ||
sleep 10 | ||
|
||
# Formats staged code using prettier | ||
# Checks and fixes all lint issues in code which don't require manual intervention. | ||
# Throws errors if lint issues requiring manual intervention are found in code. | ||
# Run your commands | ||
npm run format:fix | ||
# npm run lint:fix | ||
npm run lint-staged | ||
|
||
npm run gen:schema | ||
|
||
# Generate table of contents for markdown files in root directory | ||
npm run typecheck | ||
npm run update:toc | ||
npm run generate:graphql-markdown | ||
npm run generate:graphql-schema | ||
|
||
# Kill the background server process | ||
kill $SERVER_PID | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove server cleanup code. The server cleanup is tightly coupled with the server startup, which should be removed from the pre-commit hook. If the server fails to start or the script exits prematurely, this could kill unrelated processes or leave orphaned processes. 🧰 Tools🪛 GitHub Actions: PR Workflow[error] Unauthorized file modification or deletion attempt |
||
|
||
# Add the changes made to the stage | ||
git add . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove server management from pre-commit hook.
Starting a server in a pre-commit hook introduces several risks:
Based on the PR discussion with @palisadoes, this should be moved to a CI/CD workflow instead.
🧰 Tools
🪛 GitHub Actions: PR Workflow
[error] Unauthorized file modification or deletion attempt