From d77dec1f4fd0da573c15103e773d776b87970d17 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Wed, 14 Dec 2022 17:33:16 -0330 Subject: [PATCH] Add client libs to doc search --- apps/docs/components/DocSearch.tsx | 1 - apps/docs/public/sitemap.xml | 1220 ++++++++++++++-------------- apps/docs/scripts/build-search.js | 145 ++-- 3 files changed, 703 insertions(+), 663 deletions(-) diff --git a/apps/docs/components/DocSearch.tsx b/apps/docs/components/DocSearch.tsx index d8bde374580..fded1f47d8c 100644 --- a/apps/docs/components/DocSearch.tsx +++ b/apps/docs/components/DocSearch.tsx @@ -20,7 +20,6 @@ export function SearchProvider({ children }: any) { const router = useRouter() const [isOpen, setIsOpen] = useState(false) const [initialQuery, setInitialQuery] = useState(null) - const onOpen = useCallback(() => { setIsOpen(true) }, [setIsOpen]) diff --git a/apps/docs/public/sitemap.xml b/apps/docs/public/sitemap.xml index 91ddce8fdf8..8f32971da43 100644 --- a/apps/docs/public/sitemap.xml +++ b/apps/docs/public/sitemap.xml @@ -18,24 +18,12 @@ 0.5 - - https://supabase.com/docs/architecture - weekly - 0.5 - - https://supabase.com/docs/faq weekly 0.5 - - https://supabase.com/docs/features - weekly - 0.5 - - https://supabase.com/docs/getting-started weekly @@ -60,42 +48,12 @@ 0.5 - - https://supabase.com/docs/handbook/contributing - weekly - 0.5 - - - - https://supabase.com/docs/handbook/introduction - weekly - 0.5 - - - - https://supabase.com/supasquad - weekly - 0.5 - - https://supabase.com/docs/guides/api weekly 0.5 - - https://supabase.com/docs/guides/auth - weekly - 0.5 - - - - https://supabase.com/docs/guides/cli - weekly - 0.5 - - https://supabase.com/docs/guides/database weekly @@ -157,91 +115,13 @@ - https://supabase.com/docs/guides/with-angular + https://supabase.com/docs/handbook/contributing weekly 0.5 - https://supabase.com/docs/guides/with-expo - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-flutter - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-ionic-angular - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-ionic-react - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-ionic-vue - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-nextjs - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-nuxt-3 - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-react - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-redwoodjs - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-solidjs - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-svelte - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-sveltekit - weekly - 0.5 - - - - https://supabase.com/docs/guides/with-vue-3 - weekly - 0.5 - - - - https://supabase.com/docs/reference/index + https://supabase.com/docs/handbook/introduction weekly 0.5 @@ -252,12 +132,6 @@ 0.5 - - https://supabase.com/docs/new/index - weekly - 0.5 - - https://supabase.com/docs/tutorials/nextjs weekly @@ -265,31 +139,7 @@ - https://supabase.com/docs/learn/auth-deep-dive/auth-deep-dive-jwts - weekly - 0.5 - - - - https://supabase.com/docs/learn/auth-deep-dive/auth-google-oauth - weekly - 0.5 - - - - https://supabase.com/docs/learn/auth-deep-dive/auth-gotrue - weekly - 0.5 - - - - https://supabase.com/docs/learn/auth-deep-dive/auth-policies - weekly - 0.5 - - - - https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security + https://supabase.com/docs/reference/index weekly 0.5 @@ -300,156 +150,36 @@ 0.5 - - https://supabase.com/docs/guides/auth/auth-apple - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-azure - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-bitbucket - weekly - 0.5 - - https://supabase.com/docs/guides/auth/auth-captcha weekly 0.5 - - https://supabase.com/docs/guides/auth/auth-discord - weekly - 0.5 - - https://supabase.com/docs/guides/auth/auth-email weekly 0.5 - - https://supabase.com/docs/guides/auth/auth-facebook - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-github - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-gitlab - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-google - weekly - 0.5 - - https://supabase.com/docs/guides/auth/auth-helpers weekly 0.5 - - https://supabase.com/docs/guides/auth/auth-keycloak - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-linkedin - weekly - 0.5 - - https://supabase.com/docs/guides/auth/auth-magic-link weekly 0.5 - - https://supabase.com/docs/guides/auth/auth-messagebird - weekly - 0.5 - - https://supabase.com/docs/guides/auth/auth-mfa weekly 0.5 - - https://supabase.com/docs/guides/auth/auth-notion - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-slack - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-spotify - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-twilio - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-twitch - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-twitter - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-vonage - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-workos - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-zoom - weekly - 0.5 - - https://supabase.com/docs/guides/auth/managing-user-data weekly @@ -486,18 +216,6 @@ 0.5 - - https://supabase.com/docs/guides/cli/local-development - weekly - 0.5 - - - - https://supabase.com/docs/guides/cli/managing-environments - weekly - 0.5 - - https://supabase.com/docs/guides/functions/auth weekly @@ -522,30 +240,6 @@ 0.5 - - https://supabase.com/docs/guides/getting-started/architecture - weekly - 0.5 - - - - https://supabase.com/docs/guides/getting-started/features - weekly - 0.5 - - - - https://supabase.com/docs/guides/hosting/docker - weekly - 0.5 - - - - https://supabase.com/docs/guides/hosting/overview - weekly - 0.5 - - https://supabase.com/docs/guides/database/arrays weekly @@ -636,6 +330,18 @@ 0.5 + + https://supabase.com/docs/guides/getting-started/architecture + weekly + 0.5 + + + + https://supabase.com/docs/guides/getting-started/features + weekly + 0.5 + + https://supabase.com/docs/guides/integrations/appsmith weekly @@ -775,67 +481,7 @@ - https://supabase.com/docs/guides/realtime/postgres-changes - weekly - 0.5 - - - - https://supabase.com/docs/guides/realtime/quickstart - weekly - 0.5 - - - - https://supabase.com/docs/guides/realtime/rate-limits - weekly - 0.5 - - - - https://supabase.com/docs/guides/storage/access-control - weekly - 0.5 - - - - https://supabase.com/docs/guides/storage/cdn - weekly - 0.5 - - - - https://supabase.com/docs/guides/storage/quickstart - weekly - 0.5 - - - - https://supabase.com/docs/guides/storage/storage-sample - weekly - 0.5 - - - - https://supabase.com/docs/guides/migrations/firebase-auth - weekly - 0.5 - - - - https://supabase.com/docs/guides/migrations/firebase-storage - weekly - 0.5 - - - - https://supabase.com/docs/guides/migrations/firestore-data - weekly - 0.5 - - - - https://supabase.com/docs/guides/migrations/heroku + https://supabase.com/docs/guides/platform/access-control weekly 0.5 @@ -882,6 +528,12 @@ 0.5 + + https://supabase.com/docs/guides/platform/network-restrictions + weekly + 0.5 + + https://supabase.com/docs/guides/platform/performance weekly @@ -895,7 +547,25 @@ - https://supabase.com/docs/guides/resources/examples + https://supabase.com/docs/guides/platform/sso + weekly + 0.5 + + + + https://supabase.com/docs/guides/realtime/postgres-changes + weekly + 0.5 + + + + https://supabase.com/docs/guides/realtime/quickstart + weekly + 0.5 + + + + https://supabase.com/docs/guides/realtime/rate-limits weekly 0.5 @@ -906,12 +576,6 @@ 0.5 - - https://supabase.com/docs/guides/resources/migrating-to-supabase - weekly - 0.5 - - https://supabase.com/docs/guides/resources/self-hosting weekly @@ -924,6 +588,72 @@ 0.5 + + https://supabase.com/docs/guides/storage/access-control + weekly + 0.5 + + + + https://supabase.com/docs/guides/storage/cdn + weekly + 0.5 + + + + https://supabase.com/docs/guides/storage/image-transformations + weekly + 0.5 + + + + https://supabase.com/docs/guides/storage/quickstart + weekly + 0.5 + + + + https://supabase.com/docs/guides/storage/storage-sample + weekly + 0.5 + + + + https://supabase.com/docs/learn/auth-deep-dive/auth-deep-dive-jwts + weekly + 0.5 + + + + https://supabase.com/docs/learn/auth-deep-dive/auth-google-oauth + weekly + 0.5 + + + + https://supabase.com/docs/learn/auth-deep-dive/auth-gotrue + weekly + 0.5 + + + + https://supabase.com/docs/learn/auth-deep-dive/auth-policies + weekly + 0.5 + + + + https://supabase.com/docs/learn/auth-deep-dive/auth-row-level-security + weekly + 0.5 + + + + https://supabase.com/docs/new/auth/auth-login + weekly + 0.5 + + https://supabase.com/docs/guides/auth/auth-helpers/auth-ui weekly @@ -954,12 +684,168 @@ 0.5 + + https://supabase.com/docs/guides/auth/phone-login/messagebird + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/phone-login/twilio + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/phone-login/vonage + weekly + 0.5 + + https://supabase.com/docs/guides/functions/examples/og-image weekly 0.5 + + https://supabase.com/docs/guides/database/extensions/http + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/extensions/pgcron + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/extensions/pgnet + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/extensions/pgtap + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/extensions/plv8 + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/extensions/uuid-ossp + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-apple + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-azure + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-bitbucket + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-discord + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-facebook + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-github + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-gitlab + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-google + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-keycloak + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-linkedin + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-notion + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-slack + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-spotify + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-twitch + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-twitter + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-workos + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login/auth-zoom + weekly + 0.5 + + https://supabase.com/docs/guides/getting-started/quickstarts/nextjs weekly @@ -1063,43 +949,19 @@ - https://supabase.com/docs/guides/database/extensions/http + https://supabase.com/docs/guides/platform/sso/azure weekly 0.5 - https://supabase.com/docs/guides/database/extensions/pgcron + https://supabase.com/docs/guides/platform/sso/gsuite weekly 0.5 - https://supabase.com/docs/guides/database/extensions/pgnet - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/extensions/pgtap - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/extensions/plv8 - weekly - 0.5 - - - - https://supabase.com/docs/guides/database/extensions/uuid-ossp - weekly - 0.5 - - - - https://supabase.com/docs/new/auth/auth-login + https://supabase.com/docs/guides/platform/sso/okta weekly 0.5 @@ -1111,13 +973,13 @@ - https://supabase.com/docs/guides/resources/migrating-to-supabase/firebase-data + https://supabase.com/docs/guides/resources/migrating-to-supabase/firebase-storage weekly 0.5 - https://supabase.com/docs/guides/resources/migrating-to-supabase/firebase-storage + https://supabase.com/docs/guides/resources/migrating-to-supabase/firestore-data weekly 0.5 @@ -1134,30 +996,6 @@ 0.5 - - https://supabase.com/docs/guides/auth/auth-magic-link - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/phone-login/messagebird - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/phone-login/twilio - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/phone-login/vonage - weekly - 0.5 - - https://supabase.com/docs/guides/resources/supabase-cli/local-development weekly @@ -1165,115 +1003,7 @@ - https://supabase.com/docs/guides/resources/supabase-cli/managing-enviroments - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-apple - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-azure - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-bitbucket - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-discord - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-facebook - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-github - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-gitlab - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-google - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-keycloak - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-linkedin - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-notion - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-slack - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-spotify - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-twilio - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-twitch - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-twitter - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-workos - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login/auth-zoom + https://supabase.com/docs/guides/resources/supabase-cli/managing-environments weekly 0.5 @@ -1344,6 +1074,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/abort-signal + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/admin-api weekly @@ -1392,18 +1128,6 @@ 0.5 - - https://supabase.com/docs/reference/javascript/auth-admin-mfa-deletefactor - weekly - 0.5 - - - - https://supabase.com/docs/reference/javascript/auth-admin-mfa-listfactors - weekly - 0.5 - - https://supabase.com/docs/reference/javascript/auth-admin-resetpasswordforemail weekly @@ -1416,12 +1140,6 @@ 0.5 - - https://supabase.com/docs/reference/javascript/auth-api - weekly - 0.5 - - https://supabase.com/docs/reference/javascript/auth-getsession weekly @@ -1434,44 +1152,6 @@ 0.5 - - https://supabase.com/docs/reference/javascript/auth-mfa-challenge - weekly - 0.5 - - - - https://supabase.com/docs/reference/javascript/auth-mfa-challengeandverify - weekly - 0.5 - - - - https://supabase.com/docs/reference/javascript/auth-mfa-enroll - weekly - 0.5 - - - - https://supabase.com/docs/reference/javascript/auth-mfa-getauthenticatorassurancelevel - weekly - 0.5 - - - - https://supabase.com/docs/reference/javascript/auth-mfa-unenroll - weekly - 0.5 - - - - https://supabase.com/docs/reference/javascript/auth-mfa-verify - weekly - 0.5 - - https://supabase.com/docs/reference/javascript/auth-onauthstatechange weekly @@ -1484,6 +1164,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/auth-reset-password-for-email + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/auth-resetpasswordforemail weekly @@ -1538,6 +1224,66 @@ 0.5 + + https://supabase.com/docs/reference/javascript/auth.getsession + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.getuser + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.onauthstatechange + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.refreshsession + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.setsession + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.signinwithoauth + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.signinwithotp + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.updateuser + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/auth.verifyotp + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/contained-by + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/containedby weekly @@ -1550,6 +1296,18 @@ 0.5 + + https://supabase.com/docs/reference/javascript/create-user + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/csv + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/db-abortsignal weekly @@ -1568,12 +1326,30 @@ 0.5 + + https://supabase.com/docs/reference/javascript/delete-bucket + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/delete-user + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/delete weekly 0.5 + + https://supabase.com/docs/reference/javascript/empty-bucket + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/eq weekly @@ -1586,6 +1362,102 @@ 0.5 + + https://supabase.com/docs/reference/javascript/from-copy + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-create-signed-url + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-create-signed-urls + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-download + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-get-public-url + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-list + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-move + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-remove + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-update + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/from-upload + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/generate-link + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-bucket + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-channels + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-session + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-user-by-id + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/get-user + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/getchannels weekly @@ -1634,6 +1506,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/invite-user-by-email + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/invoke weekly @@ -1658,6 +1536,18 @@ 0.5 + + https://supabase.com/docs/reference/javascript/list-buckets + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/list-users + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/lt weekly @@ -1677,7 +1567,7 @@ - https://supabase.com/docs/reference/javascript/maybesingle + https://supabase.com/docs/reference/javascript/maybeSingle weekly 0.5 @@ -1694,6 +1584,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/on-auth-state-change + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/or weekly @@ -1712,6 +1608,36 @@ 0.5 + + https://supabase.com/docs/reference/javascript/range-adjacent + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/range-gt + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/range-gte + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/range-lt + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/range-lte + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/range weekly @@ -1748,6 +1674,24 @@ 0.5 + + https://supabase.com/docs/reference/javascript/refresh-session + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/remove-all-channels + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/remove-channel + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/removeallchannels weekly @@ -1772,6 +1716,42 @@ 0.5 + + https://supabase.com/docs/reference/javascript/set-session + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-in-with-oauth + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-in-with-otp + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-in-with-password + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-out + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/sign-up + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/single weekly @@ -1790,6 +1770,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/storage-empty-bucket + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/storage-emptybucket weekly @@ -1886,6 +1872,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/text-search + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/textsearch weekly @@ -1898,6 +1890,24 @@ 0.5 + + https://supabase.com/docs/reference/javascript/update-bucket + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/update-user-by-id + weekly + 0.5 + + + + https://supabase.com/docs/reference/javascript/update-user + weekly + 0.5 + + https://supabase.com/docs/reference/javascript/update weekly @@ -1922,6 +1932,12 @@ 0.5 + + https://supabase.com/docs/reference/javascript/verify-otp + weekly + 0.5 + + https://supabase.com/docs/reference/dart/initializing weekly @@ -2102,6 +2118,12 @@ 0.5 + + https://supabase.com/docs/reference/dart/initializing + weekly + 0.5 + + https://supabase.com/docs/reference/dart/insert weekly @@ -2276,12 +2298,6 @@ 0.5 - - https://supabase.com/docs/reference/dart/storage-from-createsignedurls - weekly - 0.5 - - https://supabase.com/docs/reference/dart/storage-from-download weekly diff --git a/apps/docs/scripts/build-search.js b/apps/docs/scripts/build-search.js index 07865a2344c..b07efc07bf7 100644 --- a/apps/docs/scripts/build-search.js +++ b/apps/docs/scripts/build-search.js @@ -5,18 +5,84 @@ const matter = require('gray-matter') const dotenv = require('dotenv') const algoliasearch = require('algoliasearch/lite') const { isEmpty } = require('lodash') +const yaml = require('js-yaml') +const commonLibSections = require('../../../spec/common-client-libs-sections.json') -// [Joshen] We initially thought of building out our search using Algolia directly, -// but eventually decided to just use DocSearch since it provides us a UI and some -// configurations out of the box (e.g Doc hierarchy). +function flattenSections(sections) { + var a = [] + for (var i = 0; i < sections.length; i++) { + if (sections[i].id) { + // only push a section that has an id + // these are reserved for sidebar subtitles + a.push(sections[i]) + } + if (sections[i].items) { + // if there are subitems, loop through + a = a.concat(flattenSections(sections[i].items)) + } + } + return a +} -// As such when creating the search object, the properties that are specifically read +const clientLibFiles = [ + { fileName: 'supabase_js_v2', label: 'javascript', version: 'v2', versionSlug: false }, + { fileName: 'supabase_js_v1', label: 'javascript', version: 'v1', versionSlug: true }, + { fileName: 'supabase_dart_v1', label: 'dart', version: 'v1', versionSlug: false }, + { fileName: 'supabase_dart_v0', label: 'dart', version: 'v0', versionSlug: true }, +] + +const nameMap = { + api: 'Management API', + cli: 'Supabase CLI', + auth: 'Auth Server', + storage: 'Storage Server', + postgres: 'Postgres', + dart: 'Supabase Flutter Library', + javascript: 'Supabase JavaScript Library', +} + +const flatCommonLibSections = flattenSections(commonLibSections) + +// loop through each spec file, find the correspending entry in the common file and grab the title / description / slug +let clientLibSearchObjects = [] + +clientLibFiles.map((file) => { + const specs = yaml.load(fs.readFileSync(`../../spec/${file.fileName}.yml`, 'utf8')) + + //take each function id, find it in the commonLibSections file and return { id, title, slug, description, } + specs.functions.map((fn) => { + const item = flatCommonLibSections.find((section) => section.id === fn.id) + if (item) { + const object = clientLibSearchObjects.push({ + objectID: crypto.randomUUID(), + id: item.id, + title: item.title, + description: item.title, + url: `/reference/${file.label}/${file.versionSlug ? file.version + '/' : ''}${item.slug}`, + source: 'reference', + pageContent: '', + category: item.product, + version: file.version, + type: 'lvl2', + hierarchy: { + lvl0: 'References', + lvl1: `${nameMap[file.label]} ${file.version}`, + lvl2: item.title, + lvl3: file.version, + lvl4: null, + lvl5: null, + lvl6: null, + }, + }) + return object + } + }) +}) + +clientLibSearchObjects.map((item) => console.log(item)) +// The properties of the searchObject that are specifically read // by DocSearch are "type" and "hierarchy". The rest, though saved into Algolia (which we // can potentially use to craft more nuanced search experiences) are not used by DocSearch - -// Note that we'll need to do a general clean up of the files in the docs -// A lot of them are not even linked to within the docs site, so just need to -// double check if they can be removed or if we want them in the side bars. const ignoredFiles = [ 'pages/404.mdx', 'pages/faq.mdx', @@ -30,16 +96,6 @@ const ignoredFiles = [ 'pages/handbook/supasquad.mdx', ] -const nameMap = { - api: 'Management API', - cli: 'Supabase CLI', - auth: 'Auth Server', - storage: 'Storage Server', - postgres: 'Postgres', - dart: 'Supabase Flutter Library', - javascript: 'Supabase JavaScript Library', -} - async function walk(dir) { let files = await fs.promises.readdir(dir) files = await Promise.all( @@ -66,15 +122,6 @@ async function walk(dir) { console.log('Preparing docs indexing for Algolia') - function extractMeta(mdx) { - const regex = /^export\sconst\smeta\s=\s(\{[\w\s':,]*\})/gm - const match = regex.exec(mdx) - if (match) { - return JSON.parse(match[1]) - } - return null - } - try { const indexName = process.env.NEXT_PUBLIC_ALGOLIA_INDEX_NAME const client = algoliasearch( @@ -83,11 +130,10 @@ async function walk(dir) { ) const index = client.initIndex(indexName) - const referencePages = await walk('docs') const guidePages = (await walk('pages')).filter((slug) => !ignoredFiles.includes(slug)) - const allPages = guidePages.concat(referencePages) - const searchObjects = allPages + // generate search objects for guide pages + const guidePagesearchObjects = guidePages .map((slug) => { let id, title, description const fileContents = fs.readFileSync(slug, 'utf8') @@ -118,6 +164,7 @@ async function walk(dir) { .replace('pages', '') .replace(/\.mdx$/, '') const source = slug.includes('/reference') ? 'reference' : 'guide' + const object = { // For Algolia objectID: crypto.randomUUID(), @@ -126,7 +173,8 @@ async function walk(dir) { description, url, source, - pageContent: content, + //pageContent: content, + pageContent: '', category: undefined, version: undefined, @@ -143,44 +191,21 @@ async function walk(dir) { }, } - if (slug.includes('/reference')) { - const urlSegments = url.split('/') - const category = urlSegments[urlSegments.indexOf('reference') + 1] - const version = urlSegments[urlSegments.indexOf('reference') + 2] || '' - - const hasVersion = /v[0-9]+/.test(version) - if (hasVersion) { - object.version = version - object.type = title === nameMap[category] ? 'lvl2' : 'lvl3' - object.hierarchy.lvl1 = nameMap[category] - object.hierarchy.lvl2 = version - object.hierarchy.lvl3 = title - } else { - const page = urlSegments[urlSegments.indexOf('reference') + 2] - if (page === 'generated') { - } else { - if (page !== undefined) { - object.type = 'lvl2' - object.hierarchy.lvl1 = nameMap[category] - object.hierarchy.lvl2 = title - } - } - } - - object.category = category ? category.replace(/\.mdx$/, '') : undefined - object.hierarchy.lvl0 = 'References' - } - return object }) // Some of the reference generated files come with an 'index' page that we can ignore .filter((object) => !object.url.endsWith('/index')) .filter((object) => !object.url.endsWith('/.gitkeep')) + //console.log('guidePagesearchObjects:', guidePagesearchObjects) + + const combinedSearchObjects = guidePagesearchObjects.concat(clientLibSearchObjects) + await index.clearObjects() console.log(`Successfully cleared records from ${indexName}`) - const algoliaResponse = await index.saveObjects(searchObjects) + const algoliaResponse = await index.saveObjects(combinedSearchObjects) + console.log(`Successfully saved ${algoliaResponse.objectIDs.length} records into ${indexName}.`) } catch (error) { console.log('Error:', error)