Skip to content

Commit

Permalink
add hono template
Browse files Browse the repository at this point in the history
  • Loading branch information
noahehall committed Nov 17, 2023
1 parent 413913e commit db8a03e
Show file tree
Hide file tree
Showing 12 changed files with 313 additions and 0 deletions.
179 changes: 179 additions & 0 deletions apps/hono/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
##### custom
*tsbuildinfo

##### default
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
_.pid
_.seed
\*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
\*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

\*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'

\*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.cache
.parcel-cache

# Next.js build output

.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

.cache/

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp
.cache

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

.vscode-test

# yarn v2

.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.\*

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store
7 changes: 7 additions & 0 deletions apps/hono/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# NIRV GRAPH

- api for accessing the nirv graph locally via tinkerpop or on aws neptune

## links

- [github](https://github.com/Ogobar/nirvgraph)
4 changes: 4 additions & 0 deletions apps/hono/api.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

docker compose --profile api build
docker compose run --rm --name nirvgraph-api nirvgraph-api bash
8 changes: 8 additions & 0 deletions apps/hono/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
```
bun install
bun run dev
```

```
open http://localhost:3000
```
Binary file added apps/hono/api/bun.lockb
Binary file not shown.
10 changes: 10 additions & 0 deletions apps/hono/api/bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
telemetry = false

[install]
exact = true
auto = "auto"

[test]
preload = ["./src/test/setup.ts"]
coverage = true
root = "src"
11 changes: 11 additions & 0 deletions apps/hono/api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"scripts": {
"dev": "bun run --hot src/index.ts"
},
"dependencies": {
"hono": "^3.10.1"
},
"devDependencies": {
"bun-types": "^1.0.7"
}
}
7 changes: 7 additions & 0 deletions apps/hono/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Hono } from 'hono'

const app = new Hono()

app.get('/', (c) => c.text('Hello Hono!'))

export default app
17 changes: 17 additions & 0 deletions apps/hono/api/src/test/setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import * as buntest from "bun:test";

declare global {
// bun stuff
var describe: typeof buntest.describe;
var expect: typeof buntest.expect;
var test: typeof buntest.test;

// not bun stuff
}

// bun stuff
globalThis.describe = buntest.describe;
globalThis.expect = buntest.expect;
globalThis.test = buntest.test;

// not bun stuff
31 changes: 31 additions & 0 deletions apps/hono/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
"outFile": "types/index",
"rootDirs": ["src", "types"],
"allowImportingTsExtensions": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"baseUrl": "./src",
"composite": true,
"downlevelIteration": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx",
"lib": ["ESNext"],
"module": "esnext",
"moduleDetection": "force",
"moduleResolution": "bundler",
"declarationMap": true,
"declaration": true,
"emitDeclarationOnly": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext",
"types": [
"bun-types" // add Bun global
]
}
}
8 changes: 8 additions & 0 deletions apps/hono/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
nirvgraph-api:
profiles: ["api"]
container_name: nirvgraph-api
image: oven/bun:1.0.12
network_mode: host
volumes:
- ${PWD}/api:/home/bun/app
31 changes: 31 additions & 0 deletions apps/hono/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"include": ["src/**/*"],
"exclude": ["node_modules"],
"compilerOptions": {
"outFile": "types/index",
"rootDirs": ["src", "types"],
"allowImportingTsExtensions": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"alwaysStrict": true,
"baseUrl": "./src",
"composite": true,
"downlevelIteration": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx",
"lib": ["ESNext"],
"module": "esnext",
"moduleDetection": "force",
"moduleResolution": "bundler",
"declarationMap": true,
"declaration": true,
"emitDeclarationOnly": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext",
"types": [
"bun-types" // add Bun global
]
}
}

0 comments on commit db8a03e

Please sign in to comment.