Skip to content
Open
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
11 changes: 10 additions & 1 deletion typescript/packages/cli/src/commands/generate-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import {
createHeader,
createSuccessBox,
NitroSpinner,
spacer
spacer,
showFooter
} from '../ui/branding.js';
import { trackEvent, shutdownAnalytics } from '../analytics/posthog.js';

/**
* Generates TypeScript types from tool definitions
Expand All @@ -24,6 +26,8 @@ export async function generateTypes(options: { output?: string; } = {}) {

if (toolFiles.length === 0) {
spinner.fail('No tool files found');
trackEvent('cli_generate_failed', { component_type: 'types', error: 'No tool files found' });
await shutdownAnalytics();
return;
}

Expand All @@ -47,6 +51,11 @@ export async function generateTypes(options: { output?: string; } = {}) {
`Location: ${path.relative(projectRoot, outputPath)}`,
`Count: ${toolFiles.length} tools processed`
]));

showFooter();

trackEvent('cli_generate_completed', { component_type: 'types', files_processed: toolFiles.length });
await shutdownAnalytics();
}

async function findToolFiles(dir: string): Promise<string[]> {
Expand Down