Repository navigation
Let devtools reuse compatible TypeScript and Vite installs - #254
Merged
Merged
Conversation
4 of 5 tasks
The devtools CLI pinned typescript 6.0.3 and vite 8.1.5 exactly, so every consumer installed a second copy at exactly those versions. Depend on typescript >=5.9.0 <7.0.0 and vite ^8.1.5 instead. Both stay regular dependencies: the CLI must work with zero setup, and TypeScript 7 does not ship the JavaScript compiler API that project inspection parses with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SandroMaglione
force-pushed
the
devtools-dependency-ranges
branch
from
November 1, 2026 09:11
070dbbf to
36dc410
Compare
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 free
to 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.
Summary
@typeonce/effect-machine-devtoolslisted"typescript": "6.0.3"and"vite": "8.1.5"as exactdependencies, so every consumer installed a second TypeScript and Vite at exactly those versions. This PR changes them to ranges and keeps them as dependencies:typescript:6.0.3→>=5.9.0 <7.0.0vite:8.1.5→^8.1.5The devtools README's Compatibility section now explains what the CLI brings with it and why TypeScript 7 is excluded. The root README has no install commands, so it is unchanged.
Decision: ranged dependencies, not peers
How devtools uses each package:
src/internal/projectInspector.ts, for syntactic discovery (ts.createSourceFile,ts.forEachChild, node guards, andts.transpileModulefor syntax diagnostics). It never type-checks the consumer project, so the consumer's compiler version doesn't matter to it.devServer.tsrunscreateServerrooted at the devtools package,staticSite.tsrunsbuildwithconfigFile: false, and the evaluation worker runs a middleware-mode server withssrLoadModule. Both CLI commands (effect-machineandeffect-machine build) need it, so it is not optional.Why not peers:
"."export oftypescript@7.0.2is justlib/version.cjs. With a peer, a TS 7 project (e.g. one on 7.0.2) would get an unsatisfied-peer warning, and pnpm would link the project's TS 7. Thenimport ts from "typescript"would load no compiler and the CLI would crash. As a dependency with<7.0.0, such a project gets a private 5.9–6.x copy and the CLI keeps working.^8.1.5dedupes with a project's Vite 8 and otherwise installs a private copy.devtools:pack-checkfixture installs devtools with neither package. The CLI is designed to need no setup, and this keeps that.The lower bound
5.9.0covers the APIs used, which have been stable for many releases. It lets a 5.9 project dedupe to a single TypeScript. I verified it at runtime (below).Changeset
.changeset/devtools-dependency-ranges.md, patch for@typeonce/effect-machine-devtools. This deviates from the "minor" originally proposed for this item. That proposal assumed a move to peers, which would change what consumers install. With ranged dependencies, consumers install nothing new, which.changeset/README.mdclasses as a compatible improvement (patch). The fixed group releases all four packages together.Validation
pnpm check: 92 files / 901 tests, all tstyche suites,pack:check,test:consumer,devtools:pack-check(fresh install resolves the newest in-range TypeScript and Vite), and the other pack checks.typescript@6.0.3andvite@8.1.5. Only the specifiers changed.pnpm devtools build --root ../.. --include "packages/devtools/src/internal/browser/{example-machine,*-example}.ts"built a static site with 14 machines. A live server started with the same include served/and returned 14Readyresults from/api/machines, then stopped on SIGINT.effect-machine build):typescript@5.9.3+vite@8.1.5: a singletypescript@5.9.3and a singlevite@8.1.5were installed (deduped), and the build succeeded.typescript@7.0.2: devtools got its owntypescript@6.0.3next to the project's 7.0.2, and the build succeeded.🤖 Generated with Claude Code