-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest-modules.ts
More file actions
59 lines (50 loc) · 1.85 KB
/
test-modules.ts
File metadata and controls
59 lines (50 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env bun
import { appModule } from './src/modules/app-module';
import { bundleModule } from './src/modules/bundle-module';
import { packageModule } from './src/modules/package-module';
import { userModule } from './src/modules/user-module';
import { versionModule } from './src/modules/version-module';
import type { CLIModule } from './src/types';
function printModuleInfo(title: string, module: CLIModule): number {
const commandCount = module.commands?.length ?? 0;
const workflows = module.workflows ?? [];
console.log(`=== ${title} ===`);
console.log(`Commands: ${commandCount}`);
console.log(`Workflows: ${workflows.length}`);
for (const workflow of workflows) {
console.log(
` - ${workflow.name}: ${workflow.description ?? 'No description'}`,
);
console.log(` Steps: ${workflow.steps.length}`);
}
console.log('');
return workflows.length;
}
function main(): void {
console.log('Testing module workflows...\n');
const modules: Array<{ title: string; module: CLIModule }> = [
{ title: 'App Module', module: appModule },
{ title: 'Bundle Module', module: bundleModule },
{ title: 'Package Module', module: packageModule },
{ title: 'Version Module', module: versionModule },
{ title: 'User Module', module: userModule },
];
let totalWorkflows = 0;
for (const item of modules) {
totalWorkflows += printModuleInfo(item.title, item.module);
}
console.log('All modules loaded successfully with enhanced workflows.');
console.log('\nSummary:');
console.log(` Total workflows: ${totalWorkflows}`);
console.log(` Enhanced modules: ${modules.length}/${modules.length}`);
}
try {
main();
} catch (error: unknown) {
if (error instanceof Error) {
console.error('Error testing modules:', error.message);
} else {
console.error('Error testing modules:', error);
}
process.exit(1);
}