@oyolincc/create 0.2.0 → 0.3.0
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.
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +29 -13
- package/templates/hono-fullstack/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
- package/templates/hono-fullstack/.agents/skills/ask-matt/SKILL.md +90 -0
- package/templates/hono-fullstack/.agents/skills/ask-matt/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/code-review/SKILL.md +87 -0
- package/templates/hono-fullstack/.agents/skills/code-review/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/codebase-design/DEEPENING.md +37 -0
- package/templates/hono-fullstack/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/templates/hono-fullstack/.agents/skills/codebase-design/SKILL.md +114 -0
- package/templates/hono-fullstack/.agents/skills/codebase-design/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/confirm-requirements/SKILL.md +25 -0
- package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
- package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
- package/templates/hono-fullstack/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/templates/hono-fullstack/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/templates/hono-fullstack/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/templates/hono-fullstack/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/grill-me/SKILL.md +7 -0
- package/templates/hono-fullstack/.agents/skills/grill-me/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/grilling/SKILL.md +22 -0
- package/templates/hono-fullstack/.agents/skills/grilling/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/implement/SKILL.md +15 -0
- package/templates/hono-fullstack/.agents/skills/implement/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/templates/hono-fullstack/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/prototype/LOGIC.md +67 -0
- package/templates/hono-fullstack/.agents/skills/prototype/SKILL.md +26 -0
- package/templates/hono-fullstack/.agents/skills/prototype/UI.md +112 -0
- package/templates/hono-fullstack/.agents/skills/prototype/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/research/SKILL.md +12 -0
- package/templates/hono-fullstack/.agents/skills/research/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/templates/hono-fullstack/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/scoped-code-review/SKILL.md +113 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/templates/hono-fullstack/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/templates/hono-fullstack/.agents/skills/tdd/SKILL.md +38 -0
- package/templates/hono-fullstack/.agents/skills/tdd/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/tdd/mocking.md +59 -0
- package/templates/hono-fullstack/.agents/skills/tdd/tests.md +77 -0
- package/templates/hono-fullstack/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/templates/hono-fullstack/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/templates/hono-fullstack/.agents/skills/teach/MISSION-FORMAT.md +31 -0
- package/templates/hono-fullstack/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/templates/hono-fullstack/.agents/skills/teach/SKILL.md +140 -0
- package/templates/hono-fullstack/.agents/skills/teach/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/to-questionnaire/SKILL.md +53 -0
- package/templates/hono-fullstack/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/triage/AGENT-BRIEF.md +207 -0
- package/templates/hono-fullstack/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/templates/hono-fullstack/.agents/skills/triage/SKILL.md +112 -0
- package/templates/hono-fullstack/.agents/skills/triage/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/wait-what/SKILL.md +7 -0
- package/templates/hono-fullstack/.agents/skills/wait-what/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/wayfinder/SKILL.md +128 -0
- package/templates/hono-fullstack/.agents/skills/wayfinder/agents/openai.yaml +5 -0
- package/templates/hono-fullstack/.agents/skills/wizard/SKILL.md +44 -0
- package/templates/hono-fullstack/.agents/skills/wizard/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.agents/skills/wizard/template.sh +204 -0
- package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/templates/hono-fullstack/.agents/skills/writing-for-agents/SKILL.md +81 -0
- package/templates/hono-fullstack/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
- package/templates/hono-fullstack/.changeset/README.md +8 -0
- package/templates/hono-fullstack/.changeset/config.json +11 -0
- package/templates/hono-fullstack/.editorconfig +31 -0
- package/templates/hono-fullstack/.gitattributes +39 -0
- package/templates/hono-fullstack/.vscode/extensions.json +5 -0
- package/templates/hono-fullstack/.vscode/launch.json +36 -0
- package/templates/hono-fullstack/.vscode/settings.json +26 -0
- package/templates/hono-fullstack/AGENTS.md +50 -0
- package/templates/hono-fullstack/README.md +51 -0
- package/templates/hono-fullstack/_gitignore +35 -0
- package/templates/hono-fullstack/apps/server/.dev.vars.example +9 -0
- package/templates/hono-fullstack/apps/server/package.json +63 -0
- package/templates/hono-fullstack/apps/server/src/adapters/cloudflare/entry.ts +36 -0
- package/templates/hono-fullstack/apps/server/src/adapters/nodejs/bootstrap.ts +61 -0
- package/templates/hono-fullstack/apps/server/src/adapters/nodejs/entry.ts +62 -0
- package/templates/hono-fullstack/apps/server/src/app.ts +43 -0
- package/templates/hono-fullstack/apps/server/src/config.ts +47 -0
- package/templates/hono-fullstack/apps/server/src/infra/logger/getter.ts +74 -0
- package/templates/hono-fullstack/apps/server/src/infra/logger/pino.ts +126 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/constants.ts +23 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/errors.ts +40 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/example/worker-entry.ts +13 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/pass-through/runner.ts +42 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/piscina/runner.ts +185 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/types.ts +118 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/business-error.ts +19 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/message.ts +49 -0
- package/templates/hono-fullstack/apps/server/src/infra/work-runner/utils/transfer.ts +144 -0
- package/templates/hono-fullstack/apps/server/src/middlewares/cors.ts +26 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/contracts.ts +9 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/routes.ts +73 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.test.ts +49 -0
- package/templates/hono-fullstack/apps/server/src/modules/example/work-task/tasks.ts +58 -0
- package/templates/hono-fullstack/apps/server/src/shared/app/types.ts +44 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/constants.ts +152 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/defs/index.ts +15 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/handler.ts +16 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/log.ts +67 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/proto.ts +42 -0
- package/templates/hono-fullstack/apps/server/src/shared/errors/types.ts +29 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/fetcher.ts +35 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/openapi/index.ts +50 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/openapi/res-defs.ts +39 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/types.ts +3 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/utils.ts +36 -0
- package/templates/hono-fullstack/apps/server/src/shared/network/validator.ts +28 -0
- package/templates/hono-fullstack/apps/server/src/shared/utils/index.ts +30 -0
- package/templates/hono-fullstack/apps/server/src/virtual-modules.d.ts +5 -0
- package/templates/hono-fullstack/apps/server/tsconfig.json +17 -0
- package/templates/hono-fullstack/apps/server/vite.config.ts +87 -0
- package/templates/hono-fullstack/apps/server/wrangler.jsonc +29 -0
- package/templates/hono-fullstack/apps/stack/backend/cloudflare.ts +5 -0
- package/templates/hono-fullstack/apps/stack/backend/node.ts +3 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/general/ErrorMessage.tsx +4 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/AppLayout.tsx +11 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/Header.tsx +7 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/Page.tsx +5 -0
- package/templates/hono-fullstack/apps/stack/frontend/components/layouts/PageContainer.tsx +5 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/api.ts +13 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleForm.tsx +45 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleList.tsx +13 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/hooks/api-hooks.ts +14 -0
- package/templates/hono-fullstack/apps/stack/frontend/modules/example/stores/index.ts +3 -0
- package/templates/hono-fullstack/apps/stack/frontend/routeTree.gen.ts +73 -0
- package/templates/hono-fullstack/apps/stack/frontend/router.tsx +22 -0
- package/templates/hono-fullstack/apps/stack/frontend/routes/__root.tsx +61 -0
- package/templates/hono-fullstack/apps/stack/frontend/routes/api/$.ts +18 -0
- package/templates/hono-fullstack/apps/stack/frontend/routes/index.tsx +50 -0
- package/templates/hono-fullstack/apps/stack/frontend/shared/network/client.ts +19 -0
- package/templates/hono-fullstack/apps/stack/frontend/shared/network/constants.ts +1 -0
- package/templates/hono-fullstack/apps/stack/frontend/shared/network/errors.ts +33 -0
- package/templates/hono-fullstack/apps/stack/frontend/styles.css +23 -0
- package/templates/hono-fullstack/apps/stack/frontend/vite-env.d.ts +6 -0
- package/templates/hono-fullstack/apps/stack/package.json +59 -0
- package/templates/hono-fullstack/apps/stack/tsconfig.json +13 -0
- package/templates/hono-fullstack/apps/stack/tsr.config.json +5 -0
- package/templates/hono-fullstack/apps/stack/vite.config.ts +82 -0
- package/templates/hono-fullstack/apps/stack/wrangler.jsonc +20 -0
- package/templates/hono-fullstack/docs/agents/domain.md +41 -0
- package/templates/hono-fullstack/docs/agents/issue-tracker.md +30 -0
- package/templates/hono-fullstack/docs/agents/triage-labels.md +15 -0
- package/templates/hono-fullstack/envs/.env.example.server +12 -0
- package/templates/hono-fullstack/envs/.env.example.sqlite +1 -0
- package/templates/hono-fullstack/envs/.env.example.sqlite-d1 +3 -0
- package/templates/hono-fullstack/libs/db/drizzle-kit/sqlite-d1.config.ts +22 -0
- package/templates/hono-fullstack/libs/db/drizzle-kit/sqlite.config.ts +22 -0
- package/templates/hono-fullstack/libs/db/package.json +42 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/client.ts +35 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/d1-client.ts +12 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/columns.ts +37 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/index.ts +7 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +22 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/relations.ts +5 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/tables.ts +5 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/types.ts +7 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/schema/vo.ts +1 -0
- package/templates/hono-fullstack/libs/db/src/dialects/sqlite/utils.ts +8 -0
- package/templates/hono-fullstack/libs/db/src/shared/types.ts +26 -0
- package/templates/hono-fullstack/libs/db/tsconfig.json +10 -0
- package/templates/hono-fullstack/libs/db/vite.config.ts +25 -0
- package/templates/hono-fullstack/libs/definition/package.json +30 -0
- package/templates/hono-fullstack/libs/definition/src/backend.ts +2 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/log.ts +53 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/middleware.ts +16 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/runtime.ts +12 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/sqlite.ts +26 -0
- package/templates/hono-fullstack/libs/definition/src/configs/defs/worker.ts +29 -0
- package/templates/hono-fullstack/libs/definition/src/configs/index.ts +5 -0
- package/templates/hono-fullstack/libs/definition/src/configs/proto.ts +81 -0
- package/templates/hono-fullstack/libs/definition/src/configs/schema.ts +23 -0
- package/templates/hono-fullstack/libs/definition/src/frontend.ts +1 -0
- package/templates/hono-fullstack/libs/definition/src/modules/example/index.ts +16 -0
- package/templates/hono-fullstack/libs/definition/src/modules/index.ts +1 -0
- package/templates/hono-fullstack/libs/definition/tsconfig.json +5 -0
- package/templates/hono-fullstack/libs/definition/vite.config.ts +16 -0
- package/templates/hono-fullstack/oyo.config.json +13 -0
- package/templates/hono-fullstack/package.json +25 -0
- package/templates/hono-fullstack/pnpm-workspace.yaml +84 -0
- package/templates/hono-fullstack/tsconfig.json +4 -0
- package/templates/hono-fullstack/turbo.json +36 -0
- package/templates/hono-fullstack/vite.config.ts +14 -0
- package/templates/hono-server/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
- package/templates/hono-server/.agents/skills/ask-matt/SKILL.md +90 -0
- package/templates/hono-server/.agents/skills/ask-matt/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/code-review/SKILL.md +87 -0
- package/templates/hono-server/.agents/skills/code-review/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/codebase-design/DEEPENING.md +37 -0
- package/templates/hono-server/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/templates/hono-server/.agents/skills/codebase-design/SKILL.md +114 -0
- package/templates/hono-server/.agents/skills/codebase-design/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/confirm-requirements/SKILL.md +25 -0
- package/templates/hono-server/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
- package/templates/hono-server/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
- package/templates/hono-server/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/templates/hono-server/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/templates/hono-server/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/templates/hono-server/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/grill-me/SKILL.md +7 -0
- package/templates/hono-server/.agents/skills/grill-me/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/grilling/SKILL.md +22 -0
- package/templates/hono-server/.agents/skills/grilling/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/implement/SKILL.md +15 -0
- package/templates/hono-server/.agents/skills/implement/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/templates/hono-server/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/templates/hono-server/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/prototype/LOGIC.md +67 -0
- package/templates/hono-server/.agents/skills/prototype/SKILL.md +26 -0
- package/templates/hono-server/.agents/skills/prototype/UI.md +112 -0
- package/templates/hono-server/.agents/skills/prototype/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/research/SKILL.md +12 -0
- package/templates/hono-server/.agents/skills/research/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/templates/hono-server/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/scoped-code-review/SKILL.md +113 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/templates/hono-server/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/templates/hono-server/.agents/skills/tdd/SKILL.md +38 -0
- package/templates/hono-server/.agents/skills/tdd/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/tdd/mocking.md +59 -0
- package/templates/hono-server/.agents/skills/tdd/tests.md +77 -0
- package/templates/hono-server/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/templates/hono-server/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/templates/hono-server/.agents/skills/teach/MISSION-FORMAT.md +31 -0
- package/templates/hono-server/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/templates/hono-server/.agents/skills/teach/SKILL.md +140 -0
- package/templates/hono-server/.agents/skills/teach/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/to-questionnaire/SKILL.md +53 -0
- package/templates/hono-server/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/triage/AGENT-BRIEF.md +207 -0
- package/templates/hono-server/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/templates/hono-server/.agents/skills/triage/SKILL.md +112 -0
- package/templates/hono-server/.agents/skills/triage/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/wait-what/SKILL.md +7 -0
- package/templates/hono-server/.agents/skills/wait-what/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/wayfinder/SKILL.md +128 -0
- package/templates/hono-server/.agents/skills/wayfinder/agents/openai.yaml +5 -0
- package/templates/hono-server/.agents/skills/wizard/SKILL.md +44 -0
- package/templates/hono-server/.agents/skills/wizard/agents/openai.yaml +3 -0
- package/templates/hono-server/.agents/skills/wizard/template.sh +204 -0
- package/templates/hono-server/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/templates/hono-server/.agents/skills/writing-for-agents/SKILL.md +81 -0
- package/templates/hono-server/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
- package/templates/hono-server/.changeset/README.md +8 -0
- package/templates/hono-server/.changeset/config.json +11 -0
- package/templates/hono-server/.editorconfig +31 -0
- package/templates/hono-server/.gitattributes +39 -0
- package/templates/hono-server/.vscode/extensions.json +5 -0
- package/templates/hono-server/.vscode/launch.json +29 -0
- package/templates/hono-server/.vscode/settings.json +26 -0
- package/templates/hono-server/AGENTS.md +50 -0
- package/templates/hono-server/README.md +44 -0
- package/templates/hono-server/_gitignore +35 -0
- package/templates/hono-server/apps/server/.dev.vars.example +9 -0
- package/templates/hono-server/apps/server/package.json +64 -0
- package/templates/hono-server/apps/server/src/adapters/cloudflare/entry.ts +36 -0
- package/templates/hono-server/apps/server/src/adapters/nodejs/bootstrap.ts +61 -0
- package/templates/hono-server/apps/server/src/adapters/nodejs/entry.ts +62 -0
- package/templates/hono-server/apps/server/src/app.ts +43 -0
- package/templates/hono-server/apps/server/src/config.ts +47 -0
- package/templates/hono-server/apps/server/src/infra/logger/getter.ts +74 -0
- package/templates/hono-server/apps/server/src/infra/logger/pino.ts +126 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/constants.ts +23 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/errors.ts +40 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/example/worker-entry.ts +13 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/pass-through/runner.ts +42 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/piscina/runner.ts +185 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/types.ts +118 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/utils/business-error.ts +19 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/utils/message.ts +49 -0
- package/templates/hono-server/apps/server/src/infra/work-runner/utils/transfer.ts +144 -0
- package/templates/hono-server/apps/server/src/middlewares/cors.ts +26 -0
- package/templates/hono-server/apps/server/src/modules/example/contracts.ts +9 -0
- package/templates/hono-server/apps/server/src/modules/example/routes.ts +73 -0
- package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.test.ts +49 -0
- package/templates/hono-server/apps/server/src/modules/example/work-task/tasks.ts +58 -0
- package/templates/hono-server/apps/server/src/shared/app/types.ts +44 -0
- package/templates/hono-server/apps/server/src/shared/errors/constants.ts +152 -0
- package/templates/hono-server/apps/server/src/shared/errors/defs/index.ts +15 -0
- package/templates/hono-server/apps/server/src/shared/errors/handler.ts +16 -0
- package/templates/hono-server/apps/server/src/shared/errors/log.ts +67 -0
- package/templates/hono-server/apps/server/src/shared/errors/proto.ts +42 -0
- package/templates/hono-server/apps/server/src/shared/errors/types.ts +29 -0
- package/templates/hono-server/apps/server/src/shared/network/fetcher.ts +35 -0
- package/templates/hono-server/apps/server/src/shared/network/openapi/index.ts +50 -0
- package/templates/hono-server/apps/server/src/shared/network/openapi/res-defs.ts +39 -0
- package/templates/hono-server/apps/server/src/shared/network/types.ts +3 -0
- package/templates/hono-server/apps/server/src/shared/network/utils.ts +36 -0
- package/templates/hono-server/apps/server/src/shared/network/validator.ts +28 -0
- package/templates/hono-server/apps/server/src/shared/utils/index.ts +30 -0
- package/templates/hono-server/apps/server/src/virtual-modules.d.ts +5 -0
- package/templates/hono-server/apps/server/tsconfig.json +17 -0
- package/templates/hono-server/apps/server/vite.config.ts +87 -0
- package/templates/hono-server/apps/server/wrangler.jsonc +29 -0
- package/templates/hono-server/docker/.env.example +4 -0
- package/templates/hono-server/docker/README.md +5 -0
- package/templates/hono-server/docker/local/compose.local.app.yml +21 -0
- package/templates/hono-server/docker/local/local-app-deploy.sh +8 -0
- package/templates/hono-server/docker/local/local-app-down.sh +8 -0
- package/templates/hono-server/docker/prod/.env.example.server +11 -0
- package/templates/hono-server/docker/prod/compose.prod.stack.yml +21 -0
- package/templates/hono-server/docker/prod/update.sh +7 -0
- package/templates/hono-server/docker/server.Dockerfile +38 -0
- package/templates/hono-server/docker/server.Dockerfile.dockerignore +23 -0
- package/templates/hono-server/docs/agents/domain.md +41 -0
- package/templates/hono-server/docs/agents/issue-tracker.md +30 -0
- package/templates/hono-server/docs/agents/triage-labels.md +15 -0
- package/templates/hono-server/envs/.env.example.server +12 -0
- package/templates/hono-server/envs/.env.example.sqlite +1 -0
- package/templates/hono-server/envs/.env.example.sqlite-d1 +3 -0
- package/templates/hono-server/libs/db/drizzle-kit/sqlite-d1.config.ts +22 -0
- package/templates/hono-server/libs/db/drizzle-kit/sqlite.config.ts +22 -0
- package/templates/hono-server/libs/db/package.json +42 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/client.ts +35 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/d1-client.ts +12 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/columns.ts +37 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/index.ts +7 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/modules/examples/examples.ts +22 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/relations.ts +5 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/tables.ts +5 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/types.ts +7 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/schema/vo.ts +1 -0
- package/templates/hono-server/libs/db/src/dialects/sqlite/utils.ts +8 -0
- package/templates/hono-server/libs/db/src/shared/types.ts +26 -0
- package/templates/hono-server/libs/db/tsconfig.json +10 -0
- package/templates/hono-server/libs/db/vite.config.ts +25 -0
- package/templates/hono-server/libs/definition/package.json +29 -0
- package/templates/hono-server/libs/definition/src/backend.ts +2 -0
- package/templates/hono-server/libs/definition/src/configs/defs/log.ts +53 -0
- package/templates/hono-server/libs/definition/src/configs/defs/middleware.ts +16 -0
- package/templates/hono-server/libs/definition/src/configs/defs/runtime.ts +12 -0
- package/templates/hono-server/libs/definition/src/configs/defs/sqlite.ts +26 -0
- package/templates/hono-server/libs/definition/src/configs/defs/worker.ts +29 -0
- package/templates/hono-server/libs/definition/src/configs/index.ts +5 -0
- package/templates/hono-server/libs/definition/src/configs/proto.ts +81 -0
- package/templates/hono-server/libs/definition/src/configs/schema.ts +23 -0
- package/templates/hono-server/libs/definition/src/modules/example/index.ts +16 -0
- package/templates/hono-server/libs/definition/src/modules/index.ts +1 -0
- package/templates/hono-server/libs/definition/tsconfig.json +5 -0
- package/templates/hono-server/libs/definition/vite.config.ts +15 -0
- package/templates/hono-server/oyo.config.json +13 -0
- package/templates/hono-server/package.json +25 -0
- package/templates/hono-server/pnpm-workspace.yaml +66 -0
- package/templates/hono-server/scripts/.env.example.docker +4 -0
- package/templates/hono-server/scripts/build-docker-server.sh +13 -0
- package/templates/hono-server/scripts/common.sh +20 -0
- package/templates/hono-server/tsconfig.json +4 -0
- package/templates/hono-server/turbo.json +36 -0
- package/templates/hono-server/vite.config.ts +14 -0
- package/templates/monorepo/.agents/skills/ask-matt/PHASE-BOUNDARIES.md +55 -0
- package/templates/monorepo/.agents/skills/ask-matt/SKILL.md +90 -0
- package/templates/monorepo/.agents/skills/ask-matt/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/code-review/SKILL.md +87 -0
- package/templates/monorepo/.agents/skills/code-review/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/codebase-design/DEEPENING.md +37 -0
- package/templates/monorepo/.agents/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
- package/templates/monorepo/.agents/skills/codebase-design/SKILL.md +114 -0
- package/templates/monorepo/.agents/skills/codebase-design/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/confirm-requirements/SKILL.md +25 -0
- package/templates/monorepo/.agents/skills/diagnosing-bugs/SKILL.md +140 -0
- package/templates/monorepo/.agents/skills/diagnosing-bugs/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +44 -0
- package/templates/monorepo/.agents/skills/domain-modeling/ADR-FORMAT.md +47 -0
- package/templates/monorepo/.agents/skills/domain-modeling/CONTEXT-FORMAT.md +60 -0
- package/templates/monorepo/.agents/skills/domain-modeling/SKILL.md +74 -0
- package/templates/monorepo/.agents/skills/domain-modeling/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/grill-me/SKILL.md +7 -0
- package/templates/monorepo/.agents/skills/grill-me/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/grilling/SKILL.md +22 -0
- package/templates/monorepo/.agents/skills/grilling/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/implement/SKILL.md +15 -0
- package/templates/monorepo/.agents/skills/implement/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/improve-codebase-architecture/HTML-REPORT.md +123 -0
- package/templates/monorepo/.agents/skills/improve-codebase-architecture/SKILL.md +71 -0
- package/templates/monorepo/.agents/skills/improve-codebase-architecture/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/prototype/LOGIC.md +67 -0
- package/templates/monorepo/.agents/skills/prototype/SKILL.md +26 -0
- package/templates/monorepo/.agents/skills/prototype/UI.md +112 -0
- package/templates/monorepo/.agents/skills/prototype/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/research/SKILL.md +12 -0
- package/templates/monorepo/.agents/skills/research/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/resolving-merge-conflicts/SKILL.md +14 -0
- package/templates/monorepo/.agents/skills/resolving-merge-conflicts/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/scoped-code-review/SKILL.md +113 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/SKILL.md +116 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/domain.md +51 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-github.md +45 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +46 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/issue-tracker-local.md +30 -0
- package/templates/monorepo/.agents/skills/setup-matt-pocock-skills/triage-labels.md +15 -0
- package/templates/monorepo/.agents/skills/tdd/SKILL.md +38 -0
- package/templates/monorepo/.agents/skills/tdd/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/tdd/mocking.md +59 -0
- package/templates/monorepo/.agents/skills/tdd/tests.md +77 -0
- package/templates/monorepo/.agents/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/templates/monorepo/.agents/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/templates/monorepo/.agents/skills/teach/MISSION-FORMAT.md +31 -0
- package/templates/monorepo/.agents/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/templates/monorepo/.agents/skills/teach/SKILL.md +140 -0
- package/templates/monorepo/.agents/skills/teach/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/to-questionnaire/SKILL.md +53 -0
- package/templates/monorepo/.agents/skills/to-questionnaire/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/triage/AGENT-BRIEF.md +207 -0
- package/templates/monorepo/.agents/skills/triage/OUT-OF-SCOPE.md +105 -0
- package/templates/monorepo/.agents/skills/triage/SKILL.md +112 -0
- package/templates/monorepo/.agents/skills/triage/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/wait-what/SKILL.md +7 -0
- package/templates/monorepo/.agents/skills/wait-what/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/wayfinder/SKILL.md +128 -0
- package/templates/monorepo/.agents/skills/wayfinder/agents/openai.yaml +5 -0
- package/templates/monorepo/.agents/skills/wizard/SKILL.md +44 -0
- package/templates/monorepo/.agents/skills/wizard/agents/openai.yaml +3 -0
- package/templates/monorepo/.agents/skills/wizard/template.sh +204 -0
- package/templates/monorepo/.agents/skills/writing-for-agents/SKILL-MECHANICS.md +22 -0
- package/templates/monorepo/.agents/skills/writing-for-agents/SKILL.md +81 -0
- package/templates/monorepo/.agents/skills/writing-for-agents/agents/openai.yaml +3 -0
- package/templates/monorepo/.vscode/extensions.json +5 -0
- package/templates/monorepo/.vscode/launch.json +0 -3
- package/templates/monorepo/.vscode/settings.json +3 -1
- package/templates/monorepo/AGENTS.md +50 -0
- package/templates/monorepo/README.md +27 -0
- package/templates/monorepo/_gitignore +5 -0
- package/templates/monorepo/docs/agents/domain.md +41 -0
- package/templates/monorepo/docs/agents/issue-tracker.md +30 -0
- package/templates/monorepo/docs/agents/triage-labels.md +15 -0
- package/templates/monorepo/package.json +4 -3
- package/templates/monorepo/pnpm-workspace.yaml +23 -26
- package/templates/monorepo/turbo.json +27 -3
- package/templates/monorepo/vite.config.ts +1 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "@oyolincc/dev-config/tsconfig.bundler.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"types": ["node", "./worker-configuration.d.ts"],
|
|
5
|
+
"verbatimModuleSyntax": true,
|
|
6
|
+
"jsx": "react-jsx",
|
|
7
|
+
"jsxImportSource": "hono/jsx",
|
|
8
|
+
"outDir": "./dist",
|
|
9
|
+
"paths": {
|
|
10
|
+
"@/*": ["./src/*"],
|
|
11
|
+
"@error-categories": ["./src/shared/errors/defs/index.ts"]
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [],
|
|
15
|
+
"include": ["src", "./*.ts", "./*.mts"],
|
|
16
|
+
"exclude": ["node_modules"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { defineConfig, type Plugin } from 'vite-plus'
|
|
2
|
+
import { packConfig } from '@oyolincc/dev-config'
|
|
3
|
+
import devServer from '@hono/vite-dev-server'
|
|
4
|
+
import nodeAdapter from '@hono/vite-dev-server/node'
|
|
5
|
+
import { loadEnvSync } from '@oyolincc/env-loader'
|
|
6
|
+
import path from 'node:path'
|
|
7
|
+
// import { builtinModules } from 'node:module'
|
|
8
|
+
|
|
9
|
+
const __dirname = import.meta.dirname
|
|
10
|
+
const isServe = !!process.env.VITE_PUBLIC_DEV_SERVE
|
|
11
|
+
const workersDir = path.resolve(__dirname, 'dist/workers')
|
|
12
|
+
|
|
13
|
+
function virtualWorkers(kind: 'dev' | 'pack'): Plugin {
|
|
14
|
+
const virtualId = 'virtual:workers'
|
|
15
|
+
const resolvedId = `\0${virtualId}`
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
name: 'virtual-workers',
|
|
19
|
+
resolveId(id) {
|
|
20
|
+
if (id === virtualId) return resolvedId
|
|
21
|
+
return null
|
|
22
|
+
},
|
|
23
|
+
load(id) {
|
|
24
|
+
if (id !== resolvedId) return null
|
|
25
|
+
// vp dev / test: Piscina cannot follow Vite's module graph; pack --watch writes dist/workers.
|
|
26
|
+
if (kind === 'dev') {
|
|
27
|
+
return `export default ${JSON.stringify(workersDir)}`
|
|
28
|
+
}
|
|
29
|
+
// vp pack: inlined into the server entry, so import.meta.dirname is dist/.
|
|
30
|
+
return "import path from 'node:path'\nexport default path.join(import.meta.dirname, 'workers')"
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default defineConfig(() => {
|
|
36
|
+
return {
|
|
37
|
+
test: {
|
|
38
|
+
clearMocks: false,
|
|
39
|
+
},
|
|
40
|
+
plugins: [
|
|
41
|
+
virtualWorkers('dev'),
|
|
42
|
+
{
|
|
43
|
+
name: 'node-bootstrap',
|
|
44
|
+
async configureServer() {
|
|
45
|
+
loadEnvSync({
|
|
46
|
+
preset: 'server',
|
|
47
|
+
})
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
devServer({
|
|
51
|
+
entry: './src/adapters/nodejs/entry.ts',
|
|
52
|
+
adapter: nodeAdapter(),
|
|
53
|
+
}) as Plugin,
|
|
54
|
+
],
|
|
55
|
+
pack: {
|
|
56
|
+
...packConfig,
|
|
57
|
+
plugins: [virtualWorkers('pack')],
|
|
58
|
+
deps: {
|
|
59
|
+
neverBundle: ['cloudflare:workers'],
|
|
60
|
+
},
|
|
61
|
+
entry: {
|
|
62
|
+
...(isServe
|
|
63
|
+
? {}
|
|
64
|
+
: {
|
|
65
|
+
nodejsMain: './src/adapters/nodejs/bootstrap.ts',
|
|
66
|
+
}),
|
|
67
|
+
nodejsEntry: './src/adapters/nodejs/entry.ts',
|
|
68
|
+
cloudflareEntry: './src/adapters/cloudflare/entry.ts',
|
|
69
|
+
// Enable this entry together with PiscinaWorkRunner in the Node.js adapter.
|
|
70
|
+
// 'workers/example-worker': './src/infra/work-runner/example/worker-entry.ts',
|
|
71
|
+
},
|
|
72
|
+
// deps: {
|
|
73
|
+
// neverBundle: [...builtinModules],
|
|
74
|
+
// },
|
|
75
|
+
},
|
|
76
|
+
resolve: {
|
|
77
|
+
alias: {
|
|
78
|
+
'@': path.resolve(__dirname, './src'),
|
|
79
|
+
'@error-categories': path.resolve(__dirname, './src/shared/errors/defs/index.ts'),
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
server: {
|
|
83
|
+
port: Number(process.env.NODE_PORT) || 6464,
|
|
84
|
+
host: true,
|
|
85
|
+
},
|
|
86
|
+
}
|
|
87
|
+
})
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/wrangler/config-schema.json",
|
|
3
|
+
"name": "repo-server-dev",
|
|
4
|
+
"main": "./src/adapters/cloudflare/entry.ts",
|
|
5
|
+
"compatibility_date": "2026-09-23",
|
|
6
|
+
"compatibility_flags": ["nodejs_compat"],
|
|
7
|
+
"dev": {
|
|
8
|
+
"port": 6464,
|
|
9
|
+
"inspector_port": 19230,
|
|
10
|
+
},
|
|
11
|
+
"observability": {
|
|
12
|
+
"logs": {
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"invocation_logs": true,
|
|
15
|
+
},
|
|
16
|
+
"traces": {
|
|
17
|
+
"enabled": false,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
"d1_databases": [
|
|
21
|
+
{
|
|
22
|
+
"binding": "DB",
|
|
23
|
+
"database_name": "repo-db",
|
|
24
|
+
"database_id": "00000000-0000-0000-0000-000000000000",
|
|
25
|
+
"migrations_dir": "../../libs/db/migrations/sqlite-d1",
|
|
26
|
+
"migrations_pattern": "../../libs/db/migrations/sqlite-d1/*/migration.sql",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react'
|
|
2
|
+
import { Header } from './Header'
|
|
3
|
+
|
|
4
|
+
export function AppLayout({ children }: { children: ReactNode }) {
|
|
5
|
+
return (
|
|
6
|
+
<div className="min-h-screen bg-zinc-950 text-zinc-100">
|
|
7
|
+
<Header />
|
|
8
|
+
{children}
|
|
9
|
+
</div>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CreateExampleInput,
|
|
3
|
+
Example,
|
|
4
|
+
ProcessExampleInput,
|
|
5
|
+
ProcessExampleOutput,
|
|
6
|
+
} from '@repo/definition/frontend'
|
|
7
|
+
import { request } from '#/shared/network/client'
|
|
8
|
+
|
|
9
|
+
export const listExamples = () => request<Example[]>('examples')
|
|
10
|
+
export const createExample = (input: CreateExampleInput) =>
|
|
11
|
+
request<Example>('examples', { method: 'post', json: input })
|
|
12
|
+
export const processExample = (input: ProcessExampleInput) =>
|
|
13
|
+
request<ProcessExampleOutput>('examples/process', { method: 'post', json: input })
|
package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleForm.tsx
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { FormEvent } from 'react'
|
|
2
|
+
|
|
3
|
+
interface ExampleFormProps {
|
|
4
|
+
message: string
|
|
5
|
+
saving: boolean
|
|
6
|
+
processing: boolean
|
|
7
|
+
onMessageChange: (message: string) => void
|
|
8
|
+
onSave: () => Promise<void>
|
|
9
|
+
onProcess: () => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function ExampleForm({
|
|
13
|
+
message,
|
|
14
|
+
saving,
|
|
15
|
+
processing,
|
|
16
|
+
onMessageChange,
|
|
17
|
+
onSave,
|
|
18
|
+
onProcess,
|
|
19
|
+
}: ExampleFormProps) {
|
|
20
|
+
const submit = async (event: FormEvent) => {
|
|
21
|
+
event.preventDefault()
|
|
22
|
+
await onSave()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<form className="flex gap-2" onSubmit={submit}>
|
|
27
|
+
<input
|
|
28
|
+
className="min-w-0 flex-1 rounded border border-zinc-700 bg-zinc-900 px-3 py-2"
|
|
29
|
+
value={message}
|
|
30
|
+
onChange={(event) => onMessageChange(event.target.value)}
|
|
31
|
+
placeholder="Message"
|
|
32
|
+
/>
|
|
33
|
+
<button className="rounded bg-blue-600 px-4 py-2" disabled={!message.trim() || saving}>
|
|
34
|
+
Save
|
|
35
|
+
</button>
|
|
36
|
+
<button
|
|
37
|
+
className="rounded bg-emerald-600 px-4 py-2"
|
|
38
|
+
type="button"
|
|
39
|
+
disabled={!message.trim() || processing}
|
|
40
|
+
onClick={onProcess}>
|
|
41
|
+
Process
|
|
42
|
+
</button>
|
|
43
|
+
</form>
|
|
44
|
+
)
|
|
45
|
+
}
|
package/templates/hono-fullstack/apps/stack/frontend/modules/example/components/ExampleList.tsx
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Example } from '@repo/definition/frontend'
|
|
2
|
+
|
|
3
|
+
export function ExampleList({ examples }: { examples?: Example[] }) {
|
|
4
|
+
return (
|
|
5
|
+
<ul className="grid gap-2">
|
|
6
|
+
{examples?.map((example) => (
|
|
7
|
+
<li className="rounded border border-zinc-800 p-3" key={example.id}>
|
|
8
|
+
{example.message}
|
|
9
|
+
</li>
|
|
10
|
+
))}
|
|
11
|
+
</ul>
|
|
12
|
+
)
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
|
2
|
+
import { createExample, listExamples, processExample } from '../api'
|
|
3
|
+
|
|
4
|
+
export const exampleQueryKey = ['examples'] as const
|
|
5
|
+
|
|
6
|
+
export const useExamples = () => useQuery({ queryKey: exampleQueryKey, queryFn: listExamples })
|
|
7
|
+
export function useCreateExample() {
|
|
8
|
+
const queryClient = useQueryClient()
|
|
9
|
+
return useMutation({
|
|
10
|
+
mutationFn: createExample,
|
|
11
|
+
onSuccess: () => queryClient.invalidateQueries({ queryKey: exampleQueryKey }),
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
export const useProcessExample = () => useMutation({ mutationFn: processExample })
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// This file was automatically generated by TanStack Router.
|
|
4
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
5
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
6
|
+
import { Route as ApiSplatRouteImport } from './routes/api/$'
|
|
7
|
+
|
|
8
|
+
const IndexRoute = IndexRouteImport.update({
|
|
9
|
+
id: '/',
|
|
10
|
+
path: '/',
|
|
11
|
+
getParentRoute: () => rootRouteImport,
|
|
12
|
+
} as any)
|
|
13
|
+
const ApiSplatRoute = ApiSplatRouteImport.update({
|
|
14
|
+
id: '/api/$',
|
|
15
|
+
path: '/api/$',
|
|
16
|
+
getParentRoute: () => rootRouteImport,
|
|
17
|
+
} as any)
|
|
18
|
+
|
|
19
|
+
export interface FileRoutesByFullPath {
|
|
20
|
+
'/': typeof IndexRoute
|
|
21
|
+
'/api/$': typeof ApiSplatRoute
|
|
22
|
+
}
|
|
23
|
+
export interface FileRoutesByTo {
|
|
24
|
+
'/': typeof IndexRoute
|
|
25
|
+
'/api/$': typeof ApiSplatRoute
|
|
26
|
+
}
|
|
27
|
+
export interface FileRoutesById {
|
|
28
|
+
__root__: typeof rootRouteImport
|
|
29
|
+
'/': typeof IndexRoute
|
|
30
|
+
'/api/$': typeof ApiSplatRoute
|
|
31
|
+
}
|
|
32
|
+
export interface FileRouteTypes {
|
|
33
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
34
|
+
fullPaths: '/' | '/api/$'
|
|
35
|
+
fileRoutesByTo: FileRoutesByTo
|
|
36
|
+
to: '/' | '/api/$'
|
|
37
|
+
id: '__root__' | '/' | '/api/$'
|
|
38
|
+
fileRoutesById: FileRoutesById
|
|
39
|
+
}
|
|
40
|
+
export interface RootRouteChildren {
|
|
41
|
+
IndexRoute: typeof IndexRoute
|
|
42
|
+
ApiSplatRoute: typeof ApiSplatRoute
|
|
43
|
+
}
|
|
44
|
+
declare module '@tanstack/react-router' {
|
|
45
|
+
interface FileRoutesByPath {
|
|
46
|
+
'/': {
|
|
47
|
+
id: '/'
|
|
48
|
+
path: '/'
|
|
49
|
+
fullPath: '/'
|
|
50
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
51
|
+
parentRoute: typeof rootRouteImport
|
|
52
|
+
}
|
|
53
|
+
'/api/$': {
|
|
54
|
+
id: '/api/$'
|
|
55
|
+
path: '/api/$'
|
|
56
|
+
fullPath: '/api/$'
|
|
57
|
+
preLoaderRoute: typeof ApiSplatRouteImport
|
|
58
|
+
parentRoute: typeof rootRouteImport
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const rootRouteChildren: RootRouteChildren = { IndexRoute, ApiSplatRoute }
|
|
63
|
+
export const routeTree = rootRouteImport
|
|
64
|
+
._addFileChildren(rootRouteChildren)
|
|
65
|
+
._addFileTypes<FileRouteTypes>()
|
|
66
|
+
|
|
67
|
+
import type { getRouter } from './router.tsx'
|
|
68
|
+
declare module '@tanstack/react-start' {
|
|
69
|
+
interface Register {
|
|
70
|
+
ssr: true
|
|
71
|
+
router: Awaited<ReturnType<typeof getRouter>>
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { QueryClient } from '@tanstack/react-query'
|
|
2
|
+
import { createRouter as createTanStackRouter } from '@tanstack/react-router'
|
|
3
|
+
import { createStore } from 'jotai'
|
|
4
|
+
import { routeTree } from './routeTree.gen'
|
|
5
|
+
|
|
6
|
+
export function getRouter() {
|
|
7
|
+
const queryClient = new QueryClient()
|
|
8
|
+
const store = createStore()
|
|
9
|
+
return createTanStackRouter({
|
|
10
|
+
routeTree,
|
|
11
|
+
context: { queryClient, store },
|
|
12
|
+
scrollRestoration: true,
|
|
13
|
+
defaultPreload: 'intent',
|
|
14
|
+
defaultPreloadStaleTime: 0,
|
|
15
|
+
})
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare module '@tanstack/react-router' {
|
|
19
|
+
interface Register {
|
|
20
|
+
router: ReturnType<typeof getRouter>
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { QueryClient } from '@tanstack/react-query'
|
|
2
|
+
import { QueryClientProvider } from '@tanstack/react-query'
|
|
3
|
+
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
|
|
4
|
+
import {
|
|
5
|
+
HeadContent,
|
|
6
|
+
Navigate,
|
|
7
|
+
Outlet,
|
|
8
|
+
Scripts,
|
|
9
|
+
createRootRouteWithContext,
|
|
10
|
+
} from '@tanstack/react-router'
|
|
11
|
+
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
|
|
12
|
+
import { Provider as JotaiProvider, type createStore } from 'jotai'
|
|
13
|
+
import appCss from '../styles.css?url'
|
|
14
|
+
|
|
15
|
+
export const Route = createRootRouteWithContext<{
|
|
16
|
+
queryClient: QueryClient
|
|
17
|
+
store: ReturnType<typeof createStore>
|
|
18
|
+
}>()({
|
|
19
|
+
head: () => ({
|
|
20
|
+
meta: [
|
|
21
|
+
{ charSet: 'utf-8' },
|
|
22
|
+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
23
|
+
{ title: 'Hono fullstack' },
|
|
24
|
+
],
|
|
25
|
+
links: [{ rel: 'stylesheet', href: appCss }],
|
|
26
|
+
}),
|
|
27
|
+
component: RootComponent,
|
|
28
|
+
notFoundComponent: () => <Navigate to="/" />,
|
|
29
|
+
shellComponent: RootDocument,
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
function RootComponent() {
|
|
33
|
+
const { queryClient, store } = Route.useRouteContext()
|
|
34
|
+
return (
|
|
35
|
+
<QueryClientProvider client={queryClient}>
|
|
36
|
+
<JotaiProvider store={store}>
|
|
37
|
+
<Outlet />
|
|
38
|
+
</JotaiProvider>
|
|
39
|
+
{import.meta.env.DEV && (
|
|
40
|
+
<>
|
|
41
|
+
<ReactQueryDevtools buttonPosition="bottom-left" />
|
|
42
|
+
<TanStackRouterDevtools position="bottom-right" />
|
|
43
|
+
</>
|
|
44
|
+
)}
|
|
45
|
+
</QueryClientProvider>
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
50
|
+
return (
|
|
51
|
+
<html lang="en" className="dark">
|
|
52
|
+
<head>
|
|
53
|
+
<HeadContent />
|
|
54
|
+
</head>
|
|
55
|
+
<body>
|
|
56
|
+
{children}
|
|
57
|
+
<Scripts />
|
|
58
|
+
</body>
|
|
59
|
+
</html>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { handleApiRequest } from '#server-runtime'
|
|
3
|
+
|
|
4
|
+
const serve = async ({ request }: { request: Request }) => handleApiRequest(request)
|
|
5
|
+
|
|
6
|
+
export const Route = createFileRoute('/api/$')({
|
|
7
|
+
server: {
|
|
8
|
+
handlers: {
|
|
9
|
+
GET: serve,
|
|
10
|
+
POST: serve,
|
|
11
|
+
PUT: serve,
|
|
12
|
+
PATCH: serve,
|
|
13
|
+
DELETE: serve,
|
|
14
|
+
OPTIONS: serve,
|
|
15
|
+
HEAD: serve,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
})
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { useAtom } from 'jotai'
|
|
3
|
+
import { ErrorMessage } from '#/components/general/ErrorMessage'
|
|
4
|
+
import { AppLayout } from '#/components/layouts/AppLayout'
|
|
5
|
+
import { Page } from '#/components/layouts/Page'
|
|
6
|
+
import { PageContainer } from '#/components/layouts/PageContainer'
|
|
7
|
+
import { ExampleForm } from '#/modules/example/components/ExampleForm'
|
|
8
|
+
import { ExampleList } from '#/modules/example/components/ExampleList'
|
|
9
|
+
import { useCreateExample, useExamples, useProcessExample } from '#/modules/example/hooks/api-hooks'
|
|
10
|
+
import { exampleMessageAtom } from '#/modules/example/stores'
|
|
11
|
+
|
|
12
|
+
export const Route = createFileRoute('/')({ component: Home })
|
|
13
|
+
|
|
14
|
+
function Home() {
|
|
15
|
+
const [message, setMessage] = useAtom(exampleMessageAtom)
|
|
16
|
+
const examples = useExamples()
|
|
17
|
+
const create = useCreateExample()
|
|
18
|
+
const process = useProcessExample()
|
|
19
|
+
|
|
20
|
+
const save = async () => {
|
|
21
|
+
await create.mutateAsync({ message })
|
|
22
|
+
setMessage('')
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<AppLayout>
|
|
27
|
+
<PageContainer>
|
|
28
|
+
<Page>
|
|
29
|
+
<header>
|
|
30
|
+
<h1 className="text-3xl font-bold">Example workspace</h1>
|
|
31
|
+
<p className="text-zinc-400">Nitro mounts the independent Hono server under /api.</p>
|
|
32
|
+
</header>
|
|
33
|
+
<ExampleForm
|
|
34
|
+
message={message}
|
|
35
|
+
saving={create.isPending}
|
|
36
|
+
processing={process.isPending}
|
|
37
|
+
onMessageChange={setMessage}
|
|
38
|
+
onSave={save}
|
|
39
|
+
onProcess={() => process.mutate({ message })}
|
|
40
|
+
/>
|
|
41
|
+
{process.data && (
|
|
42
|
+
<pre className="rounded bg-zinc-900 p-4">{JSON.stringify(process.data, null, 2)}</pre>
|
|
43
|
+
)}
|
|
44
|
+
<ErrorMessage error={create.error || process.error || examples.error} />
|
|
45
|
+
<ExampleList examples={examples.data} />
|
|
46
|
+
</Page>
|
|
47
|
+
</PageContainer>
|
|
48
|
+
</AppLayout>
|
|
49
|
+
)
|
|
50
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ky, { HTTPError, type Options } from 'ky'
|
|
2
|
+
import { NetworkDefaults } from './constants'
|
|
3
|
+
import { parseApiError } from './errors'
|
|
4
|
+
|
|
5
|
+
const client = ky.create({
|
|
6
|
+
prefix: NetworkDefaults.API_PREFIX,
|
|
7
|
+
timeout: NetworkDefaults.TIMEOUT,
|
|
8
|
+
retry: 0,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
export async function request<T>(path: string, options?: Options) {
|
|
12
|
+
try {
|
|
13
|
+
const response = await client(path, options).json<{ data: T }>()
|
|
14
|
+
return response.data
|
|
15
|
+
} catch (error) {
|
|
16
|
+
if (error instanceof HTTPError) throw await parseApiError(error)
|
|
17
|
+
throw error
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const NetworkDefaults = Object.freeze({ API_PREFIX: '/api', TIMEOUT: 15_000 })
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { HTTPError } from 'ky'
|
|
2
|
+
|
|
3
|
+
export type ProblemDetails = {
|
|
4
|
+
type?: string
|
|
5
|
+
title?: string
|
|
6
|
+
status?: number
|
|
7
|
+
detail?: string
|
|
8
|
+
message?: string
|
|
9
|
+
extensions?: Record<string, unknown>
|
|
10
|
+
[key: string]: unknown
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class ApiError extends Error {
|
|
14
|
+
constructor(
|
|
15
|
+
public readonly problem: ProblemDetails,
|
|
16
|
+
options?: ErrorOptions,
|
|
17
|
+
) {
|
|
18
|
+
super(problem.detail || problem.message || problem.title || 'Request failed', options)
|
|
19
|
+
this.name = 'ApiError'
|
|
20
|
+
}
|
|
21
|
+
get status() {
|
|
22
|
+
return this.problem.status
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const isApiError = (error: unknown, status?: number): error is ApiError =>
|
|
27
|
+
error instanceof ApiError && (status === undefined || error.status === status)
|
|
28
|
+
|
|
29
|
+
export async function parseApiError(error: HTTPError) {
|
|
30
|
+
const fallback = { title: error.response.statusText }
|
|
31
|
+
const problem = await error.response.json<ProblemDetails>().catch(() => fallback)
|
|
32
|
+
return new ApiError({ ...problem, status: error.response.status }, { cause: error })
|
|
33
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@import 'tailwindcss';
|
|
2
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
3
|
+
|
|
4
|
+
html,
|
|
5
|
+
body {
|
|
6
|
+
min-height: 100%;
|
|
7
|
+
margin: 0;
|
|
8
|
+
}
|
|
9
|
+
html.dark {
|
|
10
|
+
color-scheme: dark;
|
|
11
|
+
}
|
|
12
|
+
body {
|
|
13
|
+
background: #18181b;
|
|
14
|
+
color: #e4e4e7;
|
|
15
|
+
font-family: ui-sans-serif, system-ui, sans-serif;
|
|
16
|
+
}
|
|
17
|
+
button {
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
}
|
|
20
|
+
button:disabled {
|
|
21
|
+
cursor: not-allowed;
|
|
22
|
+
opacity: 0.5;
|
|
23
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@repo/stack",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "pnpm dev:node",
|
|
8
|
+
"build": "pnpm build:node",
|
|
9
|
+
"preview": "pnpm preview:node",
|
|
10
|
+
"dev:node-chain": "turbo watch dev:node --filter=@repo/stack",
|
|
11
|
+
"dev:node": "DEPLOY_TARGET=node SERVER_BASE_PATH=/api oyo env server -- vp dev",
|
|
12
|
+
"build:node-chain": "turbo build:node --filter=@repo/stack",
|
|
13
|
+
"build:node": "DEPLOY_TARGET=node SERVER_BASE_PATH=/api oyo env server -- vp build",
|
|
14
|
+
"preview:node": "DEPLOY_TARGET=node SERVER_BASE_PATH=/api oyo env server -- vp preview",
|
|
15
|
+
"dev:cloudflare-chain": "turbo watch dev:cloudflare --filter=@repo/stack",
|
|
16
|
+
"dev:cloudflare": "DEPLOY_TARGET=cloudflare vp dev",
|
|
17
|
+
"build:cloudflare-chain": "turbo build:cloudflare --filter=@repo/stack",
|
|
18
|
+
"build:cloudflare": "DEPLOY_TARGET=cloudflare vp build",
|
|
19
|
+
"preview:cloudflare": "DEPLOY_TARGET=cloudflare vp preview",
|
|
20
|
+
"deploy:cloudflare": "pnpm build:cloudflare-chain && wrangler deploy",
|
|
21
|
+
"db:migrate:cloudflare:local": "wrangler d1 migrations apply DB --local --config wrangler.jsonc --persist-to ../../.wrangler/state",
|
|
22
|
+
"cf:typegen": "wrangler types",
|
|
23
|
+
"cf:typecheck": "wrangler types --check",
|
|
24
|
+
"generate-routes": "tsr generate",
|
|
25
|
+
"test": "vp test",
|
|
26
|
+
"check": "vp check"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@repo/definition": "workspace:*",
|
|
30
|
+
"@repo/server": "workspace:*",
|
|
31
|
+
"@tanstack/react-query": "catalog:frontend",
|
|
32
|
+
"@tanstack/react-router": "catalog:frontend",
|
|
33
|
+
"@tanstack/react-start": "catalog:frontend",
|
|
34
|
+
"jotai": "catalog:frontend",
|
|
35
|
+
"ky": "catalog:shared",
|
|
36
|
+
"nitro": "catalog:",
|
|
37
|
+
"react": "catalog:frontend",
|
|
38
|
+
"react-dom": "catalog:frontend"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@cloudflare/vite-plugin": "catalog:",
|
|
42
|
+
"@oyolincc/cli": "catalog:",
|
|
43
|
+
"@oyolincc/dev-config": "catalog:",
|
|
44
|
+
"@rollup/pluginutils": "catalog:",
|
|
45
|
+
"@tailwindcss/vite": "catalog:frontend",
|
|
46
|
+
"@tanstack/react-query-devtools": "catalog:frontend",
|
|
47
|
+
"@tanstack/react-router-devtools": "catalog:frontend",
|
|
48
|
+
"@tanstack/router-cli": "catalog:frontend",
|
|
49
|
+
"@types/node": "catalog:",
|
|
50
|
+
"@types/react": "catalog:frontend",
|
|
51
|
+
"@types/react-dom": "catalog:frontend",
|
|
52
|
+
"@vitejs/plugin-react": "catalog:",
|
|
53
|
+
"fast-glob": "catalog:",
|
|
54
|
+
"tailwindcss": "catalog:frontend",
|
|
55
|
+
"typescript": "catalog:",
|
|
56
|
+
"vite-plus": "catalog:",
|
|
57
|
+
"wrangler": "catalog:"
|
|
58
|
+
}
|
|
59
|
+
}
|