Skip to content

fix: Examples not truly standalone - #2927

Open
matthewlipski wants to merge 2 commits into
mainfrom
examples-catalog-fix
Open

fix: Examples not truly standalone#2927
matthewlipski wants to merge 2 commits into
mainfrom
examples-catalog-fix

Conversation

@matthewlipski

@matthewlipski matthewlipski commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

The examples currently have vite-plus: "catalog:" in their package.jsons. This is an issue for 2 reasons:

  1. The examples are supposed to be able to be ran on their own, and this requires a parent pnpm workspace to fetch the correct package version.
  2. StackBlitz uses npm, not pnpm, which doesn't support "catalog:" as a valid version, so running the examples there causes an error on npm install.

The fix is to generate the package.json files with an actual version of vite-plus. Instead of hardcoding this, a getCatalogVersion helper has been added to read the package version from the project's pnpm-workspace.yaml file. This keeps the version in sync without having to manually update the gen script and avoids unnecessary additional versions of Vite/Vite+ being installed.

Rationale

The StackBlitz links for examples on the website are broken at the moment.

Changes

See above.

Impact

N/A

Testing

N/A

Screenshots/Video

N/A

Checklist

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.
  • The documentation has been updated to reflect the new feature

Additional Notes

N/A

Summary by CodeRabbit

  • Chores
    • Updated example projects to use vite-plus version ^0.1.24 for more consistent setup and execution.
    • Improved example project generation so dependency versions are populated from the workspace configuration.
  • Documentation
    • Refreshed dependency configuration across basic, backend, UI, theming, interoperability, collaboration, extension, AI, and vanilla JavaScript examples.

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
blocknote Ready Ready Preview Jul 27, 2026 4:12pm
blocknote-website Ready Ready Preview Jul 27, 2026 4:12pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5900daa8-b3d6-499d-a382-c833bae2a1a7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The change replaces catalog-based vite-plus references in example manifests with ^0.1.24, and adds catalog lookup support for the React example package template.

Changes

Vite Plus catalog migration

Layer / File(s) Summary
Catalog version lookup
packages/dev-scripts/examples/util.ts
Adds getCatalogVersion to read matching versions from the workspace catalog.
React template resolution
packages/dev-scripts/examples/template-react/package.json.template.tsx
Uses getCatalogVersion("vite-plus") for the generated dependency version.
Example manifest updates
examples/01-basic/..., examples/02-backend/..., examples/03-ui-components/..., examples/04-theming/..., examples/05-interoperability/..., examples/06-custom-schema/..., examples/07-collaboration/..., examples/08-extensions/..., examples/09-ai/..., examples/vanilla-js/...
Changes vite-plus from catalog: to ^0.1.24.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: nperez0111

Poem

A rabbit hops through packages bright,
Replacing catalog tags tonight.
Vite-plus versions neatly align,
Templates read the catalog fine.
“^0.1.24!” we cheer,
Clean little manifests far and near.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and aligns with the main change: making example projects standalone by replacing catalog-based versions.
Description check ✅ Passed The description follows the template and covers summary, rationale, changes, impact, testing, checklist, and notes, with only minor placeholder content.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch examples-catalog-fix

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/dev-scripts/examples/util.ts (1)

138-149: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Parse the catalog as YAML instead of whitespace-delimited lines.

The current regex only handles single-token values. Valid entries with quoted ranges containing spaces or inline comments will be missed, causing template generation to throw or emit an invalid dependency version. Use the repository’s YAML parser, or document and test a strict scalar-only invariant.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/dev-scripts/examples/util.ts` around lines 138 - 149, Update the
catalog parsing logic around the catalog lookup function to parse the catalog
block with the repository’s YAML parser instead of matching whitespace-delimited
key/value lines. Preserve quote handling and return the requested dependency’s
scalar value, including quoted ranges with spaces and values containing inline
comments; ensure missing or invalid entries retain the existing failure
behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/dev-scripts/examples/util.ts`:
- Around line 138-149: Update the catalog parsing logic around the catalog
lookup function to parse the catalog block with the repository’s YAML parser
instead of matching whitespace-delimited key/value lines. Preserve quote
handling and return the requested dependency’s scalar value, including quoted
ranges with spaces and values containing inline comments; ensure missing or
invalid entries retain the existing failure behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 91929846-b020-45b7-a4f8-2a32559b5cfe

📥 Commits

Reviewing files that changed from the base of the PR and between dee7880 and 6dd5648.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (99)
  • examples/01-basic/01-minimal/package.json
  • examples/01-basic/02-block-objects/package.json
  • examples/01-basic/03-multi-column/package.json
  • examples/01-basic/04-default-blocks/package.json
  • examples/01-basic/05-removing-default-blocks/package.json
  • examples/01-basic/06-block-manipulation/package.json
  • examples/01-basic/07-selection-blocks/package.json
  • examples/01-basic/08-ariakit/package.json
  • examples/01-basic/09-shadcn/package.json
  • examples/01-basic/10-localization/package.json
  • examples/01-basic/11-custom-placeholder/package.json
  • examples/01-basic/12-multi-editor/package.json
  • examples/01-basic/13-custom-paste-handler/package.json
  • examples/01-basic/14-editor-scrollable/package.json
  • examples/01-basic/15-shadowdom/package.json
  • examples/01-basic/16-read-only-editor/package.json
  • examples/01-basic/17-no-trailing-block/package.json
  • examples/01-basic/testing/package.json
  • examples/02-backend/01-file-uploading/package.json
  • examples/02-backend/02-saving-loading/package.json
  • examples/02-backend/03-s3/package.json
  • examples/02-backend/04-rendering-static-documents/package.json
  • examples/03-ui-components/01-ui-elements-remove/package.json
  • examples/03-ui-components/02-formatting-toolbar-buttons/package.json
  • examples/03-ui-components/03-formatting-toolbar-block-type-items/package.json
  • examples/03-ui-components/04-side-menu-buttons/package.json
  • examples/03-ui-components/05-side-menu-drag-handle-items/package.json
  • examples/03-ui-components/06-suggestion-menus-slash-menu-items/package.json
  • examples/03-ui-components/07-suggestion-menus-slash-menu-component/package.json
  • examples/03-ui-components/08-suggestion-menus-emoji-picker-columns/package.json
  • examples/03-ui-components/09-suggestion-menus-emoji-picker-component/package.json
  • examples/03-ui-components/10-suggestion-menus-grid-mentions/package.json
  • examples/03-ui-components/11-uppy-file-panel/package.json
  • examples/03-ui-components/12-static-formatting-toolbar/package.json
  • examples/03-ui-components/13-custom-ui/package.json
  • examples/03-ui-components/14-experimental-mobile-formatting-toolbar/package.json
  • examples/03-ui-components/15-advanced-tables/package.json
  • examples/03-ui-components/16-link-toolbar-buttons/package.json
  • examples/03-ui-components/17-advanced-tables-2/package.json
  • examples/03-ui-components/18-drag-n-drop/package.json
  • examples/03-ui-components/19-suggestion-menus-grouping-ordering/package.json
  • examples/03-ui-components/20-portal-elements/package.json
  • examples/04-theming/01-theming-dom-attributes/package.json
  • examples/04-theming/02-changing-font/package.json
  • examples/04-theming/03-theming-css/package.json
  • examples/04-theming/04-theming-css-variables/package.json
  • examples/04-theming/05-theming-css-variables-code/package.json
  • examples/04-theming/06-code-block/package.json
  • examples/04-theming/07-custom-code-block/package.json
  • examples/05-interoperability/01-converting-blocks-to-html/package.json
  • examples/05-interoperability/02-converting-blocks-from-html/package.json
  • examples/05-interoperability/03-converting-blocks-to-md/package.json
  • examples/05-interoperability/04-converting-blocks-from-md/package.json
  • examples/05-interoperability/05-converting-blocks-to-pdf/package.json
  • examples/05-interoperability/06-converting-blocks-to-docx/package.json
  • examples/05-interoperability/07-converting-blocks-to-odt/package.json
  • examples/05-interoperability/08-converting-blocks-to-react-email/package.json
  • examples/05-interoperability/09-blocks-to-html-static-render/package.json
  • examples/05-interoperability/10-static-html-render/package.json
  • examples/06-custom-schema/01-alert-block/package.json
  • examples/06-custom-schema/02-suggestion-menus-mentions/package.json
  • examples/06-custom-schema/03-font-style/package.json
  • examples/06-custom-schema/04-pdf-file-block/package.json
  • examples/06-custom-schema/05-alert-block-full-ux/package.json
  • examples/06-custom-schema/06-toggleable-blocks/package.json
  • examples/06-custom-schema/07-configuring-blocks/package.json
  • examples/06-custom-schema/08-non-editable-block/package.json
  • examples/06-custom-schema/draggable-inline-content/package.json
  • examples/06-custom-schema/react-custom-blocks/package.json
  • examples/06-custom-schema/react-custom-inline-content/package.json
  • examples/06-custom-schema/react-custom-styles/package.json
  • examples/07-collaboration/01-partykit/package.json
  • examples/07-collaboration/02-liveblocks/package.json
  • examples/07-collaboration/03-y-sweet/package.json
  • examples/07-collaboration/04-electric-sql/package.json
  • examples/07-collaboration/05-comments/package.json
  • examples/07-collaboration/06-comments-with-sidebar/package.json
  • examples/07-collaboration/07-ghost-writer/package.json
  • examples/07-collaboration/08-forking/package.json
  • examples/07-collaboration/09-comments-testing/package.json
  • examples/07-collaboration/10-suggestion-multi-editor/package.json
  • examples/07-collaboration/11-versioning-yjs13/package.json
  • examples/07-collaboration/12-multi-doc-versioning/package.json
  • examples/07-collaboration/13-versioning-yjs14/package.json
  • examples/07-collaboration/14-suggestion-gallery/package.json
  • examples/08-extensions/01-tiptap-arrow-conversion/package.json
  • examples/08-extensions/02-versioning/package.json
  • examples/09-ai/01-minimal/package.json
  • examples/09-ai/02-playground/package.json
  • examples/09-ai/03-custom-ai-menu-items/package.json
  • examples/09-ai/04-with-collaboration/package.json
  • examples/09-ai/05-manual-execution/package.json
  • examples/09-ai/06-client-side-transport/package.json
  • examples/09-ai/07-server-persistence/package.json
  • examples/vanilla-js/react-vanilla-custom-blocks/package.json
  • examples/vanilla-js/react-vanilla-custom-inline-content/package.json
  • examples/vanilla-js/react-vanilla-custom-styles/package.json
  • packages/dev-scripts/examples/template-react/package.json.template.tsx
  • packages/dev-scripts/examples/util.ts

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

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

@blocknote/code-block

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

@blocknote/core

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

@blocknote/mantine

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

@blocknote/react

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

@blocknote/server-util

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

@blocknote/shadcn

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

@blocknote/xl-ai

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

@blocknote/xl-docx-exporter

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

@blocknote/xl-email-exporter

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

@blocknote/xl-multi-column

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

@blocknote/xl-odt-exporter

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

@blocknote/xl-pdf-exporter

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

commit: 55593ce

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-2927/

Built to branch gh-pages at 2026-07-27 16:14 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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