Skip to content
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

UHHMM Someone Ordered A Fresh Batch Of Interfaces?? #112

Closed
wants to merge 1 commit into from

Conversation

nobu-sh
Copy link

@nobu-sh nobu-sh commented Jul 23, 2021

Someone Had To Do It Enjoy!

EG:

import { packet_login } from 'bedrock-protocol/packets'
y2mate.com.-.Kiss.me.on.my.hot.lips.Im.feeling.romantic_480p.mp4

@nobu-sh
Copy link
Author

nobu-sh commented Jul 23, 2021

Checks are invalid this does not bring any breaking changes to where the test would need updating. It simply adds two declarations files to the root directory.

@extremeheat
Copy link
Member

extremeheat commented Jul 23, 2021

Hi, thanks for the PR. There are a couple of issues with this PR right now:

  • The types should be auto-generated from the protocol schema, either by a generator in protodef-yaml or a general tool inside of or to complement node-protodef.
  • The types need to be multi-version compliant. We support many different versions, and potentially Earth at some point soon. For the types to be usable, this need to be handled.
  • Types should be automatically generated before publish if possible to avoid having generated code in the codebase. The protocol data in this repo will soon move to minecraft-data, so there could be a tool to build the .d.ts per version when we ship a release to npm.
    • Importing the types accordingly should be done through side-effect ES6 imports, like below to avoid having to manually import every type (the file would use declare module "bedrock-protocol" to extend the index.d.ts types) :
import 'bedrock-protocol/types/1.17.10'

mineflayer will soon support bedrock-protocol, so many of these issues with types will be a non-issue with a higher level library.

@nobu-sh
Copy link
Author

nobu-sh commented Jul 24, 2021

I see, I see.
The interfaces were initially made for a tool I was working on for interacting with realms so I just wanted to share.

Honestly, as you said auto-generated before publish would be much handier and shouldn't be overly hard so I should probably look into it. :p

@rom1504 rom1504 closed this Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants