mirror of
https://github.com/vercel/streamdown.git
synced 2026-09-19 02:18:37 +08:00
0b80aed583
* Plugin trial * Update docs and tests * Update homepage add new section * Update usage.tsx * Split out CJK plugin * Extract plugins into new packages * Misc fixes * Fix lint / formatting * Fix: The Streamdown component's memo comparison doesn't compare the plugins prop, preventing re-renders when plugins change while other props stay the same Co-authored-by: haydenbleasel <hello@haydenbleasel.com> * Fix: TypeScript type mismatch at line 89 in `index.ts`: the visitor function's `index` parameter is typed as `number | undefined`, but the `visit` function expects `number | null`. The `undefined` type is not assignable to `number | null`. This commit fixes the issue reported at /vercel/path0/packages/streamdown-cjk/index.ts:89 ## TypeScript type incompatibility in visitor callback **What fails:** TypeScript compiler fails during DTS (type definitions) build in `packages/streamdown-cjk/index.ts` at line 89 **How to reproduce:** ```bash cd packages/streamdown-cjk pnpm build ``` **Result:** ``` index.ts(89,3): error TS2769: No overload matches this call. Overload 1 of 2, '(tree: Root, check: "link", visitor: BuildVisitor<Root, "link">, reverse?: boolean | null | undefined): undefined', gave the following error. Argument of type '(node: Link, index: number | null, parent?: Parent) => number | undefined' is not assignable to parameter of type 'BuildVisitor<Root, "link">'. Types of parameters 'index' and 'index' are incompatible. Type 'number | undefined' is not assignable to type 'number | null'. Type 'undefined' is not assignable to type 'number | null'. ``` **Root cause:** The visitor callback function passed to the `visit()` function from `unist-util-visit` was declaring the `index` parameter as `number | null`, but the visitor can also receive `undefined` as the index value. The `BuildVisitor` type signature expects the callback to accept `number | null | undefined` to properly match the library's API. **Fix:** Updated the `index` parameter type annotation on line 89 from `number | null` to `number | null | undefined` to match the actual possible values that the visitor receives and the expected `BuildVisitor` type signature. Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com> Co-authored-by: haydenbleasel <hello@haydenbleasel.com> * Fix tests * Remove CDN paths * Fix tests * More cleanup * Remove shiki from main bundle * Update index.ts * Cleanup test repo * Cleanup website * Delete next-env files * Update .gitignore * Fix lockfile * Upgrade Next and React * Simplify themes * Update test site * Misc fixes * Type fixes * Create perky-cobras-punch.md --------- Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
49 lines
1.3 KiB
JSON
49 lines
1.3 KiB
JSON
{
|
|
"name": "test",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "next dev --port 3001",
|
|
"build": "next build",
|
|
"start": "next start"
|
|
},
|
|
"dependencies": {
|
|
"@ai-sdk/gateway": "^2.0.20",
|
|
"@ai-sdk/react": "^2.0.113",
|
|
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
"@streamdown/cjk": "workspace:*",
|
|
"@streamdown/code": "workspace:*",
|
|
"@streamdown/math": "workspace:*",
|
|
"@streamdown/mermaid": "workspace:*",
|
|
"ai": "^5.0.111",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"cmdk": "^1.1.1",
|
|
"lucide-react": "^0.560.0",
|
|
"next": "^16.1.3",
|
|
"radix-ui": "latest",
|
|
"react": "^19.2.3",
|
|
"react-dom": "^19.2.3",
|
|
"react-markdown": "^10.1.0",
|
|
"rehype-harden": "^1.1.7",
|
|
"rehype-katex": "^7.0.1",
|
|
"rehype-raw": "^7.0.0",
|
|
"remark-cjk-friendly": "^1.2.3",
|
|
"remark-cjk-friendly-gfm-strikethrough": "^1.2.3",
|
|
"remark-gfm": "^4.0.1",
|
|
"remark-math": "^6.0.0",
|
|
"streamdown": "workspace:*",
|
|
"tailwind-merge": "^3.4.0",
|
|
"zod": "^4.1.13"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/postcss": "^4",
|
|
"@types/node": "^25",
|
|
"@types/react": "^19",
|
|
"@types/react-dom": "^19",
|
|
"tailwindcss": "^4",
|
|
"tw-animate-css": "^1.4.0",
|
|
"typescript": "^5"
|
|
}
|
|
}
|