chore(deps): declare TypeScript instead of deriving it - #453
Merged
Conversation
`typescript` was declared only as a peerDependency (`^5.6.3 || ^6.0.0 || ^7.0.0`) and never as a devDependency, so pnpm chose it from that range and any root `pnpm add` re-resolved the root importer's peers from scratch, flipping it to 5.9.3 and churning ~305 lockfile lines inside a diff about something else (#451). Measured, because the flip is invisible in a version-set comparison: main root 6.0.3 -> pnpm add -> 5.9.3 this commit root 6.0.3 -> pnpm add -> 6.0.3 It drags more than the root. On main, one `pnpm add` moves the whole `dist` build toolchain down — `@nuxt/module-builder`, `unbuild` and `tsconfck` land on 5.9.3 while `vue-tsc` stays on 6.0.3 and `mkdist` splits across both, so the published declarations would be built by a mixed toolchain. That matters because `deploy.yml` installs without `--frozen-lockfile`. Here every one of them stays on 6.0.3. A declaration rather than an override, and the difference is the point. An override at the same version was written first and does one thing more — it collapses the second copy that `nuxt-component-meta` pulls in through a hard `typescript: ^5.9.3` dependency. It also rewrites 24 recorded peer ranges to values upstream never published, forces a third-party package's dependency across a major boundary, and erases the unmet-peer report for `@nuxt/module-builder`, `tsconfck` and `unbuild` — including one that is not optional. Since the extra copy only reaches docs-time metadata extraction, and the rendered prop tables are identical either way, that trade is not worth making. `pnpm peers check` still reports the pre-existing mismatch here, which is the honest state. `^6.0.3` is what `playgrounds/nuxt`, `playgrounds/vue` and `playgrounds/demo` already declare; the root was the odd one out. Closes #451.
IgorShevchik
force-pushed
the
fix/typescript-override
branch
from
August 20, 2026 09:36
dd89165 to
90fbadc
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.
Linked issue
Closes #451.
Type of change
Description
typescriptwas declared only as a peerDependency (^5.6.3 || ^6.0.0 || ^7.0.0) and never as a devDependency, so pnpm picked it from that range. Any rootpnpm addre-resolved the root importer's peers from scratch and flipped it to 5.9.3, churning ~305 lockfile lines inside a diff about something else.It drags the build toolchain with it
This is the part worth knowing, and the first revision of this PR did not have it. On
main, onepnpm addmoves the wholedisttoolchain down:mainafterpnpm add@nuxt/module-builderunbuildtsconfckmkdistvue-tscSo
mainis one ordinarypnpm addaway from building the published declarations with a mixed toolchain — anddeploy.ymlinstalls without--frozen-lockfile.A declaration, not an override — and that is the change from the first revision
This PR originally added
typescript: ^6.0.3tooverridesinpnpm-workspace.yaml. Review established that the smaller instrument does the same job, and that the larger one costs more than it returns.What the override did additionally: collapsed the second TypeScript copy, which
nuxt-component-metapulls in through a hardtypescript: ^5.9.3dependency — not, as the first revision's comment claimed, through@nuxt/module-builder's peer. Module-builder already resolved to 6.0.3 onmain.What that cost: rewriting 24 recorded peer ranges to values upstream never published, forcing a third-party package's dependency across a major boundary, and erasing the unmet-peer report for
@nuxt/module-builder(not optional),tsconfckandunbuild. With the override,pnpm peers checkreturns silence; here it still reports the pre-existing mismatch, which is the honest state:The extra copy only ever reached docs-time metadata extraction, and the rendered prop tables are identical either way — 49 of 134
/api/component-meta/*.jsonpayloads shift, entirely in TS-stdlib internals inside the recursiveschemafield thatcompactPropalready strips, with 0 files differing on the surfaceComponentProps.vuedisplays. Not worth erasing 24 upstream constraints for.Corrections to the first revision
Four claims in it were wrong, and they are recorded here rather than quietly dropped:
pnpm add" — it does. Both instruments produce the same root resolution and byte-identical 46-line change sets. That row was the sole stated basis for choosing the override, and it was never measured; the probe behind it silently failed to find the root importer.unbuild@3.6.1peers^5.9.2andtsconfck@3.1.6peers^5.0.0. Module-builder is the only non-optional one.Verification
pnpm install --frozen-lockfilepnpm add -Dno longer flips the rootpnpm peers checkvue-tsc --noEmiteslint .vitest run test/The lockfile diff is 6 lines (was 92 under the override).
^6.0.3is whatplaygrounds/nuxt,playgrounds/vueandplaygrounds/demoalready declare — the root was the odd one out.Checklist