fix imports
This commit is contained in:
parent
1557a14879
commit
29ab81bfc1
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
"kleur": ["kleur@4.1.5", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="],
|
"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=="],
|
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"module": "src/index.ts",
|
"module": "src/index.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
"exports": {
|
||||||
"./client": "./src/client.ts",
|
"./client": "./src/client/index.ts",
|
||||||
"./server": "./src/server/index.tsx"
|
"./server": "./src/server/index.tsx"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
"hype": "git+https://git.nose.space/defunkt/hype"
|
"hype": "git+https://git.nose.space/defunkt/hype"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "bun run src/server/index.tsx",
|
"check": "bunx tsc --noEmit"
|
||||||
"dev": "bun run --hot src/server/index.tsx"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
export { setup } from '#setup'
|
|
||||||
export { send, gameId } from '#websocket'
|
|
||||||
export { sessionId } from '#session'
|
|
||||||
3
src/client/index.ts
Normal file
3
src/client/index.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export { setup } from './setup'
|
||||||
|
export { send, gameId } from './websocket'
|
||||||
|
export { sessionId } from './session'
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { initWebsocket, onUpdate } from '#websocket'
|
import { initWebsocket, onUpdate } from './websocket'
|
||||||
|
|
||||||
export function setup<G>(onRender: (game: G | undefined) => void) {
|
export function setup<G>(onRender: (game: G | undefined) => void) {
|
||||||
let game: G | undefined = undefined
|
let game: G | undefined = undefined
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Message } from '@types'
|
import type { Message } from '../shared/types'
|
||||||
import { sessionId } from '#session'
|
import { sessionId } from './session'
|
||||||
|
|
||||||
const MAX_RETRIES = 5
|
const MAX_RETRIES = 5
|
||||||
let retries = 0
|
let retries = 0
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Message } from '@types'
|
import type { Message } from '../shared/types'
|
||||||
import { send, sendTo } from '$websocket'
|
import { send, sendTo } from './websocket'
|
||||||
|
|
||||||
// set by setup, called by server
|
// set by setup, called by server
|
||||||
export let dispatch = (ws: any, msg: Message) => { }
|
export let dispatch = (ws: any, msg: Message) => { }
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { writeFileSync as writeFile, readFileSync as readFile, existsSync as exists } from 'fs'
|
import { writeFileSync as writeFile, readFileSync as readFile, existsSync as exists } from 'fs'
|
||||||
import { watch } from 'fs'
|
import { watch } from 'fs'
|
||||||
import { join } from 'path'
|
import { join } from 'path'
|
||||||
import { parseActions } from '$actionParser'
|
import { parseActions } from './actionParser'
|
||||||
import { normalize } from '$action'
|
import { normalize } from './action'
|
||||||
|
|
||||||
const srcDir = join(process.cwd(), 'src')
|
const srcDir = join(process.cwd(), 'src')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
import { upgradeWebSocket, websocket } from 'hono/bun'
|
import { upgradeWebSocket, websocket } from 'hono/bun'
|
||||||
import { Hype } from 'hype'
|
import { Hype } from 'hype'
|
||||||
import type { Message } from '@types'
|
import type { Message } from '../shared/types'
|
||||||
import { send, addWebsocket, removeWebsocket, closeWebsockets } from '$websocket'
|
import { send, addWebsocket, removeWebsocket, closeWebsockets } from './websocket'
|
||||||
import { dispatch, onPart } from '$action'
|
import { dispatch, onPart } from './action'
|
||||||
import IndexPage from '../pages/index'
|
import IndexPage from '../pages/index'
|
||||||
|
|
||||||
export { setup } from '$action'
|
export { setup } from './action'
|
||||||
export type { Context } from '$action'
|
export type { Context } from './action'
|
||||||
|
|
||||||
import '$actionCodegen'
|
import './actionCodegen'
|
||||||
|
|
||||||
const app = new Hype({ layout: false })
|
const app = new Hype({ layout: false })
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import type { Message } from '@types'
|
import type { Message } from '../shared/types'
|
||||||
|
|
||||||
const wsConnections = new Map<string, any>()
|
const wsConnections = new Map<string, any>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,6 @@
|
||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"noUnusedParameters": false,
|
"noUnusedParameters": false,
|
||||||
"noPropertyAccessFromIndexSignature": false,
|
"noPropertyAccessFromIndexSignature": false,
|
||||||
"baseUrl": ".",
|
"baseUrl": "."
|
||||||
"paths": {
|
|
||||||
"$*": ["src/server/*"],
|
|
||||||
"#*": ["src/client/*"],
|
|
||||||
"@*": ["src/shared/*"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user