-
-
Notifications
You must be signed in to change notification settings - Fork 763
docs(examples): use plain vite for StackBlitz compatibility #2958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,10 @@ | |
| "private": true, | ||
| "version": "0.12.4", | ||
| "scripts": { | ||
| "start": "vp dev", | ||
| "dev": "vp dev", | ||
| "build:prod": "tsc && vp build", | ||
| "preview": "vp preview" | ||
| "start": "vite", | ||
| "dev": "vite", | ||
| "build:prod": "tsc && vite build", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- target package scripts ---'
for f in \
examples/01-basic/03-multi-column/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
do
printf '\n### %s\n' "$f"
cat -n "$f"
done
printf '%s\n' '--- repository command and migration context ---'
printf '\n### package-manager files\n'
git ls-files | rg '(^|/)(package.json|pnpm-lock.yaml|pnpm-workspace.yaml|vp|stackblitz|README|CONTRIBUTING|AGENTS\.md)$' || true
printf '\n### direct tsc/build:prod occurrences\n'
rg -n --glob 'package.json' '"build:prod"|(^|[^[:alnum:]_])tsc([^[:alnum:]_]|$)|vp run lint|pnpm' . || true
printf '\n### root package scripts/configuration\n'
if [ -f package.json ]; then cat -n package.json; fi
if [ -f pnpm-workspace.yaml ]; then cat -n pnpm-workspace.yaml; fiRepository: TypeCellOS/BlockNote Length of output: 2114 🌐 Web query:
💡 Result: The command Citations:
🌐 Web query:
💡 Result: The Citations:
🏁 Script executed: #!/bin/bash
set -eu
base='https://raw.githubusercontent.com/TypeCellOS/BlockNote/main'
files=(
'examples/01-basic/03-multi-column/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'
'package.json'
'pnpm-workspace.yaml'
)
for path in "${files[@]}"; do
printf '\n### %s\n' "$path"
curl -fsSL "$base/$path" | nl -ba
done
printf '\n### matching package scripts in the current public tree\n'
curl -fsSL 'https://api.github.com/repos/TypeCellOS/BlockNote/git/trees/main?recursive=1' |
jq -r '.tree[] | select(.path | endswith("package.json")) | .path' |
while IFS= read -r path; do
content=$(curl -fsSL "$base/$path" 2>/dev/null || true)
if printf '%s' "$content" | grep -Eq '"build:prod"|(^|[^[:alnum:]_])tsc([^[:alnum:]_]|$)|vp run lint'; then
printf '%s\n' "$path"
printf '%s\n' "$content" | jq -r '.scripts // {} | to_entries[] | "\(.key)=\(.value)"' 2>/dev/null || true
fi
doneRepository: TypeCellOS/BlockNote Length of output: 2114 🌐 Web query:
💡 Result: In the BlockNote project repository, the build:prod script in various package.json files—including examples/01-basic/03-multi-column/package.json—was removed as part of a migration to Vite+ [1]. Previously, these files contained build scripts (such as build:prod) to manage project builds. However, following the migration to the Vite+ build system, these scripts were moved to tasks defined within the corresponding vite.config.ts files [1]. This change was implemented to improve cache management and avoid overly broad input tracking [1]. If you are looking for how to build these projects in the current repository structure, you should check the tasks defined in the vite.config.ts file for the specific package or example, or use the centralized build commands provided by the project's updated tooling [1][2]. Citations:
🌐 Web query:
💡 Result: The file examples/04-theming/06-code-block/package.json is part of the BlockNote repository [1][2]. In the context of this project, build scripts like "build:prod" are typically defined within package.json files to facilitate the compilation of examples or packages using tools like Vite [3][4]. While the specific contents of "build:prod" can change as the project evolves [2][5], it generally serves as a production-optimized build command. In the BlockNote monorepo, which uses pnpm and Nx [2][6], these scripts often leverage vite build [7][4] to bundle the TypeScript/React code for production deployment. You can view the current definition of this script by navigating directly to the file in the TypeCellOS/BlockNote repository [1]. Citations:
🌐 Web query:
💡 Result: The command vp run lint is not a standard tool for StackBlitz, but rather a specific command used in projects utilizing the Vite+ (or Vite Task) build and task runner system [1][2]. In the context of the BlockNote repository and similar projects, vp is a task runner that integrates with Vite [1]. The command vp run lint triggers a configured linting task—often utilizing oxlint, which is a high-performance, Rust-based linter [1]. When you encounter or use this command: 1. Task Runner: The vp command is part of a custom workspace setup (often involving the voidzero-dev/setup-vp action in CI/CD pipelines) [3][1]. 2. Configuration: The tasks themselves, including lint, are defined within the project's configuration (usually vite.config.ts or associated task definitions) rather than standard package.json scripts [1]. 3. StackBlitz: If you are seeing this in a StackBlitz environment, it is because that specific project is configured to use the Vite+ task system [4]. If the command fails in your specific StackBlitz instance, it likely means the environment is not correctly configured to recognize the vp binary or the task graph is missing dependencies (e.g., needing a build step before linting, as is often the case with type-aware linting) [5][6]. To troubleshoot or run it correctly, ensure you have the necessary project dependencies installed and that the environment supports the Vite+ task runner [1][7]. Citations:
🌐 Web query:
💡 Result: Pull request Citations:
🌐 Web query:
💡 Result: In the TypeCellOS BlockNote repository, pull request Citations:
🌐 Web query:
💡 Result: The path examples/04-theming/07-custom-code-block refers to a specific example directory within the BlockNote repository (TypeCellOS/BlockNote) [1][2]. This example demonstrates how to implement and theme a custom code block in the BlockNote editor, specifically using the Citations:
Replace direct 📍 Affects 4 files
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| "preview": "vite preview" | ||
| }, | ||
| "dependencies": { | ||
| "@blocknote/ariakit": "latest", | ||
|
|
@@ -26,6 +26,6 @@ | |
| "@types/react": "^19.2.3", | ||
| "@types/react-dom": "^19.2.3", | ||
| "@vitejs/plugin-react": "^6.0.1", | ||
| "vite-plus": "^0.1.24" | ||
| "vite": "^8.0.0" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,10 @@ | |
| "private": true, | ||
| "version": "0.12.4", | ||
| "scripts": { | ||
| "start": "vp dev", | ||
| "dev": "vp dev", | ||
| "build:prod": "tsc && vp build", | ||
| "preview": "vp preview" | ||
| "start": "vite", | ||
| "dev": "vite", | ||
| "build:prod": "tsc && vite build", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win Use the prescribed type-check command consistently. The four standalone package scripts invoke
As per coding guidelines, 📍 Affects 4 files
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| "preview": "vite preview" | ||
| }, | ||
| "dependencies": { | ||
| "@blocknote/ariakit": "latest", | ||
|
|
@@ -25,6 +25,6 @@ | |
| "@types/react": "^19.2.3", | ||
| "@types/react-dom": "^19.2.3", | ||
| "@vitejs/plugin-react": "^6.0.1", | ||
| "vite-plus": "^0.1.24" | ||
| "vite": "^8.0.0" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| /// <reference types="vite-plus/client" /> | ||
| /// <reference types="vite/client" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Remove direct
tscusage from the standalone build scripts.The four generated package manifests use
tscfor type-checking. The repository guideline requiresvp run lintand prohibits directtscusage.examples/01-basic/01-minimal/package.json#L10-L10: change the script tovite build.examples/01-basic/02-block-objects/package.json#L10-L10: change the script tovite build.examples/04-theming/03-theming-css/package.json#L10-L10: change the script tovite build.examples/04-theming/04-theming-css-variables/package.json#L10-L10: change the script tovite build.As per coding guidelines, use
vp run lintfor linting and type-checking; do not usetscorprettier.📍 Affects 4 files
examples/01-basic/01-minimal/package.json#L10-L10(this comment)examples/01-basic/02-block-objects/package.json#L10-L10examples/04-theming/03-theming-css/package.json#L10-L10examples/04-theming/04-theming-css-variables/package.json#L10-L10🤖 Prompt for AI Agents
Source: Coding guidelines