feat(setup/project-init): initialize TypeScript ESM project skeleton

- package.json with @alkdev/taskgraph, ESM primary, CJS compat exports
- tsconfig.json targeting Node 18+, strict mode, declaration output
- All production deps: graphology suite, @alkdev/typebox, yaml
- Dev deps: typescript, vitest, @types/node
- src/ skeleton: schema, graph, analysis, frontmatter, error modules
- test/ directory with 5 placeholder test files
- .gitignore and vitest.config.ts
This commit is contained in:
2026-04-27 09:54:01 +00:00
parent 131e3e929b
commit bd8a7b06d0
32 changed files with 2125 additions and 12 deletions

44
src/error/index.ts Normal file
View File

@@ -0,0 +1,44 @@
// Error classes — TaskgraphError, TaskNotFoundError, CircularDependencyError,
// InvalidInputError, DuplicateNodeError, DuplicateEdgeError
export class TaskgraphError extends Error {
constructor(message: string) {
super(message);
this.name = 'TaskgraphError';
}
}
export class TaskNotFoundError extends TaskgraphError {
constructor(taskId: string) {
super(`Task not found: ${taskId}`);
this.name = 'TaskNotFoundError';
}
}
export class CircularDependencyError extends TaskgraphError {
constructor(cycle: string[]) {
super(`Circular dependency detected: ${cycle.join(' → ')}`);
this.name = 'CircularDependencyError';
}
}
export class InvalidInputError extends TaskgraphError {
constructor(message: string) {
super(message);
this.name = 'InvalidInputError';
}
}
export class DuplicateNodeError extends TaskgraphError {
constructor(nodeId: string) {
super(`Duplicate node: ${nodeId}`);
this.name = 'DuplicateNodeError';
}
}
export class DuplicateEdgeError extends TaskgraphError {
constructor(source: string, target: string) {
super(`Duplicate edge: ${source}${target}`);
this.name = 'DuplicateEdgeError';
}
}