Use explicit .ts extensions for Node-compatible imports

Node's --experimental-strip-types requires explicit .ts extensions on
relative imports. Add allowImportingTsExtensions to both app tsconfigs
and update server-side imports in planner and journal for consistency.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-03-25 01:34:16 +01:00
parent 1abcc5c804
commit 4d73de4e0d
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
8 changed files with 9 additions and 7 deletions

View file

@ -1,6 +1,6 @@
import { randomUUID } from "node:crypto";
import { eq, desc } from "drizzle-orm";
import { getDb } from "./db";
import { getDb } from "./db.ts";
import { activities, routes } from "@trails-cool/db/schema/journal";
import { parseGpxAsync } from "@trails-cool/gpx";

View file

@ -11,7 +11,7 @@ import type {
AuthenticationResponseJSON,
AuthenticatorTransportFuture,
} from "@simplewebauthn/types";
import { getDb } from "./db";
import { getDb } from "./db.ts";
import { users, credentials, magicTokens } from "@trails-cool/db/schema/journal";
const RP_NAME = "trails.cool";

View file

@ -1,6 +1,6 @@
import { randomUUID } from "node:crypto";
import { eq, desc, and } from "drizzle-orm";
import { getDb } from "./db";
import { getDb } from "./db.ts";
import { routes, routeVersions } from "@trails-cool/db/schema/journal";
import { parseGpx } from "@trails-cool/gpx";

View file

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

View file

@ -1,8 +1,8 @@
import { randomUUID } from "node:crypto";
import * as Y from "yjs";
import { eq, and, desc, lt } from "drizzle-orm";
import { getOrCreateDoc, deleteDoc } from "./yjs-server";
import { getDb } from "./db";
import { getOrCreateDoc, deleteDoc } from "./yjs-server.ts";
import { getDb } from "./db.ts";
import { sessions } from "@trails-cool/db/schema/planner";
export type SessionMetadata = typeof sessions.$inferSelect;

View file

@ -1,7 +1,7 @@
import { WebSocketServer, type WebSocket } from "ws";
import * as Y from "yjs";
import type { IncomingMessage, Server } from "node:http";
import { saveSessionState, loadSessionState, touchSession } from "./sessions";
import { saveSessionState, loadSessionState, touchSession } from "./sessions.ts";
const docs = new Map<string, Y.Doc>();
const sessionClients = new Map<string, Set<WebSocket>>();

View file

@ -1,6 +1,6 @@
import { createRequestHandler } from "@react-router/node";
import { createServer } from "node:http";
import { setupYjsWebSocket } from "./app/lib/yjs-server";
import { setupYjsWebSocket } from "./app/lib/yjs-server.ts";
const port = Number(process.env.PORT ?? 3001);

View file

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