build ready (I hope)

This commit is contained in:
2025-08-10 18:46:45 -04:00
parent 32c516bf37
commit a8a6d02cc7
12 changed files with 67 additions and 62 deletions

View File

@@ -1,14 +1,8 @@
SHELL := /bin/bash SHELL := /bin/bash
build: build:
sudo docker buildx build --load \ pnpm run build
--cache-from=type=local,src=/var/cache/docker-build \ pnpm run -F server dbdeploy
--cache-to=type=local,dest=/var/cache/docker-build \
--platform linux/arm64 \
--progress=plain \
--tag games .
npm run dbdeploy
start: start:
sudo docker run -p $(PORT):3000 -p 5555:5555 -t games PORT=$(PORT) pnpm run start

View File

@@ -1,5 +1,5 @@
{ {
"name": "client", "name": "@games/client",
"type": "module", "type": "module",
"version": "0.0.2", "version": "0.0.2",
"scripts": { "scripts": {
@@ -9,8 +9,8 @@
"dependencies": { "dependencies": {
"@elysiajs/eden": "^1.3.2", "@elysiajs/eden": "^1.3.2",
"@solidjs/router": "^0.15.3", "@solidjs/router": "^0.15.3",
"hono": "^4.8.12", "solid-js": "^1.9.5",
"solid-js": "^1.9.5" "object-hash": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"vite": "^7.0.6", "vite": "^7.0.6",

View File

@@ -3,4 +3,8 @@ import solidPlugin from "vite-plugin-solid";
export default defineConfig({ export default defineConfig({
plugins: [solidPlugin()], plugins: [solidPlugin()],
build: {
outDir: "../server/public",
emptyOutDir: true,
},
}); });

View File

@@ -1,2 +1,3 @@
# deps # deps
node_modules/ node_modules/
public

View File

@@ -1,5 +1,5 @@
{ {
"name": "server", "name": "@games/server",
"scripts": { "scripts": {
"dev": "concurrently 'pnpm run devserver' 'pnpm run dbstudio'", "dev": "concurrently 'pnpm run devserver' 'pnpm run dbstudio'",
"devserver": "NODE_ENV=development PORT=5001 bun run --hot src/index.ts", "devserver": "NODE_ENV=development PORT=5001 bun run --hot src/index.ts",
@@ -8,17 +8,16 @@
"dbtypes": "pnpm dlx prisma generate", "dbtypes": "pnpm dlx prisma generate",
"dbsync": "pnpm dlx prisma migrate dev", "dbsync": "pnpm dlx prisma migrate dev",
"dbwipe": "pnpm dlx prisma migrate reset", "dbwipe": "pnpm dlx prisma migrate reset",
"start": "NODE_ENV=production PORT=5001 bun run src/index.ts" "prod": "NODE_ENV=production bun run src/index.ts",
"start": "concurrently 'pnpm run prod' 'pnpm run dbstudio'"
}, },
"dependencies": { "dependencies": {
"@elysiajs/cors": "^1.3.3", "@elysiajs/cors": "^1.3.3",
"@elysiajs/static": "^1.3.0", "@elysiajs/static": "^1.3.0",
"@hono/zod-validator": "^0.7.2", "@games/shared": "workspace:*",
"@prisma/client": "6.13.0", "@prisma/client": "6.13.0",
"elysia": "^1.3.8", "elysia": "^1.3.8",
"hono": "^4.8.12", "object-hash": "^3.0.0"
"object-hash": "^3.0.0",
"zod": "^4.0.15"
}, },
"devDependencies": { "devDependencies": {
"@types/bun": "latest", "@types/bun": "latest",

View File

@@ -6,7 +6,7 @@ import {
shuffle, shuffle,
vCard, vCard,
} from "../../../shared/cards"; } from "../../../shared/cards";
import { heq } from "../../../shared/utils"; import { heq } from "@games/shared/utils";
import { Elysia, t } from "elysia"; import { Elysia, t } from "elysia";
import { prisma } from "../db/db"; import { prisma } from "../db/db";

View File

@@ -17,7 +17,14 @@ const app = new Elysia()
}) })
.get("/ping", () => "pong") .get("/ping", () => "pong")
.use(api) .use(api)
.use(staticPlugin({ assets: "./dist", prefix: "" })) .get("/*", () => Bun.file("./public/index.html"))
.use(
staticPlugin({
assets: "public",
prefix: "/",
alwaysStatic: true,
})
)
.listen(port); .listen(port);
console.log("server started on", port); console.log("server started on", port);

View File

@@ -1,4 +1,5 @@
{ {
"extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"strict": true, "strict": true,
"jsx": "react-jsx", "jsx": "react-jsx",

View File

@@ -0,0 +1,7 @@
{
"name": "@games/shared",
"version": "1.0.0",
"dependencies": {
"object-hash": "^3.0.0"
}
}

View File

@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"esModuleInterop": true
}
}

62
pnpm-lock.yaml generated
View File

@@ -23,9 +23,9 @@ importers:
'@solidjs/router': '@solidjs/router':
specifier: ^0.15.3 specifier: ^0.15.3
version: 0.15.3(solid-js@1.9.8) version: 0.15.3(solid-js@1.9.8)
hono: object-hash:
specifier: ^4.8.12 specifier: ^3.0.0
version: 4.8.12 version: 3.0.0
solid-js: solid-js:
specifier: ^1.9.5 specifier: ^1.9.5
version: 1.9.8 version: 1.9.8
@@ -45,28 +45,22 @@ importers:
'@elysiajs/static': '@elysiajs/static':
specifier: ^1.3.0 specifier: ^1.3.0
version: 1.3.0(elysia@1.3.8(exact-mirror@0.1.5(@sinclair/typebox@0.34.38))(file-type@21.0.0)(typescript@5.9.2)) version: 1.3.0(elysia@1.3.8(exact-mirror@0.1.5(@sinclair/typebox@0.34.38))(file-type@21.0.0)(typescript@5.9.2))
'@hono/zod-validator': '@games/shared':
specifier: ^0.7.2 specifier: workspace:*
version: 0.7.2(hono@4.8.12)(zod@4.0.15) version: link:../shared
'@prisma/client': '@prisma/client':
specifier: 6.13.0 specifier: 6.13.0
version: 6.13.0(prisma@6.13.0(typescript@5.9.2))(typescript@5.9.2) version: 6.13.0(prisma@6.13.0(typescript@5.9.2))(typescript@5.9.2)
elysia: elysia:
specifier: ^1.3.8 specifier: ^1.3.8
version: 1.3.8(exact-mirror@0.1.5(@sinclair/typebox@0.34.38))(file-type@21.0.0)(typescript@5.9.2) version: 1.3.8(exact-mirror@0.1.5(@sinclair/typebox@0.34.38))(file-type@21.0.0)(typescript@5.9.2)
hono:
specifier: ^4.8.12
version: 4.8.12
object-hash: object-hash:
specifier: ^3.0.0 specifier: ^3.0.0
version: 3.0.0 version: 3.0.0
zod:
specifier: ^4.0.15
version: 4.0.15
devDependencies: devDependencies:
'@types/bun': '@types/bun':
specifier: latest specifier: latest
version: 1.2.19(@types/react@19.1.9) version: 1.2.20(@types/react@19.1.9)
concurrently: concurrently:
specifier: ^9.2.0 specifier: ^9.2.0
version: 9.2.0 version: 9.2.0
@@ -74,6 +68,12 @@ importers:
specifier: 6.13.0 specifier: 6.13.0
version: 6.13.0(typescript@5.9.2) version: 6.13.0(typescript@5.9.2)
packages/shared:
dependencies:
object-hash:
specifier: ^3.0.0
version: 3.0.0
packages: packages:
'@ampproject/remapping@2.3.0': '@ampproject/remapping@2.3.0':
@@ -332,12 +332,6 @@ packages:
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
'@hono/zod-validator@0.7.2':
resolution: {integrity: sha512-ub5eL/NeZ4eLZawu78JpW/J+dugDAYhwqUIdp9KYScI6PZECij4Hx4UsrthlEUutqDDhPwRI0MscUfNkvn/mqQ==}
peerDependencies:
hono: '>=3.9.0'
zod: ^3.25.0 || ^4.0.0
'@jridgewell/gen-mapping@0.3.12': '@jridgewell/gen-mapping@0.3.12':
resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==} resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==}
@@ -511,8 +505,8 @@ packages:
'@types/babel__traverse@7.28.0': '@types/babel__traverse@7.28.0':
resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==}
'@types/bun@1.2.19': '@types/bun@1.2.20':
resolution: {integrity: sha512-d9ZCmrH3CJ2uYKXQIUuZ/pUnTqIvLDS0SK7pFmbx8ma+ziH/FRMoAq5bYpRG7y+w1gl+HgyNZbtqgMq4W4e2Lg==} resolution: {integrity: sha512-dX3RGzQ8+KgmMw7CsW4xT5ITBSCrSbfHc36SNT31EOUg/LA9JWq0VDdEXDRSe1InVWpd2yLUM1FUF/kEOyTzYA==}
'@types/estree@1.0.8': '@types/estree@1.0.8':
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
@@ -556,8 +550,8 @@ packages:
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
hasBin: true hasBin: true
bun-types@1.2.19: bun-types@1.2.20:
resolution: {integrity: sha512-uAOTaZSPuYsWIXRpj7o56Let0g/wjihKCkeRqUBhlLVM/Bt+Fj9xTo+LhC1OV1XDaGkz4hNC80et5xgy+9KTHQ==} resolution: {integrity: sha512-pxTnQYOrKvdOwyiyd/7sMt9yFOenN004Y6O4lCcCUoKVej48FS5cvTw9geRaEcB9TsDZaJKAxPTVvi8tFsVuXA==}
peerDependencies: peerDependencies:
'@types/react': ^19 '@types/react': ^19
@@ -730,10 +724,6 @@ packages:
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
hono@4.8.12:
resolution: {integrity: sha512-MQSKk1Mg7b74k8l+A025LfysnLtXDKkE4pLaSsYRQC5iy85lgZnuyeQ1Wynair9mmECzoLu+FtJtqNZSoogBDQ==}
engines: {node: '>=16.9.0'}
hosted-git-info@7.0.2: hosted-git-info@7.0.2:
resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==} resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==}
engines: {node: ^16.14.0 || >=18.0.0} engines: {node: ^16.14.0 || >=18.0.0}
@@ -1084,9 +1074,6 @@ packages:
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
engines: {node: '>=12'} engines: {node: '>=12'}
zod@4.0.15:
resolution: {integrity: sha512-2IVHb9h4Mt6+UXkyMs0XbfICUh1eUrlJJAOupBHUhLRnKkruawyDddYRCs0Eizt900ntIMk9/4RksYl+FgSpcQ==}
snapshots: snapshots:
'@ampproject/remapping@2.3.0': '@ampproject/remapping@2.3.0':
@@ -1296,11 +1283,6 @@ snapshots:
'@esbuild/win32-x64@0.25.8': '@esbuild/win32-x64@0.25.8':
optional: true optional: true
'@hono/zod-validator@0.7.2(hono@4.8.12)(zod@4.0.15)':
dependencies:
hono: 4.8.12
zod: 4.0.15
'@jridgewell/gen-mapping@0.3.12': '@jridgewell/gen-mapping@0.3.12':
dependencies: dependencies:
'@jridgewell/sourcemap-codec': 1.5.4 '@jridgewell/sourcemap-codec': 1.5.4
@@ -1450,9 +1432,9 @@ snapshots:
dependencies: dependencies:
'@babel/types': 7.28.2 '@babel/types': 7.28.2
'@types/bun@1.2.19(@types/react@19.1.9)': '@types/bun@1.2.20(@types/react@19.1.9)':
dependencies: dependencies:
bun-types: 1.2.19(@types/react@19.1.9) bun-types: 1.2.20(@types/react@19.1.9)
transitivePeerDependencies: transitivePeerDependencies:
- '@types/react' - '@types/react'
@@ -1500,7 +1482,7 @@ snapshots:
node-releases: 2.0.19 node-releases: 2.0.19
update-browserslist-db: 1.1.3(browserslist@4.25.1) update-browserslist-db: 1.1.3(browserslist@4.25.1)
bun-types@1.2.19(@types/react@19.1.9): bun-types@1.2.20(@types/react@19.1.9):
dependencies: dependencies:
'@types/node': 24.2.0 '@types/node': 24.2.0
'@types/react': 19.1.9 '@types/react': 19.1.9
@@ -1681,8 +1663,6 @@ snapshots:
has-flag@4.0.0: {} has-flag@4.0.0: {}
hono@4.8.12: {}
hosted-git-info@7.0.2: hosted-git-info@7.0.2:
dependencies: dependencies:
lru-cache: 10.4.3 lru-cache: 10.4.3
@@ -1999,5 +1979,3 @@ snapshots:
string-width: 4.2.3 string-width: 4.2.3
y18n: 5.0.8 y18n: 5.0.8
yargs-parser: 21.1.1 yargs-parser: 21.1.1
zod@4.0.15: {}

8
tsconfig.json Normal file
View File

@@ -0,0 +1,8 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@games/*": ["packages/*"]
}
}
}