Skip to content

Commit a2bb7c2

Browse files
committed
feat: import tool with ts-node
1 parent 0982977 commit a2bb7c2

File tree

18 files changed

+965
-527
lines changed

18 files changed

+965
-527
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,15 @@ $ prisma generate --schema backend/prisma/schema.prisma --generator client-py
5858
```
5959
### Create an empty database and import the dump files
6060

61+
> [!CAUTION]
62+
> If the database already exists, the world data will be overwritten.
63+
>
6164
#### Node backend
6265
```bash
6366
$ npx -w backend prisma db push --skip-generate
67+
$ cd backend
68+
$ node --import 'data:text/javascript,import {register} from "node:module"; import {pathToFileURL} from "node:url"; register("ts-node/esm", pathToFileURL("./"));' src/tools/import-lemuria.mts
6469
```
65-
> [!WARNING]
66-
> There is no node script to import worlds yet, so you have to use the python one instead.
6770

6871
#### Python backend
6972
```bash
@@ -74,8 +77,6 @@ $ python tools/import_lemuria.py
7477
```
7578

7679
This will create and init the database `backend/app.db` using the data in `dumps/atlemuria.txt` and `dumps/proplemuria.txt`.
77-
> [!CAUTION]
78-
> If the database already exists, the world data will be overwritten.
7980

8081
### Serve the world resource files
8182

action-parser/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
},
2020
"devDependencies": {
2121
"@eslint/js": "^9.10.0",
22-
"@swc/core": "^1.10.4",
22+
"@swc/core": "^1.10.6",
2323
"@vitest/coverage-v8": "^2.1.8",
2424
"eslint": "^9.17.0",
2525
"globals": "^15.14.0",
2626
"jiti": "^2.4.2",
2727
"prettier": "^3.4.2",
2828
"ts-node": "^10.9.2",
2929
"typescript": "^5.7.2",
30-
"typescript-eslint": "^8.19.0",
30+
"typescript-eslint": "^8.19.1",
3131
"unplugin-swc": "^1.5.1",
3232
"vitest": "^2.1.6"
3333
}

action-parser/src/action.utils.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,10 @@ export const colorStringToRGB = (color: string) => {
5555
// AW considers everything white at this point
5656
return rgb(255, 255, 255)
5757
}
58-
const red = (colorValue >> 16) % 256
59-
const green = (colorValue >> 8) % 256
60-
const blue = (colorValue >> 0) % 256
6158
return rgb(
62-
red < 0 ? red + 256 : red,
63-
green < 0 ? green + 256 : green,
64-
blue < 0 ? blue + 256 : blue
59+
(colorValue >> 16) & 255,
60+
(colorValue >> 8) & 255,
61+
colorValue & 255
6562
)
6663
}
6764

backend/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@nestjs/platform-fastify": "^10.4.15",
3434
"@nestjs/platform-ws": "^10.4.15",
3535
"@nestjs/websockets": "^10.4.15",
36-
"@prisma/client": "^6.1.0",
36+
"@prisma/client": "^6.2.1",
3737
"axios": "^1.7.9",
3838
"cache-manager": "^5.7.6",
3939
"class-validator": "^0.14.1",
@@ -50,22 +50,22 @@
5050
"@nestjs/schematics": "^10.2.3",
5151
"@nestjs/testing": "^10.4.15",
5252
"@swc/cli": "^0.5.2",
53-
"@swc/core": "^1.10.4",
53+
"@swc/core": "^1.10.6",
5454
"@types/node": "^20.17.7",
5555
"@types/supertest": "^6.0.2",
5656
"@types/ws": "^8.5.13",
5757
"@vitest/coverage-v8": "^2.1.8",
5858
"eslint": "^9.17.0",
5959
"jiti": "^2.4.2",
6060
"prettier": "^3.4.2",
61-
"prisma": "^6.1.0",
61+
"prisma": "^6.2.1",
6262
"source-map-support": "^0.5.21",
6363
"supertest": "^7.0.0",
6464
"ts-loader": "^9.5.1",
6565
"ts-node": "^10.9.2",
6666
"tsconfig-paths": "4.2.0",
6767
"typescript": "^5.7.2",
68-
"typescript-eslint": "^8.19.0",
68+
"typescript-eslint": "^8.19.1",
6969
"unplugin-swc": "^1.5.1",
7070
"vitest": "^2.1.6"
7171
}

0 commit comments

Comments
 (0)