From 54c915e23952ea0d7044e5cb409730723f110264 Mon Sep 17 00:00:00 2001 From: Baptiste Leproux Date: Thu, 19 Nov 2026 20:01:41 +0000 Subject: [PATCH] chore(assistant): remove unused highlighter and @shikijs dependencies Amp-Thread-ID: https://ampcode.com/threads/T-01a1f47b-f504-7549-9434-d7c5206cefae --- layer/modules/assistant/README.md | 6 +-- .../runtime/components/AssistantPreStream.vue | 46 ------------------- .../runtime/composables/useHighlighter.ts | 34 -------------- layer/package.json | 5 -- pnpm-lock.yaml | 39 ---------------- 5 files changed, 1 insertion(+), 129 deletions(-) delete mode 100644 layer/modules/assistant/runtime/components/AssistantPreStream.vue delete mode 100644 layer/modules/assistant/runtime/composables/useHighlighter.ts diff --git a/layer/modules/assistant/README.md b/layer/modules/assistant/README.md index 0db02e30c..8114dfc1d 100644 --- a/layer/modules/assistant/README.md +++ b/layer/modules/assistant/README.md @@ -18,7 +18,7 @@ A Nuxt module that provides an AI-powered chat interface using MCP (Model Contex 2. Install the required dependencies: ```bash -pnpm add @ai-sdk/mcp @ai-sdk/vue @ai-sdk/gateway ai shiki shiki-stream +pnpm add @ai-sdk/mcp @ai-sdk/vue @ai-sdk/gateway ai @comark/vue shiki ``` 3. Add the module to your `nuxt.config.ts`: @@ -200,10 +200,6 @@ const { } = useAssistant() ``` -### `useHighlighter` - -Composable for syntax highlighting code blocks with Shiki. - ## Requirements - Nuxt 4.x diff --git a/layer/modules/assistant/runtime/components/AssistantPreStream.vue b/layer/modules/assistant/runtime/components/AssistantPreStream.vue deleted file mode 100644 index 97cb8ac01..000000000 --- a/layer/modules/assistant/runtime/components/AssistantPreStream.vue +++ /dev/null @@ -1,46 +0,0 @@ - - - diff --git a/layer/modules/assistant/runtime/composables/useHighlighter.ts b/layer/modules/assistant/runtime/composables/useHighlighter.ts deleted file mode 100644 index dd973e7a4..000000000 --- a/layer/modules/assistant/runtime/composables/useHighlighter.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { createHighlighterCore } from '@shikijs/core' -import type { HighlighterCore } from '@shikijs/core' -import { createJavaScriptRegexEngine } from '@shikijs/engine-javascript' - -let highlighter: HighlighterCore | null = null -let promise: Promise | null = null - -export const useHighlighter = async () => { - if (!promise) { - promise = createHighlighterCore({ - langs: [ - import('@shikijs/langs/vue'), - import('@shikijs/langs/javascript'), - import('@shikijs/langs/typescript'), - import('@shikijs/langs/css'), - import('@shikijs/langs/html'), - import('@shikijs/langs/json'), - import('@shikijs/langs/yaml'), - import('@shikijs/langs/markdown'), - import('@shikijs/langs/bash'), - ], - themes: [ - import('@shikijs/themes/material-theme-palenight'), - import('@shikijs/themes/material-theme-lighter'), - ], - engine: createJavaScriptRegexEngine(), - }) - } - if (!highlighter) { - highlighter = await promise - } - - return highlighter -} diff --git a/layer/package.json b/layer/package.json index 34b22c0fe..50e8fb080 100644 --- a/layer/package.json +++ b/layer/package.json @@ -43,11 +43,6 @@ "@nuxtjs/mdc": "^0.23.4", "@nuxtjs/robots": "^7.0.2", "@nuxtjs/sitemap": "^9.1.0", - "@shikijs/core": "^4.6.0", - "@shikijs/engine-javascript": "^4.6.0", - "@shikijs/langs": "^4.6.0", - "@shikijs/stream": "^4.6.0", - "@shikijs/themes": "^4.6.0", "@takumi-rs/core": "^2.20.0", "@types/node": ">=18.12.0", "@vueuse/core": "^15.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 04876af07..46e5ed5a1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -315,21 +315,6 @@ importers: '@nuxtjs/sitemap': specifier: ^9.1.0 version: 9.1.0(7bcc82ef88544bd74caf9ca759c75328) - '@shikijs/core': - specifier: ^4.6.0 - version: 4.6.0 - '@shikijs/engine-javascript': - specifier: ^4.6.0 - version: 4.6.0 - '@shikijs/langs': - specifier: ^4.6.0 - version: 4.6.0 - '@shikijs/stream': - specifier: ^4.6.0 - version: 4.6.0(vue@3.5.45(typescript@6.0.3)) - '@shikijs/themes': - specifier: ^4.6.0 - version: 4.6.0 '@takumi-rs/core': specifier: ^2.20.0 version: 2.20.0(csstype@3.2.4) @@ -3057,24 +3042,6 @@ packages: resolution: {integrity: sha512-c54+TQEo9ToqgfL/AU8FpjnV09+GA9Oa7M5ROkkXteZfp5XzpAJGXjjvZQFQioJOwm/w/6Z3lIzQstAkl8coag==} engines: {node: '>=20'} - '@shikijs/stream@4.6.0': - resolution: {integrity: sha512-iJLx6hgvlLBVYwz2G10jenDdloQHML76fHSzz/ErccRhKAKoi+dvb8NjMV+sQMNHWvmMRvIo/iXTfDbuTnp8Ng==} - engines: {node: '>=20'} - peerDependencies: - react: ^19.0.0 - solid-js: ^1.9.0 - svelte: ^5.0.0-0 - vue: ^3.2.0 - peerDependenciesMeta: - react: - optional: true - solid-js: - optional: true - svelte: - optional: true - vue: - optional: true - '@shikijs/themes@4.6.0': resolution: {integrity: sha512-qHAVAs80RiGD+IRuH9G+JPDOEc9A/kHsng4EzCUCwB9bLzW6Z0y9WETh2YyCcADJBmfrIaJ1Jp7KBNP6FHkgtQ==} engines: {node: '>=20'} @@ -12892,12 +12859,6 @@ snapshots: '@shikijs/vscode-textmate': 10.1.0 '@types/hast': 3.0.5 - '@shikijs/stream@4.6.0(vue@3.5.45(typescript@6.0.3))': - dependencies: - '@shikijs/core': 4.6.0 - optionalDependencies: - vue: 3.5.45(typescript@6.0.3) - '@shikijs/themes@4.6.0': dependencies: '@shikijs/types': 4.6.0