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

Improve workflow and fix ESM modules #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ScreamZ
Copy link

@ScreamZ ScreamZ commented Nov 4, 2024

@endel Had issue with your ESM code

you can try it with a simple with bun (ou deno or node as u which), the important part is "type": "module" or use a .mjs file.

import Timer from "@colyseus/timer"

const timer = new Timer();
{
  "name": "sandbox",
  "module": "index.ts",
  "type": "module",
  "devDependencies": {
    "@types/bun": "latest"
  },
  "peerDependencies": {
    "typescript": "^5.0.0"
  },
  "dependencies": {
    "@colyseus/timer": "^1.0.0"
  }
}

, 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 https://www.totaltypescript.com/how-to-create-an-npm-package for best practice and ensure export are stable.

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.

1 participant