├── templates ├── bun │ ├── .gitignore │ ├── tsconfig.json │ ├── README.md │ ├── src │ │ └── index.ts │ └── package.json ├── x-basic │ ├── public │ │ ├── .assetsignore │ │ └── favicon.ico │ ├── app │ │ ├── style.css │ │ ├── client.ts │ │ ├── global.d.ts │ │ ├── server.ts │ │ ├── routes │ │ │ ├── _404.tsx │ │ │ ├── _error.tsx │ │ │ ├── index.tsx │ │ │ └── _renderer.tsx │ │ └── islands │ │ │ └── counter.tsx │ ├── vite.config.ts │ ├── tsconfig.json │ ├── .gitignore │ ├── package.json │ └── wrangler.jsonc ├── cloudflare-workers+vite │ ├── public │ │ ├── .assetsignore │ │ └── favicon.ico │ ├── src │ │ ├── style.css │ │ ├── index.tsx │ │ └── renderer.tsx │ ├── wrangler.jsonc │ ├── vite.config.ts │ ├── tsconfig.json │ ├── README.md │ ├── .gitignore │ └── package.json ├── deno │ ├── README.md │ ├── .vscode │ │ ├── extensions.json │ │ └── settings.json │ ├── main.ts │ └── deno.json ├── nextjs │ ├── README.md │ ├── next.config.ts │ ├── next-env.d.ts │ ├── app │ │ ├── api │ │ │ └── [...route] │ │ │ │ └── route.ts │ │ ├── layout.tsx │ │ └── page.tsx │ ├── eslint.config.mjs │ ├── package.json │ ├── .gitignore │ └── tsconfig.json ├── aws-lambda │ ├── README.md │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ ├── .gitignore │ └── package.json ├── lambda-edge │ ├── README.md │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ ├── .gitignore │ └── package.json ├── netlify │ ├── netlify.toml │ ├── .vscode │ │ ├── extensions.json │ │ └── settings.json │ ├── netlify │ │ └── edge-functions │ │ │ └── index.ts │ └── .gitignore ├── cloudflare-pages │ ├── public │ │ └── static │ │ │ └── style.css │ ├── src │ │ ├── index.tsx │ │ └── renderer.tsx │ ├── tsconfig.json │ ├── vite.config.ts │ ├── README.md │ ├── .gitignore │ ├── package.json │ └── wrangler.jsonc ├── nodejs │ ├── README.md │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ ├── package.json │ └── .gitignore ├── cloudflare-workers │ ├── src │ │ └── index.ts │ ├── tsconfig.json │ ├── package.json │ ├── README.md │ ├── .gitignore │ └── wrangler.jsonc ├── fastly │ ├── src │ │ └── index.ts │ ├── fastly.toml │ ├── tsconfig.json │ ├── package.json │ └── README.md └── vercel │ ├── package.json │ ├── tsconfig.json │ ├── src │ └── index.ts │ ├── README.md │ └── .gitignore ├── .yarnrc.yml ├── .vscode └── settings.json ├── .prettierrc ├── .gitignore ├── package.json ├── README.md └── .github └── workflows └── sync-branch.yml /templates/bun/.gitignore: -------------------------------------------------------------------------------- 1 | # deps 2 | node_modules/ 3 | -------------------------------------------------------------------------------- /templates/x-basic/public/.assetsignore: -------------------------------------------------------------------------------- 1 | index.js 2 | .vite/ -------------------------------------------------------------------------------- /templates/cloudflare-workers+vite/public/.assetsignore: -------------------------------------------------------------------------------- 1 | .vite -------------------------------------------------------------------------------- /templates/deno/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | deno task start 3 | ``` 4 | -------------------------------------------------------------------------------- /templates/nextjs/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | npm install 3 | npm run dev 4 | ``` 5 | -------------------------------------------------------------------------------- /templates/x-basic/app/style.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss' source('../app'); 2 | -------------------------------------------------------------------------------- /templates/aws-lambda/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | npm install 3 | npm run deploy 4 | ``` 5 | -------------------------------------------------------------------------------- /templates/lambda-edge/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | npm install 3 | npm run deploy 4 | ``` 5 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | yarnPath: .yarn/releases/yarn-3.4.1.cjs 2 | nodeLinker: node-modules 3 | -------------------------------------------------------------------------------- /templates/netlify/netlify.toml: -------------------------------------------------------------------------------- 1 | [[edge_functions]] 2 | function = "index" 3 | path = "/*" -------------------------------------------------------------------------------- /templates/cloudflare-pages/public/static/style.css: -------------------------------------------------------------------------------- 1 | h1 { font-family: Arial, Helvetica, sans-serif; } -------------------------------------------------------------------------------- /templates/x-basic/app/client.ts: -------------------------------------------------------------------------------- 1 | import { createClient } from 'honox/client' 2 | 3 | createClient() 4 | -------------------------------------------------------------------------------- /templates/cloudflare-workers+vite/src/style.css: -------------------------------------------------------------------------------- 1 | h1 { 2 | font-family: Arial, Helvetica, sans-serif; 3 | } 4 | -------------------------------------------------------------------------------- /templates/deno/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "denoland.vscode-deno" 4 | ] 5 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.codeActionsOnSave": { 3 | "source.organizeImports": "explicit" 4 | } 5 | } -------------------------------------------------------------------------------- /templates/netlify/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "denoland.vscode-deno" 4 | ] 5 | } -------------------------------------------------------------------------------- /templates/x-basic/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honojs/starter/HEAD/templates/x-basic/public/favicon.ico -------------------------------------------------------------------------------- /templates/nodejs/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | npm install 3 | npm run dev 4 | ``` 5 | 6 | ``` 7 | open http://localhost:3000 8 | ``` 9 | -------------------------------------------------------------------------------- /templates/deno/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "deno.enablePaths": [ 3 | "./" 4 | ], 5 | "editor.inlayHints.enabled": "off" 6 | } -------------------------------------------------------------------------------- /templates/netlify/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "deno.enablePaths": [ 3 | "./" 4 | ], 5 | "editor.inlayHints.enabled": "off" 6 | } -------------------------------------------------------------------------------- /templates/cloudflare-workers+vite/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/honojs/starter/HEAD/templates/cloudflare-workers+vite/public/favicon.ico -------------------------------------------------------------------------------- /templates/bun/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "strict": true, 4 | "jsx": "react-jsx", 5 | "jsxImportSource": "hono/jsx" 6 | } 7 | } -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "trailingComma": "none", 4 | "tabWidth": 2, 5 | "semi": false, 6 | "singleQuote": true, 7 | "endOfLine": "lf" 8 | } 9 | -------------------------------------------------------------------------------- /templates/x-basic/app/global.d.ts: -------------------------------------------------------------------------------- 1 | import type {} from 'hono' 2 | 3 | declare module 'hono' { 4 | interface Env { 5 | Variables: {} 6 | Bindings: {} 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /templates/bun/README.md: -------------------------------------------------------------------------------- 1 | To install dependencies: 2 | ```sh 3 | bun install 4 | ``` 5 | 6 | To run: 7 | ```sh 8 | bun run dev 9 | ``` 10 | 11 | open http://localhost:3000 12 | -------------------------------------------------------------------------------- /templates/nextjs/next.config.ts: -------------------------------------------------------------------------------- 1 | import type { NextConfig } from 'next' 2 | 3 | const nextConfig: NextConfig = { 4 | /* config options here */ 5 | } 6 | 7 | export default nextConfig 8 | -------------------------------------------------------------------------------- /templates/bun/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono' 2 | 3 | const app = new Hono() 4 | 5 | app.get('/', (c) => { 6 | return c.text('Hello Hono!') 7 | }) 8 | 9 | export default app 10 | -------------------------------------------------------------------------------- /templates/deno/main.ts: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono' 2 | 3 | const app = new Hono() 4 | 5 | app.get('/', (c) => { 6 | return c.text('Hello Hono!') 7 | }) 8 | 9 | Deno.serve(app.fetch) 10 | -------------------------------------------------------------------------------- /templates/x-basic/app/server.ts: -------------------------------------------------------------------------------- 1 | import { showRoutes } from 'hono/dev' 2 | import { createApp } from 'honox/server' 3 | 4 | const app = createApp() 5 | 6 | showRoutes(app) 7 | 8 | export default app 9 | -------------------------------------------------------------------------------- /templates/cloudflare-workers/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono' 2 | 3 | const app = new Hono() 4 | 5 | app.get('/', (c) => { 6 | return c.text('Hello Hono!') 7 | }) 8 | 9 | export default app 10 | -------------------------------------------------------------------------------- /templates/cloudflare-workers+vite/wrangler.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/wrangler/config-schema.json", 3 | "name": "%%PROJECT_NAME%%", 4 | "compatibility_date": "2025-08-03", 5 | "main": "./src/index.tsx" 6 | } -------------------------------------------------------------------------------- /templates/x-basic/app/routes/_404.tsx: -------------------------------------------------------------------------------- 1 | import type { NotFoundHandler } from 'hono' 2 | 3 | const handler: NotFoundHandler = (c) => { 4 | c.status(404) 5 | return c.render('404 Not Found') 6 | } 7 | 8 | export default handler 9 | -------------------------------------------------------------------------------- /templates/bun/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "dev": "bun run --hot src/index.ts" 4 | }, 5 | "dependencies": { 6 | "hono": "^4.11.1" 7 | }, 8 | "devDependencies": { 9 | "@types/bun": "latest" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /templates/fastly/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono' 2 | import { fire } from '@fastly/hono-fastly-compute' 3 | 4 | const app = new Hono() 5 | 6 | app.get('/', (c) => { 7 | return c.text('Hello Hono!') 8 | }) 9 | 10 | fire(app) 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | yarn-error.log 4 | package-lock.json 5 | bin 6 | pkg 7 | .next 8 | deno.lock 9 | 10 | # yarn 11 | .yarn/* 12 | !.yarn/patches 13 | !.yarn/plugins 14 | !.yarn/releases 15 | !.yarn/sdks 16 | !.yarn/versions 17 | -------------------------------------------------------------------------------- /templates/aws-lambda/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono' 2 | import { handle } from 'hono/aws-lambda' 3 | 4 | const app = new Hono() 5 | 6 | app.get('/', (c) => { 7 | return c.text('Hello Hono!') 8 | }) 9 | 10 | export const handler = handle(app) 11 | -------------------------------------------------------------------------------- /templates/lambda-edge/src/index.ts: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono' 2 | import { handle } from 'hono/lambda-edge' 3 | 4 | const app = new Hono() 5 | 6 | app.get('/', (c) => { 7 | return c.text('Hello Hono!') 8 | }) 9 | 10 | export const handler = handle(app) 11 | -------------------------------------------------------------------------------- /templates/vercel/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hono", 3 | "type": "module", 4 | "dependencies": { 5 | "hono": "^4.11.1" 6 | }, 7 | "devDependencies": { 8 | "@types/node": "^20.11.17", 9 | "tsx": "^4.7.1", 10 | "typescript": "^5.8.3" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /templates/cloudflare-pages/src/index.tsx: -------------------------------------------------------------------------------- 1 | import { Hono } from 'hono' 2 | import { renderer } from './renderer' 3 | 4 | const app = new Hono() 5 | 6 | app.use(renderer) 7 | 8 | app.get('/', (c) => { 9 | return c.render(
{count}
8 | 14 |Loading...
17 | 18 | return{message}
19 | } 20 | -------------------------------------------------------------------------------- /templates/x-basic/vite.config.ts: -------------------------------------------------------------------------------- 1 | import build from '@hono/vite-build/cloudflare-workers' 2 | import adapter from '@hono/vite-dev-server/cloudflare' 3 | import tailwindcss from '@tailwindcss/vite' 4 | import honox from 'honox/vite' 5 | import { defineConfig } from 'vite' 6 | 7 | export default defineConfig({ 8 | plugins: [ 9 | honox({ 10 | devServer: { adapter }, 11 | client: { input: ['/app/client.ts', '/app/style.css'] } 12 | }), 13 | tailwindcss(), 14 | build() 15 | ] 16 | }) 17 | -------------------------------------------------------------------------------- /templates/cloudflare-pages/README.md: -------------------------------------------------------------------------------- 1 | ```txt 2 | npm install 3 | npm run dev 4 | ``` 5 | 6 | ```txt 7 | npm run deploy 8 | ``` 9 | 10 | [For generating/synchronizing types based on your Worker configuration run](https://developers.cloudflare.com/workers/wrangler/commands/#types): 11 | 12 | ```txt 13 | npm run cf-typegen 14 | ``` 15 | 16 | Pass the `CloudflareBindings` as generics when instantiation `Hono`: 17 | 18 | ```ts 19 | // src/index.ts 20 | const app = new Hono<{ Bindings: CloudflareBindings }>() 21 | ``` 22 | -------------------------------------------------------------------------------- /templates/cloudflare-workers/README.md: -------------------------------------------------------------------------------- 1 | ```txt 2 | npm install 3 | npm run dev 4 | ``` 5 | 6 | ```txt 7 | npm run deploy 8 | ``` 9 | 10 | [For generating/synchronizing types based on your Worker configuration run](https://developers.cloudflare.com/workers/wrangler/commands/#types): 11 | 12 | ```txt 13 | npm run cf-typegen 14 | ``` 15 | 16 | Pass the `CloudflareBindings` as generics when instantiation `Hono`: 17 | 18 | ```ts 19 | // src/index.ts 20 | const app = new Hono<{ Bindings: CloudflareBindings }>() 21 | ``` 22 | -------------------------------------------------------------------------------- /templates/cloudflare-workers+vite/README.md: -------------------------------------------------------------------------------- 1 | ```txt 2 | npm install 3 | npm run dev 4 | ``` 5 | 6 | ```txt 7 | npm run deploy 8 | ``` 9 | 10 | [For generating/synchronizing types based on your Worker configuration run](https://developers.cloudflare.com/workers/wrangler/commands/#types): 11 | 12 | ```txt 13 | npm run cf-typegen 14 | ``` 15 | 16 | Pass the `CloudflareBindings` as generics when instantiation `Hono`: 17 | 18 | ```ts 19 | // src/index.ts 20 | const app = new Hono<{ Bindings: CloudflareBindings }>() 21 | ``` 22 | -------------------------------------------------------------------------------- /templates/x-basic/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ESNext", 4 | "module": "ESNext", 5 | "moduleResolution": "Bundler", 6 | "strict": true, 7 | "skipLibCheck": true, 8 | "lib": [ 9 | "ESNext", 10 | "DOM" 11 | ], 12 | "types": [ 13 | "vite/client", 14 | "@cloudflare/workers-types/2023-07-01" 15 | ], 16 | "jsx": "react-jsx", 17 | "jsxImportSource": "hono/jsx" 18 | }, 19 | "include": [ 20 | "**/*.ts", 21 | "**/*.tsx" 22 | ] 23 | } -------------------------------------------------------------------------------- /templates/cloudflare-pages/.gitignore: -------------------------------------------------------------------------------- 1 | # prod 2 | dist/ 3 | 4 | # dev 5 | .yarn/ 6 | !.yarn/releases 7 | .vscode/* 8 | !.vscode/launch.json 9 | !.vscode/*.code-snippets 10 | .idea/workspace.xml 11 | .idea/usage.statistics.xml 12 | .idea/shelf 13 | 14 | # deps 15 | node_modules/ 16 | .wrangler 17 | 18 | # env 19 | .env 20 | .env.production 21 | .dev.vars 22 | 23 | # logs 24 | logs/ 25 | *.log 26 | npm-debug.log* 27 | yarn-debug.log* 28 | yarn-error.log* 29 | pnpm-debug.log* 30 | lerna-debug.log* 31 | 32 | # misc 33 | .DS_Store 34 | -------------------------------------------------------------------------------- /templates/cloudflare-workers/.gitignore: -------------------------------------------------------------------------------- 1 | # prod 2 | dist/ 3 | 4 | # dev 5 | .yarn/ 6 | !.yarn/releases 7 | .vscode/* 8 | !.vscode/launch.json 9 | !.vscode/*.code-snippets 10 | .idea/workspace.xml 11 | .idea/usage.statistics.xml 12 | .idea/shelf 13 | 14 | # deps 15 | node_modules/ 16 | .wrangler 17 | 18 | # env 19 | .env 20 | .env.production 21 | .dev.vars 22 | 23 | # logs 24 | logs/ 25 | *.log 26 | npm-debug.log* 27 | yarn-debug.log* 28 | yarn-error.log* 29 | pnpm-debug.log* 30 | lerna-debug.log* 31 | 32 | # misc 33 | .DS_Store 34 | -------------------------------------------------------------------------------- /templates/x-basic/.gitignore: -------------------------------------------------------------------------------- 1 | # prod 2 | dist/ 3 | 4 | # dev 5 | .hono/ 6 | .wrangler/ 7 | .yarn/ 8 | !.yarn/releases 9 | .vscode/* 10 | !.vscode/launch.json 11 | !.vscode/*.code-snippets 12 | .idea/workspace.xml 13 | .idea/usage.statistics.xml 14 | .idea/shelf 15 | 16 | # deps 17 | node_modules/ 18 | 19 | # env 20 | .env 21 | .env.production 22 | .dev.vars 23 | 24 | # logs 25 | logs/ 26 | *.log 27 | npm-debug.log* 28 | yarn-debug.log* 29 | yarn-error.log* 30 | pnpm-debug.log* 31 | lerna-debug.log* 32 | 33 | # misc 34 | .DS_Store 35 | -------------------------------------------------------------------------------- /templates/cloudflare-workers+vite/.gitignore: -------------------------------------------------------------------------------- 1 | # prod 2 | dist/ 3 | dist-server/ 4 | 5 | # dev 6 | .yarn/ 7 | !.yarn/releases 8 | .vscode/* 9 | !.vscode/launch.json 10 | !.vscode/*.code-snippets 11 | .idea/workspace.xml 12 | .idea/usage.statistics.xml 13 | .idea/shelf 14 | 15 | # deps 16 | node_modules/ 17 | .wrangler 18 | 19 | # env 20 | .env 21 | .env.production 22 | .dev.vars 23 | 24 | # logs 25 | logs/ 26 | *.log 27 | npm-debug.log* 28 | yarn-debug.log* 29 | yarn-error.log* 30 | pnpm-debug.log* 31 | lerna-debug.log* 32 | 33 | # misc 34 | .DS_Store 35 | -------------------------------------------------------------------------------- /templates/aws-lambda/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "scripts": { 4 | "build": "esbuild --bundle --outfile=./dist/index.js --platform=node --target=node20 ./src/index.ts", 5 | "zip": "zip -j lambda.zip dist/index.js", 6 | "update": "aws lambda update-function-code --zip-file fileb://lambda.zip --function-name hello", 7 | "deploy": "run-s build zip update" 8 | }, 9 | "devDependencies": { 10 | "esbuild": "^0.21.4", 11 | "npm-run-all2": "^6.2.0" 12 | }, 13 | "dependencies": { 14 | "hono": "^4.11.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /templates/cloudflare-pages/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vite build", 6 | "preview": "wrangler pages dev", 7 | "deploy": "$npm_execpath run build && wrangler pages deploy", 8 | "cf-typegen": "wrangler types --env-interface CloudflareBindings" 9 | }, 10 | "dependencies": { 11 | "hono": "^4.11.1" 12 | }, 13 | "devDependencies": { 14 | "@hono/vite-build": "^1.2.0", 15 | "@hono/vite-dev-server": "^0.18.2", 16 | "vite": "^6.3.5", 17 | "wrangler": "^4.4.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /templates/nextjs/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { dirname } from 'path' 2 | import { fileURLToPath } from 'url' 3 | import { FlatCompat } from '@eslint/eslintrc' 4 | 5 | const __filename = fileURLToPath(import.meta.url) 6 | const __dirname = dirname(__filename) 7 | 8 | const compat = new FlatCompat({ 9 | baseDirectory: __dirname 10 | }) 11 | 12 | const eslintConfig = [ 13 | ...compat.extends('next/core-web-vitals', 'next/typescript'), 14 | { 15 | ignores: ['node_modules/**', '.next/**', 'out/**', 'build/**', 'next-env.d.ts'] 16 | } 17 | ] 18 | 19 | export default eslintConfig 20 | -------------------------------------------------------------------------------- /templates/cloudflare-workers+vite/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vite build", 6 | "preview": "$npm_execpath run build && vite preview", 7 | "deploy": "$npm_execpath run build && wrangler deploy", 8 | "cf-typegen": "wrangler types --env-interface CloudflareBindings" 9 | }, 10 | "dependencies": { 11 | "hono": "^4.11.1" 12 | }, 13 | "devDependencies": { 14 | "@cloudflare/vite-plugin": "^1.2.3", 15 | "vite": "^6.3.5", 16 | "vite-ssr-components": "^0.5.1", 17 | "wrangler": "^4.17.0" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /templates/nextjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "scripts": { 4 | "dev": "next dev", 5 | "build": "next build", 6 | "start": "next start", 7 | "lint": "eslint" 8 | }, 9 | "dependencies": { 10 | "hono": "^4.11.1", 11 | "next": "15.5.2", 12 | "react": "19.1.0", 13 | "react-dom": "19.1.0" 14 | }, 15 | "devDependencies": { 16 | "@eslint/eslintrc": "^3", 17 | "@types/node": "^20", 18 | "@types/react": "^19", 19 | "@types/react-dom": "^19", 20 | "eslint": "^9", 21 | "eslint-config-next": "15.5.2", 22 | "typescript": "^5" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /templates/x-basic/app/routes/_renderer.tsx: -------------------------------------------------------------------------------- 1 | import { jsxRenderer } from 'hono/jsx-renderer' 2 | import { Link, Script } from 'honox/server' 3 | 4 | export default jsxRenderer(({ children }) => { 5 | return ( 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | {children} 15 | 16 | ) 17 | }) 18 | -------------------------------------------------------------------------------- /templates/lambda-edge/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "scripts": { 4 | "build": "esbuild --bundle --outfile=./dist/index.js --platform=node --target=node20 ./src/index.ts", 5 | "zip": "zip -j lambda.zip dist/index.js", 6 | "update": "aws lambda update-function-code --zip-file fileb://lambda.zip --function-name hello --region us-east-1", 7 | "publish": "aws lambda publish-version --function-name hello --region us-east-1", 8 | "deploy": "run-s build zip update publish" 9 | }, 10 | "devDependencies": { 11 | "esbuild": "^0.21.4", 12 | "npm-run-all2": "^6.2.0" 13 | }, 14 | "dependencies": { 15 | "hono": "^4.11.1" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /templates/nextjs/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | 13 | # testing 14 | /coverage 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | 20 | # production 21 | /build 22 | 23 | # misc 24 | .DS_Store 25 | *.pem 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | .pnpm-debug.log* 32 | 33 | # env files (can opt-in for committing if needed) 34 | .env* 35 | 36 | # vercel 37 | .vercel 38 | 39 | # typescript 40 | *.tsbuildinfo 41 | next-env.d.ts 42 | -------------------------------------------------------------------------------- /templates/x-basic/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "basic", 3 | "type": "module", 4 | "scripts": { 5 | "dev": "vite", 6 | "build": "vite build --mode client && vite build", 7 | "preview": "wrangler dev", 8 | "deploy": "$npm_execpath run build && wrangler deploy" 9 | }, 10 | "private": true, 11 | "dependencies": { 12 | "hono": "^4.11.1", 13 | "honox": "0.1.52" 14 | }, 15 | "devDependencies": { 16 | "@cloudflare/workers-types": "^4.20250214.0", 17 | "@hono/vite-build": "^1.3.0", 18 | "@hono/vite-dev-server": "^0.18.2", 19 | "@tailwindcss/vite": "^4.0.9", 20 | "tailwindcss": "^4.0.9", 21 | "vite": "^6.3.5", 22 | "wrangler": "^4.4.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /templates/nextjs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "forceConsistentCasingInFileNames": true, 9 | "noEmit": true, 10 | "esModuleInterop": true, 11 | "module": "esnext", 12 | "moduleResolution": "node", 13 | "resolveJsonModule": true, 14 | "isolatedModules": true, 15 | "jsx": "preserve", 16 | "incremental": true, 17 | "baseUrl": ".", 18 | "paths": { 19 | "@/*": ["./*"] 20 | }, 21 | "plugins": [ 22 | { 23 | "name": "next" 24 | } 25 | ] 26 | }, 27 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 28 | "exclude": ["node_modules"] 29 | } 30 | -------------------------------------------------------------------------------- /templates/fastly/README.md: -------------------------------------------------------------------------------- 1 | ``` 2 | npm install 3 | npm run start 4 | ``` 5 | 6 | ``` 7 | open http://localhost:7676 8 | ``` 9 | 10 | ``` 11 | npm run deploy 12 | ``` 13 | 14 | For [typed bindings based on your Fastly resources](https://github.com/fastly/hono-fastly-compute?tab=readme-ov-file#basic-example): 15 | 16 | Import `buildFire` instead of `fire` from `@fastly/hono-fastly-compute`, and define your resources. Then pass `fire.Bindings` as the generic parameter when instantiating `Hono`: 17 | 18 | ```ts 19 | // src/index.ts 20 | import { buildFire } from '@fastly/hono-fastly-compute' 21 | const fire = buildFire({ 22 | assets: 'KVStore', // A KV Store named 'assets' 23 | mySettings: 'ConfigStore:my-settings' // A Config Store named 'my-settings' 24 | }) 25 | const app = new Hono<{ Bindings: fire.Bindings }>() 26 | ``` 27 | -------------------------------------------------------------------------------- /templates/cloudflare-pages/wrangler.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/wrangler/config-schema.json", 3 | "name": "%%PROJECT_NAME%%", 4 | "compatibility_date": "2024-04-01", 5 | "pages_build_output_dir": "./dist", 6 | "compatibility_flags": [ 7 | "nodejs_compat" 8 | ] 9 | // "vars": { 10 | // "MY_VAR": "my-variable" 11 | // }, 12 | // "kv_namespaces": [ 13 | // { 14 | // "binding": "MY_KV_NAMESPACE", 15 | // "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 16 | // } 17 | // ], 18 | // "r2_buckets": [ 19 | // { 20 | // "binding": "MY_BUCKET", 21 | // "bucket_name": "my-bucket" 22 | // } 23 | // ], 24 | // "d1_databases": [ 25 | // { 26 | // "binding": "MY_DB", 27 | // "database_name": "my-database", 28 | // "database_id": "" 29 | // } 30 | // ], 31 | // "ai": { 32 | // "binding": "AI" 33 | // } 34 | } -------------------------------------------------------------------------------- /templates/x-basic/wrangler.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/wrangler/config-schema.json", 3 | "name": "%%PROJECT_NAME%%", 4 | "main": "./dist/index.js", 5 | "compatibility_date": "2024-04-01", 6 | "compatibility_flags": [ 7 | "nodejs_compat" 8 | ], 9 | "assets": { 10 | "directory": "./dist" 11 | } 12 | // "vars": { 13 | // "MY_VAR": "my-variable" 14 | // }, 15 | // "kv_namespaces": [ 16 | // { 17 | // "binding": "MY_KV_NAMESPACE", 18 | // "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 19 | // } 20 | // ], 21 | // "r2_buckets": [ 22 | // { 23 | // "binding": "MY_BUCKET", 24 | // "bucket_name": "my-bucket" 25 | // } 26 | // ], 27 | // "d1_databases": [ 28 | // { 29 | // "binding": "MY_DB", 30 | // "database_name": "my-database", 31 | // "database_id": "" 32 | // } 33 | // ], 34 | // "ai": { 35 | // "binding": "AI" 36 | // } 37 | } -------------------------------------------------------------------------------- /templates/cloudflare-workers/wrangler.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "node_modules/wrangler/config-schema.json", 3 | "name": "%%PROJECT_NAME%%", 4 | "main": "src/index.ts", 5 | "compatibility_date": "2025-08-03" 6 | // "compatibility_flags": [ 7 | // "nodejs_compat" 8 | // ], 9 | // "vars": { 10 | // "MY_VAR": "my-variable" 11 | // }, 12 | // "kv_namespaces": [ 13 | // { 14 | // "binding": "MY_KV_NAMESPACE", 15 | // "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 16 | // } 17 | // ], 18 | // "r2_buckets": [ 19 | // { 20 | // "binding": "MY_BUCKET", 21 | // "bucket_name": "my-bucket" 22 | // } 23 | // ], 24 | // "d1_databases": [ 25 | // { 26 | // "binding": "MY_DB", 27 | // "database_name": "my-database", 28 | // "database_id": "" 29 | // } 30 | // ], 31 | // "ai": { 32 | // "binding": "AI" 33 | // }, 34 | // "observability": { 35 | // "enabled": true, 36 | // "head_sampling_rate": 1 37 | // } 38 | } -------------------------------------------------------------------------------- /.github/workflows/sync-branch.yml: -------------------------------------------------------------------------------- 1 | name: Sync versioned branch 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | permissions: 9 | contents: write 10 | 11 | jobs: 12 | sync_branch: 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout repository 17 | uses: actions/checkout@v4 18 | with: 19 | token: ${{ secrets.GITHUB_TOKEN }} 20 | 21 | - name: Setup Node.js 22 | uses: actions/setup-node@v4 23 | with: 24 | node-version: 22 25 | 26 | - name: Get create-hono version 27 | id: get_version 28 | run: | 29 | VERSION=$(npm show create-hono version) 30 | MAJOR_MINOR=$(echo "$VERSION" | cut -d '.' -f 1,2) 31 | echo "Detected version: $VERSION" 32 | echo "Branch name: v$MAJOR_MINOR" 33 | echo "branch_name=v$MAJOR_MINOR" >> "$GITHUB_ENV" 34 | 35 | - name: Setup Git 36 | run: | 37 | git config user.name "github-actions[bot]" 38 | git config user.email "41898282+github-actions[bot]@users.noreply.github.com" 39 | 40 | - name: Sync branch 41 | run: | 42 | git fetch origin 43 | git switch ${{ env.branch_name }} || git switch -c ${{ env.branch_name }} 44 | git reset --hard origin/main 45 | git push origin ${{ env.branch_name }} --force 46 | --------------------------------------------------------------------------------