Skip to content

Commit 6987c5d

Browse files
fix: kirby-types export names
1 parent 6706b5b commit 6987c5d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/module.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ import type { KirbyQueryRequest } from 'kirby-types'
77
import { logger } from './kit'
88
import { prefetchQueries } from './prefetch'
99

10+
const KIRBY_TYPES_PKG_EXPORT_NAMES = [
11+
'KirbyApiResponse',
12+
'KirbyBlock',
13+
'KirbyDefaultBlockType',
14+
'KirbyDefaultBlocks',
15+
'KirbyLayout',
16+
'KirbyLayoutColumn',
17+
'KirbyQuery',
18+
'KirbyQueryChain',
19+
'KirbyQueryModel',
20+
'KirbyQueryRequest',
21+
'KirbyQueryResponse',
22+
'KirbyQuerySchema',
23+
]
24+
1025
export interface ModuleOptions {
1126
/**
1227
* Kirby base URL, like `https://kirby.example.com`
@@ -152,7 +167,6 @@ export default defineNuxtModule<ModuleOptions>({
152167
},
153168
async setup(options, nuxt) {
154169
const moduleName = 'nuxt-kql'
155-
const exportedKirbyTypes = ['KirbyApiResponse', 'KirbyBlock', 'KirbyDefaultBlockType', 'KirbyDefaultBlocks', 'KirbyLayout', 'KirbyLayoutColumn', 'KirbyQuery', 'KirbyQueryChain', 'KirbyQueryModel', 'KirbyQueryRequest', 'KirbyQueryResponse, KirbyQuerySchema']
156170

157171
// Make sure Kirby URL and KQL endpoint are set
158172
if (!options.url)
@@ -248,7 +262,7 @@ export default defineNuxtModule<ModuleOptions>({
248262
getContents() {
249263
return `
250264
// Generated by ${moduleName}
251-
export type { ${exportedKirbyTypes.join(', ')} } from 'kirby-types'
265+
export type { ${KIRBY_TYPES_PKG_EXPORT_NAMES.join(', ')} } from 'kirby-types'
252266
253267
${[...prefetchedQueries.entries()].map(([key, response]) => `
254268
export const ${key} = ${JSON.stringify(response?.result || null, undefined, 2)}

0 commit comments

Comments
 (0)