Skip to content

ci(fresh-install): bump examples & playground in lockstep with packages#2660

Open
nperez0111 wants to merge 6 commits intomainfrom
feat/fresh-install-debug
Open

ci(fresh-install): bump examples & playground in lockstep with packages#2660
nperez0111 wants to merge 6 commits intomainfrom
feat/fresh-install-debug

Conversation

@nperez0111
Copy link
Copy Markdown
Contributor

@nperez0111 nperez0111 commented Apr 20, 2026

Summary

  • Problem: The Fresh Install Tests workflow has been failing at the Build packages step. Root cause is a TS2322 in @blocknote/example-editor: Extension<any, any> not assignable to AnyExtension. The workflow's pnpm update --prod --filter <publishable @blocknote/* only> upgraded @tiptap/react/@tiptap/pm to 3.22.4 in the publishable packages, but examples/* and playground stayed at 3.22.3. Since @tiptap/core has @tiptap/pm as a peer dep, pnpm created two virtual-store copies (...@pm@3.22.3 and ...@pm@3.22.4) and TypeScript treated their Extension exports as unrelated types.
  • Fix: Extend the update filter to also cover ./examples/*/* and ./playground. docs/, shared/, tests/, fumadocs/ stay excluded — they're not part of the "fresh npm install @blocknote/react" user experience this workflow simulates. DevDependencies still stay pinned to the lockfile via --prod.
  • Also adds feat/fresh-install-debug to the workflow's push triggers so this PR exercises the workflow.

Verified locally: clean pnpm install + targeted update + nx run @blocknote/example-editor:build all pass (was failing before).

Test plan

  • Fresh Install Tests workflow succeeds on this branch (triggered by the push)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • CI workflow now runs fresh-install tests on an additional branch.
    • Added a dependency deduplication step to reduce duplicate transitive installs and produce a cleaner lockfile.
    • Improved CI failure notifications to surface failures from the new dedupe step.
  • Tests

    • Enhanced test teardown to properly dispose editor instances after each test, reducing resource leaks and flakiness.

Without this, pnpm update --prod only bumped the publishable @blocknote/*
packages, leaving examples/* and playground pinned to older versions. For
peer-dep'd libs like @tiptap/core + @tiptap/pm that produced two virtual-
store copies keyed on different peer versions, which TypeScript treated as
unrelated types — breaking example-editor:build with TS2322.

Extending the filter keeps every app that consumes @blocknote/* in lockstep
with the published packages. docs/shared/tests/fumadocs stay excluded.

Also add this branch to the push triggers so the PR exercises the workflow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blocknote Error Error Apr 20, 2026 11:42am
blocknote-website Error Error Apr 20, 2026 11:42am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 20, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

CI workflow changed to trigger on main (was package-upgrades), added a dedupe_deps job step running pnpm dedupe and wired it into the Slack failure-notification mapping; tests now track and unmount created BlockNoteEditor instances after each test to clean up ProseMirror resources.

Changes

Cohort / File(s) Summary
CI/CD Workflow
\.github/workflows/fresh-install-tests.yml
Changed push trigger branch from package-upgrades to main; added dedupe_deps step that runs pnpm dedupe after prod dependency updates; extended Slack failure-notification mapping to include dedupe_deps (sets failed_step to "Dedupe transitive dependencies").
Editor tests teardown
packages/core/src/blocks/ListItem/NumberedListItem/IndexingPlugin.test.ts
Introduce module-level activeEditors array; update createEditor() to push created BlockNoteEditor instances; import afterEach from vitest and register an afterEach hook that unmounts all tracked editors to ensure cleanup after each test.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PR #2579 — Introduced the original fresh-install-tests workflow that this change modifies.
  • PR #2648 — Adds/edits the same fresh-install-tests.yml workflow and overlaps with the new dedupe_deps step and failure handling.

Poem

🐰 I nudged the CI to wake on main,

ran a tidy pass to clear the chain,
tiny editors bowed and went to sleep,
unmounted paws in tidy heaps,
🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: extending the workflow to update examples and playground dependencies in sync with packages.
Description check ✅ Passed The description provides comprehensive context: problem statement, root cause analysis, the fix applied, and verification steps. It covers the essential information despite not following the exact template format.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/fresh-install-debug

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 20, 2026

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@2660

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@2660

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@2660

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@2660

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@2660

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@2660

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@2660

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@2660

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@2660

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@2660

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@2660

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@2660

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@2660

commit: 47314bf

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/fresh-install-tests.yml (1)

9-10: ⚠️ Potential issue | 🟡 Minor

Keep the workflow description and Slack failure label in sync.

Line 9 and Line 110 still describe only published packages, but the update step now includes examples and playground too.

Proposed wording update
-# Only production dependencies of published (non-private) packages are updated.
-# DevDependencies (vitest, vite, typescript, etc.) stay pinned to the lockfile,
+# Production dependencies of published packages, examples, and playground are updated.
+# DevDependencies (vitest, vite, typescript, etc.) stay pinned to the lockfile,
-            failed_step="Update prod deps of published packages"
+            failed_step="Update prod deps of packages, examples, and playground"

Also applies to: 109-110

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/fresh-install-tests.yml around lines 9 - 10, Update the
workflow description and the Slack failure label text that still say "only
published packages" so they reflect the current behavior which also updates
examples and playground; find the comment/description string near the top of the
workflow and the Slack failure label value (the second occurrence later in the
file) and change both to something like "published packages, examples, and
playground" (or equivalent phrasing) so the description and Slack label remain
in sync.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/fresh-install-tests.yml:
- Around line 67-70: The workflow currently passes a static --filter
"./packages/*" to pnpm update which now picks up private packages; change this
back to selecting only non-private workspaces while keeping the static filters
for "./examples/*/*" and "./playground". Concretely, replace the static --filter
"./packages/*" entry with a dynamic filter generation step that enumerates
workspaces from package.json/workspace config and emits only non-private package
selectors (or a script that prints the list of non-private workspace globs) and
feed those selectors into the pnpm update command; keep the existing --filter
"./examples/*/*" and --filter "./playground" entries unchanged so examples and
playground remain included. Ensure the new selector logic targets the same
invocation where "pnpm update --prod" is run.

---

Outside diff comments:
In @.github/workflows/fresh-install-tests.yml:
- Around line 9-10: Update the workflow description and the Slack failure label
text that still say "only published packages" so they reflect the current
behavior which also updates examples and playground; find the
comment/description string near the top of the workflow and the Slack failure
label value (the second occurrence later in the file) and change both to
something like "published packages, examples, and playground" (or equivalent
phrasing) so the description and Slack label remain in sync.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 58df837b-bc2a-442c-ad20-219da72463af

📥 Commits

Reviewing files that changed from the base of the PR and between 40ddec4 and 4c5e498.

📒 Files selected for processing (1)
  • .github/workflows/fresh-install-tests.yml

Comment on lines +67 to +70
pnpm update --prod
--filter "./packages/*"
--filter "./examples/*/*"
--filter "./playground"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Description: Check whether the new "./packages/*" filter could include private workspaces.
# Expected: no output, or only private packages with zero production dependencies.

fd '^package\.json$' packages --max-depth 2 --type f | while IFS= read -r pkg; do
  private="$(jq -r '.private // false' "$pkg")"
  if [ "$private" = "true" ]; then
    name="$(jq -r '.name // "(unnamed)"' "$pkg")"
    prod_dep_count="$(jq -r '(.dependencies // {}) | keys | length' "$pkg")"
    printf '%s\tname=%s\tprivate=true\tprodDeps=%s\n' "$pkg" "$name" "$prod_dep_count"
  fi
done

Repository: TypeCellOS/BlockNote

Length of output: 238


The new ./packages/* filter now includes private packages that were previously excluded.

The dynamic selection previously filtered for non-private packages only. The static path selector matches all workspaces under packages/, including:

  • @blocknote/dev-scripts (1 production dependency)
  • @blocknote/xl-ai-server (10 production dependencies)

This widens the scope of pnpm update beyond intended publishable packages. Consider restoring non-private package discovery for the packages/* filter while keeping the static filters for examples/*/* and playground.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/fresh-install-tests.yml around lines 67 - 70, The workflow
currently passes a static --filter "./packages/*" to pnpm update which now picks
up private packages; change this back to selecting only non-private workspaces
while keeping the static filters for "./examples/*/*" and "./playground".
Concretely, replace the static --filter "./packages/*" entry with a dynamic
filter generation step that enumerates workspaces from package.json/workspace
config and emits only non-private package selectors (or a script that prints the
list of non-private workspace globs) and feed those selectors into the pnpm
update command; keep the existing --filter "./examples/*/*" and --filter
"./playground" entries unchanged so examples and playground remain included.
Ensure the new selector logic targets the same invocation where "pnpm update
--prod" is run.

The previous commit widened the update filter to include examples/* and
playground so @tiptap/core + @tiptap/pm would resolve uniformly across the
workspace. But pnpm update on examples/* rewrites "@blocknote/*": "latest"
to "workspace:^", which means CI stops testing what CodeSandbox users
actually see (they pull the published @blocknote/* from npm via "latest").

Switch to a two-step approach: keep the original publishable-only filter so
examples' package.json stays untouched, then run pnpm dedupe afterward.
Dedupe only rewrites the lockfile and collapses duplicate transitive
resolutions — zero package.json churn, and both the TS2322 build failure
and the CodeSandbox parity are preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/fresh-install-tests.yml (1)

17-17: Remove the temporary debug branch trigger before merging.

This is useful for exercising the workflow on this PR branch, but leaving feat/fresh-install-debug in main makes the workflow permanently watch a short-lived branch name.

Proposed cleanup
     branches:
       - package-upgrades
-      - feat/fresh-install-debug
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/fresh-install-tests.yml at line 17, Remove the temporary
debug branch entry "feat/fresh-install-debug" from the workflow trigger so the
workflow no longer watches that short-lived branch; locate the branch list in
the workflow YAML (the "branches" array under the top-level "on" or "push"
trigger) and delete the "feat/fresh-install-debug" item, leaving only the
intended persistent branches.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/fresh-install-tests.yml:
- Line 17: Remove the temporary debug branch entry "feat/fresh-install-debug"
from the workflow trigger so the workflow no longer watches that short-lived
branch; locate the branch list in the workflow YAML (the "branches" array under
the top-level "on" or "push" trigger) and delete the "feat/fresh-install-debug"
item, leaving only the intended persistent branches.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7ccbeeb9-7c3d-458e-9926-3e25c41c8ed7

📥 Commits

Reviewing files that changed from the base of the PR and between 4c5e498 and aefa9d2.

📒 Files selected for processing (1)
  • .github/workflows/fresh-install-tests.yml

The tests created BlockNoteEditor instances via createEditor() but never
destroyed them. prosemirror-view's DOMObserver keeps a setTimeout alive
waiting to flush pending mutations; when vitest tears down jsdom between
test files the timer fires against a torn-down document and throws
`ReferenceError: document is not defined`. Vitest catches it as an
unhandled error and fails the whole run even when all 16 assertions pass.

Local runs usually hit the lucky teardown ordering and pass; CI surfaces
the race intermittently. Tracking created editors and calling
_tiptapEditor.destroy() in afterEach ensures the DOMObserver timers are
canceled before jsdom goes away.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
unmount() is the public API for tearing down a BlockNoteEditor and handles
portalElement cleanup in addition to the underlying prosemirror teardown.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant