diff --git a/src/application-starter/api/create-worker.ts b/src/application-starter/api/create-worker.ts index 921f99a9d..8afa6922d 100644 --- a/src/application-starter/api/create-worker.ts +++ b/src/application-starter/api/create-worker.ts @@ -123,9 +123,7 @@ type GeneratedAddOnMetadata = Omit< | 'partner' | 'packageAdditions' > & - GeneratedAddOnFields & { - packageAdditions?: GeneratedAddOnPackageAdditions - } + GeneratedAddOnFields type GeneratedWorkerAddOnManifestModule = GeneratedWorkerManifestModule & { addOn: GeneratedAddOnManifest @@ -365,7 +363,6 @@ function getAddOnMetadata( envVars: getAddOnEnvVars(addOn.envVars), options: getAddOnOptions(addOn.options), partner: getAddOnPartner(addOn.partner), - packageAdditions: getPackageAdditions(addOn.packageAdditions), } } diff --git a/src/application-starter/api/feature-artifacts.ts b/src/application-starter/api/feature-artifacts.ts index 905c22c35..335f020b0 100644 --- a/src/application-starter/api/feature-artifacts.ts +++ b/src/application-starter/api/feature-artifacts.ts @@ -1,4 +1,3 @@ -import { type AddOnCompiled } from './compile' import { compileWithAttributionHandler, type ProjectDefinition } from './compile' import { type FrameworkId } from './config' @@ -8,7 +7,6 @@ export interface FeatureArtifactsRequest { framework?: FrameworkId tailwind?: boolean featureOptions?: Record> - customIntegrations?: Array } export interface FeatureArtifact { @@ -44,7 +42,6 @@ export async function featureArtifactsHandler( tailwind, features: request.features, featureOptions: request.featureOptions ?? {}, - customIntegrations: request.customIntegrations, } const output = await compileWithAttributionHandler(definition) diff --git a/src/auth/oauth.server.ts b/src/auth/oauth.server.ts index f980169b2..418eb886c 100644 --- a/src/auth/oauth.server.ts +++ b/src/auth/oauth.server.ts @@ -269,23 +269,13 @@ export async function exchangeGitHubCode( code: string, clientId: string, clientSecret: string, - redirectUri?: string, ): Promise { - const body: { - client_id: string - client_secret: string - code: string - redirect_uri?: string - } = { + const body = { client_id: clientId, client_secret: clientSecret, code, } - if (redirectUri) { - body.redirect_uri = redirectUri - } - const tokenResponse = await fetch( 'https://github.com/login/oauth/access_token', { diff --git a/src/chat/components/projects/Loading.tsx b/src/chat/components/projects/Loading.tsx index 0e292ff31..942372834 100644 --- a/src/chat/components/projects/Loading.tsx +++ b/src/chat/components/projects/Loading.tsx @@ -88,7 +88,7 @@ export function BuilderEditorSkeleton({ headerActions = true, subtitle, title, -}: BuilderEditorSkeletonProps = {}) { +}: BuilderEditorSkeletonProps) { return (
void } -async function getCroppedImg( - imageSrc: string, - pixelCrop: Area, - outputSize: number = 256, -): Promise { +async function getCroppedImg(imageSrc: string, pixelCrop: Area): Promise { + const outputSize = 256 const image = new Image() image.crossOrigin = 'anonymous' diff --git a/src/components/BlogCard.tsx b/src/components/BlogCard.tsx index 688ca4302..55b311703 100644 --- a/src/components/BlogCard.tsx +++ b/src/components/BlogCard.tsx @@ -16,16 +16,9 @@ export type { BlogCardPost } from '~/utils/blog-format' type BlogCardProps = { post: BlogCardPost showLibraryBadges?: boolean - /** Hero treatment: side-by-side on wider screens with larger type. Used for - * the single latest post at the top of the blog index. */ - featured?: boolean } -export function BlogCard({ - post, - showLibraryBadges = true, - featured = false, -}: BlogCardProps) { +export function BlogCard({ post, showLibraryBadges = true }: BlogCardProps) { const { slug, title, @@ -40,12 +33,9 @@ export function BlogCard({ const blogLibraries = showLibraryBadges ? getBlogLibraries(library) : [] const cardClassName = twMerge( 'relative flex flex-col justify-between overflow-hidden transition-all hover:shadow-sm hover:border-blue-500', - // Featured: image and copy sit side-by-side once there's room. - featured && 'md:flex-row md:justify-start', ) const mediaClassName = twMerge( 'aspect-video w-full overflow-hidden bg-background-subtle', - featured && 'md:aspect-auto md:w-1/2', ) const content = ( @@ -69,10 +59,10 @@ export function BlogCard({ fit: 'cover', format: 'auto', quality: 80, - width: featured ? 1200 : 800, + width: 800, })} alt="" - loading={featured ? 'eager' : 'lazy'} + loading="lazy" decoding="async" className="w-full h-full object-cover" /> @@ -84,21 +74,9 @@ export function BlogCard({ className={mediaClassName} /> )} -
+
-

- {title} -

+

{title}

by {formatAuthors(authors)} {published ? ( @@ -109,12 +87,7 @@ export function BlogCard({ ) : null}
{excerpt ? ( -

+

{excerpt}

) : null} diff --git a/src/components/ButtonGroup.tsx b/src/components/ButtonGroup.tsx index bed0087f8..d20cc2641 100644 --- a/src/components/ButtonGroup.tsx +++ b/src/components/ButtonGroup.tsx @@ -59,8 +59,6 @@ type SegmentedControlProps = { /** Labels the group for assistive tech (the control has no visible label). */ 'aria-label': string size?: SegmentSize - /** Stretch to fill the container, splitting width evenly across options. */ - fullWidth?: boolean className?: string } @@ -79,18 +77,13 @@ export function SegmentedControl({ onValueChange, 'aria-label': ariaLabel, size = 'md', - fullWidth = false, className, }: SegmentedControlProps) { return (
{options.map((option) => { const selected = value === option.value @@ -102,11 +95,7 @@ export function SegmentedControl({ aria-label={option['aria-label']} disabled={option.disabled} onClick={() => onValueChange(option.value)} - className={segmentClasses( - size, - selected, - fullWidth ? 'flex-1' : undefined, - )} + className={segmentClasses(size, selected)} > {option.label} diff --git a/src/components/CopyPageDropdown.tsx b/src/components/CopyPageDropdown.tsx index d5d574157..bbb7d8d33 100644 --- a/src/components/CopyPageDropdown.tsx +++ b/src/components/CopyPageDropdown.tsx @@ -115,7 +115,7 @@ export function CopyPageDropdown({ currentFramework, content: rawContent, label = 'Copy page', -}: CopyPageDropdownProps = {}) { +}: CopyPageDropdownProps) { const [open, setOpen] = React.useState(false) const copied = useTemporaryFlag() const { notify } = useToast() diff --git a/src/components/Doc.tsx b/src/components/Doc.tsx index 0a75bb9a9..ccc78942b 100644 --- a/src/components/Doc.tsx +++ b/src/components/Doc.tsx @@ -39,8 +39,6 @@ type DocProps = { // Breadcrumb props (optional) config?: ConfigSchema breadcrumbItems?: Array - // Footer content rendered after markdown - footer?: React.ReactNode // Optional framework to use (overrides URL and local storage) framework?: string } @@ -61,7 +59,6 @@ export function Doc({ pagePath, config, breadcrumbItems, - footer, framework: frameworkProp, }: DocProps) { const { groups: startHostingPartnerGroups } = useStartHostingPartners() @@ -219,7 +216,7 @@ export function Doc({ ) : null}
) : null} - {footer ?? } +
diff --git a/src/components/Dropdown.tsx b/src/components/Dropdown.tsx index 8ae01bc66..bd548cd48 100644 --- a/src/components/Dropdown.tsx +++ b/src/components/Dropdown.tsx @@ -20,10 +20,8 @@ type DropdownContentProps = { className?: string align?: 'start' | 'center' | 'end' sideOffset?: number - portal?: boolean onFocus?: React.FocusEventHandler onPointerEnter?: React.PointerEventHandler - onPointerLeave?: React.PointerEventHandler } type DropdownItemProps = { @@ -67,35 +65,28 @@ export function DropdownContent({ className, align = 'end', sideOffset = 6, - portal = true, onFocus, onPointerEnter, - onPointerLeave, }: DropdownContentProps) { - const content = ( - - {children} - + return ( + + + {children} + + ) - - if (!portal) { - return content - } - - return {content} } export function DropdownItem({ diff --git a/src/components/FilterComponents.tsx b/src/components/FilterComponents.tsx index 936ca3442..a164aa7a8 100644 --- a/src/components/FilterComponents.tsx +++ b/src/components/FilterComponents.tsx @@ -154,27 +154,16 @@ export function TopBarFilter({ interface FilterChipProps { label: string onRemove: () => void - onClick?: () => void className?: string } -export function FilterChip({ - label, - onRemove, - onClick, - className, -}: FilterChipProps) { +export function FilterChip({ label, onRemove, className }: FilterChipProps) { return ( e.key === 'Enter' && onClick() : undefined} - role={onClick ? 'button' : undefined} - tabIndex={onClick ? 0 : undefined} > {label} - -
- )} +
+ + + +
) } diff --git a/src/components/Squircle.tsx b/src/components/Squircle.tsx index 4c7e4f7c7..176af1b0a 100644 --- a/src/components/Squircle.tsx +++ b/src/components/Squircle.tsx @@ -25,10 +25,7 @@ function supportsNativeSquircle(): boolean { ) } -export function useSquircleFallback( - ref: React.RefObject, - smoothing = 0.6, -) { +export function useSquircleFallback(ref: React.RefObject) { React.useEffect(() => { const el = ref.current if (!el || supportsNativeSquircle()) return @@ -54,7 +51,7 @@ export function useSquircleFallback( el.style.clipPath = `path('${getSvgPath({ width, height, - cornerSmoothing: smoothing, + cornerSmoothing: 0.6, ...corners, })}')` } @@ -71,20 +68,17 @@ export function useSquircleFallback( window.removeEventListener('resize', apply) el.style.clipPath = '' } - }, [ref, smoothing]) + }, [ref]) } -type SquircleProps = React.HTMLAttributes & { - /** 0–1; 0.6 approximates the native `squircle` (superellipse(2)) curve. */ - smoothing?: number -} +type SquircleProps = React.HTMLAttributes /** A `
` that carries a squircle shape cross-browser (see useSquircleFallback). */ export const Squircle = React.forwardRef( - function Squircle({ smoothing, children, ...rest }, forwardedRef) { + function Squircle({ children, ...rest }, forwardedRef) { const localRef = React.useRef(null) React.useImperativeHandle(forwardedRef, () => localRef.current!, []) - useSquircleFallback(localRef, smoothing) + useSquircleFallback(localRef) return (
{children} diff --git a/src/components/TableComponents.tsx b/src/components/TableComponents.tsx index 239cfa97e..0926665be 100644 --- a/src/components/TableComponents.tsx +++ b/src/components/TableComponents.tsx @@ -59,16 +59,12 @@ interface TableHeaderCellProps { children?: React.ReactNode className?: string align?: 'left' | 'right' | 'center' - width?: string - compact?: boolean } export function TableHeaderCell({ children, className = '', align = 'left', - width, - compact = true, }: TableHeaderCellProps) { const alignClass = align === 'right' @@ -76,12 +72,9 @@ export function TableHeaderCell({ : align === 'center' ? 'text-center' : 'text-left' - const paddingClass = compact ? 'px-2 py-1.5' : 'px-4 py-2' - const textSizeClass = compact ? 'text-[10px]' : 'text-xs' return ( {children} @@ -93,8 +86,6 @@ interface SortableTableHeaderCellProps { children?: React.ReactNode className?: string align?: 'left' | 'right' | 'center' - width?: string - compact?: boolean sortable?: boolean sortDirection?: 'asc' | 'desc' | false onSort?: () => void @@ -104,8 +95,6 @@ export function SortableTableHeaderCell({ children, className = '', align = 'left', - width, - compact = true, sortable = false, sortDirection = false, onSort, @@ -116,22 +105,15 @@ export function SortableTableHeaderCell({ : align === 'center' ? 'text-center' : 'text-left' - const paddingClass = compact ? 'px-2 py-1.5' : 'px-4 py-2' - const textSizeClass = compact ? 'text-[10px]' : 'text-xs' - const baseClass = `${paddingClass} ${alignClass} ${textSizeClass} font-semibold text-gray-600 dark:text-gray-400 uppercase whitespace-nowrap ${className}` + const baseClass = `px-2 py-1.5 ${alignClass} text-[10px] font-semibold text-gray-600 dark:text-gray-400 uppercase whitespace-nowrap ${className}` if (!sortable) { - return ( - - {children} - - ) + return {children} } return ( ) => void } @@ -197,7 +178,6 @@ export function TableCell({ className = '', align = 'left', colSpan, - compact = true, onClick, }: TableCellProps) { const alignClass = @@ -206,10 +186,9 @@ export function TableCell({ : align === 'center' ? 'text-center' : 'text-left' - const paddingClass = compact ? 'px-2 py-2' : 'px-4 py-3' return ( diff --git a/src/components/admin/AdminEmptyState.tsx b/src/components/admin/AdminEmptyState.tsx index 6fa2cc84a..04cdb4319 100644 --- a/src/components/admin/AdminEmptyState.tsx +++ b/src/components/admin/AdminEmptyState.tsx @@ -1,22 +1,15 @@ import * as React from 'react' -import { Link } from '@tanstack/react-router' -import { Button } from '~/ui' type AdminEmptyStateProps = { icon: React.ReactNode title: string description?: string - action?: { - label: string - to: string - } } export function AdminEmptyState({ icon, title, description, - action, }: AdminEmptyStateProps) { return (
@@ -31,13 +24,6 @@ export function AdminEmptyState({ {description}

)} - {action && ( -
- - - -
- )}
) } diff --git a/src/components/application-starter/prompt-parts.tsx b/src/components/application-starter/prompt-parts.tsx index 18495f481..8380f45fa 100644 --- a/src/components/application-starter/prompt-parts.tsx +++ b/src/components/application-starter/prompt-parts.tsx @@ -22,7 +22,6 @@ export function StarterChipButton({ className, children, compact = false, - disabled = false, onClick, palette, selected, @@ -31,7 +30,6 @@ export function StarterChipButton({ className?: string children: React.ReactNode compact?: boolean - disabled?: boolean onClick?: () => void palette: StarterPalette selected: boolean @@ -41,7 +39,6 @@ export function StarterChipButton({ - ) - } - return ( ) => ({ ...prev, packageGroups: comparison.packageGroups, diff --git a/src/components/npm-stats/Resizable.tsx b/src/components/npm-stats/Resizable.tsx index 3cd2bbd01..1d1a9caa3 100644 --- a/src/components/npm-stats/Resizable.tsx +++ b/src/components/npm-stats/Resizable.tsx @@ -17,10 +17,6 @@ export type ResizableProps = { options: ResizeChangeOptions, ) => void children: React.ReactNode - minHeight?: number - minWidth?: number - fullWidthSnapThreshold?: number - enableWidthResize?: boolean } type ResizePreviewSize = { @@ -36,10 +32,6 @@ export function Resizable({ width, onSizeChange, children, - minHeight = 300, - minWidth = 320, - fullWidthSnapThreshold = 12, - enableWidthResize = true, }: ResizableProps) { const [isHeightDragging, setIsHeightDragging] = React.useState(false) const [isWidthDragging, setIsWidthDragging] = React.useState(false) @@ -96,26 +88,26 @@ export function Resizable({ }, [containerWidth]) const getHeightFromDelta = React.useCallback( - (deltaY: number) => Math.max(minHeight, startHeightRef.current + deltaY), - [minHeight], + (deltaY: number) => Math.max(300, startHeightRef.current + deltaY), + [], ) const getWidthFromDelta = React.useCallback( ({ deltaX, maxWidth }: { deltaX: number; maxWidth: number }) => { const rawWidth = startWidthRef.current + deltaX * 2 - const nextMinWidth = Math.min(minWidth, maxWidth) + const nextMinWidth = Math.min(320, maxWidth) const nextWidth = Math.max( nextMinWidth, Math.min(maxWidth, Math.round(rawWidth)), ) - if (nextWidth >= maxWidth - fullWidthSnapThreshold) { + if (nextWidth >= maxWidth - 12) { return undefined } return nextWidth }, - [fullWidthSnapThreshold, minWidth], + [], ) const handleHeightMouseDown = React.useCallback( @@ -307,48 +299,44 @@ export function Resizable({ style={{ width: width ?? '100%', maxWidth: '100%' }} > {children} - {enableWidthResize ? ( -
+
) : ( - }> + }> diff --git a/src/routes/admin/users.tsx b/src/routes/admin/users.tsx index 7bd83558c..3f59f6315 100644 --- a/src/routes/admin/users.tsx +++ b/src/routes/admin/users.tsx @@ -316,7 +316,7 @@ function UsersPage() { const bulkAssignRolesToUsers = useBulkAssignRolesToUsers() const bulkUpdateUserCapabilities = useBulkUpdateUserCapabilities() const allRolesQuery = useQuery({ - ...listRolesQueryOptions({}), + ...listRolesQueryOptions(), placeholderData: keepPreviousData, }) const allRoles = useMemo(() => allRolesQuery.data || [], [allRolesQuery.data]) diff --git a/src/routes/stats/npm/index.tsx b/src/routes/stats/npm/index.tsx index 5cf717d6d..b41a1cdbd 100644 --- a/src/routes/stats/npm/index.tsx +++ b/src/routes/stats/npm/index.tsx @@ -430,7 +430,7 @@ function RouteComponent() { }) } - const handleAddBaseline = (packageName: string, color?: string) => { + const handleAddBaseline = (packageName: string) => { navigate({ to: '.', search: (prev) => { @@ -446,7 +446,6 @@ function RouteComponent() { ...groups, { packages: [{ name: packageName, hidden: true }], - color, baseline: true, }, ], diff --git a/src/server/runtime/host.server.ts b/src/server/runtime/host.server.ts index 0e2f445a3..b484839fa 100644 --- a/src/server/runtime/host.server.ts +++ b/src/server/runtime/host.server.ts @@ -142,12 +142,9 @@ export async function getHostRuntimeEnv() { } } -export async function fetchStaticAsset( - input: RequestInfo | URL, - init?: RequestInit, -) { +export async function fetchStaticAsset(input: RequestInfo | URL) { const staticAssets = await getStaticAssetService() - return staticAssets ? staticAssets.fetch(input, init) : fetch(input, init) + return staticAssets ? staticAssets.fetch(input) : fetch(input) } export async function getDatabaseConnectionString() { diff --git a/src/server/shopify/fetch.ts b/src/server/shopify/fetch.ts index 4463d2cb2..a49fd04cb 100644 --- a/src/server/shopify/fetch.ts +++ b/src/server/shopify/fetch.ts @@ -14,11 +14,6 @@ const SHOPIFY_API_VERSION = '2026-01' type ShopifyFetchInput = { query: string variables?: TVariables - /** - * Optional buyer IP, forwarded to Shopify's bot-protection headers. - * Only meaningful with the private token. - */ - buyerIp?: string } type ShopifyResponse = { @@ -59,7 +54,6 @@ export async function shopifyServerFetch< Accept: 'application/json', 'Shopify-Storefront-Private-Token': token, } - if (input.buyerIp) headers['Shopify-Storefront-Buyer-IP'] = input.buyerIp const response = await fetch( `https://${SHOPIFY_STORE_DOMAIN}/api/${SHOPIFY_API_VERSION}/graphql.json`, diff --git a/src/server/sponsors.ts b/src/server/sponsors.ts index 6cfe2de99..a7e88fdce 100644 --- a/src/server/sponsors.ts +++ b/src/server/sponsors.ts @@ -12,7 +12,6 @@ export type SponsorMeta = { imageUrl?: string linkUrl?: string private?: boolean - amount?: number } export type Sponsor = { @@ -77,16 +76,6 @@ export async function getSponsors() { linkUrl: sponsorMeta.linkUrl ?? matchingSponsor.linkUrl, private: sponsorMeta.private ?? matchingSponsor.private, }) - } else if (sponsorMeta.amount) { - sponsors.push({ - login: sponsorMeta.login, - name: sponsorMeta.name || '', - imageUrl: sponsorMeta.imageUrl || '', - linkUrl: sponsorMeta.linkUrl || '', - private: sponsorMeta.private || false, - createdAt: new Date().toISOString(), - amount: sponsorMeta.amount || 0, - }) } }) diff --git a/src/ui/Badge.tsx b/src/ui/Badge.tsx index a5b70f4f9..71db0f2a7 100644 --- a/src/ui/Badge.tsx +++ b/src/ui/Badge.tsx @@ -13,7 +13,6 @@ type BadgeVariant = type BadgeProps = { children: React.ReactNode variant?: BadgeVariant - rounded?: 'md' | 'full' className?: string } @@ -33,14 +32,12 @@ const variantStyles: Record = { export function Badge({ children, variant = 'default', - rounded = 'full', className, }: BadgeProps) { return ( & { - /** Ring color on focus. Defaults to blue. */ - focusRing?: 'blue' | 'orange' | 'purple' -} - -const ringStyles = { - blue: 'focus:ring-blue-500', - orange: 'focus:ring-orange-500', - purple: 'focus:ring-purple-500', -} +type FormInputProps = React.InputHTMLAttributes export const FormInput = React.forwardRef( - function FormInput({ className, focusRing = 'blue', ...props }, ref) { + function FormInput({ className, ...props }, ref) { return ( , 'size'> & { - /** Size variant. 'small' uses compact viewBox. Defaults to 'default'. */ - size?: 'default' | 'small' -} - -export function LogoQueryGG({ size = 'default', ...props }: LogoQueryGGProps) { - if (size === 'small') { - return ( -
- - Query.gg - The Official React Query Course - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ) - } +type LogoQueryGGProps = Omit, 'size'> +export function LogoQueryGG(props: LogoQueryGGProps) { // Default (large) size - keeping original SVG content return (
diff --git a/src/ui/Tooltip.tsx b/src/ui/Tooltip.tsx index 5d759704e..06f65b22c 100644 --- a/src/ui/Tooltip.tsx +++ b/src/ui/Tooltip.tsx @@ -6,7 +6,6 @@ interface TooltipProps { children: React.ReactNode content: React.ReactNode side?: 'top' | 'right' | 'bottom' | 'left' - align?: 'start' | 'center' | 'end' delayDuration?: number className?: string } @@ -15,7 +14,6 @@ export function Tooltip({ children, content, side = 'top', - align = 'center', delayDuration = 200, className, }: TooltipProps) { @@ -30,7 +28,7 @@ export function Tooltip({ { - enabled?: boolean event: TName props: AnalyticsEventProps - threshold?: number } function getPageType(pathname: string) { @@ -175,7 +173,7 @@ export function trackPageView(pagePath: string) { export function useTrackedImpression< TName extends AnalyticsEventName, TElement extends Element = Element, ->({ enabled = true, event, props, threshold = 0.5 }: ImpressionOptions) { +>({ event, props }: ImpressionOptions) { const ref = React.useRef(null) const hasTrackedRef = React.useRef(false) const propsRef = React.useRef(props) @@ -185,7 +183,7 @@ export function useTrackedImpression< }, [props]) React.useEffect(() => { - if (!enabled || hasTrackedRef.current) { + if (hasTrackedRef.current) { return } @@ -215,7 +213,7 @@ export function useTrackedImpression< continue } - if (entry.intersectionRatio < threshold) { + if (entry.intersectionRatio < 0.5) { continue } @@ -224,7 +222,7 @@ export function useTrackedImpression< return } }, - { threshold: [threshold] }, + { threshold: [0.5] }, ) observer.observe(element) @@ -232,7 +230,7 @@ export function useTrackedImpression< return () => { observer.disconnect() } - }, [enabled, event, threshold]) + }, [event]) return ref } diff --git a/src/utils/application-starter.ts b/src/utils/application-starter.ts index f0ada738d..ca94d0a3b 100644 --- a/src/utils/application-starter.ts +++ b/src/utils/application-starter.ts @@ -559,13 +559,11 @@ export async function resolveApplicationStarterDeterministically({ export function composeApplicationStarterResult({ input, - prompt, rationale, recipe, resultType, }: { input: string - prompt?: string rationale: Array recipe: ApplicationStarterRecipe resultType: ApplicationStarterResultType @@ -580,9 +578,7 @@ export function composeApplicationStarterResult({ resultType === 'migration' ? 'Your migration prompt is ready' : 'Your prompt is ready', - prompt: sanitizeStarterPrompt( - prompt || buildPrompt({ input, resultType, recipe }), - ), + prompt: sanitizeStarterPrompt(buildPrompt({ input, resultType, recipe })), rationale, recipe, resultType, diff --git a/src/utils/audit.server.ts b/src/utils/audit.server.ts index 2ccd41e49..7ad6de6d0 100644 --- a/src/utils/audit.server.ts +++ b/src/utils/audit.server.ts @@ -35,9 +35,8 @@ export async function recordAuditLog(opts: { targetType: 'user' | 'role' | 'banner' | 'feed_entry' | 'feedback' targetId: string details?: Record - request?: Request }): Promise { - const { actorId, action, targetType, targetId, details, request } = opts + const { actorId, action, targetType, targetId, details } = opts await db.insert(auditLogs).values({ actorId, @@ -45,7 +44,7 @@ export async function recordAuditLog(opts: { targetType, targetId, details: details ?? null, - ipAddress: request ? getClientIp(request) : undefined, - userAgent: request?.headers.get('user-agent') || undefined, + ipAddress: undefined, + userAgent: undefined, }) } diff --git a/src/utils/browser-effects.ts b/src/utils/browser-effects.ts index 7876a68c0..be3582151 100644 --- a/src/utils/browser-effects.ts +++ b/src/utils/browser-effects.ts @@ -152,18 +152,15 @@ export function useTemporaryFlag(defaultDurationMs = 2000) { } }, []) - const trigger = React.useCallback( - (durationMs = defaultDurationMs) => { - clearTimer() - - setActive(true) - timeoutRef.current = window.setTimeout(() => { - setActive(false) - timeoutRef.current = null - }, durationMs) - }, - [clearTimer, defaultDurationMs], - ) + const trigger = React.useCallback(() => { + clearTimer() + + setActive(true) + timeoutRef.current = window.setTimeout(() => { + setActive(false) + timeoutRef.current = null + }, defaultDurationMs) + }, [clearTimer, defaultDurationMs]) React.useEffect(() => clearTimer, [clearTimer]) diff --git a/src/utils/builder-ai-stream.client.ts b/src/utils/builder-ai-stream.client.ts index fe53345dc..cf39d8d0e 100644 --- a/src/utils/builder-ai-stream.client.ts +++ b/src/utils/builder-ai-stream.client.ts @@ -49,7 +49,6 @@ export async function runBuilderAiStream({ byokProvider, includeReasoningSummaries = false, onActivityEvent, - onChunk, onText, onLocalValidate, onValidate, @@ -64,7 +63,6 @@ export async function runBuilderAiStream({ byokProvider?: BuilderAiRemoteProvider includeReasoningSummaries?: boolean onActivityEvent?: (event: BuilderAiActivityEvent) => void - onChunk?: (chunk: StreamChunk) => void onText?: (text: string) => void onLocalValidate?: ( state: BuilderAiValidationState, @@ -355,7 +353,6 @@ export async function runBuilderAiStream({ throw new Error('Builder AI returned an invalid execution result') } - onChunk?.(chunk) observeTextChunk(chunk) observeActivityChunk(chunk) diff --git a/src/utils/builder-environment.ts b/src/utils/builder-environment.ts index 2f2c988be..a8b1902e4 100644 --- a/src/utils/builder-environment.ts +++ b/src/utils/builder-environment.ts @@ -52,13 +52,12 @@ export const builderImports = { function defineExampleEnvironmentProfile({ createEntrySource, - entryPath = '/__tanstack-example-entry.ts', outputSelector, }: { createEntrySource: (entry: string, outputSource: string) => string - entryPath?: string outputSelector: `#${string}` }) { + const entryPath = '/__tanstack-example-entry.ts' return { entryPath, outputSelector, diff --git a/src/utils/builder-project-events.server.ts b/src/utils/builder-project-events.server.ts index 863928e1a..65cd26d34 100644 --- a/src/utils/builder-project-events.server.ts +++ b/src/utils/builder-project-events.server.ts @@ -156,10 +156,8 @@ export type BuilderProjectQuotaUsage = { } export class BuilderProjectLimitError extends BuilderProjectConflictError { - constructor( - message = `Builder project limit of ${builderProjectOwnerLimit} reached`, - ) { - super(message) + constructor() { + super(`Builder project limit of ${builderProjectOwnerLimit} reached`) this.name = 'BuilderProjectLimitError' } } @@ -306,10 +304,8 @@ export async function getBuilderProjectState({ export async function listBuilderProjectStates({ ownerId, - limit = 100, }: { ownerId: string - limit?: number }) { return db .select({ @@ -350,7 +346,7 @@ export async function listBuilderProjectStates({ ), ) .orderBy(desc(builderProjects.updatedAt)) - .limit(limit) + .limit(100) } export type CreateBuilderProjectStateInput = { @@ -685,7 +681,6 @@ export async function updateBuilderProjectState(input: { title?: string description?: string expectedRevisionNumber?: number - occurredAt?: Date }) { return withBuilderProjectConstraintErrors( () => @@ -755,7 +750,7 @@ export async function updateBuilderProjectState(input: { .limit(1) if (!parentRevision) throw new BuilderProjectConflictError() - const now = input.occurredAt ?? new Date() + const now = new Date() const nextRevisionNumber = project.currentRevisionNumber + 1 const [revision] = await transaction .insert(builderProjectRevisions) @@ -822,15 +817,13 @@ export async function deleteBuilderProjectState(input: { projectId: string ownerId: string clientMutationId: string - actorId?: string - occurredAt?: Date }) { const requestHash = await getBuilderProjectMutationRequestHash({ type: 'project.delete', projectId: input.projectId, ownerId: input.ownerId, clientMutationId: input.clientMutationId, - actorId: input.actorId ?? input.ownerId, + actorId: input.ownerId, }) return db.transaction(async (transaction) => { const project = await lockOwnedProject( @@ -846,7 +839,7 @@ export async function deleteBuilderProjectState(input: { requestHash, }) - const now = input.occurredAt ?? new Date() + const now = new Date() await cancelNonterminalRunsForDeletedProjectInTransaction( transaction, project, @@ -859,7 +852,7 @@ export async function deleteBuilderProjectState(input: { .update(builderProjects) .set({ deletedAt: now, - deletedById: input.actorId ?? input.ownerId, + deletedById: input.ownerId, updatedAt: now, }) .where(eq(builderProjects.id, input.projectId)) @@ -881,7 +874,7 @@ export async function deleteBuilderProjectState(input: { payload: { projectId: input.projectId, deletedAt: now.toISOString(), - actorId: input.actorId ?? input.ownerId, + actorId: input.ownerId, }, occurredAt: now, allowQuotaOverflow: true, @@ -893,12 +886,11 @@ export async function deleteBuilderProjectState(input: { export async function quarantineBuilderProjectsBySnapshotHash({ snapshotHash, actorId, - occurredAt = new Date(), }: { snapshotHash: string actorId: string - occurredAt?: Date }) { + const occurredAt = new Date() return db.transaction(async (transaction) => { const projects = await transaction .select() @@ -1272,7 +1264,6 @@ export async function enqueueBuilderProjectRun(input: { queueKind: 'queue' | 'steer' provider: string model: string - occurredAt?: Date userMessage: { id: string clientMutationId: string @@ -1327,7 +1318,7 @@ export async function enqueueBuilderProjectRun(input: { throw new BuilderProjectConflictError('Builder thread not found') } - const now = input.occurredAt ?? new Date() + const now = new Date() const firstMessageTitle = thread.lastMessagePosition === 0 ? getBuilderThreadTitle(input.userMessage.content) @@ -1439,10 +1430,8 @@ export async function claimBuilderProjectRun(input: { clientMutationId: string requestHash: string leaseOwnerId: string - leaseDurationMs?: number - occurredAt?: Date }) { - const leaseDurationMs = getLeaseDuration(input.leaseDurationMs) + const leaseDurationMs = 30_000 const result = await db.transaction(async (transaction) => { const project = await lockOwnedProject( transaction, @@ -1482,7 +1471,7 @@ export async function claimBuilderProjectRun(input: { ) } - const now = input.occurredAt ?? new Date() + const now = new Date() await interruptExpiredRunsInTransaction( transaction, input.projectId, @@ -1602,7 +1591,6 @@ export async function cancelPendingBuilderProjectRun(input: { clientMutationId: string requestHash: string browserSessionId: string - occurredAt?: Date }) { return db.transaction(async (transaction) => { await lockOwnedProject(transaction, input.projectId, input.ownerId) @@ -1624,7 +1612,7 @@ export async function cancelPendingBuilderProjectRun(input: { return commandResult(input.clientMutationId, existingEvents) } - const now = input.occurredAt ?? new Date() + const now = new Date() const [run] = await transaction .update(builderProjectRuns) .set({ @@ -1665,13 +1653,11 @@ export async function renewBuilderProjectRunLease(input: { leaseOwnerId: string fencingToken: number clientMutationId: string - leaseDurationMs?: number - occurredAt?: Date }) { - const leaseDurationMs = getLeaseDuration(input.leaseDurationMs) + const leaseDurationMs = 30_000 const result = await db.transaction(async (transaction) => { await lockOwnedProject(transaction, input.projectId, input.ownerId) - const now = input.occurredAt ?? new Date() + const now = new Date() const expired = await interruptExpiredRunsInTransaction( transaction, input.projectId, @@ -1739,7 +1725,6 @@ export async function finishBuilderProjectRun(input: { clientMutationId: string error: BuilderJsonObject } - occurredAt?: Date assistantMessage?: { id: string clientMutationId: string @@ -1798,7 +1783,7 @@ export async function finishBuilderProjectRun(input: { } } - const now = input.occurredAt ?? new Date() + const now = new Date() await interruptExpiredRunsInTransaction( transaction, input.projectId, @@ -2085,12 +2070,10 @@ export async function finishBuilderProjectRun(input: { export async function interruptExpiredBuilderProjectRuns({ projectId, ownerId, - occurredAt, includeDeleted = false, }: { projectId: string ownerId: string - occurredAt?: Date includeDeleted?: boolean }) { return db.transaction(async (transaction) => { @@ -2104,30 +2087,19 @@ export async function interruptExpiredBuilderProjectRuns({ return cancelNonterminalRunsForDeletedProjectInTransaction( transaction, project, - occurredAt ?? new Date(), + new Date(), crypto.randomUUID(), ) } - return interruptExpiredRunsInTransaction( - transaction, - projectId, - ownerId, - occurredAt, - ) + return interruptExpiredRunsInTransaction(transaction, projectId, ownerId) }) } export async function interruptExpiredBuilderProjectRunLeases({ occurredAt = new Date(), - limit = 100, }: { occurredAt?: Date - limit?: number } = {}) { - if (!Number.isInteger(limit) || limit < 1 || limit > 1_000) { - throw new Error('Invalid Builder run lease sweep limit') - } - const candidates = await db .select({ projectId: builderProjectRuns.projectId, @@ -2141,7 +2113,7 @@ export async function interruptExpiredBuilderProjectRunLeases({ ), ) .orderBy(asc(builderProjectRuns.leaseExpiresAt)) - .limit(limit) + .limit(100) const projects = new Map() for (const candidate of candidates) { @@ -2821,13 +2793,6 @@ function commandResult( } } -function getLeaseDuration(value = 30_000) { - if (!Number.isSafeInteger(value) || value < 5_000 || value > 300_000) { - throw new Error('Invalid Builder project run lease duration') - } - return value -} - function getBuilderThreadTitle(content: string) { return content.trim().replace(/\s+/g, ' ').slice(0, 160) } @@ -3158,9 +3123,8 @@ export function isMatchingBuilderProjectCreationReplay( async function findProjectCreationByMutation( input: CreateBuilderProjectStateInput, matchRevisionId = true, - database: Pick = db, ) { - const [row] = await database + const [row] = await db .select({ id: builderProjects.id }) .from(builderProjects) .where( @@ -3171,12 +3135,7 @@ async function findProjectCreationByMutation( ) .limit(1) return row - ? requireMatchingBuilderProjectCreation( - input, - row.id, - database, - matchRevisionId, - ) + ? requireMatchingBuilderProjectCreation(input, row.id, db, matchRevisionId) : undefined } diff --git a/src/utils/builder-project-sync.client.ts b/src/utils/builder-project-sync.client.ts index 9676312e9..0bd37ef20 100644 --- a/src/utils/builder-project-sync.client.ts +++ b/src/utils/builder-project-sync.client.ts @@ -476,7 +476,6 @@ function parseBuilderProjectRunEnqueueCommands({ export async function postBuilderProjectSyncCommand( projectId: string, command: BuilderProjectSyncCommand, - signal?: AbortSignal, ) { if (!isUuid(projectId)) throw new Error('Invalid Builder project ID') return requireBuilderProjectSyncCommandResult( @@ -484,7 +483,6 @@ export async function postBuilderProjectSyncCommand( url: `/api/chat/projects/${projectId}/sync`, command, fetchRequest: globalThis.fetch, - ...(signal ? { signal } : {}), }), ) } diff --git a/src/utils/chart.ts b/src/utils/chart.ts index 1a977a3fd..f2c3bc4e2 100644 --- a/src/utils/chart.ts +++ b/src/utils/chart.ts @@ -84,12 +84,11 @@ export function getCurrentBinStart(binType: BinType): Date { export function binTimeSeriesData( data: Array<{ date: string; count: number }>, binType: BinType, - options?: { includeIncomplete?: boolean }, ): Array<{ date: Date; count: number }> { if (data.length === 0) return [] const binFn = getBinFunction(binType) - const includeIncomplete = options?.includeIncomplete ?? true + const includeIncomplete = true const parsed = data.map((d) => ({ date: new Date(d.date), diff --git a/src/utils/discord.server.ts b/src/utils/discord.server.ts index 37473cd7a..6b52b0f08 100644 --- a/src/utils/discord.server.ts +++ b/src/utils/discord.server.ts @@ -21,10 +21,7 @@ type DiscordEmbed = { } type DiscordWebhookPayload = { - content?: string embeds?: Array - username?: string - avatar_url?: string } export async function sendDiscordNotification( diff --git a/src/utils/email.server.ts b/src/utils/email.server.ts index 310ea5042..d2df8c627 100644 --- a/src/utils/email.server.ts +++ b/src/utils/email.server.ts @@ -32,7 +32,6 @@ type ModeratorNotification = { capability: Capability subject: string text: string - html?: string // Extended fields for Discord notifications _showcase?: ShowcaseData _feedback?: FeedbackData diff --git a/src/utils/github-repo.server.ts b/src/utils/github-repo.server.ts index 489c2f414..e3b3f2d3b 100644 --- a/src/utils/github-repo.server.ts +++ b/src/utils/github-repo.server.ts @@ -9,7 +9,6 @@ export interface CreateRepoOptions { name: string description?: string isPrivate?: boolean - autoInit?: boolean } export interface CreateRepoResult { @@ -76,12 +75,8 @@ function isSafeGitHubPath(path: string) { export function validateGitHubFiles( files: Record, - options: GitHubFileBudgetOptions = {}, ): { valid: true } | { valid: false; error: string } { - const budget = { - ...DEFAULT_GITHUB_FILE_BUDGET, - ...options, - } + const budget = DEFAULT_GITHUB_FILE_BUDGET const entries = Object.entries(files) if (entries.length === 0) { @@ -141,7 +136,7 @@ export async function createRepository( name: options.name, description: options.description, private: options.isPrivate ?? false, - auto_init: options.autoInit ?? false, + auto_init: false, }), }) @@ -312,7 +307,6 @@ export interface PushFilesOptions { repo: string files: Record message?: string - branch?: string } /** @@ -343,8 +337,8 @@ export async function pushFiles( repo, files, message = 'Initial commit from TanChat', - branch = 'main', } = options + const branch = 'main' const fileValidation = validateGitHubFiles(files) if (!fileValidation.valid) { diff --git a/src/utils/intent-sync.server.ts b/src/utils/intent-sync.server.ts index f15b5e9fa..9a5ef8451 100644 --- a/src/utils/intent-sync.server.ts +++ b/src/utils/intent-sync.server.ts @@ -140,12 +140,11 @@ export async function selectPendingIntentVersions(options: { export function summarizeIntentProcessResults( results: Array, - options?: { deferred?: number }, ): IntentProcessResult { return { processed: results.filter((result) => result.status === 'synced').length, failed: results.filter((result) => result.status === 'failed').length, - deferred: options?.deferred ?? 0, + deferred: 0, results, } } diff --git a/src/utils/partners.tsx b/src/utils/partners.tsx index 24631cb22..19cdebdf9 100644 --- a/src/utils/partners.tsx +++ b/src/utils/partners.tsx @@ -1781,11 +1781,10 @@ function findApplicationStarterPartnerSuggestion( export function hasApplicationStarterPartnerConflictWithAny( partnerId: string, partnerIds: Array, - partnerSuggestions: Array = applicationStarterPartnerSuggestions, ) { const partner = findApplicationStarterPartnerSuggestion( partnerId, - partnerSuggestions, + applicationStarterPartnerSuggestions, ) if (!partner) { @@ -1799,7 +1798,7 @@ export function hasApplicationStarterPartnerConflictWithAny( const candidate = findApplicationStarterPartnerSuggestion( candidateId, - partnerSuggestions, + applicationStarterPartnerSuggestions, ) return candidate ? hasSharedUniqueConstraint(partner, candidate) : false diff --git a/src/utils/prod-diagnostics.server.ts b/src/utils/prod-diagnostics.server.ts index a3dac98d7..874b6024c 100644 --- a/src/utils/prod-diagnostics.server.ts +++ b/src/utils/prod-diagnostics.server.ts @@ -55,13 +55,8 @@ function getResourceSummary(): Record { return summary } -function getTopHosts( - outboundHosts: HostCounter, - limit = 8, -): Array<[string, number]> { - return [...outboundHosts.entries()] - .sort((a, b) => b[1] - a[1]) - .slice(0, limit) +function getTopHosts(outboundHosts: HostCounter): Array<[string, number]> { + return [...outboundHosts.entries()].sort((a, b) => b[1] - a[1]).slice(0, 8) } function toUrl(input: RequestInfo | URL): URL | null { @@ -276,7 +271,6 @@ export function logRequestEnd( export function logRequestError( context: RequestDiagnostics, error: unknown, - extra?: Record, ): void { if (!isProduction) { return @@ -311,7 +305,6 @@ export function logRequestError( topOutboundHosts: getTopHosts(context.outboundHosts), resourceSummary: getResourceSummary(), ...errorDetails, - ...extra, }) } diff --git a/src/utils/replayable-collection.client.ts b/src/utils/replayable-collection.client.ts index b9d508635..9510fdaf5 100644 --- a/src/utils/replayable-collection.client.ts +++ b/src/utils/replayable-collection.client.ts @@ -43,7 +43,6 @@ export interface ReplayableCollectionOptions< openStream: ( context: ReplayableStreamContext, ) => void | (() => void) - gcTime?: number } export class ReplayableCollectionStoppedError extends Error { @@ -152,7 +151,6 @@ export function createReplayableCollectionOptions< return { id: options.id, getKey: options.getKey, - gcTime: options.gcTime, syncMode: 'eager', startSync: false, utils, diff --git a/src/utils/repository-example.ts b/src/utils/repository-example.ts index 04199fa1b..e07d0b034 100644 --- a/src/utils/repository-example.ts +++ b/src/utils/repository-example.ts @@ -7,7 +7,6 @@ import { export function createRepositoryExampleDefinition({ binaryFiles, - description, entry, files, id, @@ -16,7 +15,6 @@ export function createRepositoryExampleDefinition({ title, }: { binaryFiles?: Record - description?: string entry: string files: Record id: string @@ -37,7 +35,6 @@ export function createRepositoryExampleDefinition({ return { id, title, - ...(description ? { description } : {}), ...(runtime ? { runtime } : {}), initialFile: workspace.files[normalizedInitialFile] === undefined diff --git a/src/utils/showcase.server.ts b/src/utils/showcase.server.ts index 9f1c62e3a..9c0d10f50 100644 --- a/src/utils/showcase.server.ts +++ b/src/utils/showcase.server.ts @@ -1,11 +1,5 @@ import { db, isDatabaseConfigured } from '~/db/client' -import { - showcases, - users, - auditLogs, - type ShowcaseStatus, - type ShowcaseUseCase, -} from '~/db/schema' +import { showcases, users, auditLogs, type ShowcaseUseCase } from '~/db/schema' import { and, eq, @@ -468,24 +462,19 @@ export interface GetMyShowcasesOptions { page?: number pageSize?: number } - status?: ShowcaseStatus } /** * Core: Get user's own showcases */ export async function getMyShowcasesCore(options: GetMyShowcasesOptions) { - const { userId, pagination = {}, status } = options + const { userId, pagination = {} } = options const page = pagination.page ?? 1 const pageSize = pagination.pageSize ?? 20 // Build where conditions const conditions = [eq(showcases.userId, userId)] - if (status) { - conditions.push(eq(showcases.status, status)) - } - const whereClause = and(...conditions) // Get total count diff --git a/src/utils/sponsors.functions.ts b/src/utils/sponsors.functions.ts index b339d108f..ba4328c34 100644 --- a/src/utils/sponsors.functions.ts +++ b/src/utils/sponsors.functions.ts @@ -12,7 +12,6 @@ export type SponsorMeta = { imageUrl?: string linkUrl?: string private?: boolean - amount?: number } export type Sponsor = { @@ -87,16 +86,6 @@ async function getSponsors() { linkUrl: sponsorMeta.linkUrl ?? matchingSponsor.linkUrl, private: sponsorMeta.private ?? matchingSponsor.private, }) - } else if (sponsorMeta.amount) { - sponsors.push({ - login: sponsorMeta.login, - name: sponsorMeta.name || '', - imageUrl: sponsorMeta.imageUrl || '', - linkUrl: sponsorMeta.linkUrl || '', - private: sponsorMeta.private || false, - createdAt: new Date().toISOString(), - amount: sponsorMeta.amount || 0, - }) } }) diff --git a/src/utils/stats.types.ts b/src/utils/stats.types.ts index 76be3eb57..c8e4c1fcc 100644 --- a/src/utils/stats.types.ts +++ b/src/utils/stats.types.ts @@ -25,9 +25,6 @@ export interface NpmPackageStats { export interface NpmStats { totalDownloads: number - packages?: string - // Per-package stats with rate information - packageStats?: Record // Aggregate rate and timestamp for animating the total ratePerDay?: number // Aggregate downloads per day across all packages (growth rate) updatedAt?: number // Most recent update timestamp across all packages (ms since epoch) diff --git a/src/utils/url-boundary.ts b/src/utils/url-boundary.ts index 5ccd24584..c1f6aa5c4 100644 --- a/src/utils/url-boundary.ts +++ b/src/utils/url-boundary.ts @@ -74,14 +74,13 @@ export function normalizePublicHttpUrl(value: string | undefined | null) { export function normalizeSameOriginPath( value: string | undefined | null, baseUrlOrOrigin: string, - maxLength = 2048, ) { if (!value) { return null } const trimmed = value.trim() - if (!trimmed || trimmed.length > maxLength) { + if (!trimmed || trimmed.length > 2048) { return null } @@ -110,10 +109,7 @@ function isStaticAssetPath(pathname: string) { ) } -export function getRoutableInternalLinkTarget( - href: string | undefined | null, - siteOrigin = DEFAULT_SITE_ORIGIN, -) { +export function getRoutableInternalLinkTarget(href: string | undefined | null) { if (!href) { return null } @@ -131,7 +127,7 @@ export function getRoutableInternalLinkTarget( return null } - const baseOrigin = getBaseOrigin(siteOrigin) + const baseOrigin = getBaseOrigin(DEFAULT_SITE_ORIGIN) let url: URL try { diff --git a/src/utils/user-stats.functions.ts b/src/utils/user-stats.functions.ts index 7d84a3d98..c3e1ca612 100644 --- a/src/utils/user-stats.functions.ts +++ b/src/utils/user-stats.functions.ts @@ -9,7 +9,5 @@ export const getUserStats = createServerFn({ method: 'POST' }).handler( ) export const getSignupsChartData = createServerFn({ method: 'POST' }) - .validator( - (data: { days: number | null; bin?: 'day' | 'week' | 'month' }) => data, - ) + .validator((data: { days: number | null }) => data) .handler(async ({ data }) => getSignupsChartDataServer({ data })) diff --git a/src/utils/workflow-runtime.server.ts b/src/utils/workflow-runtime.server.ts index a5482e3ba..6cedd6ff0 100644 --- a/src/utils/workflow-runtime.server.ts +++ b/src/utils/workflow-runtime.server.ts @@ -65,12 +65,9 @@ export interface WorkflowRuntimeReconcileResult { unregisteredSchedules: Array } -export async function getWorkflowRuntimeHealth(options?: { - now?: number - staleRunMs?: number -}): Promise { - const now = options?.now ?? Date.now() - const staleRunMs = options?.staleRunMs ?? DEFAULT_STALE_RUN_MS +export async function getWorkflowRuntimeHealth(): Promise { + const now = Date.now() + const staleRunMs = DEFAULT_STALE_RUN_MS const [ staleRuns, unregisteredSchedules, @@ -96,12 +93,9 @@ export async function getWorkflowRuntimeHealth(options?: { } } -export async function reconcileWorkflowRuntimeStore(options?: { - now?: number - staleRunMs?: number -}): Promise { - const now = options?.now ?? Date.now() - const staleRunMs = options?.staleRunMs ?? DEFAULT_STALE_RUN_MS +export async function reconcileWorkflowRuntimeStore(): Promise { + const now = Date.now() + const staleRunMs = DEFAULT_STALE_RUN_MS const [staleRuns, unregisteredSchedules] = await Promise.all([ listStaleWorkflowRuns({ now, staleRunMs }), listUnregisteredWorkflowSchedules(), diff --git a/tests/builder-project-sync.test.ts b/tests/builder-project-sync.test.ts index f08ce56f8..bd617fb7a 100644 --- a/tests/builder-project-sync.test.ts +++ b/tests/builder-project-sync.test.ts @@ -806,8 +806,8 @@ test('streams gap-free events, heartbeats, and then reconnects', async () => { true, ) assert.match(body, /retry: 500/) - assert.match(body, /id: 1/) - assert.match(body, /id: 2/) + assert.match(body, /^id: 1\r?$/m) + assert.match(body, /^id: 2\r?$/m) assert.match(body, /: heartbeat/) assert.equal(expiredRunChecks, 3) }) @@ -823,7 +823,7 @@ test('stops a replay before emitting an event across a sequence gap', async () = listEvents: async () => [createEvent(2)], }) const body = await response.text() - assert.doesNotMatch(body, /id: 2/) + assert.doesNotMatch(body, /^id: 2\r?$/m) } finally { console.error = originalConsoleError } @@ -838,9 +838,9 @@ test('bounds events buffered by one stream response', async () => { listEvents: async () => [createEvent(1), createEvent(2), createEvent(3)], }) const body = await response.text() - assert.match(body, /id: 1/) - assert.match(body, /id: 2/) - assert.doesNotMatch(body, /id: 3/) + assert.match(body, /^id: 1\r?$/m) + assert.match(body, /^id: 2\r?$/m) + assert.doesNotMatch(body, /^id: 3\r?$/m) }) function createEvent(sequence: number): BuilderProjectSyncEvent { diff --git a/tests/panel.test.ts b/tests/panel.test.ts index d8884f431..41ae40264 100644 --- a/tests/panel.test.ts +++ b/tests/panel.test.ts @@ -9,28 +9,6 @@ function createContent(children: React.ReactNode) { return React.createElement(PanelContent, props) } -test('panel supports horizontal disclosure', () => { - const openProps: React.ComponentProps = { - open: true, - orientation: 'horizontal', - children: createContent('Side panel'), - } - const closedProps: React.ComponentProps = { - open: false, - orientation: 'horizontal', - children: createContent('Side panel'), - } - const openMarkup = renderToStaticMarkup(React.createElement(Panel, openProps)) - const closedMarkup = renderToStaticMarkup( - React.createElement(Panel, closedProps), - ) - - assert.match(openMarkup, /data-orientation="horizontal"/) - assert.match(openMarkup, /grid-cols-\[1fr\]/) - assert.match(closedMarkup, /grid-cols-\[0fr\]/) - assert.match(closedMarkup, /aria-hidden="true"/) -}) - test('panel remains vertical by default', () => { const props: React.ComponentProps = { open: true, @@ -38,6 +16,5 @@ test('panel remains vertical by default', () => { } const markup = renderToStaticMarkup(React.createElement(Panel, props)) - assert.match(markup, /data-orientation="vertical"/) assert.match(markup, /grid-rows-\[1fr\]/) })