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

View File

@@ -0,0 +1 @@
// bottlenecks (graphology betweenness)

View File

@@ -0,0 +1 @@
// calculateTaskEv, workflowCost, computeEffectiveP

View File

@@ -0,0 +1 @@
// criticalPath, weightedCriticalPath

View File

@@ -0,0 +1 @@
// shouldDecomposeTask

1
src/analysis/defaults.ts Normal file
View File

@@ -0,0 +1 @@
// resolveDefaults, enum numeric methods

8
src/analysis/index.ts Normal file
View File

@@ -0,0 +1,8 @@
// Analysis submodule — re-exports
export * from './critical-path.js';
export * from './bottleneck.js';
export * from './risk.js';
export * from './cost-benefit.js';
export * from './decompose.js';
export * from './defaults.js';

1
src/analysis/risk.ts Normal file
View File

@@ -0,0 +1 @@
// riskPath, riskDistribution

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';
}
}

4
src/frontmatter/index.ts Normal file
View File

@@ -0,0 +1,4 @@
// Frontmatter submodule — parse and serialize
export { parseFrontmatter, parseTaskFile, parseTaskDirectory } from './parse.js';
export { serializeFrontmatter } from './serialize.js';

16
src/frontmatter/parse.ts Normal file
View File

@@ -0,0 +1,16 @@
// YAML/frontmatter parsing + typebox validation
export function parseFrontmatter(_input: string): unknown {
// Stub — implementation pending
return {};
}
export function parseTaskFile(_input: string): unknown {
// Stub — implementation pending
return {};
}
export function parseTaskDirectory(_dir: string): unknown[] {
// Stub — implementation pending
return [];
}

View File

@@ -0,0 +1,6 @@
// TaskInput → markdown with frontmatter
export function serializeFrontmatter(_input: unknown): string {
// Stub — implementation pending
return '';
}

View File

@@ -0,0 +1,5 @@
// TaskGraph class construction — fromTasks, fromRecords, fromJSON, incremental building
export class TaskGraph {
// Stub — implementation pending
}

5
src/graph/index.ts Normal file
View File

@@ -0,0 +1,5 @@
// Graph submodule — TaskGraph class and operations
export { TaskGraph } from './construction.js';
export * from './queries.js';
export * from './mutation.js';

1
src/graph/mutation.ts Normal file
View File

@@ -0,0 +1 @@
// Graph mutations — removeTask, removeDependency, updateTask, updateEdgeAttributes

1
src/graph/queries.ts Normal file
View File

@@ -0,0 +1 @@
// Graph queries — hasCycles, findCycles, topologicalOrder, dependencies, dependents

8
src/index.ts Normal file
View File

@@ -0,0 +1,8 @@
// @alkdev/taskgraph — Public API surface
// Re-exports from all submodules
export * from './schema/index.js';
export * from './graph/index.js';
export * from './analysis/index.js';
export * from './frontmatter/index.js';
export * from './error/index.js';

1
src/schema/enums.ts Normal file
View File

@@ -0,0 +1 @@
// Enum definitions: TaskScope, TaskRisk, TaskImpact, TaskLevel, TaskStatus, TaskPriority

1
src/schema/graph.ts Normal file
View File

@@ -0,0 +1 @@
// TaskGraphNodeAttributes, TaskGraphEdgeAttributes, SerializedGraph schemas

6
src/schema/index.ts Normal file
View File

@@ -0,0 +1,6 @@
// Schema submodule — re-exports
export * from './enums.js';
export * from './task.js';
export * from './graph.js';
export * from './results.js';

1
src/schema/results.ts Normal file
View File

@@ -0,0 +1 @@
// RiskPathResult, DecomposeResult, WorkflowCostResult, RiskDistributionResult schemas

1
src/schema/task.ts Normal file
View File

@@ -0,0 +1 @@
// TaskInput, DependencyEdge schemas