Skip to content

Commit 19a7aa3

Browse files
authored
refactor: restructure api/ folder inner files (#570)
1 parent 7385c4c commit 19a7aa3

File tree

9 files changed

+30
-30
lines changed

9 files changed

+30
-30
lines changed

api/src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import { WebSocketServer } from "ws";
55
import * as trpcExpress from "@trpc/server/adapters/express";
66

77
import { createSetupWSConnection } from "./yjs/yjs-setupWS";
8-
import { bindState, writeState } from "./yjs-blob";
8+
import { bindState, writeState } from "./yjs/yjs-blob";
99

1010
import cors from "cors";
11-
import { appRouter } from "./trpc";
11+
import { appRouter } from "./spawner/trpc";
1212

1313
export async function startServer({ port, blobDir }) {
1414
console.log("starting server ..");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { writeFileSync } from "fs";
33
import net from "net";
44
import http from "http";
55

6-
import { startServer } from "./runtime/server";
6+
import { startServer } from "../runtime/server";
77

88
type KernelInfo = {
99
// the kernel

api/src/trpc.ts renamed to api/src/spawner/trpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import WebSocket from "ws";
88
import { z } from "zod";
99

1010
// import { WebsocketProvider } from "../../ui/src/lib/y-websocket";
11-
import { WebsocketProvider } from "./y-websocket";
11+
import { WebsocketProvider } from "../yjs/y-websocket";
1212

1313
import { killRuntime, spawnRuntime } from "./spawner_native";
1414

api/tsconfig.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"outDir": "./build",
5+
"target": "esnext",
6+
"allowJs": true,
7+
"allowSyntheticDefaultImports": true,
8+
"esModuleInterop": true,
9+
"lib": ["esnext"],
10+
"moduleResolution": "node",
11+
"noFallthroughCasesInSwitch": true,
12+
"resolveJsonModule": true,
13+
"skipLibCheck": true,
14+
"strict": true,
15+
"isolatedModules": true,
16+
"noImplicitAny": false
17+
},
18+
"ts-node": {
19+
// these options are overrides used only by ts-node
20+
// same as the --compilerOptions flag and the TS_NODE_COMPILER_OPTIONS environment variable
221
"compilerOptions": {
3-
"module": "commonjs",
4-
"outDir": "./build",
5-
"target": "esnext",
6-
"allowJs": true,
7-
"allowSyntheticDefaultImports": true,
8-
"esModuleInterop": true,
9-
"lib": ["esnext"],
10-
"moduleResolution": "node",
11-
"noFallthroughCasesInSwitch": true,
12-
"resolveJsonModule": true,
13-
"skipLibCheck": true,
14-
"strict": true,
15-
"isolatedModules": true,
16-
"noImplicitAny": false,
17-
},
18-
"ts-node": {
19-
// these options are overrides used only by ts-node
20-
// same as the --compilerOptions flag and the TS_NODE_COMPILER_OPTIONS environment variable
21-
"compilerOptions": {
22-
"module": "commonjs"
23-
}
24-
},
25-
"include": ["src"]
26-
}
22+
"module": "commonjs"
23+
}
24+
},
25+
"include": ["src", "src/yjs/y-websocket.js"]
26+
}

ui/src/lib/store/yjsSlice.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { produce } from "immer";
66
import { Doc, Transaction } from "yjs";
77
import * as Y from "yjs";
88
// import { WebsocketProvider } from "../y-websocket";
9-
import { WebsocketProvider } from "../../../../api/src/y-websocket";
9+
import { WebsocketProvider } from "../../../../api/src/yjs/y-websocket";
1010
import { addAwarenessStyle } from "../utils/utils";
1111
import { MyState, Pod } from ".";
1212

ui/src/lib/trpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { createTRPCReact } from "@trpc/react-query";
2-
import type { AppRouter } from "../../../api/src/trpc";
2+
import type { AppRouter } from "../../../api/src/spawner/trpc";
33
export const trpc = createTRPCReact<AppRouter>();

0 commit comments

Comments
 (0)