feat(codemod-rewrite-module-specifiers-to-full-paths): add debug logging and jsx/tsx support - #6
Merged
Merged
Conversation
…ing and jsx/tsx support - structured diagnostic logging via OpenTelemetry behind a `--debug` flag (`src/otel-logger.ts`) - select the `tsx` parser for `.jsx`/`.tsx` sources, so JSX module specifiers are rewritten correctly, with fixtures covering it - bump `@commander-js/extra-typings`, `commander`, `jscodeshift`, `p-limit`, `@types/jscodeshift` and `ts-expose-internals` Co-authored-by: patricktree-agents[bot] <2968297+patricktree-agents[bot]@users.noreply.github.com>
…ersion baseline to 2.2.0 npm already carries `2.1.0` and `2.2.0` for this package, published on 2026-01-07, but the version field here still read `2.0.3`. Releasing from that baseline would publish `2.0.4` - below the highest published version - which moves the `latest` dist-tag backwards, exactly what happened when `2.0.2` was published after `2.2.0`. Set the baseline to the highest published version so the pending minor changeset lands on `2.3.0`. Co-authored-by: patricktree-agents[bot] <2968297+patricktree-agents[bot]@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The codemod has two gaps and one release hazard:
.jsx/.tsxfiles are parsed with the default parser, so module specifiers in those files are left untouched.2.0.3, but npm already carries2.1.0and2.2.0for this package, published on 2026-01-07. Releasing from this baseline would publish2.0.4— below the highest published version. npm pointslatestat whatever was published most recently, so that release would movelatestbackwards and hand consumers an older build. That is exactly what happened once already:2.0.2was published on 2026-04-27, after2.2.0, and took over the tag.Solution
Select the
tsxparser for.jsx/.tsxfiles so JSX module specifiers are rewritten like any other, and add a--debugflag that emits structured diagnostic logs through OpenTelemetry.Set the version baseline to
2.2.0, the highest version actually published, so the pending minor changeset lands on2.3.0and the next release stays abovelatest.Details
feat(codemod-rewrite-module-specifiers-to-full-paths): add debug logging and jsx/tsx support--debugflag (src/otel-logger.ts)tsxparser selection for.jsx/.tsxsources, with input/output fixtures covering JSX and angle-bracket assertions@commander-js/extra-typings,commander,jscodeshift,p-limit,@types/jscodeshiftandts-expose-internalschore(codemod-rewrite-module-specifiers-to-full-paths): correct the version baseline to 2.2.0Changesets
codemod-debug-logging.md— minor, the--debugflagcodemod-tsx-parser.md— patch, the parser selectioncodemod-deps-bump.md— patch, the dependency bumpsCombined with the baseline correction, the next release is
2.3.0.Validation
The codemod's fixture-based suite covers the new behavior:
test/codemod-inputsandtest/codemod-outputsgain atsx-component.tsxand anangle-assertion.tscase, andcli-debug.spec.mtsexercises the--debugpath.Ran:
pnpm install --frozen-lockfile— clean install from scratchpnpm run validate— 26/26 tasks (build, lint, test) plusknip, all cleanpnpm run format:check— cleanpnpm exec changeset status— confirms the minor bump resolves to2.3.0Notes for the reviewer
typescript@~5.9.3as a runtime dependency: it consumes the compiler API and types itself againstts-expose-internals, which tracks TypeScript 5.x internals.@patricktree/commons-ecmais not among the dependencies; knip reports it as unused here.Written by @patricktree's agent (Claude Code, Opus 5).