-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
refactor(typescript): refactored code to use typescript #30
refactor(typescript): refactored code to use typescript #30
Conversation
added ESM, UMD and CJS module exports
added push_pr github action workflow
HI @dvelasquez, I've had a chance to look over this, and I really like it - thanks for taking the time to work on it. I'd like to merge this in with fresh eyes though, so I'm going to check tomorrow to see what changes might be needed in code that consumes the earlier released version of co2.js, then then, and update the changelog and README, to prep for a new release. Much gracias 👍 |
Hey! It would be really interesting to try this branch with a project that uses this as a dependency, to check if everything is ok |
Indeed! Sitespeed would be the big one, as it's in production in a few high profile places. Here's an example of their public dashboards: And below is the direct link to the chart: I had planned to:
This here where it's in use in the sitespeed codebase: https://github.com/sitespeedio/sitespeed.io/blob/main/lib/plugins/sustainable/index.js#L8-L13 And the tests looked like this, but they've since been moved into a separate repo: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty great to me 👍
note: haven't run it locally
hi @dvelasquez thanks so much for this PR. I'm going to close this, as there have been a bunch of changes since this PR was initially created - both in this project, in typescript and in javascript too. Porting this to typescript isn't on the short term roadmap for now, but we're collecting any discussion in the issue below, about whether to add it later: |
No problem, let me know if you want me to tackle this again in the future. |
This PR refactors the code to use TypeScript instead of VanillaJS.
Changes