New browsers stats (packages/browserslist-config
) can be created via a CSV
that is exported from Google Analytics 4.
Instructions for doing this export can be found at
https://github.com/browserslist/browserslist-ga-export?tab=readme-ov-file#google-analytics-4
We aim to update browserslist-stats.json
every 6 months in January and July.
If you are tasked with this update, the process will be:
- Follow the browserslist-ga-export instructions
- Open the browser metrics CSV file (step 4 from the link above) and delete the "grand total" row if it is present. That row increases the column count and messes up the script.
- Place the metrics file (
metrics.csv
or whatever) in thecfpb-analytics
repository. - In Terminal,
cd
into thecfpb-analytics
repository and use the commandnpx browserslist-ga-export --reportPath metrics.csv
, to generate the.json
file. - Remove the
metrics.csv
file (we don't want to commit the CSV) and movebrowserslist-stats.json
tocfpb-analytics/packages/browserslist-config/browserslist-stats.json
and replace the JSON file that is there already. - Edit the
version
field incfpb-analytics/packages/browserslist-config/package.json
and increment the version one digit. - Create a new git branch in
cfpb-analytics
and rungit status
to see that only thebrowserslist-config/browserslist-stats.json
andbrowserslist-config/package.json
are changed. Commit these two files and push up to GitHub. - Create a Pull Request (PR) on GitHub and open it for review. If all looks good, it can be merged.
- Run the release management instructions below to make a new release.
- Open a new PR in repos that use this package
(such as consumerfinance.gov
and the design-system)
and bump
@cfpb/browserslist-config
. The commmandyarn upgrade-interactive --latest
can often be used. - Update any relevant docs, such as the list on
https://github.com/cfpb/consumerfinance.gov/blob/main/docs/browser-support.md.
You may need to manually temporarily adjust the cutoff in the project's
browserslist string
(for example, to 1%) and run
npx browserslist
in the project to get an updated list of supported browsers. Don't accidentally commit the changed cutoff!
Ready to publish changes to npm?
- Run
npm whoami
to see that you're logged into npm (runnpm login
if needed). cd
into the package you want to publish inside/packages/
.- If it hasn't already been incremented, increment the version number in the package's
package.json
. - Run
npm publish
.
All contributions to this project will be released under the CC0 public domain dedication. By submitting a pull request or filing a bug, issue, or feature request, you are agreeing to comply with this waiver of copyright interest. Details can be found in our TERMS and LICENCE.
There are two primary ways to help:
- Using the issue tracker, and
- Changing the code-base.
Use the issue tracker to suggest feature requests, report bugs, and ask questions. This is also a great way to connect with the developers of the project as well as others who are interested in this solution.
Use the issue tracker to find ways to contribute. Find a bug or a feature, mention in the issue that you will take on that effort, then follow the Changing the code-base guidance below.
Generally speaking, you should fork this repository, make changes in your own fork, and then submit a pull-request. All new code should have associated unit tests that validate implemented features and the presence or lack of defects. Additionally, the code should follow any stylistic and architectural guidelines prescribed by the project. In the absence of such guidelines, mimic the styles and patterns in the existing code-base.