feat: create tm-core and apps/cli (#1093)
- add typescript - add npm workspaces
This commit is contained in:
39
packages/tm-core/src/parser/index.ts
Normal file
39
packages/tm-core/src/parser/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @fileoverview Task parsing functionality for the tm-core package
|
||||
* This file exports all parsing-related classes and functions
|
||||
*/
|
||||
|
||||
import type { PlaceholderTask } from '../types/index';
|
||||
|
||||
// Parser implementations will be defined here
|
||||
// export * from './prd-parser.js';
|
||||
// export * from './task-parser.js';
|
||||
// export * from './markdown-parser.js';
|
||||
|
||||
// Placeholder exports - these will be implemented in later tasks
|
||||
export interface TaskParser {
|
||||
parse(content: string): Promise<PlaceholderTask[]>;
|
||||
validate(content: string): Promise<boolean>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated This is a placeholder class that will be properly implemented in later tasks
|
||||
*/
|
||||
export class PlaceholderParser implements TaskParser {
|
||||
async parse(content: string): Promise<PlaceholderTask[]> {
|
||||
// Simple placeholder parsing logic
|
||||
const lines = content
|
||||
.split('\n')
|
||||
.filter((line) => line.trim().startsWith('-'));
|
||||
return lines.map((line, index) => ({
|
||||
id: `task-${index + 1}`,
|
||||
title: line.trim().replace(/^-\s*/, ''),
|
||||
status: 'pending' as const,
|
||||
priority: 'medium' as const
|
||||
}));
|
||||
}
|
||||
|
||||
async validate(content: string): Promise<boolean> {
|
||||
return content.trim().length > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user