build: unify TypeScript on 5.9 and @types/node on 22 - #1150
Merged
Merged
Conversation
TypeScript was split between 4.9.4 (hoisted, used by most tsc runs) and 5.8.3 (nested under the @quarto/* packages). - typescript ^5.9.3 as a devDependency only in workspaces that run tsc, plus the root (one hoisted copy for typescript-eslint and tsdk). It was a runtime `dependency` in ~20 source-only workspaces that never import it. - The published @quarto/* packages no longer list typescript, tsconfig or build as runtime dependencies (npm consumers were installing TypeScript and the unrelated public `tsconfig` and `build` packages). - @types/node ^22.15.0 everywhere (was 16.x / 18 / 20). This matches the decided engines.vscode ^1.101 floor (Node 22), and is required: TS 5.9's Buffer/ArrayBufferView typings break against the old @types/node, and @types/node 22 needs TS >= 5.6, so the two have to move together. yarn.lock merges the transitive @types/node@* into the 22 entry so a single copy is hoisted. - Fix a regex TS 5.5 now rejects: in `[^\2]`, `\2` is the octal escape \x02, not a backreference, so the include_graphics() path match ran greedily past the closing quote (and across lines). Emitted dist/cjs for the four published packages is byte-identical. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This was referenced Sep 25, 2026
vezwork
approved these changes
Sep 25, 2026
vezwork
left a comment
Member
There was a problem hiding this comment.
I also hand-merged the transitive @types/node@* lock entry
😳.
Continued thanks for simple PRs with nice writeup.
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.
Phase 0.2 of the dependency upgrade. This is independent of #1149 (Node 24), and either can merge first.
TypeScript was split: 4.9.4 was hoisted and used by most
tscruns, while 5.8.3 was nested under the@quarto/*packages.@types/nodewas on four different majors (16.x, 18, 20, 20).Changes
TypeScript
^5.9.3devDependencyonly in the workspaces that actually runtsc(apps/{lsp,vscode,vscode-editor,vscode-markdownit,panmirror}and the four published@quarto/*packages), plus the root, so there's one hoisted copy for typescript-eslint andtypescript.tsdk.dependencybut never import it.yarn.locknow has exactly onetypescriptentry.Published
@quarto/*manifests.typescript,tsconfigandbuildmoved fromdependenciestodevDependencies. Today, anyone who installs@quarto/json-validatorfrom npm also gets TypeScript and the unrelated public npm packages namedtsconfigandbuild. The fix only takes effect on npm after the next patch release of those packages.@types/node^22.15.0everywhere. I originally planned this for the engine-floor PR, but it can't be split out:Buffer/ArrayBufferViewtypings fail against the old@types/node(errors inhover-image.tsandzotero/local/db.ts).@types/node@22release needs TS ≥ 5.6.22 matches the
engines.vscode: ^1.101floor we decided on (VS Code 1.101 ships Node 22). Theengines.vscodeand@types/vscodebump itself is still a separate PR. I also hand-merged the transitive@types/node@*lock entry into the 22 entry, so only one copy gets hoisted.yarn why @types/nodenow shows 22.20.4 at the root, plus the nestedjayson(12) and@fast-csv(14) copies, which are unavoidable.One real bug caught by TS 5.5 regex checking. In
rmd_chunk-image.ts,[^\2]doesn't mean "not the opening quote": inside a character class,\2is the octal escape\x02. So theinclude_graphics()path match ran greedily past the closing quote. For example,include_graphics("a.png"); x <- "b"captureda.png"); x <- "b. I changed it to(.+?)\2.Verification
yarn build --force: 14/14 tasks. This includestsc --noEmitforapps/vscode,apps/lsp,vscode-editor,vscode-markdownitandpanmirror.dist/cjsoutput (JS and.d.ts) is byte-identical to the 5.8.3 build.yarn installleaves the lockfile unchanged.yarn test-packages: 8/8 tasks.yarn test-vscode(VS Code 1.109, Quarto CLI on PATH): main label 150 passing, 0 failing; r-project label 3/3.yarn lint --continue: same result asmain. The 6no-unused-varserrors inquarto-lspare pre-existing. There are no typescript-eslint "unsupported TypeScript version" warnings, but typescript-eslint 5 officially supports only TS < 5.1. That gets resolved in the ESLint 10 / typescript-eslint 8 step.🤖 Generated with Claude Code