feat: update to rolldown-vite and typescript-go
This commit is contained in:
parent
17712cbb1c
commit
a4a037ed68
@ -1,42 +0,0 @@
|
||||
import { useMemo } from 'react';
|
||||
import { type LoaderFunctionArgs, useLoaderData } from 'react-router';
|
||||
import { commitSession, getSession } from '~/utils/sessions.server';
|
||||
import { queryAgent } from '~/utils/ws-agent';
|
||||
import AgentManagement from './components/agent/manage';
|
||||
|
||||
export async function loader({ request, context }: LoaderFunctionArgs) {
|
||||
const { ws, wsAuthKey } = context;
|
||||
const session = await getSession(request.headers.get('Cookie'));
|
||||
const onboarding = session.get('agent_onboarding') ?? false;
|
||||
|
||||
const nodeKey =
|
||||
'nodekey:542dad28354eb8d51e240aada7adf0222ba3ecc74af0bbd56123f03eefdb391b';
|
||||
const stats = await queryAgent([nodeKey]);
|
||||
|
||||
return {
|
||||
configured: wsAuthKey !== undefined,
|
||||
onboarding,
|
||||
stats: stats?.[nodeKey],
|
||||
};
|
||||
}
|
||||
|
||||
export default function Page() {
|
||||
const data = useLoaderData<typeof loader>();
|
||||
|
||||
// Whether we show the onboarding or management UI
|
||||
const management = useMemo(() => {
|
||||
return data.configured && data.onboarding === false;
|
||||
}, [data.configured, data.onboarding]);
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-8 max-w-(--breakpoint-lg)">
|
||||
{management ? (
|
||||
<AgentManagement reachable={true} hostInfo={data.stats} />
|
||||
) : (
|
||||
<div>
|
||||
<h1>Local Agent Coming Soon</h1>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -78,6 +78,13 @@ export default createHonoServer({
|
||||
overrideGlobalObjects: true,
|
||||
port: config.server.port,
|
||||
hostname: config.server.host,
|
||||
serveStaticOptions: {
|
||||
clientAssets: {
|
||||
// This is part of our monkey-patch for react-router-hono-server
|
||||
// To see the first part, go to the patches/ directory.
|
||||
rewriteRequestPath: (path) => path.replace(`${__PREFIX__}`, ''),
|
||||
},
|
||||
},
|
||||
|
||||
// Only log in development mode
|
||||
defaultLogger: import.meta.env.DEV,
|
||||
|
||||
17
package.json
17
package.json
@ -9,7 +9,7 @@
|
||||
"build": "react-router build",
|
||||
"dev": "HEADPLANE_LOAD_ENV_OVERRIDES=true HEADPLANE_CONFIG_PATH=./config.example.yaml react-router dev",
|
||||
"start": "node build/server/index.js",
|
||||
"typecheck": "tsc",
|
||||
"typecheck": "react-router typegen && tsgo",
|
||||
"test": "vitest run",
|
||||
"docs:dev": "vitepress dev docs",
|
||||
"docs:build": "vitepress build docs",
|
||||
@ -66,9 +66,10 @@
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@react-router/dev": "^7.8.1",
|
||||
"@tailwindcss/vite": "^4.1.8",
|
||||
"@types/node": "^22.15.17",
|
||||
"@tailwindcss/vite": "^4.1.12",
|
||||
"@types/node": "^24.3.0",
|
||||
"@types/websocket": "^1.0.10",
|
||||
"@typescript/native-preview": "7.0.0-dev.20250818.1",
|
||||
"drizzle-kit": "^0.31.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"lefthook": "^1.11.13",
|
||||
@ -78,8 +79,8 @@
|
||||
"tailwindcss": "^4.1.8",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"tailwindcss-react-aria-components": "^2.0.0",
|
||||
"typescript": "^5.8.3",
|
||||
"vite": "^6.3.5",
|
||||
"typescript": "^5.9.2",
|
||||
"vite": "npm:rolldown-vite@latest",
|
||||
"vite-tsconfig-paths": "^5.1.4",
|
||||
"vitepress": "next",
|
||||
"vitest": "^3.1.3"
|
||||
@ -96,9 +97,13 @@
|
||||
},
|
||||
"onlyBuiltDependencies": [
|
||||
"@biomejs/biome",
|
||||
"@tailwindcss/oxide",
|
||||
"better-sqlite3",
|
||||
"esbuild",
|
||||
"lefthook"
|
||||
]
|
||||
],
|
||||
"patchedDependencies": {
|
||||
"react-router-hono-server": "patches/react-router-hono-server.patch"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
13
patches/react-router-hono-server.patch
Normal file
13
patches/react-router-hono-server.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/dist/adapters/node.js b/dist/adapters/node.js
|
||||
index ec81622898d583ddd8c2f4d9eaf5c0ed23776475..047ef1d45ad82e4b476a882b4ab5c8962faa0df1 100644
|
||||
--- a/dist/adapters/node.js
|
||||
+++ b/dist/adapters/node.js
|
||||
@@ -49,7 +49,7 @@ async function createHonoServer(options) {
|
||||
}
|
||||
await mergedOptions.beforeAll?.(app);
|
||||
app.use(
|
||||
- `/${import.meta.env.REACT_ROUTER_HONO_SERVER_ASSETS_DIR}/*`,
|
||||
+ `${import.meta.env.REACT_ROUTER_HONO_SERVER_BASENAME}${import.meta.env.REACT_ROUTER_HONO_SERVER_ASSETS_DIR}/*`,
|
||||
cache(60 * 60 * 24 * 365),
|
||||
// 1 year
|
||||
serveStatic({ root: clientBuildPath, ...mergedOptions.serveStaticOptions?.clientAssets })
|
||||
1217
pnpm-lock.yaml
generated
1217
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,11 +1,11 @@
|
||||
{
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
"**/.server/**/*.ts",
|
||||
"**/.server/**/*.tsx",
|
||||
"**/.client/**/*.ts",
|
||||
"**/.client/**/*.tsx"
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
"**/.server/**/*.ts",
|
||||
"**/.server/**/*.tsx",
|
||||
"**/.client/**/*.ts",
|
||||
"**/.client/**/*.tsx"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
||||
@ -21,7 +21,6 @@
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"~/*": ["./app/*"],
|
||||
"~server/*": ["./server/*"]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user