From 36a38106a1d610ed6a7bf6b7a9e9f2bd8a7e593c Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Fri, 6 Jan 2023 10:21:46 -0330 Subject: [PATCH 01/21] Add a readme describing how docs work, misc required cleanup --- apps/docs/DEVELOPERS.md | 89 ++++ .../NavigationMenuRefListItems.tsx | 26 +- apps/docs/components/Options.tsx | 4 +- apps/docs/components/Params.tsx | 4 +- apps/docs/components/index.tsx | 5 +- apps/docs/pages/guides/functions.mdx | 2 - spec/common-client-libs-sections.json | 338 +++++------- spec/common-client-libs.yml | 485 ------------------ 8 files changed, 227 insertions(+), 726 deletions(-) create mode 100644 apps/docs/DEVELOPERS.md delete mode 100644 spec/common-client-libs.yml diff --git a/apps/docs/DEVELOPERS.md b/apps/docs/DEVELOPERS.md new file mode 100644 index 00000000000..bd54993a356 --- /dev/null +++ b/apps/docs/DEVELOPERS.md @@ -0,0 +1,89 @@ +# Developing Supabase Docs + +## Getting started + +Thanks for your interest in [Supabase docs](https://supabase.com/docs) and for wanting to contribute! Before you begin, read the +[code of conduct](https://github.com/supabase/.github/blob/main/CODE_OF_CONDUCT.md) and check out the +[existing issues](https://github.com/supabase/supabase/issues). +This document describes how to set up your development environment to contribute to [Supabase docs](https://supabase.com/docs). + +For a complete run-down on how all of our tools work together, see the main DEVELOPERS.md. That readme describes how to get setup locally in lots of detail, including details minimum requirements, our Turborepo setup, installing packages, sharing components across projects and more. This readme deals specifically with the docs site. + +## Local setup + +[supabase.com/docs](https://supabase.com/docs) is a Next.JS site. You can get setup by following the same steps for all of our other Next.JS projects: + +1. Follow the steps outlined in the Local Development section of the main [DEVELOPERS.md](https://github.com/supabase/supabase/blob/master/DEVELOPERS.md) +2. Start the local docs site by navigating to `/apps/docs` and running `npm run dev` +3. Visit http://localhost:3001/docs in your browser - don't forget to append the `/docs` to the end +4. Your local site should look exactly like [https://supabase.com/docs](https://supabase.com/docs) + +## Types of documentation + +[https://supabase.com/docs](https://supabase.com/docs) has several different kinds of documentation, all coming from different sources. + +### Guides + +The primary, instructional type of content. Basically anything that lives on the `https://supabase.com/docs/guides` route. This includes Guides for Auth, Database, Storage, Realtime as well as general resources, self-hosting instructions and integrations. These are all [`.mdx`](https://mdxjs.com/) files — a combination of Markdown and Javascript. + +#### Things to know + +Here's a simple [example](https://supabase.com/docs/guides/functions) `.mdx` Guide, and here is [the source on Github](https://raw.githubusercontent.com/supabase/supabase/master/apps/docs/pages/guides/functions.mdx). + +Some things to note: + +1. The files need to import a Layout at the top +2. The files need to export a `Page` at the bottom with the `` component +3. The files frontmatter is stored in `const meta = {}`. You should always include `id`, `title` and `description`. +4. You can write Markdown as you normally would, but you can also write regular Javascript and JSX. Note the `examples` array that we iterate over. +5. Any Javascript variables you use in these files need to be exported in order to be used. IE: `export const examples = []` + +##### Using components + +You can use any standard React components in these `.mdx` files without having to explicitly import them in each file. All components get imported in a [common components](https://github.com/supabase/supabase/blob/master/apps/docs/components/index.tsx) file and can be used in any `.mdx` file. Components can also be "intercepted" and modified via this file. Note how we're intercepting the `h2`, `h3` and `code` tags and modifying them before converting the `mdx` to `html`. + +### Reference docs for client libraries + +We maintain client libraries for [Javascript](https://supabase.com/docs/reference/javascript) and [Flutter/Dart](https://supabase.com/docs/reference/dart) (with more to come). These reference docs document every object and method available for developers to use. The are assembled from different sources and work much differently than the `.mdx` Guides we just looked at. + +The client libraries are essentially wrappers around the clients for the various tools we use — GoTrue, PostgREST, Storage, Functions and Realtime. The easiest way to describe how the things fit together is to look at an example and trace where the various pieces of information are coming from. + +#### Example + +Let's look at the `updateUser()` function in the `supabase-js` library. + +#### Common file + +Several pieces of information for this function come from a [common file](https://github.com/supabase/supabase/blob/master/spec/common-client-libs-sections.json#L548) where we store information shared by all libraries. + +1. id — used to identify this function +2. title - the human-readable title +3. slug — the url slug +4. product - the supabase tool or product that "owns" this function. Since `updateUser()` is an auth function, it's product is `auth` +5. type — `updateUser()` is a function and marked as such, but we can also have sections of markdown interspersed with these function definitions. + +#### Function Parameters + +The `updateUser()` function takes one parameter: `attributes`. The details for this parameter live in the GoTrue client library, referenced via a `$ref` property in the `supabase-js` [spec file](https://github.com/supabase/supabase/blob/master/spec/supabase_js_v2.yml#L357). Here, the `$ref` property is pointing to the [actual function definition](https://github.com/supabase/gotrue-js/blob/master/src/GoTrueClient.ts#L590) in the `gotrue-js` library. The accepted values for the `attributes` parameter come from the [type definition](https://github.com/supabase/gotrue-js/blob/16d3deb822097e8640a3a15b94a5690b3beaf11b/src/lib/types.ts#L233). + +These individual library spec files are fetched via this [Makefile](https://github.com/supabase/supabase/blob/master/spec/Makefile), and get [transformed](https://github.com/supabase/supabase/blob/master/spec/enrichments/tsdoc_v2/supabase_dereferenced.json) to combine the information we need (params, types, etc). If you're working on docs, you likely won't need to touch this part of the setup, but we've included this detail here to point you in the right direction in case you do. + +#### Function Examples + +The `updateUser()` function has three examples listed with it. The examples are stored along with the `$ref` property in the [supabase_js_v2 spec file](https://github.com/supabase/supabase/blob/master/spec/supabase_js_v2.yml). + +#### Rendering in Next.JS + +These reference docs are rendered by Next.JS via a dynamic route using a [`[...slug.tsx]`](https://github.com/supabase/supabase/blob/master/apps/docs/pages/reference/javascript/%5B...slug%5D.tsx). Here, we use the library [spec file](https://github.com/supabase/supabase/blob/master/apps/docs/pages/reference/javascript/%5B...slug%5D.tsx#L4) and the [common file](https://github.com/supabase/supabase/blob/master/apps/docs/pages/reference/javascript/%5B...slug%5D.tsx#L1) to output the info you see on the page. + +### Other reference docs + +The reference docs for the [Supabase Management API](https://supabase.com/docs/reference/api) and the [Supabase CLI](https://supabase.com/docs/reference/cli) are a little more straightforward than the client libraries. Both files also have a [common file](https://github.com/supabase/supabase/blob/master/spec/common-cli-sections.json) which handles things like `title`, `id` and `slug`. Both also have a spec file detailing things like parameters, descriptions and responses ([Management API](https://github.com/supabase/supabase/blob/master/spec/api_v0_openapi.json) / [CLI](https://github.com/supabase/supabase/blob/master/spec/cli_v1_commands.yaml)) + +On the Next.JS side of things, these work almost exactly the same as the client libaries with a dynamic [`[...slug.tsx]`](https://github.com/supabase/supabase/blob/master/apps/docs/pages/reference/cli/%5B...slug%5D.tsx). + +### Misc + +#### Search + +Search is handled through Algolia. When the site is built, a [script](https://github.com/supabase/supabase/blob/master/apps/docs/scripts/build-search.ts) runs through all of the types of content, generating search objects that are sent to Algolia to index. diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx index 1611cd51992..123a34e27ad 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenuRefListItems.tsx @@ -257,20 +257,18 @@ const Content: React.FC = ({ id, lib, commonSections, sp {fn.items && - fn.items - //.filter((item) => item.libs.includes(lib)) - .map((item) => ( - - ))} + fn.items.map((item) => ( + + ))} ) : ( diff --git a/apps/docs/components/Options.tsx b/apps/docs/components/Options.tsx index c2783edeaa4..e349cdd97bb 100644 --- a/apps/docs/components/Options.tsx +++ b/apps/docs/components/Options.tsx @@ -70,7 +70,9 @@ const Option: FC = (props) => { {props.type ?? 'no type'} -

{props.description ?? 'nodescription'}

+ + {props.description &&

{props.description}

} + {props.children} ) diff --git a/apps/docs/components/Params.tsx b/apps/docs/components/Params.tsx index ede7f8bcac7..10994966198 100644 --- a/apps/docs/components/Params.tsx +++ b/apps/docs/components/Params.tsx @@ -20,7 +20,9 @@ const Param: FC = (paramItem) => { {paramItem.type ?? 'no type'} -

{paramItem.description ?? 'nodescription'}

+ {paramItem.description && ( +

{paramItem.description}

+ )} {paramItem.children} ) diff --git a/apps/docs/components/index.tsx b/apps/docs/components/index.tsx index 9ee8c4060d5..587a5cfee32 100644 --- a/apps/docs/components/index.tsx +++ b/apps/docs/components/index.tsx @@ -1,4 +1,5 @@ -import { Button, Tabs, Alert } from 'ui' +import { Button, Tabs, Alert, GlassPanel } from 'ui' +import Link from 'next/link' // Common components import Admonition from './Admonition' @@ -38,6 +39,8 @@ const components = { Button, ButtonCard, CodeBlock, + GlassPanel, + Link, Frameworks, AuthProviders, FunctionsExamples, diff --git a/apps/docs/pages/guides/functions.mdx b/apps/docs/pages/guides/functions.mdx index 9c970cb6bfe..a382f7ccde1 100644 --- a/apps/docs/pages/guides/functions.mdx +++ b/apps/docs/pages/guides/functions.mdx @@ -1,6 +1,4 @@ import Layout from '~/layouts/DefaultGuideLayout' -import { Button, GlassPanel } from 'ui' -import Link from 'next/link' export const meta = { id: 'functions', diff --git a/spec/common-client-libs-sections.json b/spec/common-client-libs-sections.json index 14606af13be..c290fb91859 100644 --- a/spec/common-client-libs-sections.json +++ b/spec/common-client-libs-sections.json @@ -3,15 +3,13 @@ "title": "Introduction", "id": "introduction", "slug": "introduction", - "type": "markdown", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "markdown" }, { "title": "Installing", "id": "installing", "slug": "installing", - "type": "markdown", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "markdown" }, { "title": "Initializing", @@ -23,67 +21,59 @@ "title": "Typescript Support", "id": "typescript-support", "slug": "typescript-support", - "type": "markdown", - "libs": ["js", "js_v1"] + "type": "markdown" }, { "title": "Upgrade guide", "id": "upgrade-guide", "slug": "upgrade-guide", - "type": "markdown", - "libs": ["js"] + "type": "markdown" }, { "title": "Database", - "libs": ["js", "js_v1", "dart", "dart_v0"], + "items": [ { "id": "select", "title": "Fetch data", "slug": "select", "product": "database", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "insert", "title": "Insert data", "slug": "insert", "product": "database", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "update", "title": "Update data", "slug": "update", "product": "database", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "upsert", "title": "Upsert data", "slug": "upsert", "product": "database", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "delete", "title": "Delete data", "slug": "delete", "product": "database", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "rpc", "title": "Call a Postgres function", "slug": "rpc", "product": "database", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "using-filters", @@ -92,7 +82,7 @@ "slug": "using-filters", "product": "database", "type": "function", - "libs": ["js", "dart", "dart_v0"], + "items": [ { "id": "eq", @@ -100,8 +90,7 @@ "slug": "eq", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "neq", @@ -109,8 +98,7 @@ "slug": "neq", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "gt", @@ -118,8 +106,7 @@ "slug": "gt", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "gte", @@ -127,8 +114,7 @@ "slug": "gte", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "lt", @@ -136,8 +122,7 @@ "slug": "lt", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "lte", @@ -145,8 +130,7 @@ "slug": "lte", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "like", @@ -154,8 +138,7 @@ "slug": "like", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "ilike", @@ -163,8 +146,7 @@ "slug": "ilike", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "is", @@ -172,8 +154,7 @@ "slug": "is", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "in", @@ -181,8 +162,7 @@ "slug": "in", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "contains", @@ -190,8 +170,7 @@ "slug": "contains", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "contained-by", @@ -199,8 +178,7 @@ "slug": "containedby", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "range-gt", @@ -208,8 +186,7 @@ "slug": "rangegt", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "range-gte", @@ -217,8 +194,7 @@ "slug": "rangegte", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "range-lt", @@ -226,8 +202,7 @@ "slug": "rangelt", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "range-lte", @@ -235,8 +210,7 @@ "slug": "rangelte", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "range-adjacent", @@ -244,8 +218,7 @@ "slug": "rangeadjacent", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "overlaps", @@ -253,8 +226,7 @@ "slug": "overlaps", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "text-search", @@ -262,8 +234,7 @@ "slug": "textsearch", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "match", @@ -271,8 +242,7 @@ "slug": "match", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "not", @@ -280,8 +250,7 @@ "slug": "not", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "or", @@ -289,8 +258,7 @@ "slug": "or", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "filter", @@ -298,8 +266,7 @@ "slug": "filter", "product": "database", "parent": "filters", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" } ] }, @@ -311,7 +278,7 @@ "product": "database", "parent": "modifiers", "type": "function", - "libs": ["js", "dart", "dart_v0"], + "items": [ { "id": "db-modifiers-select", @@ -319,8 +286,7 @@ "slug": "db-modifiers-select", "product": "database", "parent": "modifiers", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "order", @@ -328,8 +294,7 @@ "slug": "order", "product": "database", "parent": "modifiers", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "limit", @@ -337,8 +302,7 @@ "slug": "limit", "product": "database", "parent": "modifiers", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "range", @@ -346,8 +310,7 @@ "slug": "range", "product": "database", "parent": "modifiers", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "abort-signal", @@ -355,8 +318,7 @@ "slug": "db-abortsignal", "product": "database", "parent": "modifiers", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "single", @@ -364,8 +326,7 @@ "slug": "single", "product": "database", "parent": "modifiers", - "type": "function", - "libs": ["js", "dart", "dart_v0"] + "type": "function" }, { "id": "maybe-single", @@ -373,8 +334,7 @@ "slug": "maybesingle", "product": "database", "parent": "modifiers", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "csv", @@ -382,8 +342,7 @@ "slug": "db-csv", "product": "database", "parent": "modifiers", - "type": "function", - "libs": ["js"] + "type": "function" } ] } @@ -391,13 +350,13 @@ }, { "title": "Auth", - "libs": ["js", "js_v1", "dart", "dart_v0"], + "items": [ { "id": "auth-api", "title": "Overview", "slug": "auth-api", - "libs": ["js"], + "type": "function" }, { @@ -405,230 +364,202 @@ "title": "Create a new user", "slug": "auth-signup", "product": "auth", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "sign-in", "title": "Sign in a user", "slug": "auth-signin", "product": "auth", - "type": "function", - "libs": ["js_v1", "dart_v0"] + "type": "function" }, { "id": "sign-in-with-provider", "title": "Sign in a user through OAuth", "slug": "auth-signinwithprovider", "product": "auth", - "type": "function", - "libs": ["dart_v0"] + "type": "function" }, { "id": "sign-in-with-password", "title": "Sign in a user", "slug": "auth-signinwithpassword", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "sign-in-with-otp", "title": "Sign in a user through OTP", "slug": "auth-signinwithotp", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "sign-in-with-oauth", "title": "Sign in a user through OAuth", "slug": "auth-signinwithoauth", "product": "auth", - "type": "function", - "libs": ["js", "dart"] + "type": "function" }, { "id": "sign-out", "title": "Sign out a user", "slug": "auth-signout", "product": "auth", - "type": "function", - "libs": ["js", "js_v1", "dart"] + "type": "function" }, { "id": "session", "title": "Retrieve a session", "slug": "auth-session", "product": "auth", - "type": "function", - "libs": ["js_v1"] + "type": "function" }, { "id": "auth-update", "title": "Update a user", "slug": "auth-update", "product": "auth", - "type": "function", - "libs": ["js_v1"] + "type": "function" }, { "id": "set-auth", "title": "Update the access token", "slug": "auth-setauth", "product": "auth", - "type": "function", - "libs": ["js_v1"] + "type": "function" }, { "id": "user", "title": "Retrieve a user", "slug": "auth-user", "product": "auth", - "type": "function", - "libs": ["js_v1"] + "type": "function" }, { "id": "session", "title": "Retrieve a session", "slug": "auth-session", "product": "auth", - "type": "function", - "libs": ["js_v1"] + "type": "function" }, { "id": "verify-otp", "title": "Verify and log in through OTP", "slug": "auth-verifyotp", "product": "auth", - "type": "function", - "libs": ["js", "dart"] + "type": "function" }, { "id": "current-session", "title": "Retrieve a session", "slug": "auth-currentsession", "product": "auth", - "type": "function", - "libs": ["dart"] + "type": "function" }, { "id": "current-user", "title": "Retrieve a user", "slug": "auth-currentuser", "product": "auth", - "type": "function", - "libs": ["dart"] + "type": "function" }, { "id": "get-session", "title": "Retrieve a session", "slug": "auth-getsession", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "refresh-session", "title": "Retrieve a new session", "slug": "auth-refreshsession", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "get-user", "title": "Retrieve a user", "slug": "auth-getuser", "product": "auth", - "type": "function", - "libs": ["js", "js_v1"] + "type": "function" }, { "id": "update-user", "title": "Update a user", "slug": "auth-updateuser", "product": "auth", - "type": "function", - "libs": ["js", "dart"] + "type": "function" }, { "id": "set-session", "title": "Set the session data", "slug": "auth-setsession", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "on-auth-state-change", "title": "Listen to auth events", "slug": "auth-onauthstatechange", "product": "auth", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "reset-password-for-email", "title": "Send a password reset request", "slug": "auth-resetpasswordforemail", "product": "auth", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "mfa-enroll", "title": "Enroll a factor", "slug": "auth-mfa-enroll", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "mfa-challenge", "title": "Create a challenge", "slug": "auth-mfa-challenge", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "mfa-verify", "title": "Verify a challenge", "slug": "auth-mfa-verify", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "mfa-challenge-and-verify", "title": "Create and verify a challenge", "slug": "auth-mfa-challengeandverify", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "mfa-unenroll", "title": "Unenroll a factor", "slug": "auth-mfa-unenroll", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "mfa-get-authenticator-assurance-level", "title": "Get Authenticator Assurance Level", "slug": "auth-mfa-getauthenticatorassurancelevel", "product": "auth", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "admin-api", "title": "Auth Admin", "slug": "admin-api", - "libs": ["js", "js_v1"], + "type": "function", "items": [ { @@ -636,88 +567,77 @@ "title": "Retrieve a user", "slug": "auth-admin-getuserbyid", "product": "auth-admin", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "list-users", "title": "List all users", "slug": "auth-admin-listusers", "product": "auth-admin", - "type": "function", - "libs": ["js", "js_v1"] + "type": "function" }, { "id": "create-user", "title": "Create a user", "slug": "auth-admin-createuser", "product": "auth-admin", - "type": "function", - "libs": ["js", "js_v1"] + "type": "function" }, { "id": "delete-user", "title": "Delete a user", "slug": "auth-admin-deleteuser", "product": "auth-admin", - "type": "function", - "libs": ["js", "js_v1"] + "type": "function" }, { "id": "invite-user-by-email", "title": "Send an email invite link", "slug": "auth-admin-inviteuserbyemail", "product": "auth-admin", - "type": "function", - "libs": ["js", "js_v1"] + "type": "function" }, { "id": "reset-password-for-email", "title": "Send a password reset request", "slug": "auth-admin-resetpasswordforemail", "product": "auth-admin", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "generate-link", "title": "Generate an email link", "slug": "auth-admin-generatelink", "product": "auth-admin", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "send-mobile-otp", "title": "Send a one-time passcode", "slug": "auth-api-sendmobileotp", "product": "auth-server", - "type": "function", - "libs": ["js_v1"] + "type": "function" }, { "id": "update-user-by-id", "title": "Update a user", "slug": "auth-admin-updateuserbyid", "product": "auth-admin", - "type": "function", - "libs": ["js", "js_v1"] + "type": "function" }, { "id": "mfa-list-factors", "title": "List all factors for a user", "slug": "auth-admin-mfa-listfactors", "product": "auth-admin", - "type": "function", - "libs": ["js"] + "type": "function" }, { "id": "mfa-delete-factor", "title": "Delete a factor for a user", "slug": "auth-admin-mfa-deletefactor", "product": "auth-admin", - "type": "function", - "libs": ["js"] + "type": "function" } ] } @@ -725,61 +645,55 @@ }, { "title": "Functions", - "libs": ["js", "js_v1", "dart", "dart_v0"], + "items": [ { "id": "invoke", "title": "Invoke a function", "slug": "auth-admin-invoke", "product": "functions", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" } ] }, { "title": "Realtime", - "libs": ["js", "js_v1", "dart", "dart_v0"], + "items": [ { "id": "stream", "title": "Listen to database changes", "slug": "stream", "product": "realtime", - "type": "function", - "libs": ["dart", "dart_v0"] + "type": "function" }, { "id": "subscribe", "title": "Subscribe to database changes", "slug": "subscribe", "product": "realtime", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "remove-subscription", "title": "Remove a subscription", "slug": "removesubscription", "product": "realtime", - "type": "function", - "libs": ["dart_v0", "js_v1"] + "type": "function" }, { "id": "remove-all-subscriptions", "title": "Remove all subscriptions", "slug": "removeallsubscriptions", "product": "realtime", - "type": "function", - "libs": ["js_v1"] + "type": "function" }, { "id": "get-subscriptions", "title": "Retrieve subscriptions", "slug": "getsubscriptions", "product": "realtime", - "type": "function", - "libs": ["js_v1"] + "type": "function" }, { @@ -787,172 +701,152 @@ "title": "Unsubscribe from a channel", "slug": "removechannel", "product": "realtime", - "type": "function", - "libs": ["js", "dart"] + "type": "function" }, { "id": "remove-all-channels", "title": "Unsubscribe from all channels", "slug": "removeallchannels", "product": "realtime", - "type": "function", - "libs": ["js", "dart"] + "type": "function" }, { "id": "get-channels", "title": "Retrieve all channels", "slug": "getchannels", "product": "realtime", - "type": "function", - "libs": ["js", "dart"] + "type": "function" } ] }, { "title": "Storage", - "libs": ["js", "js_v1", "dart", "dart_v0"], + "items": [ { "id": "create-bucket", "title": "Create a bucket", "slug": "storage-createbucket", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "get-bucket", "title": "Retrieve a bucket", "slug": "storage-getbucket", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "list-buckets", "title": "List all buckets", "slug": "storage-listbuckets", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "update-bucket", "title": "Update a bucket", "slug": "storage-updatebucket", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "delete-bucket", "title": "Delete a bucket", "slug": "storage-deletebucket", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "empty-bucket", "title": "Empty a bucket", "slug": "storage-emptybucket", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "from-upload", "title": "Upload a file", "slug": "storage-from-upload", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "from-download", "title": "Download a file", "slug": "storage-from-download", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "from-list", "title": "List all files in a bucket", "slug": "storage-from-list", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "from-update", "title": "Replace an existing file", "slug": "storage-from-update", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "from-move", "title": "Move an existing file", "slug": "storage-from-move", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "from-copy", "title": "Copy an existing file", "slug": "storage-from-copy", "product": "storage", - "type": "function", - "libs": ["js", "js_v1"] + "type": "function" }, { "id": "from-remove", "title": "Delete files in a bucket", "slug": "storage-from-remove", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "from-create-signed-url", "title": "Create a signed URL", "slug": "storage-from-createsignedurl", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" }, { "id": "from-create-signed-urls", "title": "Create signed URLs", "slug": "storage-from-createsignedurls", "product": "storage", - "type": "function", - "libs": ["js", "js_v1"] + "type": "function" }, { "id": "from-get-public-url", "title": "Retrieve public URL", "slug": "storage-from-getpublicurl", "product": "storage", - "type": "function", - "libs": ["js", "js_v1", "dart", "dart_v0"] + "type": "function" } ] }, { "title": "Misc", - "libs": ["js", "js_v1"], + "items": [ { "title": "Release Notes", "id": "release-notes", "slug": "release-notes", "isFunc": false, - "type": "markdown", - "libs": ["js", "js_v1"] + "type": "markdown" } ] } diff --git a/spec/common-client-libs.yml b/spec/common-client-libs.yml deleted file mode 100644 index 1d2a2b713c6..00000000000 --- a/spec/common-client-libs.yml +++ /dev/null @@ -1,485 +0,0 @@ -openref: 0.1 - -info: - id: reference/common-library-file - title: Supabase Client libs common - description: | - - This file shares info common between the JS and Dart libraries. - -functions: - - id: initializing - title: initializing - slug: initializing - - - id: select - title: 'Fetching data' - slug: select - product: database - - - id: insert - title: 'Insert data' - slug: insert - product: 'database' - - - id: update - title: 'Update data' - slug: update - product: 'database' - - - id: upsert - title: 'Upsert data' - slug: upsert - product: 'database' - - - id: delete - title: 'Delete data' - slug: delete - product: 'database' - - - id: rpc - title: 'Postgres functions' - slug: rpc - product: 'database' - - - id: using-filters - title: 'Using filters' - slug: using-filters - product: 'database' - - - id: eq - title: eq() - slug: eq - product: 'database' - parent: 'Filters' - - - id: neq - title: neq() - slug: neq - product: 'database' - parent: 'Filters' - - - id: gt - title: gt() - slug: gt - product: 'database' - parent: 'Filters' - - - id: gte - title: gte() - slug: gte - product: 'database' - parent: 'Filters' - - - id: lt - title: lt() - slug: lt - product: 'database' - parent: 'Filters' - - - id: lte - title: lte() - slug: lte - product: 'database' - parent: 'Filters' - - - id: like - title: like() - slug: like - product: 'database' - parent: 'Filters' - - - id: ilike - title: ilike() - slug: ilike - product: 'database' - parent: 'Filters' - - - id: is - title: is() - slug: is - product: 'database' - parent: 'Filters' - - - id: in - title: in() - slug: in - product: 'database' - parent: 'Filters' - - - id: contains - title: contains() - slug: contains - product: 'database' - parent: 'Filters' - - - id: contained-by - title: containedBy() - slug: containedby - product: 'database' - parent: 'Filters' - - - id: range-gt - title: rangeGt() - slug: rangegt - product: 'database' - parent: 'Filters' - - - id: range-gte - title: rangeGte() - slug: rangegte - product: 'database' - parent: 'Filters' - - - id: range-lt - title: rangeLt() - slug: rangelt - product: 'database' - parent: 'Filters' - - - id: range-lte - title: rangeLte() - slug: rangelte - product: 'database' - parent: 'Filters' - - - id: range-adjacent - title: rangeAdjacent() - slug: rangeadjacent - product: 'database' - parent: 'Filters' - - - id: overlaps - title: overlaps() - slug: overlaps - product: 'database' - parent: 'Filters' - - - id: text-search - title: textSearch() - slug: textsearch - product: 'database' - parent: 'Filters' - - - id: match - title: match() - slug: match - product: 'database' - parent: 'Filters' - - - id: not - title: not() - slug: not - product: 'database' - parent: 'Filters' - - - id: or - title: or() - slug: or - product: 'database' - parent: 'Filters' - - - id: filter - title: filter() - slug: filter - product: 'database' - parent: 'Filters' - - - id: using-modifiers - title: Using Modifiers - slug: using-modifiers - product: 'database' - parent: 'Modifiers' - - - id: db-modifiers-select - title: select() - slug: db-modifiers-select - product: 'database' - parent: 'Modifiers' - - - id: order - title: order() - slug: order - product: 'database' - parent: 'Modifiers' - - - id: limit - title: limit() - slug: limit - product: 'database' - parent: 'Modifiers' - - - id: range - title: range() - slug: range - product: 'database' - parent: 'Modifiers' - - - id: abort-signal - title: abortSignal() - slug: db-abortsignal - product: 'database' - parent: 'Modifiers' - - - id: single - title: single() - slug: single - product: 'database' - parent: 'Modifiers' - - - id: maybe-single - title: maybeSingle() - slug: maybesingle - product: 'database' - parent: 'Modifiers' - - - id: csv - title: csv() - slug: db-csv - product: 'database' - parent: 'Modifiers' - - - id: sign-up - title: Sign up - slug: auth-signup - product: 'auth' - - - id: sign-in - title: Sign in - slug: auth-signin - product: 'auth' - - - id: set-auth - title: setAuth() - slug: auth-setauth - product: 'auth' - - - id: send-mobile-otp - title: sendMobileOTP() - slug: auth-api-sendmobileotp - product: 'auth' - - - id: sign-in-with-password - title: Sign in with password - slug: auth-signinwithpassword - product: 'auth' - - - id: sign-in-with-otp - title: Sign in with OTP - slug: auth-signinwithotp - product: 'auth' - - - id: sign-in-with-oauth - title: Sign in with 0auth - slug: auth-signinwithoauth - product: 'auth' - - - id: sign-out - title: signOut() - slug: auth-signout - product: 'auth' - - - id: verify-otp - title: verifyOtp() - slug: auth-verifyotp - product: 'auth' - - - id: get-session - title: getSession() - slug: auth-getsession - product: 'auth' - - - id: get-user - title: getUser() - slug: auth-getuser - product: 'auth' - - - id: update-user - title: updateUser() - slug: auth-updateuser - product: 'auth' - - - id: set-session - title: setSession() - slug: auth-setsession - product: 'auth' - - - id: refresh-session - title: refreshSession() - slug: auth-refreshsession - product: 'auth' - - - id: on-auth-state-change - title: onAuthStateChange() - slug: auth-onauthstatechange - product: 'auth' - - - id: admin-api - title: Overview - slug: supabase-auth-admin-api - product: 'auth-admin' - - - id: get-user-by-id - title: getUserById() - slug: auth-admin-getuserbyid - product: 'auth-admin' - - - id: list-users - title: listUsers() - slug: auth-admin-listusers - product: 'auth-admin' - - - id: create-user - title: createUser() - slug: auth-admin-createuser - product: 'auth-admin' - - - id: delete-user - title: deleteUser() - slug: auth-admin-deleteuser - product: 'auth-admin' - - - id: invite-user-by-email - title: inviteUserByEmail() - slug: auth-admin-inviteuserbyemail - product: 'auth-admin' - - - id: reset-password-for-email - title: resetPasswordForEmail() - slug: auth-admin-resetpasswordforemail - product: 'auth-admin' - - - id: generate-link - title: generateLink() - slug: auth-admin-generatelink - product: 'auth-admin' - - - id: update-user-by-id - title: updateUserById() - slug: auth-admin-updateuserbyid - product: 'auth-admin' - - - id: invoke - title: invoke() - slug: auth-admin-invoke - product: 'functions' - - - id: stream - title: stream() - slug: stream - product: 'realtime' - - - id: subscribe - title: on().subscribe() - slug: subscribe - product: 'realtime' - - - id: remove-subscription - title: removeSubscription() - slug: removesubscription - product: 'realtime' - - - id: remove-all-subscriptions - title: removeallsubscriptions() - slug: removeallsubscriptions - product: 'realtime' - - - id: get-subscriptions - title: getSubscriptions() - slug: getsubscriptions - product: 'realtime' - - - id: get-channels - title: getChannels() - slug: getchannels - product: 'realtime' - - - id: remove-channel - title: removeChannel() - slug: removechannel - product: 'realtime' - - - id: remove-all-channels - title: removeAllChannels() - slug: removeallchannels - product: 'realtime' - - - id: list-buckets - title: listBuckets() - slug: storage-listbuckets - product: 'storage' - - - id: get-bucket - title: getBucket() - slug: storage-getbucket - product: 'storage' - - - id: create-bucket - title: createBucket() - slug: storage-createbucket - product: 'storage' - - - id: empty-bucket - title: emptyBucket() - slug: storage-emptybucket - product: 'storage' - - - id: update-bucket - title: updateBucket() - slug: storage-updatebucket - product: 'storage' - - - id: delete-bucket - title: deleteBucket() - slug: storage-deletebucket - product: 'storage' - - - id: from-upload - title: from.upload() - slug: storage-from-upload - product: 'storage' - - - id: from-update - title: from.update() - slug: storage-from-update - product: 'storage' - - - id: from-move - title: from.move() - slug: storage-from-move - product: 'storage' - - - id: from-copy - title: from.copy() - slug: storage-from-copy - product: 'storage' - - - id: from-create-signed-url - title: from.createSignedUrl() - slug: storage-from-createsignedurl - product: 'storage' - - - id: from-create-signed-urls - title: from.createSignedUrls() - slug: storage-from-createsignedurls - product: 'storage' - - - id: from-get-public-url - title: from.getPublicUrl() - slug: storage-from-getpublicurl - product: 'storage' - - - id: from-download - title: from.download() - slug: storage-from-download - product: 'storage' - - - id: from-remove - title: from.remove() - slug: storage-from-remove - product: 'storage' - - - id: from-list - title: from.list() - slug: storage-from-list - product: 'storage' From 0d93c8b5e4817af637283ece3fb4aa6aa7a57360 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Fri, 6 Jan 2023 15:29:13 -0330 Subject: [PATCH 02/21] Remove references to new_docs --- .../reference/RefSectionHandler.tsx | 4 +-- apps/docs/lib/mdx/handleRefStaticProps.tsx | 31 +++---------------- apps/docs/pages/guides/auth/overview.mdx | 10 ++---- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/apps/docs/components/reference/RefSectionHandler.tsx b/apps/docs/components/reference/RefSectionHandler.tsx index d54e5d616bb..8f981bcbb91 100644 --- a/apps/docs/components/reference/RefSectionHandler.tsx +++ b/apps/docs/components/reference/RefSectionHandler.tsx @@ -24,12 +24,10 @@ const RefSectionHandler = (props) => { const slug = router.query.slug[0] - const isNewDocs = process.env.NEXT_PUBLIC_NEW_DOCS === 'true' - // When user lands on a url like http://supabase.com/docs/reference/javascript/sign-up // find the #sign-up element and scroll to that useEffect(() => { - if (isNewDocs && document && slug !== 'start') { + if (document && slug !== 'start') { document.querySelector(`#${slug}`) && document.querySelector(`#${slug}`).scrollIntoView() } }) diff --git a/apps/docs/lib/mdx/handleRefStaticProps.tsx b/apps/docs/lib/mdx/handleRefStaticProps.tsx index c9c47b4496d..c97245387f9 100644 --- a/apps/docs/lib/mdx/handleRefStaticProps.tsx +++ b/apps/docs/lib/mdx/handleRefStaticProps.tsx @@ -1,33 +1,12 @@ -import generateOldRefMarkdown from '~/lib/mdx/generateOldRefMarkdown' import generateRefMarkdown from '~/lib/mdx/generateRefMarkdown' -async function handleRefStaticProps(sections, params, librarypath, urlPath) { +async function handleRefStaticProps(sections, librarypath) { let markdownContent = await generateRefMarkdown(sections, librarypath) - /* - * old content generation - * this is for grabbing to old markdown files - */ - - let slug - if (params.slug.length > 1) { - slug = `docs/reference${urlPath}/${params.slug.join('/')}` - } else { - slug = `docs/reference${urlPath}/${params.slug[0]}` - } - - /* - * handle old ref pages - */ - if (process.env.NEXT_PUBLIC_NEW_DOCS === 'false') { - const oldMarkdown = await generateOldRefMarkdown(slug) - return oldMarkdown - } else { - return { - props: { - docs: markdownContent, - }, - } + return { + props: { + docs: markdownContent, + }, } } diff --git a/apps/docs/pages/guides/auth/overview.mdx b/apps/docs/pages/guides/auth/overview.mdx index 97044096e13..d46b0eb3e9d 100644 --- a/apps/docs/pages/guides/auth/overview.mdx +++ b/apps/docs/pages/guides/auth/overview.mdx @@ -1,5 +1,5 @@ import Layout from '~/layouts/DefaultGuideLayout' -import NewContent from '~/pages/new/auth.mdx' + import { useRouter } from 'next/router' export const meta = { @@ -174,12 +174,6 @@ When users sign up, Supabase assigns them a unique ID. You can reference this ID -export const Page = ({ children }) => { - const router = useRouter() - if (process.env.NEXT_PUBLIC_NEW_DOCS === 'true' && !router.asPath.includes('overview')) { - return NewContent() - } - return -} +export const Page = ({ children }) => export default Page From 21b1c5a3df0c40885a715c50e0c6a64771da86cf Mon Sep 17 00:00:00 2001 From: dng Date: Fri, 6 Jan 2023 11:08:56 -0800 Subject: [PATCH 03/21] Update readme --- apps/docs/DEVELOPERS.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/docs/DEVELOPERS.md b/apps/docs/DEVELOPERS.md index bd54993a356..6b0dadd2641 100644 --- a/apps/docs/DEVELOPERS.md +++ b/apps/docs/DEVELOPERS.md @@ -7,7 +7,7 @@ Thanks for your interest in [Supabase docs](https://supabase.com/docs) and for w [existing issues](https://github.com/supabase/supabase/issues). This document describes how to set up your development environment to contribute to [Supabase docs](https://supabase.com/docs). -For a complete run-down on how all of our tools work together, see the main DEVELOPERS.md. That readme describes how to get setup locally in lots of detail, including details minimum requirements, our Turborepo setup, installing packages, sharing components across projects and more. This readme deals specifically with the docs site. +For a complete run-down on how all of our tools work together, see the main DEVELOPERS.md. That readme describes how to get set up locally in lots of detail, including minimum requirements, our Turborepo setup, installing packages, sharing components across projects, and more. This readme deals specifically with the docs site. ## Local setup @@ -24,7 +24,7 @@ For a complete run-down on how all of our tools work together, see the main DEVE ### Guides -The primary, instructional type of content. Basically anything that lives on the `https://supabase.com/docs/guides` route. This includes Guides for Auth, Database, Storage, Realtime as well as general resources, self-hosting instructions and integrations. These are all [`.mdx`](https://mdxjs.com/) files — a combination of Markdown and Javascript. +The primary, instructional type of content. Basically anything that lives on the `https://supabase.com/docs/guides` route. This includes Guides for Auth, Database, Storage, Realtime, Edge Functions, as well as general resources, self-hosting instructions, and integrations. These are all [`.mdx`](https://mdxjs.com/) files — a combination of Markdown and Javascript. #### Things to know @@ -36,7 +36,7 @@ Some things to note: 2. The files need to export a `Page` at the bottom with the `` component 3. The files frontmatter is stored in `const meta = {}`. You should always include `id`, `title` and `description`. 4. You can write Markdown as you normally would, but you can also write regular Javascript and JSX. Note the `examples` array that we iterate over. -5. Any Javascript variables you use in these files need to be exported in order to be used. IE: `export const examples = []` +5. Any Javascript variables you use in these files need to be exported in order to be used (i.e., `export const examples = []`). ##### Using components @@ -46,7 +46,7 @@ You can use any standard React components in these `.mdx` files without having t We maintain client libraries for [Javascript](https://supabase.com/docs/reference/javascript) and [Flutter/Dart](https://supabase.com/docs/reference/dart) (with more to come). These reference docs document every object and method available for developers to use. The are assembled from different sources and work much differently than the `.mdx` Guides we just looked at. -The client libraries are essentially wrappers around the clients for the various tools we use — GoTrue, PostgREST, Storage, Functions and Realtime. The easiest way to describe how the things fit together is to look at an example and trace where the various pieces of information are coming from. +The client libraries are essentially wrappers around the clients for the various tools we use — GoTrue, PostgREST, Storage, Functions, and Realtime. The easiest way to describe how the things fit together is to look at an example and trace where the various pieces of information are coming from. #### Example @@ -54,17 +54,17 @@ Let's look at the `updateUser()` function in the `supabase-js` library. #### Common file -Several pieces of information for this function come from a [common file](https://github.com/supabase/supabase/blob/master/spec/common-client-libs-sections.json#L548) where we store information shared by all libraries. +Several pieces of information for this function come from a [common file](https://github.com/supabase/supabase/blob/3d774b3b7bcdcb410e25726d832467584ebea686/spec/common-client-libs-sections.json#L548) where we store information shared by all libraries. 1. id — used to identify this function 2. title - the human-readable title 3. slug — the url slug -4. product - the supabase tool or product that "owns" this function. Since `updateUser()` is an auth function, it's product is `auth` +4. product - the Supabase tool or product that "owns" this function. Since `updateUser()` is an auth function, its product is `auth` 5. type — `updateUser()` is a function and marked as such, but we can also have sections of markdown interspersed with these function definitions. #### Function Parameters -The `updateUser()` function takes one parameter: `attributes`. The details for this parameter live in the GoTrue client library, referenced via a `$ref` property in the `supabase-js` [spec file](https://github.com/supabase/supabase/blob/master/spec/supabase_js_v2.yml#L357). Here, the `$ref` property is pointing to the [actual function definition](https://github.com/supabase/gotrue-js/blob/master/src/GoTrueClient.ts#L590) in the `gotrue-js` library. The accepted values for the `attributes` parameter come from the [type definition](https://github.com/supabase/gotrue-js/blob/16d3deb822097e8640a3a15b94a5690b3beaf11b/src/lib/types.ts#L233). +The `updateUser()` function takes one parameter: `attributes`. The details for this parameter live in the GoTrue client library, referenced via a `$ref` property in the `supabase-js` [spec file](https://github.com/supabase/supabase/blob/cb04d85262db6a371539dda7df9b00ba5a901e87/spec/supabase_js_v2.yml#L357). Here, the `$ref` property is pointing to the [actual function definition](https://github.com/supabase/gotrue-js/blob/2d60e79073b96ae8c97a6ce18e2601ed1e2a2712/src/GoTrueClient.ts#L590) in the `gotrue-js` library. The accepted values for the `attributes` parameter come from the [type definition](https://github.com/supabase/gotrue-js/blob/16d3deb822097e8640a3a15b94a5690b3beaf11b/src/lib/types.ts#L233). These individual library spec files are fetched via this [Makefile](https://github.com/supabase/supabase/blob/master/spec/Makefile), and get [transformed](https://github.com/supabase/supabase/blob/master/spec/enrichments/tsdoc_v2/supabase_dereferenced.json) to combine the information we need (params, types, etc). If you're working on docs, you likely won't need to touch this part of the setup, but we've included this detail here to point you in the right direction in case you do. @@ -74,11 +74,11 @@ The `updateUser()` function has three examples listed with it. The examples are #### Rendering in Next.JS -These reference docs are rendered by Next.JS via a dynamic route using a [`[...slug.tsx]`](https://github.com/supabase/supabase/blob/master/apps/docs/pages/reference/javascript/%5B...slug%5D.tsx). Here, we use the library [spec file](https://github.com/supabase/supabase/blob/master/apps/docs/pages/reference/javascript/%5B...slug%5D.tsx#L4) and the [common file](https://github.com/supabase/supabase/blob/master/apps/docs/pages/reference/javascript/%5B...slug%5D.tsx#L1) to output the info you see on the page. +These reference docs are rendered by Next.JS via a dynamic route using a [`[...slug.tsx]`](https://github.com/supabase/supabase/blob/master/apps/docs/pages/reference/javascript/%5B...slug%5D.tsx). Here, we use the library [spec file](https://github.com/supabase/supabase/blob/bd0514553c627db8f1e8d0b3ae440ccb6759d228/apps/docs/pages/reference/javascript/%5B...slug%5D.tsx#L4) and the [common file](https://github.com/supabase/supabase/blob/bd0514553c627db8f1e8d0b3ae440ccb6759d228/apps/docs/pages/reference/javascript/%5B...slug%5D.tsx#L1) to output the info you see on the page. ### Other reference docs -The reference docs for the [Supabase Management API](https://supabase.com/docs/reference/api) and the [Supabase CLI](https://supabase.com/docs/reference/cli) are a little more straightforward than the client libraries. Both files also have a [common file](https://github.com/supabase/supabase/blob/master/spec/common-cli-sections.json) which handles things like `title`, `id` and `slug`. Both also have a spec file detailing things like parameters, descriptions and responses ([Management API](https://github.com/supabase/supabase/blob/master/spec/api_v0_openapi.json) / [CLI](https://github.com/supabase/supabase/blob/master/spec/cli_v1_commands.yaml)) +The reference docs for the [Supabase Management API](https://supabase.com/docs/reference/api) and the [Supabase CLI](https://supabase.com/docs/reference/cli) are a little more straightforward than the client libraries. Both files also have a [common file](https://github.com/supabase/supabase/blob/master/spec/common-cli-sections.json) which handles things like `title`, `id` and `slug`. Both also have a spec file detailing things like parameters, descriptions, and responses ([Management API](https://github.com/supabase/supabase/blob/master/spec/api_v0_openapi.json) / [CLI](https://github.com/supabase/supabase/blob/master/spec/cli_v1_commands.yaml)) On the Next.JS side of things, these work almost exactly the same as the client libaries with a dynamic [`[...slug.tsx]`](https://github.com/supabase/supabase/blob/master/apps/docs/pages/reference/cli/%5B...slug%5D.tsx). From e3da1e72bfd53e59e01f1420198483adb3a35741 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Fri, 6 Jan 2023 16:02:02 -0330 Subject: [PATCH 04/21] Cleanup getStaticProps --- apps/docs/pages/reference/api/[...slug].tsx | 4 ++-- apps/docs/pages/reference/cli/[...slug].tsx | 4 ++-- apps/docs/pages/reference/dart/[...slug].tsx | 4 ++-- apps/docs/pages/reference/dart/crawlers/[...slug].tsx | 4 ++-- apps/docs/pages/reference/dart/v0/[...slug].tsx | 4 ++-- apps/docs/pages/reference/dart/v0/crawlers/[...slug].tsx | 4 ++-- apps/docs/pages/reference/javascript/[...slug].tsx | 4 ++-- apps/docs/pages/reference/javascript/crawlers/[...slug].tsx | 4 ++-- apps/docs/pages/reference/javascript/v1/[...slug].tsx | 4 ++-- .../docs/pages/reference/javascript/v1/crawlers/[...slug].tsx | 4 ++-- apps/docs/pages/reference/self-hosting-auth/[...slug].tsx | 4 ++-- apps/docs/pages/reference/self-hosting-realtime/[...slug].tsx | 4 ++-- apps/docs/pages/reference/self-hosting-storage/[...slug].tsx | 4 ++-- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/apps/docs/pages/reference/api/[...slug].tsx b/apps/docs/pages/reference/api/[...slug].tsx index 58d617d5cac..382c882a190 100644 --- a/apps/docs/pages/reference/api/[...slug].tsx +++ b/apps/docs/pages/reference/api/[...slug].tsx @@ -15,8 +15,8 @@ export default function Config(props) { return } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/api', '/api') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/api') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/cli/[...slug].tsx b/apps/docs/pages/reference/cli/[...slug].tsx index 2e4a2218b3e..3555095ee72 100644 --- a/apps/docs/pages/reference/cli/[...slug].tsx +++ b/apps/docs/pages/reference/cli/[...slug].tsx @@ -14,8 +14,8 @@ export default function CliRef(props) { return } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/cli', '/cli') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/cli') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/dart/[...slug].tsx b/apps/docs/pages/reference/dart/[...slug].tsx index 4fecc97170d..735ae57f35f 100644 --- a/apps/docs/pages/reference/dart/[...slug].tsx +++ b/apps/docs/pages/reference/dart/[...slug].tsx @@ -12,8 +12,8 @@ export default function JSReference(props) { return } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/dart', '/dart') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/dart') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/dart/crawlers/[...slug].tsx b/apps/docs/pages/reference/dart/crawlers/[...slug].tsx index c12f3cabbf2..0b62b1ca55b 100644 --- a/apps/docs/pages/reference/dart/crawlers/[...slug].tsx +++ b/apps/docs/pages/reference/dart/crawlers/[...slug].tsx @@ -34,8 +34,8 @@ export default function JSReference(props) { ) } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/dart', '/dart') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/dart') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/dart/v0/[...slug].tsx b/apps/docs/pages/reference/dart/v0/[...slug].tsx index f0daf4e9d6e..9a74ea2583d 100644 --- a/apps/docs/pages/reference/dart/v0/[...slug].tsx +++ b/apps/docs/pages/reference/dart/v0/[...slug].tsx @@ -12,8 +12,8 @@ export default function JSReference(props) { return } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/dart/v0', '/dart/v0') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/dart/v0') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/dart/v0/crawlers/[...slug].tsx b/apps/docs/pages/reference/dart/v0/crawlers/[...slug].tsx index 2e67a5b5c8e..18d7c8cac37 100644 --- a/apps/docs/pages/reference/dart/v0/crawlers/[...slug].tsx +++ b/apps/docs/pages/reference/dart/v0/crawlers/[...slug].tsx @@ -33,8 +33,8 @@ export default function JSReference(props) { ) } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/dart/v0', '/dart/v0') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/dart/v0') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/javascript/[...slug].tsx b/apps/docs/pages/reference/javascript/[...slug].tsx index cab58348221..31e44d594aa 100644 --- a/apps/docs/pages/reference/javascript/[...slug].tsx +++ b/apps/docs/pages/reference/javascript/[...slug].tsx @@ -13,8 +13,8 @@ export default function JSReference(props) { return } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/javascript', '/javascript') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/javascript') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx b/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx index 2e6e0b271a9..feebcf6998e 100644 --- a/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx +++ b/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx @@ -34,8 +34,8 @@ export default function JSReference(props) { ) } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/javascript', '/javascript') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/javascript') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/javascript/v1/[...slug].tsx b/apps/docs/pages/reference/javascript/v1/[...slug].tsx index d54c9df6d94..1eeb40044f1 100644 --- a/apps/docs/pages/reference/javascript/v1/[...slug].tsx +++ b/apps/docs/pages/reference/javascript/v1/[...slug].tsx @@ -13,8 +13,8 @@ export default function JSReference(props) { return } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/javascript/v1', '/javascript/v1') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/javascript/v1') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx b/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx index bbb38f4598a..3f59baad46e 100644 --- a/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx +++ b/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx @@ -33,8 +33,8 @@ export default function JSReference(props) { ) } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/javascript/v1', '/javascript/v1') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/javascript/v1') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/self-hosting-auth/[...slug].tsx b/apps/docs/pages/reference/self-hosting-auth/[...slug].tsx index 819fd773892..64c91fb4f5e 100644 --- a/apps/docs/pages/reference/self-hosting-auth/[...slug].tsx +++ b/apps/docs/pages/reference/self-hosting-auth/[...slug].tsx @@ -15,8 +15,8 @@ export default function JSReference(props) { return } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/self-hosting-auth', '/self-hosting-auth') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/self-hosting-auth') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/self-hosting-realtime/[...slug].tsx b/apps/docs/pages/reference/self-hosting-realtime/[...slug].tsx index 240ea180f0c..beb4f192715 100644 --- a/apps/docs/pages/reference/self-hosting-realtime/[...slug].tsx +++ b/apps/docs/pages/reference/self-hosting-realtime/[...slug].tsx @@ -12,8 +12,8 @@ export default function JSReference(props) { return } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/self-hosting-realtime', '/self-hosting-realtime') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/self-hosting-realtime') } export function getStaticPaths() { diff --git a/apps/docs/pages/reference/self-hosting-storage/[...slug].tsx b/apps/docs/pages/reference/self-hosting-storage/[...slug].tsx index 2d2de874622..ea76596b3f8 100644 --- a/apps/docs/pages/reference/self-hosting-storage/[...slug].tsx +++ b/apps/docs/pages/reference/self-hosting-storage/[...slug].tsx @@ -15,8 +15,8 @@ export default function JSReference(props) { return } -export async function getStaticProps({ params }: { params: { slug: string[] } }) { - return handleRefStaticProps(sections, params, '/self-hosting-storage', '/self-hosting-storage') +export async function getStaticProps() { + return handleRefStaticProps(sections, '/self-hosting-storage') } export function getStaticPaths() { From 8d4717814bdac7f7c502e0d5df911f89df9e5802 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Mon, 9 Jan 2023 12:35:59 -0330 Subject: [PATCH 05/21] You get a type, and you get a type, and you get a type --- .../reference/CLICommandSection.tsx | 2 +- .../reference/RefFunctionSection.tsx | 18 +- .../reference/RefSectionHandler.tsx | 17 +- .../components/reference/Reference.types.ts | 109 +++++++ apps/docs/lib/refGenerator/helpers.ts | 9 + apps/docs/pages/reference/api/[...slug].tsx | 1 + apps/docs/pages/reference/dart/[...slug].tsx | 2 +- .../reference/dart/crawlers/[...slug].tsx | 1 + .../pages/reference/dart/v0/[...slug].tsx | 2 +- .../reference/dart/v0/crawlers/[...slug].tsx | 1 + .../pages/reference/javascript/[...slug].tsx | 10 +- .../javascript/crawlers/[...slug].tsx | 1 + .../reference/javascript/v1/[...slug].tsx | 10 +- .../javascript/v1/crawlers/[...slug].tsx | 1 + .../reference/self-hosting-auth/[...slug].tsx | 2 +- .../self-hosting-realtime/[...slug].tsx | 2 +- .../self-hosting-storage/[...slug].tsx | 2 +- apps/docs/public/sitemap.xml | 300 ++++++++++-------- 18 files changed, 330 insertions(+), 160 deletions(-) create mode 100644 apps/docs/components/reference/Reference.types.ts diff --git a/apps/docs/components/reference/CLICommandSection.tsx b/apps/docs/components/reference/CLICommandSection.tsx index 9f685157482..f7e86190b4e 100644 --- a/apps/docs/components/reference/CLICommandSection.tsx +++ b/apps/docs/components/reference/CLICommandSection.tsx @@ -16,7 +16,7 @@ interface ICommonFunc { } interface IRefFunctionSection { - funcData: any + funcData: ICommonFunc commonFuncData: ICommonFunc spec: any } diff --git a/apps/docs/components/reference/RefFunctionSection.tsx b/apps/docs/components/reference/RefFunctionSection.tsx index 5cdacd0d458..14f74a45c44 100644 --- a/apps/docs/components/reference/RefFunctionSection.tsx +++ b/apps/docs/components/reference/RefFunctionSection.tsx @@ -10,22 +10,7 @@ import { extractTsDocNode, generateParameters } from '~/lib/refGenerator/helpers import RefDetailCollapse from '~/components/reference/RefDetailCollapse' import { Fragment } from 'react' - -interface ICommonFunc { - id: string - title: string - slug: string - product: string - libs: string - items: ICommonFunc[] -} - -interface IRefFunctionSection { - funcData: any - commonFuncData: ICommonFunc - spec: any - typeSpec?: any -} +import { IRefFunctionSection } from './Reference.types' const RefFunctionSection: React.FC = (props) => { const item = props.spec.functions.find((x: any) => x.id === props.funcData.id) @@ -204,7 +189,6 @@ const RefFunctionSection: React.FC = (props) => { )} - { +const RefSectionHandler = (props: RefSectionHandlerProps) => { + console.log('props', props) const router = useRouter() const slug = router.query.slug[0] diff --git a/apps/docs/components/reference/Reference.types.ts b/apps/docs/components/reference/Reference.types.ts new file mode 100644 index 00000000000..663f633ebd2 --- /dev/null +++ b/apps/docs/components/reference/Reference.types.ts @@ -0,0 +1,109 @@ +import { enrichedOperation } from '~/lib/refGenerator/helpers' + +export interface ISpec { + openref: any + info: { + id: string + title: string + description: string + definition: string + libraries: any + slugPrefix: string + specUrl: string + } + functions: IFunctionDefinition[] +} + +export interface IAPISpec { + info: { + title: string + description?: string + version: string + contact?: {} + } + operations: enrichedOperation[] + sections: any +} + +export interface IFunctionDefinition { + title: string + id: string + $ref: string + description: string + examples?: [] +} + +export interface ICommonFunc { + id: string + title: string + slug: string + product: string + type: string + parent?: string + items: ICommonFunc[] +} + +export interface IRefFunctionSection { + funcData: any + commonFuncData: ICommonFunc + spec: any + typeSpec?: TypeSpec +} + +export interface IRefStaticDoc { + id: string + title: string + meta: { + id: string + title: string + hideTitle: boolean + } + content: { + compiledSource: string + frontmatter: {} + scope: {} + } +} + +export type TypeSpec = { + name: string + children: TypeSpecChild[] +} + +export type TypeSpecChild = { + id: number + name: string + kind: number + kindString?: string + flags?: {} + originalName?: string + children?: TypeSpecChild[] + defaultValue?: string + default?: any + groups?: any + sources?: any + target?: any + comment?: TypeSpecChildComment + typeParameter?: any + implementedTypes?: any + extendedTypes?: any + dereferenced?: TypeSpecChildComment + extendedBy?: any + indexSignature?: any + extendsType?: any + objectType?: any + trueType?: any + falseType?: any + type?: any + signatures?: any + overwrites?: any + inheritedFrom?: any + implementationOf?: any +} + +export interface TypeSpecChildComment { + shortText?: string + text?: string | null + returns?: string | null + tags?: any +} diff --git a/apps/docs/lib/refGenerator/helpers.ts b/apps/docs/lib/refGenerator/helpers.ts index 9c14a80167f..251a101add0 100644 --- a/apps/docs/lib/refGenerator/helpers.ts +++ b/apps/docs/lib/refGenerator/helpers.ts @@ -23,6 +23,9 @@ export function extractTsDocNode(nodeToFind: string, definition: any) { } export function generateParameters(tsDefinition: any) { + if (!tsDefinition.signatures) { + console.log('tsDefinition', tsDefinition.signatures) + } let functionDeclaration = null if (tsDefinition.kindString == 'Method') { functionDeclaration = tsDefinition @@ -218,6 +221,12 @@ export type enrichedOperation = OpenAPIV3.OperationObject & { operationId: string operation: string responseList: [] + description?: string + parameters?: [] + responses?: {} + security?: [] + summary?: string + tags?: [] } export function gen_v3(spec: OpenAPIV3.Document, dest: string, { apiUrl }: { apiUrl: string }) { diff --git a/apps/docs/pages/reference/api/[...slug].tsx b/apps/docs/pages/reference/api/[...slug].tsx index 382c882a190..859c3af9e0b 100644 --- a/apps/docs/pages/reference/api/[...slug].tsx +++ b/apps/docs/pages/reference/api/[...slug].tsx @@ -12,6 +12,7 @@ const generatedSpec = gen_v3(specFile, 'wat', { apiUrl: 'apiv0' }) const sections = flattenSections(apiCommonSections) export default function Config(props) { + console.log('generatedSpec', generatedSpec) return } diff --git a/apps/docs/pages/reference/dart/[...slug].tsx b/apps/docs/pages/reference/dart/[...slug].tsx index 735ae57f35f..f35f74c6120 100644 --- a/apps/docs/pages/reference/dart/[...slug].tsx +++ b/apps/docs/pages/reference/dart/[...slug].tsx @@ -9,7 +9,7 @@ import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' const sections = flattenSections(clientLibsCommonSections) export default function JSReference(props) { - return + return } export async function getStaticProps() { diff --git a/apps/docs/pages/reference/dart/crawlers/[...slug].tsx b/apps/docs/pages/reference/dart/crawlers/[...slug].tsx index 0b62b1ca55b..036933a1682 100644 --- a/apps/docs/pages/reference/dart/crawlers/[...slug].tsx +++ b/apps/docs/pages/reference/dart/crawlers/[...slug].tsx @@ -29,6 +29,7 @@ export default function JSReference(props) { spec={spec} typeSpec={typeSpec} pageProps={props} + type="client-lib" /> ) diff --git a/apps/docs/pages/reference/dart/v0/[...slug].tsx b/apps/docs/pages/reference/dart/v0/[...slug].tsx index 9a74ea2583d..4b6a485d9c6 100644 --- a/apps/docs/pages/reference/dart/v0/[...slug].tsx +++ b/apps/docs/pages/reference/dart/v0/[...slug].tsx @@ -9,7 +9,7 @@ import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' const sections = flattenSections(clientLibsCommonSections) export default function JSReference(props) { - return + return } export async function getStaticProps() { diff --git a/apps/docs/pages/reference/dart/v0/crawlers/[...slug].tsx b/apps/docs/pages/reference/dart/v0/crawlers/[...slug].tsx index 18d7c8cac37..8539659431d 100644 --- a/apps/docs/pages/reference/dart/v0/crawlers/[...slug].tsx +++ b/apps/docs/pages/reference/dart/v0/crawlers/[...slug].tsx @@ -28,6 +28,7 @@ export default function JSReference(props) { spec={spec} typeSpec={typeSpec} pageProps={props} + type="client-lib" /> ) diff --git a/apps/docs/pages/reference/javascript/[...slug].tsx b/apps/docs/pages/reference/javascript/[...slug].tsx index 31e44d594aa..3cbbcc08694 100644 --- a/apps/docs/pages/reference/javascript/[...slug].tsx +++ b/apps/docs/pages/reference/javascript/[...slug].tsx @@ -10,7 +10,15 @@ import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' const sections = flattenSections(clientLibsCommonSections) export default function JSReference(props) { - return + return ( + + ) } export async function getStaticProps() { diff --git a/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx b/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx index feebcf6998e..67c72c5151c 100644 --- a/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx +++ b/apps/docs/pages/reference/javascript/crawlers/[...slug].tsx @@ -29,6 +29,7 @@ export default function JSReference(props) { spec={spec} typeSpec={typeSpec} pageProps={props} + type="client-lib" /> ) diff --git a/apps/docs/pages/reference/javascript/v1/[...slug].tsx b/apps/docs/pages/reference/javascript/v1/[...slug].tsx index 1eeb40044f1..4dd32c156ca 100644 --- a/apps/docs/pages/reference/javascript/v1/[...slug].tsx +++ b/apps/docs/pages/reference/javascript/v1/[...slug].tsx @@ -10,7 +10,15 @@ import handleRefStaticProps from '~/lib/mdx/handleRefStaticProps' const sections = flattenSections(clientLibsCommonSections) export default function JSReference(props) { - return + return ( + + ) } export async function getStaticProps() { diff --git a/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx b/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx index 3f59baad46e..18c498125ef 100644 --- a/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx +++ b/apps/docs/pages/reference/javascript/v1/crawlers/[...slug].tsx @@ -28,6 +28,7 @@ export default function JSReference(props) { spec={spec} typeSpec={typeSpec} pageProps={props} + type="client-lib" /> ) diff --git a/apps/docs/pages/reference/self-hosting-auth/[...slug].tsx b/apps/docs/pages/reference/self-hosting-auth/[...slug].tsx index 64c91fb4f5e..c7b2382af16 100644 --- a/apps/docs/pages/reference/self-hosting-auth/[...slug].tsx +++ b/apps/docs/pages/reference/self-hosting-auth/[...slug].tsx @@ -12,7 +12,7 @@ const sections = flattenSections(selfHostingAuthCommonSections) const spec = gen_v3(authSpec, 'wat', { apiUrl: 'apiv0' }) export default function JSReference(props) { - return + return } export async function getStaticProps() { diff --git a/apps/docs/pages/reference/self-hosting-realtime/[...slug].tsx b/apps/docs/pages/reference/self-hosting-realtime/[...slug].tsx index beb4f192715..49e91894a06 100644 --- a/apps/docs/pages/reference/self-hosting-realtime/[...slug].tsx +++ b/apps/docs/pages/reference/self-hosting-realtime/[...slug].tsx @@ -9,7 +9,7 @@ import { gen_v3 } from '~/lib/refGenerator/helpers' const sections = flattenSections(selfHostingRealtimeCommonSections) export default function JSReference(props) { - return + return } export async function getStaticProps() { diff --git a/apps/docs/pages/reference/self-hosting-storage/[...slug].tsx b/apps/docs/pages/reference/self-hosting-storage/[...slug].tsx index ea76596b3f8..1b4b99fb9c8 100644 --- a/apps/docs/pages/reference/self-hosting-storage/[...slug].tsx +++ b/apps/docs/pages/reference/self-hosting-storage/[...slug].tsx @@ -12,7 +12,7 @@ const sections = flattenSections(selfHostingStorageCommonSections) const spec = gen_v3(storageSpec, 'wat', { apiUrl: 'apiv0' }) export default function JSReference(props) { - return + return } export async function getStaticProps() { diff --git a/apps/docs/public/sitemap.xml b/apps/docs/public/sitemap.xml index 38b0e06220a..2e86001d252 100644 --- a/apps/docs/public/sitemap.xml +++ b/apps/docs/public/sitemap.xml @@ -78,6 +78,12 @@ 0.5 + + https://supabase.com/docs/guides/self-hosting + weekly + 0.5 + + https://supabase.com/docs/guides/storage weekly @@ -126,6 +132,78 @@ 0.5 + + https://supabase.com/docs/guides/auth/auth-captcha + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/auth-email-templates + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/auth-email + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/auth-helpers + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/auth-magic-link + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/auth-mfa + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/managing-user-data + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/overview + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/phone-login + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/row-level-security + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/server-side-rendering + weekly + 0.5 + + + + https://supabase.com/docs/guides/auth/social-login + weekly + 0.5 + + https://supabase.com/docs/guides/database/arrays weekly @@ -216,78 +294,6 @@ 0.5 - - https://supabase.com/docs/guides/auth/auth-captcha - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-email-templates - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-email - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-helpers - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-magic-link - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/auth-mfa - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/managing-user-data - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/overview - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/phone-login - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/row-level-security - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/server-side-rendering - weekly - 0.5 - - - - https://supabase.com/docs/guides/auth/social-login - weekly - 0.5 - - https://supabase.com/docs/guides/functions/auth weekly @@ -570,12 +576,6 @@ 0.5 - - https://supabase.com/docs/guides/resources/self-hosting - weekly - 0.5 - - https://supabase.com/docs/guides/resources/supabase-cli weekly @@ -612,6 +612,12 @@ 0.5 + + https://supabase.com/docs/guides/self-hosting/docker + weekly + 0.5 + + https://supabase.com/docs/learn/auth-deep-dive/auth-deep-dive-jwts weekly @@ -642,42 +648,6 @@ 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/auth-helpers/auth-ui weekly @@ -829,25 +799,43 @@ - https://supabase.com/docs/guides/functions/examples/og-image + https://supabase.com/docs/guides/database/extensions/http weekly 0.5 - https://supabase.com/docs/guides/getting-started/quickstarts/nextjs + https://supabase.com/docs/guides/database/extensions/pgcron weekly 0.5 - https://supabase.com/docs/guides/getting-started/quickstarts/nuxtjs + https://supabase.com/docs/guides/database/extensions/pgnet weekly 0.5 - https://supabase.com/docs/guides/getting-started/quickstarts/reactjs + 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/postgis + weekly + 0.5 + + + + https://supabase.com/docs/guides/database/extensions/uuid-ossp weekly 0.5 @@ -936,6 +924,30 @@ 0.5 + + https://supabase.com/docs/guides/functions/examples/og-image + weekly + 0.5 + + + + https://supabase.com/docs/guides/getting-started/quickstarts/nextjs + weekly + 0.5 + + + + https://supabase.com/docs/guides/getting-started/quickstarts/nuxtjs + weekly + 0.5 + + + + https://supabase.com/docs/guides/getting-started/quickstarts/reactjs + weekly + 0.5 + + https://supabase.com/docs/guides/platform/sso/azure weekly @@ -954,6 +966,24 @@ 0.5 + + https://supabase.com/docs/guides/resources/supabase-cli/local-development + weekly + 0.5 + + + + https://supabase.com/docs/guides/resources/supabase-cli/managing-environments + weekly + 0.5 + + + + https://supabase.com/docs/guides/self-hosting/auth/config + weekly + 0.5 + + https://supabase.com/docs/guides/resources/migrating-to-supabase/firebase-auth weekly @@ -979,19 +1009,13 @@ - https://supabase.com/docs/guides/resources/self-hosting/docker + https://supabase.com/docs/guides/self-hosting/realtime/config weekly 0.5 - https://supabase.com/docs/guides/resources/supabase-cli/local-development - weekly - 0.5 - - - - https://supabase.com/docs/guides/resources/supabase-cli/managing-environments + https://supabase.com/docs/guides/self-hosting/storage/config weekly 0.5 @@ -3326,6 +3350,24 @@ 0.5 + + https://supabase.com/docs/reference/cli/supabase-network-bans + weekly + 0.5 + + + + https://supabase.com/docs/reference/cli/supabase-network-bans-remove + weekly + 0.5 + + + + https://supabase.com/docs/reference/cli/supabase-network-bans-get + weekly + 0.5 + + https://supabase.com/docs/reference/cli/supabase-migration weekly @@ -3488,6 +3530,12 @@ 0.5 + + https://supabase.com/docs/reference/cli/supabase-db-dump + weekly + 0.5 + + https://supabase.com/docs/reference/cli/supabase-db-diff weekly From fce82b0bdfaa00c8dcf509dd0dba6e2747e797c7 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Mon, 9 Jan 2023 12:40:40 -0330 Subject: [PATCH 06/21] Cleanup --- apps/docs/components/reference/RefSectionHandler.tsx | 1 - apps/docs/lib/refGenerator/helpers.ts | 3 --- apps/docs/pages/reference/api/[...slug].tsx | 1 - 3 files changed, 5 deletions(-) diff --git a/apps/docs/components/reference/RefSectionHandler.tsx b/apps/docs/components/reference/RefSectionHandler.tsx index 70024788999..76f1e0cc3e1 100644 --- a/apps/docs/components/reference/RefSectionHandler.tsx +++ b/apps/docs/components/reference/RefSectionHandler.tsx @@ -18,7 +18,6 @@ interface RefSectionHandlerProps { } const RefSectionHandler = (props: RefSectionHandlerProps) => { - console.log('props', props) const router = useRouter() const slug = router.query.slug[0] diff --git a/apps/docs/lib/refGenerator/helpers.ts b/apps/docs/lib/refGenerator/helpers.ts index 251a101add0..83864fa5540 100644 --- a/apps/docs/lib/refGenerator/helpers.ts +++ b/apps/docs/lib/refGenerator/helpers.ts @@ -23,9 +23,6 @@ export function extractTsDocNode(nodeToFind: string, definition: any) { } export function generateParameters(tsDefinition: any) { - if (!tsDefinition.signatures) { - console.log('tsDefinition', tsDefinition.signatures) - } let functionDeclaration = null if (tsDefinition.kindString == 'Method') { functionDeclaration = tsDefinition diff --git a/apps/docs/pages/reference/api/[...slug].tsx b/apps/docs/pages/reference/api/[...slug].tsx index 859c3af9e0b..382c882a190 100644 --- a/apps/docs/pages/reference/api/[...slug].tsx +++ b/apps/docs/pages/reference/api/[...slug].tsx @@ -12,7 +12,6 @@ const generatedSpec = gen_v3(specFile, 'wat', { apiUrl: 'apiv0' }) const sections = flattenSections(apiCommonSections) export default function Config(props) { - console.log('generatedSpec', generatedSpec) return } From a9c84cac8df8f380dbdb5897ad29384c227758da Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Mon, 9 Jan 2023 15:24:39 -0330 Subject: [PATCH 07/21] Cleanup --- apps/docs/components/reference/Reference.types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/components/reference/Reference.types.ts b/apps/docs/components/reference/Reference.types.ts index 663f633ebd2..04a9c04b7da 100644 --- a/apps/docs/components/reference/Reference.types.ts +++ b/apps/docs/components/reference/Reference.types.ts @@ -87,7 +87,7 @@ export type TypeSpecChild = { typeParameter?: any implementedTypes?: any extendedTypes?: any - dereferenced?: TypeSpecChildComment + dereferenced?: TypeSpecChild extendedBy?: any indexSignature?: any extendsType?: any From a0bdfa8b8e24ce31610eb55977ac4096bbd31e96 Mon Sep 17 00:00:00 2001 From: Pavel Borisov Date: Tue, 10 Jan 2023 11:50:54 +0300 Subject: [PATCH 08/21] Split planetpg rss into separate feed by author --- apps/www/pages/blog.tsx | 36 ++++++- apps/www/public/planetpg-rss.xml | 159 ------------------------------- 2 files changed, 33 insertions(+), 162 deletions(-) delete mode 100644 apps/www/public/planetpg-rss.xml diff --git a/apps/www/pages/blog.tsx b/apps/www/pages/blog.tsx index 49eb7c8351f..5b81312706b 100644 --- a/apps/www/pages/blog.tsx +++ b/apps/www/pages/blog.tsx @@ -21,14 +21,44 @@ export async function getStaticProps() { const rss = generateRss(allPostsData) // @ts-ignore const planetPgPosts = allPostsData.filter((post) => post.tags.includes('planetpg')) - const planetPgrss = generateRss(planetPgPosts) + + const planetPgPavel = planetPgPosts.filter((post) => post.author.includes('pavel')) + const planetPgAlexander = planetPgPosts.filter((post) => post.author.includes('alexander')) + const planetPgMichel = planetPgPosts.filter((post) => post.author.includes('michel')) + const planetPgSteve = planetPgPosts.filter((post) => post.author.includes('steve_chavez')) + const planetPgAngelico = planetPgPosts.filter((post) => post.author.includes('angelico_de_los_reyes')) + const planetPgOli = planetPgPosts.filter((post) => post.author.includes('oli_rice')) + const planetPgMark = planetPgPosts.filter((post) => post.author.includes('burggraf')) + const planetPgVictor = planetPgPosts.filter((post) => post.author.includes('victor')) + const planetPgPaul = planetPgPosts.filter((post) => post.author.includes('paul_copplestone')) + const planetPgAnt = planetPgPosts.filter((post) => post.author.includes('ant_wilson')) + + const planetPgrssPavel = generateRss(planetPgPavel) + const planetPgrssAlexander = generateRss(planetPgAlexander) + const planetPgrssMichel = generateRss(planetPgMichel) + const planetPgrssSteve = generateRss(planetPgSteve) + const planetPgrssAngelico = generateRss(planetPgAngelico) + const planetPgrssOli = generateRss(planetPgOli) + const planetPgrssMark = generateRss(planetPgMark) + const planetPgrssVictor = generateRss(planetPgVictor) + const planetPgrssPaul = generateRss(planetPgPaul) + const planetPgrssAnt = generateRss(planetPgAnt) // create a rss feed in public directory // rss feed is added via component in render return fs.writeFileSync('./public/rss.xml', rss) - // create separate feed for just posts promoted in PlanetPG - fs.writeFileSync('./public/planetpg-rss.xml', planetPgrss) + // create separate feed for posts to promote in PlanetPG for each author + fs.writeFileSync('./public/planetpg-pavel-rss.xml', planetPgrssPavel) + fs.writeFileSync('./public/planetpg-alexander-rss.xml', planetPgrssAlexander) + fs.writeFileSync('./public/planetpg-michel-rss.xml', planetPgrssMichel) + fs.writeFileSync('./public/planetpg-steve-rss.xml', planetPgrssSteve) + fs.writeFileSync('./public/planetpg-angelico-rss.xml', planetPgrssAngelico) + fs.writeFileSync('./public/planetpg-oli-rss.xml', planetPgrssOli) + fs.writeFileSync('./public/planetpg-mark-rss.xml', planetPgrssMark) + fs.writeFileSync('./public/planetpg-victor-rss.xml', planetPgrssVictor) + fs.writeFileSync('./public/planetpg-paul-rss.xml', planetPgrssPaul) + fs.writeFileSync('./public/planetpg-ant-rss.xml', planetPgrssAnt) return { props: { diff --git a/apps/www/public/planetpg-rss.xml b/apps/www/public/planetpg-rss.xml deleted file mode 100644 index 9a980d87cea..00000000000 --- a/apps/www/public/planetpg-rss.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - Blog - Supabase - https://supabase.com - Latest news from Supabase - en - Thu, 15 Dec 2022 03:03:30 +0000 - - - https://supabase.com/blog/vault-now-in-beta - Supabase Vault is now in Beta - https://supabase.com/blog/vault-now-in-beta - A Postgres extension to store encrypted secrets and encrypt data. - Thu, 15 Dec 2022 03:03:30 +0000 - - - https://supabase.com/blog/postgrest-11-prerelease - PostgREST 11 pre-release - https://supabase.com/blog/postgrest-11-prerelease - Describes new features of PostgREST 11 pre-release - Thu, 15 Dec 2022 03:03:30 +0000 - - - https://supabase.com/blog/postgres-point-in-time-recovery - Point in Time Recovery is now available for Pro projects - https://supabase.com/blog/postgres-point-in-time-recovery - We're making PITR available for more projects, with a new Dashboard UI that makes it simple to use. - Thu, 15 Dec 2022 03:03:30 +0000 - - - https://supabase.com/blog/pg-graphql-v1 - pg_graphql v1.0 - https://supabase.com/blog/pg-graphql-v1 - Announcing the v1.0 release of pg_graphql - Thu, 15 Dec 2022 03:03:30 +0000 - - - https://supabase.com/blog/new-in-postgres-15 - What's new in Postgres 15? - https://supabase.com/blog/new-in-postgres-15 - Describes the release of Postgres 15, new features and reasons to use it - Thu, 15 Dec 2022 03:03:30 +0000 - - - https://supabase.com/blog/transparent-column-encryption-with-postgres - Transparent Column Encryption with Postgres - https://supabase.com/blog/transparent-column-encryption-with-postgres - Using pgsodium's Transparent Column Encryption to encrypt data and provide your users with row-level encryption. - Wed, 30 Nov 2022 03:03:30 +0000 - - - https://supabase.com/blog/sql-or-nosql-both-with-postgresql - SQL or NoSQL? Why not use both (with PostgreSQL)? - https://supabase.com/blog/sql-or-nosql-both-with-postgresql - How to turn Postgres into an easy-to-use NoSQL database that retains all the power of SQL - Wed, 23 Nov 2022 03:03:30 +0000 - - - https://supabase.com/blog/postgresql-commitfest - What is PostgreSQL commitfest and how to contribute - https://supabase.com/blog/postgresql-commitfest - A time-tested method for contributing to the core Postgres code - Wed, 26 Oct 2022 02:02:30 +0000 - - - https://supabase.com/blog/postgres-full-text-search-vs-the-rest - Postgres Full Text Search vs the rest - https://supabase.com/blog/postgres-full-text-search-vs-the-rest - Comparing one of the most popular Postgres features against alternatives - Thu, 13 Oct 2022 02:02:30 +0000 - - - https://supabase.com/blog/postgres-wasm - Postgres WASM by Snaplet and Supabase - https://supabase.com/blog/postgres-wasm - We're open sourcing postgres-wasm, a PostgresQL server that runs inside a browser, with our friends at Snaplet. - Sun, 02 Oct 2022 02:02:30 +0000 - - - https://supabase.com/blog/choosing-a-postgres-primary-key - Choosing a Postgres Primary Key - https://supabase.com/blog/choosing-a-postgres-primary-key - Turns out the question of which identifier to use as a Primary Key is complicated -- we're going to dive into some of the complexity and inherent trade-offs, and figure things out - Wed, 07 Sep 2022 02:02:30 +0000 - - - https://supabase.com/blog/seen-by-in-postgresql - Implementing "seen by" functionality with Postgres - https://supabase.com/blog/seen-by-in-postgresql - Different approaches for tracking visitor counts with PostgreSQL. - Sun, 17 Jul 2022 02:02:30 +0000 - - - https://supabase.com/blog/partial-postgresql-data-dumps-with-rls - Partial data dumps using Postgres Row Level Security - https://supabase.com/blog/partial-postgresql-data-dumps-with-rls - Using RLS to create seed files for local PostgreSQL testing. - Mon, 27 Jun 2022 02:02:30 +0000 - - - https://supabase.com/blog/audit - Postgres Auditing in 150 lines of SQL - https://supabase.com/blog/audit - PostgreSQL has a robust set of features which we can leverage to create a generic auditing solution in 150 lines of SQL. - Mon, 07 Mar 2022 03:03:30 +0000 - - - https://supabase.com/blog/roles-postgres-hooks - Protecting reserved roles with PostgreSQL Hooks - https://supabase.com/blog/roles-postgres-hooks - Using Postgres Hooks to protect functionality in your Postgres database. - Thu, 01 Jul 2021 02:02:30 +0000 - - - https://supabase.com/blog/postgres-as-a-cron-server - Postgres as a CRON Server - https://supabase.com/blog/postgres-as-a-cron-server - Running repetitive tasks with your Postgres database. - Fri, 05 Mar 2021 03:03:30 +0000 - - - https://supabase.com/blog/cracking-postgres-interview - Cracking PostgreSQL Interview Questions - https://supabase.com/blog/cracking-postgres-interview - Understand the top PostgreSQL Interview Questions - Sat, 27 Feb 2021 03:03:30 +0000 - - - https://supabase.com/blog/postgresql-views - Postgres Views - https://supabase.com/blog/postgresql-views - Creating and using a view in PostgreSQL. - Wed, 18 Nov 2020 03:03:30 +0000 - - - https://supabase.com/blog/continuous-postgresql-backup-walg - Continuous PostgreSQL Backups using WAL-G - https://supabase.com/blog/continuous-postgresql-backup-walg - Have you ever wanted to restore your database's state to a particular moment in time? This post explains how, using WAL-G. - Sun, 02 Aug 2020 02:02:30 +0000 - - - https://supabase.com/blog/postgresql-templates - What are PostgreSQL Templates? - https://supabase.com/blog/postgresql-templates - What are PostgreSQL templates and what are they used for? - Thu, 09 Jul 2020 02:02:30 +0000 - - - https://supabase.com/blog/postgresql-physical-logical-backups - Physical vs Logical Backups in PostgreSQL - https://supabase.com/blog/postgresql-physical-logical-backups - What are physical and logical backups in Postgres? - Tue, 07 Jul 2020 02:02:30 +0000 - - - - From 90a568ffebf0c2797ed1ff80035af69ddc32b66b Mon Sep 17 00:00:00 2001 From: Pavel Borisov <63344111+pashkinelfe@users.noreply.github.com> Date: Tue, 10 Jan 2023 13:12:00 +0400 Subject: [PATCH 09/21] Update apps/www/pages/blog.tsx line formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- apps/www/pages/blog.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/www/pages/blog.tsx b/apps/www/pages/blog.tsx index 5b81312706b..470a94ee476 100644 --- a/apps/www/pages/blog.tsx +++ b/apps/www/pages/blog.tsx @@ -26,7 +26,9 @@ export async function getStaticProps() { const planetPgAlexander = planetPgPosts.filter((post) => post.author.includes('alexander')) const planetPgMichel = planetPgPosts.filter((post) => post.author.includes('michel')) const planetPgSteve = planetPgPosts.filter((post) => post.author.includes('steve_chavez')) - const planetPgAngelico = planetPgPosts.filter((post) => post.author.includes('angelico_de_los_reyes')) + const planetPgAngelico = planetPgPosts.filter((post) => + post.author.includes('angelico_de_los_reyes') + ) const planetPgOli = planetPgPosts.filter((post) => post.author.includes('oli_rice')) const planetPgMark = planetPgPosts.filter((post) => post.author.includes('burggraf')) const planetPgVictor = planetPgPosts.filter((post) => post.author.includes('victor')) From 77cc9ec5fc54fd5c4d0457e65c65dd081582c463 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Tue, 10 Jan 2023 09:17:14 -0330 Subject: [PATCH 10/21] Fix ts and no-posts-found errors --- apps/www/pages/blog.tsx | 59 +++++++------------ .../planetpg-angelico_de_los_reyes-rss.xml | 40 +++++++++++++ apps/www/public/planetpg-ant_wilson-rss.xml | 19 ++++++ apps/www/public/planetpg-burggraf-rss.xml | 26 ++++++++ apps/www/public/planetpg-michel-rss.xml | 26 ++++++++ apps/www/public/planetpg-oli_rice-rss.xml | 26 ++++++++ .../public/planetpg-paul_copplestone-rss.xml | 33 +++++++++++ apps/www/public/planetpg-steve_chavez-rss.xml | 26 ++++++++ apps/www/public/planetpg-victor-rss.xml | 33 +++++++++++ 9 files changed, 251 insertions(+), 37 deletions(-) create mode 100644 apps/www/public/planetpg-angelico_de_los_reyes-rss.xml create mode 100644 apps/www/public/planetpg-ant_wilson-rss.xml create mode 100644 apps/www/public/planetpg-burggraf-rss.xml create mode 100644 apps/www/public/planetpg-michel-rss.xml create mode 100644 apps/www/public/planetpg-oli_rice-rss.xml create mode 100644 apps/www/public/planetpg-paul_copplestone-rss.xml create mode 100644 apps/www/public/planetpg-steve_chavez-rss.xml create mode 100644 apps/www/public/planetpg-victor-rss.xml diff --git a/apps/www/pages/blog.tsx b/apps/www/pages/blog.tsx index 470a94ee476..91382f96787 100644 --- a/apps/www/pages/blog.tsx +++ b/apps/www/pages/blog.tsx @@ -19,48 +19,33 @@ export async function getStaticProps() { const allPostsData = getSortedPosts('_blog', undefined, undefined, '** BLOG PAGE **') const categories = getAllCategories('_blog') const rss = generateRss(allPostsData) - // @ts-ignore - const planetPgPosts = allPostsData.filter((post) => post.tags.includes('planetpg')) - - const planetPgPavel = planetPgPosts.filter((post) => post.author.includes('pavel')) - const planetPgAlexander = planetPgPosts.filter((post) => post.author.includes('alexander')) - const planetPgMichel = planetPgPosts.filter((post) => post.author.includes('michel')) - const planetPgSteve = planetPgPosts.filter((post) => post.author.includes('steve_chavez')) - const planetPgAngelico = planetPgPosts.filter((post) => - post.author.includes('angelico_de_los_reyes') - ) - const planetPgOli = planetPgPosts.filter((post) => post.author.includes('oli_rice')) - const planetPgMark = planetPgPosts.filter((post) => post.author.includes('burggraf')) - const planetPgVictor = planetPgPosts.filter((post) => post.author.includes('victor')) - const planetPgPaul = planetPgPosts.filter((post) => post.author.includes('paul_copplestone')) - const planetPgAnt = planetPgPosts.filter((post) => post.author.includes('ant_wilson')) - - const planetPgrssPavel = generateRss(planetPgPavel) - const planetPgrssAlexander = generateRss(planetPgAlexander) - const planetPgrssMichel = generateRss(planetPgMichel) - const planetPgrssSteve = generateRss(planetPgSteve) - const planetPgrssAngelico = generateRss(planetPgAngelico) - const planetPgrssOli = generateRss(planetPgOli) - const planetPgrssMark = generateRss(planetPgMark) - const planetPgrssVictor = generateRss(planetPgVictor) - const planetPgrssPaul = generateRss(planetPgPaul) - const planetPgrssAnt = generateRss(planetPgAnt) // create a rss feed in public directory // rss feed is added via component in render return fs.writeFileSync('./public/rss.xml', rss) - // create separate feed for posts to promote in PlanetPG for each author - fs.writeFileSync('./public/planetpg-pavel-rss.xml', planetPgrssPavel) - fs.writeFileSync('./public/planetpg-alexander-rss.xml', planetPgrssAlexander) - fs.writeFileSync('./public/planetpg-michel-rss.xml', planetPgrssMichel) - fs.writeFileSync('./public/planetpg-steve-rss.xml', planetPgrssSteve) - fs.writeFileSync('./public/planetpg-angelico-rss.xml', planetPgrssAngelico) - fs.writeFileSync('./public/planetpg-oli-rss.xml', planetPgrssOli) - fs.writeFileSync('./public/planetpg-mark-rss.xml', planetPgrssMark) - fs.writeFileSync('./public/planetpg-victor-rss.xml', planetPgrssVictor) - fs.writeFileSync('./public/planetpg-paul-rss.xml', planetPgrssPaul) - fs.writeFileSync('./public/planetpg-ant-rss.xml', planetPgrssAnt) + // generate a series of rss feeds for each author (for PlanetPG) + const planetPgPosts = allPostsData.filter((post: any) => post.tags.includes('planetpg')) + + const authors = [ + 'alexander', + 'michel', + 'steve_chavez', + 'angelico_de_los_reyes', + 'oli_rice', + 'burggraf', + 'victor', + 'paul_copplestone', + 'ant_wilson', + ] + + authors.forEach((author) => { + const authorPosts = planetPgPosts.filter((post: any) => post.author.includes(author)) + if (authorPosts.length > 0) { + const authorRss = generateRss(authorPosts) + fs.writeFileSync(`./public/planetpg-${author}-rss.xml`, authorRss) + } + }) return { props: { diff --git a/apps/www/public/planetpg-angelico_de_los_reyes-rss.xml b/apps/www/public/planetpg-angelico_de_los_reyes-rss.xml new file mode 100644 index 00000000000..280497b278e --- /dev/null +++ b/apps/www/public/planetpg-angelico_de_los_reyes-rss.xml @@ -0,0 +1,40 @@ + + + + Blog - Supabase + https://supabase.com + Latest news from Supabase + en + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/postgres-point-in-time-recovery + Point in Time Recovery is now available for Pro projects + https://supabase.com/blog/postgres-point-in-time-recovery + We're making PITR available for more projects, with a new Dashboard UI that makes it simple to use. + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/continuous-postgresql-backup-walg + Continuous PostgreSQL Backups using WAL-G + https://supabase.com/blog/continuous-postgresql-backup-walg + Have you ever wanted to restore your database's state to a particular moment in time? This post explains how, using WAL-G. + Sun, 02 Aug 2020 02:02:30 +0000 + + + https://supabase.com/blog/postgresql-templates + What are PostgreSQL Templates? + https://supabase.com/blog/postgresql-templates + What are PostgreSQL templates and what are they used for? + Thu, 09 Jul 2020 02:02:30 +0000 + + + https://supabase.com/blog/postgresql-physical-logical-backups + Physical vs Logical Backups in PostgreSQL + https://supabase.com/blog/postgresql-physical-logical-backups + What are physical and logical backups in Postgres? + Tue, 07 Jul 2020 02:02:30 +0000 + + + + diff --git a/apps/www/public/planetpg-ant_wilson-rss.xml b/apps/www/public/planetpg-ant_wilson-rss.xml new file mode 100644 index 00000000000..b0afb8913f2 --- /dev/null +++ b/apps/www/public/planetpg-ant_wilson-rss.xml @@ -0,0 +1,19 @@ + + + + Blog - Supabase + https://supabase.com + Latest news from Supabase + en + Sat, 27 Feb 2021 03:03:30 +0000 + + + https://supabase.com/blog/cracking-postgres-interview + Cracking PostgreSQL Interview Questions + https://supabase.com/blog/cracking-postgres-interview + Understand the top PostgreSQL Interview Questions + Sat, 27 Feb 2021 03:03:30 +0000 + + + + diff --git a/apps/www/public/planetpg-burggraf-rss.xml b/apps/www/public/planetpg-burggraf-rss.xml new file mode 100644 index 00000000000..3f3db745b40 --- /dev/null +++ b/apps/www/public/planetpg-burggraf-rss.xml @@ -0,0 +1,26 @@ + + + + Blog - Supabase + https://supabase.com + Latest news from Supabase + en + Wed, 23 Nov 2022 03:03:30 +0000 + + + https://supabase.com/blog/sql-or-nosql-both-with-postgresql + SQL or NoSQL? Why not use both (with PostgreSQL)? + https://supabase.com/blog/sql-or-nosql-both-with-postgresql + How to turn Postgres into an easy-to-use NoSQL database that retains all the power of SQL + Wed, 23 Nov 2022 03:03:30 +0000 + + + https://supabase.com/blog/postgres-wasm + Postgres WASM by Snaplet and Supabase + https://supabase.com/blog/postgres-wasm + We're open sourcing postgres-wasm, a PostgresQL server that runs inside a browser, with our friends at Snaplet. + Sun, 02 Oct 2022 02:02:30 +0000 + + + + diff --git a/apps/www/public/planetpg-michel-rss.xml b/apps/www/public/planetpg-michel-rss.xml new file mode 100644 index 00000000000..8df9cc5a91c --- /dev/null +++ b/apps/www/public/planetpg-michel-rss.xml @@ -0,0 +1,26 @@ + + + + Blog - Supabase + https://supabase.com + Latest news from Supabase + en + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/vault-now-in-beta + Supabase Vault is now in Beta + https://supabase.com/blog/vault-now-in-beta + A Postgres extension to store encrypted secrets and encrypt data. + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/transparent-column-encryption-with-postgres + Transparent Column Encryption with Postgres + https://supabase.com/blog/transparent-column-encryption-with-postgres + Using pgsodium's Transparent Column Encryption to encrypt data and provide your users with row-level encryption. + Wed, 30 Nov 2022 03:03:30 +0000 + + + + diff --git a/apps/www/public/planetpg-oli_rice-rss.xml b/apps/www/public/planetpg-oli_rice-rss.xml new file mode 100644 index 00000000000..da3f0ad119b --- /dev/null +++ b/apps/www/public/planetpg-oli_rice-rss.xml @@ -0,0 +1,26 @@ + + + + Blog - Supabase + https://supabase.com + Latest news from Supabase + en + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/pg-graphql-v1 + pg_graphql v1.0 + https://supabase.com/blog/pg-graphql-v1 + Announcing the v1.0 release of pg_graphql + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/audit + Postgres Auditing in 150 lines of SQL + https://supabase.com/blog/audit + PostgreSQL has a robust set of features which we can leverage to create a generic auditing solution in 150 lines of SQL. + Mon, 07 Mar 2022 03:03:30 +0000 + + + + diff --git a/apps/www/public/planetpg-paul_copplestone-rss.xml b/apps/www/public/planetpg-paul_copplestone-rss.xml new file mode 100644 index 00000000000..784975b7a6f --- /dev/null +++ b/apps/www/public/planetpg-paul_copplestone-rss.xml @@ -0,0 +1,33 @@ + + + + Blog - Supabase + https://supabase.com + Latest news from Supabase + en + Mon, 27 Jun 2022 02:02:30 +0000 + + + https://supabase.com/blog/partial-postgresql-data-dumps-with-rls + Partial data dumps using Postgres Row Level Security + https://supabase.com/blog/partial-postgresql-data-dumps-with-rls + Using RLS to create seed files for local PostgreSQL testing. + Mon, 27 Jun 2022 02:02:30 +0000 + + + https://supabase.com/blog/postgres-as-a-cron-server + Postgres as a CRON Server + https://supabase.com/blog/postgres-as-a-cron-server + Running repetitive tasks with your Postgres database. + Fri, 05 Mar 2021 03:03:30 +0000 + + + https://supabase.com/blog/postgresql-views + Postgres Views + https://supabase.com/blog/postgresql-views + Creating and using a view in PostgreSQL. + Wed, 18 Nov 2020 03:03:30 +0000 + + + + diff --git a/apps/www/public/planetpg-steve_chavez-rss.xml b/apps/www/public/planetpg-steve_chavez-rss.xml new file mode 100644 index 00000000000..0b47a94b124 --- /dev/null +++ b/apps/www/public/planetpg-steve_chavez-rss.xml @@ -0,0 +1,26 @@ + + + + Blog - Supabase + https://supabase.com + Latest news from Supabase + en + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/postgrest-11-prerelease + PostgREST 11 pre-release + https://supabase.com/blog/postgrest-11-prerelease + Describes new features of PostgREST 11 pre-release + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/roles-postgres-hooks + Protecting reserved roles with PostgreSQL Hooks + https://supabase.com/blog/roles-postgres-hooks + Using Postgres Hooks to protect functionality in your Postgres database. + Thu, 01 Jul 2021 02:02:30 +0000 + + + + diff --git a/apps/www/public/planetpg-victor-rss.xml b/apps/www/public/planetpg-victor-rss.xml new file mode 100644 index 00000000000..f3fbdfd181f --- /dev/null +++ b/apps/www/public/planetpg-victor-rss.xml @@ -0,0 +1,33 @@ + + + + Blog - Supabase + https://supabase.com + Latest news from Supabase + en + Thu, 13 Oct 2022 02:02:30 +0000 + + + https://supabase.com/blog/postgres-full-text-search-vs-the-rest + Postgres Full Text Search vs the rest + https://supabase.com/blog/postgres-full-text-search-vs-the-rest + Comparing one of the most popular Postgres features against alternatives + Thu, 13 Oct 2022 02:02:30 +0000 + + + https://supabase.com/blog/choosing-a-postgres-primary-key + Choosing a Postgres Primary Key + https://supabase.com/blog/choosing-a-postgres-primary-key + Turns out the question of which identifier to use as a Primary Key is complicated -- we're going to dive into some of the complexity and inherent trade-offs, and figure things out + Wed, 07 Sep 2022 02:02:30 +0000 + + + https://supabase.com/blog/seen-by-in-postgresql + Implementing "seen by" functionality with Postgres + https://supabase.com/blog/seen-by-in-postgresql + Different approaches for tracking visitor counts with PostgreSQL. + Sun, 17 Jul 2022 02:02:30 +0000 + + + + From ea441c7e7cc051813a633361f595966bd6c71920 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Tue, 10 Jan 2023 09:47:31 -0330 Subject: [PATCH 11/21] Add pavel back --- apps/www/pages/blog.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/www/pages/blog.tsx b/apps/www/pages/blog.tsx index 91382f96787..8e2a55c3c44 100644 --- a/apps/www/pages/blog.tsx +++ b/apps/www/pages/blog.tsx @@ -30,6 +30,7 @@ export async function getStaticProps() { const authors = [ 'alexander', 'michel', + 'pavel', 'steve_chavez', 'angelico_de_los_reyes', 'oli_rice', From 0d5156c7ed6a170a855b208e6cb89eca2443d1d3 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Tue, 10 Jan 2023 09:50:54 -0330 Subject: [PATCH 12/21] Add Pavels rss file --- apps/www/public/planetpg-pavel-rss.xml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 apps/www/public/planetpg-pavel-rss.xml diff --git a/apps/www/public/planetpg-pavel-rss.xml b/apps/www/public/planetpg-pavel-rss.xml new file mode 100644 index 00000000000..22153485707 --- /dev/null +++ b/apps/www/public/planetpg-pavel-rss.xml @@ -0,0 +1,26 @@ + + + + Blog - Supabase + https://supabase.com + Latest news from Supabase + en + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/new-in-postgres-15 + What's new in Postgres 15? + https://supabase.com/blog/new-in-postgres-15 + Describes the release of Postgres 15, new features and reasons to use it + Thu, 15 Dec 2022 03:03:30 +0000 + + + https://supabase.com/blog/postgresql-commitfest + What is PostgreSQL commitfest and how to contribute + https://supabase.com/blog/postgresql-commitfest + A time-tested method for contributing to the core Postgres code + Wed, 26 Oct 2022 02:02:30 +0000 + + + + From d8c02d80f913f9fa862205832b58c3d8f9c3d9fc Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Tue, 10 Jan 2023 10:54:48 -0330 Subject: [PATCH 13/21] Updates --- apps/www/lib/rss.tsx | 27 +++++++++++++++++-- apps/www/pages/blog.tsx | 19 +++---------- .../planetpg-angelico_de_los_reyes-rss.xml | 8 +++--- apps/www/public/planetpg-ant_wilson-rss.xml | 8 +++--- apps/www/public/planetpg-burggraf-rss.xml | 8 +++--- apps/www/public/planetpg-michel-rss.xml | 8 +++--- apps/www/public/planetpg-oli_rice-rss.xml | 8 +++--- .../public/planetpg-paul_copplestone-rss.xml | 8 +++--- apps/www/public/planetpg-pavel-rss.xml | 8 +++--- apps/www/public/planetpg-steve_chavez-rss.xml | 8 +++--- apps/www/public/planetpg-victor-rss.xml | 8 +++--- 11 files changed, 65 insertions(+), 53 deletions(-) diff --git a/apps/www/lib/rss.tsx b/apps/www/lib/rss.tsx index 36fb38f5825..c0409f8393d 100644 --- a/apps/www/lib/rss.tsx +++ b/apps/www/lib/rss.tsx @@ -1,3 +1,4 @@ +import authors from 'lib/authors.json' const dayjs = require('dayjs') var utc = require('dayjs/plugin/utc') var advancedFormat = require('dayjs/plugin/advancedFormat') @@ -17,8 +18,29 @@ const generateRssItem = (post: any): string => { ` } -export const generateRss = (posts: any[]): string => { - return ` +// we generate a main rss.xml flie as well as individual files for +// authors who publish under the `planetpg` tag +export const generateRss = (posts: any[], authorID?: string): string => { + const authorInfo = authors.find((item) => item.author_id === authorID) + + if (authorID) { + return ` + + + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from ${authorInfo?.author} at Supabase + en + ${dayjs(posts[0].date) + .utc() + .format('ddd, DD MMM YYYY HH:hh:mm ZZ')} + + ${posts.map(generateRssItem).join('')} + + +` + } else { + return ` Blog - Supabase @@ -33,4 +55,5 @@ export const generateRss = (posts: any[]): string => { ` + } } diff --git a/apps/www/pages/blog.tsx b/apps/www/pages/blog.tsx index 8e2a55c3c44..a14bbd8feef 100644 --- a/apps/www/pages/blog.tsx +++ b/apps/www/pages/blog.tsx @@ -26,24 +26,13 @@ export async function getStaticProps() { // generate a series of rss feeds for each author (for PlanetPG) const planetPgPosts = allPostsData.filter((post: any) => post.tags.includes('planetpg')) + const planetPgAuthors = planetPgPosts.map((post: any) => post.author.split(',')) + const uniquePlanetPgAuthors = new Set([].concat(...planetPgAuthors)) - const authors = [ - 'alexander', - 'michel', - 'pavel', - 'steve_chavez', - 'angelico_de_los_reyes', - 'oli_rice', - 'burggraf', - 'victor', - 'paul_copplestone', - 'ant_wilson', - ] - - authors.forEach((author) => { + uniquePlanetPgAuthors.forEach((author) => { const authorPosts = planetPgPosts.filter((post: any) => post.author.includes(author)) if (authorPosts.length > 0) { - const authorRss = generateRss(authorPosts) + const authorRss = generateRss(authorPosts, author) fs.writeFileSync(`./public/planetpg-${author}-rss.xml`, authorRss) } }) diff --git a/apps/www/public/planetpg-angelico_de_los_reyes-rss.xml b/apps/www/public/planetpg-angelico_de_los_reyes-rss.xml index 280497b278e..84fe8fab257 100644 --- a/apps/www/public/planetpg-angelico_de_los_reyes-rss.xml +++ b/apps/www/public/planetpg-angelico_de_los_reyes-rss.xml @@ -1,12 +1,12 @@ - Blog - Supabase - https://supabase.com - Latest news from Supabase + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from Angelico de los Reyes at Supabase en Thu, 15 Dec 2022 03:03:30 +0000 - + https://supabase.com/blog/postgres-point-in-time-recovery Point in Time Recovery is now available for Pro projects diff --git a/apps/www/public/planetpg-ant_wilson-rss.xml b/apps/www/public/planetpg-ant_wilson-rss.xml index b0afb8913f2..07cfe4056b8 100644 --- a/apps/www/public/planetpg-ant_wilson-rss.xml +++ b/apps/www/public/planetpg-ant_wilson-rss.xml @@ -1,12 +1,12 @@ - Blog - Supabase - https://supabase.com - Latest news from Supabase + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from Ant Wilson at Supabase en Sat, 27 Feb 2021 03:03:30 +0000 - + https://supabase.com/blog/cracking-postgres-interview Cracking PostgreSQL Interview Questions diff --git a/apps/www/public/planetpg-burggraf-rss.xml b/apps/www/public/planetpg-burggraf-rss.xml index 3f3db745b40..26233a86f1e 100644 --- a/apps/www/public/planetpg-burggraf-rss.xml +++ b/apps/www/public/planetpg-burggraf-rss.xml @@ -1,12 +1,12 @@ - Blog - Supabase - https://supabase.com - Latest news from Supabase + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from Mark Burggraf at Supabase en Wed, 23 Nov 2022 03:03:30 +0000 - + https://supabase.com/blog/sql-or-nosql-both-with-postgresql SQL or NoSQL? Why not use both (with PostgreSQL)? diff --git a/apps/www/public/planetpg-michel-rss.xml b/apps/www/public/planetpg-michel-rss.xml index 8df9cc5a91c..3bcd14a76b8 100644 --- a/apps/www/public/planetpg-michel-rss.xml +++ b/apps/www/public/planetpg-michel-rss.xml @@ -1,12 +1,12 @@ - Blog - Supabase - https://supabase.com - Latest news from Supabase + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from Michel Pelletier at Supabase en Thu, 15 Dec 2022 03:03:30 +0000 - + https://supabase.com/blog/vault-now-in-beta Supabase Vault is now in Beta diff --git a/apps/www/public/planetpg-oli_rice-rss.xml b/apps/www/public/planetpg-oli_rice-rss.xml index da3f0ad119b..77f01e50bdf 100644 --- a/apps/www/public/planetpg-oli_rice-rss.xml +++ b/apps/www/public/planetpg-oli_rice-rss.xml @@ -1,12 +1,12 @@ - Blog - Supabase - https://supabase.com - Latest news from Supabase + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from Oliver Rice at Supabase en Thu, 15 Dec 2022 03:03:30 +0000 - + https://supabase.com/blog/pg-graphql-v1 pg_graphql v1.0 diff --git a/apps/www/public/planetpg-paul_copplestone-rss.xml b/apps/www/public/planetpg-paul_copplestone-rss.xml index 784975b7a6f..bc3d31ea3d3 100644 --- a/apps/www/public/planetpg-paul_copplestone-rss.xml +++ b/apps/www/public/planetpg-paul_copplestone-rss.xml @@ -1,12 +1,12 @@ - Blog - Supabase - https://supabase.com - Latest news from Supabase + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from Paul Copplestone at Supabase en Mon, 27 Jun 2022 02:02:30 +0000 - + https://supabase.com/blog/partial-postgresql-data-dumps-with-rls Partial data dumps using Postgres Row Level Security diff --git a/apps/www/public/planetpg-pavel-rss.xml b/apps/www/public/planetpg-pavel-rss.xml index 22153485707..e6dbbb4c1fe 100644 --- a/apps/www/public/planetpg-pavel-rss.xml +++ b/apps/www/public/planetpg-pavel-rss.xml @@ -1,12 +1,12 @@ - Blog - Supabase - https://supabase.com - Latest news from Supabase + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from Pavel Borisov at Supabase en Thu, 15 Dec 2022 03:03:30 +0000 - + https://supabase.com/blog/new-in-postgres-15 What's new in Postgres 15? diff --git a/apps/www/public/planetpg-steve_chavez-rss.xml b/apps/www/public/planetpg-steve_chavez-rss.xml index 0b47a94b124..575cafb6b06 100644 --- a/apps/www/public/planetpg-steve_chavez-rss.xml +++ b/apps/www/public/planetpg-steve_chavez-rss.xml @@ -1,12 +1,12 @@ - Blog - Supabase - https://supabase.com - Latest news from Supabase + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from Steve Chavez at Supabase en Thu, 15 Dec 2022 03:03:30 +0000 - + https://supabase.com/blog/postgrest-11-prerelease PostgREST 11 pre-release diff --git a/apps/www/public/planetpg-victor-rss.xml b/apps/www/public/planetpg-victor-rss.xml index f3fbdfd181f..e742fb6eec8 100644 --- a/apps/www/public/planetpg-victor-rss.xml +++ b/apps/www/public/planetpg-victor-rss.xml @@ -1,12 +1,12 @@ - Blog - Supabase - https://supabase.com - Latest news from Supabase + 'Postgres | Supabase Blog + https://supabase.com/blog + Latest Postgres news from Victor at Supabase en Thu, 13 Oct 2022 02:02:30 +0000 - + https://supabase.com/blog/postgres-full-text-search-vs-the-rest Postgres Full Text Search vs the rest From c8a08e936bd644c8815b708b220258847aa910d2 Mon Sep 17 00:00:00 2001 From: Inian Date: Wed, 11 Jan 2023 14:14:11 +0800 Subject: [PATCH 14/21] update storage docs --- spec/enrichments/tsdoc_v2/combined.json | 2 +- spec/enrichments/tsdoc_v2/storage.json | 2 +- spec/enrichments/tsdoc_v2/storage_dereferenced.json | 2 +- spec/gotrue_v1_config.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/enrichments/tsdoc_v2/combined.json b/spec/enrichments/tsdoc_v2/combined.json index 0467e800000..0c72523e032 100644 --- a/spec/enrichments/tsdoc_v2/combined.json +++ b/spec/enrichments/tsdoc_v2/combined.json @@ -79271,7 +79271,7 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Downloads a file." + "shortText": "Downloads a file from a private bucket. For public buckets, make a request to the URL returned from `getPublicUrl` instead." }, "parameters": [ { diff --git a/spec/enrichments/tsdoc_v2/storage.json b/spec/enrichments/tsdoc_v2/storage.json index d94d2aadde8..475ba699fc3 100644 --- a/spec/enrichments/tsdoc_v2/storage.json +++ b/spec/enrichments/tsdoc_v2/storage.json @@ -5251,7 +5251,7 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Downloads a file." + "shortText": "Downloads a file from a private bucket. For public buckets, make a request to the URL returned from `getPublicUrl` instead." }, "parameters": [ { diff --git a/spec/enrichments/tsdoc_v2/storage_dereferenced.json b/spec/enrichments/tsdoc_v2/storage_dereferenced.json index 2074da33442..634dd23b469 100644 --- a/spec/enrichments/tsdoc_v2/storage_dereferenced.json +++ b/spec/enrichments/tsdoc_v2/storage_dereferenced.json @@ -5550,7 +5550,7 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Downloads a file." + "shortText": "Downloads a file from a private bucket. For public buckets, make a request to the URL returned from `getPublicUrl` instead." }, "parameters": [ { diff --git a/spec/gotrue_v1_config.yaml b/spec/gotrue_v1_config.yaml index fd7e88431b2..31827802154 100644 --- a/spec/gotrue_v1_config.yaml +++ b/spec/gotrue_v1_config.yaml @@ -40,7 +40,7 @@ parameters: tags: ['general'] # {string[]} These tags are useful for grouping parameters required: true description: | - The base URL of your website. Used as an allow-list for redirects and for constructing URLs used in emails. + The base URL of your website. Used as an allow-list for redirects and for constructing URLs used in emails. - id: 'GOTRUE_URI_ALLOW_LIST' # {string} A unique identifier for this param. title: 'auth.additional_redirect_urls' # {string} Any name. tags: ['general'] # {string[]} These tags are useful for grouping parameters From 35ae4f8a942a59f2da785c33d09199fea18db627 Mon Sep 17 00:00:00 2001 From: dshukertjr <18113850+dshukertjr@users.noreply.github.com> Date: Thu, 12 Jan 2023 00:00:18 +0900 Subject: [PATCH 15/21] remove execute() from dart code --- apps/docs/pages/guides/database/functions.mdx | 15 ++++++--------- apps/docs/pages/guides/database/tables.mdx | 4 ++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/apps/docs/pages/guides/database/functions.mdx b/apps/docs/pages/guides/database/functions.mdx index 0204ef78eac..3c547cf93fd 100644 --- a/apps/docs/pages/guides/database/functions.mdx +++ b/apps/docs/pages/guides/database/functions.mdx @@ -88,9 +88,8 @@ Reference: [rpc()](../../reference/javascript/rpc) ```dart -final res = await supabase - .rpc('hello_world') - .execute(); +final data = await supabase + .rpc('hello_world'); ``` Reference: [rpc()](../../reference/dart/rpc) @@ -199,10 +198,9 @@ const { data, error } = supabase.rpc('get_planets').eq('id', 1) ```dart -final res = await supabase +final data = await supabase .rpc('get_planets') - .eq('id', 1) - .execute(); + .eq('id', 1); ``` @@ -254,9 +252,8 @@ const { data, error } = await supabase.rpc('add_planet', { name: 'Jakku' }) ```dart -final res = await supabase - .rpc('add_planet', params: { 'name': 'Jakku' }) - .execute(); +final data = await supabase + .rpc('add_planet', params: { 'name': 'Jakku' }); ``` diff --git a/apps/docs/pages/guides/database/tables.mdx b/apps/docs/pages/guides/database/tables.mdx index 78d1b62115a..3a8caa24c19 100644 --- a/apps/docs/pages/guides/database/tables.mdx +++ b/apps/docs/pages/guides/database/tables.mdx @@ -206,7 +206,7 @@ const { data, error } = await supabase ```sql -final res = await supabase +await supabase .from('movies') .insert([{ name: 'The Empire Strikes Back', @@ -214,7 +214,7 @@ final res = await supabase }, { name: 'Return of the Jedi', description: 'After a daring mission to rescue Han Solo from Jabba the Hutt, the Rebels dispatch to Endor to destroy the second Death Star.' - }]).execute(); + }]); ``` From f7f781749e5bcff076088119fb5b2c292abae9eb Mon Sep 17 00:00:00 2001 From: Peter Ibidapo-Obe Date: Wed, 11 Jan 2023 16:10:10 +0100 Subject: [PATCH 16/21] Fix documentation descriptions --- apps/docs/pages/guides/getting-started.mdx | 16 ++++++++-------- apps/docs/pages/guides/tutorials.mdx | 18 +++++++++--------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/apps/docs/pages/guides/getting-started.mdx b/apps/docs/pages/guides/getting-started.mdx index 5cb4efb70e2..535ee897ec6 100644 --- a/apps/docs/pages/guides/getting-started.mdx +++ b/apps/docs/pages/guides/getting-started.mdx @@ -85,28 +85,28 @@ export const webapps = [ title: 'Angular', href: '/guides/getting-started/tutorials/with-angular', description: - 'Learn how to build a user management app with Nuxt 3 and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Angular and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/angular-icon', }, { title: 'RedwoodJS', href: '/guides/getting-started/tutorials/with-redwoodjs', description: - 'Learn how to build a user management app with Nuxt 3 and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with RedwoodJS and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/redwood-icon', }, { title: 'Svelte', href: '/guides/getting-started/tutorials/with-svelte', description: - 'Learn how to build a user management app with Nuxt 3 and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Svelte and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/svelte-icon', }, { title: 'SvelteKit', href: '/guides/getting-started/tutorials/with-sveltekit', description: - 'Learn how to build a user management app with Nuxt 3 and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with SvelteKit and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/svelte-icon', }, { @@ -120,28 +120,28 @@ export const webapps = [ title: 'Expo', href: '/guides/getting-started/tutorials/with-expo', description: - 'Learn how to build a user management app with React and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Expo and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/expo-icon', }, { title: 'Ionic React', href: '/guides/getting-started/tutorials/with-ionic-react', description: - 'Learn how to build a user management app with React and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Ionic React and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/ionic-icon', }, { title: 'Ionic Vue', href: '/guides/getting-started/tutorials/with-ionic-vue', description: - 'Learn how to build a user management app with Flutter and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Ionic Vue and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/ionic-icon', }, { title: 'Ionic Angular', href: '/guides/getting-started/tutorials/with-ionic-angular', description: - 'Learn how to build a user management app with NextJS and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Ionic Angular and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/ionic-icon', }, ] diff --git a/apps/docs/pages/guides/tutorials.mdx b/apps/docs/pages/guides/tutorials.mdx index 39f553feea8..887788bdb39 100644 --- a/apps/docs/pages/guides/tutorials.mdx +++ b/apps/docs/pages/guides/tutorials.mdx @@ -84,31 +84,31 @@ export const webapps = [ icon: '/docs/img/icons/nuxt-icon', }, { - title: 'Anglular', + title: 'Angular', href: '/guides/tutorials/with-angular', description: - 'Learn how to build a user management app with Nuxt 3 and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Angular and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/angular-icon', }, { title: 'RedwoodJS', href: '/guides/tutorials/with-redwoodjs', description: - 'Learn how to build a user management app with Nuxt 3 and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with RedwoodJS and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/redwood-icon', }, { title: 'Svelte', href: '/guides/tutorials/with-svelte', description: - 'Learn how to build a user management app with Nuxt 3 and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Svelte and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/svelte-icon', }, { title: 'SvelteKit', href: '/guides/tutorials/with-sveltekit', description: - 'Learn how to build a user management app with Nuxt 3 and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with SvelteKit and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/svelte-icon', }, ] @@ -125,7 +125,7 @@ export const mobile = [ title: 'Expo', href: '/guides/tutorials/with-expo', description: - 'Learn how to build a user management app with React and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Expo and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/expo-icon', }, ] @@ -135,21 +135,21 @@ export const lowCode = [ title: 'Ionic React', href: '/guides/tutorials/with-ionic-react', description: - 'Learn how to build a user management app with React and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Ionic React and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/ionic-icon', }, { title: 'Ionic Vue', href: '/guides/tutorials/with-ionic-vue', description: - 'Learn how to build a user management app with Flutter and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Ionic Vue and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/ionic-icon', }, { title: 'Ionic Angular', href: '/guides/tutorials/with-ionic-angular', description: - 'Learn how to build a user management app with NextJS and Supabase Database, Auth, and Storage functionality.', + 'Learn how to build a user management app with Ionic Angular and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/ionic-icon', }, ] From 2ebd226f8487b71a191ff0aea9ba3ffdbbc94cfe Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Wed, 11 Jan 2023 14:06:27 -0330 Subject: [PATCH 17/21] Update how function info is built --- apps/docs/DEVELOPERS.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/docs/DEVELOPERS.md b/apps/docs/DEVELOPERS.md index 6b0dadd2641..e016dbb53c1 100644 --- a/apps/docs/DEVELOPERS.md +++ b/apps/docs/DEVELOPERS.md @@ -62,11 +62,20 @@ Several pieces of information for this function come from a [common file](https: 4. product - the Supabase tool or product that "owns" this function. Since `updateUser()` is an auth function, its product is `auth` 5. type — `updateUser()` is a function and marked as such, but we can also have sections of markdown interspersed with these function definitions. +When a new function is added, this info would need to be manually added to the common file. + #### Function Parameters The `updateUser()` function takes one parameter: `attributes`. The details for this parameter live in the GoTrue client library, referenced via a `$ref` property in the `supabase-js` [spec file](https://github.com/supabase/supabase/blob/cb04d85262db6a371539dda7df9b00ba5a901e87/spec/supabase_js_v2.yml#L357). Here, the `$ref` property is pointing to the [actual function definition](https://github.com/supabase/gotrue-js/blob/2d60e79073b96ae8c97a6ce18e2601ed1e2a2712/src/GoTrueClient.ts#L590) in the `gotrue-js` library. The accepted values for the `attributes` parameter come from the [type definition](https://github.com/supabase/gotrue-js/blob/16d3deb822097e8640a3a15b94a5690b3beaf11b/src/lib/types.ts#L233). -These individual library spec files are fetched via this [Makefile](https://github.com/supabase/supabase/blob/master/spec/Makefile), and get [transformed](https://github.com/supabase/supabase/blob/master/spec/enrichments/tsdoc_v2/supabase_dereferenced.json) to combine the information we need (params, types, etc). If you're working on docs, you likely won't need to touch this part of the setup, but we've included this detail here to point you in the right direction in case you do. +These individual library spec files are fetched via this [Makefile](https://github.com/supabase/supabase/blob/master/spec/Makefile), and get [transformed](https://github.com/supabase/supabase/blob/master/spec/enrichments/tsdoc_v2/supabase_dereferenced.json) to combine the information we need (params, types, etc). Unless you're a library maintainer, you shouldn't need to worry about this part of the process. + +If you are a library maintainer, the last important note about these library files is that the [Makefile](https://github.com/supabase/supabase/blob/master/spec/Makefile) pulls from the `gh-pages` branch of the client library repo. Here's an example of the [`realtime-js` spec file](https://github.com/supabase/realtime-js/blob/gh-pages/v2/spec.json). Updating something like function params or returns, the process is: + +1. Get your changes merged to `master` in your library +2. This will kick off an action that automatically updates the spec file in the library's `gh-pages` branch +3. Run `make` in `/spec` of the `supabase/supabase` repo. This will regenerate all of the `tsdoc` files that the docs site uses +4. You should now see the changes you've made in the docs site locally #### Function Examples @@ -86,4 +95,4 @@ On the Next.JS side of things, these work almost exactly the same as the client #### Search -Search is handled through Algolia. When the site is built, a [script](https://github.com/supabase/supabase/blob/master/apps/docs/scripts/build-search.ts) runs through all of the types of content, generating search objects that are sent to Algolia to index. +Search is handled through Algolia. When the site is built, a [search script](https://github.com/supabase/supabase/blob/master/apps/docs/scripts/build-search.ts) runs through all of the types of content, generating search objects that are sent to Algolia to index. From f112be97b49e257b5f69262ad7e00946768452c4 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Wed, 11 Jan 2023 14:11:02 -0330 Subject: [PATCH 18/21] Cleanup --- apps/docs/DEVELOPERS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/DEVELOPERS.md b/apps/docs/DEVELOPERS.md index e016dbb53c1..50ea5d9deec 100644 --- a/apps/docs/DEVELOPERS.md +++ b/apps/docs/DEVELOPERS.md @@ -34,7 +34,7 @@ Some things to note: 1. The files need to import a Layout at the top 2. The files need to export a `Page` at the bottom with the `` component -3. The files frontmatter is stored in `const meta = {}`. You should always include `id`, `title` and `description`. +3. The files frontmatter is stored in `const meta = {}`. You should always include `title` and `description`. 4. You can write Markdown as you normally would, but you can also write regular Javascript and JSX. Note the `examples` array that we iterate over. 5. Any Javascript variables you use in these files need to be exported in order to be used (i.e., `export const examples = []`). From d0196ece8b6c4696e381146b071f5d72b53e00a3 Mon Sep 17 00:00:00 2001 From: yayza <80866371+yayza@users.noreply.github.com> Date: Wed, 11 Jan 2023 17:38:39 -0800 Subject: [PATCH 19/21] Update sveltekit.mdx Tiny spelling mistake --- apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx b/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx index e6d1d141100..bcdcef28fc2 100644 --- a/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx +++ b/apps/docs/pages/guides/auth/auth-helpers/sveltekit.mdx @@ -39,7 +39,7 @@ yarn add @supabase/auth-helpers-sveltekit ### Configuration -Set up the fillowing env vars. For local development you can set them in a `.env` file. See an [example](https://github.com/supabase/auth-helpers/blob/main/examples/sveltekit/.env.example). +Set up the following env vars. For local development you can set them in a `.env` file. See an [example](https://github.com/supabase/auth-helpers/blob/main/examples/sveltekit/.env.example). ```bash # Find these in your Supabase project settings > API From 2d2ba85af51eb2a3dafa6b4f6bf6d82face289a1 Mon Sep 17 00:00:00 2001 From: Inian Date: Thu, 12 Jan 2023 11:49:30 +0800 Subject: [PATCH 20/21] add origin image clarification for storage pricing --- apps/www/data/Pricing.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/www/data/Pricing.json b/apps/www/data/Pricing.json index 7d2dd4e24ae..dd2589b08f3 100644 --- a/apps/www/data/Pricing.json +++ b/apps/www/data/Pricing.json @@ -194,6 +194,7 @@ }, { "title": "Asset transformations", + "tooltip": "Origin images are only relevant for image transformations. Images in the bucket which are not transformed do not count towards this limit.", "tiers": { "free": false, "pro": "Unlimited transformations for 100 origin images, then 5$ per 1000 origin images", From caa7220bcd197f5cafe0bdc482cc49ada243a877 Mon Sep 17 00:00:00 2001 From: Kevin Brolly Date: Thu, 12 Jan 2023 07:36:57 +0000 Subject: [PATCH 21/21] Add note to local development docs for NPM users Some [users had trouble](https://www.reddit.com/r/Supabase/comments/zl8zgz/trying_to_install_supabase_cli/) when installing the Supabase CLI via NPM, this note may provide some guidance in these cases. --- .../guides/resources/supabase-cli/local-development.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/docs/pages/guides/resources/supabase-cli/local-development.mdx b/apps/docs/pages/guides/resources/supabase-cli/local-development.mdx index eb4d4572a8b..b0f45364b52 100644 --- a/apps/docs/pages/guides/resources/supabase-cli/local-development.mdx +++ b/apps/docs/pages/guides/resources/supabase-cli/local-development.mdx @@ -31,6 +31,13 @@ Make sure you have these installed on your local machine: supabase login ``` + + +If you installed the Supabase CLI via NPM you may have to use `npx supabase login`. + + + + ## Initialize your project Create a new folder for your project and start a new git repository: