Skip to content

Commit c54a786

Browse files
committed
feat: Introduce task management interfaces and validation framework
- Added ITaskFixer interface for automatic task validation fixes. - Introduced ITaskHydrationUseCase and ITaskRenderUseCase for task hydration and rendering operations. - Created ITaskRepository and ITaskStore interfaces for task data management. - Implemented ITaskValidator interface for task validation against business rules. - Added IUIdSupersedeUseCase and IUidRepository interfaces for UID management. - Defined IValidationResult and IValidationResultBuilder for structured validation results. - Introduced OutputFormat, TaskPriority, TaskProviderType, and TaskStatus enums for task categorization. - Created command options types for various task-related commands. - Established a new validation framework using AJV for JSON schema validation. - Refactored validation context and factory to utilize new types and validation logic. - Removed legacy hydrate and renderer utilities in favor of a more modular approach.
1 parent 5152a59 commit c54a786

File tree

100 files changed

+2007
-1148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2007
-1148
lines changed

src/__tests__/task-fixer.test.ts

Lines changed: 0 additions & 136 deletions
This file was deleted.

src/__tests__/validator.test.ts

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/cli/cli.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#!/usr/bin/env node
22
import { Command } from 'commander';
33

4-
import { getLogger } from '../utils/logger';
5-
6-
import { CommandFactory } from './command.factory';
4+
import { getLogger } from '../core/system/logger';
5+
import { CommandFactory } from '../commands/shared/command.factory';
76

87
/**
98
* Main CLI entry point for the Documentation-Driven Development toolkit.
@@ -17,19 +16,19 @@ import { CommandFactory } from './command.factory';
1716
const program = new Command();
1817
program.name('dddctl').description('Documentation-Driven Development CLI').version('1.0.0');
1918

19+
// Create logger for command configuration
20+
const logger = getLogger();
21+
2022
// Configure all commands through the factory
21-
CommandFactory.configureProgram(program);
23+
CommandFactory.configureProgram(program, logger);
2224

2325
// Error handling following clean architecture principles
2426
try {
25-
const logger = getLogger();
2627
logger.debug('CLI start', { argv: process.argv.slice(2) });
2728

2829
// Parse command line arguments and execute the appropriate command
2930
program.parse(process.argv);
3031
} catch (error) {
31-
const logger = getLogger();
32-
3332
// Log domain errors with appropriate level
3433
if (error instanceof Error && 'code' in error) {
3534
logger.error('Domain error occurred', {

src/cli/command.factory.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/commands/add-task.command.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Command } from 'commander';
22

3-
import { ILogger } from '../interfaces/ILogger';
4-
import { getLogger } from '../utils/logger';
5-
import { container, SERVICE_KEYS } from '../utils/container';
3+
import { container, SERVICE_KEYS } from '../../core/system/container';
4+
import { ILogger } from '../../types/ILogger';
65

76
/**
87
* Command for auditing references.
@@ -13,23 +12,22 @@ export class RefAuditCommand {
1312
/**
1413
* Executes the ref audit command.
1514
*/
16-
execute(): Promise<void> {
15+
async execute(): Promise<void> {
1716
this.logger.info('Executing ref audit command');
1817
const svc = container.resolve(SERVICE_KEYS.REFERENCE_AUDIT) as unknown as {
1918
execute(): Promise<unknown>;
2019
};
21-
return svc.execute().then(() => {
22-
console.log('Ref audit command executed');
23-
this.logger.info('Reference audit completed');
24-
});
20+
await svc.execute();
21+
console.log('Ref audit command executed');
22+
this.logger.info('Reference audit completed');
2523
}
2624

27-
static configure(parent: Command): void {
25+
static configure(parent: Command, logger: ILogger): void {
2826
parent
2927
.command('audit')
3028
.description('Audit references across repo & tasks')
3129
.action(async () => {
32-
const cmd = new RefAuditCommand(getLogger());
30+
const cmd = new RefAuditCommand(logger);
3331
await cmd.execute();
3432
});
3533
}

0 commit comments

Comments
 (0)