0.0.1 • Published 1 year ago

browserslist-config-sfgov v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

browserslist-config-sfgov

This is a shareable list of the browsers supported by the San Francisco Digital Services, for use with tools that support browserslist, such as autoprefixer, postcss-preset-env, Babel, and eslint-plugin-compat.

This list is automatically generated from analytics data, and is tailored to support 99% of browsers used within the last year by visitors to sf.gov.

Usage

To use this config, first install browserslist-config-sfgov as a development dependency:

npm install --save-dev browserslist-config-sfgov

Then, in the browserslist field of your package.json, your .browserslistrc, or any of the other supported browserslist config locations, use:

extends browserslist-config-sfgov

For example, in your package.json:

+   "browserslist": ["extends browserslist-config-sfgov"]

You can add entries to the list if you'd like to support specific browsers. You may exclude specific browsers from your own config with the not prefix, e.g. to exclude Internet Explorer entirely in your .browserslistrc:

extends browserslist-config-sfgov
not ie

Updating

This package uses browserslist-ga-export to convert a CSV export from Google Analytics into browserslist-stats.json, which is read when browserslist encounters the in my stats identifier from index.js. The update process is manual:

  1. Install the dev dependencies with npm install
  2. Follow the CSV export instructions from browserslist-ga-export
  3. Copy your CSV export to the data directory, e.g. as data/stats.csv
  4. Run browserslist-ga-export on the CSV file:

    npx browserslist-ga-export --reportPath=data/stats.csv

You should see a success message in your terminal and a diff in browserslist-stats.json. Add the CSV export and your changes, commit them, then file a pull request.

Automated updating

You can automate the updating of the stats, but it's complicated because Google Analytics doesn't provide a way to export custom reports via the API. (Aaaaarrrgh Google, why?) Here's the workaround:

  1. Create a new Google Sheet
  2. Add the Google Analytics add-on
  3. Create a new report from the Sheets menu bar: Add-onsGoogle AnalyticsCreate new report. This will create a new worksheet that houses your report's configuration (not the report data itself).
  4. Set the following options in your report:

    OptionValue
    Report Name"Browser stats" (for instance)
    Start Date30daysAgo (or use a different period)
    End Dateyesterday
    Metrics:pageviews
    Dimensionsga:operatingSystem,ga:operatingSystemVersion,ga:browser,ga:browserVersion,ga:deviceCategory
    Order-ga:pageviews
    Limit1000 (or go lower for less coverage)
  5. Run your report from the Sheets menu bar: Add-onsGoogle AnalyticsRun reports

  6. Set up the report to run periodically: Add-onsGoogle AnalyticsSchedule reports
  7. Set up a Google service account to access the Google Sheets API
  8. Share the Sheet with the email address of your new service account
  9. In your environment (.env locally), set up the following variables:
    • GOOGLE_SHEET_ID: your sheet's ID (in the URL between /sheets/d/ and /edit#...)
    • GOOGLE_CREDS_JSON: your Google service account credentials JSON, on a single line
  10. Test the export script with script/export-browser-stats
  11. Test the whole update process with npm run update
  12. Figure out where to run this in the cloud

😅

0.0.0-8b7d3e4

1 year ago

0.0.0-6d01e7a

1 year ago

0.0.0-e33bc49

1 year ago

0.0.0-c5cdb13

1 year ago

0.0.0-c41afd1

1 year ago

0.0.0-fd2d3dc

1 year ago

0.0.0-883b966

1 year ago

0.0.0-8f8a84e

1 year ago

0.0.0-b55abbb

1 year ago

0.0.0-3c070da

1 year ago

0.0.0-8749dc4

1 year ago

0.0.0-9a5534d

1 year ago

0.0.0-fdfbddb

1 year ago

0.0.0-4949b3f

1 year ago

0.0.0-ab3274f

1 year ago

0.0.0-0c088a6

1 year ago

0.0.0-33a630f

1 year ago

0.0.0-bae4bc5

1 year ago

0.0.0-6dfde4b

1 year ago

0.0.0-967c355

1 year ago

0.0.0-228c291

1 year ago

0.0.0-d42f2a0

1 year ago

0.0.0-d4980b7

1 year ago

0.0.0-b7c2b6b

1 year ago

0.0.0-8f56963

1 year ago

0.0.0-b5c0f10

2 years ago

0.0.0-9115a85

2 years ago

0.0.0-99171d9

2 years ago

0.0.0-32616e0

2 years ago

0.0.0-8efc9ff

1 year ago

0.0.0-c9eccb8

1 year ago

0.0.0-9da2d29

2 years ago

0.0.0-735e714

2 years ago

0.0.0-0935d17

2 years ago

0.0.0-b960401

2 years ago

0.0.0-114ba17

2 years ago

0.0.0-65cb107

2 years ago

0.0.0-840bf1c

2 years ago

0.0.0-310ee67

2 years ago

0.0.0-ca06ac6

2 years ago

0.0.0-a68711d

2 years ago

0.0.0-1de3a61

2 years ago

0.0.0-e4255a3

2 years ago

0.0.0-a671432

2 years ago

0.0.0-35c3c47

2 years ago

0.0.0-f5a9670

2 years ago

0.0.0-7ba8180

2 years ago

0.0.0-57e4563

2 years ago

0.0.0-733125e

2 years ago

0.0.0-962abdf

2 years ago

0.0.0-92b0dea

2 years ago

0.0.0-11536e1

2 years ago

0.0.0-944e292

2 years ago

0.0.0-55691b3

2 years ago

0.0.0-6581dd6

2 years ago

0.0.0-67440c5

2 years ago

0.0.0-013b2f6

2 years ago

0.0.0-aef5f6b

2 years ago

0.0.0-baa5278

2 years ago

0.0.0-826404d

2 years ago

0.0.0-37362ba

2 years ago

0.0.0-5d70010

2 years ago

0.0.0-639d588

2 years ago

0.0.0-00fab38

2 years ago

0.0.0-7b6c7a0

2 years ago

0.0.0-5b193c5

2 years ago

0.0.0-b33e3ff

2 years ago

0.0.0-2444a1a

2 years ago

0.0.0-25dc370

2 years ago

0.0.0-71e0d05

2 years ago

0.0.0-9e0ded7

2 years ago

0.0.0-436a2b8

2 years ago

0.0.0-f7686ff

2 years ago

0.0.0-7203c7f

2 years ago

0.0.0-563f806

2 years ago

0.0.0-fe4f475

2 years ago

0.0.0-6173a30

2 years ago

0.0.0-48fa588

2 years ago

0.0.0-b465674

2 years ago

0.0.0-7334df3

2 years ago

0.0.0-b134d96

2 years ago

0.0.0-998ee63

2 years ago

0.0.0-9eaa31c

2 years ago

0.0.0-90964b3

2 years ago

0.0.0-de11fb2

2 years ago

0.0.0-f5a5b2e

2 years ago

0.0.0-dd2dd98

2 years ago

0.0.0-693b1e4

3 years ago

0.0.0-7b9c847

3 years ago

0.0.0-ef438eb

2 years ago

0.0.0-299eec9

3 years ago

0.0.0-2290e18

3 years ago

0.0.0-2172475

3 years ago

0.0.0-ba43da5

3 years ago

0.0.0-1633849

3 years ago

0.0.0-eaebf76

3 years ago

0.0.0-2d0ecdc

3 years ago

0.0.0-b3be2b4

3 years ago

0.0.0-2955fd7

3 years ago

0.0.0-a8610c9

3 years ago

0.0.0-0e30bf6

3 years ago

0.0.0-007df47

3 years ago

0.0.0-53afb0e

3 years ago

0.0.0-c600dc2

3 years ago

0.0.0-cdfbbd3

3 years ago

0.0.0-a9c8cfc

3 years ago

0.0.0-0e621de

3 years ago

0.0.0-f4f125b

3 years ago

0.0.0-74bf1c0

3 years ago

0.0.0-8c1998a

3 years ago

0.0.0-34fe41e

3 years ago

0.0.0-b608437

3 years ago

0.0.0-bca5838

3 years ago

0.0.1

3 years ago