Skip to content

Commit

Permalink
feat: optimize twoslash
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackman99 committed Sep 2, 2024
1 parent 8a5d1eb commit d71c8b8
Show file tree
Hide file tree
Showing 23 changed files with 21,940 additions and 626 deletions.
10,183 changes: 10,183 additions & 0 deletions packages/create/template-js/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/create/template-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.1",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@sveltepress/theme-default": "^3.0.0",
"@sveltepress/vite": "^0.34.0",
"@types/node": "^20.11.20",
Expand Down
10,184 changes: 10,184 additions & 0 deletions packages/create/template-ts/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/create/template-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.1",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@sveltepress/theme-default": "^3.0.0",
"@sveltepress/vite": "^0.34.0",
"@types/node": "^20.11.20",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-site-bn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@iconify-json/vscode-icons": "^1.1.36",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.1",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@sveltepress/theme-default": "workspace:*",
"@sveltepress/twoslash": "workspace:*",
"@sveltepress/vite": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-site-zh/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@iconify-json/vscode-icons": "^1.1.36",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.1",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@sveltepress/theme-default": "workspace:*",
"@sveltepress/twoslash": "workspace:*",
"@sveltepress/vite": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@iconify-json/vscode-icons": "^1.1.36",
"@sveltejs/adapter-static": "^3.0.1",
"@sveltejs/kit": "^2.5.1",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@sveltepress/theme-default": "workspace:*",
"@sveltepress/twoslash": "workspace:*",
"@sveltepress/vite": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ console.log('This is shown')
<script>
import { onMount } from 'svelte'
export let message = 'World'
let count = 0
onMount(() => {
Expand All @@ -148,4 +150,7 @@ console.log('This is shown')
<button on:click="{count++}">
Count is: { count }
</button>
<div class="text-6">
Hello, {message}
</div>
```
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ exports[`code import > existing and non-existing file 2`] = `
<span class="line"><span style="color:#998418;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> value</span><span style="color:#999999;--shiki-dark:#C792EA">:</span><span style="color:#AB5959;--shiki-dark:#82AAFF;font-style:inherit;--shiki-dark-font-style:italic"> undefined</span><span style="color:#999999;--shiki-dark:#C792EA">,</span></span>
<span class="line"><span style="color:#999999;--shiki-dark:#C792EA">&#125;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#1E754F;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic">export</span><span style="color:#AB5959;--shiki-dark:#C792EA"> const</span><span style="color:#B07D48;--shiki-dark:#82AAFF;font-style:inherit;--shiki-dark-font-style:italic"> SERVICE_WORKER_PATH</span><span style="color:#999999;--shiki-dark:#C792EA"> =</span><span style="color:#B5695999;--shiki-dark:#D9F5DD"> '</span><span style="color:#B56959;--shiki-dark:#ECC48D">./node_modules/@sveltepress/theme-default/dist/components/pwa/sw.js</span><span style="color:#B5695999;--shiki-dark:#D9F5DD">'</span></span>
<span class="line"><span style="color:#1E754F;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic">export</span><span style="color:#AB5959;--shiki-dark:#C792EA"> const</span><span style="color:#B07D48;--shiki-dark:#82AAFF;font-style:inherit;--shiki-dark-font-style:italic"> SERVICE_WORKER_PATH</span><span style="color:#999999;--shiki-dark:#C792EA"> =</span><span style="color:#B5695977;--shiki-dark:#D9F5DD"> '</span><span style="color:#B56959;--shiki-dark:#ECC48D">./node_modules/@sveltepress/theme-default/dist/components/pwa/sw.js</span><span style="color:#B5695977;--shiki-dark:#D9F5DD">'</span></span>
<span class="line"></span>
<span class="line"><span style="color:#AB5959;--shiki-dark:#C792EA">const</span><span style="color:#59873A;--shiki-dark:#82AAFF;font-style:inherit;--shiki-dark-font-style:italic"> defaultTheme</span><span style="color:#999999;--shiki-dark:#7FDBCA">:</span><span style="color:#2E8F82;--shiki-dark:#FFCB8B;font-style:inherit;--shiki-dark-font-style:italic"> ThemeDefault</span><span style="color:#999999;--shiki-dark:#C792EA"> =</span><span style="color:#B07D48;--shiki-dark:#D7DBE0;font-style:inherit;--shiki-dark-font-style:italic"> options</span><span style="color:#999999;--shiki-dark:#C792EA"> =></span><span style="color:#999999;--shiki-dark:#C792EA"> &#123;</span></span>
<span class="line"><span style="color:#B07D48;--shiki-dark:#D6DEEB;font-style:inherit;--shiki-dark-font-style:italic"> themeOptionsRef</span><span style="color:#999999;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic">.</span><span style="color:#B07D48;--shiki-dark:#BAEBE2;font-style:inherit;--shiki-dark-font-style:italic">value</span><span style="color:#999999;--shiki-dark:#C792EA"> =</span><span style="color:#B07D48;--shiki-dark:#D6DEEB;font-style:inherit;--shiki-dark-font-style:italic"> options</span></span>
<span class="line"></span>
<span class="line"><span style="color:#1E754F;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> return</span><span style="color:#999999;--shiki-dark:#C792EA"> &#123;</span></span>
<span class="line"><span style="color:#998418;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> name</span><span style="color:#999999;--shiki-dark:#C792EA">:</span><span style="color:#B5695999;--shiki-dark:#D9F5DD"> '</span><span style="color:#B56959;--shiki-dark:#ECC48D">@sveltepress/theme-default</span><span style="color:#B5695999;--shiki-dark:#D9F5DD">'</span><span style="color:#999999;--shiki-dark:#C792EA">,</span></span>
<span class="line"><span style="color:#998418;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> globalLayout</span><span style="color:#999999;--shiki-dark:#C792EA">:</span><span style="color:#B5695999;--shiki-dark:#D9F5DD"> '</span><span style="color:#B56959;--shiki-dark:#ECC48D">@sveltepress/theme-default/GlobalLayout.svelte</span><span style="color:#B5695999;--shiki-dark:#D9F5DD">'</span><span style="color:#999999;--shiki-dark:#C792EA">,</span></span>
<span class="line"><span style="color:#998418;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> pageLayout</span><span style="color:#999999;--shiki-dark:#C792EA">:</span><span style="color:#B5695999;--shiki-dark:#D9F5DD"> '</span><span style="color:#B56959;--shiki-dark:#ECC48D">@sveltepress/theme-default/PageLayout.svelte</span><span style="color:#B5695999;--shiki-dark:#D9F5DD">'</span><span style="color:#999999;--shiki-dark:#C792EA">,</span></span>
<span class="line"><span style="color:#998418;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> name</span><span style="color:#999999;--shiki-dark:#C792EA">:</span><span style="color:#B5695977;--shiki-dark:#D9F5DD"> '</span><span style="color:#B56959;--shiki-dark:#ECC48D">@sveltepress/theme-default</span><span style="color:#B5695977;--shiki-dark:#D9F5DD">'</span><span style="color:#999999;--shiki-dark:#C792EA">,</span></span>
<span class="line"><span style="color:#998418;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> globalLayout</span><span style="color:#999999;--shiki-dark:#C792EA">:</span><span style="color:#B5695977;--shiki-dark:#D9F5DD"> '</span><span style="color:#B56959;--shiki-dark:#ECC48D">@sveltepress/theme-default/GlobalLayout.svelte</span><span style="color:#B5695977;--shiki-dark:#D9F5DD">'</span><span style="color:#999999;--shiki-dark:#C792EA">,</span></span>
<span class="line"><span style="color:#998418;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> pageLayout</span><span style="color:#999999;--shiki-dark:#C792EA">:</span><span style="color:#B5695977;--shiki-dark:#D9F5DD"> '</span><span style="color:#B56959;--shiki-dark:#ECC48D">@sveltepress/theme-default/PageLayout.svelte</span><span style="color:#B5695977;--shiki-dark:#D9F5DD">'</span><span style="color:#999999;--shiki-dark:#C792EA">,</span></span>
<span class="line"><span style="color:#59873A;--shiki-dark:#82AAFF;font-style:inherit;--shiki-dark-font-style:italic"> vitePlugins</span><span style="color:#999999;--shiki-dark:#C792EA">:</span><span style="color:#B07D48;--shiki-dark:#D7DBE0;font-style:inherit;--shiki-dark-font-style:italic"> corePlugin</span><span style="color:#999999;--shiki-dark:#C792EA"> =></span><span style="color:#999999;--shiki-dark:#C792EA"> &#123;</span></span>
<span class="line"><span style="color:#AB5959;--shiki-dark:#C792EA"> const</span><span style="color:#B07D48;--shiki-dark:#82AAFF;font-style:inherit;--shiki-dark-font-style:italic"> plugins</span><span style="color:#999999;--shiki-dark:#C792EA"> =</span><span style="color:#999999;--shiki-dark:#D6DEEB"> [</span></span>
<span class="line"><span style="color:#999999;--shiki-dark:#7FDBCA"> ...</span><span style="color:#59873A;--shiki-dark:#82AAFF;font-style:inherit;--shiki-dark-font-style:italic">createPreCorePlugins</span><span style="color:#999999;--shiki-dark:#D6DEEB">(</span><span style="color:#B07D48;--shiki-dark:#D6DEEB;font-style:inherit;--shiki-dark-font-style:italic">options</span><span style="color:#999999;--shiki-dark:#D6DEEB">)</span></span></code></pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`line highlight > single line 1`] = `
<span class="line"><span style="color:#AB5959;--shiki-dark:#C792EA"> let</span><span style="color:#B07D48;--shiki-dark:#D7DBE0"> count</span><span style="color:#999999;--shiki-dark:#C792EA"> =</span><span style="color:#2F798A;--shiki-dark:#F78C6C"> 0</span><span style="color:#393A34;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> </span></span>
<span class="line"><span style="color:#999999;--shiki-dark:#7FDBCA">&#x3C;/</span><span style="color:#1E754F;--shiki-dark:#CAECE6">script</span><span style="color:#999999;--shiki-dark:#7FDBCA">></span></span>
<span class="line"></span>
<span class="line"><span style="color:#999999;--shiki-dark:#7FDBCA">&#x3C;</span><span style="color:#1E754F;--shiki-dark:#CAECE6">button</span><span style="color:#1E754F;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> on</span><span style="color:#999999;--shiki-dark:#7FDBCA">:</span><span style="color:#2E8F82;--shiki-dark:#7FDBCA">click</span><span style="color:#999999;--shiki-dark:#7FDBCA">=</span><span style="color:#B5695999;--shiki-dark:#D9F5DD">"</span><span style="color:#999999;--shiki-dark:#D3423E">&#123;</span><span style="color:#999999;--shiki-dark:#D9F5DD">()</span><span style="color:#999999;--shiki-dark:#C792EA"> =></span><span style="color:#B56959;--shiki-dark:#D6DEEB"> count</span><span style="color:#AB5959;--shiki-dark:#C792EA">++</span><span style="color:#999999;--shiki-dark:#D3423E">&#125;</span><span style="color:#B5695999;--shiki-dark:#D9F5DD">"</span><span style="color:#999999;--shiki-dark:#7FDBCA">></span></span>
<span class="line"><span style="color:#999999;--shiki-dark:#7FDBCA">&#x3C;</span><span style="color:#1E754F;--shiki-dark:#CAECE6">button</span><span style="color:#1E754F;--shiki-dark:#C792EA;font-style:inherit;--shiki-dark-font-style:italic"> on</span><span style="color:#999999;--shiki-dark:#7FDBCA">:</span><span style="color:#2E8F82;--shiki-dark:#7FDBCA">click</span><span style="color:#999999;--shiki-dark:#7FDBCA">=</span><span style="color:#B5695977;--shiki-dark:#D9F5DD">"</span><span style="color:#999999;--shiki-dark:#D3423E">&#123;</span><span style="color:#999999;--shiki-dark:#D9F5DD">()</span><span style="color:#999999;--shiki-dark:#C792EA"> =></span><span style="color:#B56959;--shiki-dark:#D6DEEB"> count</span><span style="color:#AB5959;--shiki-dark:#C792EA">++</span><span style="color:#999999;--shiki-dark:#D3423E">&#125;</span><span style="color:#B5695977;--shiki-dark:#D9F5DD">"</span><span style="color:#999999;--shiki-dark:#7FDBCA">></span></span>
<span class="line"><span style="color:#393A34;--shiki-dark:#D6DEEB"> You've clicked </span><span style="color:#999999;--shiki-dark:#D3423E">&#123;</span><span style="color:#B07D48;--shiki-dark:#D6DEEB">count</span><span style="color:#999999;--shiki-dark:#D3423E">&#125;</span><span style="color:#393A34;--shiki-dark:#D6DEEB"> times.</span></span>
<span class="line"><span style="color:#999999;--shiki-dark:#7FDBCA">&#x3C;/</span><span style="color:#1E754F;--shiki-dark:#CAECE6">button</span><span style="color:#999999;--shiki-dark:#7FDBCA">></span></span>
<span class="line"></span></code></pre>
Expand Down
Loading

0 comments on commit d71c8b8

Please sign in to comment.