remix-run / react-router-website

The React Router website
https://reactrouter.com
MIT License
152 stars 35 forks source link

fix: npm downloads count #25

Closed sinchang closed 1 year ago

sinchang commented 1 year ago

we got the below error when back to the home page

image

the root cause is that the npmDownloads is NaN

the npm download counts API response

query [
  {
    downloads: 1993005,
    start: '2015-01-10',
    end: '2016-01-10',
    package: 'react-router'
  },
  {
    downloads: 9876499,
    start: '2016-01-11',
    end: '2017-01-11',
    package: 'react-router'
  },
  {
    downloads: 28481372,
    start: '2017-01-12',
    end: '2018-01-12',
    package: 'react-router'
  },
  {
    downloads: 62270439,
    start: '2018-01-13',
    end: '2019-01-13',
    package: 'react-router'
  },
  {
    downloads: 127107479,
    start: '2019-01-14',
    end: '2020-01-14',
    package: 'react-router'
  },
  {
    downloads: 184417302,
    start: '2020-01-15',
    end: '2021-01-15',
    package: 'react-router'
  },
  {
    downloads: 250765671,
    start: '2021-01-16',
    end: '2022-01-16',
    package: 'react-router'
  },
  {
    downloads: 417683846,
    start: '2022-01-17',
    end: '2023-01-03',
    package: 'react-router'
  },
  { error: 'end date > start date' }
]
timdorr commented 1 year ago

This will pass tests once merged, so let's get this in. Thanks!