-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10b7260
commit f6b34b1
Showing
29 changed files
with
135 additions
and
921 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,17 +7,18 @@ | |
"keywords": [], | ||
"private": true, | ||
"packageManager": "[email protected]", | ||
"main": "dist/index.js", | ||
"main": "dist/index.mjs", | ||
"type": "module", | ||
"scripts": { | ||
"lint": "eslint --max-warnings=0 src", | ||
"lint:fix": "eslint --fix --max-warnings=0 src", | ||
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc", | ||
"start": "NODE_ENV=production node dist/index.js", | ||
"dev": "NODE_ENV=development tsx --watch ./src/index.ts", | ||
"start": "NODE_ENV=production node dist/index.mjs", | ||
"dev": "NODE_ENV=development tsx --watch ./src/index.mts", | ||
"test": "NODE_ENV=test vitest", | ||
"test:ci": "NODE_ENV=ci vitest run", | ||
"build:kill-dist": "rimraf ./dist", | ||
"build:code": "tsc && tscpaths -p tsconfig.json -s ./src -o ./dist", | ||
"build:code": "tsc && tsc-alias", | ||
"build": "pnpm run build:kill-dist && pnpm run build:code", | ||
"postbuild": "node postbuild.mjs", | ||
"db:explorer": "drizzle-kit studio", | ||
|
@@ -35,7 +36,7 @@ | |
"pg": "^8.12.0", | ||
"prettier": "^3.3.2", | ||
"rimraf": "^5.0.7", | ||
"tscpaths": "^0.0.9", | ||
"tsc-alias": "^1.8.10", | ||
"tsx": "^4.15.7", | ||
"typescript": "^5.5.2", | ||
"vite-tsconfig-paths": "^4.3.2", | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { drizzle } from "drizzle-orm/postgres-js"; | ||
import postgres from "postgres"; | ||
|
||
import { env } from "@/config/env"; | ||
import * as schema from "./schema"; | ||
import { env } from "@/config/env.mjs"; | ||
import * as schema from "./schema.mjs"; | ||
|
||
const client = postgres(env.DATABASE_URL); | ||
export const db = drizzle(client, { schema, logger: true }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { db } from "./drizzle.mjs"; |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/routers/app/auth/index.ts → src/routers/app/auth/index.mts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 27 additions & 7 deletions
34
src/routers/app/ui/index.ts → src/routers/app/ui/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,43 @@ | ||
import type { ServerContext } from "@/types/hono"; | ||
import type { ServerContext } from "@/types/hono.mjs"; | ||
import { Hono } from "hono"; | ||
import { html } from "hono/html"; | ||
import type { FC } from "hono/jsx"; | ||
|
||
import { db } from "@/config/db"; | ||
import { db } from "@/config/db/index.mjs"; | ||
|
||
const app = new Hono<ServerContext>(); | ||
|
||
const Layout: FC = ({ children }) => { | ||
return ( | ||
<html> | ||
<head> | ||
<script | ||
src="https://unpkg.com/[email protected]" | ||
integrity="sha384-D1Kt99CQMDuVetoL1lrYwg5t+9QdHe7NLX/SoJYkXDFfX37iInKRy5xLSi8nO7UC" | ||
crossorigin="anonymous" | ||
></script> | ||
<script src="https://unpkg.com/htmx.org/dist/ext/json-enc.js"></script> | ||
<script src="https://cdn.tailwindcss.com"></script> | ||
</head> | ||
<body>{children}</body> | ||
</html> | ||
); | ||
}; | ||
|
||
app.get("/login", async (c) => { | ||
const user = c.var.user; | ||
|
||
if (user) { | ||
return c.redirect("/app"); | ||
} | ||
|
||
return c.render( | ||
html`<div style="display: grid;gap: 0.5rem;"> | ||
<a href="/app/login/github">Login with Github</a> | ||
<a href="/app">← Go back</a> | ||
</div>`, | ||
return c.html( | ||
<Layout> | ||
<div style="display: grid;gap: 0.5rem;"> | ||
<a href="/app/login/github">Login with Github</a> | ||
<a href="/app">← Go back</a> | ||
</div> | ||
</Layout>, | ||
); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters