Files
flowgraph/tasks/setup-project-init.md

50 lines
2.4 KiB
Markdown

---
id: setup/project-init
name: Initialize project with package.json, tsconfig, build tooling, and source skeleton
status: completed
depends_on: []
scope: moderate
risk: low
impact: project
level: implementation
---
## Description
Set up the TypeScript project from scratch. The repo currently has only `AGENTS.md` and `docs/`. Initialize everything needed for a pure TypeScript ESM library targeting DAG-based workflow orchestration.
Per [build-distribution.md](../docs/architecture/build-distribution.md):
- Package name: `@alkdev/flowgraph`
- ESM primary, CJS compat via tsup
- Targets: Node 18+, Deno, Bun, Browser (pure JS, no native addons)
- Build: `tsup` for ESM + CJS + declarations
- Dependencies: `graphology`, `graphology-dag`, `@alkdev/typebox`, `@alkdev/ujsx`, `@preact/signals-core`
- Peer dependencies: `@alkdev/operations`
## Acceptance Criteria
- [ ] `package.json` exists with name `@alkdev/flowgraph`, ESM primary (`"type": "module"`), full exports map per build-distribution spec
- [ ] All production dependencies listed: `graphology`, `graphology-dag`, `@alkdev/typebox`, `@alkdev/ujsx`, `@preact/signals-core`
- [ ] Peer dependency: `@alkdev/operations`
- [ ] Dev dependencies include: `typescript`, `vitest`, `@vitest/coverage-v8`, `tsup`, `@types/node`
- [ ] `tsconfig.json` configured for ES2022 target, Node16 module resolution, strict mode with `noUncheckedIndexedAccess`, `noUnusedLocals`, `noUnusedParameters`, `noFallthroughCasesInSwitch`, `erasableSyntaxOnly`
- [ ] `tsup.config.ts` with named entry points matching exports map (index, component/index, host/index, schema/index, graph/index, reactive/index, analysis/index, error/index)
- [ ] `vitest.config.ts` with `@` alias, globals, V8 coverage
- [ ] `.gitignore` covers `node_modules/`, `dist/`, `*.js.map`
- [ ] `src/` directory skeleton created per build-distribution spec with all module directories and empty index.ts barrel files
- [ ] `test/` directory with placeholder test files per module structure
- [ ] `npm install` succeeds without errors
- [ ] `npx tsc --noEmit` succeeds (empty source files, but config is valid)
- [ ] `npm run build` succeeds via tsup (produces dist/ output with ESM + CJS + .d.ts)
## References
- docs/architecture/build-distribution.md — project structure, dependencies, exports map, tsup config, tsconfig, vitest config
## Notes
> To be filled by implementation agent
## Summary
> To be filled on completion