Skip to content

Commit 3b26f4b

Browse files
committed
fix
1 parent 676049f commit 3b26f4b

5 files changed

Lines changed: 13 additions & 9 deletions

File tree

packages/server/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"version": "1.0.0",
44
"private": true,
55
"description": "",
6-
"main": "dist/index.js",
6+
"main": "dist/types/index.js",
7+
"type": "module",
78
"scripts": {
8-
"start": "node dist/index.js",
9+
"start": "node .",
910
"dev": "nodemon --exec tsx src/index.ts",
1011
"build:types": "tsc -b ."
1112
},

packages/server/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import dotenv from 'dotenv';
22
import express from 'express';
3-
import { sockets } from './sockets';
3+
import { sockets } from './sockets.js';
44
import { createServer } from 'http';
5-
import { LOCALHOST_PORT } from './constants';
5+
import { LOCALHOST_PORT } from './constants.js';
66

77
dotenv.config();
88

packages/server/src/sockets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Server } from 'socket.io'
22
import { createServer } from 'http'
3-
import { trackGraphState } from './trackGraphState'
4-
import { Collaborator, SocketEvents } from '@magic/graph/collab/types'
3+
import { trackGraphState } from './trackGraphState.js'
4+
import { Collaborator, SocketEvents } from '@magic/graph/collab/types.js'
55

66
export const sockets = (httpServer: ReturnType<typeof createServer>) => {
77
const io = new Server<SocketEvents, SocketEvents, {}, {}>(httpServer, {

packages/server/src/trackGraphState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { GraphState } from "@magic/graph/collab/types"
2-
import type { GEdge, GNode } from "@magic/graph/types"
1+
import type { GraphState } from "@magic/graph/collab/types.js"
2+
import type { GEdge, GNode } from "@magic/graph/types.js"
33

44
/**
55
* maps the room id to the live version of the graph for that room

packages/server/tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
"paths": {
77
"@magic/server/*": ["./src/*"],
88
"@magic/graph/*": ["../graph/src/*"]
9-
}
9+
},
10+
"moduleResolution": "nodenext",
11+
"module": "nodenext",
12+
"emitDeclarationOnly": false
1013
},
1114
"references": [{ "path": "../graph" }],
1215
"include": ["./src/**/*"],

0 commit comments

Comments
 (0)