Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/browser-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tailwind-merge": "^3.2.0",
"webext-bridge": "^6.0.1",
"webextension-polyfill": "^0.12.0",
"zod": "4.0.0-beta.20250414T061543"
"zod": "3.25.20"
},
"devDependencies": {
"@babel/generator": "^7.27.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/browser-extension/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createEnv } from '@t3-oss/env-core';
import { z } from 'zod';
import { z } from 'zod/v4';

export default createEnv({
clientPrefix: 'VITE_PUBLIC_',
Expand Down
2 changes: 1 addition & 1 deletion apps/discord-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"date-fns": "^4.1.0",
"es-toolkit": "^1.34.1",
"posthog-node": "^4.11.6",
"zod": "4.0.0-beta.20250414T061543"
"zod": "3.25.20"
},
"devDependencies": {
"tsup": "^8.4.0"
Expand Down
2 changes: 1 addition & 1 deletion apps/discord-bot/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createEnv } from '@t3-oss/env-core';
import { z } from 'zod';
import { z } from 'zod/v4';

export default createEnv({
server: {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"type-fest": "^4.40.0",
"virtual-file-explorer-backend": "^0.0.4",
"vscode-icons-js": "^11.6.1",
"zod": "4.0.0-beta.20250414T061543"
"zod": "3.25.20"
},
"devDependencies": {
"@million/lint": "^1.0.14",
Expand Down
2 changes: 1 addition & 1 deletion apps/website/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createEnv } from '@t3-oss/env-nextjs';
import { vercel } from '@t3-oss/env-nextjs/presets-zod';
import discordEnv from 'discord-bot/env';
import { z } from 'zod';
import { z } from 'zod/v4';

export default createEnv({
extends: [discordEnv, vercel()],
Expand Down
55 changes: 26 additions & 29 deletions packages/hooks/src/media-query.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,35 @@
import { useState } from 'react';
import { useIsomorphicLayoutEffect } from './isomorphic-layout-effect.js';

export function createMediaQueryHook<T extends Record<string, string>>(
breakpoints: T,
) {
return function useMediaQuery(
query:
| Extract<keyof T, string>
| (`(${'min' | 'max'}-width: ${string})` & {}),
) {
const mediaQuery =
query in breakpoints ? `(min-width: ${breakpoints[query]})` : query;
const breakpoints = {
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
'2xl': '1536px',
} as const;

const [matches, setMatches] = useState<boolean>();
export function useMediaQuery(
query:
| Extract<keyof typeof breakpoints, string>
| (`(${'min' | 'max'}-width: ${string})` & {}),
) {
const mediaQuery =
query in breakpoints
? (`(min-width: ${breakpoints[query as 'sm']})` as const)
: query;
const [matches, setMatches] = useState<boolean>();

useIsomorphicLayoutEffect(() => {
if (typeof window === 'undefined') return;
useIsomorphicLayoutEffect(() => {
if (typeof window === 'undefined') return;

const mediaQueryList = window.matchMedia(mediaQuery);
setMatches(mediaQueryList.matches);
const mediaQueryList = window.matchMedia(mediaQuery);
setMatches(mediaQueryList.matches);

const syncMatches = () => setMatches(mediaQueryList.matches);
mediaQueryList.addEventListener('change', syncMatches);
return () => mediaQueryList.removeEventListener('change', syncMatches);
}, []);
const syncMatches = () => setMatches(mediaQueryList.matches);
mediaQueryList.addEventListener('change', syncMatches);
return () => mediaQueryList.removeEventListener('change', syncMatches);
}, []);

return matches;
};
return matches;
}

export const useMediaQuery = createMediaQueryHook({
sm: '640px',
md: '768px',
lg: '1024px',
xl: '1280px',
'2xl': '1536px',
});
2 changes: 1 addition & 1 deletion packages/shapes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"build": "tsc"
},
"dependencies": {
"zod": "4.0.0-beta.20250414T061543"
"zod": "3.25.20"
}
}
2 changes: 1 addition & 1 deletion packages/shapes/src/execute.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from 'zod';
import { z } from 'zod/v4';

export type ExecuteOptions = z.infer<typeof ExecuteOptions>;
export const ExecuteOptions = z
Expand Down
2 changes: 1 addition & 1 deletion packages/shapes/src/runtime.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { z } from 'zod';
import { z } from 'zod/v4';
import { ExecuteOptions } from './execute.js';

export type PartialRuntime = z.infer<typeof PartialRuntime>;
Expand Down
Loading