Skip to content

v0.14.1 fix: widen typescript dependency range to dedupe with TS 6 - #75

Merged
Dominik-O22 merged 2 commits into
mainfrom
fix/typescript-dep-range-ts6
Jul 24, 2026
Merged

Dominik-O22 merged 2 commits into
mainfrom
fix/typescript-dep-range-ts6

Conversation

@Dominik-O22

@Dominik-O22 Dominik-O22 commented Jul 24, 2026 •

Copy link
Copy Markdown
Owner

Problem

typescript was pinned to ^5.9.3 (= >=5.9.3 <6.0.0). Consumers already on TypeScript 6 can't dedupe against that range, so npm/bun install a second nested typescript@5.9.3 beside the host's 6.x — the reported double-bundle.

Fix

Widen the dependency range to >=5.0.0-0 <7.0.0-0:

  • Floor 5.0.0 — every compiler API dry-ts uses (getModifiers, getDecorators, canHave*, createSourceFile, SyntaxKind, …) has existed since TS 4.8, so 5.0 is a safe, generous floor.
  • Prerelease-tagged bounds (-0) — makes 6.0.0-beta satisfy the range (plain >=5.0.0 excludes prereleases by semver rule), so it dedupes with a TS 6 host.
  • Upper cap <7.0.0-0 — TS 7 is the native (Go) typescript-go rewrite. Its package exports changed: import ts from "typescript" resolves to a stub, ts.SyntaxKind is undefined at runtime. dry-ts genuinely does not run on 7 yet, so it's excluded rather than silently broken.

Verification

TS version Build Tests
6.0.0-beta ✅ ✅ 198 pass
7.0.2 ❌ ❌ ts.SyntaxKind undefined at runtime

Standalone/fresh installs still resolve to stable 5.9.3. bun run check passes (lint + build + 198 tests + self-dupe check).

Ships as v0.14.1 (PATCH) — VERSION + package.json + CHANGELOG bumped.

Follow-up (not in this PR)

Supporting TS 7 needs code changes for the typescript-go export shape (import * as ts + entrypoint verification, possibly a compat shim). Bump the upper cap alongside that work.

🤖 Generated with Claude Code

The dependency was pinned to `^5.9.3` (>=5.9.3 <6.0.0), so consumers on
TypeScript 6 could not dedupe: npm/bun installed a second nested 5.9.3
copy alongside the host's 6.x.

Widen to `>=5.0.0-0 <7.0.0-0`:
- floor 5.0.0 covers every API used (getModifiers/getDecorators et al.
  exist since 4.8); prerelease-tagged (`-0`) bounds so 6.0.0-beta
  satisfies the range and dedupes.
- upper cap excludes TS 7: the native (Go) rewrite changed the package
  exports, so `import ts from "typescript"` resolves to a stub and
  `ts.SyntaxKind` is undefined at runtime — dry-ts genuinely does not run
  on 7 yet. Verified: build + 198 tests pass on 6.0.0-beta, both fail on
  7.0.2.

Standalone installs still resolve to stable 5.9.3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The package manifest broadens the TypeScript dependency constraint from ^5.9.3 to >=5.0.0-0 <7.0.0-0.

Changes

TypeScript Dependency

Layer / File(s) Summary
Broaden TypeScript version constraint
package.json
The TypeScript dependency range changes from ^5.9.3 to >=5.0.0-0 <7.0.0-0.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A bunny checked the version gate,
And widened TypeScript’s range in state.
From five-nine-three to seven’s door,
More versions hop across the floor.
“Less pinning!” the rabbit sings,
With carrot crumbs and semver wings.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: widening the TypeScript range to dedupe with TypeScript 6.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/typescript-dep-range-ts6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Line 58: Update the TypeScript dependency range in package.json to explicitly
include TypeScript 6 prereleases, while retaining support for the existing
TypeScript 5 through 6 stable versions and the upper bound below 7.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d942d17a-406f-49f7-b457-7610a23f07f3

📥 Commits

Reviewing files that changed from the base of the PR and between 1a06492 and b5560dc.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • package.json

Comment thread package.json
"dependencies": {
"ignore": "^7.0.5",
"typescript": "^5.9.3"
"typescript": ">=5.0.0-0 <7.0.0-0"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

bun -e 'const r = ">=5.0.0-0 <7.0.0-0"; for (const v of ["5.9.3", "6.0.0-beta", "6.0.0"]) console.log(v, Bun.semver.satisfies(v, r))'

Repository: Dominik-O22/dry-ts

Length of output: 197


🌐 Web query:

Bun semver prerelease version ranges documentation node-semver prerelease requirements

💡 Result:

Bun’s Bun.semver API is designed to be compatible with node-semver [1]. It provides a built-in semantic versioning parser that mimics the behavior found in npm [2]. Prerelease Version Requirements In both Bun and node-semver, prerelease versions (e.g., 1.2.3-alpha.3) are treated as unstable and are excluded from range-matching by default [3][4][5]. A version with a prerelease tag will only satisfy a range if at least one comparator within that range (or the comparator set) also carries a prerelease tag with the same major, minor, and patch tuple [3][5]. For example, a range such as >1.2.3-alpha.3 will not be satisfied by 3.4.5-alpha.9, because the range lacks a prerelease comparator for that specific version set, even though 3.4.5-alpha.9 is technically higher [5]. Bun.semver API Bun offers two primary functions in its Bun.semver namespace: 1. Bun.semver.satisfies(version, range): Returns true if the provided version satisfies the given range [1][6]. It follows the same default behavior as node-semver, where prerelease versions are excluded unless explicitly matched [7][3]. 2. Bun.semver.order(versionA, versionB): Returns 0 if versions are equal, 1 if versionA is greater, or -1 if versionA is less than versionB [1][6]. Compliance and Differences Bun consistently works to match npm’s version resolution logic [8]. While Bun is significantly faster than node-semver, it is explicitly built to pass the node-semver test suite [2]. Updates to Bun, such as those related to peer dependency validation, have been implemented to ensure that Bun's internal handling of prerelease versions aligns with expected npm semantics [9]. If you require behavior where prerelease versions are treated as normal versions, standard node-semver practice (which Bun follows) typically requires utilizing an includePrerelease flag or explicit opt-in mechanisms during range parsing [3][4][5].

Citations:


🌐 Web query:

npm semver prerelease range same major minor patch tuple documentation

💡 Result:

In npm's semver implementation, prerelease versions are excluded from range matching by default to prevent unstable, rapidly changing versions from being accidentally installed [1][2]. For a version with a prerelease tag (e.g., 1.2.3-alpha.3) to satisfy a range, the range must explicitly include a comparator with the same major, minor, and patch tuple that also contains a prerelease tag [3][1]. Key behavior details: - Matching Requirement: If a version has a prerelease tag, it will only satisfy a comparator set if at least one comparator in that set shares the same [major, minor, patch] tuple and also includes a prerelease tag [1][2]. - Example: The range >1.2.3-alpha.3 can match 1.2.3-alpha.7, but it will not match 3.4.5-alpha.9, even though the latter is technically greater [3][1]. The version 3.4.5 (without a tag) would satisfy the range because it is greater than 1.2.3-alpha.7 [1]. - Suppressing Behavior: This default behavior can be overridden by setting the includePrerelease flag to true in the options object of semver functions that perform range matching [4][1]. When enabled, prerelease versions are treated as if they were normal (stable) versions for the purpose of matching [1][2]. This design serves two main purposes: it prevents users from automatically pulling in unstable prereleases they did not intend to use, and it ensures that users who explicitly opt into a specific set of prerelease versions are not automatically upgraded to subsequent, potentially unrelated prerelease sets [1][2].

Citations:


🏁 Script executed:

node -e 'const semver = require("semver"); for (const r of [">=5.0.0-0 <7.0.0-0", ">=5.0.0-0 <6.0.0-0 || >=6.0.0-0 <7.0.0-0"]) { console.log("range", r); for (const v of ["5.9.3", "6.0.0-beta", "6.0.0"]) { console.log("  ", v, semver.satisfies(v, r)); } }'

Repository: Dominik-O22/dry-ts

Length of output: 1008


Include TypeScript 6 prereleases explicitly.

>=5.0.0-0 <7.0.0-0 does not satisfy 6.0.0-beta because prereleases are accepted only when a comparator shares the same major/minor/patch tuple. Add an explicit TypeScript 6 prerelease range, e.g.:

Proposed fix
-    "typescript": ">=5.0.0-0 <7.0.0-0"
+    "typescript": ">=5.0.0-0 <6.0.0-0 || >=6.0.0-0 <7.0.0-0"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"typescript": ">=5.0.0-0 <7.0.0-0"
"typescript": ">=5.0.0-0 <6.0.0-0 || >=6.0.0-0 <7.0.0-0"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` at line 58, Update the TypeScript dependency range in
package.json to explicitly include TypeScript 6 prereleases, while retaining
support for the existing TypeScript 5 through 6 stable versions and the upper
bound below 7.

Source: MCP tools

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Dominik-O22 Dominik-O22 changed the title fix: widen typescript dependency range to dedupe with TS 6 v0.14.1 fix: widen typescript dependency range to dedupe with TS 6 Jul 24, 2026
@Dominik-O22
Dominik-O22 merged commit 772ff2c into main Jul 24, 2026
5 checks passed
@Dominik-O22
Dominik-O22 deleted the fix/typescript-dep-range-ts6 branch July 24, 2026 08:05
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.

1 participant