Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,5 @@ dist/

# Conformance test results
results/

.lefthook-local.yml
24 changes: 24 additions & 0 deletions lefthook-local.example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Optional local lefthook configuration
# To enable this:
# cp lefthook-local.example.yml lefthook-local.yml

pre-commit:
parallel: true
jobs:
- name: 'Typecheck'
run: pnpm typecheck:all
stage_fixed: true

- name: 'Lint Fix & Format'
run: pnpm lint:fix:all
stage_fixed: true

post-checkout:
jobs:
- name: 'Install Dependencies'
run: pnpm install

post-merge:
jobs:
- name: 'Install Dependencies'
run: pnpm install
47 changes: 47 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# lefthook.yml
# Configuration reference: https://lefthook.dev/configuration/

assert_lefthook_installed: true

output:
- meta # Print lefthook version
- summary # Print summary block (successful and failed steps)
- empty_summary # Print summary heading when there are no steps to run
- success # Print successful steps
- failure # Print failed steps printing
- execution # Print any execution logs (but prints if the execution failed)
- execution_out # Print execution output (but still prints failed commands output)
- execution_info # Print `EXECUTE > ...` logging
- skips # Print "skip" (i.e. no files matched)

pre-push:
follow: true
parallel: true
jobs:
- name: 'Typecheck'
run: pnpm run typecheck:all
fail_text: |
💡 To catch typechecking issues earlier, enable the pre-commit hook:
cp lefthook-local.example.yml lefthook-local.yml

- name: 'Lint'
run: pnpm run lint:all
fail_text: |
💡 To catch linting issues earlier, enable the pre-commit hook:
cp lefthook-local.example.yml lefthook-local.yml

- name: 'Build'
run: pnpm run build:all
fail_text: |
💡 To catch build issues earlier, enable the pre-commit hook:
cp lefthook-local.example.yml lefthook-local.yml

post-checkout:
jobs:
- name: 'Install Dependencies'
run: pnpm install

post-merge:
jobs:
- name: 'Install Dependencies'
run: pnpm install
189 changes: 189 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"lint:fix:all": "pnpm -r lint:fix",
"check:all": "pnpm -r typecheck && pnpm -r lint",
"test:all": "pnpm -r test",
"prepare": "npx --no-install lefthook install",
"test:conformance:client": "pnpm --filter @modelcontextprotocol/test-conformance run test:conformance:client",
"test:conformance:client:all": "pnpm --filter @modelcontextprotocol/test-conformance run test:conformance:client:all",
"test:conformance:client:run": "pnpm --filter @modelcontextprotocol/test-conformance run test:conformance:client:run",
Expand All @@ -42,6 +43,7 @@
"test:conformance:all": "pnpm run test:conformance:client:all && pnpm run test:conformance:server:all"
},
"devDependencies": {
"lefthook": "^2.0.16",
"@cfworker/json-schema": "catalog:runtimeShared",
"@changesets/changelog-github": "^0.5.2",
"@changesets/cli": "^2.29.8",
Expand Down
Loading
Loading