feat: Node-ification#25
Open
jasonjgardner wants to merge 18 commits into
Open
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. |
Owner
Author
Haven't had a chance to test everything out yet. So far, all the revisions look great! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merging Node.js contributions from @Offroaders123