Skip to content

Commit 75b9fab

Browse files
refactor: remove logging of virtual module generation and type generation success messages
1 parent 7218eec commit 75b9fab

File tree

3 files changed

+1
-64
lines changed

3 files changed

+1
-64
lines changed

src/index.ts

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -262,45 +262,7 @@ export default defineNitroModule({
262262
},
263263
})
264264

265-
if (resolvers.length > 0) {
266-
const totalExports = resolvers.reduce((sum, r) => sum + r.imports.length, 0)
267-
268-
// Show breakdown by type for better visibility
269-
const typeCount = {
270-
query: 0,
271-
mutation: 0,
272-
resolver: 0,
273-
type: 0,
274-
subscription: 0,
275-
directive: 0,
276-
}
277-
for (const resolver of resolvers) {
278-
for (const imp of resolver.imports) {
279-
if (imp.type in typeCount) {
280-
typeCount[imp.type as keyof typeof typeCount]++
281-
}
282-
}
283-
}
284-
285-
const breakdown: string[] = []
286-
if (typeCount.query > 0)
287-
breakdown.push(`${typeCount.query} query`)
288-
if (typeCount.mutation > 0)
289-
breakdown.push(`${typeCount.mutation} mutation`)
290-
if (typeCount.resolver > 0)
291-
breakdown.push(`${typeCount.resolver} resolver`)
292-
if (typeCount.type > 0)
293-
breakdown.push(`${typeCount.type} type`)
294-
if (typeCount.subscription > 0)
295-
breakdown.push(`${typeCount.subscription} subscription`)
296-
if (typeCount.directive > 0)
297-
breakdown.push(`${typeCount.directive} directive`)
298-
299-
if (breakdown.length > 0) {
300-
consola.success(`[nitro-graphql] ${totalExports} resolver export(s): ${breakdown.join(', ')}`)
301-
}
302-
}
303-
else {
265+
if (resolvers.length === 0) {
304266
consola.warn('[nitro-graphql] No resolvers found. Check /_nitro/graphql/debug for details.')
305267
}
306268
}
@@ -389,7 +351,6 @@ export default defineNitroModule({
389351
handler: join(runtime, 'debug'),
390352
method: 'get',
391353
})
392-
consola.info('[nitro-graphql] Debug dashboard available at: /_nitro/graphql/debug')
393354
}
394355

395356
// Auto-import utilities

src/rollup.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,6 @@ ${schemaArray.join(',\n')}
117117
];
118118
`
119119

120-
// Log virtual module generation in dev mode
121-
if (app.options.dev) {
122-
app.logger.success(`[nitro-graphql] Generated virtual schema module: ${imports.length} schema(s)`)
123-
}
124-
125120
return code
126121
}
127122
catch (error) {
@@ -203,12 +198,6 @@ export function virtualResolvers(app: Nitro) {
203198

204199
const code = content.join('\n')
205200

206-
// Log virtual module generation in dev mode
207-
if (app.options.dev) {
208-
const totalExports = imports.reduce((sum, r) => sum + r.imports.length, 0)
209-
app.logger.success(`[nitro-graphql] Generated virtual resolver module: ${totalExports} export(s) from ${imports.length} file(s)`)
210-
}
211-
212201
return code
213202
}
214203
catch (error) {
@@ -285,11 +274,6 @@ export function virtualDirectives(app: Nitro) {
285274

286275
const code = content.join('\n')
287276

288-
if (app.options.dev) {
289-
const totalExports = imports.reduce((sum, d) => sum + d.imports.length, 0)
290-
app.logger.success(`[nitro-graphql] Generated virtual directive module: ${totalExports} directive(s) from ${imports.length} file(s)`)
291-
}
292-
293277
return code
294278
}
295279
catch (error) {

src/utils/type-generation.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ export async function serverTypeGeneration(app: Nitro) {
412412
if (serverTypesPath) {
413413
mkdirSync(dirname(serverTypesPath), { recursive: true })
414414
writeFileSync(serverTypesPath, data, 'utf-8')
415-
consola.success(`[nitro-graphql] Generated server types at: ${serverTypesPath}`)
416415
}
417416
}
418417
catch (error) {
@@ -525,7 +524,6 @@ async function generateMainClientTypes(nitro: Nitro) {
525524
if (clientTypesPath) {
526525
mkdirSync(dirname(clientTypesPath), { recursive: true })
527526
writeFileSync(clientTypesPath, types.types, 'utf-8')
528-
consola.success(`[nitro-graphql] Generated client types at: ${clientTypesPath}`)
529527
}
530528

531529
// 2. Generate SDK file
@@ -540,7 +538,6 @@ async function generateMainClientTypes(nitro: Nitro) {
540538
if (sdkPath) {
541539
mkdirSync(dirname(sdkPath), { recursive: true })
542540
writeFileSync(sdkPath, types.sdk, 'utf-8')
543-
consola.success(`[nitro-graphql] Generated SDK at: ${sdkPath}`)
544541
}
545542

546543
// Generate ofetch client for Nuxt framework
@@ -558,7 +555,6 @@ async function generateExternalServicesTypes(nitro: Nitro) {
558555

559556
for (const service of externalServices) {
560557
try {
561-
consola.info(`[graphql:${service.name}] Processing external service`)
562558

563559
// Download and save schema if enabled
564560
await downloadAndSaveSchema(service, nitro.options.buildDir)
@@ -618,7 +614,6 @@ async function generateExternalServicesTypes(nitro: Nitro) {
618614
if (serviceTypesPath) {
619615
mkdirSync(dirname(serviceTypesPath), { recursive: true })
620616
writeFileSync(serviceTypesPath, types.types, 'utf-8')
621-
consola.success(`[graphql:${service.name}] Generated types at: ${serviceTypesPath}`)
622617
}
623618

624619
// 2. Generate external service SDK
@@ -633,15 +628,12 @@ async function generateExternalServicesTypes(nitro: Nitro) {
633628
if (serviceSdkPath) {
634629
mkdirSync(dirname(serviceSdkPath), { recursive: true })
635630
writeFileSync(serviceSdkPath, types.sdk, 'utf-8')
636-
consola.success(`[graphql:${service.name}] Generated SDK at: ${serviceSdkPath}`)
637631
}
638632

639633
// Generate ofetch client for Nuxt framework
640634
if (nitro.options.framework?.name === 'nuxt') {
641635
generateExternalOfetchClient(nitro, service, service.endpoint)
642636
}
643-
644-
consola.success(`[graphql:${service.name}] External service types generated successfully`)
645637
}
646638
catch (error) {
647639
consola.error(`[graphql:${service.name}] External service generation failed:`, error)

0 commit comments

Comments
 (0)