fix: Examples not truly standalone - #2927
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe change replaces catalog-based ChangesVite Plus catalog migration
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/dev-scripts/examples/util.ts (1)
138-149: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winParse 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (99)
examples/01-basic/01-minimal/package.jsonexamples/01-basic/02-block-objects/package.jsonexamples/01-basic/03-multi-column/package.jsonexamples/01-basic/04-default-blocks/package.jsonexamples/01-basic/05-removing-default-blocks/package.jsonexamples/01-basic/06-block-manipulation/package.jsonexamples/01-basic/07-selection-blocks/package.jsonexamples/01-basic/08-ariakit/package.jsonexamples/01-basic/09-shadcn/package.jsonexamples/01-basic/10-localization/package.jsonexamples/01-basic/11-custom-placeholder/package.jsonexamples/01-basic/12-multi-editor/package.jsonexamples/01-basic/13-custom-paste-handler/package.jsonexamples/01-basic/14-editor-scrollable/package.jsonexamples/01-basic/15-shadowdom/package.jsonexamples/01-basic/16-read-only-editor/package.jsonexamples/01-basic/17-no-trailing-block/package.jsonexamples/01-basic/testing/package.jsonexamples/02-backend/01-file-uploading/package.jsonexamples/02-backend/02-saving-loading/package.jsonexamples/02-backend/03-s3/package.jsonexamples/02-backend/04-rendering-static-documents/package.jsonexamples/03-ui-components/01-ui-elements-remove/package.jsonexamples/03-ui-components/02-formatting-toolbar-buttons/package.jsonexamples/03-ui-components/03-formatting-toolbar-block-type-items/package.jsonexamples/03-ui-components/04-side-menu-buttons/package.jsonexamples/03-ui-components/05-side-menu-drag-handle-items/package.jsonexamples/03-ui-components/06-suggestion-menus-slash-menu-items/package.jsonexamples/03-ui-components/07-suggestion-menus-slash-menu-component/package.jsonexamples/03-ui-components/08-suggestion-menus-emoji-picker-columns/package.jsonexamples/03-ui-components/09-suggestion-menus-emoji-picker-component/package.jsonexamples/03-ui-components/10-suggestion-menus-grid-mentions/package.jsonexamples/03-ui-components/11-uppy-file-panel/package.jsonexamples/03-ui-components/12-static-formatting-toolbar/package.jsonexamples/03-ui-components/13-custom-ui/package.jsonexamples/03-ui-components/14-experimental-mobile-formatting-toolbar/package.jsonexamples/03-ui-components/15-advanced-tables/package.jsonexamples/03-ui-components/16-link-toolbar-buttons/package.jsonexamples/03-ui-components/17-advanced-tables-2/package.jsonexamples/03-ui-components/18-drag-n-drop/package.jsonexamples/03-ui-components/19-suggestion-menus-grouping-ordering/package.jsonexamples/03-ui-components/20-portal-elements/package.jsonexamples/04-theming/01-theming-dom-attributes/package.jsonexamples/04-theming/02-changing-font/package.jsonexamples/04-theming/03-theming-css/package.jsonexamples/04-theming/04-theming-css-variables/package.jsonexamples/04-theming/05-theming-css-variables-code/package.jsonexamples/04-theming/06-code-block/package.jsonexamples/04-theming/07-custom-code-block/package.jsonexamples/05-interoperability/01-converting-blocks-to-html/package.jsonexamples/05-interoperability/02-converting-blocks-from-html/package.jsonexamples/05-interoperability/03-converting-blocks-to-md/package.jsonexamples/05-interoperability/04-converting-blocks-from-md/package.jsonexamples/05-interoperability/05-converting-blocks-to-pdf/package.jsonexamples/05-interoperability/06-converting-blocks-to-docx/package.jsonexamples/05-interoperability/07-converting-blocks-to-odt/package.jsonexamples/05-interoperability/08-converting-blocks-to-react-email/package.jsonexamples/05-interoperability/09-blocks-to-html-static-render/package.jsonexamples/05-interoperability/10-static-html-render/package.jsonexamples/06-custom-schema/01-alert-block/package.jsonexamples/06-custom-schema/02-suggestion-menus-mentions/package.jsonexamples/06-custom-schema/03-font-style/package.jsonexamples/06-custom-schema/04-pdf-file-block/package.jsonexamples/06-custom-schema/05-alert-block-full-ux/package.jsonexamples/06-custom-schema/06-toggleable-blocks/package.jsonexamples/06-custom-schema/07-configuring-blocks/package.jsonexamples/06-custom-schema/08-non-editable-block/package.jsonexamples/06-custom-schema/draggable-inline-content/package.jsonexamples/06-custom-schema/react-custom-blocks/package.jsonexamples/06-custom-schema/react-custom-inline-content/package.jsonexamples/06-custom-schema/react-custom-styles/package.jsonexamples/07-collaboration/01-partykit/package.jsonexamples/07-collaboration/02-liveblocks/package.jsonexamples/07-collaboration/03-y-sweet/package.jsonexamples/07-collaboration/04-electric-sql/package.jsonexamples/07-collaboration/05-comments/package.jsonexamples/07-collaboration/06-comments-with-sidebar/package.jsonexamples/07-collaboration/07-ghost-writer/package.jsonexamples/07-collaboration/08-forking/package.jsonexamples/07-collaboration/09-comments-testing/package.jsonexamples/07-collaboration/10-suggestion-multi-editor/package.jsonexamples/07-collaboration/11-versioning-yjs13/package.jsonexamples/07-collaboration/12-multi-doc-versioning/package.jsonexamples/07-collaboration/13-versioning-yjs14/package.jsonexamples/07-collaboration/14-suggestion-gallery/package.jsonexamples/08-extensions/01-tiptap-arrow-conversion/package.jsonexamples/08-extensions/02-versioning/package.jsonexamples/09-ai/01-minimal/package.jsonexamples/09-ai/02-playground/package.jsonexamples/09-ai/03-custom-ai-menu-items/package.jsonexamples/09-ai/04-with-collaboration/package.jsonexamples/09-ai/05-manual-execution/package.jsonexamples/09-ai/06-client-side-transport/package.jsonexamples/09-ai/07-server-persistence/package.jsonexamples/vanilla-js/react-vanilla-custom-blocks/package.jsonexamples/vanilla-js/react-vanilla-custom-inline-content/package.jsonexamples/vanilla-js/react-vanilla-custom-styles/package.jsonpackages/dev-scripts/examples/template-react/package.json.template.tsxpackages/dev-scripts/examples/util.ts
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
|
Summary
The examples currently have
vite-plus: "catalog:"in theirpackage.jsons. This is an issue for 2 reasons:"catalog:"as a valid version, so running the examples there causes an error onnpm install.The fix is to generate the
package.jsonfiles with an actual version ofvite-plus. Instead of hardcoding this, agetCatalogVersionhelper has been added to read the package version from the project'spnpm-workspace.yamlfile. This keeps the version in sync without having to manually update thegenscript 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
Additional Notes
N/A
Summary by CodeRabbit
vite-plusversion^0.1.24for more consistent setup and execution.