From e5609a40dc2d2f792491ea6e2459e16df6cce3ae Mon Sep 17 00:00:00 2001 From: Lycoon Date: Wed, 22 Apr 2026 15:13:46 +0200 Subject: [PATCH 1/6] some renaming --- Dockerfile | 2 +- package.json | 6 +- {src => scripts}/build-tauri.ts | 0 launch.sh => scripts/launch.sh | 0 .../[projectId]/members/[userId]/route.ts | 2 +- src/context/ProjectContext.tsx | 42 +++++++-- src/lib/{collaboration => cloud}/.dev.vars | 0 src/lib/{collaboration => cloud}/index.ts | 0 src/lib/{collaboration => cloud}/protocol.ts | 0 src/lib/{collaboration => cloud}/room.ts | 0 .../{collaboration => cloud}/tsconfig.json | 0 src/lib/{collaboration => cloud}/types.ts | 0 src/lib/{collaboration => cloud}/utils.ts | 0 .../{collaboration => cloud}/wrangler.toml | 0 src/lib/project/project-state.ts | 88 ++++++++++++------- 15 files changed, 94 insertions(+), 46 deletions(-) rename {src => scripts}/build-tauri.ts (100%) rename launch.sh => scripts/launch.sh (100%) mode change 100755 => 100644 rename src/lib/{collaboration => cloud}/.dev.vars (100%) rename src/lib/{collaboration => cloud}/index.ts (100%) rename src/lib/{collaboration => cloud}/protocol.ts (100%) rename src/lib/{collaboration => cloud}/room.ts (100%) rename src/lib/{collaboration => cloud}/tsconfig.json (100%) rename src/lib/{collaboration => cloud}/types.ts (100%) rename src/lib/{collaboration => cloud}/utils.ts (100%) rename src/lib/{collaboration => cloud}/wrangler.toml (100%) diff --git a/Dockerfile b/Dockerfile index 3fbba538..0db35525 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,5 +26,5 @@ EXPOSE 3000 USER node ENV NEXT_TELEMETRY_DISABLED 1 -ENTRYPOINT ["./launch.sh"] +ENTRYPOINT ["./scripts/launch.sh"] CMD [ "npm", "start" ] \ No newline at end of file diff --git a/package.json b/package.json index 3b0736cf..dee8029c 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "postinstall": "patch-package", "dev": "docker compose --profile dev up -d --wait && npx prisma db push && next dev", "build": "npx prisma generate && next build", - "build:tauri": "npx prisma generate && npx tsx src/build-tauri.ts", - "worker:dev": "wrangler dev -c src/lib/collaboration/wrangler.toml", - "worker:deploy": "wrangler deploy -c src/lib/collaboration/wrangler.toml", + "build:tauri": "npx prisma generate && npx tsx scripts/build-tauri.ts", + "worker:dev": "wrangler dev -c src/lib/cloud/wrangler.toml", + "worker:deploy": "wrangler deploy -c src/lib/cloud/wrangler.toml", "stripe:dev": "stripe listen --forward-to localhost:3000/api/webhooks/stripe", "tauri": "tauri", "tauri:dev": "tauri dev", diff --git a/src/build-tauri.ts b/scripts/build-tauri.ts similarity index 100% rename from src/build-tauri.ts rename to scripts/build-tauri.ts diff --git a/launch.sh b/scripts/launch.sh old mode 100755 new mode 100644 similarity index 100% rename from launch.sh rename to scripts/launch.sh diff --git a/src/app/api/projects/[projectId]/members/[userId]/route.ts b/src/app/api/projects/[projectId]/members/[userId]/route.ts index 8a89ae1f..743c549a 100644 --- a/src/app/api/projects/[projectId]/members/[userId]/route.ts +++ b/src/app/api/projects/[projectId]/members/[userId]/route.ts @@ -12,7 +12,7 @@ import { import * as Roles from "@src/lib/utils/roles"; import * as ProjectService from "@src/server/service/project-service"; -import * as CollabUtils from "@src/lib/collaboration/utils"; +import * as CollabUtils from "@src/lib/cloud/utils"; import z from "zod"; import { NextRequest } from "next/server"; diff --git a/src/context/ProjectContext.tsx b/src/context/ProjectContext.tsx index c1e2144e..84511436 100644 --- a/src/context/ProjectContext.tsx +++ b/src/context/ProjectContext.tsx @@ -1,6 +1,14 @@ "use client"; -import { createContext, ReactNode, useCallback, useContext, useEffect, useMemo, useState } from "react"; +import { + createContext, + ReactNode, + useCallback, + useContext, + useEffect, + useMemo, + useState, +} from "react"; import { Editor } from "@tiptap/react"; import { CharacterMap, mergeCharactersData } from "@src/lib/screenplay/characters"; import { LocationMap, mergeLocationsData } from "@src/lib/screenplay/locations"; @@ -22,7 +30,7 @@ import { ScreenplayElement, TitlePageElement, Style, PageFormat } from "@src/lib import { SearchMatch } from "@src/lib/screenplay/extensions/search-highlight-extension"; // Import types only - these don't cause module loading -import type { ThrottledWebsocketProvider } from "@src/lib/collaboration/utils"; +import type { ThrottledWebsocketProvider } from "@src/lib/cloud/utils"; import type { ProjectRepository } from "@src/lib/project/project-repository"; // -------------------------------- // @@ -258,7 +266,9 @@ export const ProjectProvider = ({ children, projectId }: ProjectProviderProps) = const [characters, setCharacters] = useState(undefined); const [locations, setLocations] = useState(undefined); const [scenes, setScenes] = useState([]); - const [selectedElement, setSelectedElementState] = useState(ScreenplayElement.Action); + const [selectedElement, setSelectedElementState] = useState( + ScreenplayElement.Action, + ); const [selectedStyles, setSelectedStylesState] = useState