feat: migrate to tsgo, fix lint warnings, and fix vp build caching#2859
Conversation
Pass the editor through addThreadToDocument so RESTYjsThreadStore can
compute yjs relative positions from the prosemirror selection, restoring
wire compatibility with the {prosemirror, yjs} selection shape.
Resolve 86 lint warnings reported by vp check: prefix unused variables/params with _, remove unused catch bindings, delete unused imports, convert ternary-as-statement to if/else, add missing JSX keys, fix React hook dependency arrays, wrap handlers in useCallback, and suppress intentional lint exceptions.
Without the output field, vp's cache only replays terminal output on cache hits but does not restore build artifacts to disk. This causes ENOENT errors on Vercel when downstream packages (ariakit, shadcn) try to import style.css from react/dist or core/dist that was never written. Add output: ["dist/**"] to all 14 package build task definitions so that cached builds correctly archive and restore their dist/ directories.
- Replace tsc with tsgo in all package build commands (2x faster declaration emit) - Install @typescript/native-preview (tsgo) and oxlint-tsgolint at workspace root - Enable typeAware: true and typeCheck: true in root lint config, powered by tsgolint - Add root tsconfig.json with project references to all 15 packages for unified type graph - Add vite-env.d.ts to packages with CSS side-effect imports (react, ariakit, mantine, shadcn, xl-ai) and to all 91 example directories - Remove baseUrl from shadcn and docs tsconfigs (removed in TypeScript 7/tsgo) - Fix tsgo-caught type errors: wrong destructuring patterns in ariakit/shadcn/mantine components, implicit any in react vitestSetup, stream.ts Symbol.asyncIterator type, wrong import path for YjsThreadStore in docs - Scope lint ignorePatterns to exclude examples, playground, tests, docs, fumadocs — cuts vp check from ~33s to ~16s by eliminating 91 per-example tsgolint invocations
- Add @blocknote/mantine and @blocknote/server-util to tests/vite.config.ts aliases so all unit tests resolve from source, never needing a dist build - Rebuild stale tsdown-generated dist files (ariakit, mantine, shadcn, xl-ai, xl-ai-server, xl-multi-column) so Next.js serverUtil test can find mantine - Fix TestExecutor type to accept void | Promise<void> — sync test executors are valid but the type was requiring Promise<void>, causing tsgo TS2322 errors
tsgo writes tsconfig.tsbuildinfo to dist/, then vp build clears dist/ and recreates it without the file. On cache replay the tsgo sub-task restores the tsbuildinfo, causing downstream tasks (e.g. playground) to see a new file and miss cache. Excluding it from the output declaration gives 100% cache hits on the second build after a clean.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedToo many files! This PR contains 300 files, which is 150 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (300)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
|
…ages Type-aware oxlint needs compiled type declarations from @blocknote/core (and other packages) to resolve cross-package imports. Moving the build step before lint ensures dist/ exists when the linter runs.
@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: |
setup-vp does not put pnpm on PATH, so the direct pnpm invocations failed with "command not found" (exit 127). vp update and vp dedupe support the same flags and are the correct way to invoke pnpm under vp.
…es dist The playground was missed in 0443605 which added output: ["dist/**"] to all library package build tasks. Without it, vp replays terminal output on cache hits but never restores the actual dist/ files, causing Vercel to fail with "No Output Directory named dist found".
…Vercel The 8GB Vercel build machine defaults to ~1.5GB Node.js heap, which is insufficient for the docs site build (React Compiler + MDX + Shiki).
… build directly The previous build:site pipeline skipped building workspace packages (relying on stale cache) and ran next build through vp which buffered stdout, hiding errors and OOM kills.
Summary
Migrates type declarations from tsc to tsgo, enables type-aware oxlint, fixes all lint warnings across the codebase, includes yjs relative positions in RESTYjsThreadStore wire format, and fixes vp build task caching to achieve 100% cache hits on repeat builds.
Rationale
The tsgo migration improves type-checking speed significantly. Enabling type-aware linting catches more issues at dev time. The build cache fix eliminates wasted rebuilds — previously,
tsconfig.tsbuildinfofiles leaked intodist/via cache replay, causing downstream tasks (especially the playground) to always miss cache.Changes
tsctotsgoacross all packagesoutputfield to vp build tasks so cache restores dist files correctly*.tsbuildinfofrom build taskoutputdeclarations to prevent cache pollutionRESTYjsThreadStorewire formattsconfig.jsonandvite-env.d.tsfiles for tsgo compatibilityImpact
Testing
vp run buildachieves 35/35 cache hits on second run afterpnpm run cleanvp run testpasses across all packagesChecklist