build ready (I hope)
This commit is contained in:
13
Makefile
13
Makefile
@@ -1,14 +1,9 @@
|
||||
SHELL := /bin/bash
|
||||
|
||||
build:
|
||||
sudo docker buildx build --load \
|
||||
--cache-from=type=local,src=/var/cache/docker-build \
|
||||
--cache-to=type=local,dest=/var/cache/docker-build \
|
||||
--platform linux/arm64 \
|
||||
--progress=plain \
|
||||
--tag games .
|
||||
npm run dbdeploy
|
||||
|
||||
pnpm install
|
||||
pnpm run -F client build
|
||||
pnpm run -F server dbdeploy
|
||||
|
||||
start:
|
||||
sudo docker run -p $(PORT):3000 -p 5555:5555 -t games
|
||||
PORT=$(PORT) pnpm start
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "client",
|
||||
"name": "@games/client",
|
||||
"type": "module",
|
||||
"version": "0.0.2",
|
||||
"scripts": {
|
||||
@@ -9,8 +9,8 @@
|
||||
"dependencies": {
|
||||
"@elysiajs/eden": "^1.3.2",
|
||||
"@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": {
|
||||
"vite": "^7.0.6",
|
||||
|
||||
@@ -3,4 +3,8 @@ import solidPlugin from "vite-plugin-solid";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [solidPlugin()],
|
||||
build: {
|
||||
outDir: "../server/public",
|
||||
emptyOutDir: true,
|
||||
},
|
||||
});
|
||||
|
||||
1
packages/server/.gitignore
vendored
1
packages/server/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
# deps
|
||||
node_modules/
|
||||
public
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "server",
|
||||
"name": "@games/server",
|
||||
"scripts": {
|
||||
"dev": "concurrently 'pnpm run devserver' 'pnpm run dbstudio'",
|
||||
"devserver": "NODE_ENV=development PORT=5001 bun run --hot src/index.ts",
|
||||
@@ -8,17 +8,16 @@
|
||||
"dbtypes": "pnpm dlx prisma generate",
|
||||
"dbsync": "pnpm dlx prisma migrate dev",
|
||||
"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": {
|
||||
"@elysiajs/cors": "^1.3.3",
|
||||
"@elysiajs/static": "^1.3.0",
|
||||
"@hono/zod-validator": "^0.7.2",
|
||||
"@games/shared": "workspace:*",
|
||||
"@prisma/client": "6.13.0",
|
||||
"elysia": "^1.3.8",
|
||||
"hono": "^4.8.12",
|
||||
"object-hash": "^3.0.0",
|
||||
"zod": "^4.0.15"
|
||||
"object-hash": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest",
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
shuffle,
|
||||
vCard,
|
||||
} from "../../../shared/cards";
|
||||
import { heq } from "../../../shared/utils";
|
||||
import { heq } from "@games/shared/utils";
|
||||
import { Elysia, t } from "elysia";
|
||||
import { prisma } from "../db/db";
|
||||
|
||||
|
||||
@@ -17,7 +17,14 @@ const app = new Elysia()
|
||||
})
|
||||
.get("/ping", () => "pong")
|
||||
.use(api)
|
||||
.use(staticPlugin({ assets: "./dist", prefix: "" }))
|
||||
.get("/*", () => Bun.file("./public/index.html"))
|
||||
.use(
|
||||
staticPlugin({
|
||||
assets: "public",
|
||||
prefix: "/",
|
||||
alwaysStatic: true,
|
||||
})
|
||||
)
|
||||
.listen(port);
|
||||
|
||||
console.log("server started on", port);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"jsx": "react-jsx",
|
||||
|
||||
7
packages/shared/package.json
Normal file
7
packages/shared/package.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "@games/shared",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"object-hash": "^3.0.0"
|
||||
}
|
||||
}
|
||||
6
packages/shared/tsconfig.json
Normal file
6
packages/shared/tsconfig.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"esModuleInterop": true
|
||||
}
|
||||
}
|
||||
62
pnpm-lock.yaml
generated
62
pnpm-lock.yaml
generated
@@ -23,9 +23,9 @@ importers:
|
||||
'@solidjs/router':
|
||||
specifier: ^0.15.3
|
||||
version: 0.15.3(solid-js@1.9.8)
|
||||
hono:
|
||||
specifier: ^4.8.12
|
||||
version: 4.8.12
|
||||
object-hash:
|
||||
specifier: ^3.0.0
|
||||
version: 3.0.0
|
||||
solid-js:
|
||||
specifier: ^1.9.5
|
||||
version: 1.9.8
|
||||
@@ -45,28 +45,22 @@ importers:
|
||||
'@elysiajs/static':
|
||||
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))
|
||||
'@hono/zod-validator':
|
||||
specifier: ^0.7.2
|
||||
version: 0.7.2(hono@4.8.12)(zod@4.0.15)
|
||||
'@games/shared':
|
||||
specifier: workspace:*
|
||||
version: link:../shared
|
||||
'@prisma/client':
|
||||
specifier: 6.13.0
|
||||
version: 6.13.0(prisma@6.13.0(typescript@5.9.2))(typescript@5.9.2)
|
||||
elysia:
|
||||
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)
|
||||
hono:
|
||||
specifier: ^4.8.12
|
||||
version: 4.8.12
|
||||
object-hash:
|
||||
specifier: ^3.0.0
|
||||
version: 3.0.0
|
||||
zod:
|
||||
specifier: ^4.0.15
|
||||
version: 4.0.15
|
||||
devDependencies:
|
||||
'@types/bun':
|
||||
specifier: latest
|
||||
version: 1.2.19(@types/react@19.1.9)
|
||||
version: 1.2.20(@types/react@19.1.9)
|
||||
concurrently:
|
||||
specifier: ^9.2.0
|
||||
version: 9.2.0
|
||||
@@ -74,6 +68,12 @@ importers:
|
||||
specifier: 6.13.0
|
||||
version: 6.13.0(typescript@5.9.2)
|
||||
|
||||
packages/shared:
|
||||
dependencies:
|
||||
object-hash:
|
||||
specifier: ^3.0.0
|
||||
version: 3.0.0
|
||||
|
||||
packages:
|
||||
|
||||
'@ampproject/remapping@2.3.0':
|
||||
@@ -332,12 +332,6 @@ packages:
|
||||
cpu: [x64]
|
||||
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':
|
||||
resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==}
|
||||
|
||||
@@ -511,8 +505,8 @@ packages:
|
||||
'@types/babel__traverse@7.28.0':
|
||||
resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==}
|
||||
|
||||
'@types/bun@1.2.19':
|
||||
resolution: {integrity: sha512-d9ZCmrH3CJ2uYKXQIUuZ/pUnTqIvLDS0SK7pFmbx8ma+ziH/FRMoAq5bYpRG7y+w1gl+HgyNZbtqgMq4W4e2Lg==}
|
||||
'@types/bun@1.2.20':
|
||||
resolution: {integrity: sha512-dX3RGzQ8+KgmMw7CsW4xT5ITBSCrSbfHc36SNT31EOUg/LA9JWq0VDdEXDRSe1InVWpd2yLUM1FUF/kEOyTzYA==}
|
||||
|
||||
'@types/estree@1.0.8':
|
||||
resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}
|
||||
@@ -556,8 +550,8 @@ packages:
|
||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||
hasBin: true
|
||||
|
||||
bun-types@1.2.19:
|
||||
resolution: {integrity: sha512-uAOTaZSPuYsWIXRpj7o56Let0g/wjihKCkeRqUBhlLVM/Bt+Fj9xTo+LhC1OV1XDaGkz4hNC80et5xgy+9KTHQ==}
|
||||
bun-types@1.2.20:
|
||||
resolution: {integrity: sha512-pxTnQYOrKvdOwyiyd/7sMt9yFOenN004Y6O4lCcCUoKVej48FS5cvTw9geRaEcB9TsDZaJKAxPTVvi8tFsVuXA==}
|
||||
peerDependencies:
|
||||
'@types/react': ^19
|
||||
|
||||
@@ -730,10 +724,6 @@ packages:
|
||||
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
hono@4.8.12:
|
||||
resolution: {integrity: sha512-MQSKk1Mg7b74k8l+A025LfysnLtXDKkE4pLaSsYRQC5iy85lgZnuyeQ1Wynair9mmECzoLu+FtJtqNZSoogBDQ==}
|
||||
engines: {node: '>=16.9.0'}
|
||||
|
||||
hosted-git-info@7.0.2:
|
||||
resolution: {integrity: sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==}
|
||||
engines: {node: ^16.14.0 || >=18.0.0}
|
||||
@@ -1084,9 +1074,6 @@ packages:
|
||||
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
zod@4.0.15:
|
||||
resolution: {integrity: sha512-2IVHb9h4Mt6+UXkyMs0XbfICUh1eUrlJJAOupBHUhLRnKkruawyDddYRCs0Eizt900ntIMk9/4RksYl+FgSpcQ==}
|
||||
|
||||
snapshots:
|
||||
|
||||
'@ampproject/remapping@2.3.0':
|
||||
@@ -1296,11 +1283,6 @@ snapshots:
|
||||
'@esbuild/win32-x64@0.25.8':
|
||||
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':
|
||||
dependencies:
|
||||
'@jridgewell/sourcemap-codec': 1.5.4
|
||||
@@ -1450,9 +1432,9 @@ snapshots:
|
||||
dependencies:
|
||||
'@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:
|
||||
bun-types: 1.2.19(@types/react@19.1.9)
|
||||
bun-types: 1.2.20(@types/react@19.1.9)
|
||||
transitivePeerDependencies:
|
||||
- '@types/react'
|
||||
|
||||
@@ -1500,7 +1482,7 @@ snapshots:
|
||||
node-releases: 2.0.19
|
||||
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:
|
||||
'@types/node': 24.2.0
|
||||
'@types/react': 19.1.9
|
||||
@@ -1681,8 +1663,6 @@ snapshots:
|
||||
|
||||
has-flag@4.0.0: {}
|
||||
|
||||
hono@4.8.12: {}
|
||||
|
||||
hosted-git-info@7.0.2:
|
||||
dependencies:
|
||||
lru-cache: 10.4.3
|
||||
@@ -1999,5 +1979,3 @@ snapshots:
|
||||
string-width: 4.2.3
|
||||
y18n: 5.0.8
|
||||
yargs-parser: 21.1.1
|
||||
|
||||
zod@4.0.15: {}
|
||||
|
||||
8
tsconfig.json
Normal file
8
tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@games/*": ["packages/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user