-
Notifications
You must be signed in to change notification settings - Fork 100
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
Move to Typescript #579
Move to Typescript #579
Conversation
This moves to TypeScript, and directly uses ESLint because standard complained about typescript todo: fix the 31 eslint warnings semi-breaking: You now need to build the project using `pnpm build`/`yarn build`/`npm run build`
The main .gitignore file now ignores *.log (see 47e9ccd), so this .gitignore is unnecesary
Somehow the commit where I actually changed this, didn't change it in git (wtf)
This is done to (a) save time, and (b) because the 16.x workflow for mcVersionIndex 8 takes slightly too long in CI/CD
This also fixes #323 |
can you instead follow the same technical choice we made for the rest of PrismarineJS: adding a .d.ts file and keeping the code in javascript? |
Sure - I'll do that when I have time for that. |
This looks like it is patching console.log in a way where it will always put the cursor at a certain position once called. It is probably to make the command line cleaner once stuff has been logged to it. Just like the vanilla minecraft server dose it. No wonder it is throwing linting errors because it overwrites the default console.log. The 'real' way to patch this is to make a new custom logging function and change all console.log to that. |
My tsc was complaining, not my eslint - eslint was pretty silent for it. |
@rom1504 |
Changes
This PR introduces a few changes:
examples/basic.ts
package.json
:engines.node
be>=14
instead of the previous>=8
In terms of TypeScript types, there's a lot more to be desired, however this is definitely an improvement over vanilla JS.
Compatability
This, in theory, shouldn't break any dependents, unless they directly import files in the
src
directory.Other things of note
src/lib/plugins/log.ts:49 Removed this weird code that my tsc was complaining about - don't really know why it's there, maybe someone here can re-implement this in a non-broken way.