-
-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish the official rot.js to npmjs.org #53
Conversation
Makes sense. I will merge this, but:
|
Publish the official rot.js to npmjs.org
Ah, forget 1), I mis-read the diff. |
Adjusted the Makefile (https://github.com/ondras/rot.js/blob/master/Makefile#L53) as planned. Done, thanks for your work! |
Thanks! It'd be great to get @blinkdog's signoff for publishing as the |
Just two days ago I was thinking "In preparation for 7DRL 2015, maybe I should pull the latest rot.js, port my Node support, and offer a pull request to @ondras". Then, this morning, I see your e-mails about Issue #53 ... nice timing! I'm agreeable to using I'm excited that Node.js is becoming an officially supported platform. Back when I published the package, rot.js seemed browser-focused, and I didn't want to bother @ondras with my stuff ("Hey, add my Node-specific code to your browser-focused library!"). But, I noticed a short while ago that a bower package was created, and that's what got me thinking about offering a Node pull request. As for my code; the Node shim and xterm display support, would you like me to port them to the latest rot.js? If you think they'd be useful, I'm happy to do it. If not, I'll leave my old branch alone. |
Hmm, this is complex stuff. I am certain that some parts of rot.js are platform-independent (RNG, FOV, ...), but We should keep in mind that the ROT.Display API is designed for a browser environment. Some of its features are completely illogical for a native TTY: font size, font family/style, dimensions, padding/spacing, hexes... you probably just want to use what the user's terminal emulator already has, right? Also, graphical tiles were introduced recently. Bringing them to Node is not going to be easy. Perhaps some folks experienced with ncurses, bearlib and other native TTY libs would have a reasonable opinion on whether it is worth to adjust ROT.Display for server-side usage (or use some server-specific simpler API instead). As for the npm package name, I really have no opinion here. I have no interest in running server-side code, so the whole npm quest is just "for other devs out there". Having only one name would make things less confusing for a user, that is for sure. |
The shim is "just enough" browser environment to make ROT.Display comfortable in Node. Some examples:
Agreed. There is a lot of ROT.Display that doesn't translate well to a terminal. That said, the API itself is simple and direct (it doesn't get much easier than A goal of mine was to keep the drawing code portable. That is, if I develop a roguelike in Node, I wanted porting to the browser to be a change from There are probably some ways to more aggressively refactor ROT.Display. But I decided not to do that, because I thought:
And, even if the Node shim and xterm display support are there, the author targeting Node is not required to use them. If one likes the simple ROT.Display API, it can be used without modification (in so far as a terminal can support the features). If not, one can always use their favorite curses library for Node, like blessed, for example.
Agreed. Doing this will probably require Node bindings for SDL or alike. Especially if it is to achieve any kind of cross-platform support. There is still some research I need to do this in area, as I haven't had a need for graphical tiles in any of my personal projects yet. My suggestion for integrating these features (if you want them) is to have a separate build target for Node. The standard rot.js (for the browser) doesn't need the shim or xterm support, so no way they should go into the main code. The Node build target can include them and get published to the npm repository. |
No, I do not. I can create one, though. No problem.
Ah, a dedicated layout module is a nice approach (I was initially thinking about your shim fixing the existing "rect" and "hex" modules) that keeps most of the code untouched. I like it. I find the "separate build target for Node.js" approach most straightforward. I assume this implies you maintaining the shim + build repo, pulling current rot.js source in the (build) process? I am able to guarantee you some amount of backwards compatibility, so there shall be no issues when building against a more recent rot.js version. |
Great! Just let me know your username, and I'll add you as an owner on the
I was thinking to add some target to the Makefile, like I'll pull the latest rot.js, make a branch, and offer you a pull request. 😃 |
Cool, thanks. My npmjs.com username is "ondras". Let me know when your adjustments are ready. |
(CC @blinkdog)
NPM is the package manager for Node.js. It would be great to publish this awesome package to npmjs.org and make its functionality server-side:
@blinkdog appears to have already made some progress here with the rot-js package. They've done some great work on making a console display. However, that fork is a bit out of date.
I think that there should be one NPM package (say, https://www.npmjs.com/package/rot-js) which points to the primary repo -- this one -- which is kept up to date on NPM. This PR does the minimal work of making that happen.
More information on publishing to NPM: https://docs.npmjs.com/getting-started/publishing-npm-packages