create-einja-app 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +75 -7
  2. package/dist/cli.js +863 -70
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +1 -1
  5. package/templates/default/.playwright-mcp/dashboard.png +0 -0
  6. package/templates/default/.playwright-mcp/web-home.png +0 -0
  7. package/templates/{turborepo-pandacss → default}/CLAUDE.md +32 -5
  8. package/templates/{turborepo-pandacss → default}/README.md +150 -45
  9. package/templates/default/apps/web/server/presentation/routes/userRoutes.ts +54 -0
  10. package/templates/default/apps/web/src/app/(authenticated)/data/_components/UserTable.tsx +211 -0
  11. package/templates/default/apps/web/src/app/(authenticated)/data/_components/UserTableContainer.tsx +50 -0
  12. package/templates/{turborepo-pandacss → default}/apps/web/src/app/(authenticated)/data/page.tsx +15 -8
  13. package/templates/default/apps/web/src/app/api/rpc/[[...route]]/route.ts +31 -0
  14. package/templates/default/apps/web/src/hooks/api/prefetch-users.ts +63 -0
  15. package/templates/default/apps/web/src/hooks/api/use-users.ts +83 -0
  16. package/templates/default/apps/web/src/lib/api/client.ts +18 -0
  17. package/templates/default/apps/web/src/lib/api/parse-response.ts +114 -0
  18. package/templates/default/apps/web/src/shared/schemas/user.ts +36 -0
  19. package/templates/{turborepo-pandacss → default}/apps/web/tsconfig.json +5 -0
  20. package/templates/{turborepo-pandacss → default}/package.json +7 -2
  21. package/templates/default/packages/server-core/src/domain/validators/user.ts +23 -0
  22. package/templates/{turborepo-pandacss → default}/pnpm-lock.yaml +21 -3
  23. package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/data/_components/UserTable.tsx +0 -203
  24. package/templates/turborepo-pandacss/middleware.ts +0 -32
  25. /package/templates/{turborepo-pandacss → default}/.biomeignore +0 -0
  26. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/biome-format.sh +0 -0
  27. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/design-doc-check.sh +0 -0
  28. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/detect-secrets.sh +0 -0
  29. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/large-file-warning.sh +0 -0
  30. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/playwright-resize.sh +0 -0
  31. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/typecheck.sh +0 -0
  32. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/unset-volta-recursion.sh +0 -0
  33. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/validate-git-commit.sh +0 -0
  34. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/warn-index-ts.sh +0 -0
  35. /package/templates/{turborepo-pandacss → default}/.claude/hooks/einja/warn-relative-import.sh +0 -0
  36. /package/templates/{turborepo-pandacss → default}/.claude/settings.json +0 -0
  37. /package/templates/{turborepo-pandacss → default}/.claude/skills/create-einja-app-release/SKILL.md +0 -0
  38. /package/templates/{turborepo-pandacss → default}/.claude/skills/dev-cli-release/SKILL.md +0 -0
  39. /package/templates/{turborepo-pandacss → default}/.cursor/commands/spec-create.md +0 -0
  40. /package/templates/{turborepo-pandacss → default}/.cursor/commands/start-dev.md +0 -0
  41. /package/templates/{turborepo-pandacss → default}/.cursor/commands/task-exec.md +0 -0
  42. /package/templates/{turborepo-pandacss → default}/.cursor/commands/task-vibe-kanban-loop.md +0 -0
  43. /package/templates/{turborepo-pandacss → default}/.cursor/commands/update-docs-by-task-specs.md +0 -0
  44. /package/templates/{turborepo-pandacss → default}/.cursor/mcp.json +0 -0
  45. /package/templates/{turborepo-pandacss → default}/.cursor/rules/api-rules.mdc +0 -0
  46. /package/templates/{turborepo-pandacss → default}/.cursor/rules/api-test-rules.mdc +0 -0
  47. /package/templates/{turborepo-pandacss → default}/.cursor/rules/base-code.mdc +0 -0
  48. /package/templates/{turborepo-pandacss → default}/.cursor/rules/base-commit-rules.mdc +0 -0
  49. /package/templates/{turborepo-pandacss → default}/.cursor/rules/base-design.mdc +0 -0
  50. /package/templates/{turborepo-pandacss → default}/.cursor/rules/base-rules.mdc +0 -0
  51. /package/templates/{turborepo-pandacss → default}/.cursor/rules/error-handling-rules.mdc +0 -0
  52. /package/templates/{turborepo-pandacss → default}/.cursor/rules/refactor-rules.mdc +0 -0
  53. /package/templates/{turborepo-pandacss → default}/.dockerignore +0 -0
  54. /package/templates/{turborepo-pandacss → default}/.einja-sync.json +0 -0
  55. /package/templates/{turborepo-pandacss → default}/.env.ci +0 -0
  56. /package/templates/{turborepo-pandacss → default}/.env.example +0 -0
  57. /package/templates/{turborepo-pandacss → default}/.env.personal.example +0 -0
  58. /package/templates/{turborepo-pandacss → default}/.envrc +0 -0
  59. /package/templates/{turborepo-pandacss → default}/.gitattributes +0 -0
  60. /package/templates/{turborepo-pandacss → default}/.husky/pre-commit +0 -0
  61. /package/templates/{turborepo-pandacss → default}/.lintstagedrc.js +0 -0
  62. /package/templates/{turborepo-pandacss → default}/.mcp.json +0 -0
  63. /package/templates/{turborepo-pandacss → default}/.node-version +0 -0
  64. /package/templates/{turborepo-pandacss → default}/.templateignore +0 -0
  65. /package/templates/{turborepo-pandacss → default}/.vscode/extensions.json +0 -0
  66. /package/templates/{turborepo-pandacss → default}/apps/web/middleware.ts +0 -0
  67. /package/templates/{turborepo-pandacss → default}/apps/web/next.config.ts +0 -0
  68. /package/templates/{turborepo-pandacss → default}/apps/web/package.json +0 -0
  69. /package/templates/{turborepo-pandacss → default}/apps/web/panda.config.ts +0 -0
  70. /package/templates/{turborepo-pandacss → default}/apps/web/postcss.config.cjs +0 -0
  71. /package/templates/{turborepo-pandacss → default}/apps/web/public/file.svg +0 -0
  72. /package/templates/{turborepo-pandacss → default}/apps/web/public/globe.svg +0 -0
  73. /package/templates/{turborepo-pandacss → default}/apps/web/public/next.svg +0 -0
  74. /package/templates/{turborepo-pandacss → default}/apps/web/public/vercel.svg +0 -0
  75. /package/templates/{turborepo-pandacss → default}/apps/web/public/window.svg +0 -0
  76. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/(authenticated)/dashboard/page.tsx +0 -0
  77. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/(authenticated)/layout-client.tsx +0 -0
  78. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/(authenticated)/layout.tsx +0 -0
  79. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/(authenticated)/profile/page.tsx +0 -0
  80. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/api/auth/[...nextauth]/route.ts +0 -0
  81. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/api/auth/signup/route.ts +0 -0
  82. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/error.tsx +0 -0
  83. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/favicon.ico +0 -0
  84. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/global-error.tsx +0 -0
  85. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/globals.css +0 -0
  86. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/layout.tsx +0 -0
  87. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/not-found.tsx +0 -0
  88. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/page.module.css +0 -0
  89. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/page.test.tsx +0 -0
  90. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/page.tsx +0 -0
  91. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/signin/page.tsx +0 -0
  92. /package/templates/{turborepo-pandacss → default}/apps/web/src/app/signup/page.tsx +0 -0
  93. /package/templates/{turborepo-pandacss → default}/apps/web/src/application/use-cases/UserUseCases.test.ts +0 -0
  94. /package/templates/{turborepo-pandacss → default}/apps/web/src/application/use-cases/UserUseCases.ts +0 -0
  95. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/auth/login-button.tsx +0 -0
  96. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/auth/logout-button.tsx +0 -0
  97. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/auth/user-avatar.test.tsx +0 -0
  98. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/auth/user-avatar.tsx +0 -0
  99. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/dashboard/dashboard-stats.tsx +0 -0
  100. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/providers/query-provider.tsx +0 -0
  101. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/providers/session-provider.tsx +0 -0
  102. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/shared/Sidebar.tsx +0 -0
  103. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/shared/header.tsx +0 -0
  104. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/accordion.tsx +0 -0
  105. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/alert-dialog.tsx +0 -0
  106. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/alert.tsx +0 -0
  107. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/aspect-ratio.tsx +0 -0
  108. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/avatar.tsx +0 -0
  109. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/badge.tsx +0 -0
  110. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/breadcrumb.tsx +0 -0
  111. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/button.tsx +0 -0
  112. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/card.tsx +0 -0
  113. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/checkbox.tsx +0 -0
  114. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/data-table.tsx +0 -0
  115. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/dialog-hook.tsx +0 -0
  116. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/dialog.tsx +0 -0
  117. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/drawer.tsx +0 -0
  118. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/dropdown-menu.tsx +0 -0
  119. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/form.tsx +0 -0
  120. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/hover-card.tsx +0 -0
  121. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/input.tsx +0 -0
  122. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/label.tsx +0 -0
  123. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/pagination.tsx +0 -0
  124. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/popover.tsx +0 -0
  125. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/progress.tsx +0 -0
  126. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/select.tsx +0 -0
  127. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/separator.tsx +0 -0
  128. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/skeleton.tsx +0 -0
  129. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/sonner.tsx +0 -0
  130. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/table.tsx +0 -0
  131. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/tabs.tsx +0 -0
  132. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/textarea.tsx +0 -0
  133. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/tooltip.tsx +0 -0
  134. /package/templates/{turborepo-pandacss → default}/apps/web/src/components/ui/typography.tsx +0 -0
  135. /package/templates/{turborepo-pandacss → default}/apps/web/src/lib/auth/guard.ts +0 -0
  136. /package/templates/{turborepo-pandacss → default}/apps/web/src/lib/auth/index.ts +0 -0
  137. /package/templates/{turborepo-pandacss → default}/apps/web/src/lib/prisma.ts +0 -0
  138. /package/templates/{turborepo-pandacss → default}/apps/web/src/lib/utils.ts +0 -0
  139. /package/templates/{turborepo-pandacss → default}/apps/web/test/globals.d.ts +0 -0
  140. /package/templates/{turborepo-pandacss → default}/apps/web/test/matchers.d.ts +0 -0
  141. /package/templates/{turborepo-pandacss → default}/apps/web/test/setup.ts +0 -0
  142. /package/templates/{turborepo-pandacss → default}/apps/web/vitest.config.ts +0 -0
  143. /package/templates/{turborepo-pandacss → default}/apps/web/vitest.d.ts +0 -0
  144. /package/templates/{turborepo-pandacss → default}/biome.json +0 -0
  145. /package/templates/{turborepo-pandacss → default}/components.json +0 -0
  146. /package/templates/{turborepo-pandacss → default}/docker-compose.yml +0 -0
  147. /package/templates/{turborepo-pandacss → default}/next.config.ts +0 -0
  148. /package/templates/{turborepo-pandacss → default}/package-lock.json +0 -0
  149. /package/templates/{turborepo-pandacss → default}/packages/config/package.json +0 -0
  150. /package/templates/{turborepo-pandacss → default}/packages/config/panda.config.ts +0 -0
  151. /package/templates/{turborepo-pandacss → default}/packages/config/src/index.ts +0 -0
  152. /package/templates/{turborepo-pandacss → default}/packages/config/src/worktree-config-loader.ts +0 -0
  153. /package/templates/{turborepo-pandacss → default}/packages/config/src/worktree-config.ts +0 -0
  154. /package/templates/{turborepo-pandacss → default}/packages/config/tsconfig.build.json +0 -0
  155. /package/templates/{turborepo-pandacss → default}/packages/config/tsconfig.json +0 -0
  156. /package/templates/{turborepo-pandacss → default}/packages/config/typescript/base.json +0 -0
  157. /package/templates/{turborepo-pandacss → default}/packages/front-core/package.json +0 -0
  158. /package/templates/{turborepo-pandacss → default}/packages/front-core/src/auth/config.ts +0 -0
  159. /package/templates/{turborepo-pandacss → default}/packages/front-core/src/auth/index.ts +0 -0
  160. /package/templates/{turborepo-pandacss → default}/packages/front-core/src/auth/types/next-auth.d.ts +0 -0
  161. /package/templates/{turborepo-pandacss → default}/packages/front-core/src/auth/utils.ts +0 -0
  162. /package/templates/{turborepo-pandacss → default}/packages/front-core/src/context/index.ts +0 -0
  163. /package/templates/{turborepo-pandacss → default}/packages/front-core/src/hooks/index.ts +0 -0
  164. /package/templates/{turborepo-pandacss → default}/packages/front-core/src/index.ts +0 -0
  165. /package/templates/{turborepo-pandacss → default}/packages/front-core/src/utils/index.ts +0 -0
  166. /package/templates/{turborepo-pandacss → default}/packages/front-core/tsconfig.json +0 -0
  167. /package/templates/{turborepo-pandacss → default}/packages/server-core/package.json +0 -0
  168. /package/templates/{turborepo-pandacss → default}/packages/server-core/prisma/schema.prisma +0 -0
  169. /package/templates/{turborepo-pandacss → default}/packages/server-core/prisma/seed.ts +0 -0
  170. /package/templates/{turborepo-pandacss → default}/packages/server-core/prisma.config.ts +0 -0
  171. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/__generated__/fabbrica/index.d.ts +0 -0
  172. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/__generated__/fabbrica/index.js +0 -0
  173. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/core/result.test.ts +0 -0
  174. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/core/result.ts +0 -0
  175. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/domain/.gitkeep +0 -0
  176. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/domain/entities/User.test.ts +0 -0
  177. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/domain/entities/User.ts +0 -0
  178. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/domain/repository-interfaces/IUserRepository.ts +0 -0
  179. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/infrastructure/database/client.ts +0 -0
  180. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/infrastructure/database/mappers/UserMapper.test.ts +0 -0
  181. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/infrastructure/database/mappers/UserMapper.ts +0 -0
  182. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/infrastructure/database/repositories/UserRepository.test.ts +0 -0
  183. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/infrastructure/database/repositories/UserRepository.ts +0 -0
  184. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/testing/factories/index.ts +0 -0
  185. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/testing/factories/user.factory.ts +0 -0
  186. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/testing/fixtures/users.ts +0 -0
  187. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/testing/helpers/date.ts +0 -0
  188. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/testing/helpers/password.ts +0 -0
  189. /package/templates/{turborepo-pandacss → default}/packages/server-core/src/testing/index.ts +0 -0
  190. /package/templates/{turborepo-pandacss → default}/packages/server-core/tsconfig.json +0 -0
  191. /package/templates/{turborepo-pandacss → default}/packages/server-core/vitest.config.ts +0 -0
  192. /package/templates/{turborepo-pandacss → default}/packages/ui/package.json +0 -0
  193. /package/templates/{turborepo-pandacss → default}/packages/ui/src/accordion.tsx +0 -0
  194. /package/templates/{turborepo-pandacss → default}/packages/ui/src/alert-dialog.tsx +0 -0
  195. /package/templates/{turborepo-pandacss → default}/packages/ui/src/alert.tsx +0 -0
  196. /package/templates/{turborepo-pandacss → default}/packages/ui/src/aspect-ratio.tsx +0 -0
  197. /package/templates/{turborepo-pandacss → default}/packages/ui/src/avatar.tsx +0 -0
  198. /package/templates/{turborepo-pandacss → default}/packages/ui/src/badge.tsx +0 -0
  199. /package/templates/{turborepo-pandacss → default}/packages/ui/src/breadcrumb.tsx +0 -0
  200. /package/templates/{turborepo-pandacss → default}/packages/ui/src/button.tsx +0 -0
  201. /package/templates/{turborepo-pandacss → default}/packages/ui/src/card.tsx +0 -0
  202. /package/templates/{turborepo-pandacss → default}/packages/ui/src/checkbox.tsx +0 -0
  203. /package/templates/{turborepo-pandacss → default}/packages/ui/src/data-table.tsx +0 -0
  204. /package/templates/{turborepo-pandacss → default}/packages/ui/src/dialog-hook.tsx +0 -0
  205. /package/templates/{turborepo-pandacss → default}/packages/ui/src/dialog.tsx +0 -0
  206. /package/templates/{turborepo-pandacss → default}/packages/ui/src/drawer.tsx +0 -0
  207. /package/templates/{turborepo-pandacss → default}/packages/ui/src/dropdown-menu.tsx +0 -0
  208. /package/templates/{turborepo-pandacss → default}/packages/ui/src/form.tsx +0 -0
  209. /package/templates/{turborepo-pandacss → default}/packages/ui/src/hover-card.tsx +0 -0
  210. /package/templates/{turborepo-pandacss → default}/packages/ui/src/input.tsx +0 -0
  211. /package/templates/{turborepo-pandacss → default}/packages/ui/src/label.tsx +0 -0
  212. /package/templates/{turborepo-pandacss → default}/packages/ui/src/lib/utils.ts +0 -0
  213. /package/templates/{turborepo-pandacss → default}/packages/ui/src/pagination.tsx +0 -0
  214. /package/templates/{turborepo-pandacss → default}/packages/ui/src/popover.tsx +0 -0
  215. /package/templates/{turborepo-pandacss → default}/packages/ui/src/progress.tsx +0 -0
  216. /package/templates/{turborepo-pandacss → default}/packages/ui/src/select.tsx +0 -0
  217. /package/templates/{turborepo-pandacss → default}/packages/ui/src/separator.tsx +0 -0
  218. /package/templates/{turborepo-pandacss → default}/packages/ui/src/skeleton.tsx +0 -0
  219. /package/templates/{turborepo-pandacss → default}/packages/ui/src/sonner.tsx +0 -0
  220. /package/templates/{turborepo-pandacss → default}/packages/ui/src/table.tsx +0 -0
  221. /package/templates/{turborepo-pandacss → default}/packages/ui/src/tabs.tsx +0 -0
  222. /package/templates/{turborepo-pandacss → default}/packages/ui/src/textarea.tsx +0 -0
  223. /package/templates/{turborepo-pandacss → default}/packages/ui/src/tooltip.tsx +0 -0
  224. /package/templates/{turborepo-pandacss → default}/packages/ui/src/typography.tsx +0 -0
  225. /package/templates/{turborepo-pandacss → default}/packages/ui/tsconfig.json +0 -0
  226. /package/templates/{turborepo-pandacss → default}/panda.config.ts +0 -0
  227. /package/templates/{turborepo-pandacss → default}/pnpm-workspace.yaml +0 -0
  228. /package/templates/{turborepo-pandacss → default}/postcss.config.cjs +0 -0
  229. /package/templates/{turborepo-pandacss → default}/prisma/schema.prisma +0 -0
  230. /package/templates/{turborepo-pandacss → default}/public/file.svg +0 -0
  231. /package/templates/{turborepo-pandacss → default}/public/globe.svg +0 -0
  232. /package/templates/{turborepo-pandacss → default}/public/next.svg +0 -0
  233. /package/templates/{turborepo-pandacss → default}/public/vercel.svg +0 -0
  234. /package/templates/{turborepo-pandacss → default}/public/window.svg +0 -0
  235. /package/templates/{turborepo-pandacss → default}/scripts/cli-template-update.ts +0 -0
  236. /package/templates/{turborepo-pandacss → default}/scripts/env-show.ts +0 -0
  237. /package/templates/{turborepo-pandacss → default}/scripts/env.ts +0 -0
  238. /package/templates/{turborepo-pandacss → default}/scripts/init.sh +0 -0
  239. /package/templates/{turborepo-pandacss → default}/scripts/setup-dev.ts +0 -0
  240. /package/templates/{turborepo-pandacss → default}/scripts/template-update.ts +0 -0
  241. /package/templates/{turborepo-pandacss → default}/scripts/worktree/dev.ts +0 -0
  242. /package/templates/{turborepo-pandacss → default}/test/globals.d.ts +0 -0
  243. /package/templates/{turborepo-pandacss → default}/test/setup.ts +0 -0
  244. /package/templates/{turborepo-pandacss → default}/tsconfig.json +0 -0
  245. /package/templates/{turborepo-pandacss → default}/turbo.json +0 -0
  246. /package/templates/{turborepo-pandacss → default}/vitest.config.ts +0 -0
@@ -1,11 +1,20 @@
1
- import { userUseCases } from "@/application/use-cases/UserUseCases";
2
1
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
3
- import { UserTable } from "./_components/UserTable";
2
+ import { prefetchUsers } from "@/hooks/api/prefetch-users";
3
+ import type { PaginatedUserList } from "@/shared/schemas/user";
4
+ import { UserTableContainer } from "./_components/UserTableContainer";
4
5
 
5
6
  export default async function DataPage() {
6
- const result = await userUseCases.list({}, { page: 1, limit: 100 });
7
+ let initialData: PaginatedUserList | undefined;
8
+ let error: string | undefined;
7
9
 
8
- if (!result.isSuccess) {
10
+ const result = await prefetchUsers({ page: 1, limit: 100 });
11
+ if (result === null) {
12
+ error = "データの取得に失敗しました";
13
+ } else {
14
+ initialData = result;
15
+ }
16
+
17
+ if (error) {
9
18
  return (
10
19
  <div className="container mx-auto p-6">
11
20
  <div className="space-y-6">
@@ -22,7 +31,7 @@ export default async function DataPage() {
22
31
  <CardDescription>データの取得中にエラーが発生しました。</CardDescription>
23
32
  </CardHeader>
24
33
  <CardContent>
25
- <p className="text-destructive">{result.error.message}</p>
34
+ <p className="text-destructive">{error}</p>
26
35
  </CardContent>
27
36
  </Card>
28
37
  </div>
@@ -30,8 +39,6 @@ export default async function DataPage() {
30
39
  );
31
40
  }
32
41
 
33
- const { items: users } = result.value;
34
-
35
42
  return (
36
43
  <div className="container mx-auto p-6">
37
44
  <div className="space-y-6">
@@ -48,7 +55,7 @@ export default async function DataPage() {
48
55
  </CardDescription>
49
56
  </CardHeader>
50
57
  <CardContent>
51
- <UserTable users={users} />
58
+ <UserTableContainer initialData={initialData} />
52
59
  </CardContent>
53
60
  </Card>
54
61
  </div>
@@ -0,0 +1,31 @@
1
+ /**
2
+ * route.ts
3
+ *
4
+ * Hono APIエントリーポイント
5
+ * basePath: /api/rpc
6
+ */
7
+
8
+ import { userRoutes } from "@web/server/presentation/routes/userRoutes";
9
+ import { Hono } from "hono";
10
+ import { handle } from "hono/vercel";
11
+
12
+ const app = new Hono().basePath("/api/rpc");
13
+
14
+ /**
15
+ * ルート登録
16
+ */
17
+ const routes = app.route("/users", userRoutes);
18
+
19
+ /**
20
+ * 型エクスポート(Hono Client用)
21
+ */
22
+ export type AppType = typeof routes;
23
+
24
+ /**
25
+ * Next.js App Router統合
26
+ */
27
+ export const GET = handle(app);
28
+ export const POST = handle(app);
29
+ export const PUT = handle(app);
30
+ export const DELETE = handle(app);
31
+ export const PATCH = handle(app);
@@ -0,0 +1,63 @@
1
+ /**
2
+ * prefetch-users.ts
3
+ *
4
+ * Server Component用のユーザーデータプリフェッチ関数
5
+ */
6
+
7
+ import { parseResponse } from "@/lib/api/parse-response";
8
+ import { type PaginatedUserList, paginatedUserListSchema } from "@/shared/schemas/user";
9
+ import { cookies, headers } from "next/headers";
10
+
11
+ /**
12
+ * User filters type
13
+ */
14
+ export interface UserFilters {
15
+ page?: number;
16
+ limit?: number;
17
+ search?: string;
18
+ status?: "active" | "inactive";
19
+ role?: "admin" | "user";
20
+ }
21
+
22
+ /**
23
+ * prefetchUsers
24
+ *
25
+ * Server Component用のデータ取得関数
26
+ */
27
+ export async function prefetchUsers(filters: UserFilters = {}): Promise<PaginatedUserList | null> {
28
+ try {
29
+ // リクエストヘッダーからホスト情報を取得
30
+ const headersList = await headers();
31
+ const host = headersList.get("host") || "localhost:3000";
32
+ const protocol = headersList.get("x-forwarded-proto") || "http";
33
+ const baseUrl = `${protocol}://${host}`;
34
+
35
+ // クッキーを取得して転送
36
+ const cookieStore = await cookies();
37
+ const cookieHeader = cookieStore
38
+ .getAll()
39
+ .map((c) => `${c.name}=${c.value}`)
40
+ .join("; ");
41
+
42
+ const params = new URLSearchParams();
43
+ if (filters.page) params.set("page", String(filters.page));
44
+ if (filters.limit) params.set("limit", String(filters.limit));
45
+ if (filters.search) params.set("search", filters.search);
46
+ if (filters.status) params.set("status", filters.status);
47
+ if (filters.role) params.set("role", filters.role);
48
+
49
+ const url = `${baseUrl}/api/rpc/users?${params.toString()}`;
50
+
51
+ const response = await fetch(url, {
52
+ headers: {
53
+ Cookie: cookieHeader,
54
+ },
55
+ cache: "no-store",
56
+ });
57
+
58
+ return parseResponse(response, paginatedUserListSchema);
59
+ } catch (error) {
60
+ console.error("Failed to prefetch users:", error);
61
+ return null;
62
+ }
63
+ }
@@ -0,0 +1,83 @@
1
+ /**
2
+ * use-users.ts
3
+ *
4
+ * Tanstack Query hooks for user data management
5
+ */
6
+
7
+ "use client";
8
+
9
+ import { apiClient } from "@/lib/api/client";
10
+ import { parseResponse } from "@/lib/api/parse-response";
11
+ import {
12
+ type PaginatedUserList,
13
+ type UserListItem,
14
+ paginatedUserListSchema,
15
+ userListItemSchema,
16
+ } from "@/shared/schemas/user";
17
+ import { useQuery } from "@tanstack/react-query";
18
+
19
+ /**
20
+ * QueryKey factory for users
21
+ */
22
+ export const userKeys = {
23
+ all: ["users"] as const,
24
+ lists: () => [...userKeys.all, "list"] as const,
25
+ list: (filters: UserFilters) => [...userKeys.lists(), filters] as const,
26
+ details: () => [...userKeys.all, "detail"] as const,
27
+ detail: (id: string) => [...userKeys.details(), id] as const,
28
+ };
29
+
30
+ /**
31
+ * User filters type
32
+ */
33
+ export interface UserFilters {
34
+ page?: number;
35
+ limit?: number;
36
+ search?: string;
37
+ status?: "active" | "inactive";
38
+ role?: "admin" | "user";
39
+ }
40
+
41
+ /**
42
+ * useUsers hook
43
+ *
44
+ * ユーザー一覧を取得するhook
45
+ */
46
+ export function useUsers(filters: UserFilters = {}, initialData?: PaginatedUserList) {
47
+ return useQuery({
48
+ queryKey: userKeys.list(filters),
49
+ queryFn: async () => {
50
+ const response = await apiClient.api.rpc.users.$get({
51
+ query: {
52
+ page: filters.page?.toString() ?? "1",
53
+ limit: filters.limit?.toString() ?? "10",
54
+ search: filters.search,
55
+ status: filters.status,
56
+ role: filters.role,
57
+ },
58
+ });
59
+
60
+ return parseResponse(response, paginatedUserListSchema);
61
+ },
62
+ initialData,
63
+ });
64
+ }
65
+
66
+ /**
67
+ * useUser hook
68
+ *
69
+ * 特定のユーザーを取得するhook
70
+ */
71
+ export function useUser(id: string) {
72
+ return useQuery({
73
+ queryKey: userKeys.detail(id),
74
+ queryFn: async () => {
75
+ const response = await apiClient.api.rpc.users[":id"].$get({
76
+ param: { id },
77
+ });
78
+
79
+ return parseResponse(response, userListItemSchema);
80
+ },
81
+ enabled: !!id,
82
+ });
83
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * api-client.ts
3
+ *
4
+ * Hono Client設定
5
+ * 型安全なAPI呼び出しを提供
6
+ */
7
+
8
+ import type { AppType } from "@/app/api/rpc/[[...route]]/route";
9
+ import { hc } from "hono/client";
10
+
11
+ /**
12
+ * Hono Client インスタンス
13
+ *
14
+ * 使用方法:
15
+ * - 一覧取得: apiClient.api.rpc.users.$get({ query: { page: "1", limit: "10" } })
16
+ * - 詳細取得: apiClient.api.rpc.users[":id"].$get({ param: { id: "..." } })
17
+ */
18
+ export const apiClient = hc<AppType>("/");
@@ -0,0 +1,114 @@
1
+ /**
2
+ * parse-response.ts
3
+ *
4
+ * Zodスキーマによるレスポンス検証とエラーハンドリング
5
+ */
6
+
7
+ import type { z } from "zod";
8
+
9
+ /**
10
+ * APIエラークラス
11
+ *
12
+ * APIレスポンスのエラーを表現する
13
+ */
14
+ export class ApiError extends Error {
15
+ constructor(
16
+ public readonly code: string,
17
+ message: string,
18
+ public readonly statusCode: number,
19
+ public readonly details?: Record<string, unknown>
20
+ ) {
21
+ super(message);
22
+ this.name = "ApiError";
23
+ }
24
+ }
25
+
26
+ /**
27
+ * JSONを安全にパースする
28
+ *
29
+ * @param response - Fetchレスポンス
30
+ * @returns パース結果(失敗時は空オブジェクト)
31
+ */
32
+ async function safeJsonParse(response: Response): Promise<unknown> {
33
+ try {
34
+ return await response.json();
35
+ } catch {
36
+ // JSONパースに失敗した場合は空オブジェクトを返す
37
+ return {};
38
+ }
39
+ }
40
+
41
+ /**
42
+ * エラーレスポンスからエラー情報を抽出する
43
+ *
44
+ * バックエンドの形式: { error: string } または { error: { code, message, details } }
45
+ *
46
+ * @param json - パースされたJSON
47
+ * @param statusCode - HTTPステータスコード
48
+ * @returns エラー情報
49
+ */
50
+ function extractErrorInfo(
51
+ json: unknown,
52
+ statusCode: number
53
+ ): { code: string; message: string; details?: Record<string, unknown> } {
54
+ if (typeof json === "object" && json !== null && "error" in json) {
55
+ const errorField = (json as { error: unknown }).error;
56
+
57
+ // { error: string } 形式
58
+ if (typeof errorField === "string") {
59
+ return {
60
+ code: "API_ERROR",
61
+ message: errorField,
62
+ };
63
+ }
64
+
65
+ // { error: { code, message, details } } 形式
66
+ if (typeof errorField === "object" && errorField !== null) {
67
+ const errObj = errorField as {
68
+ code?: string;
69
+ message?: string;
70
+ details?: Record<string, unknown>;
71
+ };
72
+ return {
73
+ code: errObj.code ?? "API_ERROR",
74
+ message: errObj.message ?? "An unknown error occurred",
75
+ details: errObj.details,
76
+ };
77
+ }
78
+ }
79
+
80
+ return {
81
+ code: "UNKNOWN_ERROR",
82
+ message: "An unknown error occurred",
83
+ };
84
+ }
85
+
86
+ /**
87
+ * レスポンスをパースしてZodスキーマで検証
88
+ *
89
+ * @param response - Fetchレスポンス
90
+ * @param schema - Zodスキーマ
91
+ * @returns バリデーション済みのデータ
92
+ * @throws ApiError - レスポンスエラーまたはバリデーションエラー
93
+ */
94
+ export async function parseResponse<T>(response: Response, schema: z.ZodType<T>): Promise<T> {
95
+ // エラーレスポンスの場合
96
+ if (!response.ok) {
97
+ const json = await safeJsonParse(response);
98
+ const errorInfo = extractErrorInfo(json, response.status);
99
+ throw new ApiError(errorInfo.code, errorInfo.message, response.status, errorInfo.details);
100
+ }
101
+
102
+ // 成功レスポンスの場合
103
+ const json = await safeJsonParse(response);
104
+
105
+ // Zodスキーマでバリデーション
106
+ const result = schema.safeParse(json);
107
+ if (!result.success) {
108
+ throw new ApiError("VALIDATION_ERROR", "Response validation failed", response.status, {
109
+ zodErrors: result.error.flatten(),
110
+ });
111
+ }
112
+
113
+ return result.data;
114
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * user.ts
3
+ *
4
+ * ユーザー関連のZodスキーマと型定義
5
+ * APIレスポンスの型検証に使用
6
+ */
7
+
8
+ import { z } from "zod";
9
+
10
+ /**
11
+ * ユーザー一覧アイテムのレスポンススキーマ
12
+ * APIレスポンスの型検証に使用
13
+ */
14
+ export const userListItemSchema = z.object({
15
+ id: z.string(),
16
+ name: z.string(),
17
+ email: z.string(),
18
+ status: z.enum(["active", "inactive", "pending"]),
19
+ role: z.enum(["admin", "user", "moderator"]),
20
+ createdAt: z.string(),
21
+ lastLogin: z.string().nullable(),
22
+ });
23
+
24
+ /**
25
+ * ページネーション付きユーザー一覧のレスポンススキーマ
26
+ */
27
+ export const paginatedUserListSchema = z.object({
28
+ items: z.array(userListItemSchema),
29
+ total: z.number(),
30
+ page: z.number(),
31
+ limit: z.number(),
32
+ totalPages: z.number(),
33
+ });
34
+
35
+ export type UserListItem = z.infer<typeof userListItemSchema>;
36
+ export type PaginatedUserList = z.infer<typeof paginatedUserListSchema>;
@@ -10,6 +10,10 @@
10
10
  "@/*": [
11
11
  "./src/*"
12
12
  ],
13
+ "@web/*": [
14
+ "./src/*",
15
+ "./*"
16
+ ],
13
17
  "@/styled-system/*": [
14
18
  "./styled-system/*"
15
19
  ],
@@ -24,6 +28,7 @@
24
28
  "test/matchers.d.ts",
25
29
  "**/*.ts",
26
30
  "**/*.tsx",
31
+ "server/**/*.ts",
27
32
  ".next/types/**/*.ts",
28
33
  "../../packages/front-core/src/auth/types/**/*.d.ts"
29
34
  ],
@@ -45,12 +45,12 @@
45
45
  "dotenvx": "dotenvx",
46
46
  "env:encrypt": "dotenvx encrypt",
47
47
  "env:show": "tsx scripts/env-show.ts",
48
- "task:loop": "einja task:loop"
48
+ "task:loop": "npx @einja/dev-cli task:loop",
49
+ "einja:sync": "npx @einja/dev-cli sync"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@clack/prompts": "^0.11.0",
52
53
  "@dotenvx/dotenvx": "^1.51.4",
53
- "@einja/dev-cli": "workspace:*",
54
54
  "@types/node": "^25.0.3",
55
55
  "husky": "^9.1.7",
56
56
  "lint-staged": "^16.1.0",
@@ -60,5 +60,10 @@
60
60
  "volta": {
61
61
  "node": "22.16.0",
62
62
  "pnpm": "10.14.0"
63
+ },
64
+ "dependencies": {
65
+ "@hono/zod-validator": "^0.7.6",
66
+ "hono": "^4.11.3",
67
+ "zod": "^4.3.5"
63
68
  }
64
69
  }
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+
3
+ /**
4
+ * ユーザー一覧取得クエリパラメータスキーマ
5
+ */
6
+ export const userListQuerySchema = z.object({
7
+ page: z.string().optional().default("1").transform(Number),
8
+ limit: z.string().optional().default("10").transform(Number),
9
+ search: z.string().optional(),
10
+ status: z.enum(["active", "inactive"]).optional(),
11
+ role: z.enum(["admin", "user"]).optional(),
12
+ });
13
+
14
+ export type UserListQuery = z.infer<typeof userListQuerySchema>;
15
+
16
+ /**
17
+ * ユーザーIDパスパラメータスキーマ
18
+ */
19
+ export const userIdParamSchema = z.object({
20
+ id: z.string().uuid("Invalid user ID format"),
21
+ });
22
+
23
+ export type UserIdParam = z.infer<typeof userIdParamSchema>;
@@ -7,6 +7,16 @@ settings:
7
7
  importers:
8
8
 
9
9
  .:
10
+ dependencies:
11
+ '@hono/zod-validator':
12
+ specifier: ^0.7.6
13
+ version: 0.7.6(hono@4.11.3)(zod@4.3.5)
14
+ hono:
15
+ specifier: ^4.11.3
16
+ version: 4.11.3
17
+ zod:
18
+ specifier: ^4.3.5
19
+ version: 4.3.5
10
20
  devDependencies:
11
21
  '@clack/prompts':
12
22
  specifier: ^0.11.0
@@ -14,9 +24,6 @@ importers:
14
24
  '@dotenvx/dotenvx':
15
25
  specifier: ^1.51.4
16
26
  version: 1.51.4
17
- '@einja/dev-cli':
18
- specifier: workspace:*
19
- version: link:packages/cli
20
27
  '@types/node':
21
28
  specifier: ^25.0.3
22
29
  version: 25.0.3
@@ -1094,6 +1101,12 @@ packages:
1094
1101
  peerDependencies:
1095
1102
  hono: ^4
1096
1103
 
1104
+ '@hono/zod-validator@0.7.6':
1105
+ resolution: {integrity: sha512-Io1B6d011Gj1KknV4rXYz4le5+5EubcWEU/speUjuw9XMMIaP3n78yXLhjd2A3PXaXaUwEAluOiAyLqhBEJgsw==}
1106
+ peerDependencies:
1107
+ hono: '>=3.9.0'
1108
+ zod: ^3.25.0 || ^4.0.0
1109
+
1097
1110
  '@hookform/resolvers@5.2.2':
1098
1111
  resolution: {integrity: sha512-A/IxlMLShx3KjV/HeTcTfaMxdwy690+L/ZADoeaTltLx+CVuzkeVIPuybK3jrRfw7YZnmdKsVVHAlEPIAEUNlA==}
1099
1112
  peerDependencies:
@@ -5205,6 +5218,11 @@ snapshots:
5205
5218
  dependencies:
5206
5219
  hono: 4.11.3
5207
5220
 
5221
+ '@hono/zod-validator@0.7.6(hono@4.11.3)(zod@4.3.5)':
5222
+ dependencies:
5223
+ hono: 4.11.3
5224
+ zod: 4.3.5
5225
+
5208
5226
  '@hookform/resolvers@5.2.2(react-hook-form@7.65.0(react@19.2.0))':
5209
5227
  dependencies:
5210
5228
  '@standard-schema/utils': 0.3.0