Skip to content

Commit 050ec30

Browse files
authored
ci(fresh-install): bump examples & playground in lockstep with packages (#2660)
1 parent 40ddec4 commit 050ec30

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

.github/workflows/fresh-install-tests.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ name: Fresh Install Tests
1111
# so test tooling churn doesn't cause false positives.
1212

1313
on:
14-
push:
15-
branches:
16-
- package-upgrades
1714
schedule:
1815
- cron: "0 2 * * *" # Daily at 02:00 UTC
1916
workflow_dispatch: # Allow manual runs
@@ -67,6 +64,19 @@ jobs:
6764
echo "Updating prod deps for: $FILTERS"
6865
eval pnpm update --prod $FILTERS
6966
67+
- id: dedupe_deps
68+
name: Dedupe transitive dependencies
69+
# After bumping the publishable packages' prod deps, collapse any
70+
# duplicate transitive resolutions (e.g. @tiptap/core + @tiptap/pm)
71+
# that would otherwise differ between the updated publishable packages
72+
# and the un-updated examples/playground. Without this, TypeScript
73+
# treats the two copies' exports as unrelated types and example-editor
74+
# fails to build (TS2322 on Extension<any, any> vs AnyExtension).
75+
# Dedupe only rewrites the lockfile — it does NOT modify package.json,
76+
# so the examples' "@blocknote/*": "latest" specs (which is what
77+
# CodeSandbox users see) stay intact.
78+
run: pnpm dedupe
79+
7080
- id: build_packages
7181
name: Build packages
7282
run: pnpm run build
@@ -106,6 +116,8 @@ jobs:
106116
failed_step="Install dependencies"
107117
elif [ "${{ steps.update_prod_deps.outcome }}" = "failure" ]; then
108118
failed_step="Update prod deps of published packages"
119+
elif [ "${{ steps.dedupe_deps.outcome }}" = "failure" ]; then
120+
failed_step="Dedupe transitive dependencies"
109121
elif [ "${{ steps.build_packages.outcome }}" = "failure" ]; then
110122
failed_step="Build packages"
111123
elif [ "${{ steps.run_unit_tests.outcome }}" = "failure" ]; then

packages/core/src/blocks/ListItem/NumberedListItem/IndexingPlugin.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Selection } from "prosemirror-state";
2-
import { describe, expect, it } from "vitest";
2+
import { afterEach, describe, expect, it } from "vitest";
33

44
import { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
55

@@ -9,9 +9,22 @@ import { BlockNoteEditor } from "../../../editor/BlockNoteEditor.js";
99

1010
const PLUGIN_KEY = "numbered-list-indexing-decorations$";
1111

12+
// Track editors created in each test so we can unmount them in afterEach —
13+
// otherwise prosemirror-view's DOMObserver leaves a setTimeout alive that
14+
// fires after vitest tears down jsdom, throwing
15+
// `ReferenceError: document is not defined` and failing the run.
16+
const activeEditors: BlockNoteEditor<any, any, any>[] = [];
17+
18+
afterEach(() => {
19+
while (activeEditors.length) {
20+
activeEditors.pop()!.unmount();
21+
}
22+
});
23+
1224
function createEditor() {
1325
const editor = BlockNoteEditor.create();
1426
editor.mount(document.createElement("div"));
27+
activeEditors.push(editor);
1528
return editor;
1629
}
1730

0 commit comments

Comments
 (0)