开发者工具验证于 2026年11月5日
Typed Next.js app with tests
A Next.js App Router app with Tailwind styling, Zod-validated inputs and Vitest unit tests.
作者:Promptu
最终成果
A working Next.js app where every input is validated with Zod and core logic has Vitest tests. The two prompts draft the Zod schemas from sample JSON and the first unit tests.
搭建顺序
- 1
- 2技术StylingTailwind CSS
Utility-first CSS framework. Style directly in markup and ship only the classes you use.
- 3技术ValidationZod
TypeScript-first schema validation with static type inference. Validate API input once and get types for free.
npm install zod
- 4提示词Draft the schemasZod schema from a JSON example
- 5技术TestingVitest
Fast, Vite-native unit test framework with a Jest-compatible API.
npm install -D vitest
- 6提示词Draft the first testsUnit tests for a pure function (no mocks)
运行命令前请先检查。Promptu 绝不会在你的设备上运行代码。

