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

Update project to get proper ESM export and tests. #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ScreamZ
Copy link
Contributor

@ScreamZ ScreamZ commented Nov 4, 2024

Warning

Do not merge until clock is released, as it depends on it and i need to update depencies for 1.1
Ping me when ready.

@endel Had issue with your ESM code, so i rewrote full clock and timer (as they depends on each others.)

They both works in commonJS and ESM.

Added CI checks with github workflows
Based on work from totaltypescript.com/how-to-create-an-npm-package

@endel
Copy link
Member

endel commented Nov 7, 2024

Hi @ScreamZ, thank you for the pull-request. I'm afraid ESM support is already working since the package rename here: 07fb476

I think the real issue is that @colyseus/core 0.15 is still requiring the previous @gamestdio/timer instead of @colyseus/timer.

I am hesitant to add so many new dependencies as history has shown keeping up-to-date with a number of different tools only adds burden to maintaining such simple package as @colyseus/timer is (although there are quite a few already!)

@ScreamZ
Copy link
Contributor Author

ScreamZ commented Nov 7, 2024

Hi @ScreamZ, thank you for the pull-request. I'm afraid ESM support is already working since the package rename here: 07fb476

I think the real issue is that @colyseus/core 0.15 is still requiring the previous @gamestdio/timer instead of @colyseus/timer.

I am hesitant to add so many new dependencies as history has shown keeping up-to-date with a number of different tools only adds burden to maintaining such simple package as @colyseus/timer is (although there are quite a few already!)

The change consists on two changes, first change to clock (colyseus/clock#3) then to timer (this one)
It might work in colyseus core, but as I said earlier this year, I'm using timer in my own project, and I can confirm that what's currently exported from colyseus/timer is not Typescript/ESM compliant. I've dropped an example on the colyseus/clock#3

I can understand your fears and respect them. I just wanted to share what I've done. So I'll probably make my own fork on npm as I can't use the library right now 😅

I would be pleased to use more things from colyseus, but I've migrated to a simpler protocol to implement without compilation for my IoT Server Kit. I'm already taking a lot of inspiration of your work, thanks! And I contribute whenever i can ;)

@ScreamZ
Copy link
Contributor Author

ScreamZ commented Nov 18, 2024

So @endel any plan on merging that, or you rather prefer if I publish my own fork of this to support true ESM, both are ok for me

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.

2 participants