Skip to content

chore(pre-commit): add local schema generation sync check#3

Open
sakinaroufid wants to merge 1 commit intomainfrom
pr-b-precommit-hook
Open

chore(pre-commit): add local schema generation sync check#3
sakinaroufid wants to merge 1 commit intomainfrom
pr-b-precommit-hook

Conversation

@sakinaroufid
Copy link
Owner

@sakinaroufid sakinaroufid commented Mar 1, 2026

Description

Adds a pre-commit hook that runs node generate_ts_schema_types.js and checks git diff --exit-code -- generated/schema-types.ts to catch schema desync locally before committing, giving instant feedback instead of waiting for CI.

This complements the CI workflow added in part 1 — CI remains as a safety net for contributors who bypass or don't have pre-commit installed.

Depends on part 1 (schema validation workflow) being merged first, which fixes the generator's source path so the hook produces correct output.

This is part 2 of 3 from Universal-Commerce-Protocol#13, split per maintainer request.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@github-actions
Copy link

github-actions bot commented Mar 1, 2026

Super-linter summary

Language Validation result
BIOME_LINT Pass ✅
GITHUB_ACTIONS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
JAVASCRIPT_ES Pass ✅
PRE_COMMIT Pass ✅
TRIVY Pass ✅
TYPESCRIPT_ES Pass ✅
TYPESCRIPT_PRETTIER Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the
GitHub Actions workflow run

Powered by Super-linter

@sakinaroufid sakinaroufid force-pushed the pr-b-precommit-hook branch from fda485e to fb829db Compare March 1, 2026 15:16
@github-actions
Copy link

github-actions bot commented Mar 1, 2026

Super-linter summary

Language Validation result
BIOME_LINT Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
PRE_COMMIT Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the
GitHub Actions workflow run

Powered by Super-linter

@sakinaroufid sakinaroufid reopened this Mar 1, 2026
@github-actions
Copy link

github-actions bot commented Mar 1, 2026

Super-linter summary

Language Validation result
BIOME_LINT Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
PRE_COMMIT Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the
GitHub Actions workflow run

Powered by Super-linter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant