fix imports

This commit is contained in:
Chris Wanstrath 2026-01-20 21:16:52 -08:00
parent 1557a14879
commit 29ab81bfc1
11 changed files with 22 additions and 28 deletions

View File

@ -25,7 +25,7 @@
"kleur": ["kleur@4.1.5", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="],
"pyre": ["pyre@file:..", { "dependencies": { "hype": "git+https://git.nose.space/defunkt/hype" }, "devDependencies": { "@types/bun": "latest" }, "peerDependencies": { "hono": "*", "typescript": "^5" } }],
"pyre": ["pyre@file:..", { "dependencies": { "hype": "git+https://git.nose.space/defunkt/hype" }, "devDependencies": { "@types/bun": "latest" }, "peerDependencies": { "typescript": "^5" } }],
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],

View File

@ -3,7 +3,7 @@
"module": "src/index.ts",
"type": "module",
"exports": {
"./client": "./src/client.ts",
"./client": "./src/client/index.ts",
"./server": "./src/server/index.tsx"
},
"devDependencies": {
@ -16,7 +16,6 @@
"hype": "git+https://git.nose.space/defunkt/hype"
},
"scripts": {
"start": "bun run src/server/index.tsx",
"dev": "bun run --hot src/server/index.tsx"
"check": "bunx tsc --noEmit"
}
}

View File

@ -1,3 +0,0 @@
export { setup } from '#setup'
export { send, gameId } from '#websocket'
export { sessionId } from '#session'

3
src/client/index.ts Normal file
View File

@ -0,0 +1,3 @@
export { setup } from './setup'
export { send, gameId } from './websocket'
export { sessionId } from './session'

View File

@ -1,4 +1,4 @@
import { initWebsocket, onUpdate } from '#websocket'
import { initWebsocket, onUpdate } from './websocket'
export function setup<G>(onRender: (game: G | undefined) => void) {
let game: G | undefined = undefined

View File

@ -1,5 +1,5 @@
import type { Message } from '@types'
import { sessionId } from '#session'
import type { Message } from '../shared/types'
import { sessionId } from './session'
const MAX_RETRIES = 5
let retries = 0

View File

@ -1,5 +1,5 @@
import type { Message } from '@types'
import { send, sendTo } from '$websocket'
import type { Message } from '../shared/types'
import { send, sendTo } from './websocket'
// set by setup, called by server
export let dispatch = (ws: any, msg: Message) => { }

View File

@ -1,8 +1,8 @@
import { writeFileSync as writeFile, readFileSync as readFile, existsSync as exists } from 'fs'
import { watch } from 'fs'
import { join } from 'path'
import { parseActions } from '$actionParser'
import { normalize } from '$action'
import { parseActions } from './actionParser'
import { normalize } from './action'
const srcDir = join(process.cwd(), 'src')

View File

@ -1,14 +1,14 @@
import { upgradeWebSocket, websocket } from 'hono/bun'
import { Hype } from 'hype'
import type { Message } from '@types'
import { send, addWebsocket, removeWebsocket, closeWebsockets } from '$websocket'
import { dispatch, onPart } from '$action'
import type { Message } from '../shared/types'
import { send, addWebsocket, removeWebsocket, closeWebsockets } from './websocket'
import { dispatch, onPart } from './action'
import IndexPage from '../pages/index'
export { setup } from '$action'
export type { Context } from '$action'
export { setup } from './action'
export type { Context } from './action'
import '$actionCodegen'
import './actionCodegen'
const app = new Hype({ layout: false })

View File

@ -1,4 +1,4 @@
import type { Message } from '@types'
import type { Message } from '../shared/types'
const wsConnections = new Map<string, any>()

View File

@ -19,11 +19,6 @@
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false,
"baseUrl": ".",
"paths": {
"$*": ["src/server/*"],
"#*": ["src/client/*"],
"@*": ["src/shared/*"]
}
"baseUrl": "."
}
}