work-hub-server/openspec/changes/swap-superstruct-valibot/tasks.md
Nicolas HOARAU 9314e72f3e feat(schema): add shared schema package with Drizzle ORM and Valibot validation
Create @workspace/schema package with Project and Task table definitions, Drizzle relations, Valibot validation schemas (select/insert/update), and wire as workspace dependency in API and Web apps.
2026-06-04 12:46:51 +04:00

26 lines
1 KiB
Markdown

## 1. Dependency swap
- [x] 1.1 Remove `superstruct` from `packages/schema/package.json` dependencies
- [x] 1.2 Add `valibot` to `packages/schema/package.json` dependencies
## 2. Create Valibot schemas
- [x] 2.1 Create `packages/schema/src/valibot.ts` with `createInsertSchema` and `createUpdateSchema` for `projects` and `tasks`
- [x] 2.2 Add `picklist()` refinements for enum fields (`status`, `priority`) using the constant arrays from `drizzle/enums.ts`
- [x] 2.3 Export insert and update schemas as named exports
## 3. Remove old modules
- [x] 3.1 Delete `packages/schema/src/validation/` directory
- [x] 3.2 Delete `packages/schema/src/types/` directory
## 4. Update barrel export
- [x] 4.1 Update `packages/schema/src/index.ts` to export Drizzle tables and Valibot schemas (remove old validation/types exports)
## 5. Verify
- [x] 5.1 Run `pnpm --filter=@workspace/schema build` to confirm compilation
- [x] 5.2 Run `pnpm build` from root to confirm full monorepo integrity
- [x] 5.3 Run `pnpm --filter=api test` to confirm no regressions