Fix planner production server + use .ts extensions everywhere

- Fix createRequestHandler → createRequestListener (@react-router/node
  removed the old API)
- Move noEmit + allowImportingTsExtensions to tsconfig.base.json so all
  packages and apps inherit them consistently
- Add explicit .ts extensions to all remaining relative imports across
  packages and apps

Verified locally: node --experimental-strip-types server.ts starts and
responds 200.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-03-25 01:41:33 +01:00
parent 655dc46ec8
commit 62b5fb998e
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
18 changed files with 38 additions and 43 deletions

View file

@ -8,8 +8,6 @@
"exclude": ["build", "node_modules"],
"compilerOptions": {
"rootDirs": [".", "./.react-router/types"],
"noEmit": true,
"allowImportingTsExtensions": true,
"types": ["vite/client"],
"paths": {
"~/*": ["./app/*"]

View file

@ -1,5 +1,5 @@
import { describe, it, expect } from "vitest";
import { electHost } from "./host-election";
import { electHost } from "./host-election.ts";
function makeStates(
entries: Array<{ id: number; user?: boolean; role?: string }>,

View file

@ -1,5 +1,5 @@
import { describe, it, expect } from "vitest";
import { checkRateLimit } from "./rate-limit";
import { checkRateLimit } from "./rate-limit.ts";
describe("checkRateLimit", () => {
it("allows requests within limit", () => {

View file

@ -1,7 +1,7 @@
import { useCallback, useEffect, useRef, useState } from "react";
import * as Y from "yjs";
import type { YjsState } from "./use-yjs";
import { electHost } from "./host-election";
import type { YjsState } from "./use-yjs.ts";
import { electHost } from "./host-election.ts";
interface RouteStats {
distance?: number;

View file

@ -1,18 +1,15 @@
import { createRequestHandler } from "@react-router/node";
import { createRequestListener } from "@react-router/node";
import { createServer } from "node:http";
import { setupYjsWebSocket } from "./app/lib/yjs-server.ts";
const port = Number(process.env.PORT ?? 3001);
const handler = createRequestHandler(
// @ts-expect-error - build output types
await import("./build/server/index.js"),
);
const server = createServer((req, res) => {
handler(req, res);
const listener = createRequestListener({
build: () => import("./build/server/index.js") as never,
});
const server = createServer(listener);
setupYjsWebSocket(server);
server.listen(port, () => {

View file

@ -8,8 +8,6 @@
"exclude": ["build", "node_modules", "server.ts"],
"compilerOptions": {
"rootDirs": [".", "./.react-router/types"],
"noEmit": true,
"allowImportingTsExtensions": true,
"types": ["vite/client"],
"paths": {
"~/*": ["./app/*"]

View file

@ -2,7 +2,7 @@ import { reactRouter } from "@react-router/dev/vite";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig } from "vite";
import path from "node:path";
import { yjsDevPlugin } from "./app/lib/vite-yjs-plugin";
import { yjsDevPlugin } from "./app/lib/vite-yjs-plugin.ts";
export default defineConfig({
plugins: [tailwindcss(), reactRouter(), yjsDevPlugin()],