Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ export default defineAppConfig({
'next.config.ts': 'i-simple-icons-nextjs',
astro: 'i-simple-icons:astro',
nitro: 'i-unjs-nitro',
md: 'i-custom-comark',
mdc: 'i-custom-comark',
md: 'i-comark-logo',
mdc: 'i-comark-logo',
react: 'i-logos-react',
html: 'i-vscode-icons-file-type-html',
svelte: 'i-logos-svelte-icon',
Expand Down
File renamed without changes
2 changes: 1 addition & 1 deletion app/components/content/landing/LandingHeroDemo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const plugins = [rangi({ theme: geistTheme })]
const sourceAsCode = computed(() => ['````md', props.source, '````'].join('\n'))

const tabs = [
{ id: 'source', label: 'source.md', icon: 'i-custom-comark' },
{ id: 'source', label: 'source.md', icon: 'i-comark-logo' },
{ id: 'output', label: 'preview', icon: 'i-lucide-eye' },
]
const activeIndex = ref(0)
Expand Down
9 changes: 0 additions & 9 deletions app/plugins/icons.ts

This file was deleted.

4 changes: 4 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ export default defineNuxtConfig({
provider: 'server',
fallbackToApi: 'client-only',
serverBundle: { collections: LAYER_ICON_COLLECTIONS },
// The layer's own SVGs, used as `i-comark-<file name>`. Registered at build time so the server bundle and
// SSR know them: a runtime `addIcon()` only reaches the `@iconify/vue` copy it was imported from, which is
// not the one `@nuxt/icon` renders with when a consumer installs two versions.
customCollections: [{ prefix: 'comark', dir: resolve('./app/assets/icons') }],
clientBundle: { scan: true },
},
vite: {
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"@iconify-json/simple-icons": "^1.2.101",
"@iconify-json/unjs": "^1.2.4",
"@iconify-json/vscode-icons": "^1.2.96",
"@iconify/vue": "^5.0.5",
"@nuxt/kit": "^4.6.4",
"@nuxt/ui": "^4.12.0",
"@nuxtjs/mcp-toolkit": "^0.24.3",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions test/e2e/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,13 @@ describe('agent routes', () => {
expect(response.headers.get('content-type')).toContain('text/markdown')
})
})

describe('icons', () => {
// The icon of `md` code blocks is the layer's own SVG, not an Iconify collection. @nuxt/icon caches the
// JSON error of a missing icon and then answers 200 with it, so the body is what shows it is served.
it('serves the comark logo from the server bundle', async () => {
const response = await fetchPath('/api/_nuxt_icon/comark.json?icons=logo')
const collection = await response.json() as { icons?: Record<string, { body: string }> }
expect(collection.icons?.logo?.body).toContain('<path')
})
})
Loading