fix(deps): update codemirror (#12013)

This commit is contained in:
Elian Doran
2026-10-11 14:03:48 +03:00
committed by GitHub
7 changed files with 345 additions and 289 deletions
+24
View File
@@ -13,6 +13,7 @@ vi.mock("../services/server.js", mockServer);
injectGlobals();
survivePendingModalCallbacks();
deferSelectionChange();
drainBootstrapTransitions();
function injectGlobals() {
@@ -49,6 +50,29 @@ function survivePendingModalCallbacks() {
};
}
/**
* Fires `selectionchange` after the code that moved the selection, as browsers do.
*
* happy-dom dispatches it from inside `Selection.collapse()`. CodeMirror moves the DOM selection
* during `EditorView.update()`, and its listener updates the view again, which throws
* "Calls to EditorView.update are not allowed while an update is in progress".
*/
function deferSelectionChange() {
const dispatch = document.dispatchEvent.bind(document);
// happy-dom's `dispatchEvent()` calls itself again for each event phase.
const deferred = new WeakSet<Event>();
document.dispatchEvent = (event: Event) => {
if (event.type !== "selectionchange" || deferred.has(event)) {
return dispatch(event);
}
deferred.add(event);
queueMicrotask(() => dispatch(event));
return true;
};
}
function mockWebsocket() {
function subscribeToMessages(_callback: (message: unknown) => void) {
// Do nothing.
+2 -2
View File
@@ -19,12 +19,12 @@
"@codemirror/lang-php": "6.0.2",
"@codemirror/lang-vue": "0.1.3",
"@codemirror/lang-xml": "6.1.0",
"@codemirror/legacy-modes": "6.5.4",
"@codemirror/legacy-modes": "6.5.5",
"@codemirror/lint": "6.9.7",
"@codemirror/autocomplete": "6.20.3",
"@codemirror/search": "6.7.2",
"@codemirror/state": "6.7.6",
"@codemirror/view": "6.43.13",
"@codemirror/view": "6.43.14",
"@typescript/vfs": "1.6.5",
"@valtown/codemirror-ts": "2.3.1",
"typescript": "6.0.3",
+24
View File
@@ -0,0 +1,24 @@
deferSelectionChange();
/**
* Fires `selectionchange` after the code that moved the selection, as browsers do.
*
* happy-dom dispatches it from inside `Selection.collapse()`. CodeMirror moves the DOM selection
* during `EditorView.update()`, and its listener updates the view again, which throws
* "Calls to EditorView.update are not allowed while an update is in progress".
*/
function deferSelectionChange() {
const dispatch = document.dispatchEvent.bind(document);
// happy-dom's `dispatchEvent()` calls itself again for each event phase.
const deferred = new WeakSet<Event>();
document.dispatchEvent = (event: Event) => {
if (event.type !== "selectionchange" || deferred.has(event)) {
return dispatch(event);
}
deferred.add(event);
queueMicrotask(() => dispatch(event));
return true;
};
}
+2 -1
View File
@@ -36,6 +36,7 @@
"src/**/*.test.js",
"src/**/*.spec.js",
"src/**/*.test.jsx",
"src/**/*.spec.jsx"
"src/**/*.spec.jsx",
"src/test/**"
]
}
+2 -1
View File
@@ -31,6 +31,7 @@ export default defineConfig(() => ({
watch: false,
globals: true,
environment: 'happy-dom',
setupFiles: ['./src/test/setup.ts'],
include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
reporters: [
'default',
@@ -45,7 +46,7 @@ export default defineConfig(() => ({
},
provider: 'v8',
include: ['src/**/*.{ts,tsx}'],
exclude: ['**/*.{test,spec}.{ts,mts,cts,tsx,js,jsx}', '**/*.d.ts'],
exclude: ['**/*.{test,spec}.{ts,mts,cts,tsx,js,jsx}', '**/*.d.ts', 'src/test/**'],
// Codecov resolves an lcov `SF:` path by matching it against the repo's file list, so the
// package-relative paths istanbul emits by default (`src/index.ts`, relative to cwd) are
// ambiguous in this monorepo and get attributed to whichever package wins the match. Emit
+288 -282
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -23,16 +23,16 @@ overrides:
# facets to work. A partial bump leaves two copies in the tree, which breaks
# both typechecking (nominal type clashes) and runtime (lint markers, etc.).
# Keep every core singleton pinned here so the whole tree resolves to one copy.
"@codemirror/view": "6.43.13"
"@codemirror/view": "6.43.14"
"@codemirror/state": "6.7.6"
"@codemirror/language": "6.12.4"
"@codemirror/language": "6.13.1"
"@codemirror/commands": "6.11.1"
"@codemirror/autocomplete": "6.20.3"
"@codemirror/lint": "6.9.7"
"@codemirror/search": "6.7.2"
"@lezer/common": "1.5.3"
"@lezer/highlight": "1.2.5"
"@lezer/lr": "1.4.10"
"@lezer/lr": "1.4.11"
# The AI SDK packages each pin @ai-sdk/provider-utils to an exact patch, and they do not move in
# step: `ai` and the OpenAI/Google providers ask for one, the Anthropic provider for another. Two
# copies in the tree mean two declarations of the `unique symbol` that marks a `Schema`, so a tool