-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Node-ification #25
base: feat/node
Are you sure you want to change the base?
Conversation
Tried to run `tsc -w`, but it didn't work because it couldn't resolve `@hono/hono/jsx`, changing it to `@jsr/hono__hono/jsx` makes it work now. microsoft/TypeScript#58600 I'm going to see what it looks like on making this project work closer to plain ESM/Node/npm, maybe with the intent of getting it to work in frontend JS too, I'm not sure it's setup for that just yet.
Going to abstract out the library parts of the code, and allow it to work anywhere, without npm, jsr, Bun, Node, or anything like that. Just plain dependencies :)
This really helps with tightening up parts of a codebase, it took me a while to get on board with it, but it really is great!
Going to migrate the code over to Node from the backend of it first, then look into the CLI parts again down the road. Didn't know about Node's `parseArgs()` feature, that's awesome! Pretty much exactly what I've been wanting for NBTify 🔥 I don't want to make a crazy complex CLI setup for that, it should be possible with just some regular modules and logging. I'll probably sway my mind on that later on, but yeah hehe.
Going back to the basics now (this is definitely opinionated, I like having a whole universal stack whenever possible)
Remaining parts from the last step, and parts of the Deno config I realized that the `package.json` could have instead.
(also opinionated on my part)
The linting for the tsconfig was mad at the lowercase 'asynciterable' lib option for some reason. This helps make things even easier to run as plain ESM in the browser, nearly there!
They are more specific primitives to what the underlying NBT uses, this will make things more safe when loading the file. I still have to bring this to the rest of the functions that implement around these types. Borrowed this from my Structure-Reader project! https://github.com/Offroaders123/Structure-Reader `block_position_data` still needs specific NBTify typings, I didn't have those in my reference code.
Started working on adding the proper typings for things with the new edits to `types.ts`, and accessing things with the namespace gets a bit taxing, so I want to migrate to this setup before implementing that. Definitely going to look into using better-named named exports for NBTify, they don't have to be so general as I have them now.
Started working on this the other day, now I think this version is the most structurally-sound (pun unintended) Been using this Gist for documentation :) https://gist.github.com/tryashtar/87ad9654305e5df686acab05cc4b6205 The thing I noticed here was that NBT-specific primitives weren't being used for Int number types, and that means that they just get saved as Double values, which might not get handled correctly by the game.
I don't think this is doing any kind of additional transform to the underlying object, so it can just be passed to the `write()` function itself :)
This option was renamed a few versions ago, so it may have used to work previously. My bad it wasn't noted much!
Awesome! I wasn't completely sure if it migrated everything perfectly, so if you can see if you can double check that it still does everything as you intended it to before my changes. |
Haven't had a chance to test everything out yet. So far, all the revisions look great! |
Merging Node.js contributions from @Offroaders123