Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions apps/api/component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: sourceplane.io/v1
kind: Component
metadata:
name: api
description: The Hono API (a plain Cloudflare Worker, per environment)
spec:
type: cloudflare-worker-turbo
lifecycle: production
owner: platform
domain: api
path: apps/api
subscribe:
environments:
- name: dev
profile: verify
- name: stage
profile: verify
profileRules:
- profile: deploy
when:
triggerRef: github-push-main
- name: prod
profile: verify
profileRules:
- profile: deploy
when:
triggerRef: github-push-main
parameters:
nodeVersion: "22"
pnpmVersion: "10.12.1"

workspaceDir: ../..
appDir: .

orgName: sourceplane
owner: sourceplane
repo: hono-api

turboFilter: "@app/api"
# Committed, not rendered: the Worker binds nothing, so there are no
# resource IDs to wire. Per-env names come from `--env`: hono-api-api-{stage,prod}.
wranglerConfig: wrangler.jsonc

installCommand: pnpm install --frozen-lockfile
buildCommand: pnpm exec turbo run build --filter=@app/api
typecheckCommand: pnpm exec turbo run typecheck --filter=@app/api

dryRunCommand: pnpm exec wrangler deploy --dry-run --config wrangler.jsonc --env prod
deployCommand: pnpm exec wrangler deploy --config wrangler.jsonc --env prod

preDeployCommand: "echo 'No pre-deploy step configured.'"
migrationCommand: "echo 'No migrations configured.'"
smokeCommand: "echo 'No smoke test configured.'"
labels:
team: platform
layer: runtime
surface: api
runtime: cloudflare
2 changes: 2 additions & 0 deletions apps/api/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import config from "../../tooling/eslint/index.js";
export default config;
23 changes: 23 additions & 0 deletions apps/api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@app/api",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "wrangler dev",
"build": "wrangler deploy --dry-run --outdir dist",
"deploy": "wrangler deploy",
"typecheck": "tsc --noEmit",
"lint": "eslint src"
},
"dependencies": {
"hono": "^4.13.0"
},
"devDependencies": {
"@app/eslint-config": "workspace:*",
"@app/tsconfig": "workspace:*",
"@cloudflare/workers-types": "^5.20261006.1",
"typescript": "^5.8.3",
"wrangler": "^4.151.0"
}
}
14 changes: 14 additions & 0 deletions apps/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Hono } from 'hono'

const app = new Hono()

const welcomeStrings = [
"Hello Hono!",
"To learn more about Hono on Cloudflare Workers, visit https://hono.dev/docs/getting-started/cloudflare-workers",
]

app.get('/', (c) => {
return c.text(welcomeStrings.join('\n\n'))
})

export default app
11 changes: 11 additions & 0 deletions apps/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../tooling/tsconfig/worker.json",
"compilerOptions": {
"composite": false,
"noEmit": true,
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx"
},
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules", "dist"]
}
33 changes: 33 additions & 0 deletions apps/api/wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// The Worker binds nothing, so this file is committed as-is (no wiring
// template). Orun deploys with `--env stage` / `--env prod`; wrangler names
// the Worker hono-api-api-<env> from the top-level name.
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "hono-api-api",
"main": "src/index.ts",
"compatibility_date": "2026-10-01",
"compatibility_flags": ["nodejs_compat"],
"observability": {
"enabled": true
},
"vars": {
"ENVIRONMENT": "local"
},
"env": {
"dev": {
"vars": {
"ENVIRONMENT": "dev"
}
},
"stage": {
"vars": {
"ENVIRONMENT": "stage"
}
},
"prod": {
"vars": {
"ENVIRONMENT": "prod"
}
}
}
}
Loading
Loading