From 9741f440eb2bf183488a80eda8f60cf5c2e5d55a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 2 Sep 2025 01:42:31 -0500 Subject: [PATCH] Switch to nodenext, add file extensions to all imports --- package-lock.json | 16 ++++---- package.json | 3 +- src/App.test.tsx | 2 +- src/App.tsx | 14 +++---- src/AppRouter.tsx | 8 ++-- src/components/AppProvider.tsx | 8 ++-- src/components/EditProfileForm.tsx | 42 ++++++++++----------- src/components/NostrProvider.tsx | 2 +- src/components/NoteContent.test.tsx | 10 ++--- src/components/NoteContent.tsx | 6 +-- src/components/RelaySelector.tsx | 32 ++++++++-------- src/components/WalletModal.tsx | 26 ++++++------- src/components/ZapButton.tsx | 10 ++--- src/components/ZapDialog.tsx | 32 ++++++++-------- src/components/auth/AccountSwitcher.tsx | 12 +++--- src/components/auth/LoginArea.tsx | 12 +++--- src/components/auth/LoginDialog.tsx | 14 +++---- src/components/auth/SignupDialog.tsx | 20 +++++----- src/components/comments/Comment.tsx | 20 +++++----- src/components/comments/CommentForm.tsx | 12 +++--- src/components/comments/CommentsSection.tsx | 12 +++--- src/components/ui/accordion.tsx | 2 +- src/components/ui/alert-dialog.tsx | 4 +- src/components/ui/alert.tsx | 2 +- src/components/ui/avatar.tsx | 2 +- src/components/ui/badge.tsx | 4 +- src/components/ui/breadcrumb.tsx | 2 +- src/components/ui/button.tsx | 4 +- src/components/ui/calendar.tsx | 4 +- src/components/ui/card.tsx | 2 +- src/components/ui/carousel.tsx | 4 +- src/components/ui/chart.tsx | 2 +- src/components/ui/checkbox.tsx | 2 +- src/components/ui/command.tsx | 4 +- src/components/ui/context-menu.tsx | 2 +- src/components/ui/dialog.tsx | 2 +- src/components/ui/drawer.tsx | 2 +- src/components/ui/dropdown-menu.tsx | 2 +- src/components/ui/form.tsx | 6 +-- src/components/ui/hover-card.tsx | 2 +- src/components/ui/input-otp.tsx | 2 +- src/components/ui/input.tsx | 2 +- src/components/ui/label.tsx | 2 +- src/components/ui/menubar.tsx | 2 +- src/components/ui/navigation-menu.tsx | 4 +- src/components/ui/pagination.tsx | 12 +++--- src/components/ui/popover.tsx | 2 +- src/components/ui/progress.tsx | 2 +- src/components/ui/radio-group.tsx | 2 +- src/components/ui/resizable.tsx | 2 +- src/components/ui/scroll-area.tsx | 2 +- src/components/ui/select.tsx | 2 +- src/components/ui/separator.tsx | 2 +- src/components/ui/sheet.tsx | 2 +- src/components/ui/sidebar.tsx | 18 ++++----- src/components/ui/skeleton.tsx | 2 +- src/components/ui/slider.tsx | 2 +- src/components/ui/switch.tsx | 2 +- src/components/ui/table.tsx | 2 +- src/components/ui/tabs.tsx | 2 +- src/components/ui/textarea.tsx | 2 +- src/components/ui/toast.tsx | 2 +- src/components/ui/toaster.tsx | 4 +- src/components/ui/toggle-group.tsx | 7 ++-- src/components/ui/toggle.tsx | 4 +- src/components/ui/tooltip.tsx | 2 +- src/contexts/NWCContext.tsx | 4 +- src/hooks/useAppContext.ts | 2 +- src/hooks/useCurrentUser.ts | 2 +- src/hooks/useNWC.ts | 4 +- src/hooks/useNWCContext.ts | 2 +- src/hooks/useNostrPublish.ts | 2 +- src/hooks/usePostComment.ts | 2 +- src/hooks/useTheme.ts | 4 +- src/hooks/useToast.ts | 2 +- src/hooks/useUploadFile.ts | 2 +- src/hooks/useWallet.ts | 2 +- src/hooks/useZaps.ts | 14 +++---- src/lib/genUserName.test.ts | 2 +- src/main.tsx | 8 ++-- src/pages/NIP19Page.tsx | 2 +- src/test/ErrorBoundary.test.tsx | 2 +- src/test/TestApp.tsx | 8 ++-- tsconfig.app.json | 9 ++--- 84 files changed, 266 insertions(+), 263 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1ed38a2..05cbcde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "dependencies": { "@fontsource-variable/inter": "^5.2.6", - "@getalby/sdk": "^5.1.1", + "@getalby/sdk": "^6.0.0", "@hookform/resolvers": "^3.9.0", "@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.46.4", "@nostrify/react": "npm:@jsr/nostrify__react@^0.2.8", @@ -953,9 +953,9 @@ } }, "node_modules/@getalby/lightning-tools": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@getalby/lightning-tools/-/lightning-tools-5.2.0.tgz", - "integrity": "sha512-8kBvENBTMh541VjGKhw3I29+549/C02gLSh3AQaMfoMNSZaMxfQW+7dcMcc7vbFaCKEcEe18ST5bUveTRBuXCQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@getalby/lightning-tools/-/lightning-tools-5.2.1.tgz", + "integrity": "sha512-dxOmJLJAh6qJ8rsbA5/Bwj7MSI9X3RkxxqmCedl5rfP+yKwNSdfu8i4EiCZN/tk2hNBJb8GHSCcPRNZfwfmEHg==", "license": "MIT", "engines": { "node": ">=14" @@ -966,12 +966,12 @@ } }, "node_modules/@getalby/sdk": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/@getalby/sdk/-/sdk-5.1.1.tgz", - "integrity": "sha512-t/kg2ljPx86qRYKqEVc5VYhDICFKtVPRlQKIz5cI/AqOLYVguLJz1AkQlDBaiOz2PW5FxoyGlLkTGmX7ONHH/Q==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@getalby/sdk/-/sdk-6.0.0.tgz", + "integrity": "sha512-ix2ZFcYwxBy3r4o11C1jC4Hwlu2s8C9pz7Y/NWYw8sSEutioPjG2e0k5Nx1nTs6luQ2LKUBFg9/6f1akZiwYcw==", "license": "MIT", "dependencies": { - "@getalby/lightning-tools": "^5.1.2", + "@getalby/lightning-tools": "^5.2.0", "nostr-tools": "2.15.0" }, "engines": { diff --git a/package.json b/package.json index d6adff7..0efa3cc 100644 --- a/package.json +++ b/package.json @@ -7,11 +7,12 @@ "dev": "npm i && vite", "build": "npm i && vite build && cp dist/index.html dist/404.html", "test": "npm i && tsc -p tsconfig.app.json --noEmit && eslint && vitest run && vite build", + "check": "tsc -p tsconfig.app.json --noEmit", "deploy": "npm run build && npx -y nostr-deploy-cli deploy --skip-setup" }, "dependencies": { "@fontsource-variable/inter": "^5.2.6", - "@getalby/sdk": "^5.1.1", + "@getalby/sdk": "^6.0.0", "@hookform/resolvers": "^3.9.0", "@nostrify/nostrify": "npm:@jsr/nostrify__nostrify@^0.46.4", "@nostrify/react": "npm:@jsr/nostrify__react@^0.2.8", diff --git a/src/App.test.tsx b/src/App.test.tsx index bedec00..616c8e4 100644 --- a/src/App.test.tsx +++ b/src/App.test.tsx @@ -1,7 +1,7 @@ import { render } from '@testing-library/react'; import { test } from 'vitest'; -import App from './App'; +import App from "./App.jsx"; test('App', () => { render(); diff --git a/src/App.tsx b/src/App.tsx index eb5704c..0fb7174 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,14 +5,14 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; import { createHead, UnheadProvider } from '@unhead/react/client'; import { InferSeoMetaPlugin } from '@unhead/addons'; import { Suspense } from 'react'; -import NostrProvider from '@/components/NostrProvider'; -import { Toaster } from "@/components/ui/toaster"; -import { TooltipProvider } from "@/components/ui/tooltip"; +import NostrProvider from '@/components/NostrProvider.jsx'; +import { Toaster } from "@/components/ui/toaster.jsx"; +import { TooltipProvider } from "@/components/ui/tooltip.jsx"; import { NostrLoginProvider } from '@nostrify/react/login'; -import { AppProvider } from '@/components/AppProvider'; -import { NWCProvider } from '@/contexts/NWCContext'; -import { AppConfig } from '@/contexts/AppContext'; -import AppRouter from './AppRouter'; +import { AppProvider } from '@/components/AppProvider.jsx'; +import { NWCProvider } from '@/contexts/NWCContext.jsx'; +import { AppConfig } from '@/contexts/AppContext.jsx'; +import AppRouter from "./AppRouter.jsx"; const head = createHead({ plugins: [ diff --git a/src/AppRouter.tsx b/src/AppRouter.tsx index 2db53ee..a283cca 100644 --- a/src/AppRouter.tsx +++ b/src/AppRouter.tsx @@ -1,9 +1,9 @@ import { BrowserRouter, Route, Routes } from "react-router-dom"; -import { ScrollToTop } from "./components/ScrollToTop"; +import { ScrollToTop } from "./components/ScrollToTop.jsx"; -import Index from "./pages/Index"; -import { NIP19Page } from "./pages/NIP19Page"; -import NotFound from "./pages/NotFound"; +import Index from "./pages/Index.jsx"; +import { NIP19Page } from "./pages/NIP19Page.jsx"; +import NotFound from "./pages/NotFound.jsx"; export function AppRouter() { return ( diff --git a/src/components/AppProvider.tsx b/src/components/AppProvider.tsx index 79c9e69..fdc4ac8 100644 --- a/src/components/AppProvider.tsx +++ b/src/components/AppProvider.tsx @@ -1,7 +1,7 @@ import { ReactNode, useEffect } from 'react'; import { z } from 'zod'; -import { useLocalStorage } from '@/hooks/useLocalStorage'; -import { AppContext, type AppConfig, type AppContextType, type Theme } from '@/contexts/AppContext'; +import { useLocalStorage } from '@/hooks/useLocalStorage.js'; +import { AppContext, type AppConfig, type AppContextType, type Theme } from '@/contexts/AppContext.jsx'; interface AppProviderProps { children: ReactNode; @@ -88,11 +88,11 @@ function useApplyTheme(theme: Theme) { if (theme !== 'system') return; const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)'); - + const handleChange = () => { const root = window.document.documentElement; root.classList.remove('light', 'dark'); - + const systemTheme = mediaQuery.matches ? 'dark' : 'light'; root.classList.add(systemTheme); }; diff --git a/src/components/EditProfileForm.tsx b/src/components/EditProfileForm.tsx index 1219ae9..2e656cf 100644 --- a/src/components/EditProfileForm.tsx +++ b/src/components/EditProfileForm.tsx @@ -1,10 +1,10 @@ import React, { useEffect, useRef } from 'react'; import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; -import { useCurrentUser } from '@/hooks/useCurrentUser'; -import { useNostrPublish } from '@/hooks/useNostrPublish'; -import { useToast } from '@/hooks/useToast'; -import { Button } from '@/components/ui/button'; +import { useCurrentUser } from '@/hooks/useCurrentUser.js'; +import { useNostrPublish } from '@/hooks/useNostrPublish.js'; +import { useToast } from '@/hooks/useToast.js'; +import { Button } from '@/components/ui/button.jsx'; import { Form, FormControl, @@ -13,14 +13,14 @@ import { FormItem, FormLabel, FormMessage, -} from '@/components/ui/form'; -import { Input } from '@/components/ui/input'; -import { Textarea } from '@/components/ui/textarea'; -import { Switch } from '@/components/ui/switch'; +} from '@/components/ui/form.jsx'; +import { Input } from '@/components/ui/input.jsx'; +import { Textarea } from '@/components/ui/textarea.jsx'; +import { Switch } from '@/components/ui/switch.jsx'; import { Loader2, Upload } from 'lucide-react'; import { NSchema as n, type NostrMetadata } from '@nostrify/nostrify'; import { useQueryClient } from '@tanstack/react-query'; -import { useUploadFile } from '@/hooks/useUploadFile'; +import { useUploadFile } from '@/hooks/useUploadFile.js'; export const EditProfileForm: React.FC = () => { const queryClient = useQueryClient(); @@ -151,10 +151,10 @@ export const EditProfileForm: React.FC = () => { Bio -