-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
301 additions
and
175 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 80 | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"suspicious": { | ||
"noExplicitAny": "off" | ||
}, | ||
"recommended": true | ||
} | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"files": { | ||
"ignore": [ | ||
"node_modules", | ||
"build" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "@cookie-clicker-brasil/socket", | ||
"private": true, | ||
"version": "1.0.1", | ||
"main": "src/main.js", | ||
"license": "Apache-2.0", | ||
"author": "Sebastian Jn <sebastianjnuwu@gmail.com>", | ||
"scripts": { | ||
"start": "node build/main.js", | ||
"build": "tsc --project tsconfig.json", | ||
"dev": "tsnd --expose-gc --transpile-only --ignore-watch node_modules --respawn src/main.ts", | ||
"lint": "npx @biomejs/biome lint --write", | ||
"format": "npx @biomejs/biome format --write" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "1.9.4", | ||
"@types/node": "^22.10.5", | ||
"@types/socket.io": "^3.0.1", | ||
"ts-node-dev": "^2.0.0", | ||
"typescript": "^5.7.3" | ||
}, | ||
"dependencies": { | ||
"socket.io": "^4.8.1" | ||
}, | ||
"engines": { | ||
"npm": ">=8", | ||
"node": ">=18" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/sebastianjnuwu/cookie.git" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// types/rooms.d.ts | ||
|
||
/** Represents a room */ | ||
export interface Room { | ||
code: string; | ||
date: Date; | ||
players: Player[]; | ||
owner: string; | ||
time: number; | ||
state: "waiting" | "in_game" | "finished"; | ||
} | ||
|
||
/** Represents a player */ | ||
export interface Player { | ||
id: number; | ||
date: Date; | ||
socket: string; | ||
player_data: { | ||
cookies: number | null; | ||
}; | ||
room_player: string; | ||
} | ||
|
||
/** Data received to create or join a room */ | ||
export interface RoomData { | ||
room_code?: string; | ||
room_time: number; | ||
room_player: string; | ||
} | ||
|
||
/** Data for leaving a room */ | ||
export interface LeaveRoomData { | ||
room_code: string; | ||
room_player: string; | ||
} | ||
|
||
/** Data for rejoining a room */ | ||
export interface RejoinRoomData { | ||
room_code: string; | ||
room_player: string; | ||
} | ||
|
||
/** Data for starting a game */ | ||
export interface StartGameData { | ||
room_code: string; | ||
} | ||
|
||
/** Data for updating cookies */ | ||
export interface UpdateCookiesData { | ||
room_code: string; | ||
room_player: string; | ||
cookies: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": ["ESNext"], | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"target": "ESNext", | ||
"outDir": "build", | ||
"strictNullChecks": false, | ||
"sourceMap": false, | ||
"esModuleInterop": true, | ||
"experimentalDecorators": true, | ||
"emitDecoratorMetadata": true, | ||
"allowSyntheticDefaultImports": true, | ||
"skipLibCheck": true, | ||
"skipDefaultLibCheck": true, | ||
"resolveJsonModule": true, | ||
"importHelpers": true | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules", "build"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[default] | ||
check-filename = true | ||
|
||
[files] | ||
extend-exclude = [ | ||
"www/src/js/modules", | ||
"www/src/locales/lang", | ||
"node_modules", | ||
"android", | ||
"socket" | ||
] | ||
|
||
[default.extend-words] | ||
strech = "strech" | ||
contaienr = "contaienr" | ||
collapsable = "collapsable" | ||
styl = "styl" |
Oops, something went wrong.