@oyolincc/create 0.0.0-dev-20260513110237 → 0.0.0-dev-20260918103756

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 (419) hide show
  1. package/dist/index.d.mts +2 -2
  2. package/dist/index.mjs +2 -2
  3. package/dist/index.mjs.map +1 -1
  4. package/package.json +35 -17
  5. package/templates/hono-fullstack/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
  6. package/templates/hono-fullstack/.agents/skills/ask-matt/SKILL.md +90 -0
  7. package/templates/hono-fullstack/.agents/skills/ask-matt/agents/openai.yaml +5 -0
  8. package/templates/hono-fullstack/.agents/skills/code-review/SKILL.md +87 -0
  9. package/templates/hono-fullstack/.agents/skills/code-review/agents/openai.yaml +3 -0
  10. package/templates/hono-fullstack/.agents/skills/codebase-design/DEEPENING.md +37 -0
  11. package/templates/hono-fullstack/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  12. package/templates/hono-fullstack/.agents/skills/codebase-design/SKILL.md +114 -0
  13. package/templates/hono-fullstack/.agents/skills/codebase-design/agents/openai.yaml +3 -0
  14. package/templates/hono-fullstack/.agents/skills/confirm-requirements/SKILL.md +25 -0
  15. package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
  16. package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  17. package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  18. package/templates/hono-fullstack/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  19. package/templates/hono-fullstack/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  20. package/templates/hono-fullstack/.agents/skills/domain-modeling/SKILL.md +74 -0
  21. package/templates/hono-fullstack/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
  22. package/templates/hono-fullstack/.agents/skills/grill-me/SKILL.md +7 -0
  23. package/templates/hono-fullstack/.agents/skills/grill-me/agents/openai.yaml +5 -0
  24. package/templates/hono-fullstack/.agents/skills/grilling/SKILL.md +22 -0
  25. package/templates/hono-fullstack/.agents/skills/grilling/agents/openai.yaml +3 -0
  26. package/templates/hono-fullstack/.agents/skills/implement/SKILL.md +15 -0
  27. package/templates/hono-fullstack/.agents/skills/implement/agents/openai.yaml +5 -0
  28. package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  29. package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
  30. package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  31. package/templates/hono-fullstack/.agents/skills/prototype/LOGIC.md +67 -0
  32. package/templates/hono-fullstack/.agents/skills/prototype/SKILL.md +26 -0
  33. package/templates/hono-fullstack/.agents/skills/prototype/UI.md +112 -0
  34. package/templates/hono-fullstack/.agents/skills/prototype/agents/openai.yaml +3 -0
  35. package/templates/hono-fullstack/.agents/skills/research/SKILL.md +12 -0
  36. package/templates/hono-fullstack/.agents/skills/research/agents/openai.yaml +3 -0
  37. package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  38. package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
  39. package/templates/hono-fullstack/.agents/skills/scoped-code-review/SKILL.md +113 -0
  40. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  41. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  42. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  43. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  44. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  45. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  46. package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  47. package/templates/hono-fullstack/.agents/skills/tdd/SKILL.md +38 -0
  48. package/templates/hono-fullstack/.agents/skills/tdd/agents/openai.yaml +3 -0
  49. package/templates/hono-fullstack/.agents/skills/tdd/mocking.md +59 -0
  50. package/templates/hono-fullstack/.agents/skills/tdd/tests.md +77 -0
  51. package/templates/hono-fullstack/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
  52. package/templates/hono-fullstack/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  53. package/templates/hono-fullstack/.agents/skills/teach/MISSION-FORMAT.md +31 -0
  54. package/templates/hono-fullstack/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
  55. package/templates/hono-fullstack/.agents/skills/teach/SKILL.md +140 -0
  56. package/templates/hono-fullstack/.agents/skills/teach/agents/openai.yaml +5 -0
  57. package/templates/hono-fullstack/.agents/skills/to-questionnaire/SKILL.md +53 -0
  58. package/templates/hono-fullstack/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
  59. package/templates/hono-fullstack/.agents/skills/triage/AGENT-BRIEF.md +207 -0
  60. package/templates/hono-fullstack/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
  61. package/templates/hono-fullstack/.agents/skills/triage/SKILL.md +112 -0
  62. package/templates/hono-fullstack/.agents/skills/triage/agents/openai.yaml +5 -0
  63. package/templates/hono-fullstack/.agents/skills/wait-what/SKILL.md +7 -0
  64. package/templates/hono-fullstack/.agents/skills/wait-what/agents/openai.yaml +5 -0
  65. package/templates/hono-fullstack/.agents/skills/wayfinder/SKILL.md +128 -0
  66. package/templates/hono-fullstack/.agents/skills/wayfinder/agents/openai.yaml +5 -0
  67. package/templates/hono-fullstack/.agents/skills/wizard/SKILL.md +44 -0
  68. package/templates/hono-fullstack/.agents/skills/wizard/agents/openai.yaml +3 -0
  69. package/templates/hono-fullstack/.agents/skills/wizard/template.sh +204 -0
  70. package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  71. package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL.md +81 -0
  72. package/templates/hono-fullstack/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
  73. package/templates/hono-fullstack/.changeset/README.md +8 -0
  74. package/templates/hono-fullstack/.changeset/config.json +11 -0
  75. package/templates/hono-fullstack/.vscode/extensions.json +5 -0
  76. package/templates/hono-fullstack/.vscode/launch.json +25 -0
  77. package/templates/hono-fullstack/.vscode/settings.json +24 -0
  78. package/templates/hono-fullstack/AGENTS.md +43 -0
  79. package/templates/hono-fullstack/README.md +37 -0
  80. package/templates/hono-fullstack/_gitignore +30 -0
  81. package/templates/hono-fullstack/apps/server/package.json +56 -0
  82. package/templates/hono-fullstack/apps/server/src/adapters/nodejs/bootstrap.ts +64 -0
  83. package/templates/hono-fullstack/apps/server/src/adapters/nodejs/config.ts +53 -0
  84. package/templates/hono-fullstack/apps/server/src/adapters/nodejs/entry.ts +47 -0
  85. package/templates/hono-fullstack/apps/server/src/app.test.ts +52 -0
  86. package/templates/hono-fullstack/apps/server/src/app.ts +45 -0
  87. package/templates/hono-fullstack/apps/server/src/infra/logger/getter.ts +74 -0
  88. package/templates/hono-fullstack/apps/server/src/infra/logger/pino.ts +122 -0
  89. package/templates/hono-fullstack/apps/server/src/infra/work-runner/constants.ts +23 -0
  90. package/templates/hono-fullstack/apps/server/src/infra/work-runner/errors.ts +40 -0
  91. package/templates/hono-fullstack/apps/server/src/infra/work-runner/example/runner.test.ts +56 -0
  92. package/templates/hono-fullstack/apps/server/src/infra/work-runner/example/runner.ts +185 -0
  93. package/templates/hono-fullstack/apps/server/src/infra/work-runner/example/worker-entry.ts +34 -0
  94. package/templates/hono-fullstack/apps/server/src/infra/work-runner/types.ts +113 -0
  95. package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/business-error.ts +19 -0
  96. package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/message.ts +46 -0
  97. package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/transfer.ts +144 -0
  98. package/templates/hono-fullstack/apps/server/src/middlewares/cors.ts +26 -0
  99. package/templates/hono-fullstack/apps/server/src/modules/example/contracts.ts +9 -0
  100. package/templates/hono-fullstack/apps/server/src/modules/example/routes.ts +75 -0
  101. package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.test.ts +37 -0
  102. package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.ts +35 -0
  103. package/templates/hono-fullstack/apps/server/src/shared/app/types.ts +40 -0
  104. package/templates/hono-fullstack/apps/server/src/shared/errors/constants.ts +152 -0
  105. package/templates/hono-fullstack/apps/server/src/shared/errors/defs/index.ts +15 -0
  106. package/templates/hono-fullstack/apps/server/src/shared/errors/handler.ts +16 -0
  107. package/templates/hono-fullstack/apps/server/src/shared/errors/log.ts +67 -0
  108. package/templates/hono-fullstack/apps/server/src/shared/errors/proto.ts +42 -0
  109. package/templates/hono-fullstack/apps/server/src/shared/errors/types.ts +29 -0
  110. package/templates/hono-fullstack/apps/server/src/shared/network/fetcher.ts +35 -0
  111. package/templates/hono-fullstack/apps/server/src/shared/network/openapi/index.ts +50 -0
  112. package/templates/hono-fullstack/apps/server/src/shared/network/openapi/res-defs.ts +39 -0
  113. package/templates/hono-fullstack/apps/server/src/shared/network/types.ts +3 -0
  114. package/templates/hono-fullstack/apps/server/src/shared/network/utils.ts +36 -0
  115. package/templates/hono-fullstack/apps/server/src/shared/network/validator.ts +21 -0
  116. package/templates/hono-fullstack/apps/server/src/shared/utils/index.ts +30 -0
  117. package/templates/hono-fullstack/apps/server/src/virtual-modules.d.ts +5 -0
  118. package/templates/hono-fullstack/apps/server/tsconfig.json +16 -0
  119. package/templates/hono-fullstack/apps/server/vite.config.ts +79 -0
  120. package/templates/hono-fullstack/apps/stack/frontend/modules/example/ExamplePage.tsx +57 -0
  121. package/templates/hono-fullstack/apps/stack/frontend/modules/example/api.ts +13 -0
  122. package/templates/hono-fullstack/apps/stack/frontend/modules/example/hooks.ts +13 -0
  123. package/templates/hono-fullstack/apps/stack/frontend/routeTree.gen.ts +56 -0
  124. package/templates/hono-fullstack/apps/stack/frontend/router.tsx +22 -0
  125. package/templates/hono-fullstack/apps/stack/frontend/routes/__root.tsx +61 -0
  126. package/templates/hono-fullstack/apps/stack/frontend/routes/index.tsx +4 -0
  127. package/templates/hono-fullstack/apps/stack/frontend/shared/network/client.ts +19 -0
  128. package/templates/hono-fullstack/apps/stack/frontend/shared/network/constants.ts +1 -0
  129. package/templates/hono-fullstack/apps/stack/frontend/shared/network/errors.ts +33 -0
  130. package/templates/hono-fullstack/apps/stack/frontend/styles.css +23 -0
  131. package/templates/hono-fullstack/apps/stack/frontend/vite-env.d.ts +1 -0
  132. package/templates/hono-fullstack/apps/stack/nitro/handlers/hono.ts +1 -0
  133. package/templates/hono-fullstack/apps/stack/nitro/plugins/hono.ts +9 -0
  134. package/templates/hono-fullstack/apps/stack/package.json +43 -0
  135. package/templates/hono-fullstack/apps/stack/tsconfig.json +10 -0
  136. package/templates/hono-fullstack/apps/stack/tsr.config.json +5 -0
  137. package/templates/hono-fullstack/apps/stack/vite.config.ts +33 -0
  138. package/templates/hono-fullstack/docs/agents/domain.md +41 -0
  139. package/templates/hono-fullstack/docs/agents/issue-tracker.md +30 -0
  140. package/templates/hono-fullstack/docs/agents/triage-labels.md +15 -0
  141. package/templates/hono-fullstack/envs/.env.example.server +12 -0
  142. package/templates/hono-fullstack/envs/.env.example.sqlite +2 -0
  143. package/templates/hono-fullstack/libs/db/drizzle-kit/sqlite.config.ts +22 -0
  144. package/templates/hono-fullstack/libs/db/package.json +39 -0
  145. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/client.ts +35 -0
  146. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/columns.ts +32 -0
  147. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/index.ts +7 -0
  148. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +22 -0
  149. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/relations.ts +5 -0
  150. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/tables.ts +5 -0
  151. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/types.ts +7 -0
  152. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/vo.ts +1 -0
  153. package/templates/hono-fullstack/libs/db/src/dialects/sqlite/utils.ts +8 -0
  154. package/templates/hono-fullstack/libs/db/src/shared/types.ts +26 -0
  155. package/templates/hono-fullstack/libs/db/tsconfig.json +10 -0
  156. package/templates/hono-fullstack/libs/db/vite.config.ts +21 -0
  157. package/templates/hono-fullstack/libs/definition/package.json +30 -0
  158. package/templates/hono-fullstack/libs/definition/src/backend.ts +2 -0
  159. package/templates/hono-fullstack/libs/definition/src/configs/defs/log.ts +53 -0
  160. package/templates/hono-fullstack/libs/definition/src/configs/defs/middleware.ts +16 -0
  161. package/templates/hono-fullstack/libs/definition/src/configs/defs/runtime.ts +11 -0
  162. package/templates/hono-fullstack/libs/definition/src/configs/defs/sqlite.ts +13 -0
  163. package/templates/hono-fullstack/libs/definition/src/configs/defs/worker.ts +29 -0
  164. package/templates/hono-fullstack/libs/definition/src/configs/index.ts +5 -0
  165. package/templates/hono-fullstack/libs/definition/src/configs/proto.ts +81 -0
  166. package/templates/hono-fullstack/libs/definition/src/configs/schema.ts +23 -0
  167. package/templates/hono-fullstack/libs/definition/src/frontend.ts +1 -0
  168. package/templates/hono-fullstack/libs/definition/src/modules/example/index.ts +16 -0
  169. package/templates/hono-fullstack/libs/definition/src/modules/index.ts +1 -0
  170. package/templates/hono-fullstack/libs/definition/tsconfig.json +5 -0
  171. package/templates/hono-fullstack/libs/definition/vite.config.ts +13 -0
  172. package/templates/hono-fullstack/oyo.config.json +12 -0
  173. package/templates/hono-fullstack/package.json +29 -0
  174. package/templates/hono-fullstack/pnpm-workspace.yaml +82 -0
  175. package/templates/hono-fullstack/tsconfig.json +4 -0
  176. package/templates/hono-fullstack/turbo.json +13 -0
  177. package/templates/hono-fullstack/vite.config.ts +13 -0
  178. package/templates/hono-server/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
  179. package/templates/hono-server/.agents/skills/ask-matt/SKILL.md +90 -0
  180. package/templates/hono-server/.agents/skills/ask-matt/agents/openai.yaml +5 -0
  181. package/templates/hono-server/.agents/skills/code-review/SKILL.md +87 -0
  182. package/templates/hono-server/.agents/skills/code-review/agents/openai.yaml +3 -0
  183. package/templates/hono-server/.agents/skills/codebase-design/DEEPENING.md +37 -0
  184. package/templates/hono-server/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  185. package/templates/hono-server/.agents/skills/codebase-design/SKILL.md +114 -0
  186. package/templates/hono-server/.agents/skills/codebase-design/agents/openai.yaml +3 -0
  187. package/templates/hono-server/.agents/skills/confirm-requirements/SKILL.md +25 -0
  188. package/templates/hono-server/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
  189. package/templates/hono-server/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  190. package/templates/hono-server/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  191. package/templates/hono-server/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  192. package/templates/hono-server/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  193. package/templates/hono-server/.agents/skills/domain-modeling/SKILL.md +74 -0
  194. package/templates/hono-server/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
  195. package/templates/hono-server/.agents/skills/grill-me/SKILL.md +7 -0
  196. package/templates/hono-server/.agents/skills/grill-me/agents/openai.yaml +5 -0
  197. package/templates/hono-server/.agents/skills/grilling/SKILL.md +22 -0
  198. package/templates/hono-server/.agents/skills/grilling/agents/openai.yaml +3 -0
  199. package/templates/hono-server/.agents/skills/implement/SKILL.md +15 -0
  200. package/templates/hono-server/.agents/skills/implement/agents/openai.yaml +5 -0
  201. package/templates/hono-server/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  202. package/templates/hono-server/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
  203. package/templates/hono-server/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  204. package/templates/hono-server/.agents/skills/prototype/LOGIC.md +67 -0
  205. package/templates/hono-server/.agents/skills/prototype/SKILL.md +26 -0
  206. package/templates/hono-server/.agents/skills/prototype/UI.md +112 -0
  207. package/templates/hono-server/.agents/skills/prototype/agents/openai.yaml +3 -0
  208. package/templates/hono-server/.agents/skills/research/SKILL.md +12 -0
  209. package/templates/hono-server/.agents/skills/research/agents/openai.yaml +3 -0
  210. package/templates/hono-server/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  211. package/templates/hono-server/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
  212. package/templates/hono-server/.agents/skills/scoped-code-review/SKILL.md +113 -0
  213. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  214. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  215. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  216. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  217. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  218. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  219. package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  220. package/templates/hono-server/.agents/skills/tdd/SKILL.md +38 -0
  221. package/templates/hono-server/.agents/skills/tdd/agents/openai.yaml +3 -0
  222. package/templates/hono-server/.agents/skills/tdd/mocking.md +59 -0
  223. package/templates/hono-server/.agents/skills/tdd/tests.md +77 -0
  224. package/templates/hono-server/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
  225. package/templates/hono-server/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  226. package/templates/hono-server/.agents/skills/teach/MISSION-FORMAT.md +31 -0
  227. package/templates/hono-server/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
  228. package/templates/hono-server/.agents/skills/teach/SKILL.md +140 -0
  229. package/templates/hono-server/.agents/skills/teach/agents/openai.yaml +5 -0
  230. package/templates/hono-server/.agents/skills/to-questionnaire/SKILL.md +53 -0
  231. package/templates/hono-server/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
  232. package/templates/hono-server/.agents/skills/triage/AGENT-BRIEF.md +207 -0
  233. package/templates/hono-server/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
  234. package/templates/hono-server/.agents/skills/triage/SKILL.md +112 -0
  235. package/templates/hono-server/.agents/skills/triage/agents/openai.yaml +5 -0
  236. package/templates/hono-server/.agents/skills/wait-what/SKILL.md +7 -0
  237. package/templates/hono-server/.agents/skills/wait-what/agents/openai.yaml +5 -0
  238. package/templates/hono-server/.agents/skills/wayfinder/SKILL.md +128 -0
  239. package/templates/hono-server/.agents/skills/wayfinder/agents/openai.yaml +5 -0
  240. package/templates/hono-server/.agents/skills/wizard/SKILL.md +44 -0
  241. package/templates/hono-server/.agents/skills/wizard/agents/openai.yaml +3 -0
  242. package/templates/hono-server/.agents/skills/wizard/template.sh +204 -0
  243. package/templates/hono-server/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  244. package/templates/hono-server/.agents/skills/writing-for-agents/SKILL.md +81 -0
  245. package/templates/hono-server/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
  246. package/templates/hono-server/.changeset/README.md +8 -0
  247. package/templates/hono-server/.changeset/config.json +11 -0
  248. package/templates/hono-server/.editorconfig +31 -0
  249. package/templates/hono-server/.gitattributes +39 -0
  250. package/templates/hono-server/.vscode/extensions.json +5 -0
  251. package/templates/hono-server/.vscode/launch.json +25 -0
  252. package/templates/hono-server/.vscode/settings.json +24 -0
  253. package/templates/hono-server/AGENTS.md +43 -0
  254. package/templates/hono-server/README.md +31 -0
  255. package/templates/hono-server/_gitignore +30 -0
  256. package/templates/hono-server/apps/server/package.json +55 -0
  257. package/templates/hono-server/apps/server/src/adapters/nodejs/bootstrap.ts +61 -0
  258. package/templates/hono-server/apps/server/src/adapters/nodejs/config.ts +53 -0
  259. package/templates/hono-server/apps/server/src/adapters/nodejs/entry.ts +40 -0
  260. package/templates/hono-server/apps/server/src/app.test.ts +52 -0
  261. package/templates/hono-server/apps/server/src/app.ts +45 -0
  262. package/templates/hono-server/apps/server/src/infra/logger/getter.ts +74 -0
  263. package/templates/hono-server/apps/server/src/infra/logger/pino.ts +122 -0
  264. package/templates/hono-server/apps/server/src/infra/work-runner/constants.ts +23 -0
  265. package/templates/hono-server/apps/server/src/infra/work-runner/errors.ts +40 -0
  266. package/templates/hono-server/apps/server/src/infra/work-runner/example/runner.test.ts +56 -0
  267. package/templates/hono-server/apps/server/src/infra/work-runner/example/runner.ts +185 -0
  268. package/templates/hono-server/apps/server/src/infra/work-runner/example/worker-entry.ts +34 -0
  269. package/templates/hono-server/apps/server/src/infra/work-runner/types.ts +113 -0
  270. package/templates/hono-server/apps/server/src/infra/work-runner/utils/business-error.ts +19 -0
  271. package/templates/hono-server/apps/server/src/infra/work-runner/utils/message.ts +46 -0
  272. package/templates/hono-server/apps/server/src/infra/work-runner/utils/transfer.ts +144 -0
  273. package/templates/hono-server/apps/server/src/middlewares/cors.ts +26 -0
  274. package/templates/hono-server/apps/server/src/modules/example/contracts.ts +5 -0
  275. package/templates/hono-server/apps/server/src/modules/example/routes.ts +46 -0
  276. package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.test.ts +37 -0
  277. package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.ts +35 -0
  278. package/templates/hono-server/apps/server/src/shared/app/types.ts +40 -0
  279. package/templates/hono-server/apps/server/src/shared/errors/constants.ts +152 -0
  280. package/templates/hono-server/apps/server/src/shared/errors/defs/index.ts +15 -0
  281. package/templates/hono-server/apps/server/src/shared/errors/handler.ts +16 -0
  282. package/templates/hono-server/apps/server/src/shared/errors/log.ts +67 -0
  283. package/templates/hono-server/apps/server/src/shared/errors/proto.ts +42 -0
  284. package/templates/hono-server/apps/server/src/shared/errors/types.ts +29 -0
  285. package/templates/hono-server/apps/server/src/shared/network/fetcher.ts +35 -0
  286. package/templates/hono-server/apps/server/src/shared/network/openapi/index.ts +50 -0
  287. package/templates/hono-server/apps/server/src/shared/network/openapi/res-defs.ts +39 -0
  288. package/templates/hono-server/apps/server/src/shared/network/types.ts +3 -0
  289. package/templates/hono-server/apps/server/src/shared/network/utils.ts +36 -0
  290. package/templates/hono-server/apps/server/src/shared/network/validator.ts +21 -0
  291. package/templates/hono-server/apps/server/src/shared/utils/index.ts +30 -0
  292. package/templates/hono-server/apps/server/src/virtual-modules.d.ts +5 -0
  293. package/templates/hono-server/apps/server/tsconfig.json +16 -0
  294. package/templates/hono-server/apps/server/vite.config.ts +79 -0
  295. package/templates/hono-server/docker/.env.example +4 -0
  296. package/templates/hono-server/docker/README.md +5 -0
  297. package/templates/hono-server/docker/local/compose.local.app.yml +21 -0
  298. package/templates/hono-server/docker/local/local-app-deploy.sh +8 -0
  299. package/templates/hono-server/docker/local/local-app-down.sh +8 -0
  300. package/templates/hono-server/docker/prod/.env.example.server +11 -0
  301. package/templates/hono-server/docker/prod/compose.prod.stack.yml +21 -0
  302. package/templates/hono-server/docker/prod/update.sh +7 -0
  303. package/templates/hono-server/docker/server.Dockerfile +40 -0
  304. package/templates/hono-server/docker/server.Dockerfile.dockerignore +23 -0
  305. package/templates/hono-server/docs/agents/domain.md +41 -0
  306. package/templates/hono-server/docs/agents/issue-tracker.md +30 -0
  307. package/templates/hono-server/docs/agents/triage-labels.md +15 -0
  308. package/templates/hono-server/envs/.env.example.server +12 -0
  309. package/templates/hono-server/libs/definition/package.json +29 -0
  310. package/templates/hono-server/libs/definition/src/backend.ts +2 -0
  311. package/templates/hono-server/libs/definition/src/configs/defs/log.ts +53 -0
  312. package/templates/hono-server/libs/definition/src/configs/defs/middleware.ts +16 -0
  313. package/templates/hono-server/libs/definition/src/configs/defs/runtime.ts +11 -0
  314. package/templates/hono-server/libs/definition/src/configs/defs/worker.ts +29 -0
  315. package/templates/hono-server/libs/definition/src/configs/index.ts +4 -0
  316. package/templates/hono-server/libs/definition/src/configs/proto.ts +81 -0
  317. package/templates/hono-server/libs/definition/src/configs/schema.ts +23 -0
  318. package/templates/hono-server/libs/definition/src/modules/example/index.ts +16 -0
  319. package/templates/hono-server/libs/definition/src/modules/index.ts +1 -0
  320. package/templates/hono-server/libs/definition/tsconfig.json +5 -0
  321. package/templates/hono-server/libs/definition/vite.config.ts +12 -0
  322. package/templates/hono-server/oyo.config.json +11 -0
  323. package/templates/hono-server/package.json +26 -0
  324. package/templates/hono-server/pnpm-workspace.yaml +57 -0
  325. package/templates/hono-server/scripts/.env.example.docker +4 -0
  326. package/templates/hono-server/scripts/build-docker-server.sh +13 -0
  327. package/templates/hono-server/scripts/common.sh +20 -0
  328. package/templates/hono-server/tsconfig.json +4 -0
  329. package/templates/hono-server/turbo.json +13 -0
  330. package/templates/hono-server/vite.config.ts +13 -0
  331. package/templates/monorepo/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
  332. package/templates/monorepo/.agents/skills/ask-matt/SKILL.md +90 -0
  333. package/templates/monorepo/.agents/skills/ask-matt/agents/openai.yaml +5 -0
  334. package/templates/monorepo/.agents/skills/code-review/SKILL.md +87 -0
  335. package/templates/monorepo/.agents/skills/code-review/agents/openai.yaml +3 -0
  336. package/templates/monorepo/.agents/skills/codebase-design/DEEPENING.md +37 -0
  337. package/templates/monorepo/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  338. package/templates/monorepo/.agents/skills/codebase-design/SKILL.md +114 -0
  339. package/templates/monorepo/.agents/skills/codebase-design/agents/openai.yaml +3 -0
  340. package/templates/monorepo/.agents/skills/confirm-requirements/SKILL.md +25 -0
  341. package/templates/monorepo/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
  342. package/templates/monorepo/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
  343. package/templates/monorepo/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
  344. package/templates/monorepo/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
  345. package/templates/monorepo/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
  346. package/templates/monorepo/.agents/skills/domain-modeling/SKILL.md +74 -0
  347. package/templates/monorepo/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
  348. package/templates/monorepo/.agents/skills/grill-me/SKILL.md +7 -0
  349. package/templates/monorepo/.agents/skills/grill-me/agents/openai.yaml +5 -0
  350. package/templates/monorepo/.agents/skills/grilling/SKILL.md +22 -0
  351. package/templates/monorepo/.agents/skills/grilling/agents/openai.yaml +3 -0
  352. package/templates/monorepo/.agents/skills/implement/SKILL.md +15 -0
  353. package/templates/monorepo/.agents/skills/implement/agents/openai.yaml +5 -0
  354. package/templates/monorepo/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
  355. package/templates/monorepo/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
  356. package/templates/monorepo/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
  357. package/templates/monorepo/.agents/skills/prototype/LOGIC.md +67 -0
  358. package/templates/monorepo/.agents/skills/prototype/SKILL.md +26 -0
  359. package/templates/monorepo/.agents/skills/prototype/UI.md +112 -0
  360. package/templates/monorepo/.agents/skills/prototype/agents/openai.yaml +3 -0
  361. package/templates/monorepo/.agents/skills/research/SKILL.md +12 -0
  362. package/templates/monorepo/.agents/skills/research/agents/openai.yaml +3 -0
  363. package/templates/monorepo/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
  364. package/templates/monorepo/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
  365. package/templates/monorepo/.agents/skills/scoped-code-review/SKILL.md +113 -0
  366. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
  367. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
  368. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
  369. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
  370. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
  371. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
  372. package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
  373. package/templates/monorepo/.agents/skills/tdd/SKILL.md +38 -0
  374. package/templates/monorepo/.agents/skills/tdd/agents/openai.yaml +3 -0
  375. package/templates/monorepo/.agents/skills/tdd/mocking.md +59 -0
  376. package/templates/monorepo/.agents/skills/tdd/tests.md +77 -0
  377. package/templates/monorepo/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
  378. package/templates/monorepo/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
  379. package/templates/monorepo/.agents/skills/teach/MISSION-FORMAT.md +31 -0
  380. package/templates/monorepo/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
  381. package/templates/monorepo/.agents/skills/teach/SKILL.md +140 -0
  382. package/templates/monorepo/.agents/skills/teach/agents/openai.yaml +5 -0
  383. package/templates/monorepo/.agents/skills/to-questionnaire/SKILL.md +53 -0
  384. package/templates/monorepo/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
  385. package/templates/monorepo/.agents/skills/triage/AGENT-BRIEF.md +207 -0
  386. package/templates/monorepo/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
  387. package/templates/monorepo/.agents/skills/triage/SKILL.md +112 -0
  388. package/templates/monorepo/.agents/skills/triage/agents/openai.yaml +5 -0
  389. package/templates/monorepo/.agents/skills/wait-what/SKILL.md +7 -0
  390. package/templates/monorepo/.agents/skills/wait-what/agents/openai.yaml +5 -0
  391. package/templates/monorepo/.agents/skills/wayfinder/SKILL.md +128 -0
  392. package/templates/monorepo/.agents/skills/wayfinder/agents/openai.yaml +5 -0
  393. package/templates/monorepo/.agents/skills/wizard/SKILL.md +44 -0
  394. package/templates/monorepo/.agents/skills/wizard/agents/openai.yaml +3 -0
  395. package/templates/monorepo/.agents/skills/wizard/template.sh +204 -0
  396. package/templates/monorepo/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
  397. package/templates/monorepo/.agents/skills/writing-for-agents/SKILL.md +81 -0
  398. package/templates/monorepo/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
  399. package/templates/monorepo/.editorconfig +31 -0
  400. package/templates/monorepo/.gitattributes +39 -0
  401. package/templates/monorepo/.vscode/extensions.json +5 -0
  402. package/templates/monorepo/.vscode/launch.json +25 -0
  403. package/templates/monorepo/.vscode/settings.json +3 -1
  404. package/templates/monorepo/AGENTS.md +43 -0
  405. package/templates/monorepo/README.md +27 -0
  406. package/templates/monorepo/_gitignore +8 -0
  407. package/templates/monorepo/docs/agents/domain.md +41 -0
  408. package/templates/monorepo/docs/agents/issue-tracker.md +30 -0
  409. package/templates/monorepo/docs/agents/triage-labels.md +15 -0
  410. package/templates/monorepo/envs/.env.example +1 -0
  411. package/templates/monorepo/oyo.config.json +11 -0
  412. package/templates/monorepo/package.json +24 -0
  413. package/templates/monorepo/pnpm-workspace.yaml +32 -0
  414. package/templates/monorepo/tsconfig.json +4 -0
  415. package/templates/monorepo/turbo.json +13 -0
  416. package/templates/monorepo/vite.config.ts +13 -0
  417. package/templates/monorepo/.vite-hooks/pre-commit +0 -1
  418. /package/templates/{monorepo/_editorconfig → hono-fullstack/.editorconfig} +0 -0
  419. /package/templates/{monorepo/_gitattributes → hono-fullstack/.gitattributes} +0 -0
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@repo/db",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "exports": {
10
+ "./sqlite/schema": "./dist/sqlite/schema.mjs",
11
+ "./sqlite/sqlite": "./dist/sqlite/sqlite.mjs",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "scripts": {
15
+ "build": "vp pack",
16
+ "dev": "vp pack --watch",
17
+ "test": "vp test",
18
+ "check": "vp check",
19
+ "dev:sqlite:push": "oyo env sqlite -- drizzle-kit push --config=drizzle-kit/sqlite.config.ts",
20
+ "dev:sqlite:gen": "oyo env sqlite -- drizzle-kit generate --config=drizzle-kit/sqlite.config.ts",
21
+ "dev:sqlite:migrate": "oyo env sqlite -- drizzle-kit migrate --config=drizzle-kit/sqlite.config.ts"
22
+ },
23
+ "dependencies": {
24
+ "@repo/definition": "workspace:*",
25
+ "better-sqlite3": "catalog:drizzle",
26
+ "drizzle-orm": "catalog:drizzle"
27
+ },
28
+ "devDependencies": {
29
+ "@cloudflare/workers-types": "catalog:drizzle",
30
+ "@oyolincc/cli": "catalog:",
31
+ "@oyolincc/dev-config": "catalog:",
32
+ "@types/better-sqlite3": "catalog:drizzle",
33
+ "@types/node": "catalog:",
34
+ "drizzle-kit": "catalog:drizzle",
35
+ "tsx": "catalog:",
36
+ "typescript": "catalog:",
37
+ "vite-plus": "catalog:"
38
+ }
39
+ }
@@ -0,0 +1,35 @@
1
+ import Database from 'better-sqlite3'
2
+ import { drizzle } from 'drizzle-orm/better-sqlite3'
3
+ import { relations, type SqliteDBType } from './schema'
4
+ import { ensureDatabaseDirectory } from './utils'
5
+
6
+ export type SqliteDatabase = SqliteDBType
7
+
8
+ export interface SqliteClient {
9
+ db: SqliteDatabase
10
+ close(): void
11
+ }
12
+
13
+ export function createSqliteClient(databaseFile: string): SqliteClient {
14
+ if (!databaseFile) throw new Error('databaseFile must not be empty')
15
+
16
+ ensureDatabaseDirectory(databaseFile)
17
+
18
+ const client = new Database(databaseFile)
19
+ client.pragma('foreign_keys = ON')
20
+ if (databaseFile !== ':memory:') client.pragma('journal_mode = WAL')
21
+
22
+ const db = drizzle({ client, relations })
23
+
24
+ let closed = false
25
+
26
+ return {
27
+ db,
28
+ close() {
29
+ if (!closed) {
30
+ client.close()
31
+ closed = true
32
+ }
33
+ },
34
+ }
35
+ }
@@ -0,0 +1,32 @@
1
+ import { sql } from 'drizzle-orm'
2
+ import { customType, integer, text } from 'drizzle-orm/sqlite-core'
3
+
4
+ export const idType = customType<{ data: string; driverData: number | bigint }>({
5
+ dataType() {
6
+ return 'integer'
7
+ },
8
+ fromDriver(value) {
9
+ return String(value)
10
+ },
11
+ })
12
+
13
+ export function timestampMsColumn(name: string) {
14
+ return integer(name, { mode: 'timestamp_ms' })
15
+ .notNull()
16
+ .default(sql`(unixepoch('subsec') * 1000)`)
17
+ }
18
+
19
+ export const updatedAtCol = () => timestampMsColumn('updated_at').$onUpdateFn(() => new Date())
20
+
21
+ /**
22
+ * createdAt 和 updatedAt 是数据库行的创建/修改时间,SQLite 保存毫秒时间戳,代码里使用 Date。
23
+ * syncState.updatedTime 是客户端同步版本号,和这两个时间不是一回事,不要混用。
24
+ */
25
+ export const modifiedTimeCols = () => ({
26
+ createdAt: timestampMsColumn('created_at'),
27
+ updatedAt: updatedAtCol(),
28
+ })
29
+
30
+ export function jsonColumn<T>(name: string) {
31
+ return text(name, { mode: 'json' }).$type<T>()
32
+ }
@@ -0,0 +1,7 @@
1
+ export * from './relations'
2
+ export * from './tables'
3
+ export * from './types'
4
+ export * from './vo'
5
+ export * from '@/shared/types'
6
+
7
+ export { relations } from './relations'
@@ -0,0 +1,22 @@
1
+ import { sqliteTable, text } from 'drizzle-orm/sqlite-core'
2
+ import { idType, modifiedTimeCols } from '../../columns'
3
+ import type { SelectVOResults } from '@/shared/types'
4
+ import { defineVO } from '@/shared/types'
5
+
6
+ export const examples = sqliteTable('examples', {
7
+ id: idType('id').primaryKey({ autoIncrement: true }),
8
+ message: text('message').notNull(),
9
+ ...modifiedTimeCols(),
10
+ })
11
+
12
+ export type InsertExample = typeof examples.$inferInsert
13
+
14
+ export const voExamples = defineVO({
15
+ id: examples.id,
16
+ message: examples.message,
17
+ createdAt: examples.createdAt,
18
+ updatedAt: examples.updatedAt,
19
+ })
20
+ export type IExamplesVO = SelectVOResults<typeof voExamples>
21
+
22
+ export const vcExamples = { default: voExamples } as const
@@ -0,0 +1,5 @@
1
+ import { defineRelations } from 'drizzle-orm'
2
+ import { sqliteTableDefs } from './tables'
3
+
4
+ /** The example table has no relationships; keep the relations entrypoint for future modules. */
5
+ export const relations = defineRelations(sqliteTableDefs)
@@ -0,0 +1,5 @@
1
+ export { examples, type InsertExample } from './modules/examples/examples'
2
+
3
+ import { examples } from './modules/examples/examples'
4
+
5
+ export const sqliteTableDefs = { examples } as const
@@ -0,0 +1,7 @@
1
+ import type { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3'
2
+ import type { AnySQLiteColumn, AnySQLiteTable } from 'drizzle-orm/sqlite-core'
3
+ import type { relations } from './relations'
4
+
5
+ export type SqliteDBType = BetterSQLite3Database<typeof relations>
6
+ export type SqliteTableType = AnySQLiteTable
7
+ export type SqliteColType = AnySQLiteColumn
@@ -0,0 +1 @@
1
+ export { vcExamples, voExamples, type IExamplesVO } from './modules/examples/examples'
@@ -0,0 +1,8 @@
1
+ import { mkdirSync } from 'node:fs'
2
+ import { dirname } from 'node:path'
3
+
4
+ export function ensureDatabaseDirectory(databaseFile: string): void {
5
+ if (!databaseFile || databaseFile === ':memory:') return
6
+
7
+ mkdirSync(dirname(databaseFile), { recursive: true })
8
+ }
@@ -0,0 +1,26 @@
1
+ import type { AnyColumn, GetColumnData, InferModelFromColumns, Table } from 'drizzle-orm'
2
+
3
+ export type AnyTableType = Table
4
+ export type AnyColType = AnyColumn
5
+
6
+ export type TableColsMap<T extends AnyTableType> = T['_']['columns']
7
+ export type TableField<T extends AnyTableType> = keyof TableColsMap<T> & string
8
+ export type TableFieldValue<T extends AnyTableType, K extends TableField<T>> = GetColumnData<
9
+ TableColsMap<T>[K],
10
+ 'query'
11
+ >
12
+
13
+ export type VO<TColumn extends AnyColType = AnyColType> = Record<string, TColumn>
14
+ export type InsertModel<T extends AnyTableType> = InferModelFromColumns<TableColsMap<T>, 'insert'>
15
+
16
+ export function defineVO<T extends VO>(vo: T): T {
17
+ return vo
18
+ }
19
+
20
+ export type SelectVOResults<V extends VO> = {
21
+ [K in keyof V]: GetColumnData<V[K], 'query'>
22
+ }
23
+
24
+ export type VOColsOption<V extends VO> = {
25
+ [K in keyof V]: true
26
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "@oyolincc/dev-config/tsconfig.bundler.json",
3
+ "compilerOptions": {
4
+ "paths": {
5
+ "@/*": ["./src/*"]
6
+ }
7
+ },
8
+ "files": [],
9
+ "include": ["src", "drizzle-kit", "./*.ts", "./*.mts"]
10
+ }
@@ -0,0 +1,21 @@
1
+ import { defineConfig } from 'vite-plus'
2
+ import { packConfig } from '@oyolincc/dev-config'
3
+ import path from 'node:path'
4
+
5
+ const __dirname = import.meta.dirname
6
+
7
+ export default defineConfig({
8
+ pack: {
9
+ ...packConfig,
10
+ entry: {
11
+ 'sqlite/schema': 'src/dialects/sqlite/schema/index.ts',
12
+ 'sqlite/sqlite': 'src/dialects/sqlite/client.ts',
13
+ },
14
+ exports: true,
15
+ },
16
+ resolve: {
17
+ alias: {
18
+ '@': path.resolve(__dirname, './src'),
19
+ },
20
+ },
21
+ })
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "@repo/definition",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "exports": {
10
+ "./backend": "./dist/backend.mjs",
11
+ "./frontend": "./dist/frontend.mjs",
12
+ "./package.json": "./package.json"
13
+ },
14
+ "scripts": {
15
+ "build": "vp pack",
16
+ "dev": "vp pack --watch",
17
+ "test": "vp test",
18
+ "check": "vp check"
19
+ },
20
+ "dependencies": {
21
+ "change-case": "catalog:shared",
22
+ "valibot": "catalog:shared"
23
+ },
24
+ "devDependencies": {
25
+ "@oyolincc/dev-config": "catalog:",
26
+ "@types/node": "catalog:",
27
+ "typescript": "catalog:",
28
+ "vite-plus": "catalog:"
29
+ }
30
+ }
@@ -0,0 +1,2 @@
1
+ export * from './modules'
2
+ export * from './configs'
@@ -0,0 +1,53 @@
1
+ import * as v from 'valibot'
2
+ import { defineSchemaConfig, defineStaticConfig } from '../proto'
3
+
4
+ export const $S_LogRollSchemaConfig = v.object({
5
+ loggerDir: v.optional(v.string(), './logs'),
6
+ loggerFileBase: v.optional(
7
+ v.pipe(v.string(), v.minLength(1, 'loggerFileBase must be at least 1 character long')),
8
+ 'app',
9
+ ),
10
+ })
11
+ export type LogRollSchemaConfig = v.InferOutput<typeof $S_LogRollSchemaConfig>
12
+ export const logRollSchemaConfig = defineSchemaConfig($S_LogRollSchemaConfig)
13
+
14
+ export const $S_LogBaseConfig = v.object({
15
+ loggerLevel: v.optional(
16
+ v.picklist(['trace', 'debug', 'info', 'warn', 'error', 'fatal', 'silent']),
17
+ ),
18
+ })
19
+ export type LogBaseConfig = v.InferOutput<typeof $S_LogBaseConfig>
20
+ export const logBaseConfig = defineSchemaConfig($S_LogBaseConfig)
21
+
22
+ // https://github.com/mcollina/pino-roll#options
23
+ export interface LogRollRawConfig {
24
+ frequency: number | string
25
+ extension: string
26
+ size: number | string
27
+ maxFiles: number
28
+ mkdir: boolean
29
+ dateFormat: string
30
+ }
31
+ export const logRollRawConfig = defineStaticConfig<LogRollRawConfig>(() => ({
32
+ frequency: 'daily' as const,
33
+ extension: '.log',
34
+ size: '10M',
35
+ maxFiles: 30,
36
+ mkdir: true,
37
+ dateFormat: 'yyyy-MM-dd',
38
+ }))
39
+
40
+ export interface LogPrettyRawConfig {
41
+ colorize: boolean
42
+ singleLine: boolean
43
+ levelFirst: boolean
44
+ translateTime: string
45
+ ignore: string
46
+ }
47
+ export const logPrettyRawConfig = defineStaticConfig<LogPrettyRawConfig>(() => ({
48
+ colorize: true,
49
+ singleLine: true,
50
+ levelFirst: true,
51
+ translateTime: 'SYS:yyyy-mm-dd HH:MM:ss',
52
+ ignore: 'pid,hostname',
53
+ }))
@@ -0,0 +1,16 @@
1
+ import * as v from 'valibot'
2
+ import { defineSchemaConfig } from '../proto'
3
+
4
+ export const $S_CORSConfig = v.object({
5
+ domains: v.pipe(
6
+ v.optional(v.string()),
7
+ v.transform((val) =>
8
+ String(val || '')
9
+ .split(',')
10
+ .map((s) => s.trim())
11
+ .filter(Boolean),
12
+ ),
13
+ ) as v.GenericSchema<string | undefined, string[]>,
14
+ })
15
+ export type CORSConfig = v.InferOutput<typeof $S_CORSConfig>
16
+ export const corsConfig = defineSchemaConfig($S_CORSConfig)
@@ -0,0 +1,11 @@
1
+ import * as v from 'valibot'
2
+ import { defineSchemaConfig } from '../proto'
3
+
4
+ export const $S_RuntimeConfig = v.object({
5
+ serverEnv: v.optional(
6
+ v.union([v.literal('local'), v.literal('test'), v.literal('staging'), v.literal('main')]),
7
+ 'local',
8
+ ),
9
+ })
10
+ export type RuntimeConfig = v.InferOutput<typeof $S_RuntimeConfig>
11
+ export const runtimeConfig = defineSchemaConfig($S_RuntimeConfig)
@@ -0,0 +1,13 @@
1
+ import path from 'node:path'
2
+ import * as v from 'valibot'
3
+ import { defineSchemaConfig } from '../proto'
4
+ import { $S_NonEmptyString } from '../schema'
5
+
6
+ const workspaceRoot = path.join(import.meta.dirname, '../../..')
7
+ const defaultDbPath = path.join(workspaceRoot, 'db-data', 'repo.sqlite')
8
+
9
+ export const $S_SqliteSchemaConfig = v.object({
10
+ dbPath: v.optional($S_NonEmptyString, defaultDbPath),
11
+ })
12
+ export type SqliteSchemaConfig = v.InferOutput<typeof $S_SqliteSchemaConfig>
13
+ export const sqliteSchemaConfig = defineSchemaConfig($S_SqliteSchemaConfig)
@@ -0,0 +1,29 @@
1
+ import * as v from 'valibot'
2
+ import { defineSchemaConfig } from '../proto'
3
+ import { availableParallelism } from 'node:os'
4
+
5
+ const workerNumber = (minimum: number, name: string) =>
6
+ v.pipe(
7
+ v.union([v.string(), v.number()]),
8
+ v.transform((value) => Number(value)),
9
+ v.integer(`${name} must be an integer`),
10
+ v.minValue(minimum, `${name} must be at least ${minimum}`),
11
+ )
12
+
13
+ export const $S_WorkerConfig = v.object({
14
+ /** Worker 池启动时至少保留的 Worker 数量。 */
15
+ minThreads: v.optional(workerNumber(1, 'minThreads'), 1),
16
+ /** Worker 池允许创建的最大 Worker 数量。 */
17
+ maxThreads: v.optional(workerNumber(1, 'maxThreads'), Math.max(2, availableParallelism() + 1)),
18
+ /** 每个 Worker 可同时执行的任务数量。 */
19
+ concurrentTasksPerWorker: v.optional(workerNumber(1, 'concurrentTasksPerWorker'), 1),
20
+ /** Runner 等待队列允许容纳的最大任务数量。 */
21
+ maxQueue: v.optional(workerNumber(0, 'maxQueue'), 12),
22
+
23
+ /** 非 Piscina 官方配置,任务从提交到完成的最长时间,0 表示不限制。 */
24
+ workerTaskTimeoutMs: v.optional(workerNumber(0, 'workerTaskTimeoutMs'), 30_000),
25
+ })
26
+
27
+ export type WorkerConfig = v.InferOutput<typeof $S_WorkerConfig>
28
+
29
+ export const workerConfig = defineSchemaConfig($S_WorkerConfig)
@@ -0,0 +1,5 @@
1
+ export * from './defs/runtime'
2
+ export * from './defs/log'
3
+ export * from './defs/middleware'
4
+ export * from './defs/worker'
5
+ export * from './defs/sqlite'
@@ -0,0 +1,81 @@
1
+ import { camelCase, constantCase, kebabCase, snakeCase } from 'change-case'
2
+ import { type ObjectEntries, type ObjectSchema, type InferOutput, parse } from 'valibot'
3
+
4
+ export type ConfigType = 'static' | 'schema'
5
+ export type ContextCase = 'kebab' | 'camel' | 'env' | 'constantCase' | 'snake' | 'raw'
6
+
7
+ const rawCaser = (str: string) => str || ''
8
+
9
+ const caserMap: Record<ContextCase, (str: string) => string> = {
10
+ kebab: kebabCase,
11
+ camel: camelCase,
12
+ env: constantCase,
13
+ constantCase: constantCase,
14
+ snake: snakeCase,
15
+ raw: rawCaser,
16
+ }
17
+
18
+ export interface ConfigResolver<TParams, TValue> {
19
+ (...args: undefined extends TParams ? [params?: TParams] : [params: TParams]): TValue
20
+ }
21
+
22
+ export interface SchemaConfigResolverParams {
23
+ context: Record<string, any>
24
+ matchContextKey?: ContextCase | ((str: string) => string)
25
+ }
26
+ export type SchemaConfigResolver<TSchema extends ObjectSchema<ObjectEntries, any>> = ConfigResolver<
27
+ SchemaConfigResolverParams,
28
+ InferOutput<TSchema>
29
+ >
30
+
31
+ export interface AppConfig<TKind extends ConfigType, R extends ConfigResolver<any, any>> {
32
+ kind: TKind
33
+ resolve: R
34
+ }
35
+
36
+ export type StaticAppConfig<TValue> = AppConfig<'static', ConfigResolver<undefined, TValue>>
37
+
38
+ export type SchemaAppConfig<TSchema extends ObjectSchema<ObjectEntries, any>> = AppConfig<
39
+ 'schema',
40
+ SchemaConfigResolver<TSchema>
41
+ > & {
42
+ schema: TSchema
43
+ }
44
+
45
+ export const createSchemaResolver = <TSchema extends ObjectSchema<ObjectEntries, any>>(
46
+ schema: TSchema,
47
+ ): SchemaConfigResolver<TSchema> => {
48
+ return ({ context, matchContextKey }) => {
49
+ const caser =
50
+ typeof matchContextKey === 'function'
51
+ ? matchContextKey
52
+ : (matchContextKey && caserMap[matchContextKey]) || rawCaser
53
+
54
+ const depKeys = Object.keys(schema.entries)
55
+ const filteredInput: Record<string, any> = {}
56
+ for (const key of depKeys) {
57
+ const fromKey = caser(key)
58
+ if (fromKey) filteredInput[key] = context[fromKey]
59
+ }
60
+
61
+ const parsed = parse(schema, filteredInput)
62
+ return parsed
63
+ }
64
+ }
65
+
66
+ export const defineStaticConfig = <TValue>(resolver: () => TValue): StaticAppConfig<TValue> => {
67
+ return {
68
+ kind: 'static',
69
+ resolve: resolver,
70
+ }
71
+ }
72
+
73
+ export const defineSchemaConfig = <TSchema extends ObjectSchema<ObjectEntries, any>>(
74
+ schema: TSchema,
75
+ ): SchemaAppConfig<TSchema> => {
76
+ return {
77
+ kind: 'schema',
78
+ schema: schema,
79
+ resolve: createSchemaResolver(schema),
80
+ }
81
+ }
@@ -0,0 +1,23 @@
1
+ import * as v from 'valibot'
2
+
3
+ export const $S_NonEmptyString = v.pipe(v.string(), v.minLength(1))
4
+
5
+ export const $S_BooleanString = v.pipe(
6
+ v.optional(
7
+ v.pipe(
8
+ v.string(),
9
+ v.check((value) => value === 'true' || value === 'false', 'Expected true or false'),
10
+ ),
11
+ ),
12
+ v.transform((value) => value !== 'false'),
13
+ )
14
+
15
+ export const $S_NumberString = (defaultValue: number) =>
16
+ v.optional(
17
+ v.pipe(
18
+ v.string(),
19
+ v.check((value) => Number.isFinite(Number(value)), 'Expected a numeric string'),
20
+ v.transform(Number),
21
+ ),
22
+ String(defaultValue),
23
+ )
@@ -0,0 +1 @@
1
+ export * from './modules'
@@ -0,0 +1,16 @@
1
+ export type Example = {
2
+ id: string
3
+ message: string
4
+ createdAt: string
5
+ updatedAt: string
6
+ }
7
+
8
+ export type CreateExampleInput = Pick<Example, 'message'>
9
+
10
+ export type ProcessExampleInput = Pick<Example, 'message'>
11
+
12
+ export type ProcessExampleOutput = {
13
+ original: string
14
+ normalized: string
15
+ length: number
16
+ }
@@ -0,0 +1 @@
1
+ export * from './example'
@@ -0,0 +1,5 @@
1
+ {
2
+ "extends": "@oyolincc/dev-config/tsconfig.bundler.json",
3
+ "files": [],
4
+ "include": ["src", "./*.ts", "./*.mts"]
5
+ }
@@ -0,0 +1,13 @@
1
+ import { defineConfig } from 'vite-plus'
2
+ import { packConfig } from '@oyolincc/dev-config'
3
+
4
+ export default defineConfig({
5
+ pack: {
6
+ ...packConfig,
7
+ entry: {
8
+ frontend: 'src/frontend.ts',
9
+ backend: 'src/backend.ts',
10
+ },
11
+ exports: true,
12
+ },
13
+ })
@@ -0,0 +1,12 @@
1
+ {
2
+ "env": {
3
+ "dir": "./envs/",
4
+ "presets": {
5
+ "server": [".env.server", ".env.sqlite"],
6
+ "sqlite": [".env.sqlite"]
7
+ }
8
+ },
9
+ "codeGenerator": {
10
+ "root": "."
11
+ }
12
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "repo",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "prepare": "vp config",
7
+ "changeset": "vp exec changeset",
8
+ "build": "turbo build",
9
+ "dev": "turbo build --filter=@repo/definition --filter=@repo/db --filter=@repo/server && concurrently -k -n definition,db,server,stack -c blue,magenta,green,yellow \"pnpm --filter @repo/definition dev\" \"pnpm --filter @repo/db dev\" \"pnpm --filter @repo/server dev:pack\" \"pnpm --filter @repo/stack dev\"",
10
+ "dev:sqlite:push": "pnpm --filter @repo/db dev:sqlite:push",
11
+ "dev:sqlite:gen": "pnpm --filter @repo/db dev:sqlite:gen",
12
+ "dev:sqlite:migrate": "pnpm --filter @repo/db dev:sqlite:migrate"
13
+ },
14
+ "devDependencies": {
15
+ "@changesets/changelog-github": "catalog:",
16
+ "@changesets/cli": "catalog:",
17
+ "@oyolincc/cli": "catalog:",
18
+ "@oyolincc/dev-config": "catalog:",
19
+ "@types/node": "catalog:",
20
+ "concurrently": "catalog:",
21
+ "tsx": "catalog:",
22
+ "turbo": "catalog:",
23
+ "vite-plus": "catalog:"
24
+ },
25
+ "engines": {
26
+ "node": ">=22.12.0"
27
+ },
28
+ "packageManager": "pnpm@11.25.0"
29
+ }