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

Create an npm package #2

Closed
Velover opened this issue Jun 5, 2024 · 13 comments
Closed

Create an npm package #2

Velover opened this issue Jun 5, 2024 · 13 comments

Comments

@Velover
Copy link

Velover commented Jun 5, 2024

Could you pls create an npm package for @rbxts since it was written / just typed for typescript?

@probablytukars
Copy link
Owner

I will take a look at it in a couple days when I have the time to, since I haven't made an npm package before. Out of interest, would you also be interested in this being published to wally (package manager for roblox)? Also, if you could tell me more information about your workflow so I can replicate it, that would be much appreciated, by this I mean: What editor are you using, how are you integrating with roblox (rojo), I assume you are using roblox-ts at some point?

@Velover
Copy link
Author

Velover commented Jun 6, 2024

I never use Wally and I think npm is enough. As well some methods are missing e.g. .Add .Mul .Pow etc.
roblox ts doesn't have these for classes. It would be great if you could add them as well.
Right now I'm making sort of animation tooling with bezier/splines. I think your quaternion library can come in handy

@Velover
Copy link
Author

Velover commented Jun 6, 2024

and as well it would be great if each of these had a method
image

@probablytukars
Copy link
Owner

I've created an npm package npm i @tukars/luaquaternion is how you can install it.

Also, regarding your second comment, these do have functions, they are quat:Normalize() and quat:Length(), if you are talking about the cached versions, then you can just index using quat.unit and quat.magnitude, unless you are talking about methods to directly access the cached functionality? Please clarify, and if it seems reasonable, I will add them :)

I have never used roblox-ts, so I can't confirm whether or not the types work, I just add them for people who use roblox-ts and requested them. If you know how to add metatable methods into roblox-ts I think they could help other people who use this library also :)

@Velover
Copy link
Author

Velover commented Jun 17, 2024

Thank you! It's interesting that you have .d.ts file and you are not using the Roblox TS. About TS you can still set the metametods but you not able to use something like Vector3 + Vector3 so you have to use macros like Vector3.add(Vector3) at the end it compiles to +.

There's no implementations of these macros for classes for now so it's better to add the methods like add mul div etc. I think.

For Roblox TS you have to tell in the .d.ts file that the parameters like . magnitude exist, it's not about the metatables but more about the types

interface ITest{
Test1(): void // compiles to object:Test1()
Test2: () => void // compiles to object.Test2()
}

@probablytukars
Copy link
Owner

I downloaded roblox-ts just to help fix this issue, I expect it to be finished within ~2 hours because I want to overhaul some metamethods to support strict typing within roblox studio (as a major revision). I apologize for the original delay in getting to this issue and hope I can make the roblox-ts experience much better :)

@Velover
Copy link
Author

Velover commented Jun 18, 2024

Thank you a lot for this. Not everyone will decide to try ts just to expand the reach to his package.
The time is not a problem, especially if that package will be on npm after this

@probablytukars
Copy link
Owner

I believe all of your concerns have now been addressed with the release of v2.0.2! If you have any problems let me know, otherwise I will be closing this issue as completed :).

@Velover
Copy link
Author

Velover commented Jun 22, 2024

You can as well make an announcement in the RobloxTS server to get more people to download the package

@Velover
Copy link
Author

Velover commented Jun 22, 2024

btw why you didnt join rbxts, it will not be considered as valid package

@Velover
Copy link
Author

Velover commented Jun 22, 2024

@probablytukars
Copy link
Owner

No worries, I will take a look at it

@probablytukars
Copy link
Owner

Issues have now been addressed in the latest release. :)

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

No branches or pull requests

2 participants