Skip to content

Commit

Permalink
typescript, other dependency updates (#356)
Browse files Browse the repository at this point in the history
* typescript, other dependency updates

* restore import

* patch refresh_token
  • Loading branch information
chrisdroukas authored Sep 6, 2023
1 parent a8ae36b commit 471df4b
Show file tree
Hide file tree
Showing 9 changed files with 1,156 additions and 913 deletions.
6 changes: 5 additions & 1 deletion apps/site/app/api/activity/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ import { ActivityStats } from "../schemas/activity";

export async function GET() {
const entries = await firebase.collection("access_tokens").get();

const refresh_token = entries.docs.map(doc => doc.data()).find(data => 'refresh_token' in data)?.refresh_token;

let [{ refresh_token }] = entries.docs.map((entry) => entry.data());
if (!refresh_token) {
throw new Error("refresh_token not found");
}

const responseToken = await fetch(
`https://www.strava.com/api/v3/oauth/token?client_id=${process.env.STRAVA_CLIENT_ID}&client_secret=${process.env.STRAVA_CLIENT_SECRET}&grant_type=refresh_token&refresh_token=${refresh_token}`,
Expand Down
8 changes: 4 additions & 4 deletions apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"date-fns": "2.30.0",
"firebase-admin": "11.10.1",
"gray-matter": "4.0.3",
"react-hook-form": "7.46.0",
"react-hook-form": "7.46.1",
"next": "13.4.19",
"next-auth": "4.23.1",
"next-contentlayer": "0.3.4",
Expand All @@ -37,10 +37,10 @@
"zod": "3.22.2"
},
"devDependencies": {
"@babel/core": "7.22.11",
"@babel/core": "7.22.15",
"@mdx-js/mdx": "2.3.0",
"@tailwindcss/line-clamp": "0.4.4",
"@tailwindcss/typography": "0.5.9",
"@tailwindcss/typography": "0.5.10",
"prisma": "5.2.0",
"@types/node": "20.5.9",
"@types/react": "18.2.21",
Expand All @@ -51,7 +51,7 @@
"eslint-config-custom": "workspace:*",
"postcss": "8.4.29",
"rehype": "13.0.1",
"rehype-autolink-headings": "6.1.1",
"rehype-autolink-headings": "7.0.0",
"rehype-pretty-code": "0.10.1",
"rehype-slug": "6.0.0",
"remark": "14.0.3",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"turbo": "1.10.13",
"typescript": "5.2.2"
},
"packageManager": "pnpm@8.7.1",
"packageManager": "pnpm@8.7.4",
"engines": {
"node": ">=18.17.0"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-presets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"devDependencies": {
"@jest/globals": "29.6.4",
"@testing-library/jest-dom": "6.1.2",
"@testing-library/jest-dom": "6.1.3",
"ts-jest": "29.1.1"
}
}
5 changes: 4 additions & 1 deletion packages/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
"forceConsistentCasingInFileNames": true,
"inlineSources": false,
"isolatedModules": true,
"moduleResolution": "node",
"moduleResolution": "Node",
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"moduleDetection": "force",
"noUncheckedIndexedAccess": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"strict": true
},
Expand Down
17 changes: 7 additions & 10 deletions packages/tsconfig/nextjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@
"display": "Next.js",
"extends": "./base.json",
"compilerOptions": {
"plugins": [{ "name": "next" }],
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": true,
"declaration": false,
"declarationMap": false,
"incremental": true,
"jsx": "preserve",
"lib": ["dom", "dom.iterable", "esnext"],
"module": "esnext",
"noEmit": true,
"module": "esnext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"strict": true,
"target": "es5",
"jsx": "preserve",
"incremental": true,
"plugins": [{ "name": "next" }],
"baseUrl": ".",
"paths": {
"@/*": ["../../packages/ui/*"]
}
},
"include": ["src", "next-env.d.ts"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
4 changes: 3 additions & 1 deletion packages/ui/library/hooks/use-breakpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ type BreakpointKey = keyof ScreensConfig;

export function useBreakpoint<K extends string>(breakpointKey: K) {
const breakpointValue = breakpoints[breakpointKey as BreakpointKey];

const bool = useMediaQuery({
query: `(max-width: ${breakpointValue})`,
});

const capitalizedKey =
breakpointKey[0].toUpperCase() + breakpointKey.substring(1);
breakpointKey?.[0]?.toUpperCase() + breakpointKey?.substring(1);

type KeyAbove = `isAbove${Capitalize<K>}`;
type KeyBelow = `isBelow${Capitalize<K>}`;
Expand Down
7 changes: 3 additions & 4 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,19 @@
"cmdk": "0.2.0",
"contentlayer": "0.3.4",
"date-fns": "2.30.0",
"lucide-react": "0.274.0",
"next": "13.4.19",
"next-contentlayer": "0.3.4",
"next-themes": "0.2.1",
"react-day-picker": "8.8.1",
"react-hook-form": "7.46.0",
"react-hook-form": "7.46.1",
"tailwind-merge": "1.14.0",
"tailwindcss-animate": "1.0.7",
"zod": "3.22.2"
},
"devDependencies": {
"@tailwindcss/line-clamp": "0.4.4",
"@tailwindcss/typography": "0.5.9",
"@testing-library/jest-dom": "6.1.2",
"@tailwindcss/typography": "0.5.10",
"@testing-library/jest-dom": "6.1.3",
"@testing-library/react": "14.0.0",
"@types/jest": "29.5.4",
"@types/mdx": "2.0.7",
Expand Down
Loading

1 comment on commit 471df4b

@vercel
Copy link

@vercel vercel bot commented on 471df4b Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.