| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The nightly update-spec-types workflow is failing because lefthook's pre-push hook (added in #1003) runs `pnpm run lint:all`, which rejects the freshly-fetched spec.types.ts for not matching prettier style. Format the output via prettier's Node API using the project config before writing it to disk. This also reduces nightly PR diffs to only semantic changes, not formatting noise.
⚠️ No Changeset foundLatest commit: efbd98e Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
Sorry, something went wrong.
|
@modelcontextprotocol/client
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1782
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1782
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1782
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1782
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1782 commit: efbd98e |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM, straightforward fix to format fetched spec types with prettier before writing.
Extended reasoning...This PR modifies a single CI script (scripts/fetch-spec-types.ts) to run prettier on the fetched spec types before writing them to disk. The change adds 3 lines of prettier API calls (resolveConfig, format) and removes the direct writeFileSync of unformatted content. This fixes the nightly update-spec-types workflow which has been failing since lefthook pre-push hooks were added.
None. This is a build/CI script that formats code before writing it locally. No user input, no network-facing code, no auth changes.
Low scrutiny appropriate. This is a small, mechanical change to a CI helper script. The prettier API usage is standard and idiomatic (resolveConfig + format with filepath for parser inference). The script is not production code — it runs during development/CI to sync upstream spec types.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM — straightforward fix to format fetched spec types with prettier so the nightly CI workflow stops failing on lint.
Extended reasoning...This PR modifies a single CI script (scripts/fetch-spec-types.ts) to add prettier formatting before writing the fetched spec types to disk. The change is 3 lines of new code: importing prettier, resolving the project config, and formatting the content before writing. This fixes the nightly update-spec-types workflow which has been failing because lefthook runs lint checks on push.
None. This is a build/CI script that runs locally or in CI, not production code. The prettier API usage is standard (resolveConfig + format) with no user-controlled inputs beyond what was already there.
Low scrutiny appropriate. This is a small, mechanical change to a CI helper script. The implementation follows the standard prettier Node API pattern and the motivation is clearly explained with a concrete CI failure example.
Sorry, something went wrong.
There was a problem hiding this comment.
Formatting generated output through prettier using project config — sensible, keeps fetch-spec-types output lint-clean.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Formats the output of scripts/fetch-spec-types.ts with prettier before writing to disk, so the nightly update-spec-types workflow produces lint-clean output.
Motivation and Context
The nightly update-spec-types workflow has been failing since lefthook was added in #1003. The pre-push hook runs pnpm run lint:all, which rejects the freshly-fetched spec.types.ts because it uses the upstream spec repo's formatting (double quotes, different line wrapping) rather than this repo's prettier config.
Last night's run (March 26) failed with:
This also means nightly PRs will now show only semantic diffs instead of ~100KB of formatting noise.
How Has This Been Tested?
Ran pnpm run fetch:spec-types locally — output now passes pnpm --filter @modelcontextprotocol/core lint. The resulting diff against main is 6 lines (commit SHA header + @nullable + @maxItems 100 annotations) instead of 118KB.
Breaking Changes
None.
Types of changes
Checklist
Additional context
Uses prettier's Node API (resolveConfig + format) to pick up .prettierrc.json automatically, so any future config changes apply without touching this script.
Heads up: once this lands and the nightly runs, the resulting PR will revert extensions?: { [key: string]: JSONObject } back to { [key: string]: object } in ClientCapabilities/ServerCapabilities — the JSONObject variant was a manual edit in #1630 that diverges from the upstream spec. If JSONObject is the intended type, it should be changed in schema/draft/schema.ts upstream.