You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTE.md
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,18 @@ After you cloned the project, you can just install it like normal node project b
13
13
14
14
The code are splited into seperated projects, which layed in under `packages` folder. Most of them are really simple (only one `index.ts` file or few files).
15
15
16
-
If you want to write some code for specific module, the command `npm run dev` might help you.
16
+
The simplest way to run the code is write a test and then run it.
17
17
18
-
For example, you want to add a functions to parse minecraft chunk data, you can add some code in `packages/world/index.ts`. You might also want to add some test related to your new features, just add sth. in `packages/world/test.ts`.
18
+
And, the simplest way to run a test is `npx jest packages/<the-package>/<the-test-file.test.ts>`.
19
+
20
+
Also you can use the command `npm run dev`.
21
+
22
+
For example, you want to add a functions to parse minecraft chunk data, you can add some code in `packages/world/index.ts`. You might also want to add some test related to your new features, just add somthing in `packages/world/test.ts`.
19
23
20
24
During this process, you can first run `npm run dev world`, and it will start to auto compile & test the code for world module. You can see the result immediately.
21
25
26
+
**Please make sure you clean all built js files before you run your test! The test will fail if there are built js file! You can run `npm run build:clean` to clean all js!**
27
+
22
28
**Highly recommended to add test for the features,**~~which I always lazy to add.~~
23
29
24
30
### Before Submit PR
@@ -49,15 +55,15 @@ The features like login, fetch user info/textures goes here:
49
55
50
56
-@xmcl/user
51
57
52
-
In node, it will use `got` as requester.
58
+
In node, it will use nodejs http/https module as requester.
53
59
In browser, it will use `fetch` as requester.
54
60
55
61
### General Gaming Features (Node/Electron/Browser)
56
62
57
63
The features like parsing game setting, parsing forge mod metadata, NBT parsing, game saves parsing, they don't really have any strong connection.
Copy file name to clipboardExpand all lines: packages/resource-manager/index.ts
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,7 @@ interface ResourceSourceWrapper {
7
7
}
8
8
9
9
/**
10
-
* The resource manager. Design to be able to use in both nodejs and browser environment.
11
-
* @template T The type of the resource content. If you use this in node, it's probably `Buffer`. If you are in browser, it might be `string`. Just align this with your `ResourceSource`
10
+
* The resource manager just like Minecraft. Design to be able to use in both nodejs and browser environment.
0 commit comments