mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-04 18:13:17 +00:00
Root cause: Bun's test runner fails to resolve exports from directory index.ts files during parallel test execution. The api-command/index.ts imports 8 subcommand modules — if any fail to load during concurrent test runs, the entire module fails with "Export not found." Fix: extract createApiCommandHandler into handler.ts (lightweight, only imports named-command-router). Test imports from handler.ts directly, bypassing the heavy index.ts that loads all subcommand modules. Also: - Remove stale api-command.ts barrel file - Use explicit /index import paths in source - Migrate CI validate to self-hosted runner with clean artifact step - Disable Bun cache (no-cache: true) on self-hosted runner
29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import { handleApiCopyCommand } from './copy-command';
|
|
import { handleApiCreateCommand } from './create-command';
|
|
import { handleApiDiscoverCommand } from './discover-command';
|
|
import { handleApiExportCommand } from './export-command';
|
|
import { createApiCommandHandler, type ApiCommandDependencies } from './handler';
|
|
import { showApiCommandHelp, showUnknownApiCommand } from './help';
|
|
import { handleApiImportCommand } from './import-command';
|
|
import { handleApiListCommand } from './list-command';
|
|
import { handleApiRemoveCommand } from './remove-command';
|
|
|
|
export { createApiCommandHandler, type ApiCommandDependencies } from './handler';
|
|
export { parseApiCommandArgs } from './shared';
|
|
|
|
const DEFAULT_API_COMMAND_DEPENDENCIES: ApiCommandDependencies = {
|
|
help: showApiCommandHelp,
|
|
unknown: showUnknownApiCommand,
|
|
create: handleApiCreateCommand,
|
|
list: handleApiListCommand,
|
|
discover: handleApiDiscoverCommand,
|
|
copy: handleApiCopyCommand,
|
|
export: handleApiExportCommand,
|
|
import: handleApiImportCommand,
|
|
remove: handleApiRemoveCommand,
|
|
};
|
|
|
|
export async function handleApiCommand(args: string[]): Promise<void> {
|
|
await createApiCommandHandler(DEFAULT_API_COMMAND_DEPENDENCIES)(args);
|
|
}
|