- C1(critical): Replace tsc build with tsup for dual ESM + CJS output - W2(warning): Change workflowCost to accept TaskGraph instead of TaskGraphInner - S1(suggestion): Add test for bottlenecks empty-graph early return - S2(suggestion): Document dangling-reference detection is unreachable via public API
2.8 KiB
2.8 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| api/public-exports | Wire up public API surface in src/index.ts | completed |
|
narrow | low | project | implementation |
Description
Wire up src/index.ts to re-export the full public API surface. This is the main entry point for consumers: everything they need should be importable from @alkdev/taskgraph.
Acceptance Criteria
src/index.tsre-exports all public API items:TaskGraphclass (fromsrc/graph/index.ts)- All analysis functions:
parallelGroups,criticalPath,weightedCriticalPath,bottlenecks,riskPath,riskDistribution,shouldDecomposeTask,workflowCost,calculateTaskEv - All categorical numeric functions:
scopeCostEstimate,scopeTokenEstimate,riskSuccessProbability,riskWeight,impactWeight,resolveDefaults - All frontmatter functions:
parseFrontmatter,parseTaskFile,parseTaskDirectory,serializeFrontmatter - All schemas and types: all enum schemas,
TaskInput,DependencyEdge,TaskGraphNodeAttributes,TaskGraphEdgeAttributes,TaskGraphSerialized, all result types - All error classes:
TaskgraphError,TaskNotFoundError,CircularDependencyError,InvalidInputError,DuplicateNodeError,DuplicateEdgeError
- No internal implementation details leak through the public API
package.json"exports"field configured for ESM primary + CJS compat- TypeScript declarations (
tsc --emitDeclarationOnly) verify the public surface compiles correctly - Consumer import
import { TaskGraph, workflowCost } from "@alkdev/taskgraph"works
References
- docs/architecture/api-surface.md — full public API
- docs/architecture/build-distribution.md — package name, ESM primary
Notes
To be filled by implementation agent
Summary
Implemented the public API surface in src/index.ts using selective named re-exports instead of wildcard export *, ensuring no internal implementation details leak through.
- Modified:
src/index.ts— rewrote with selective named exports for all public API items - Modified:
src/schema/task.ts— removed internalNullablere-export (kept import for internal use) - Modified:
src/schema/index.ts— switched toexport *(kept as barrel; public API filtering is in src/index.ts) - Modified:
test/schema.test.ts— removed test forNullablere-export from task.ts (no longer exported) - Tests: 590, all passing