diff --git a/apps/hono/.gitignore b/apps/hono/.gitignore new file mode 100644 index 0000000..1009b20 --- /dev/null +++ b/apps/hono/.gitignore @@ -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 diff --git a/apps/hono/README.md b/apps/hono/README.md new file mode 100644 index 0000000..feaad51 --- /dev/null +++ b/apps/hono/README.md @@ -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) diff --git a/apps/hono/api.sh b/apps/hono/api.sh new file mode 100755 index 0000000..aa95018 --- /dev/null +++ b/apps/hono/api.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +docker compose --profile api build +docker compose run --rm --name nirvgraph-api nirvgraph-api bash diff --git a/apps/hono/api/README.md b/apps/hono/api/README.md new file mode 100644 index 0000000..a2d0450 --- /dev/null +++ b/apps/hono/api/README.md @@ -0,0 +1,8 @@ +``` +bun install +bun run dev +``` + +``` +open http://localhost:3000 +``` diff --git a/apps/hono/api/bun.lockb b/apps/hono/api/bun.lockb new file mode 100755 index 0000000..1ef2024 Binary files /dev/null and b/apps/hono/api/bun.lockb differ diff --git a/apps/hono/api/bunfig.toml b/apps/hono/api/bunfig.toml new file mode 100644 index 0000000..c3ffbed --- /dev/null +++ b/apps/hono/api/bunfig.toml @@ -0,0 +1,10 @@ +telemetry = false + +[install] +exact = true +auto = "auto" + +[test] +preload = ["./src/test/setup.ts"] +coverage = true +root = "src" diff --git a/apps/hono/api/package.json b/apps/hono/api/package.json new file mode 100644 index 0000000..154854a --- /dev/null +++ b/apps/hono/api/package.json @@ -0,0 +1,11 @@ +{ + "scripts": { + "dev": "bun run --hot src/index.ts" + }, + "dependencies": { + "hono": "^3.10.1" + }, + "devDependencies": { + "bun-types": "^1.0.7" + } +} diff --git a/apps/hono/api/src/index.ts b/apps/hono/api/src/index.ts new file mode 100644 index 0000000..c3d6158 --- /dev/null +++ b/apps/hono/api/src/index.ts @@ -0,0 +1,7 @@ +import { Hono } from 'hono' + +const app = new Hono() + +app.get('/', (c) => c.text('Hello Hono!')) + +export default app diff --git a/apps/hono/api/src/test/setup.ts b/apps/hono/api/src/test/setup.ts new file mode 100644 index 0000000..1e207ab --- /dev/null +++ b/apps/hono/api/src/test/setup.ts @@ -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 diff --git a/apps/hono/api/tsconfig.json b/apps/hono/api/tsconfig.json new file mode 100644 index 0000000..74a140a --- /dev/null +++ b/apps/hono/api/tsconfig.json @@ -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 + ] + } +} diff --git a/apps/hono/docker-compose.yaml b/apps/hono/docker-compose.yaml new file mode 100644 index 0000000..ef73531 --- /dev/null +++ b/apps/hono/docker-compose.yaml @@ -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 diff --git a/apps/hono/tsconfig.json b/apps/hono/tsconfig.json new file mode 100644 index 0000000..74a140a --- /dev/null +++ b/apps/hono/tsconfig.json @@ -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 + ] + } +}