8000 feat: allow customizing the collection id · romhml/compodium@1b75712 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 1b75712

Browse files
committed
feat: allow customizing the collection id
1 parent d7c7827 commit 1b75712

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export default defineNuxtModule<ModuleOptions>({
8484
})
8585

8686
nuxt.options.appConfig.compodium = {
87-
collections: options.collections.map(c => ({ ...c, id: camelCase(c.name), path: appResolver.resolve(c.path) })).concat(libraryCollections),
87+
collections: options.collections.map(c => ({ ...c, id: c.id ?? camelCase(c.name), path: appResolver.resolve(c.path) })).concat(libraryCollections),
8888
matchUIColors: options.extras?.ui?.matchColors
8989
}
9090

src/types.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export type ComponentExample = NuxtComponent & {
4343
}
4444

4545
export type CollectionConfig = {
46+
id?: string
4647
name: string
4748
path: string
4849
icon?: string

0 commit comments

Comments
 (0)
0