From aa7f8d05ee9c74478744d7a63fd93d44e3689f43 Mon Sep 17 00:00:00 2001 From: Shawn Erquhart Date: Fri, 29 Nov 2024 13:51:57 -0500 Subject: [PATCH] use incrementing github dependent counter --- app/routes/_libraries/index.tsx | 20 ++++++++++++++++---- package.json | 2 +- pnpm-lock.yaml | 14 +++++++------- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/app/routes/_libraries/index.tsx b/app/routes/_libraries/index.tsx index 61e77eda..c07afd77 100644 --- a/app/routes/_libraries/index.tsx +++ b/app/routes/_libraries/index.tsx @@ -7,7 +7,10 @@ import { } from '@tanstack/react-router' import { useSuspenseQuery } from '@tanstack/react-query' import { convexQuery } from '@convex-dev/react-query' -import { useNpmDownloadCounter } from '@erquhart/convex-oss-stats/react' +import { + useNpmDownloadCounter, + useGithubDependentCounter, +} from '@erquhart/convex-oss-stats/react' import NumberFlow from '@number-flow/react' import { api } from '../../../convex/_generated/api' import { Carbon } from '~/components/Carbon' @@ -78,8 +81,6 @@ async function bytesSignupServerFn({ email }: { email: string }) { const librariesRouteApi = getRouteApi('/_libraries') -// Will also be used for GitHub dependent count once -// useGithubDependentCounter is fixed upstream const StableCounter = ({ value }: { value?: number }) => { const dummyString = Number( Array(value?.toString().length ?? 1) @@ -117,6 +118,17 @@ const NpmDownloadCounter = ({ return } +// TODO: Use this once useGithubDependentCounter is fixed upstream +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const GitHubDependentCounter = ({ + githubData, +}: { + githubData: Parameters[0] +}) => { + const liveGitHubDependentCount = useGithubDependentCounter(githubData) + return +} + const OssStats = () => { const { data: github } = useSuspenseQuery( convexQuery(api.stats.getGithubOwner, { @@ -170,7 +182,7 @@ const OssStats = () => {
- +
Dependents on GitHub diff --git a/package.json b/package.json index 95cfc57c..8b948b34 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@convex-dev/react-query": "0.0.0-alpha.8", "@docsearch/css": "^3.5.2", "@docsearch/react": "^3.5.2", - "@erquhart/convex-oss-stats": "^0.3.1", + "@erquhart/convex-oss-stats": "^0.3.2", "@headlessui/react": "1.7.18", "@number-flow/react": "^0.4.1", "@octokit/graphql": "^7.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 791e9b0b..3b911792 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,8 +21,8 @@ importers: specifier: ^3.5.2 version: 3.6.0(@algolia/client-search@5.14.2)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(search-insights@2.17.3) '@erquhart/convex-oss-stats': - specifier: ^0.3.1 - version: 0.3.1(convex@1.17.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^0.3.2 + version: 0.3.2(convex@1.17.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@headlessui/react': specifier: 1.7.18 version: 1.7.18(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1092,8 +1092,8 @@ packages: '@emotion/weak-memoize@0.2.5': resolution: {integrity: sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==} - '@erquhart/convex-oss-stats@0.3.1': - resolution: {integrity: sha512-o8cn90niqm0b9LTDd5i244IO9cA6Li7B2HKIRktdoyWYvAVm+RUPC+AwcyCD3cAtm5jV4ViSwYvwgY7hWOYPow==} + '@erquhart/convex-oss-stats@0.3.2': + resolution: {integrity: sha512-DvyofZ+v2SpvIzRn8vzsqi0lVoEev6+yelGstv2mxM1+wK5SHwAvmAj6qt4t4qi8Vf+nJEpKwkSB2lRmmTysCQ==} peerDependencies: convex: ~1.16.5 || ~1.17.0 react: ^17.0.2 || ^18.0.0 || ^19.0.0-0 @@ -7542,7 +7542,7 @@ snapshots: '@emotion/weak-memoize@0.2.5': {} - '@erquhart/convex-oss-stats@0.3.1(convex@1.17.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@erquhart/convex-oss-stats@0.3.2(convex@1.17.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@convex-dev/crons': 0.1.5(convex@1.17.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@octokit/graphql': 8.1.1 @@ -10431,7 +10431,7 @@ snapshots: eslint: 8.57.0 eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.26.0(@babel/core@7.26.0))(@babel/plugin-transform-react-jsx@7.25.9(@babel/core@7.26.0))(eslint@8.57.0) eslint-plugin-import: 2.29.1(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0) - eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3) + eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-react: 7.34.0(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.0(eslint@8.57.0) @@ -10499,7 +10499,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3): + eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0)(typescript@5.6.3): dependencies: '@typescript-eslint/experimental-utils': 5.62.0(eslint@8.57.0)(typescript@5.6.3) eslint: 8.57.0