Hello guys! first, @mdotedot thanks for trying it out! Let me help you a bit.
First of all, let's say we can simplify the whole setup by doing following steps (assuming we use clean machine with only node and npm installed - you can do this kind of experiment with docker container).
First, we install lix globally. lix is a dependency package manager for haxe and it also allows you to use/download/switch multiple versions of haxe at a time.
npm install lix -g
Then clone the git repo to wherever your projects reside. It's better than downloading zip because it's just faster.
cd ~/Documents/Projects
git clone https://github.com/serjek/colyseus-hxjs-examples.git
cd colyseus-hxjs-examples
Next, note that we need haxe 4.0.0-rc.2 for this because ES6 support came only at rc2 that is newer than preview4. And ES6 support allows haxe compiling js classes instead of functions, that is crucial for state handling in colyseus.
lix use haxe 4.0.0-rc.2
Tell lix to download and use all required haxe libraries, including new colyseus-hxjs.
lix download
After that you are good to compile proper example server, as you have all the stuff you need for haxe side.
haxe server.hxml
Running server is another thing though. For this you will need node (obviously), yarn as it's package manager and original colyseus server library. Npm will certainly do as well, yarn is just my personal preference. For reference: npm and yarn use package.json
file to determine dependencies and install them automatically into node_modules
folder. node
knows about this and references modules to node_modules
automatically. You should never commit node_modules
and you can always remove and recreate it in case if something isn't right. Now, with yarn you install colyseus to the ./bin/server location:
cd ./bin/server
yarn
After that feel free to run the server that has been compiled into index.js file several steps before:
node index.js
Basically this wraps up the server build and run process. In order to build client from examples (like you don't want to get into original examples but would like to quickly verify it's working) you compile client from project root with
haxe client.hxml
(note that all required haxe libs are already installed)
and then run yarn in ./bin/client. After that you are good to run client(s) with node:
cd ./bin/client
yarn
node index.js
Please let me know if this makes things clearer, I will be happy to help and will update readme accordingly.
@endel I would support those externs of course, should any API change occur, or if you would add new feature, or in case if something left not covered. So yep, if everything is okay for you and you don't see any major flaws then I'm ready for transfer.