Skip to content

Commit

Permalink
feat: shiki (#303)
Browse files Browse the repository at this point in the history
* shiki init

Signed-off-by: Innei <i@innei.in>

* update

Signed-off-by: Innei <i@innei.in>

* feat: transformer

Signed-off-by: Innei <i@innei.in>

* update

Signed-off-by: Innei <i@innei.in>

* update

Signed-off-by: Innei <i@innei.in>

* update

Signed-off-by: Innei <i@innei.in>

---------

Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei authored Mar 3, 2024
1 parent d8ba333 commit 207658f
Show file tree
Hide file tree
Showing 22 changed files with 1,264 additions and 704 deletions.
38 changes: 20 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"prod:reload": "pm2 reload ecosystem.config.js"
},
"dependencies": {
"@aws-sdk/client-s3": "3.523.0",
"@clerk/nextjs": "4.29.8",
"@aws-sdk/client-s3": "3.525.0",
"@clerk/nextjs": "4.29.9",
"@excalidraw/excalidraw": "0.17.3",
"@floating-ui/react-dom": "2.0.8",
"@milkdown/core": "7.3.5",
Expand All @@ -62,24 +62,25 @@
"@radix-ui/react-select": "2.0.0",
"@radix-ui/react-switch": "1.0.3",
"@radix-ui/react-tabs": "1.0.4",
"@tanstack/query-async-storage-persister": "5.24.1",
"@tanstack/react-query": "5.24.1",
"@tanstack/react-query-devtools": "5.24.1",
"@tanstack/react-query-persist-client": "5.24.1",
"@shikijs/transformers": "1.1.7",
"@tanstack/query-async-storage-persister": "5.24.2",
"@tanstack/react-query": "5.24.2",
"@tanstack/react-query-devtools": "5.24.2",
"@tanstack/react-query-persist-client": "5.24.2",
"@upstash/redis": "1.28.4",
"@vercel/analytics": "1.2.2",
"@vercel/postgres": "0.7.2",
"axios": "1.6.7",
"bypass-vue-devtools": "0.0.6",
"clsx": "2.1.0",
"colorjs.io": "^0.4.5",
"crossbell": "1.11.3",
"colorjs.io": "^0.5.0",
"crossbell": "1.11.7",
"daisyui": "4.7.2",
"dayjs": "1.11.10",
"emoji-mart": "5.5.2",
"emoji-picker-react": "4.8.0",
"foxact": "0.2.31",
"framer-motion": "^11.0.6",
"framer-motion": "^11.0.8",
"fuse.js": "7.0.0",
"idb-keyval": "6.2.1",
"immer": "^10.0.3",
Expand All @@ -94,15 +95,15 @@
"marked": "12.0.0",
"medium-zoom": "1.1.0",
"mermaid": "10.8.0",
"nanoid": "*",
"next": "14.1.0",
"nanoid": "^5.0.6",
"next": "14.1.1",
"next-themes": "0.2.1",
"openai": "4.28.0",
"openai": "4.28.4",
"pngjs": "7.0.0",
"qrcode.react": "3.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-error-boundary": "4.0.12",
"react-error-boundary": "4.0.13",
"react-intersection-observer": "9.8.1",
"react-responsive-masonry": "2.2.0",
"react-toastify": "10.0.4",
Expand All @@ -117,7 +118,7 @@
"unified": "^11.0.4",
"uniqolor": "1.1.1",
"unist-util-visit": "5.0.0",
"use-context-selector": "1.4.1",
"use-context-selector": "1.4.2",
"vaul": "0.9.0",
"xss": "1.0.14"
},
Expand All @@ -128,19 +129,19 @@
"@innei/eslint-config-react-ts": "0.12.2",
"@innei/prettier": "0.12.2",
"@mx-space/webhook": "0.2.4",
"@next/bundle-analyzer": "14.1.0",
"@next/bundle-analyzer": "14.1.1",
"@tailwindcss/container-queries": "0.1.1",
"@tailwindcss/typography": "0.5.10",
"@types/js-cookie": "3.0.6",
"@types/js-yaml": "4.0.9",
"@types/markdown-escape": "1.1.3",
"@types/node": "20.11.21",
"@types/node": "20.11.24",
"@types/pngjs": "6.0.4",
"@types/react": "18.2.60",
"@types/react": "18.2.61",
"@types/react-dom": "18.2.19",
"@types/react-responsive-masonry": "2.1.3",
"@types/remove-markdown": "0.3.4",
"autoprefixer": "10.4.17",
"autoprefixer": "10.4.18",
"cross-env": "7.0.3",
"dotenv": "16.4.5",
"eslint": "8.57.0",
Expand All @@ -152,6 +153,7 @@
"postcss-prune-var": "1.1.1",
"prettier": "3.2.5",
"rimraf": "5.0.5",
"shiki": "1.1.7",
"simple-git-hooks": "2.9.0",
"tailwind-scrollbar": "3.1.0",
"tailwind-variants": "0.2.0",
Expand Down
Loading

3 comments on commit 207658f

@zhuozhiyongde
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

大佬太强辣!

@zhuozhiyongde
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

问题:Shiki 似乎加载缓慢/需要手动触发(控制台搜Shiki??),似乎还有原先的渲染:

@Innei

image

@zhuozhiyongde
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外还有一些细节问题:

  1. 展开后无法收起
  2. span 子节点 overflow 了,但是父节点没有 fit-width,不知道是不是 shiki 本身的问题,这会导致代码块在右侧没有 padding:

image

Please sign in to comment.