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

separate options parsing for byteTrace and visitTrace functions #226

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,62 @@
"contributions": [
"code"
]
},
{
"login": "dsubject",
"name": "Dani Subject",
"avatar_url": "https://avatars.githubusercontent.com/u/33845418?s=64&v=4",
"profile": "https://github.com/dsubject",
"contributions": [
"code"
]
},
{
"login": "Malay-dev",
"name": "Malay Kumar",
"avatar_url": "https://avatars.githubusercontent.com/u/91375797?s=64&v=4",
"profile": "https://github.com/Malay-dev",
"contributions": [
"doc"
]
},
{
"login": "samuelIkoli",
"name": "Samuel Ikoli",
"avatar_url": "https://avatars.githubusercontent.com/u/98848723?v=4",
"profile": "https://github.com/samuelIkoli",
"contributions": [
"doc"
]
},
{
"login": "APJohns",
"name": "Ash Johns",
"avatar_url": "https://avatars.githubusercontent.com/u/18357173?v=4",
"profile": "https://github.com/APJohns",
"contributions": [
"bug",
"code"
]
},
{
"login": "mgriffin-scottlogic",
"name": "Matthew Griffin",
"avatar_url": "https://avatars.githubusercontent.com/u/117279304?v=4",
"profile": "https://github.com/mgriffin-scottlogic",
"contributions": [
"doc",
"code"
]
},
{
"login": "hanopcan",
"name": "Hannah",
"avatar_url": "https://avatars.githubusercontent.com/u/11687898?v=4",
"profile": "https://github.com/hanopcan",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
Expand Down
35 changes: 18 additions & 17 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@ name: Unit tests
on:
push:
branches:
- main
- ca-v0.10.0
- main
pull_request:
branches:
- main
- ca-v0.10.0
- main
permissions:
contents: read
contents: read
jobs:
build:
runs-on: ubuntu-latest
# We officially support LTS versions of nodejs still inside
# their security support window
# https://endoflife.date/nodejs
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm ci
- name: Verify lint
run: npm run lint
- name: Run unit tests
run: npm test
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm ci
- name: Verify lint
run: npm run lint
- name: Run unit tests
run: npm test
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add ability to create adaptors which provide access to external data sources #134
- Add access to the Electricity Maps API free tier #134
- Allow access to individual models and their internal functions #195
- Update the Github actions testing matrix to Node 18,20, and 22 #242
<!-- - _(Add a summary of your feature, and if relevant the issue, in your PR for merging into `main`)_ -->

## Released
Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ Thank you for considering contributing to CO2.js. Open source is at the heart of
**NB** Changes/commits that are not linked to an issue will not be accepted.

### New issues
- Our issue template provides you with a scaffold to follow when raising a new issue. There are three formats to choose from:
1. *Bugs* - clearly describe the problem you're facing including steps to reproduce it. Please also be sure to include the information about the environment your code was running in (e.g. NodeJS, Deno, Edge Worker, Browser etc).
1. *New features* - clearly describe the new feature you'd like to see added and provide a reason for why it should be added. eg what will be improved/possible as a result of making your suggested change.
1. *Request addition of carbon estimation model to CO2.js* - please provide as much information about the model as possible including links to additional documentation and information about how the model is licensed.


- Our issue template provides you with a scaffold to follow when raising a new issue. There are three formats to choose from:
1. _Bugs_ - clearly describe the problem you're facing including steps to reproduce it. Please also be sure to include the information about the environment your code was running in (e.g. NodeJS, Deno, Edge Worker, Browser etc).
1. _New features_ - clearly describe the new feature you'd like to see added and provide a reason for why it should be added. eg what will be improved/possible as a result of making your suggested change.
1. _Request addition of carbon estimation model to CO2.js_ - please provide as much information about the model as possible including links to additional documentation and information about how the model is licensed.

## Making Changes

- Fork the repository on GitHub.
- Create a topic branch from where you want to base your work. This branch should usually be based off `main`.
- Remember to add JSDoc comments to any new functions or variables that you are introducing into the codebase.
- Make commits of logical units.
- Make commit messages clear and understandable.

Expand All @@ -28,10 +28,10 @@ Thank you for considering contributing to CO2.js. Open source is at the heart of
- Push the changes made in your branch to your fork of this repository.
- Submit a [pull request](https://github.com/thegreenwebfoundation/co2.js/pulls) to the CO2.js repository in the `thegreenwebfoundation` organization.
- When opening a new pull request, you'll see a template. Please follow it. It asks you to state:
- the type of change (choose from a list)
- link to the related issue
- what documentation needs updating as a result (choose from a list)
- what your changes are - be sure to clearly explain the changes you've made, any new files, dependencies, or network requests that have been added, and provide any additional context to help reviewers understand the changes made.
- the type of change (choose from a list)
- link to the related issue
- what documentation needs updating as a result (choose from a list)
- what your changes are - be sure to clearly explain the changes you've made, any new files, dependencies, or network requests that have been added, and provide any additional context to help reviewers understand the changes made.
- Your pull request will be reviewed by a maintainer from Green Web Foundation.
- After feedback has been given we expect responses within two weeks. After two weeks we may close the pull request if it isn't showing any activity.

Expand All @@ -43,4 +43,4 @@ Please note that this project is released with a [Contributor Code of Conduct](h

## Thank you

Again, thank you for your contributions. We appreciate your help improving CO2.js, and we look forward to your future contributions!
Again, thank you for your contributions. We appreciate your help improving CO2.js, and we look forward to your future contributions!
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# CO2.js

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-)

[![All Contributors](https://img.shields.io/badge/all_contributors-20-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

<img src="https://github.com/thegreenwebfoundation/co2.js/actions/workflows/unittests.yml/badge.svg" />
Expand All @@ -24,7 +22,7 @@ Internally, you may want to use this library to create a _carbon budget_ for you

For user facing applications, CO2.js could be used to check & block the uploading of carbon intensive files. Or, to present users with information about the carbon impact of their online activities (such as browsing a website).

The above a just a few examples of the many and varied ways CO2.js can be applied to provide carbon estimates for data transfer. If you’re using CO2.js in production we’d love to hear how! [Contact us](https://www.thegreenwebfoundation.org/support-form/) via our website.
The above are just a few examples of the many and varied ways CO2.js can be applied to provide carbon estimates for data transfer. If you’re using CO2.js in production we’d love to hear how! [Contact us](https://www.thegreenwebfoundation.org/support-form/) via our website.

## Installation

Expand Down Expand Up @@ -160,6 +158,14 @@ To contribute changes back to this project, please follow the steps outlined in
<td align="center" valign="top" width="14.28%"><a href="https://github.com/p-gerard"><img src="https://avatars.githubusercontent.com/u/97036756?v=4?s=100" width="100px;" alt="p-gerard"/><br /><sub><b>p-gerard</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/issues?q=author%3Ap-gerard" title="Bug reports">🐛</a> <a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=p-gerard" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sfishel18"><img src="https://avatars.githubusercontent.com/u/294695?v=4?s=100" width="100px;" alt="Simon Fishel"/><br /><sub><b>Simon Fishel</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=sfishel18" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dsubject"><img src="https://avatars.githubusercontent.com/u/33845418?s=64&v=4?s=100" width="100px;" alt="Dani Subject"/><br /><sub><b>Dani Subject</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=dsubject" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Malay-dev"><img src="https://avatars.githubusercontent.com/u/91375797?s=64&v=4?s=100" width="100px;" alt="Malay Kumar"/><br /><sub><b>Malay Kumar</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=Malay-dev" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/samuelIkoli"><img src="https://avatars.githubusercontent.com/u/98848723?v=4?s=100" width="100px;" alt="Samuel Ikoli"/><br /><sub><b>Samuel Ikoli</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=samuelIkoli" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/APJohns"><img src="https://avatars.githubusercontent.com/u/18357173?v=4?s=100" width="100px;" alt="Ash Johns"/><br /><sub><b>Ash Johns</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/issues?q=author%3AAPJohns" title="Bug reports">🐛</a> <a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=APJohns" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mgriffin-scottlogic"><img src="https://avatars.githubusercontent.com/u/117279304?v=4?s=100" width="100px;" alt="Matthew Griffin"/><br /><sub><b>Matthew Griffin</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=mgriffin-scottlogic" title="Documentation">📖</a> <a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=mgriffin-scottlogic" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/hanopcan"><img src="https://avatars.githubusercontent.com/u/11687898?v=4?s=100" width="100px;" alt="Hannah"/><br /><sub><b>Hannah</b></sub></a><br /><a href="https://github.com/thegreenwebfoundation/co2.js/commits?author=hanopcan" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>

Expand Down
Loading