From 5bbab87b1e23a57060b9a16fc46cc5ba0996f72d Mon Sep 17 00:00:00 2001 From: mmattbtw Date: Sun, 11 May 2025 23:09:20 -0500 Subject: [PATCH 1/3] prettier config --- package.json | 4 ++- pnpm-lock.yaml | 87 +++++++++++++++++++++++++++++++++++++++++++++ prettier.config.cjs | 38 ++++++++++++++++++++ 3 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 prettier.config.cjs diff --git a/package.json b/package.json index afbbcbc..d22831f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,9 @@ "lex:gen-server": "turbo lex:gen-server" }, "dependencies": { - "@atproto/oauth-client": "^0.3.8" + "@atproto/oauth-client": "^0.3.8", + "@ianvs/prettier-plugin-sort-imports": "^4.4.1", + "prettier-plugin-tailwindcss": "^0.6.11" }, "devDependencies": { "@types/node": "^20.17.10", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2d1f4ba..db01e78 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,12 @@ importers: '@atproto/oauth-client': specifier: ^0.3.8 version: 0.3.8 + '@ianvs/prettier-plugin-sort-imports': + specifier: ^4.4.1 + version: 4.4.1(prettier@3.4.2) + prettier-plugin-tailwindcss: + specifier: ^0.6.11 + version: 0.6.11(@ianvs/prettier-plugin-sort-imports@4.4.1(prettier@3.4.2))(prettier@3.4.2) devDependencies: '@types/node': specifier: ^20.17.10 @@ -1860,6 +1866,15 @@ packages: resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} deprecated: Use @eslint/object-schema instead + '@ianvs/prettier-plugin-sort-imports@4.4.1': + resolution: {integrity: sha512-F0/Hrcfpy8WuxlQyAWJTEren/uxKhYonOGY4OyWmwRdeTvkh9mMSCxowZLjNkhwi/2ipqCgtXwwOk7tW0mWXkA==} + peerDependencies: + '@vue/compiler-sfc': 2.7.x || 3.x + prettier: 2 || 3 + peerDependenciesMeta: + '@vue/compiler-sfc': + optional: true + '@ipld/car@3.2.4': resolution: {integrity: sha512-rezKd+jk8AsTGOoJKqzfjLJ3WVft7NZNH95f0pfPbicROvzTyvHCNy567HzSUd6gRXZ9im29z5ZEv9Hw49jSYw==} @@ -5773,6 +5788,61 @@ packages: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} + prettier-plugin-tailwindcss@0.6.11: + resolution: {integrity: sha512-YxaYSIvZPAqhrrEpRtonnrXdghZg1irNg4qrjboCXrpybLWVs55cW2N3juhspVJiO0JBvYJT8SYsJpc8OQSnsA==} + engines: {node: '>=14.21.3'} + peerDependencies: + '@ianvs/prettier-plugin-sort-imports': '*' + '@prettier/plugin-pug': '*' + '@shopify/prettier-plugin-liquid': '*' + '@trivago/prettier-plugin-sort-imports': '*' + '@zackad/prettier-plugin-twig': '*' + prettier: ^3.0 + prettier-plugin-astro: '*' + prettier-plugin-css-order: '*' + prettier-plugin-import-sort: '*' + prettier-plugin-jsdoc: '*' + prettier-plugin-marko: '*' + prettier-plugin-multiline-arrays: '*' + prettier-plugin-organize-attributes: '*' + prettier-plugin-organize-imports: '*' + prettier-plugin-sort-imports: '*' + prettier-plugin-style-order: '*' + prettier-plugin-svelte: '*' + peerDependenciesMeta: + '@ianvs/prettier-plugin-sort-imports': + optional: true + '@prettier/plugin-pug': + optional: true + '@shopify/prettier-plugin-liquid': + optional: true + '@trivago/prettier-plugin-sort-imports': + optional: true + '@zackad/prettier-plugin-twig': + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-css-order: + optional: true + prettier-plugin-import-sort: + optional: true + prettier-plugin-jsdoc: + optional: true + prettier-plugin-marko: + optional: true + prettier-plugin-multiline-arrays: + optional: true + prettier-plugin-organize-attributes: + optional: true + prettier-plugin-organize-imports: + optional: true + prettier-plugin-sort-imports: + optional: true + prettier-plugin-style-order: + optional: true + prettier-plugin-svelte: + optional: true + prettier@3.4.2: resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} engines: {node: '>=14'} @@ -8998,6 +9068,17 @@ snapshots: '@humanwhocodes/object-schema@2.0.3': {} + '@ianvs/prettier-plugin-sort-imports@4.4.1(prettier@3.4.2)': + dependencies: + '@babel/generator': 7.26.3 + '@babel/parser': 7.26.3 + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 + prettier: 3.4.2 + semver: 7.6.3 + transitivePeerDependencies: + - supports-color + '@ipld/car@3.2.4': dependencies: '@ipld/dag-cbor': 7.0.3 @@ -13557,6 +13638,12 @@ snapshots: prelude-ls@1.2.1: {} + prettier-plugin-tailwindcss@0.6.11(@ianvs/prettier-plugin-sort-imports@4.4.1(prettier@3.4.2))(prettier@3.4.2): + dependencies: + prettier: 3.4.2 + optionalDependencies: + '@ianvs/prettier-plugin-sort-imports': 4.4.1(prettier@3.4.2) + prettier@3.4.2: {} pretty-bytes@5.6.0: {} diff --git a/prettier.config.cjs b/prettier.config.cjs new file mode 100644 index 0000000..c9c91e5 --- /dev/null +++ b/prettier.config.cjs @@ -0,0 +1,38 @@ +/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig*/ +/** @typedef {import("prettier").Config} PrettierConfig*/ +/** @typedef {{ tailwindConfig: string }} TailwindConfig*/ + +/** @type { PrettierConfig | SortImportsConfig | TailwindConfig } */ +const config = { + arrowParens: "always", + printWidth: 80, + singleQuote: false, + jsxSingleQuote: false, + semi: true, + trailingComma: "all", + tabWidth: 2, + // pluginSearchDirs: false, + plugins: [ + "@ianvs/prettier-plugin-sort-imports", + "prettier-plugin-tailwindcss", + ], + tailwindConfig: "./apps/amethyst/tailwind.config.js", + importOrder: [ + "^(react/(.*)$)|^(react$)|^(react-native(.*)$)", + "^(next/(.*)$)|^(next$)", + "^(expo(.*)$)|^(expo$)", + "", + "", + "^@teal/(.*)$", + "", + "^~/utils/(.*)$", + "^~/components/(.*)$", + "^~/styles/(.*)$", + "^~/(.*)$", + "^[./]", + ], + importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"], + importOrderTypeScriptVersion: "5.0.4", +}; + +module.exports = config; -- 2.51.2 From db5b57f1b716a6296dab8b7fc6a70b5ce0b2f679 Mon Sep 17 00:00:00 2001 From: mmattbtw Date: Sun, 11 May 2025 23:10:51 -0500 Subject: [PATCH 2/3] Rebase --- .vscode/settings.json | 6 +- CONTRIBUTING.md | 17 +- README.md | 2 + apps/amethyst/.eslintrc.js | 13 +- apps/amethyst/app/(tabs)/(stamp)/_layout.tsx | 2 +- .../app/(tabs)/(stamp)/stamp/_layout.tsx | 4 +- .../app/(tabs)/(stamp)/stamp/index.tsx | 64 +- .../app/(tabs)/(stamp)/stamp/submit.tsx | 33 +- .../app/(tabs)/(stamp)/stamp/success.tsx | 17 +- apps/amethyst/app/(tabs)/_layout.tsx | 3 +- apps/amethyst/app/(tabs)/index.tsx | 42 +- apps/amethyst/app/(tabs)/profile/[handle].tsx | 2 +- apps/amethyst/app/(tabs)/search/index.tsx | 50 +- apps/amethyst/app/(tabs)/settings/index.tsx | 9 +- apps/amethyst/app/+html.tsx | 7 +- apps/amethyst/app/+not-found.tsx | 2 +- apps/amethyst/app/_layout.tsx | 13 +- apps/amethyst/app/auth/callback.tsx | 14 +- apps/amethyst/app/auth/login.tsx | 6 +- apps/amethyst/app/auth/logoutModal.tsx | 18 +- apps/amethyst/app/auth/options.tsx | 16 +- apps/amethyst/app/auth/signup.tsx | 51 +- apps/amethyst/app/error.tsx | 17 +- .../app/onboarding/descriptionPage.tsx | 34 +- .../app/onboarding/displayNamePage.tsx | 28 +- .../app/onboarding/imageSelectionPage.tsx | 38 +- apps/amethyst/app/onboarding/index.tsx | 90 +- apps/amethyst/components.json | 2 +- apps/amethyst/components/ExternalLink.tsx | 4 +- .../components/__tests__/StyledText-test.js | 6 +- apps/amethyst/components/actor/actorView.tsx | 112 +- .../components/actor/editProfileView.tsx | 81 +- .../components/onboarding/progressDots.tsx | 14 +- apps/amethyst/components/play/playView.tsx | 10 +- .../components/play/verticalPlayView.tsx | 6 +- apps/amethyst/components/toggleTheme.tsx | 2 +- apps/amethyst/components/ui/ago.tsx | 18 +- apps/amethyst/components/ui/avatar.tsx | 3 +- apps/amethyst/components/ui/button.tsx | 3 +- apps/amethyst/components/ui/card.tsx | 7 +- apps/amethyst/components/ui/hover-card.tsx | 27 +- apps/amethyst/components/ui/input.tsx | 5 +- apps/amethyst/components/ui/progress.tsx | 5 +- apps/amethyst/components/ui/sheetBackdrop.tsx | 8 +- apps/amethyst/components/ui/text.tsx | 5 +- apps/amethyst/components/ui/tooltip.tsx | 23 +- .../components/useClientOnlyValue.web.ts | 2 +- apps/amethyst/constants/Colors.ts | 16 +- .../AppIcon.appiconset/Contents.json | 2 +- .../amethyst/Images.xcassets/Contents.json | 6 +- .../Contents.json | 2 +- .../SplashScreenLogo.imageset/Contents.json | 2 +- apps/amethyst/lib/atp/getImageCdnLink.tsx | 6 +- apps/amethyst/lib/atp/oauth.tsx | 4 +- apps/amethyst/lib/icons/CalendarDays.tsx | 1 + apps/amethyst/lib/icons/Info.tsx | 1 + apps/amethyst/lib/icons/Moon.tsx | 1 + apps/amethyst/lib/icons/Sun.tsx | 1 + apps/amethyst/lib/icons/iconWithClassName.tsx | 10 +- apps/amethyst/lib/oldStamp.tsx | 1 - apps/amethyst/nativewind-env.d.ts | 2 +- apps/amethyst/readme.md | 1 + apps/amethyst/stores/authenticationSlice.tsx | 80 +- apps/amethyst/stores/mainStore.tsx | 15 +- apps/amethyst/stores/preferenceSlice.tsx | 10 +- apps/amethyst/stores/tempSlice.tsx | 17 +- apps/amethyst/tailwind.config.js | 6 +- apps/aqua/public/latex.css | 96 +- apps/aqua/src/index.ts | 41 +- apps/aqua/src/lib/env.ts | 22 +- apps/aqua/src/xrpc/actor/getProfile.ts | 13 +- apps/aqua/src/xrpc/actor/searchActors.ts | 25 +- apps/aqua/src/xrpc/feed/getPlay.ts | 5 +- compose.yaml | 2 +- package.json | 4 +- packages/db/.drizzle/meta/0000_snapshot.json | 39 +- packages/db/.drizzle/meta/0001_snapshot.json | 39 +- packages/db/.drizzle/meta/0002_snapshot.json | 39 +- packages/db/.drizzle/meta/0003_snapshot.json | 39 +- packages/db/.drizzle/meta/0004_snapshot.json | 39 +- packages/db/.drizzle/meta/0005_snapshot.json | 39 +- packages/db/.drizzle/meta/_journal.json | 2 +- packages/db/connect.ts | 5 +- packages/db/schema.ts | 14 +- packages/lexicons/src/index.ts | 169 +- packages/lexicons/src/lexicons.ts | 530 +-- .../src/types/app/bsky/actor/profile.ts | 39 +- .../src/types/app/bsky/richtext/facet.ts | 73 +- .../src/types/fm/teal/alpha/actor/defs.ts | 57 +- .../types/fm/teal/alpha/actor/getProfile.ts | 53 +- .../types/fm/teal/alpha/actor/getProfiles.ts | 53 +- .../src/types/fm/teal/alpha/actor/profile.ts | 51 +- .../types/fm/teal/alpha/actor/searchActors.ts | 59 +- .../src/types/fm/teal/alpha/actor/status.ts | 21 +- .../src/types/fm/teal/alpha/feed/defs.ts | 39 +- .../types/fm/teal/alpha/feed/getActorFeed.ts | 57 +- .../src/types/fm/teal/alpha/feed/getPlay.ts | 55 +- .../src/types/fm/teal/alpha/feed/play.ts | 32 +- .../src/types/xyz/statusphere/status.ts | 25 +- packages/lexicons/src/util.ts | 4 +- pnpm-lock.yaml | 3196 ++++++++--------- pnpm-workspace.yaml | 4 +- 102 files changed, 2912 insertions(+), 3193 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 9479744..974a2b4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ -{ - "deno.enable": false -} +{ + "deno.enable": false +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 93f2071..3b65895 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,14 +1,15 @@ # Contributing -Hi, thanks for showing interest in our project, we appreciate you wanting to be +Hi, thanks for showing interest in our project, we appreciate you wanting to be a part of it! > ###### Do you accept external contributions? -> Yes, we welcome external contributions! The only request we have is that you -> check with us before working on a large feature, as we'd prefer to avoid duplicating effort. > -> You can do this by either creating an issue that we can communicate through, or -> popping into the Discord channel and asking in the #development channel. +> Yes, we welcome external contributions! The only request we have is that you +> check with us before working on a large feature, as we'd prefer to avoid duplicating effort. +> +> You can do this by either creating an issue that we can communicate through, or +> popping into the Discord channel and asking in the #development channel. > Whatever works best for you! > > Other than that, feel free to contribute however you'd like! @@ -38,9 +39,9 @@ If you only want to start one service run: turbo dev --filter= ``` -Open http://localhost:3000/ with your browser to see the home page. You will need -to login with Bluesky to test the posting functionality of the app. Note: if the -redirect back to the app after you login isn't working correctly, you may need to +Open http://localhost:3000/ with your browser to see the home page. You will need +to login with Bluesky to test the posting functionality of the app. Note: if the +redirect back to the app after you login isn't working correctly, you may need to replace the `127.0.0.1` with `localhost`. Push to your fork and [submit a pull request][pr]. diff --git a/README.md b/README.md index 015fa7f..c01899e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ## Getting Started ### Prerequisites + - Node (>= v21.0.0) - Go - Bun @@ -12,6 +13,7 @@ To get started with this template, simply paste this command into your terminal: pnpm install && pnpm install -g turbo && cp apps/aqua/.env.example apps/aqua/.env && pnpm run db:migrate ``` + Running on a Mac may also require adding @libsql/darwin-x64 dependency ## Development diff --git a/apps/amethyst/.eslintrc.js b/apps/amethyst/.eslintrc.js index f3b510d..9793e31 100644 --- a/apps/amethyst/.eslintrc.js +++ b/apps/amethyst/.eslintrc.js @@ -1,9 +1,8 @@ // https://docs.expo.dev/guides/using-eslint/ module.exports = { - extends: 'expo', - plugins: ['eslint-plugin-react-compiler'], - rules: { - 'react-compiler/react-compiler': 'error', - }, - }; - \ No newline at end of file + extends: "expo", + plugins: ["eslint-plugin-react-compiler"], + rules: { + "react-compiler/react-compiler": "error", + }, +}; diff --git a/apps/amethyst/app/(tabs)/(stamp)/_layout.tsx b/apps/amethyst/app/(tabs)/(stamp)/_layout.tsx index 7c4c5bd..9cef2b3 100644 --- a/apps/amethyst/app/(tabs)/(stamp)/_layout.tsx +++ b/apps/amethyst/app/(tabs)/(stamp)/_layout.tsx @@ -1,5 +1,5 @@ -import { Stack } from "expo-router"; import { useMemo } from "react"; +import { Stack } from "expo-router"; const Layout = ({ segment }: { segment: string }) => { const rootScreen = useMemo(() => { diff --git a/apps/amethyst/app/(tabs)/(stamp)/stamp/_layout.tsx b/apps/amethyst/app/(tabs)/(stamp)/stamp/_layout.tsx index 35f650e..03450a1 100644 --- a/apps/amethyst/app/(tabs)/(stamp)/stamp/_layout.tsx +++ b/apps/amethyst/app/(tabs)/(stamp)/stamp/_layout.tsx @@ -1,6 +1,6 @@ -import { MusicBrainzRecording, PlaySubmittedData } from "@/lib/oldStamp"; -import { Slot, Stack } from "expo-router"; import { createContext, useState } from "react"; +import { Slot, Stack } from "expo-router"; +import { MusicBrainzRecording, PlaySubmittedData } from "@/lib/oldStamp"; export enum StampStep { IDLE = "IDLE", diff --git a/apps/amethyst/app/(tabs)/(stamp)/stamp/index.tsx b/apps/amethyst/app/(tabs)/(stamp)/stamp/index.tsx index 08746d3..44894c4 100644 --- a/apps/amethyst/app/(tabs)/(stamp)/stamp/index.tsx +++ b/apps/amethyst/app/(tabs)/(stamp)/stamp/index.tsx @@ -1,8 +1,3 @@ -import { Button } from "@/components/ui/button"; -import { Icon } from "@/lib/icons/iconWithClassName"; -import { Link, Stack, useRouter } from "expo-router"; -import { Check, ChevronDown, ChevronRight } from "lucide-react-native"; - import React, { useContext, useEffect, useRef, useState } from "react"; import { FlatList, @@ -11,8 +6,13 @@ import { TouchableOpacity, View, } from "react-native"; - +import { Link, Stack, useRouter } from "expo-router"; +import { ExternalLink } from "@/components/ExternalLink"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import SheetBackdrop, { SheetHandle } from "@/components/ui/sheetBackdrop"; import { Text } from "@/components/ui/text"; +import { Icon } from "@/lib/icons/iconWithClassName"; import { MusicBrainzRecording, MusicBrainzRelease, @@ -22,11 +22,9 @@ import { SearchResultProps, } from "@/lib/oldStamp"; import { BottomSheetModal, BottomSheetScrollView } from "@gorhom/bottom-sheet"; -import SheetBackdrop, { SheetHandle } from "@/components/ui/sheetBackdrop"; -import { StampContext, StampContextValue, StampStep } from "./_layout"; -import { ExternalLink } from "@/components/ExternalLink"; +import { Check, ChevronDown, ChevronRight } from "lucide-react-native"; -import { Input } from "@/components/ui/input"; +import { StampContext, StampContextValue, StampStep } from "./_layout"; export default function StepOne() { const router = useRouter(); @@ -80,7 +78,7 @@ export default function StepOne() { }; return ( - + {/* Search Results */} - + {searchResults.length > 0 ? ( - + Search Results ({searchResults.length}) @@ -175,10 +173,10 @@ export default function StepOne() { ) : ( hasSearched && ( - + No search results found. - + Please try importing with{" "} + diff --git a/apps/amethyst/app/error.tsx b/apps/amethyst/app/error.tsx index d7c686e..f37f4b3 100644 --- a/apps/amethyst/app/error.tsx +++ b/apps/amethyst/app/error.tsx @@ -1,11 +1,12 @@ import React from "react"; -import { View, TouchableOpacity } from "react-native"; +import { TouchableOpacity, View } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; -import { Text } from "../components/ui/text"; +import { router, Stack } from "expo-router"; +import { AlertCircle, Home } from "lucide-react-native"; + import { Button } from "../components/ui/button"; +import { Text } from "../components/ui/text"; import { Icon } from "../lib/icons/iconWithClassName"; -import { Home, AlertCircle } from "lucide-react-native"; -import { Stack, router } from "expo-router"; const ErrorScreen = () => { return ( @@ -17,20 +18,20 @@ const ErrorScreen = () => { headerShown: false, }} /> - + - + Oops! Something went wrong We couldn't complete your request. Please try again later. - + diff --git a/apps/amethyst/app/onboarding/descriptionPage.tsx b/apps/amethyst/app/onboarding/descriptionPage.tsx index 88ce186..1b5649b 100644 --- a/apps/amethyst/app/onboarding/descriptionPage.tsx +++ b/apps/amethyst/app/onboarding/descriptionPage.tsx @@ -1,10 +1,10 @@ -import React, { useState } from 'react'; -import { View } from 'react-native'; -import { Text } from '@/components/ui/text'; -import { Button } from '@/components/ui/button'; -import { Textarea } from '@/components/ui/textarea'; -import { Icon } from '@/lib/icons/iconWithClassName'; -import { CheckCircle } from 'lucide-react-native'; +import React, { useState } from "react"; +import { View } from "react-native"; +import { Button } from "@/components/ui/button"; +import { Text } from "@/components/ui/text"; +import { Textarea } from "@/components/ui/textarea"; +import { Icon } from "@/lib/icons/iconWithClassName"; +import { CheckCircle } from "lucide-react-native"; interface DescriptionPageProps { onComplete: (description: string) => void; @@ -17,7 +17,7 @@ const DescriptionPage: React.FC = ({ initialDescription, onBack, }) => { - const [description, setDescription] = useState(initialDescription || ''); + const [description, setDescription] = useState(initialDescription || ""); const handleComplete = () => { if (description) { @@ -26,36 +26,36 @@ const DescriptionPage: React.FC = ({ }; return ( - + - - + + Tell us about yourself! - + Your bio is your chance to shine. Let your creativity flow and tell the world who you are. You can always edit it later.