Merge branch 'next'
This commit is contained in:
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
@@ -1,3 +1,6 @@
|
||||
{
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.biome": "explicit"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,13 +9,15 @@
|
||||
"ignoreUnknown": false
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": false,
|
||||
"indentStyle": "tab"
|
||||
"enabled": false
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
"recommended": true,
|
||||
"nursery": {
|
||||
"useSortedClasses": "error"
|
||||
}
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createServer } from "node:http"
|
||||
import { NodeContext, NodeHttpServer, NodeRuntime } from "@effect/platform-node"
|
||||
import { Effect, Layer } from "effect"
|
||||
import { createServer } from "node:http"
|
||||
import { ServerConfig } from "./config"
|
||||
import { Server } from "./server"
|
||||
|
||||
|
||||
@@ -16,51 +16,41 @@ const makeWebRpcRoute = Effect.all([
|
||||
Effect.provide(WebRpcLive),
|
||||
)
|
||||
|
||||
const makeProductionWebappMiddleware = Effect.gen(function*() {
|
||||
const makeProductionWebappRoute = Effect.fnUntraced(function*(route: HttpRouter.PathInput) {
|
||||
const path = yield* Path.Path
|
||||
const fs = yield* FileSystem.FileSystem
|
||||
const dist = path.join(yield* path.fromFileUrl(new URL(".", import.meta.resolve("@website/webapp"))), "dist")
|
||||
|
||||
return () => Effect.gen(function*() {
|
||||
return HttpRouter.all(route, Effect.gen(function*() {
|
||||
const req = yield* HttpServerRequest.HttpServerRequest
|
||||
const source = path.join(dist, req.url)
|
||||
const isValid = yield* fs.stat(source).pipe(
|
||||
const exists = yield* fs.stat(source).pipe(
|
||||
Effect.andThen(stat => stat.type === "File"),
|
||||
Effect.catchAll(() => Effect.succeed(false)),
|
||||
)
|
||||
|
||||
return yield* HttpServerResponse.setHeader(
|
||||
yield* HttpServerResponse.file(isValid ? source : path.join(dist, "index.html")),
|
||||
yield* HttpServerResponse.file(exists ? source : path.join(dist, "index.html")),
|
||||
"Cache-Control",
|
||||
`public, max-age=${Duration.toSeconds("365 days")}, immutable`
|
||||
)
|
||||
})
|
||||
}))
|
||||
})
|
||||
|
||||
|
||||
export const HttpAppDevelopment = Effect.provide(makeWebRpcRoute, WebRpcSerializationDevelopment).pipe(
|
||||
Effect.map(serveWebRpc => router.pipe(
|
||||
serveWebRpc,
|
||||
HttpServer.serve(flow(
|
||||
HttpMiddleware.logger,
|
||||
HttpMiddleware.xForwardedHeaders,
|
||||
)),
|
||||
export const HttpAppDevelopment = Layer.unwrapScoped(Effect.gen(function*() {
|
||||
return router.pipe(
|
||||
yield* Effect.provide(makeWebRpcRoute, WebRpcSerializationDevelopment),
|
||||
HttpServer.serve(flow(HttpMiddleware.logger, HttpMiddleware.xForwardedHeaders)),
|
||||
HttpServer.withLogAddress,
|
||||
)),
|
||||
)
|
||||
}))
|
||||
|
||||
Layer.unwrapScoped,
|
||||
)
|
||||
|
||||
export const HttpAppProduction = Effect.all([
|
||||
Effect.provide(makeWebRpcRoute, WebRpcSerializationProduction),
|
||||
makeProductionWebappMiddleware,
|
||||
]).pipe(
|
||||
Effect.map(([serveWebRpc, serveProductionWebapp]) => router.pipe(
|
||||
serveWebRpc,
|
||||
serveProductionWebapp,
|
||||
export const HttpAppProduction = Layer.unwrapScoped(Effect.gen(function*() {
|
||||
return router.pipe(
|
||||
yield* Effect.provide(makeWebRpcRoute, WebRpcSerializationProduction),
|
||||
yield* makeProductionWebappRoute("*"),
|
||||
HttpServer.serve(HttpMiddleware.xForwardedHeaders),
|
||||
HttpServer.withLogAddress,
|
||||
)),
|
||||
|
||||
Layer.unwrapScoped,
|
||||
)
|
||||
)
|
||||
}))
|
||||
|
||||
@@ -7,7 +7,7 @@ function Card({ className, ...props }: React.ComponentProps<"div">) {
|
||||
<div
|
||||
data-slot="card"
|
||||
className={cn(
|
||||
"rounded-base flex flex-col shadow-shadow border-2 gap-6 py-6 border-border bg-background text-foreground font-base",
|
||||
"flex flex-col gap-6 rounded-base border-2 border-border bg-background py-6 font-base text-foreground shadow-shadow",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
@@ -42,7 +42,7 @@ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
|
||||
return (
|
||||
<div
|
||||
data-slot="card-description"
|
||||
className={cn("text-sm font-base", className)}
|
||||
className={cn("font-base text-sm", className)}
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Card, CardContent } from "@/components/ui/card"
|
||||
import { Outlet, createRootRoute } from "@tanstack/react-router"
|
||||
import { createRootRoute, Outlet } from "@tanstack/react-router"
|
||||
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools"
|
||||
import { Card, CardContent } from "@/components/ui/card"
|
||||
|
||||
|
||||
export const Route = createRootRoute({
|
||||
@@ -9,7 +9,7 @@ export const Route = createRootRoute({
|
||||
|
||||
function RootComponent() {
|
||||
return <>
|
||||
<div className="text-foreground mx-auto w-[750px] max-w-full px-5 pt-28 pb-10">
|
||||
<div className="mx-auto w-[750px] max-w-full px-5 pt-28 pb-10 text-foreground">
|
||||
<Card>
|
||||
<CardContent>
|
||||
<Outlet />
|
||||
|
||||
@@ -2,5 +2,24 @@
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
],
|
||||
"packageRules": [
|
||||
{
|
||||
"matchManagers": ["npm"],
|
||||
"matchPaths": ["./packages/**"],
|
||||
"manager": "bun"
|
||||
},
|
||||
{
|
||||
"matchManagers": ["bun", "npm"],
|
||||
"matchUpdateTypes": ["minor", "patch"],
|
||||
"groupName": "bun minor+patch updates",
|
||||
"groupSlug": "bun-minor-patch"
|
||||
},
|
||||
{
|
||||
"matchManagers": ["bun", "npm"],
|
||||
"matchUpdateTypes": ["major"],
|
||||
"groupName": "bun major updates",
|
||||
"groupSlug": "bun-major"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user