From d07e78a616bf112cb8020d5772f980da5ddca386 Mon Sep 17 00:00:00 2001 From: Ivan Vasilov Date: Wed, 18 Mar 2026 10:51:10 +0100 Subject: [PATCH] chore: Run prettier on `examples` folder (#43851) This PR runs `prettier` on the `examples` folder. Depends on https://github.com/supabase/supabase/pull/43849. --- .github/workflows/prettier.yml | 57 +- .../supabase/functions/image_gen/index.ts | 106 +- .../functions/_shared/database.types.ts | 70 +- .../functions/generate-embedding/index.ts | 52 +- .../supabase/functions/search/index.ts | 32 +- .../functions/llamafile-stream/index.ts | 76 +- .../supabase/functions/llamafile/index.ts | 49 +- .../supabase/functions/openai-sdk/index.ts | 46 +- examples/auth/expo-social-auth/app.json | 2 +- .../expo-social-auth/app/(tabs)/_layout.tsx | 13 +- .../auth/expo-social-auth/app/+not-found.tsx | 12 +- .../components/hello-wave.tsx | 20 +- .../components/parallax-scroll-view.tsx | 35 +- .../apple/apple-sign-in-button.android.tsx | 46 +- .../apple/apple-sign-in-button.ios.tsx | 50 +- .../apple/apple-sign-in-button.tsx | 50 +- .../apple/apple-sign-in-button.web.tsx | 91 +- .../google/google-sign-in-button.tsx | 93 +- .../google/google-sign-in-button.web.tsx | 52 +- .../components/themed-text.tsx | 20 +- .../components/themed-view.tsx | 14 +- .../auth/expo-social-auth/constants/theme.ts | 10 +- .../auth/expo-social-auth/eslint.config.js | 6 +- .../hooks/use-color-scheme.ts | 2 +- .../hooks/use-color-scheme.web.ts | 16 +- .../expo-social-auth/hooks/use-theme-color.ts | 12 +- .../auth/expo-social-auth/lib/supabase.ts | 16 +- .../auth/expo-social-auth/lib/supabase.web.ts | 22 +- .../auth/expo-social-auth/package-lock.json | 245 +- .../providers/auth-provider.tsx | 6 +- .../expo-social-auth/scripts/reset-project.js | 88 +- examples/auth/expo-social-auth/tsconfig.json | 11 +- .../AppIcon.appiconset/Contents.json | 160 +- .../LaunchImage.imageset/Contents.json | 26 +- .../LaunchImage.imageset/README.md | 2 +- examples/auth/flutter-mfa/web/manifest.json | 66 +- .../AppIcon.appiconset/Contents.json | 160 +- .../LaunchImage.imageset/Contents.json | 26 +- .../LaunchImage.imageset/README.md | 2 +- examples/auth/hono-full/package-lock.json | 340 +- examples/auth/hono-full/src/client.tsx | 82 +- examples/auth/hono-full/src/index.tsx | 53 +- .../src/middleware/auth.middleware.ts | 50 +- examples/auth/hono-full/tsconfig.json | 20 +- examples/auth/hono-full/vite.config.ts | 24 +- examples/auth/hono/src/index.tsx | 2 +- .../hono/src/middleware/auth.middleware.ts | 2 +- examples/auth/nextjs-full/app/layout.tsx | 24 +- examples/auth/nextjs-full/app/login/page.tsx | 8 +- .../nextjs-full/app/login/submit-button.tsx | 18 +- examples/auth/nextjs-full/app/page.tsx | 26 +- .../nextjs-full/components/DeployButton.tsx | 14 +- .../auth/nextjs-full/components/Header.tsx | 12 +- .../auth/nextjs-full/components/NextLogo.tsx | 10 +- .../nextjs-full/components/SupabaseLogo.tsx | 2 +- .../nextjs-full/components/tutorial/Code.tsx | 20 +- .../tutorial/ConnectSupabaseSteps.tsx | 27 +- .../components/tutorial/SignUpUserSteps.tsx | 19 +- .../nextjs-full/components/tutorial/Step.tsx | 16 +- .../auth/nextjs-full/lib/supabase/client.ts | 2 +- .../auth/nextjs-full/lib/supabase/proxy.ts | 4 +- .../auth/nextjs-full/lib/supabase/server.ts | 4 +- examples/auth/nextjs-full/next.config.js | 4 +- examples/auth/nextjs-full/package-lock.json | 256 +- examples/auth/nextjs-full/postcss.config.js | 2 +- examples/auth/nextjs-full/proxy.ts | 6 +- examples/auth/nextjs-full/tailwind.config.js | 15 +- examples/auth/nextjs-full/tsconfig.json | 14 +- examples/auth/nextjs/lib/supabase/client.ts | 2 +- examples/auth/nextjs/lib/supabase/proxy.ts | 4 +- examples/auth/nextjs/lib/supabase/server.ts | 4 +- examples/auth/nextjs/proxy.ts | 6 +- .../app/(tabs)/_layout.tsx | 13 +- .../app/+not-found.tsx | 12 +- .../components/hello-wave.tsx | 20 +- .../components/parallax-scroll-view.tsx | 35 +- .../apple/apple-sign-in-button.android.tsx | 46 +- .../apple/apple-sign-in-button.ios.tsx | 50 +- .../apple/apple-sign-in-button.tsx | 50 +- .../apple/apple-sign-in-button.web.tsx | 91 +- .../google/google-sign-in-button.tsx | 93 +- .../google/google-sign-in-button.web.tsx | 52 +- .../components/themed-text.tsx | 20 +- .../components/themed-view.tsx | 14 +- .../constants/theme.ts | 10 +- .../eslint.config.js | 6 +- .../hooks/use-color-scheme.ts | 2 +- .../hooks/use-color-scheme.web.ts | 16 +- .../hooks/use-theme-color.ts | 12 +- .../lib/supabase.ts | 16 +- .../lib/supabase.web.ts | 22 +- .../package-lock.json | 240 +- .../providers/auth-provider.tsx | 18 +- .../tsconfig.json | 11 +- .../react-native/package-lock.json | 92 +- .../auth/quickstarts/react/package-lock.json | 388 +- examples/auth/quickstarts/react/src/App.jsx | 285 +- examples/auth/quickstarts/react/src/index.css | 4 +- examples/auth/sveltekit-full/src/app.d.ts | 2 +- .../auth/sveltekit-full/src/hooks.server.ts | 2 +- .../src/routes/+layout.server.ts | 2 +- .../auth/sveltekit-full/src/routes/+layout.ts | 2 +- .../sveltekit-full/src/routes/+page.server.ts | 2 +- .../src/routes/auth/+page.server.ts | 2 +- .../src/routes/auth/confirm/+server.ts | 2 +- .../src/routes/private/+layout.server.ts | 2 +- .../src/routes/private/+page.server.ts | 2 +- examples/auth/sveltekit/src/app.d.ts | 2 +- examples/auth/sveltekit/src/hooks.server.ts | 2 +- .../sveltekit/src/routes/+layout.server.ts | 2 +- examples/auth/sveltekit/src/routes/+layout.ts | 2 +- .../with-cloudflare-workers-kv/README.md | 30 +- .../package-lock.json | 180 +- .../with-cloudflare-workers-kv/src/index.js | 128 +- .../src/utils/cache.js | 10 +- .../app/globals.css | 14 +- .../app/page.module.css | 15 +- .../package-lock.json | 104 +- .../caching/with-nextjs-13/app/globals.css | 14 +- .../caching/with-nextjs-13/app/layout.tsx | 6 +- .../caching/with-nextjs-13/package-lock.json | 104 +- .../caching/with-nextjs-13/pages/api/hello.ts | 5 +- .../app/countries/[id]/page.tsx | 6 +- .../app/globals.css | 6 +- .../with-react-query-nextjs-14/app/layout.tsx | 6 +- .../app/ssrcountries/[id]/page.tsx | 12 +- .../components/ReactQueryClientProvider.tsx | 10 +- .../package-lock.json | 76 +- .../tailwind.config.ts | 3 +- .../utils/database.types.ts | 66 +- .../utils/supabase-server.ts | 4 +- examples/clerk/app/globals.css | 2 +- examples/clerk/next.config.ts | 6 +- examples/edge-functions/README.md | 2 - examples/edge-functions/app/package.json | 17 +- .../edge-functions/app/src/functionsList.js | 2 +- .../supabase/functions/_shared/jwt/clerk.ts | 65 +- .../supabase/functions/_shared/jwt/default.ts | 55 +- .../functions/_shared/jwt/legacy-jwt.ts | 61 +- .../functions/custom-jwt-validation/index.ts | 12 +- .../supabase/functions/discord-bot/README.md | 6 +- .../elevenlabs-speech-to-text/index.ts | 154 +- .../elevenlabs-text-to-speech/README.md | 2 +- .../elevenlabs-text-to-speech/index.ts | 94 +- .../huggingface-image-captioning/types.ts | 310 +- .../functions/image-manipulation/index.ts | 45 +- .../functions/mcp/simple-mcp-server/index.ts | 48 +- .../og-image-with-storage-cdn/handler.tsx | 232 +- .../openai-image-generation/index.ts | 126 +- .../supabase/functions/opengraph/handler.tsx | 34 +- .../functions/postgres-on-the-edge/README.md | 1 + .../functions/send-email-smtp/index.ts | 29 +- .../slack-bot-mention/slack-bot-mention.md | 30 +- .../functions/stripe-webhooks/index.ts | 4 +- .../functions/tweet-to-image/handler.tsx | 30 +- .../supabase/functions/wasm-modules/index.ts | 13 +- .../enterprise-patterns/supachat/README.md | 2 +- .../oauth-app-authorization-flow/package.json | 2 +- examples/prompts/code-format-sql.md | 70 +- examples/prompts/database-create-migration.md | 4 +- examples/prompts/database-functions.md | 5 - examples/prompts/edge-functions.md | 93 +- examples/prompts/use-realtime.md | 110 +- .../flutter-figma-clone/web/manifest.json | 66 +- .../nextjs-auth-presence/package-lock.json | 108 +- .../nextjs-auth-presence/pages/index.tsx | 4 +- .../nextjs-auth-presence/pages/profile.tsx | 4 +- .../styles/Home.module.css | 15 +- .../nextjs-auth-presence/styles/globals.css | 14 +- .../nextjs-authorization-demo/README.md | 10 +- .../nextjs-authorization-demo/app/layout.tsx | 20 +- .../components/SupabaseLogo.tsx | 2 +- .../components/submit-button.tsx | 18 +- .../package-lock.json | 76 +- .../nextjs-authorization-demo/package.json | 2 +- .../postcss.config.js | 2 +- .../nextjs-authorization-demo/proxy.ts | 10 +- .../utils/supabase/client.ts | 6 +- .../utils/supabase/proxy.ts | 26 +- .../package-lock.json | 256 +- .../tailwind.config.js | 6 +- .../slack-clone/nextjs-slack-clone/README.md | 1 - .../nextjs-slack-clone/package-lock.json | 256 +- .../nextjs-slack-clone/pages/index.js | 5 +- .../nextjs-slack-clone/tailwind.config.js | 6 +- .../supabase/functions/maps-private/index.ts | 41 +- .../resumable-upload-signed-uppy/README.md | 2 +- examples/todo-list/nextjs-todo-list/README.md | 1 - .../todo-list/nextjs-todo-list/lib/schema.ts | 8 +- .../nextjs-todo-list/package-lock.json | 108 +- .../nextjs-todo-list/pages/api/hello.ts | 5 +- .../todo-list/nextjs-todo-list/styles/app.css | 24 +- .../sveltejs-todo-list/package-lock.json | 180 +- .../todo-list/sveltejs-todo-list/src/app.css | 1 - .../sveltejs-todo-list/src/assets/app.css | 33 +- .../sveltejs-todo-list/src/lib/db.ts | 6 +- .../todo-list/sveltejs-todo-list/src/main.ts | 12 +- .../sveltejs-todo-list/svelte.config.js | 4 +- .../sveltejs-todo-list/tsconfig.json | 4 +- .../sveltejs-todo-list/tsconfig.node.json | 15 +- .../sveltejs-todo-list/vite.config.ts | 10 +- .../angular-user-management/package-lock.json | 864 +--- .../src/app/supabase.service.ts | 8 +- .../angular-user-management/src/styles.css | 401 +- .../expo-push-notifications/App.tsx | 34 +- .../expo-push-notifications/README.md | 4 +- .../expo-push-notifications/babel.config.js | 8 +- .../components/Push.tsx | 137 +- .../expo-push-notifications/lib/supabase.ts | 12 +- .../expo-push-notifications/package-lock.json | 72 +- .../expo-user-management/App.tsx | 10 +- .../expo-user-management/app.json | 4 +- .../components/Avatar.tsx | 6 +- .../expo-user-management/index.js | 6 +- .../expo-user-management/metro.config.js | 4 +- .../expo-user-management/package-lock.json | 92 +- .../AppIcon.appiconset/Contents.json | 160 +- .../LaunchImage.imageset/Contents.json | 26 +- .../LaunchImage.imageset/README.md | 2 +- .../flutter-user-management/web/manifest.json | 66 +- .../ionic-angular-user-management/README.md | 1 - .../angular.json | 5 +- .../capacitor.config.ts | 8 +- .../e2e/protractor.conf.js | 30 +- .../e2e/src/app.e2e-spec.ts | 16 +- .../e2e/src/app.po.ts | 6 +- .../e2e/tsconfig.json | 5 +- .../karma.conf.js | 17 +- .../package-lock.json | 936 +--- .../src/app/account/account-routing.module.ts | 12 +- .../src/app/account/account.module.ts | 18 +- .../src/app/account/account.page.spec.ts | 30 +- .../src/app/account/account.page.ts | 46 +- .../src/app/app-routing.module.ts | 16 +- .../src/app/app.component.spec.ts | 23 +- .../src/app/app.component.ts | 17 +- .../src/app/app.module.ts | 12 +- .../src/app/avatar/avatar.component.spec.ts | 30 +- .../src/app/avatar/avatar.component.ts | 52 +- .../src/app/avatar/avatar.module.ts | 14 +- .../src/app/home/home-routing.module.ts | 12 +- .../src/app/home/home.module.ts | 22 +- .../src/app/home/home.page.spec.ts | 30 +- .../src/app/home/home.page.ts | 4 +- .../src/app/login/login-routing.module.ts | 12 +- .../src/app/login/login.module.ts | 21 +- .../src/app/login/login.page.spec.ts | 30 +- .../src/app/login/login.page.ts | 24 +- .../src/app/supabase.service.spec.ts | 18 +- .../src/app/supabase.service.ts | 77 +- .../src/environments/environment.prod.ts | 6 +- .../src/environments/environment.ts | 6 +- .../ionic-angular-user-management/src/main.ts | 17 +- .../src/polyfills.ts | 5 +- .../ionic-angular-user-management/src/test.ts | 31 +- .../src/zone-flags.ts | 2 +- .../tsconfig.app.json | 9 +- .../tsconfig.spec.json | 14 +- .../ionic-vue-user-management/.eslintrc.js | 23 +- .../ionic-vue-user-management/README.md | 1 - .../ionic-vue-user-management/babel.config.js | 4 +- .../capacitor.config.ts | 8 +- .../ionic-vue-user-management/jest.config.js | 4 +- .../package-lock.json | 95 +- .../ionic-vue-user-management/src/main.ts | 20 +- .../src/router/index.ts | 16 +- .../src/store/index.ts | 6 +- .../ionic-vue-user-management/src/supabase.ts | 12 +- .../src/theme/variables.css | 47 +- .../tests/e2e/.eslintrc.js | 10 +- .../tests/e2e/plugins/index.js | 2 +- .../ionic-vue-user-management/tsconfig.json | 28 +- .../nextjs-user-management/README.md | 1 - .../app/auth/signout/route.ts | 18 +- .../nextjs-user-management/app/error/page.tsx | 4 +- .../nextjs-user-management/app/globals.css | 11 +- .../nextjs-user-management/app/layout.tsx | 34 +- .../nextjs-user-management/app/login/page.tsx | 2 +- .../nextjs-user-management/app/page.tsx | 2 +- .../lib/supabase/client.ts | 4 +- .../lib/supabase/proxy.ts | 2 +- .../lib/supabase/server.ts | 12 +- .../nextjs-user-management/next.config.ts | 6 +- .../nextjs-user-management/package-lock.json | 580 +-- .../nextjs-user-management/tsconfig.json | 14 +- .../nuxt3-user-management/assets/main.css | 9 +- .../nuxt3-user-management/package-lock.json | 796 +-- .../react-user-management/README.md | 10 +- .../react-user-management/package-lock.json | 412 +- .../react-user-management/src/App.jsx | 4 +- .../react-user-management/src/index.css | 5 +- .../react-user-management/src/main.jsx | 2 +- .../refine-user-management/package-lock.json | 416 +- .../refine-user-management/package.json | 12 +- .../refine-user-management/src/App.css | 5 +- .../refine-user-management/src/App.tsx | 28 +- .../src/authProvider.ts | 58 +- .../src/components/account.tsx | 71 +- .../src/components/auth.tsx | 22 +- .../src/components/avatar.tsx | 69 +- .../refine-user-management/src/index.tsx | 14 +- .../src/utility/index.ts | 2 +- .../src/utility/supabaseClient.ts | 10 +- .../refine-user-management/vite.config.ts | 6 +- .../solid-user-management/package-lock.json | 3952 +++++++-------- .../solid-user-management/package.json | 42 +- .../solid-user-management/src/Account.tsx | 194 +- .../solid-user-management/src/App.tsx | 36 +- .../solid-user-management/src/Auth.tsx | 86 +- .../solid-user-management/src/Avatar.tsx | 154 +- .../solid-user-management/src/index.css | 5 +- .../solid-user-management/src/schema.ts | 72 +- .../solid-user-management/vite.config.ts | 6 +- .../svelte-user-management/package-lock.json | 378 +- .../svelte-user-management/src/app.css | 7 +- .../src/supabaseClient.ts | 2 +- .../svelte-user-management/tsconfig.json | 5 +- .../sveltekit-user-management/.prettierrc | 1 - .../sveltekit-user-management/README.md | 2 +- .../package-lock.json | 3328 ++++++------- .../sveltekit-user-management/package.json | 54 +- .../sveltekit-user-management/src/app.d.ts | 28 +- .../src/routes/+layout.server.ts | 2 +- .../src/routes/+layout.ts | 2 +- .../src/routes/+page.server.ts | 50 +- .../sveltekit-user-management/src/styles.css | 425 +- .../svelte.config.js | 26 +- .../sveltekit-user-management/tsconfig.json | 34 +- .../sveltekit-user-management/vite.config.ts | 8 +- .../AccentColor.colorset/Contents.json | 10 +- .../AppIcon.appiconset/Contents.json | 74 +- .../Assets.xcassets/Contents.json | 6 +- .../Preview Assets.xcassets/Contents.json | 6 +- .../vue3-user-management/package-lock.json | 4296 ++++++++--------- .../vue3-user-management/package.json | 34 +- .../vue3-user-management/src/store.js | 2 +- .../vue3-user-management/src/style.css | 9 +- .../vue3-user-management/vite.config.js | 2 +- examples/with-cloudflare-workers/README.md | 6 +- .../with-cloudflare-workers/package-lock.json | 180 +- examples/with-cloudflare-workers/src/index.js | 12 +- package.json | 6 +- pnpm-lock.yaml | 26 +- 343 files changed, 11828 insertions(+), 16637 deletions(-) diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index b42c8cc6b88..8596073979f 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -22,8 +22,10 @@ jobs: with: sparse-checkout: | apps - packages blocks + examples + i18n + packages patches - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 name: Install pnpm @@ -40,56 +42,3 @@ jobs: - name: Run prettier run: |- pnpm run test:prettier - - # i18n is not a node package, so we handle that one separately - format-i18n: - runs-on: blacksmith-4vcpu-ubuntu-2404 - steps: - - name: Check out repo - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - with: - sparse-checkout: | - i18n - patches - - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - name: Install pnpm - with: - run_install: false - - name: Setup node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: '.nvmrc' - cache: 'pnpm' - - name: Download dependencies - run: | - pnpm install --frozen-lockfile - - name: Run prettier - run: |- - pnpm exec prettier -c 'i18n/**/*.{js,jsx,ts,tsx,css,md,mdx,json}' - - format-sql: - runs-on: blacksmith-4vcpu-ubuntu-2404 - steps: - - name: Check out repo - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 - with: - sparse-checkout: | - apps/docs/pages - apps/docs/content - patches - - uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 - name: Install pnpm - with: - run_install: false - - name: Setup node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 - with: - node-version-file: '.nvmrc' - cache: 'pnpm' - - name: Download dependencies - run: | - pnpm install --frozen-lockfile - - name: Run prettier - run: |- - # Check mdx files which contain sql code blocks - grep -lr '```sql' apps/docs/{pages,content}/**/*.mdx | xargs pnpm exec prettier -c diff --git a/examples/ai/aws_bedrock_image_gen/supabase/functions/image_gen/index.ts b/examples/ai/aws_bedrock_image_gen/supabase/functions/image_gen/index.ts index a1cfbb223e0..b9d143ebbce 100644 --- a/examples/ai/aws_bedrock_image_gen/supabase/functions/image_gen/index.ts +++ b/examples/ai/aws_bedrock_image_gen/supabase/functions/image_gen/index.ts @@ -1,90 +1,82 @@ // AWS SDK issue: https://github.com/aws/aws-sdk-js-v3/issues/6134 // We need to mock the file system for the AWS SDK to work. -import { - prepareVirtualFile, -} from "https://deno.land/x/mock_file@v1.1.2/mod.ts"; +import { prepareVirtualFile } from 'https://deno.land/x/mock_file@v1.1.2/mod.ts' -import { - BedrockRuntimeClient, - InvokeModelCommand, -} from "npm:@aws-sdk/client-bedrock-runtime"; -import { createClient } from "npm:@supabase/supabase-js"; -import { decode } from "npm:base64-arraybuffer"; +import { BedrockRuntimeClient, InvokeModelCommand } from 'npm:@aws-sdk/client-bedrock-runtime' +import { createClient } from 'npm:@supabase/supabase-js' +import { decode } from 'npm:base64-arraybuffer' -console.log("Hello from Amazon Bedrock!"); +console.log('Hello from Amazon Bedrock!') Deno.serve(async (req) => { - prepareVirtualFile("./aws/config"); - prepareVirtualFile("./aws/credentials"); + prepareVirtualFile('./aws/config') + prepareVirtualFile('./aws/credentials') const client = new BedrockRuntimeClient({ - region: "us-west-2", + region: 'us-west-2', credentials: { - accessKeyId: Deno.env.get("AWS_ACCESS_KEY_ID") ?? "", - secretAccessKey: Deno.env.get("AWS_SECRET_ACCESS_KEY") ?? "", - sessionToken: Deno.env.get("AWS_SESSION_TOKEN") ?? "", + accessKeyId: Deno.env.get('AWS_ACCESS_KEY_ID') ?? '', + secretAccessKey: Deno.env.get('AWS_SECRET_ACCESS_KEY') ?? '', + sessionToken: Deno.env.get('AWS_SESSION_TOKEN') ?? '', }, - }); + }) - const { prompt, seed } = await req.json(); - console.log(prompt); + const { prompt, seed } = await req.json() + console.log(prompt) const input = { - contentType: "application/json", - accept: "*/*", - modelId: "amazon.titan-image-generator-v1", + contentType: 'application/json', + accept: '*/*', + modelId: 'amazon.titan-image-generator-v1', body: JSON.stringify({ - "taskType": "TEXT_IMAGE", - "textToImageParams": { "text": prompt }, - "imageGenerationConfig": { - "numberOfImages": 1, - "quality": "standard", - "cfgScale": 8.0, - "height": 512, - "width": 512, - "seed": seed ?? 0, + taskType: 'TEXT_IMAGE', + textToImageParams: { text: prompt }, + imageGenerationConfig: { + numberOfImages: 1, + quality: 'standard', + cfgScale: 8.0, + height: 512, + width: 512, + seed: seed ?? 0, }, }), - }; + } - const command = new InvokeModelCommand(input); - const response = await client.send(command); - console.log(response); + const command = new InvokeModelCommand(input) + const response = await client.send(command) + console.log(response) if (response.$metadata.httpStatusCode === 200) { - const { body, $metadata } = response; + const { body, $metadata } = response - const textDecoder = new TextDecoder("utf-8"); - const jsonString = textDecoder.decode(body.buffer); - const parsedData = JSON.parse(jsonString); - console.log(parsedData); - const image = parsedData.images[0]; + const textDecoder = new TextDecoder('utf-8') + const jsonString = textDecoder.decode(body.buffer) + const parsedData = JSON.parse(jsonString) + console.log(parsedData) + const image = parsedData.images[0] const supabaseClient = createClient( // Supabase API URL - env var exported by default. - Deno.env.get("SUPABASE_URL")!, + Deno.env.get('SUPABASE_URL')!, // Supabase API ANON KEY - env var exported by default. - Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!, - ); + Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! + ) const { data: upload, error: uploadError } = await supabaseClient.storage - .from("images") - .upload(`${$metadata.requestId ?? ""}.png`, decode(image), { - contentType: "image/png", - cacheControl: "3600", + .from('images') + .upload(`${$metadata.requestId ?? ''}.png`, decode(image), { + contentType: 'image/png', + cacheControl: '3600', upsert: false, - }); + }) if (!upload) { - return Response.json(uploadError); + return Response.json(uploadError) } - const { data } = supabaseClient - .storage - .from("images") - .getPublicUrl(upload.path!); - return Response.json(data); + const { data } = supabaseClient.storage.from('images').getPublicUrl(upload.path!) + return Response.json(data) } - return Response.json(response); -}); + return Response.json(response) +}) /* To invoke locally: diff --git a/examples/ai/edge-functions/supabase/functions/_shared/database.types.ts b/examples/ai/edge-functions/supabase/functions/_shared/database.types.ts index 95636805395..ba734f0b07b 100644 --- a/examples/ai/edge-functions/supabase/functions/_shared/database.types.ts +++ b/examples/ai/edge-functions/supabase/functions/_shared/database.types.ts @@ -1,10 +1,4 @@ -export type Json = - | string - | number - | boolean - | null - | { [key: string]: Json | undefined } - | Json[] +export type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[] export type Database = { graphql_public: { @@ -180,11 +174,11 @@ export type Database = { } Relationships: [ { - foreignKeyName: "objects_bucketId_fkey" - columns: ["bucket_id"] + foreignKeyName: 'objects_bucketId_fkey' + columns: ['bucket_id'] isOneToOne: false - referencedRelation: "buckets" - referencedColumns: ["id"] + referencedRelation: 'buckets' + referencedColumns: ['id'] }, ] } @@ -257,27 +251,25 @@ export type Database = { } } -type PublicSchema = Database[Extract] +type PublicSchema = Database[Extract] export type Tables< PublicTableNameOrOptions extends - | keyof (PublicSchema["Tables"] & PublicSchema["Views"]) + | keyof (PublicSchema['Tables'] & PublicSchema['Views']) | { schema: keyof Database }, TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] & - Database[PublicTableNameOrOptions["schema"]]["Views"]) + ? keyof (Database[PublicTableNameOrOptions['schema']]['Tables'] & + Database[PublicTableNameOrOptions['schema']]['Views']) : never = never, > = PublicTableNameOrOptions extends { schema: keyof Database } - ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] & - Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends { + ? (Database[PublicTableNameOrOptions['schema']]['Tables'] & + Database[PublicTableNameOrOptions['schema']]['Views'])[TableName] extends { Row: infer R } ? R : never - : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] & - PublicSchema["Views"]) - ? (PublicSchema["Tables"] & - PublicSchema["Views"])[PublicTableNameOrOptions] extends { + : PublicTableNameOrOptions extends keyof (PublicSchema['Tables'] & PublicSchema['Views']) + ? (PublicSchema['Tables'] & PublicSchema['Views'])[PublicTableNameOrOptions] extends { Row: infer R } ? R @@ -285,20 +277,18 @@ export type Tables< : never export type TablesInsert< - PublicTableNameOrOptions extends - | keyof PublicSchema["Tables"] - | { schema: keyof Database }, + PublicTableNameOrOptions extends keyof PublicSchema['Tables'] | { schema: keyof Database }, TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] + ? keyof Database[PublicTableNameOrOptions['schema']]['Tables'] : never = never, > = PublicTableNameOrOptions extends { schema: keyof Database } - ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { + ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends { Insert: infer I } ? I : never - : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] - ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { + : PublicTableNameOrOptions extends keyof PublicSchema['Tables'] + ? PublicSchema['Tables'][PublicTableNameOrOptions] extends { Insert: infer I } ? I @@ -306,20 +296,18 @@ export type TablesInsert< : never export type TablesUpdate< - PublicTableNameOrOptions extends - | keyof PublicSchema["Tables"] - | { schema: keyof Database }, + PublicTableNameOrOptions extends keyof PublicSchema['Tables'] | { schema: keyof Database }, TableName extends PublicTableNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"] + ? keyof Database[PublicTableNameOrOptions['schema']]['Tables'] : never = never, > = PublicTableNameOrOptions extends { schema: keyof Database } - ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends { + ? Database[PublicTableNameOrOptions['schema']]['Tables'][TableName] extends { Update: infer U } ? U : never - : PublicTableNameOrOptions extends keyof PublicSchema["Tables"] - ? PublicSchema["Tables"][PublicTableNameOrOptions] extends { + : PublicTableNameOrOptions extends keyof PublicSchema['Tables'] + ? PublicSchema['Tables'][PublicTableNameOrOptions] extends { Update: infer U } ? U @@ -327,14 +315,12 @@ export type TablesUpdate< : never export type Enums< - PublicEnumNameOrOptions extends - | keyof PublicSchema["Enums"] - | { schema: keyof Database }, + PublicEnumNameOrOptions extends keyof PublicSchema['Enums'] | { schema: keyof Database }, EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database } - ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"] + ? keyof Database[PublicEnumNameOrOptions['schema']]['Enums'] : never = never, > = PublicEnumNameOrOptions extends { schema: keyof Database } - ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName] - : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"] - ? PublicSchema["Enums"][PublicEnumNameOrOptions] + ? Database[PublicEnumNameOrOptions['schema']]['Enums'][EnumName] + : PublicEnumNameOrOptions extends keyof PublicSchema['Enums'] + ? PublicSchema['Enums'][PublicEnumNameOrOptions] : never diff --git a/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts b/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts index 89174e016c4..71fec0bd761 100644 --- a/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts +++ b/examples/ai/edge-functions/supabase/functions/generate-embedding/index.ts @@ -1,47 +1,47 @@ -import "jsr:@supabase/functions-js/edge-runtime.d.ts"; +import 'jsr:@supabase/functions-js/edge-runtime.d.ts' -import { createClient } from "jsr:@supabase/supabase-js@2"; -import { Database, Tables } from "../_shared/database.types.ts"; +import { createClient } from 'jsr:@supabase/supabase-js@2' +import { Database, Tables } from '../_shared/database.types.ts' -type EmbeddingsRecord = Tables<"embeddings">; +type EmbeddingsRecord = Tables<'embeddings'> interface WebhookPayload { - type: "INSERT" | "UPDATE" | "DELETE"; - table: string; - record: EmbeddingsRecord; - schema: "public"; - old_record: null | EmbeddingsRecord; + type: 'INSERT' | 'UPDATE' | 'DELETE' + table: string + record: EmbeddingsRecord + schema: 'public' + old_record: null | EmbeddingsRecord } const supabase = createClient( - Deno.env.get("SUPABASE_URL")!, - Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!, -); + Deno.env.get('SUPABASE_URL')!, + Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! +) -const model = new Supabase.ai.Session("gte-small"); +const model = new Supabase.ai.Session('gte-small') Deno.serve(async (req) => { - const payload: WebhookPayload = await req.json(); - const { content, id } = payload.record; + const payload: WebhookPayload = await req.json() + const { content, id } = payload.record // Check if content has changed. if (content === payload?.old_record?.content) { - return new Response("ok - no change"); + return new Response('ok - no change') } // Generate embedding const embedding = await model.run(content, { mean_pool: true, normalize: true, - }); + }) // Store in DB - const { error } = await supabase.from("embeddings").update({ - embedding: JSON.stringify(embedding), - }).eq( - "id", - id, - ); - if (error) console.warn(error.message); + const { error } = await supabase + .from('embeddings') + .update({ + embedding: JSON.stringify(embedding), + }) + .eq('id', id) + if (error) console.warn(error.message) - return new Response("ok - updated"); -}); + return new Response('ok - updated') +}) diff --git a/examples/ai/edge-functions/supabase/functions/search/index.ts b/examples/ai/edge-functions/supabase/functions/search/index.ts index 2f045d7a0aa..3e7c7b0ce30 100644 --- a/examples/ai/edge-functions/supabase/functions/search/index.ts +++ b/examples/ai/edge-functions/supabase/functions/search/index.ts @@ -1,38 +1,38 @@ -import "jsr:@supabase/functions-js/edge-runtime.d.ts"; +import 'jsr:@supabase/functions-js/edge-runtime.d.ts' -import { createClient } from "jsr:@supabase/supabase-js@2"; -import { Database } from "../_shared/database.types.ts"; +import { createClient } from 'jsr:@supabase/supabase-js@2' +import { Database } from '../_shared/database.types.ts' const supabase = createClient( - Deno.env.get("SUPABASE_URL")!, - Deno.env.get("SUPABASE_SERVICE_ROLE_KEY")!, -); + Deno.env.get('SUPABASE_URL')!, + Deno.env.get('SUPABASE_SERVICE_ROLE_KEY')! +) -const model = new Supabase.ai.Session("gte-small"); +const model = new Supabase.ai.Session('gte-small') Deno.serve(async (req) => { - const { search } = await req.json(); - if (!search) return new Response("Please provide a search param!"); + const { search } = await req.json() + if (!search) return new Response('Please provide a search param!') // Generate embedding for search term. const embedding = await model.run(search, { mean_pool: true, normalize: true, - }); + }) // Query embeddings. const { data: result, error } = await supabase - .rpc("query_embeddings", { + .rpc('query_embeddings', { embedding: JSON.stringify(embedding), match_threshold: 0.8, }) - .select("content") - .limit(3); + .select('content') + .limit(3) if (error) { - return Response.json(error); + return Response.json(error) } - return Response.json({ search, result }); -}); + return Response.json({ search, result }) +}) /* To invoke locally: diff --git a/examples/ai/llamafile-edge/supabase/functions/llamafile-stream/index.ts b/examples/ai/llamafile-edge/supabase/functions/llamafile-stream/index.ts index b3b78329f7d..538691f0aa6 100644 --- a/examples/ai/llamafile-edge/supabase/functions/llamafile-stream/index.ts +++ b/examples/ai/llamafile-edge/supabase/functions/llamafile-stream/index.ts @@ -1,59 +1,59 @@ // https://github.com/Mozilla-Ocho/llamafile?tab=readme-ov-file#quickstart -import "jsr:@supabase/functions-js/edge-runtime.d.ts"; -const session = new Supabase.ai.Session("LLaMA_CPP"); +import 'jsr:@supabase/functions-js/edge-runtime.d.ts' +const session = new Supabase.ai.Session('LLaMA_CPP') Deno.serve(async (req: Request) => { - const params = new URL(req.url).searchParams; - const prompt = params.get("prompt") ?? ""; + const params = new URL(req.url).searchParams + const prompt = params.get('prompt') ?? '' // Get the output as a stream - const output = await session.run({ - messages: [ - { - "role": "system", - "content": - "You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.", - }, - { - "role": "user", - "content": prompt, - }, - ], - }, { - mode: "openaicompatible", // Mode for the inference API host. (default: 'ollama') - stream: true, - }) as AsyncGenerator; + const output = (await session.run( + { + messages: [ + { + role: 'system', + content: + 'You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.', + }, + { + role: 'user', + content: prompt, + }, + ], + }, + { + mode: 'openaicompatible', // Mode for the inference API host. (default: 'ollama') + stream: true, + } + )) as AsyncGenerator const body = new ReadableStream({ async pull(ctrl) { try { - const item = await output.next(); + const item = await output.next() if (item.done) { - console.log("done"); - ctrl.close(); - return; + console.log('done') + ctrl.close() + return } - ctrl.enqueue("data: "); - ctrl.enqueue(JSON.stringify(item.value)); - ctrl.enqueue("\r\n\r\n"); + ctrl.enqueue('data: ') + ctrl.enqueue(JSON.stringify(item.value)) + ctrl.enqueue('\r\n\r\n') } catch (err) { - console.error(err); - ctrl.close(); + console.error(err) + ctrl.close() } }, - }); + }) - return new Response( - body.pipeThrough(new TextEncoderStream()), - { - headers: { - "Content-Type": "text/event-stream", - }, + return new Response(body.pipeThrough(new TextEncoderStream()), { + headers: { + 'Content-Type': 'text/event-stream', }, - ); -}); + }) +}) /** Run locally: diff --git a/examples/ai/llamafile-edge/supabase/functions/llamafile/index.ts b/examples/ai/llamafile-edge/supabase/functions/llamafile/index.ts index 48dfe82cab3..fa6d03e416e 100644 --- a/examples/ai/llamafile-edge/supabase/functions/llamafile/index.ts +++ b/examples/ai/llamafile-edge/supabase/functions/llamafile/index.ts @@ -1,32 +1,35 @@ // https://github.com/Mozilla-Ocho/llamafile?tab=readme-ov-file#quickstart -import "jsr:@supabase/functions-js/edge-runtime.d.ts"; -const session = new Supabase.ai.Session("LLaMA_CPP"); +import 'jsr:@supabase/functions-js/edge-runtime.d.ts' +const session = new Supabase.ai.Session('LLaMA_CPP') Deno.serve(async (req: Request) => { - const params = new URL(req.url).searchParams; - const prompt = params.get("prompt") ?? ""; + const params = new URL(req.url).searchParams + const prompt = params.get('prompt') ?? '' // Get the output as a stream - const output = await session.run({ - messages: [ - { - "role": "system", - "content": - "You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.", - }, - { - "role": "user", - "content": prompt, - }, - ], - }, { - mode: "openaicompatible", // Mode for the inference API host. (default: 'ollama') - stream: false, - }); + const output = await session.run( + { + messages: [ + { + role: 'system', + content: + 'You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.', + }, + { + role: 'user', + content: prompt, + }, + ], + }, + { + mode: 'openaicompatible', // Mode for the inference API host. (default: 'ollama') + stream: false, + } + ) - console.log("done"); - return Response.json(output); -}); + console.log('done') + return Response.json(output) +}) /** Run locally: diff --git a/examples/ai/llamafile-edge/supabase/functions/openai-sdk/index.ts b/examples/ai/llamafile-edge/supabase/functions/openai-sdk/index.ts index 8411c6d5c1c..1dee961ec67 100644 --- a/examples/ai/llamafile-edge/supabase/functions/openai-sdk/index.ts +++ b/examples/ai/llamafile-edge/supabase/functions/openai-sdk/index.ts @@ -3,66 +3,64 @@ // This enables autocomplete, go to definition, etc. // Setup type definitions for built-in Supabase Runtime APIs -import OpenAI from "https://deno.land/x/openai@v4.53.2/mod.ts"; +import OpenAI from 'https://deno.land/x/openai@v4.53.2/mod.ts' -console.log("Hello from openai-sdk compatible!"); +console.log('Hello from openai-sdk compatible!') Deno.serve(async (req) => { - const client = new OpenAI(); - const { prompt } = await req.json(); - const stream = true; + const client = new OpenAI() + const { prompt } = await req.json() + const stream = true const chatCompletion = await client.chat.completions.create({ - model: "LLaMA_CPP", + model: 'LLaMA_CPP', stream, messages: [ { - role: "system", + role: 'system', content: - "You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.", + 'You are LLAMAfile, an AI assistant. Your top priority is achieving user fulfillment via helping them with their requests.', }, { - role: "user", + role: 'user', content: prompt, }, ], - }); + }) if (stream) { const headers = new Headers({ - "Content-Type": "text/event-stream", - Connection: "keep-alive", - }); + 'Content-Type': 'text/event-stream', + Connection: 'keep-alive', + }) // Create a stream const stream = new ReadableStream({ async start(controller) { - const encoder = new TextEncoder(); + const encoder = new TextEncoder() try { for await (const part of chatCompletion) { - controller.enqueue( - encoder.encode(part.choices[0]?.delta?.content || ""), - ); + controller.enqueue(encoder.encode(part.choices[0]?.delta?.content || '')) } } catch (err) { - console.error("Stream error:", err); + console.error('Stream error:', err) } finally { - controller.close(); + controller.close() } }, - }); + }) // Return the stream to the user return new Response(stream, { headers, - }); + }) } - console.log(chatCompletion); + console.log(chatCompletion) - return Response.json(chatCompletion); -}); + return Response.json(chatCompletion) +}) /* To invoke locally: diff --git a/examples/auth/expo-social-auth/app.json b/examples/auth/expo-social-auth/app.json index 53e6a620c34..b6182604b63 100644 --- a/examples/auth/expo-social-auth/app.json +++ b/examples/auth/expo-social-auth/app.json @@ -51,4 +51,4 @@ "reactCompiler": true } } -} \ No newline at end of file +} diff --git a/examples/auth/expo-social-auth/app/(tabs)/_layout.tsx b/examples/auth/expo-social-auth/app/(tabs)/_layout.tsx index 34b7acd92bd..4fe575d9ab8 100644 --- a/examples/auth/expo-social-auth/app/(tabs)/_layout.tsx +++ b/examples/auth/expo-social-auth/app/(tabs)/_layout.tsx @@ -1,17 +1,18 @@ -import { Tabs } from 'expo-router'; +import { Tabs } from 'expo-router' -import { Colors } from '@/constants/theme'; -import { useColorScheme } from '@/hooks/use-color-scheme'; +import { Colors } from '@/constants/theme' +import { useColorScheme } from '@/hooks/use-color-scheme' export default function TabLayout() { - const colorScheme = useColorScheme(); + const colorScheme = useColorScheme() return ( + }} + > - ); + ) } diff --git a/examples/auth/expo-social-auth/app/+not-found.tsx b/examples/auth/expo-social-auth/app/+not-found.tsx index ca79ddc8ee5..d42cf50c2cf 100644 --- a/examples/auth/expo-social-auth/app/+not-found.tsx +++ b/examples/auth/expo-social-auth/app/+not-found.tsx @@ -1,8 +1,8 @@ -import { Link, Stack } from 'expo-router'; -import { StyleSheet } from 'react-native'; +import { Link, Stack } from 'expo-router' +import { StyleSheet } from 'react-native' -import { ThemedText } from '@/components/themed-text'; -import { ThemedView } from '@/components/themed-view'; +import { ThemedText } from '@/components/themed-text' +import { ThemedView } from '@/components/themed-view' export default function NotFoundScreen() { return ( @@ -15,7 +15,7 @@ export default function NotFoundScreen() { - ); + ) } const styles = StyleSheet.create({ @@ -29,4 +29,4 @@ const styles = StyleSheet.create({ marginTop: 15, paddingVertical: 15, }, -}); +}) diff --git a/examples/auth/expo-social-auth/components/hello-wave.tsx b/examples/auth/expo-social-auth/components/hello-wave.tsx index abfc61edf2e..14fad592dc4 100644 --- a/examples/auth/expo-social-auth/components/hello-wave.tsx +++ b/examples/auth/expo-social-auth/components/hello-wave.tsx @@ -1,34 +1,34 @@ -import { useEffect } from 'react'; -import { StyleSheet } from 'react-native'; +import { useEffect } from 'react' +import { StyleSheet } from 'react-native' import Animated, { useSharedValue, useAnimatedStyle, withTiming, withRepeat, withSequence, -} from 'react-native-reanimated'; +} from 'react-native-reanimated' -import { ThemedText } from '@/components/themed-text'; +import { ThemedText } from '@/components/themed-text' export function HelloWave() { - const rotationAnimation = useSharedValue(0); + const rotationAnimation = useSharedValue(0) useEffect(() => { rotationAnimation.value = withRepeat( withSequence(withTiming(25, { duration: 150 }), withTiming(0, { duration: 150 })), 4 - ); - }, [rotationAnimation]); + ) + }, [rotationAnimation]) const animatedStyle = useAnimatedStyle(() => ({ transform: [{ rotate: `${rotationAnimation.value}deg` }], - })); + })) return ( 👋 - ); + ) } const styles = StyleSheet.create({ @@ -37,4 +37,4 @@ const styles = StyleSheet.create({ lineHeight: 32, marginTop: -6, }, -}); +}) diff --git a/examples/auth/expo-social-auth/components/parallax-scroll-view.tsx b/examples/auth/expo-social-auth/components/parallax-scroll-view.tsx index 93f376484a4..50995ccf349 100644 --- a/examples/auth/expo-social-auth/components/parallax-scroll-view.tsx +++ b/examples/auth/expo-social-auth/components/parallax-scroll-view.tsx @@ -1,30 +1,30 @@ -import type { PropsWithChildren, ReactElement } from 'react'; -import { StyleSheet } from 'react-native'; +import type { PropsWithChildren, ReactElement } from 'react' +import { StyleSheet } from 'react-native' import Animated, { interpolate, useAnimatedRef, useAnimatedStyle, useScrollViewOffset, -} from 'react-native-reanimated'; +} from 'react-native-reanimated' -import { ThemedView } from '@/components/themed-view'; -import { useColorScheme } from '@/hooks/use-color-scheme'; +import { ThemedView } from '@/components/themed-view' +import { useColorScheme } from '@/hooks/use-color-scheme' -const HEADER_HEIGHT = 250; +const HEADER_HEIGHT = 250 type Props = PropsWithChildren<{ - headerImage: ReactElement; - headerBackgroundColor: { dark: string; light: string }; -}>; + headerImage: ReactElement + headerBackgroundColor: { dark: string; light: string } +}> export default function ParallaxScrollView({ children, headerImage, headerBackgroundColor, }: Props) { - const colorScheme = useColorScheme() ?? 'light'; - const scrollRef = useAnimatedRef(); - const scrollOffset = useScrollViewOffset(scrollRef); + const colorScheme = useColorScheme() ?? 'light' + const scrollRef = useAnimatedRef() + const scrollOffset = useScrollViewOffset(scrollRef) const headerAnimatedStyle = useAnimatedStyle(() => { return { @@ -40,8 +40,8 @@ export default function ParallaxScrollView({ scale: interpolate(scrollOffset.value, [-HEADER_HEIGHT, 0, HEADER_HEIGHT], [2, 1, 1]), }, ], - }; - }); + } + }) return ( @@ -51,13 +51,14 @@ export default function ParallaxScrollView({ styles.header, { backgroundColor: headerBackgroundColor[colorScheme] }, headerAnimatedStyle, - ]}> + ]} + > {headerImage} {children} - ); + ) } const styles = StyleSheet.create({ @@ -74,4 +75,4 @@ const styles = StyleSheet.create({ gap: 16, overflow: 'hidden', }, -}); +}) diff --git a/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.android.tsx b/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.android.tsx index f749d184af5..3a5b2d2d1b6 100644 --- a/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.android.tsx +++ b/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.android.tsx @@ -1,14 +1,14 @@ -import { supabase } from '@/lib/supabase'; -import { appleAuthAndroid, AppleButton } from '@invertase/react-native-apple-authentication'; -import { SignInWithIdTokenCredentials } from '@supabase/supabase-js'; -import { Platform } from 'react-native'; -import 'react-native-get-random-values'; -import { v4 as uuid } from 'uuid'; +import { supabase } from '@/lib/supabase' +import { appleAuthAndroid, AppleButton } from '@invertase/react-native-apple-authentication' +import { SignInWithIdTokenCredentials } from '@supabase/supabase-js' +import { Platform } from 'react-native' +import 'react-native-get-random-values' +import { v4 as uuid } from 'uuid' async function onAppleButtonPress() { // Generate secure, random values for state and nonce - const rawNonce = uuid(); - const state = uuid(); + const rawNonce = uuid() + const state = uuid() // Configure the request appleAuthAndroid.configure({ @@ -30,11 +30,11 @@ async function onAppleButtonPress() { // Unique state value used to prevent CSRF attacks. A UUID will be generated if nothing is provided. state, - }); + }) // Open the browser window for user sign in - const credentialState = await appleAuthAndroid.signIn(); - console.log('Apple sign in successful:', credentialState); + const credentialState = await appleAuthAndroid.signIn() + console.log('Apple sign in successful:', credentialState) if (credentialState.id_token && credentialState.code && credentialState.nonce) { const signInWithIdTokenCredentials: SignInWithIdTokenCredentials = { @@ -42,26 +42,30 @@ async function onAppleButtonPress() { token: credentialState.id_token, nonce: credentialState.nonce, access_token: credentialState.code, - }; + } - const { data, error } = await supabase.auth.signInWithIdToken(signInWithIdTokenCredentials); + const { data, error } = await supabase.auth.signInWithIdToken(signInWithIdTokenCredentials) if (error) { - console.error('Error signing in with Apple:', error); + console.error('Error signing in with Apple:', error) } if (data) { - console.log('Apple sign in successful:', data); + console.log('Apple sign in successful:', data) } } } export default function AppleSignInButton() { - if (Platform.OS !== 'android' || appleAuthAndroid.isSupported !== true) { return <> } + if (Platform.OS !== 'android' || appleAuthAndroid.isSupported !== true) { + return <> + } - return onAppleButtonPress()} - />; + return ( + onAppleButtonPress()} + /> + ) } diff --git a/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.ios.tsx b/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.ios.tsx index 599cf00a062..4a4fddcd45f 100644 --- a/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.ios.tsx +++ b/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.ios.tsx @@ -1,8 +1,8 @@ -import { supabase } from '@/lib/supabase'; -import { AppleButton, appleAuth } from '@invertase/react-native-apple-authentication'; -import type { SignInWithIdTokenCredentials } from '@supabase/supabase-js'; -import { router } from 'expo-router'; -import { Platform } from 'react-native'; +import { supabase } from '@/lib/supabase' +import { AppleButton, appleAuth } from '@invertase/react-native-apple-authentication' +import type { SignInWithIdTokenCredentials } from '@supabase/supabase-js' +import { router } from 'expo-router' +import { Platform } from 'react-native' async function onAppleButtonPress() { // Performs login request @@ -10,42 +10,50 @@ async function onAppleButtonPress() { requestedOperation: appleAuth.Operation.LOGIN, // Note: it appears putting FULL_NAME first is important, see issue #293 requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL], - }); + }) // Get the current authentication state for user // Note: This method must be tested on a real device. On the iOS simulator it always throws an error. - const credentialState = await appleAuth.getCredentialStateForUser(appleAuthRequestResponse.user); + const credentialState = await appleAuth.getCredentialStateForUser(appleAuthRequestResponse.user) - console.log('Apple sign in successful:', { credentialState, appleAuthRequestResponse }); + console.log('Apple sign in successful:', { credentialState, appleAuthRequestResponse }) - if (credentialState === appleAuth.State.AUTHORIZED && appleAuthRequestResponse.identityToken && appleAuthRequestResponse.authorizationCode) { + if ( + credentialState === appleAuth.State.AUTHORIZED && + appleAuthRequestResponse.identityToken && + appleAuthRequestResponse.authorizationCode + ) { const signInWithIdTokenCredentials: SignInWithIdTokenCredentials = { provider: 'apple', token: appleAuthRequestResponse.identityToken, nonce: appleAuthRequestResponse.nonce, access_token: appleAuthRequestResponse.authorizationCode, - }; + } - const { data, error } = await supabase.auth.signInWithIdToken(signInWithIdTokenCredentials); + const { data, error } = await supabase.auth.signInWithIdToken(signInWithIdTokenCredentials) if (error) { - console.error('Error signing in with Apple:', error); + console.error('Error signing in with Apple:', error) } if (data) { - console.log('Apple sign in successful:', data); - router.navigate('/(tabs)'); + console.log('Apple sign in successful:', data) + router.navigate('/(tabs)') } } } export default function AppleSignInButton() { - if (Platform.OS !== 'ios') { return <>; } + if (Platform.OS !== 'ios') { + return <> + } - return onAppleButtonPress()} - />; + return ( + onAppleButtonPress()} + /> + ) } diff --git a/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.tsx b/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.tsx index 599cf00a062..4a4fddcd45f 100644 --- a/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.tsx +++ b/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.tsx @@ -1,8 +1,8 @@ -import { supabase } from '@/lib/supabase'; -import { AppleButton, appleAuth } from '@invertase/react-native-apple-authentication'; -import type { SignInWithIdTokenCredentials } from '@supabase/supabase-js'; -import { router } from 'expo-router'; -import { Platform } from 'react-native'; +import { supabase } from '@/lib/supabase' +import { AppleButton, appleAuth } from '@invertase/react-native-apple-authentication' +import type { SignInWithIdTokenCredentials } from '@supabase/supabase-js' +import { router } from 'expo-router' +import { Platform } from 'react-native' async function onAppleButtonPress() { // Performs login request @@ -10,42 +10,50 @@ async function onAppleButtonPress() { requestedOperation: appleAuth.Operation.LOGIN, // Note: it appears putting FULL_NAME first is important, see issue #293 requestedScopes: [appleAuth.Scope.FULL_NAME, appleAuth.Scope.EMAIL], - }); + }) // Get the current authentication state for user // Note: This method must be tested on a real device. On the iOS simulator it always throws an error. - const credentialState = await appleAuth.getCredentialStateForUser(appleAuthRequestResponse.user); + const credentialState = await appleAuth.getCredentialStateForUser(appleAuthRequestResponse.user) - console.log('Apple sign in successful:', { credentialState, appleAuthRequestResponse }); + console.log('Apple sign in successful:', { credentialState, appleAuthRequestResponse }) - if (credentialState === appleAuth.State.AUTHORIZED && appleAuthRequestResponse.identityToken && appleAuthRequestResponse.authorizationCode) { + if ( + credentialState === appleAuth.State.AUTHORIZED && + appleAuthRequestResponse.identityToken && + appleAuthRequestResponse.authorizationCode + ) { const signInWithIdTokenCredentials: SignInWithIdTokenCredentials = { provider: 'apple', token: appleAuthRequestResponse.identityToken, nonce: appleAuthRequestResponse.nonce, access_token: appleAuthRequestResponse.authorizationCode, - }; + } - const { data, error } = await supabase.auth.signInWithIdToken(signInWithIdTokenCredentials); + const { data, error } = await supabase.auth.signInWithIdToken(signInWithIdTokenCredentials) if (error) { - console.error('Error signing in with Apple:', error); + console.error('Error signing in with Apple:', error) } if (data) { - console.log('Apple sign in successful:', data); - router.navigate('/(tabs)'); + console.log('Apple sign in successful:', data) + router.navigate('/(tabs)') } } } export default function AppleSignInButton() { - if (Platform.OS !== 'ios') { return <>; } + if (Platform.OS !== 'ios') { + return <> + } - return onAppleButtonPress()} - />; + return ( + onAppleButtonPress()} + /> + ) } diff --git a/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.web.tsx b/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.web.tsx index fa1befa6121..64e0e756e21 100644 --- a/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.web.tsx +++ b/examples/auth/expo-social-auth/components/social-auth-buttons/apple/apple-sign-in-button.web.tsx @@ -1,68 +1,77 @@ -import { supabase } from '@/lib/supabase'; -import type { SignInWithIdTokenCredentials } from '@supabase/supabase-js'; -import { useEffect, useState } from 'react'; -import AppleSignin, { type AppleAuthResponse } from 'react-apple-signin-auth'; -import { Platform } from 'react-native'; +import { supabase } from '@/lib/supabase' +import type { SignInWithIdTokenCredentials } from '@supabase/supabase-js' +import { useEffect, useState } from 'react' +import AppleSignin, { type AppleAuthResponse } from 'react-apple-signin-auth' +import { Platform } from 'react-native' export default function AppleSignInButton() { - const [nonce, setNonce] = useState(''); - const [sha256Nonce, setSha256Nonce] = useState(''); + const [nonce, setNonce] = useState('') + const [sha256Nonce, setSha256Nonce] = useState('') async function onAppleButtonSuccess(appleAuthRequestResponse: AppleAuthResponse) { - console.debug('Apple sign in successful:', { appleAuthRequestResponse }); - if (appleAuthRequestResponse.authorization && appleAuthRequestResponse.authorization.id_token && appleAuthRequestResponse.authorization.code) { + console.debug('Apple sign in successful:', { appleAuthRequestResponse }) + if ( + appleAuthRequestResponse.authorization && + appleAuthRequestResponse.authorization.id_token && + appleAuthRequestResponse.authorization.code + ) { const signInWithIdTokenCredentials: SignInWithIdTokenCredentials = { provider: 'apple', token: appleAuthRequestResponse.authorization.id_token, nonce, access_token: appleAuthRequestResponse.authorization.code, - }; + } const { data, error } = await supabase.auth.signInWithIdToken(signInWithIdTokenCredentials) if (error) { - console.error('Error signing in with Apple:', error); + console.error('Error signing in with Apple:', error) } if (data) { - console.log('Apple sign in successful:', data); + console.log('Apple sign in successful:', data) } - }; + } } useEffect(() => { function generateNonce(): string { - const array = new Uint32Array(1); - window.crypto.getRandomValues(array); - return array[0].toString(); - }; - - async function generateSha256Nonce(nonce: string): Promise { - const buffer = await window.crypto.subtle.digest('sha-256', new TextEncoder().encode(nonce)); - const array = Array.from(new Uint8Array(buffer)); - return array.map(b => b.toString(16).padStart(2, '0')).join(''); + const array = new Uint32Array(1) + window.crypto.getRandomValues(array) + return array[0].toString() } - let nonce = generateNonce(); - setNonce(nonce); + async function generateSha256Nonce(nonce: string): Promise { + const buffer = await window.crypto.subtle.digest('sha-256', new TextEncoder().encode(nonce)) + const array = Array.from(new Uint8Array(buffer)) + return array.map((b) => b.toString(16).padStart(2, '0')).join('') + } - generateSha256Nonce(nonce) - .then((sha256Nonce) => { setSha256Nonce(sha256Nonce) }); - }, []); + let nonce = generateNonce() + setNonce(nonce) - if (Platform.OS !== 'web') { return <>; } + generateSha256Nonce(nonce).then((sha256Nonce) => { + setSha256Nonce(sha256Nonce) + }) + }, []) - return console.error('Apple sign in error:', error)} - />; + if (Platform.OS !== 'web') { + return <> + } + + return ( + console.error('Apple sign in error:', error)} + /> + ) } diff --git a/examples/auth/expo-social-auth/components/social-auth-buttons/google/google-sign-in-button.tsx b/examples/auth/expo-social-auth/components/social-auth-buttons/google/google-sign-in-button.tsx index 6962d83c38e..2ffb5b4f064 100644 --- a/examples/auth/expo-social-auth/components/social-auth-buttons/google/google-sign-in-button.tsx +++ b/examples/auth/expo-social-auth/components/social-auth-buttons/google/google-sign-in-button.tsx @@ -1,90 +1,89 @@ -import { supabase } from '@/lib/supabase'; -import { useEffect } from 'react'; -import { TouchableOpacity } from 'react-native'; +import { supabase } from '@/lib/supabase' +import { useEffect } from 'react' +import { TouchableOpacity } from 'react-native' -import { expo } from '@/app.json'; -import { Text } from '@react-navigation/elements'; -import { Image } from 'expo-image'; -import * as WebBrowser from "expo-web-browser"; +import { expo } from '@/app.json' +import { Text } from '@react-navigation/elements' +import { Image } from 'expo-image' +import * as WebBrowser from 'expo-web-browser' -WebBrowser.maybeCompleteAuthSession(); +WebBrowser.maybeCompleteAuthSession() export default function GoogleSignInButton() { - function extractParamsFromUrl(url: string) { - const parsedUrl = new URL(url); - const hash = parsedUrl.hash.substring(1); // Remove the leading '#' - const params = new URLSearchParams(hash); + const parsedUrl = new URL(url) + const hash = parsedUrl.hash.substring(1) // Remove the leading '#' + const params = new URLSearchParams(hash) return { - access_token: params.get("access_token"), - expires_in: parseInt(params.get("expires_in") || "0"), - refresh_token: params.get("refresh_token"), - token_type: params.get("token_type"), - provider_token: params.get("provider_token"), - code: params.get("code"), - }; - }; + access_token: params.get('access_token'), + expires_in: parseInt(params.get('expires_in') || '0'), + refresh_token: params.get('refresh_token'), + token_type: params.get('token_type'), + provider_token: params.get('provider_token'), + code: params.get('code'), + } + } async function onSignInButtonPress() { - console.debug('onSignInButtonPress - start'); + console.debug('onSignInButtonPress - start') const res = await supabase.auth.signInWithOAuth({ - provider: "google", + provider: 'google', options: { redirectTo: `${expo.scheme}://google-auth`, - queryParams: { prompt: "consent" }, + queryParams: { prompt: 'consent' }, skipBrowserRedirect: true, }, - }); + }) - const googleOAuthUrl = res.data.url; + const googleOAuthUrl = res.data.url if (!googleOAuthUrl) { - console.error("no oauth url found!"); - return; + console.error('no oauth url found!') + return } const result = await WebBrowser.openAuthSessionAsync( googleOAuthUrl, `${expo.scheme}://google-auth`, - { showInRecents: true }, + { showInRecents: true } ).catch((err) => { - console.error('onSignInButtonPress - openAuthSessionAsync - error', { err }); - console.log(err); - }); + console.error('onSignInButtonPress - openAuthSessionAsync - error', { err }) + console.log(err) + }) - console.debug('onSignInButtonPress - openAuthSessionAsync - result', { result }); + console.debug('onSignInButtonPress - openAuthSessionAsync - result', { result }) - if (result && result.type === "success") { - console.debug('onSignInButtonPress - openAuthSessionAsync - success'); - const params = extractParamsFromUrl(result.url); - console.debug('onSignInButtonPress - openAuthSessionAsync - success', { params }); + if (result && result.type === 'success') { + console.debug('onSignInButtonPress - openAuthSessionAsync - success') + const params = extractParamsFromUrl(result.url) + console.debug('onSignInButtonPress - openAuthSessionAsync - success', { params }) if (params.access_token && params.refresh_token) { - console.debug('onSignInButtonPress - setSession'); + console.debug('onSignInButtonPress - setSession') const { data, error } = await supabase.auth.setSession({ access_token: params.access_token, refresh_token: params.refresh_token, - }); - console.debug('onSignInButtonPress - setSession - success', { data, error }); - return; + }) + console.debug('onSignInButtonPress - setSession - success', { data, error }) + return } else { - console.error('onSignInButtonPress - setSession - failed'); + console.error('onSignInButtonPress - setSession - failed') // sign in/up failed } } else { - console.error('onSignInButtonPress - openAuthSessionAsync - failed'); + console.error('onSignInButtonPress - openAuthSessionAsync - failed') } } // to warm up the browser useEffect(() => { - WebBrowser.warmUpAsync(); + WebBrowser.warmUpAsync() return () => { - WebBrowser.coolDownAsync(); - }; - }, []); + WebBrowser.coolDownAsync() + } + }, []) return ( - ); + ) } diff --git a/examples/auth/expo-social-auth/components/social-auth-buttons/google/google-sign-in-button.web.tsx b/examples/auth/expo-social-auth/components/social-auth-buttons/google/google-sign-in-button.web.tsx index 36d60d9be2c..1e446d9b927 100644 --- a/examples/auth/expo-social-auth/components/social-auth-buttons/google/google-sign-in-button.web.tsx +++ b/examples/auth/expo-social-auth/components/social-auth-buttons/google/google-sign-in-button.web.tsx @@ -1,60 +1,60 @@ -import { supabase } from '@/lib/supabase'; -import { CredentialResponse, GoogleLogin, GoogleOAuthProvider } from '@react-oauth/google'; -import { SignInWithIdTokenCredentials } from '@supabase/supabase-js'; -import { useEffect, useState } from 'react'; +import { supabase } from '@/lib/supabase' +import { CredentialResponse, GoogleLogin, GoogleOAuthProvider } from '@react-oauth/google' +import { SignInWithIdTokenCredentials } from '@supabase/supabase-js' +import { useEffect, useState } from 'react' -import 'react-native-get-random-values'; +import 'react-native-get-random-values' export default function GoogleSignInButton() { - // Generate secure, random values for state and nonce - const [nonce, setNonce] = useState(''); - const [sha256Nonce, setSha256Nonce] = useState(''); + const [nonce, setNonce] = useState('') + const [sha256Nonce, setSha256Nonce] = useState('') async function onGoogleButtonSuccess(authRequestResponse: CredentialResponse) { - console.debug('Google sign in successful:', { authRequestResponse }); + console.debug('Google sign in successful:', { authRequestResponse }) if (authRequestResponse.clientId && authRequestResponse.credential) { const signInWithIdTokenCredentials: SignInWithIdTokenCredentials = { provider: 'google', token: authRequestResponse.credential, nonce: nonce, - }; + } - const { data, error } = await supabase.auth.signInWithIdToken(signInWithIdTokenCredentials); + const { data, error } = await supabase.auth.signInWithIdToken(signInWithIdTokenCredentials) if (error) { - console.error('Error signing in with Google:', error); + console.error('Error signing in with Google:', error) } if (data) { - console.log('Google sign in successful:', data); + console.log('Google sign in successful:', data) } } } function onGoogleButtonFailure() { - console.error('Error signing in with Google'); + console.error('Error signing in with Google') } useEffect(() => { function generateNonce(): string { - const array = new Uint32Array(1); - window.crypto.getRandomValues(array); - return array[0].toString(); + const array = new Uint32Array(1) + window.crypto.getRandomValues(array) + return array[0].toString() } async function generateSha256Nonce(nonce: string): Promise { - const buffer = await window.crypto.subtle.digest('sha-256', new TextEncoder().encode(nonce)); - const array = Array.from(new Uint8Array(buffer)); - return array.map(b => b.toString(16).padStart(2, '0')).join(''); + const buffer = await window.crypto.subtle.digest('sha-256', new TextEncoder().encode(nonce)) + const array = Array.from(new Uint8Array(buffer)) + return array.map((b) => b.toString(16).padStart(2, '0')).join('') } - let nonce = generateNonce(); - setNonce(nonce); + let nonce = generateNonce() + setNonce(nonce) - generateSha256Nonce(nonce) - .then((sha256Nonce) => { setSha256Nonce(sha256Nonce) }); - }, []); + generateSha256Nonce(nonce).then((sha256Nonce) => { + setSha256Nonce(sha256Nonce) + }) + }, []) return ( - ); + ) } diff --git a/examples/auth/expo-social-auth/components/themed-text.tsx b/examples/auth/expo-social-auth/components/themed-text.tsx index f16b689b1b7..a6e900f0623 100644 --- a/examples/auth/expo-social-auth/components/themed-text.tsx +++ b/examples/auth/expo-social-auth/components/themed-text.tsx @@ -1,13 +1,13 @@ -import { Text, type TextProps, StyleSheet } from 'react-native'; +import { Text, type TextProps, StyleSheet } from 'react-native' -import { useThemeColor } from '@/hooks/use-theme-color'; -import { Fonts } from '@/constants/theme'; +import { useThemeColor } from '@/hooks/use-theme-color' +import { Fonts } from '@/constants/theme' export type ThemedTextProps = TextProps & { - lightColor?: string; - darkColor?: string; - type?: 'default' | 'title' | 'defaultSemiBold' | 'subtitle' | 'link'; -}; + lightColor?: string + darkColor?: string + type?: 'default' | 'title' | 'defaultSemiBold' | 'subtitle' | 'link' +} export function ThemedText({ style, @@ -16,7 +16,7 @@ export function ThemedText({ type = 'default', ...rest }: ThemedTextProps) { - const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text'); + const color = useThemeColor({ light: lightColor, dark: darkColor }, 'text') return ( - ); + ) } const styles = StyleSheet.create({ @@ -58,4 +58,4 @@ const styles = StyleSheet.create({ fontSize: 16, color: '#0a7ea4', }, -}); +}) diff --git a/examples/auth/expo-social-auth/components/themed-view.tsx b/examples/auth/expo-social-auth/components/themed-view.tsx index 6f181d826ea..fe24772c1c0 100644 --- a/examples/auth/expo-social-auth/components/themed-view.tsx +++ b/examples/auth/expo-social-auth/components/themed-view.tsx @@ -1,14 +1,14 @@ -import { View, type ViewProps } from 'react-native'; +import { View, type ViewProps } from 'react-native' -import { useThemeColor } from '@/hooks/use-theme-color'; +import { useThemeColor } from '@/hooks/use-theme-color' export type ThemedViewProps = ViewProps & { - lightColor?: string; - darkColor?: string; -}; + lightColor?: string + darkColor?: string +} export function ThemedView({ style, lightColor, darkColor, ...otherProps }: ThemedViewProps) { - const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background'); + const backgroundColor = useThemeColor({ light: lightColor, dark: darkColor }, 'background') - return ; + return } diff --git a/examples/auth/expo-social-auth/constants/theme.ts b/examples/auth/expo-social-auth/constants/theme.ts index f06facd2f6e..97686da8b7a 100644 --- a/examples/auth/expo-social-auth/constants/theme.ts +++ b/examples/auth/expo-social-auth/constants/theme.ts @@ -3,10 +3,10 @@ * There are many other ways to style your app. For example, [Nativewind](https://www.nativewind.dev/), [Tamagui](https://tamagui.dev/), [unistyles](https://reactnativeunistyles.vercel.app), etc. */ -import { Platform } from 'react-native'; +import { Platform } from 'react-native' -const tintColorLight = '#0a7ea4'; -const tintColorDark = '#fff'; +const tintColorLight = '#0a7ea4' +const tintColorDark = '#fff' export const Colors = { light: { @@ -25,7 +25,7 @@ export const Colors = { tabIconDefault: '#9BA1A6', tabIconSelected: tintColorDark, }, -}; +} export const Fonts = Platform.select({ ios: { @@ -50,4 +50,4 @@ export const Fonts = Platform.select({ rounded: "'SF Pro Rounded', 'Hiragino Maru Gothic ProN', Meiryo, 'MS PGothic', sans-serif", mono: "SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace", }, -}); +}) diff --git a/examples/auth/expo-social-auth/eslint.config.js b/examples/auth/expo-social-auth/eslint.config.js index 5025da683d6..ea589baa12f 100644 --- a/examples/auth/expo-social-auth/eslint.config.js +++ b/examples/auth/expo-social-auth/eslint.config.js @@ -1,10 +1,10 @@ // https://docs.expo.dev/guides/using-eslint/ -const { defineConfig } = require('eslint/config'); -const expoConfig = require('eslint-config-expo/flat'); +const { defineConfig } = require('eslint/config') +const expoConfig = require('eslint-config-expo/flat') module.exports = defineConfig([ expoConfig, { ignores: ['dist/*'], }, -]); +]) diff --git a/examples/auth/expo-social-auth/hooks/use-color-scheme.ts b/examples/auth/expo-social-auth/hooks/use-color-scheme.ts index 17e3c63e1ac..b370337ae82 100644 --- a/examples/auth/expo-social-auth/hooks/use-color-scheme.ts +++ b/examples/auth/expo-social-auth/hooks/use-color-scheme.ts @@ -1 +1 @@ -export { useColorScheme } from 'react-native'; +export { useColorScheme } from 'react-native' diff --git a/examples/auth/expo-social-auth/hooks/use-color-scheme.web.ts b/examples/auth/expo-social-auth/hooks/use-color-scheme.web.ts index 7eb1c1b7071..2a690de8e92 100644 --- a/examples/auth/expo-social-auth/hooks/use-color-scheme.web.ts +++ b/examples/auth/expo-social-auth/hooks/use-color-scheme.web.ts @@ -1,21 +1,21 @@ -import { useEffect, useState } from 'react'; -import { useColorScheme as useRNColorScheme } from 'react-native'; +import { useEffect, useState } from 'react' +import { useColorScheme as useRNColorScheme } from 'react-native' /** * To support static rendering, this value needs to be re-calculated on the client side for web */ export function useColorScheme() { - const [hasHydrated, setHasHydrated] = useState(false); + const [hasHydrated, setHasHydrated] = useState(false) useEffect(() => { - setHasHydrated(true); - }, []); + setHasHydrated(true) + }, []) - const colorScheme = useRNColorScheme(); + const colorScheme = useRNColorScheme() if (hasHydrated) { - return colorScheme; + return colorScheme } - return 'light'; + return 'light' } diff --git a/examples/auth/expo-social-auth/hooks/use-theme-color.ts b/examples/auth/expo-social-auth/hooks/use-theme-color.ts index 0cbc3a6e6f9..d0137b2a5ea 100644 --- a/examples/auth/expo-social-auth/hooks/use-theme-color.ts +++ b/examples/auth/expo-social-auth/hooks/use-theme-color.ts @@ -3,19 +3,19 @@ * https://docs.expo.dev/guides/color-schemes/ */ -import { Colors } from '@/constants/theme'; -import { useColorScheme } from '@/hooks/use-color-scheme'; +import { Colors } from '@/constants/theme' +import { useColorScheme } from '@/hooks/use-color-scheme' export function useThemeColor( props: { light?: string; dark?: string }, colorName: keyof typeof Colors.light & keyof typeof Colors.dark ) { - const theme = useColorScheme() ?? 'light'; - const colorFromProps = props[theme]; + const theme = useColorScheme() ?? 'light' + const colorFromProps = props[theme] if (colorFromProps) { - return colorFromProps; + return colorFromProps } else { - return Colors[theme][colorName]; + return Colors[theme][colorName] } } diff --git a/examples/auth/expo-social-auth/lib/supabase.ts b/examples/auth/expo-social-auth/lib/supabase.ts index 0f2096b9871..a207641a2dd 100644 --- a/examples/auth/expo-social-auth/lib/supabase.ts +++ b/examples/auth/expo-social-auth/lib/supabase.ts @@ -1,21 +1,23 @@ -import { createClient } from '@supabase/supabase-js'; -import { deleteItemAsync, getItemAsync, setItemAsync } from 'expo-secure-store'; +import { createClient } from '@supabase/supabase-js' +import { deleteItemAsync, getItemAsync, setItemAsync } from 'expo-secure-store' const ExpoSecureStoreAdapter = { getItem: (key: string) => { - console.debug("getItem", { key, getItemAsync }) + console.debug('getItem', { key, getItemAsync }) return getItemAsync(key) }, setItem: (key: string, value: string) => { if (value.length > 2048) { - console.warn('Value being stored in SecureStore is larger than 2048 bytes and it may not be stored successfully. In a future SDK version, this call may throw an error.') + console.warn( + 'Value being stored in SecureStore is larger than 2048 bytes and it may not be stored successfully. In a future SDK version, this call may throw an error.' + ) } return setItemAsync(key, value) }, removeItem: (key: string) => { return deleteItemAsync(key) }, -}; +} export const supabase = createClient( process.env.EXPO_PUBLIC_SUPABASE_URL ?? '', @@ -27,5 +29,5 @@ export const supabase = createClient( persistSession: true, detectSessionInUrl: false, }, - }, -); + } +) diff --git a/examples/auth/expo-social-auth/lib/supabase.web.ts b/examples/auth/expo-social-auth/lib/supabase.web.ts index 882c2b4b21d..e7054507ed1 100644 --- a/examples/auth/expo-social-auth/lib/supabase.web.ts +++ b/examples/auth/expo-social-auth/lib/supabase.web.ts @@ -1,24 +1,24 @@ -import AsyncStorage from '@react-native-async-storage/async-storage'; -import { createClient } from '@supabase/supabase-js'; -import 'react-native-url-polyfill/auto'; +import AsyncStorage from '@react-native-async-storage/async-storage' +import { createClient } from '@supabase/supabase-js' +import 'react-native-url-polyfill/auto' -const isSSR = typeof window === 'undefined'; +const isSSR = typeof window === 'undefined' const ExpoWebSecureStoreAdapter = { getItem: (key: string) => { - if (isSSR) return null; - console.debug("getItem", { key }) + if (isSSR) return null + console.debug('getItem', { key }) return AsyncStorage.getItem(key) }, setItem: (key: string, value: string) => { - if (isSSR) return; + if (isSSR) return return AsyncStorage.setItem(key, value) }, removeItem: (key: string) => { - if (isSSR) return; + if (isSSR) return return AsyncStorage.removeItem(key) }, -}; +} export const supabase = createClient( process.env.EXPO_PUBLIC_SUPABASE_URL ?? '', @@ -30,5 +30,5 @@ export const supabase = createClient( persistSession: true, detectSessionInUrl: false, }, - }, -); + } +) diff --git a/examples/auth/expo-social-auth/package-lock.json b/examples/auth/expo-social-auth/package-lock.json index 05c0dfd77e4..958a5a7d6f9 100644 --- a/examples/auth/expo-social-auth/package-lock.json +++ b/examples/auth/expo-social-auth/package-lock.json @@ -4231,219 +4231,157 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm-eabi/-/resolver-binding-android-arm-eabi-1.11.1.tgz", "integrity": "sha512-ppLRUgHVaGRWUx0R0Ut06Mjo9gBaBkg3v/8AxusGLhsIotbBLuRk51rAzqLC8gq6NyyAojEXglNjzf6R948DNw==", - "cpu": [ - "arm" - ], + "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "android" - ] + "os": ["android"] }, "node_modules/@unrs/resolver-binding-android-arm64": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-android-arm64/-/resolver-binding-android-arm64-1.11.1.tgz", "integrity": "sha512-lCxkVtb4wp1v+EoN+HjIG9cIIzPkX5OtM03pQYkG+U5O/wL53LC4QbIeazgiKqluGeVEeBlZahHalCaBvU1a2g==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "android" - ] + "os": ["android"] }, "node_modules/@unrs/resolver-binding-darwin-arm64": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-arm64/-/resolver-binding-darwin-arm64-1.11.1.tgz", "integrity": "sha512-gPVA1UjRu1Y/IsB/dQEsp2V1pm44Of6+LWvbLc9SDk1c2KhhDRDBUkQCYVWe6f26uJb3fOK8saWMgtX8IrMk3g==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "darwin" - ] + "os": ["darwin"] }, "node_modules/@unrs/resolver-binding-darwin-x64": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-darwin-x64/-/resolver-binding-darwin-x64-1.11.1.tgz", "integrity": "sha512-cFzP7rWKd3lZaCsDze07QX1SC24lO8mPty9vdP+YVa3MGdVgPmFc59317b2ioXtgCMKGiCLxJ4HQs62oz6GfRQ==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "darwin" - ] + "os": ["darwin"] }, "node_modules/@unrs/resolver-binding-freebsd-x64": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-freebsd-x64/-/resolver-binding-freebsd-x64-1.11.1.tgz", "integrity": "sha512-fqtGgak3zX4DCB6PFpsH5+Kmt/8CIi4Bry4rb1ho6Av2QHTREM+47y282Uqiu3ZRF5IQioJQ5qWRV6jduA+iGw==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "freebsd" - ] + "os": ["freebsd"] }, "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-gnueabihf/-/resolver-binding-linux-arm-gnueabihf-1.11.1.tgz", "integrity": "sha512-u92mvlcYtp9MRKmP+ZvMmtPN34+/3lMHlyMj7wXJDeXxuM0Vgzz0+PPJNsro1m3IZPYChIkn944wW8TYgGKFHw==", - "cpu": [ - "arm" - ], + "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm-musleabihf/-/resolver-binding-linux-arm-musleabihf-1.11.1.tgz", "integrity": "sha512-cINaoY2z7LVCrfHkIcmvj7osTOtm6VVT16b5oQdS4beibX2SYBwgYLmqhBjA1t51CarSaBuX5YNsWLjsqfW5Cw==", - "cpu": [ - "arm" - ], + "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-gnu/-/resolver-binding-linux-arm64-gnu-1.11.1.tgz", "integrity": "sha512-34gw7PjDGB9JgePJEmhEqBhWvCiiWCuXsL9hYphDF7crW7UgI05gyBAi6MF58uGcMOiOqSJ2ybEeCvHcq0BCmQ==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-linux-arm64-musl": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-arm64-musl/-/resolver-binding-linux-arm64-musl-1.11.1.tgz", "integrity": "sha512-RyMIx6Uf53hhOtJDIamSbTskA99sPHS96wxVE/bJtePJJtpdKGXO1wY90oRdXuYOGOTuqjT8ACccMc4K6QmT3w==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-ppc64-gnu/-/resolver-binding-linux-ppc64-gnu-1.11.1.tgz", "integrity": "sha512-D8Vae74A4/a+mZH0FbOkFJL9DSK2R6TFPC9M+jCWYia/q2einCubX10pecpDiTmkJVUH+y8K3BZClycD8nCShA==", - "cpu": [ - "ppc64" - ], + "cpu": ["ppc64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-gnu/-/resolver-binding-linux-riscv64-gnu-1.11.1.tgz", "integrity": "sha512-frxL4OrzOWVVsOc96+V3aqTIQl1O2TjgExV4EKgRY09AJ9leZpEg8Ak9phadbuX0BA4k8U5qtvMSQQGGmaJqcQ==", - "cpu": [ - "riscv64" - ], + "cpu": ["riscv64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-riscv64-musl/-/resolver-binding-linux-riscv64-musl-1.11.1.tgz", "integrity": "sha512-mJ5vuDaIZ+l/acv01sHoXfpnyrNKOk/3aDoEdLO/Xtn9HuZlDD6jKxHlkN8ZhWyLJsRBxfv9GYM2utQ1SChKew==", - "cpu": [ - "riscv64" - ], + "cpu": ["riscv64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-s390x-gnu/-/resolver-binding-linux-s390x-gnu-1.11.1.tgz", "integrity": "sha512-kELo8ebBVtb9sA7rMe1Cph4QHreByhaZ2QEADd9NzIQsYNQpt9UkM9iqr2lhGr5afh885d/cB5QeTXSbZHTYPg==", - "cpu": [ - "s390x" - ], + "cpu": ["s390x"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-linux-x64-gnu": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-gnu/-/resolver-binding-linux-x64-gnu-1.11.1.tgz", "integrity": "sha512-C3ZAHugKgovV5YvAMsxhq0gtXuwESUKc5MhEtjBpLoHPLYM+iuwSj3lflFwK3DPm68660rZ7G8BMcwSro7hD5w==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-linux-x64-musl": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-linux-x64-musl/-/resolver-binding-linux-x64-musl-1.11.1.tgz", "integrity": "sha512-rV0YSoyhK2nZ4vEswT/QwqzqQXw5I6CjoaYMOX0TqBlWhojUf8P94mvI7nuJTeaCkkds3QE4+zS8Ko+GdXuZtA==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@unrs/resolver-binding-wasm32-wasi": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-wasm32-wasi/-/resolver-binding-wasm32-wasi-1.11.1.tgz", "integrity": "sha512-5u4RkfxJm+Ng7IWgkzi3qrFOvLvQYnPBmjmZQ8+szTK/b31fQCnleNl1GgEt7nIsZRIf5PLhPwT0WM+q45x/UQ==", - "cpu": [ - "wasm32" - ], + "cpu": ["wasm32"], "dev": true, "license": "MIT", "optional": true, @@ -4458,43 +4396,31 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-arm64-msvc/-/resolver-binding-win32-arm64-msvc-1.11.1.tgz", "integrity": "sha512-nRcz5Il4ln0kMhfL8S3hLkxI85BXs3o8EYoattsJNdsX4YUU89iOkVn7g0VHSRxFuVMdM4Q1jEpIId1Ihim/Uw==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "os": ["win32"] }, "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-ia32-msvc/-/resolver-binding-win32-ia32-msvc-1.11.1.tgz", "integrity": "sha512-DCEI6t5i1NmAZp6pFonpD5m7i6aFrpofcp4LA2i8IIq60Jyo28hamKBxNrZcyOwVOZkgsRp9O2sXWBWP8MnvIQ==", - "cpu": [ - "ia32" - ], + "cpu": ["ia32"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "os": ["win32"] }, "node_modules/@unrs/resolver-binding-win32-x64-msvc": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@unrs/resolver-binding-win32-x64-msvc/-/resolver-binding-win32-x64-msvc-1.11.1.tgz", "integrity": "sha512-lrW200hZdbfRtztbygyaq/6jP6AKE8qQN2KvPcJ+x7wiD038YtnYtZ82IMNJ69GJibV7bwL3y9FgK+5w/pYt6g==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "os": ["win32"] }, "node_modules/@urql/core": { "version": "5.2.0", @@ -7304,9 +7230,7 @@ "hasInstallScript": true, "license": "MIT", "optional": true, - "os": [ - "darwin" - ], + "os": ["darwin"], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -8811,14 +8735,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.31.1.tgz", "integrity": "sha512-HXJF3x8w9nQ4jbXRiNppBCqeZPIAfUo8zE/kOEGbW5NZvGc/K7nMxbhIr+YlFlHW5mpbg/YFPdbnCh1wAXCKFg==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "license": "MPL-2.0", "optional": true, - "os": [ - "android" - ], + "os": ["android"], "engines": { "node": ">= 12.0.0" }, @@ -8831,14 +8751,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.31.1.tgz", "integrity": "sha512-02uTEqf3vIfNMq3h/z2cJfcOXnQ0GRwQrkmPafhueLb2h7mqEidiCzkE4gBMEH65abHRiQvhdcQ+aP0D0g67sg==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "license": "MPL-2.0", "optional": true, - "os": [ - "darwin" - ], + "os": ["darwin"], "engines": { "node": ">= 12.0.0" }, @@ -8851,14 +8767,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.31.1.tgz", "integrity": "sha512-1ObhyoCY+tGxtsz1lSx5NXCj3nirk0Y0kB/g8B8DT+sSx4G9djitg9ejFnjb3gJNWo7qXH4DIy2SUHvpoFwfTA==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "license": "MPL-2.0", "optional": true, - "os": [ - "darwin" - ], + "os": ["darwin"], "engines": { "node": ">= 12.0.0" }, @@ -8871,14 +8783,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.31.1.tgz", "integrity": "sha512-1RINmQKAItO6ISxYgPwszQE1BrsVU5aB45ho6O42mu96UiZBxEXsuQ7cJW4zs4CEodPUioj/QrXW1r9pLUM74A==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "license": "MPL-2.0", "optional": true, - "os": [ - "freebsd" - ], + "os": ["freebsd"], "engines": { "node": ">= 12.0.0" }, @@ -8891,14 +8799,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.31.1.tgz", "integrity": "sha512-OOCm2//MZJ87CdDK62rZIu+aw9gBv4azMJuA8/KB74wmfS3lnC4yoPHm0uXZ/dvNNHmnZnB8XLAZzObeG0nS1g==", - "cpu": [ - "arm" - ], + "cpu": ["arm"], "license": "MPL-2.0", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">= 12.0.0" }, @@ -8911,14 +8815,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.31.1.tgz", "integrity": "sha512-WKyLWztD71rTnou4xAD5kQT+982wvca7E6QoLpoawZ1gP9JM0GJj4Tp5jMUh9B3AitHbRZ2/H3W5xQmdEOUlLg==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "license": "MPL-2.0", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">= 12.0.0" }, @@ -8931,14 +8831,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.31.1.tgz", "integrity": "sha512-mVZ7Pg2zIbe3XlNbZJdjs86YViQFoJSpc41CbVmKBPiGmC4YrfeOyz65ms2qpAobVd7WQsbW4PdsSJEMymyIMg==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "license": "MPL-2.0", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">= 12.0.0" }, @@ -8951,14 +8847,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.31.1.tgz", "integrity": "sha512-xGlFWRMl+0KvUhgySdIaReQdB4FNudfUTARn7q0hh/V67PVGCs3ADFjw+6++kG1RNd0zdGRlEKa+T13/tQjPMA==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "license": "MPL-2.0", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">= 12.0.0" }, @@ -8971,14 +8863,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.31.1.tgz", "integrity": "sha512-eowF8PrKHw9LpoZii5tdZwnBcYDxRw2rRCyvAXLi34iyeYfqCQNA9rmUM0ce62NlPhCvof1+9ivRaTY6pSKDaA==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "license": "MPL-2.0", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">= 12.0.0" }, @@ -8991,14 +8879,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.31.1.tgz", "integrity": "sha512-aJReEbSEQzx1uBlQizAOBSjcmr9dCdL3XuC/6HLXAxmtErsj2ICo5yYggg1qOODQMtnjNQv2UHb9NpOuFtYe4w==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "license": "MPL-2.0", "optional": true, - "os": [ - "win32" - ], + "os": ["win32"], "engines": { "node": ">= 12.0.0" }, @@ -9011,14 +8895,10 @@ "version": "1.31.1", "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.31.1.tgz", "integrity": "sha512-I9aiFrbd7oYHwlnQDqr1Roz+fTz61oDDJX7n9tYF9FJymH1cIN1DtKw3iYt6b8WZgEjoNwVSncwF4wx/ZedMhw==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "license": "MPL-2.0", "optional": true, - "os": [ - "win32" - ], + "os": ["win32"], "engines": { "node": ">= 12.0.0" }, @@ -12897,10 +12777,7 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-13.0.0.tgz", "integrity": "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w==", "dev": true, - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], + "funding": ["https://github.com/sponsors/broofa", "https://github.com/sponsors/ctavan"], "license": "MIT", "bin": { "uuid": "dist-node/bin/uuid" diff --git a/examples/auth/expo-social-auth/providers/auth-provider.tsx b/examples/auth/expo-social-auth/providers/auth-provider.tsx index f351dd2f595..760424dae96 100644 --- a/examples/auth/expo-social-auth/providers/auth-provider.tsx +++ b/examples/auth/expo-social-auth/providers/auth-provider.tsx @@ -44,11 +44,7 @@ export default function AuthProvider({ children }: PropsWithChildren) { setIsLoading(true) if (claims) { - const { data } = await supabase - .from('profiles') - .select('*') - .eq('id', claims.sub) - .single() + const { data } = await supabase.from('profiles').select('*').eq('id', claims.sub).single() setProfile(data) } else { diff --git a/examples/auth/expo-social-auth/scripts/reset-project.js b/examples/auth/expo-social-auth/scripts/reset-project.js index 51dff15acba..6f6763a21e1 100755 --- a/examples/auth/expo-social-auth/scripts/reset-project.js +++ b/examples/auth/expo-social-auth/scripts/reset-project.js @@ -6,15 +6,15 @@ * You can remove the `reset-project` script from package.json and safely delete this file after running it. */ -const fs = require("fs"); -const path = require("path"); -const readline = require("readline"); +const fs = require('fs') +const path = require('path') +const readline = require('readline') -const root = process.cwd(); -const oldDirs = ["app", "components", "hooks", "constants", "scripts"]; -const exampleDir = "app-example"; -const newAppDir = "app"; -const exampleDirPath = path.join(root, exampleDir); +const root = process.cwd() +const oldDirs = ['app', 'components', 'hooks', 'constants', 'scripts'] +const exampleDir = 'app-example' +const newAppDir = 'app' +const exampleDirPath = path.join(root, exampleDir) const indexContent = `import { Text, View } from "react-native"; @@ -31,82 +31,82 @@ export default function Index() { ); } -`; +` const layoutContent = `import { Stack } from "expo-router"; export default function RootLayout() { return ; } -`; +` const rl = readline.createInterface({ input: process.stdin, output: process.stdout, -}); +}) const moveDirectories = async (userInput) => { try { - if (userInput === "y") { + if (userInput === 'y') { // Create the app-example directory - await fs.promises.mkdir(exampleDirPath, { recursive: true }); - console.log(`📁 /${exampleDir} directory created.`); + await fs.promises.mkdir(exampleDirPath, { recursive: true }) + console.log(`📁 /${exampleDir} directory created.`) } // Move old directories to new app-example directory or delete them for (const dir of oldDirs) { - const oldDirPath = path.join(root, dir); + const oldDirPath = path.join(root, dir) if (fs.existsSync(oldDirPath)) { - if (userInput === "y") { - const newDirPath = path.join(root, exampleDir, dir); - await fs.promises.rename(oldDirPath, newDirPath); - console.log(`➡️ /${dir} moved to /${exampleDir}/${dir}.`); + if (userInput === 'y') { + const newDirPath = path.join(root, exampleDir, dir) + await fs.promises.rename(oldDirPath, newDirPath) + console.log(`➡️ /${dir} moved to /${exampleDir}/${dir}.`) } else { - await fs.promises.rm(oldDirPath, { recursive: true, force: true }); - console.log(`❌ /${dir} deleted.`); + await fs.promises.rm(oldDirPath, { recursive: true, force: true }) + console.log(`❌ /${dir} deleted.`) } } else { - console.log(`➡️ /${dir} does not exist, skipping.`); + console.log(`➡️ /${dir} does not exist, skipping.`) } } // Create new /app directory - const newAppDirPath = path.join(root, newAppDir); - await fs.promises.mkdir(newAppDirPath, { recursive: true }); - console.log("\n📁 New /app directory created."); + const newAppDirPath = path.join(root, newAppDir) + await fs.promises.mkdir(newAppDirPath, { recursive: true }) + console.log('\n📁 New /app directory created.') // Create index.tsx - const indexPath = path.join(newAppDirPath, "index.tsx"); - await fs.promises.writeFile(indexPath, indexContent); - console.log("📄 app/index.tsx created."); + const indexPath = path.join(newAppDirPath, 'index.tsx') + await fs.promises.writeFile(indexPath, indexContent) + console.log('📄 app/index.tsx created.') // Create _layout.tsx - const layoutPath = path.join(newAppDirPath, "_layout.tsx"); - await fs.promises.writeFile(layoutPath, layoutContent); - console.log("📄 app/_layout.tsx created."); + const layoutPath = path.join(newAppDirPath, '_layout.tsx') + await fs.promises.writeFile(layoutPath, layoutContent) + console.log('📄 app/_layout.tsx created.') - console.log("\n✅ Project reset complete. Next steps:"); + console.log('\n✅ Project reset complete. Next steps:') console.log( `1. Run \`npx expo start\` to start a development server.\n2. Edit app/index.tsx to edit the main screen.${ - userInput === "y" + userInput === 'y' ? `\n3. Delete the /${exampleDir} directory when you're done referencing it.` - : "" + : '' }` - ); + ) } catch (error) { - console.error(`❌ Error during script execution: ${error.message}`); + console.error(`❌ Error during script execution: ${error.message}`) } -}; +} rl.question( - "Do you want to move existing files to /app-example instead of deleting them? (Y/n): ", + 'Do you want to move existing files to /app-example instead of deleting them? (Y/n): ', (answer) => { - const userInput = answer.trim().toLowerCase() || "y"; - if (userInput === "y" || userInput === "n") { - moveDirectories(userInput).finally(() => rl.close()); + const userInput = answer.trim().toLowerCase() || 'y' + if (userInput === 'y' || userInput === 'n') { + moveDirectories(userInput).finally(() => rl.close()) } else { - console.log("❌ Invalid input. Please enter 'Y' or 'N'."); - rl.close(); + console.log("❌ Invalid input. Please enter 'Y' or 'N'.") + rl.close() } } -); +) diff --git a/examples/auth/expo-social-auth/tsconfig.json b/examples/auth/expo-social-auth/tsconfig.json index 909e9010867..ce27fee398f 100644 --- a/examples/auth/expo-social-auth/tsconfig.json +++ b/examples/auth/expo-social-auth/tsconfig.json @@ -3,15 +3,8 @@ "compilerOptions": { "strict": true, "paths": { - "@/*": [ - "./*" - ] + "@/*": ["./*"] } }, - "include": [ - "**/*.ts", - "**/*.tsx", - ".expo/types/**/*.ts", - "expo-env.d.ts" - ] + "include": ["**/*.ts", "**/*.tsx", ".expo/types/**/*.ts", "expo-env.d.ts"] } diff --git a/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d36b1fab2d9..e882ab98894 100644 --- a/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1,122 @@ { - "images" : [ + "images": [ { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" + "size": "20x20", + "idiom": "iphone", + "filename": "Icon-App-20x20@2x.png", + "scale": "2x" }, { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" + "size": "20x20", + "idiom": "iphone", + "filename": "Icon-App-20x20@3x.png", + "scale": "3x" }, { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" + "size": "29x29", + "idiom": "iphone", + "filename": "Icon-App-29x29@1x.png", + "scale": "1x" }, { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" + "size": "29x29", + "idiom": "iphone", + "filename": "Icon-App-29x29@2x.png", + "scale": "2x" }, { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" + "size": "29x29", + "idiom": "iphone", + "filename": "Icon-App-29x29@3x.png", + "scale": "3x" }, { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" + "size": "40x40", + "idiom": "iphone", + "filename": "Icon-App-40x40@2x.png", + "scale": "2x" }, { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" + "size": "40x40", + "idiom": "iphone", + "filename": "Icon-App-40x40@3x.png", + "scale": "3x" }, { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" + "size": "60x60", + "idiom": "iphone", + "filename": "Icon-App-60x60@2x.png", + "scale": "2x" }, { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" + "size": "60x60", + "idiom": "iphone", + "filename": "Icon-App-60x60@3x.png", + "scale": "3x" }, { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" + "size": "20x20", + "idiom": "ipad", + "filename": "Icon-App-20x20@1x.png", + "scale": "1x" }, { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" + "size": "20x20", + "idiom": "ipad", + "filename": "Icon-App-20x20@2x.png", + "scale": "2x" }, { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" + "size": "29x29", + "idiom": "ipad", + "filename": "Icon-App-29x29@1x.png", + "scale": "1x" }, { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" + "size": "29x29", + "idiom": "ipad", + "filename": "Icon-App-29x29@2x.png", + "scale": "2x" }, { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" + "size": "40x40", + "idiom": "ipad", + "filename": "Icon-App-40x40@1x.png", + "scale": "1x" }, { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" + "size": "40x40", + "idiom": "ipad", + "filename": "Icon-App-40x40@2x.png", + "scale": "2x" }, { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" + "size": "76x76", + "idiom": "ipad", + "filename": "Icon-App-76x76@1x.png", + "scale": "1x" }, { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" + "size": "76x76", + "idiom": "ipad", + "filename": "Icon-App-76x76@2x.png", + "scale": "2x" }, { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" + "size": "83.5x83.5", + "idiom": "ipad", + "filename": "Icon-App-83.5x83.5@2x.png", + "scale": "2x" }, { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" + "size": "1024x1024", + "idiom": "ios-marketing", + "filename": "Icon-App-1024x1024@1x.png", + "scale": "1x" } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" } } diff --git a/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json index 0bedcf2fd46..781d7cdcac0 100644 --- a/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ b/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -1,23 +1,23 @@ { - "images" : [ + "images": [ { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" + "idiom": "universal", + "filename": "LaunchImage.png", + "scale": "1x" }, { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" + "idiom": "universal", + "filename": "LaunchImage@2x.png", + "scale": "2x" }, { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" + "idiom": "universal", + "filename": "LaunchImage@3x.png", + "scale": "3x" } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" } } diff --git a/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md index 89c2725b70f..b5b843ad3b8 100644 --- a/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ b/examples/auth/flutter-mfa/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -2,4 +2,4 @@ You can customize the launch screen with your own desired assets by replacing the image files in this directory. -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. diff --git a/examples/auth/flutter-mfa/web/manifest.json b/examples/auth/flutter-mfa/web/manifest.json index 222e13d6e91..03c5c55da8c 100644 --- a/examples/auth/flutter-mfa/web/manifest.json +++ b/examples/auth/flutter-mfa/web/manifest.json @@ -1,35 +1,35 @@ { - "name": "mfa_app", - "short_name": "mfa_app", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] + "name": "mfa_app", + "short_name": "mfa_app", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] } diff --git a/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index d36b1fab2d9..e882ab98894 100644 --- a/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,122 +1,122 @@ { - "images" : [ + "images": [ { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" + "size": "20x20", + "idiom": "iphone", + "filename": "Icon-App-20x20@2x.png", + "scale": "2x" }, { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" + "size": "20x20", + "idiom": "iphone", + "filename": "Icon-App-20x20@3x.png", + "scale": "3x" }, { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" + "size": "29x29", + "idiom": "iphone", + "filename": "Icon-App-29x29@1x.png", + "scale": "1x" }, { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" + "size": "29x29", + "idiom": "iphone", + "filename": "Icon-App-29x29@2x.png", + "scale": "2x" }, { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" + "size": "29x29", + "idiom": "iphone", + "filename": "Icon-App-29x29@3x.png", + "scale": "3x" }, { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" + "size": "40x40", + "idiom": "iphone", + "filename": "Icon-App-40x40@2x.png", + "scale": "2x" }, { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" + "size": "40x40", + "idiom": "iphone", + "filename": "Icon-App-40x40@3x.png", + "scale": "3x" }, { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" + "size": "60x60", + "idiom": "iphone", + "filename": "Icon-App-60x60@2x.png", + "scale": "2x" }, { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" + "size": "60x60", + "idiom": "iphone", + "filename": "Icon-App-60x60@3x.png", + "scale": "3x" }, { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" + "size": "20x20", + "idiom": "ipad", + "filename": "Icon-App-20x20@1x.png", + "scale": "1x" }, { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" + "size": "20x20", + "idiom": "ipad", + "filename": "Icon-App-20x20@2x.png", + "scale": "2x" }, { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" + "size": "29x29", + "idiom": "ipad", + "filename": "Icon-App-29x29@1x.png", + "scale": "1x" }, { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" + "size": "29x29", + "idiom": "ipad", + "filename": "Icon-App-29x29@2x.png", + "scale": "2x" }, { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" + "size": "40x40", + "idiom": "ipad", + "filename": "Icon-App-40x40@1x.png", + "scale": "1x" }, { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" + "size": "40x40", + "idiom": "ipad", + "filename": "Icon-App-40x40@2x.png", + "scale": "2x" }, { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" + "size": "76x76", + "idiom": "ipad", + "filename": "Icon-App-76x76@1x.png", + "scale": "1x" }, { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" + "size": "76x76", + "idiom": "ipad", + "filename": "Icon-App-76x76@2x.png", + "scale": "2x" }, { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" + "size": "83.5x83.5", + "idiom": "ipad", + "filename": "Icon-App-83.5x83.5@2x.png", + "scale": "2x" }, { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" + "size": "1024x1024", + "idiom": "ios-marketing", + "filename": "Icon-App-1024x1024@1x.png", + "scale": "1x" } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" } } diff --git a/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json index 0bedcf2fd46..781d7cdcac0 100644 --- a/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ b/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -1,23 +1,23 @@ { - "images" : [ + "images": [ { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" + "idiom": "universal", + "filename": "LaunchImage.png", + "scale": "1x" }, { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" + "idiom": "universal", + "filename": "LaunchImage@2x.png", + "scale": "2x" }, { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" + "idiom": "universal", + "filename": "LaunchImage@3x.png", + "scale": "3x" } ], - "info" : { - "version" : 1, - "author" : "xcode" + "info": { + "version": 1, + "author": "xcode" } } diff --git a/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md index 89c2725b70f..b5b843ad3b8 100644 --- a/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ b/examples/auth/flutter-native-google-auth/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -2,4 +2,4 @@ You can customize the launch screen with your own desired assets by replacing the image files in this directory. -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. diff --git a/examples/auth/hono-full/package-lock.json b/examples/auth/hono-full/package-lock.json index 0845eac4371..70d88021ffc 100644 --- a/examples/auth/hono-full/package-lock.json +++ b/examples/auth/hono-full/package-lock.json @@ -22,15 +22,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", - "cpu": [ - "ppc64" - ], + "cpu": ["ppc64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "aix" - ], + "os": ["aix"], "engines": { "node": ">=12" } @@ -39,15 +35,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", - "cpu": [ - "arm" - ], + "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "android" - ], + "os": ["android"], "engines": { "node": ">=12" } @@ -56,15 +48,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "android" - ], + "os": ["android"], "engines": { "node": ">=12" } @@ -73,15 +61,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "android" - ], + "os": ["android"], "engines": { "node": ">=12" } @@ -90,15 +74,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "darwin" - ], + "os": ["darwin"], "engines": { "node": ">=12" } @@ -107,15 +87,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "darwin" - ], + "os": ["darwin"], "engines": { "node": ">=12" } @@ -124,15 +100,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "freebsd" - ], + "os": ["freebsd"], "engines": { "node": ">=12" } @@ -141,15 +113,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "freebsd" - ], + "os": ["freebsd"], "engines": { "node": ">=12" } @@ -158,15 +126,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", - "cpu": [ - "arm" - ], + "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">=12" } @@ -175,15 +139,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">=12" } @@ -192,15 +152,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", - "cpu": [ - "ia32" - ], + "cpu": ["ia32"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">=12" } @@ -209,15 +165,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", - "cpu": [ - "loong64" - ], + "cpu": ["loong64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">=12" } @@ -226,15 +178,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", - "cpu": [ - "mips64el" - ], + "cpu": ["mips64el"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">=12" } @@ -243,15 +191,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", - "cpu": [ - "ppc64" - ], + "cpu": ["ppc64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">=12" } @@ -260,15 +204,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", - "cpu": [ - "riscv64" - ], + "cpu": ["riscv64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">=12" } @@ -277,15 +217,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", - "cpu": [ - "s390x" - ], + "cpu": ["s390x"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">=12" } @@ -294,15 +230,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ], + "os": ["linux"], "engines": { "node": ">=12" } @@ -311,15 +243,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "netbsd" - ], + "os": ["netbsd"], "engines": { "node": ">=12" } @@ -328,15 +256,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "openbsd" - ], + "os": ["openbsd"], "engines": { "node": ">=12" } @@ -345,15 +269,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "sunos" - ], + "os": ["sunos"], "engines": { "node": ">=12" } @@ -362,15 +282,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ], + "os": ["win32"], "engines": { "node": ">=12" } @@ -379,15 +295,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", - "cpu": [ - "ia32" - ], + "cpu": ["ia32"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ], + "os": ["win32"], "engines": { "node": ">=12" } @@ -396,15 +308,11 @@ "version": "0.21.5", "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ], + "os": ["win32"], "engines": { "node": ">=12" } @@ -468,267 +376,191 @@ "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.30.0.tgz", "integrity": "sha512-qFcFto9figFLz2g25DxJ1WWL9+c91fTxnGuwhToCl8BaqDsDYMl/kOnBXAyAqkkzAWimYMSWNPWEjt+ADAHuoQ==", - "cpu": [ - "arm" - ], + "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "android" - ] + "os": ["android"] }, "node_modules/@rollup/rollup-android-arm64": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.30.0.tgz", "integrity": "sha512-vqrQdusvVl7dthqNjWCL043qelBK+gv9v3ZiqdxgaJvmZyIAAXMjeGVSqZynKq69T7062T5VrVTuikKSAAVP6A==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "android" - ] + "os": ["android"] }, "node_modules/@rollup/rollup-darwin-arm64": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.30.0.tgz", "integrity": "sha512-617pd92LhdA9+wpixnzsyhVft3szYiN16aNUMzVkf2N+yAk8UXY226Bfp36LvxYTUt7MO/ycqGFjQgJ0wlMaWQ==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "darwin" - ] + "os": ["darwin"] }, "node_modules/@rollup/rollup-darwin-x64": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.30.0.tgz", "integrity": "sha512-Y3b4oDoaEhCypg8ajPqigKDcpi5ZZovemQl9Edpem0uNv6UUjXv7iySBpGIUTSs2ovWOzYpfw9EbFJXF/fJHWw==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "darwin" - ] + "os": ["darwin"] }, "node_modules/@rollup/rollup-freebsd-arm64": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.30.0.tgz", "integrity": "sha512-3REQJ4f90sFIBfa0BUokiCdrV/E4uIjhkWe1bMgCkhFXbf4D8YN6C4zwJL881GM818qVYE9BO3dGwjKhpo2ABA==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "freebsd" - ] + "os": ["freebsd"] }, "node_modules/@rollup/rollup-freebsd-x64": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.30.0.tgz", "integrity": "sha512-ZtY3Y8icbe3Cc+uQicsXG5L+CRGUfLZjW6j2gn5ikpltt3Whqjfo5mkyZ86UiuHF9Q3ZsaQeW7YswlHnN+lAcg==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "freebsd" - ] + "os": ["freebsd"] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.30.0.tgz", "integrity": "sha512-bsPGGzfiHXMhQGuFGpmo2PyTwcrh2otL6ycSZAFTESviUoBOuxF7iBbAL5IJXc/69peXl5rAtbewBFeASZ9O0g==", - "cpu": [ - "arm" - ], + "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.30.0.tgz", "integrity": "sha512-kvyIECEhs2DrrdfQf++maCWJIQ974EI4txlz1nNSBaCdtf7i5Xf1AQCEJWOC5rEBisdaMFFnOWNLYt7KpFqy5A==", - "cpu": [ - "arm" - ], + "cpu": ["arm"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.30.0.tgz", "integrity": "sha512-CFE7zDNrokaotXu+shwIrmWrFxllg79vciH4E/zeK7NitVuWEaXRzS0mFfFvyhZfn8WfVOG/1E9u8/DFEgK7WQ==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-linux-arm64-musl": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.30.0.tgz", "integrity": "sha512-MctNTBlvMcIBP0t8lV/NXiUwFg9oK5F79CxLU+a3xgrdJjfBLVIEHSAjQ9+ipofN2GKaMLnFFXLltg1HEEPaGQ==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.30.0.tgz", "integrity": "sha512-fBpoYwLEPivL3q368+gwn4qnYnr7GVwM6NnMo8rJ4wb0p/Y5lg88vQRRP077gf+tc25akuqd+1Sxbn9meODhwA==", - "cpu": [ - "loong64" - ], + "cpu": ["loong64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.30.0.tgz", "integrity": "sha512-1hiHPV6dUaqIMXrIjN+vgJqtfkLpqHS1Xsg0oUfUVD98xGp1wX89PIXgDF2DWra1nxAd8dfE0Dk59MyeKaBVAw==", - "cpu": [ - "ppc64" - ], + "cpu": ["ppc64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.30.0.tgz", "integrity": "sha512-U0xcC80SMpEbvvLw92emHrNjlS3OXjAM0aVzlWfar6PR0ODWCTQtKeeB+tlAPGfZQXicv1SpWwRz9Hyzq3Jx3g==", - "cpu": [ - "riscv64" - ], + "cpu": ["riscv64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.30.0.tgz", "integrity": "sha512-VU/P/IODrNPasgZDLIFJmMiLGez+BN11DQWfTVlViJVabyF3JaeaJkP6teI8760f18BMGCQOW9gOmuzFaI1pUw==", - "cpu": [ - "s390x" - ], + "cpu": ["s390x"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-linux-x64-gnu": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.30.0.tgz", "integrity": "sha512-laQVRvdbKmjXuFA3ZiZj7+U24FcmoPlXEi2OyLfbpY2MW1oxLt9Au8q9eHd0x6Pw/Kw4oe9gwVXWwIf2PVqblg==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-linux-x64-musl": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.30.0.tgz", "integrity": "sha512-3wzKzduS7jzxqcOvy/ocU/gMR3/QrHEFLge5CD7Si9fyHuoXcidyYZ6jyx8OPYmCcGm3uKTUl+9jUSAY74Ln5A==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "linux" - ] + "os": ["linux"] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.30.0.tgz", "integrity": "sha512-jROwnI1+wPyuv696rAFHp5+6RFhXGGwgmgSfzE8e4xfit6oLRg7GyMArVUoM3ChS045OwWr9aTnU+2c1UdBMyw==", - "cpu": [ - "arm64" - ], + "cpu": ["arm64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "os": ["win32"] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.30.0.tgz", "integrity": "sha512-duzweyup5WELhcXx5H1jokpr13i3BV9b48FMiikYAwk/MT1LrMYYk2TzenBd0jj4ivQIt58JWSxc19y4SvLP4g==", - "cpu": [ - "ia32" - ], + "cpu": ["ia32"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "os": ["win32"] }, "node_modules/@rollup/rollup-win32-x64-msvc": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.30.0.tgz", "integrity": "sha512-DYvxS0M07PvgvavMIybCOBYheyrqlui6ZQBHJs6GqduVzHSZ06TPPvlfvnYstjODHQ8UUXFwt5YE+h0jFI8kwg==", - "cpu": [ - "x64" - ], + "cpu": ["x64"], "dev": true, "license": "MIT", "optional": true, - "os": [ - "win32" - ] + "os": ["win32"] }, "node_modules/@supabase/auth-js": { "version": "2.67.3", @@ -927,9 +759,7 @@ "hasInstallScript": true, "license": "MIT", "optional": true, - "os": [ - "darwin" - ], + "os": ["darwin"], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } diff --git a/examples/auth/hono-full/src/client.tsx b/examples/auth/hono-full/src/client.tsx index 1c2a0d9c5d6..66f64c6eb02 100644 --- a/examples/auth/hono-full/src/client.tsx +++ b/examples/auth/hono-full/src/client.tsx @@ -1,29 +1,29 @@ -import { createBrowserClient } from '@supabase/ssr'; -import { hc } from 'hono/client'; -import { useEffect, useState } from 'hono/jsx'; -import { render } from 'hono/jsx/dom'; -import type { AppType } from '.'; +import { createBrowserClient } from '@supabase/ssr' +import { hc } from 'hono/client' +import { useEffect, useState } from 'hono/jsx' +import { render } from 'hono/jsx/dom' +import type { AppType } from '.' -const client = hc('/'); +const client = hc('/') const supabase = createBrowserClient( import.meta.env.VITE_SUPABASE_URL!, import.meta.env.VITE_SUPABASE_ANON_KEY! -); +) function App() { - const [user, setUser] = useState(null); + const [user, setUser] = useState(null) // Check client-side if user is logged in: useEffect(() => { supabase.auth.onAuthStateChange((event, session) => { - console.log('Auth event:', event); + console.log('Auth event:', event) if (event === 'SIGNED_OUT') { - setUser(null); + setUser(null) } else { - setUser(session?.user!); + setUser(session?.user!) } - }); - }, []); + }) + }, []) return ( <> @@ -35,7 +35,7 @@ function App() { - ); + ) } const UserDetailsButton = () => { - const [response, setResponse] = useState(null); + const [response, setResponse] = useState(null) const handleClick = async () => { - const response = await client.api.user.$get(); - const data = await response.json(); - const headers = Array.from(response.headers.entries()).reduce< - Record - >((acc, [key, value]) => { - acc[key] = value; - return acc; - }, {}); + const response = await client.api.user.$get() + const data = await response.json() + const headers = Array.from(response.headers.entries()).reduce>( + (acc, [key, value]) => { + acc[key] = value + return acc + }, + {} + ) const fullResponse = { url: response.url, status: response.status, headers, body: data, - }; - setResponse(JSON.stringify(fullResponse, null, 2)); - }; + } + setResponse(JSON.stringify(fullResponse, null, 2)) + } return (
@@ -107,8 +103,8 @@ const UserDetailsButton = () => { {response &&
{response}
}
- ); -}; + ) +} -const root = document.getElementById('root')!; -render(, root); +const root = document.getElementById('root')! +render(, root) diff --git a/examples/auth/hono-full/src/index.tsx b/examples/auth/hono-full/src/index.tsx index 5acaf4801f8..8560a3bcabf 100644 --- a/examples/auth/hono-full/src/index.tsx +++ b/examples/auth/hono-full/src/index.tsx @@ -1,42 +1,42 @@ -import { Hono } from 'hono'; -import { getSupabase, supabaseMiddleware } from './middleware/auth.middleware'; +import { Hono } from 'hono' +import { getSupabase, supabaseMiddleware } from './middleware/auth.middleware' -const app = new Hono(); -app.use('*', supabaseMiddleware()); +const app = new Hono() +app.use('*', supabaseMiddleware()) const routes = app.get('/api/user', async (c) => { - const supabase = getSupabase(c); - const { data, error } = await supabase.auth.getUser(); + const supabase = getSupabase(c) + const { data, error } = await supabase.auth.getUser() - if (error) console.log('error', error); + if (error) console.log('error', error) if (!data?.user) { return c.json({ message: 'You are not logged in.', - }); + }) } return c.json({ message: 'You are logged in!', userId: data.user, - }); -}); + }) +}) app.get('/signout', async (c) => { - const supabase = getSupabase(c); - await supabase.auth.signOut(); - console.log('Signed out server-side!'); - return c.redirect('/'); -}); + const supabase = getSupabase(c) + await supabase.auth.signOut() + console.log('Signed out server-side!') + return c.redirect('/') +}) app.get('/countries', async (c) => { - const supabase = getSupabase(c); - const { data, error } = await supabase.from('countries').select('*'); - if (error) console.log(error); - return c.json(data); -}); + const supabase = getSupabase(c) + const { data, error } = await supabase.from('countries').select('*') + if (error) console.log(error) + return c.json(data) +}) -export type AppType = typeof routes; +export type AppType = typeof routes app.get('/', (c) => { return c.html( @@ -44,10 +44,7 @@ app.get('/', (c) => { - + {import.meta.env.PROD ? (