Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ci: auto-fix prettier formatting in pre-commit hook and CI#498

Merged
ochafik merged 1 commit intomainfrom
claude/automate-prettier-formatting-lkoLZ
Feb 24, 2026
Merged

ci: auto-fix prettier formatting in pre-commit hook and CI#498
ochafik merged 1 commit intomainfrom
claude/automate-prettier-formatting-lkoLZ

Conversation

@ochafik
Copy link
Contributor

@ochafik ochafik commented Feb 24, 2026

Summary

Automates prettier formatting so contributors don't have to manually iterate on formatting failures.

Changes

Pre-commit hook (.husky/pre-commit)

  • After running prettier:fix, stage all modified files (not just src/generated/)
  • This ensures formatting fixes are included in the commit automatically

CI (ci.yml) — new prettier-fix job

  • Runs on PRs from the same repo (skips fork PRs for security — no write access)
  • Runs npm run prettier:fix
  • If there are formatting changes, commits and pushes them back to the PR branch
  • Uses github-actions[bot] as the commit author

How it works

  1. Local development: The pre-commit hook runs prettier and stages any reformatted files, so formatting is always correct before push
  2. CI fallback: If someone bypasses the hook (e.g., --no-verify, GUI client), the CI job auto-fixes and pushes a formatting commit back to the PR branch
  3. Existing check preserved: The npm run prettier check in the build job still runs across all platforms as a gate — it will pass after the auto-fix job runs

Pre-commit hook:
- Stage all files modified by prettier:fix, not just src/generated/

CI (GitHub Actions):
- Add prettier-fix job that runs on PRs from the same repo
- Auto-commits formatting fixes back to the PR branch
- Skips fork PRs (no write access to fork branches)
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 24, 2026

Open in StackBlitz

@modelcontextprotocol/ext-apps

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/ext-apps@498

@modelcontextprotocol/server-basic-preact

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-preact@498

@modelcontextprotocol/server-basic-react

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-react@498

@modelcontextprotocol/server-basic-solid

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-solid@498

@modelcontextprotocol/server-basic-svelte

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-svelte@498

@modelcontextprotocol/server-basic-vanillajs

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-vanillajs@498

@modelcontextprotocol/server-basic-vue

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-basic-vue@498

@modelcontextprotocol/server-budget-allocator

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-budget-allocator@498

@modelcontextprotocol/server-cohort-heatmap

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-cohort-heatmap@498

@modelcontextprotocol/server-customer-segmentation

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-customer-segmentation@498

@modelcontextprotocol/server-debug

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-debug@498

@modelcontextprotocol/server-map

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-map@498

@modelcontextprotocol/server-pdf

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-pdf@498

@modelcontextprotocol/server-scenario-modeler

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-scenario-modeler@498

@modelcontextprotocol/server-shadertoy

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-shadertoy@498

@modelcontextprotocol/server-sheet-music

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-sheet-music@498

@modelcontextprotocol/server-system-monitor

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-system-monitor@498

@modelcontextprotocol/server-threejs

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-threejs@498

@modelcontextprotocol/server-transcript

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-transcript@498

@modelcontextprotocol/server-video-resource

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-video-resource@498

@modelcontextprotocol/server-wiki-explorer

npm i https://pkg.pr.new/modelcontextprotocol/ext-apps/@modelcontextprotocol/server-wiki-explorer@498

commit: 68e6cd2

@ochafik ochafik merged commit 1728617 into main Feb 24, 2026
20 checks passed
ochafik added a commit that referenced this pull request Feb 24, 2026
Changes since 1.1.1:
- feat: add ui/download-file method for host-mediated file downloads (#475)
- pdf-server: robust path validation + folder/file root support (#497)
- ci: auto-fix prettier formatting in pre-commit hook and CI (#498)
ochafik added a commit that referenced this pull request Feb 25, 2026
* chore: bump ext-apps to 1.1.2

Changes since 1.1.1:
- feat: add ui/download-file method for host-mediated file downloads (#475)
- pdf-server: robust path validation + folder/file root support (#497)
- ci: auto-fix prettier formatting in pre-commit hook and CI (#498)

* fix: sync local SDK build into node_modules for examples

npm workspaces hoists example dependencies to the root node_modules,
but installs the published registry copy of @modelcontextprotocol/ext-apps
instead of linking to the local source. This causes type-check failures
when examples use features not yet published to npm.

Add scripts/link-self.mjs which copies the freshly-built dist/ and
package.json into the hoisted node_modules copy after each SDK build,
ensuring examples always type-check against the latest local types.

See: npm/feedback#774

* Revert "fix: sync local SDK build into node_modules for examples"

This reverts commit e3387e8.
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.

3 participants