| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
🦋 Changeset detectedLatest commit: 85879d7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Sorry, something went wrong.
|
@modelcontextprotocol/client
npm i https://pkg.pr.new/@modelcontextprotocol/client@2386
npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2386
npm i https://pkg.pr.new/@modelcontextprotocol/core@2386
npm i https://pkg.pr.new/@modelcontextprotocol/server@2386
npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2386
npm i https://pkg.pr.new/@modelcontextprotocol/express@2386
npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2386
npm i https://pkg.pr.new/@modelcontextprotocol/hono@2386
npm i https://pkg.pr.new/@modelcontextprotocol/node@2386 commit: 85879d7 |
Sorry, something went wrong.
There was a problem hiding this comment.
Needs a CI check - seems to fail a build
Sorry, something went wrong.
- typedoc: exclude src/bin from codemod docs so the batch-test harness's
exported types no longer trip treatWarningsAsErrors (fixes check:all)
- runner: shift diagnostic lines by the restored shebang's line count so
reported file:line matches the saved file
- batchTest: record post-install versions in a separate map so a
startup-unresolved package isn't retroactively pinned for later repos
- batchTest/README: correct npm-view abort wording, the parseNpmViewVersion
'highest match' comment, and 'How it works' step 4
- changeset: patch @modelcontextprotocol/codemod for the shebang fix
…tprotocol/typescript-sdk into feature/codemod-iterations-4
| Back | FazBrowse Home | New Git URL |
feat(codemod): test the batch harness against the published codemod + SDK, and preserve shebangs
Extends the codemod batch-test harness so it can validate the published @modelcontextprotocol/codemod and the published v2 SDK packages from npm — not just the local working copy — and fixes a codemod bug that dropped a file's leading #! shebang during migration.
Motivation and Context
The batch-test harness runs the v1→v2 codemod against real-world repos to catch regressions, missing transforms, and gaps. Until now it could only exercise the local working-copy codemod against locally-packed SDK tarballs. That validates the branch under development, but never the artifacts users actually npm install — so a bug present only in a published build, or an incompatibility with a published SDK alpha, would slip through.
This PR adds independent source selection for the codemod and the SDK, each local or published, plus version pinning:
So the same harness can now answer "does the published codemod + published SDK still migrate these repos cleanly?", with results written to per-run directories keyed on the resolved versions.
Separately, several transforms consumed a file's leading #! shebang (it is leading trivia of the first import they rewrite), silently breaking CLI packages whose bin points at the migrated entry. The runner now captures the shebang before transforms and restores it before saving.
How Has This Been Tested?
Breaking Changes
None. The batch-test harness is dev-only tooling. The shebang fix is a user-facing codemod bugfix (output is now more correct) shipped as a patch changeset for @modelcontextprotocol/codemod; no consumer action required.
Types of changes
Checklist
Additional context
Results layout. Each run writes to batch-test/results/codemod-…__sdk-…/, keyed on the resolved versions, with a top-level summary.json (per-repo pass/fail, error counts, run config, and the resolved per-package sdkVersions) and a report.json per repo (baseline vs post-codemod check results, diagnostics, change counts). In published-codemod mode the CLI emits text rather than structured diagnostics, so codemod.diagnostics is empty and the raw CLI output is captured under codemod.cli.
Subprocess env hygiene. The harness is invoked via pnpm, which exports its own config as npm_config_* / PNPM_* vars; those leak into every subprocess and break things (minimum-release-age blocks installs, workspace-cwd npx mis-resolves). cleanSubprocessEnv strips them so installs, npx, and npm view see a clean package-manager env (npmrc files still honored).
Security. The npx / npm view / git shell-outs interpolate only operator-controlled inputs — CLI flags, the committed repos.json, and Anthropic-published npm versions. JSON.stringify quoting does not neutralize $(…)/backticks under sh -c, so the harness must never be pointed at an untrusted manifest. This is called out at each call site.
Review fixes folded in (latest commit):