diff --git a/apps/reference/_cli/usage.mdx b/apps/reference/_cli/usage.mdx index 9959e7dc443..92173fd9a22 100644 --- a/apps/reference/_cli/usage.mdx +++ b/apps/reference/_cli/usage.mdx @@ -5,8 +5,7 @@ title: Usage -Supabase CLI. - +Supabase CLI @@ -14,37 +13,573 @@ Supabase CLI.

-## Manage your Edge Functions {#supabase-functions} +## Stop the Supabase local development setup {#supabase-stop} -Manage your Edge Functions. ### Usage ```sh -supabase functions [command] [flags] +supabase stop [flags] ``` +### Options + +```sh + -h, --help help for stop +``` + + + + + +

+ +## Show status of the Supabase local development setup {#supabase-status} + + + + +### Usage + +```sh +supabase status [flags] +``` + + + +### Options + +```sh + -h, --help help for status +``` + + + + + +

+ +## Start the Supabase local development setup {#supabase-start} + + + + +### Usage + +```sh +supabase start [flags] +``` + + + +### Options + +```sh + -h, --help help for start +``` + + + + + +

+ +## Manage Supabase secrets {#supabase-secrets} + + + + +### Usage + + + + ### Available Commands -- supabase-functions-new +- supabase-secrets-list + +- supabase-secrets-set + +- supabase-secrets-unset + + + +### Options + +```sh + -h, --help help for secrets +``` + + + + + +

+ +## Unset a secret(s) from the linked Supabase project {#supabase-secrets-unset} + + + + +### Usage + +```sh +supabase secrets unset ... [flags] +``` + + + +### Options + +```sh + -h, --help help for unset +``` + + + + + +

+ +## Set a secret(s) to the linked Supabase project {#supabase-secrets-set} + + + + +### Usage + +```sh +supabase secrets set [flags] ... +``` + + + +### Options + +```sh + --env-file string Read secrets from a .env file. + -h, --help help for set +``` + + + + + +

+ +## List all secrets in the linked project {#supabase-secrets-list} + + + + +### Usage + +```sh +supabase secrets list [flags] +``` + + + +### Options + +```sh + -h, --help help for list +``` + + + + + +

+ +## Manage Supabase projects {#supabase-projects} + + + + +### Usage + + + + +### Available Commands + + +- supabase-projects-create + +- supabase-projects-list + + + +### Options + +```sh + -h, --help help for projects +``` + + + + + +

+ +## List all projects {#supabase-projects-list} + + + + +### Usage + +```sh +supabase projects list [flags] +``` + + + +### Options + +```sh + -h, --help help for list +``` + + + + + +

+ +## Create a new project {#supabase-projects-create} + + + + +### Usage + +```sh +supabase projects create [flags] +``` + + + +### Options + +```sh + --db-password string Database password of the project. + -h, --help help for create + --org-id string Organization ID to create the project in. + --plan string Select a plan that suits your needs. Can be "free" or "pro". (default "free") + --region string Select a region close to you for the best performance. +``` + + + + + +

+ +## Manage Supabase organizations {#supabase-orgs} + + + + +### Usage + + + + +### Available Commands + + +- supabase-orgs-list + + + +### Options + +```sh + -h, --help help for orgs +``` + + + + + +

+ +## List all organizations the logged-in user belongs {#supabase-orgs-list} + + + + +### Usage + +```sh +supabase orgs list [flags] +``` + + + +### Options + +```sh + -h, --help help for list +``` + + + + + +

+ +## Manage database migration scripts {#supabase-migration} + + + + +### Usage + + + + +### Available Commands + + +- supabase-migration-new + + + +### Options + +```sh + -h, --help help for migration +``` + + + + + +

+ +## Create an empty migration script {#supabase-migration-new} + + + + +### Usage + +```sh +supabase migration new [flags] +``` + + + +### Options + +```sh + -h, --help help for new +``` + + + + + +

+ +## Authenticate using an access token {#supabase-login} + + + + +### Usage + +```sh +supabase login [flags] +``` + + + +### Options + +```sh + -h, --help help for login +``` + + + + + +

+ +## Link to a Supabase project {#supabase-link} + + + + +### Usage + +```sh +supabase link [flags] +``` + + + +### Options + +```sh + -h, --help help for link + --project-ref string Project ref of the Supabase project. +``` + + + + + +

+ +## Initialize a project to use Supabase CLI {#supabase-init} + + + + +### Usage + +```sh +supabase init [flags] +``` + + + +### Options + +```sh + -h, --help help for init +``` + + + + + +

+ +## Run code generation tools {#supabase-gen} + + + + +### Usage + + + + +### Available Commands + + +- supabase-gen-types + + + +### Options + +```sh + -h, --help help for gen +``` + + + + + +

+ +## Generate types from Postgres schema {#supabase-gen-types} + + + + +### Usage + + + + +### Available Commands + + +- supabase-gen-types-typescript + + + +### Options + +```sh + -h, --help help for types +``` + + + + + +

+ +## Generate types for TypeScript. Must specify either --local or --db-url + {#supabase-gen-types-typescript} + + + + +### Usage + +```sh +supabase gen types typescript [flags] +``` + + + +### Options + +```sh + --db-url string Generate types from a database url. + -h, --help help for typescript + --local Generate types from the local dev database. +``` + + + + + +

+ +## Manage Supabase Edge functions {#supabase-functions} + + + + +### Usage + + + + +### Available Commands -- supabase-functions-deploy - supabase-functions-delete +- supabase-functions-deploy + +- supabase-functions-new + +- supabase-functions-serve + ### Options +```sh + -h, --help help for functions ``` --h, --help help for functions -``` - @@ -52,27 +587,26 @@ supabase functions [command] [flags]

-## Create an Edge Functions {#supabase-functions-new} +## Serve a Function locally {#supabase-functions-serve} -Create an Edge Functions. ### Usage ```sh -supabase functions new +supabase functions serve [flags] ``` - ### Options +```sh + --env-file string Path to an env file to be populated to the Function environment. + -h, --help help for serve + --no-verify-jwt Disable JWT verification for the Function. ``` --h, --help help for functions -``` - @@ -80,27 +614,24 @@ supabase functions new

-## Deploy an Edge Functions {#supabase-functions-deploy} +## Create a new Function locally {#supabase-functions-new} -Deploy an Edge Functions. ### Usage ```sh -supabase functions deploy -```` - +supabase functions new [flags] +``` ### Options +```sh + -h, --help help for new ``` --h, --help help for functions -``` - @@ -108,25 +639,413 @@ supabase functions deploy

-## Delete an Edge Functions {#supabase-functions-delete} +## Deploy a Function to the linked Supabase project {#supabase-functions-deploy} -Delete an Edge Functions. ### Usage ```sh -supabase functions delete +supabase functions deploy [flags] ``` - ### Options -``` --h, --help help for functions +```sh + -h, --help help for deploy + --no-verify-jwt Disable JWT verification for the Function. + --project-ref string Project ref of the Supabase project. ``` + + + +

+ +## Delete a Function from the linked Supabase project. This does NOT remove the Function locally. + {#supabase-functions-delete} + + + + +### Usage + +```sh +supabase functions delete [flags] +``` + + + +### Options + +```sh + -h, --help help for delete + --project-ref string Project ref of the Supabase project. +``` + + + + + +

+ +## Manage Postgres databases {#supabase-db} + + + + +### Usage + + + + +### Available Commands + + +- supabase-db-branch + +- supabase-db-diff + +- supabase-db-push + +- supabase-db-remote + +- supabase-db-reset + + + +### Options + +```sh + -h, --help help for db +``` + + + + + +

+ +## Resets the local database to current migrations {#supabase-db-reset} + + + + +### Usage + +```sh +supabase db reset [flags] +``` + + + +### Options + +```sh + -h, --help help for reset +``` + + + + + +

+ +## Manage remote database connections {#supabase-db-remote} + + + + +### Usage + + + + +### Available Commands + + +- supabase-db-remote-changes + +- supabase-db-remote-commit + +- supabase-db-remote-set + + + +### Options + +```sh + -h, --help help for remote +``` + + + + + +

+ +## Set the remote database to push migrations to {#supabase-db-remote-set} + + + + +### Usage + +```sh +supabase db remote set [flags] +``` + + + +### Options + +```sh + -h, --help help for set +``` + + + + + +

+ +## Commit changes on the remote database since the last pushed migration + {#supabase-db-remote-commit} + + + + +### Usage + +```sh +supabase db remote commit [flags] +``` + + + +### Options + +```sh + -h, --help help for commit +``` + + + + + +

+ +## Print changes on the remote database since the last pushed migration + {#supabase-db-remote-changes} + + + + +### Usage + +```sh +supabase db remote changes [flags] +``` + + + +### Options + +```sh + -h, --help help for changes +``` + + + + + +

+ +## Push new migrations to the remote database {#supabase-db-push} + + + + +### Usage + +```sh +supabase db push [flags] +``` + + + +### Options + +```sh + --dry-run Print the migrations that would be applied, but don't actually apply them. + -h, --help help for push +``` + + + + + +

+ +## Diffs the local database for schema changes {#supabase-db-diff} + + + + +### Usage + +```sh +supabase db diff [flags] +``` + + + +### Options + +```sh + -f, --file string Saves schema diff to a file. + -h, --help help for diff + -s, --schema strings List of schema to include. (default [public]) + --use-migra Use migra to generate schema diff. +``` + + + + + +

+ +## Manage branches. Each branch is associated with a separate database. + {#supabase-db-branch} + + + + +### Usage + + + + +### Available Commands + + +- supabase-db-branch-create + +- supabase-db-branch-delete + +- supabase-db-branch-list + +- supabase-db-branch-switch + + + +### Options + +```sh + -h, --help help for branch +``` + + + + + +

+ +## Switch the active branch {#supabase-db-branch-switch} + + + + +### Usage + +```sh +supabase db branch switch [flags] +``` + + + +### Options + +```sh + -h, --help help for switch +``` + + + + + +

+ +## List branches {#supabase-db-branch-list} + + + + +### Usage + +```sh +supabase db branch list [flags] +``` + + + +### Options + +```sh + -h, --help help for list +``` + + + + + +

+ +## Delete a branch {#supabase-db-branch-delete} + + + + +### Usage + +```sh +supabase db branch delete [flags] +``` + + + +### Options + +```sh + -h, --help help for delete +``` + + + + + +

+ +## Create a branch {#supabase-db-branch-create} + + + + +### Usage + +```sh +supabase db branch create [flags] +``` + + + +### Options + +```sh + -h, --help help for create +``` + diff --git a/apps/reference/docs/about.md b/apps/reference/docs/about.md index e19ffb81f44..fc881d9f35a 100644 --- a/apps/reference/docs/about.md +++ b/apps/reference/docs/about.md @@ -1,467 +1,9 @@ --- id: about +title: Introduction +description: 'What is Supabase?' slug: / -sidebar_label: About -sidebar_position: 2 +hide_table_of_contents: true --- -# Reference Documentation - -This section of the docs provides technical descriptions of the products and how to use them. - -## Modularity - -Supabase is modular. While it may seem like a single tool, it is actually a suite of tools that are composed on top of a PostgreSQL database. This offers several advantages: - -- Each tool scales independently. -- Each tool can be self-hosted. -- Developers can disable tools which are not required. -- Each tool is focused on a single task to minimize complexity. - -This is a similar approach to any Enterprise-grade system with an additional focus on modularity: while some companies might cut-corners, Supabase makes modularity a priority. - -## Architecture - -- `Database` - - [PostgreSQL](https://www.postgresql.org/) is an object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance. - - Coonection Pooling: [PgBouncer](https://www.pgbouncer.org/) is a lightweight connection pooler for PostgreSQL. - - [postgres-meta](https://github.com/supabase/postgres-meta) is a RESTful API for managing your Postgres, allowing you to fetch tables, add roles, and run queries, etc. -- `Auth` - - Authentication: [GoTrue](https://github.com/supabase/gotrue) is an SWT based API for managing users and issuing SWT tokens. - - Authorization: using [PostgreSQL Row Level Security](https://supabase.com/docs/guides/auth/row-level-security). -- `APIs` - - Websockets: [Realtime](https://github.com/supabase/realtime) is an Elixir server that allows you to listen to PostgreSQL inserts, updates, and deletes using websockets. Realtime polls Postgres' built-in replication functionality for database changes, converts changes to JSON, then broadcasts the JSON over websockets to authorized clients. - - REST: [PostgREST](http://postgrest.org/) is a web server that turns your PostgreSQL database directly into a RESTful API - - GraphQL: [pg_graphql](https://github.com/supabase/pg_graphql) adds GraphQL support to your PostgreSQL database. - - Edge Functions: [Deno](https://deno.land/) is a modern and secure runtime for JavaScript, TypeScript, and WebAssembly. - - Reverse Proxy: [Kong](https://github.com/Kong/kong) is a cloud-native API gateway. -- `File Storage` - - [Storage](https://github.com/supabase/storage-api) provides a RESTful interface for managing Files stored in S3, using Postgres to manage permissions. - -## Open source - -Each part of the Supabase ecosystem is open source. Wherever possible, we support existing tools rather than developing from scratch. - -We choose tools which are [OSI Compliant](https://opensource.org/licenses), with a strong bias towards MIT, Apache 2.0, and PostgreSQL licenses. -Everything we open source is licensed with one of these 3 licenses: - -- MIT for client libraries -- Apache 2.0 for API servers -- PostgreSQL for any Postgres-related tooling - -## Client Libraries - -Supabase provides client libraries for building your products. Our approach for client libraries is modular. Each sub-library is a standalone implementation for a single system. - -For example, our `supabase-js` library is a wrapper around five smaller libraries: - -- `postgrest-js` (REST API) -- `gotrue-js` (Authentication) -- `storage-js` (File Storage) -- `realtime-js` (Websockets) -- `functions-js` (Edge Functions) - -## Community - -Supabase officially supports the Javascript libraries, and all other libraries are community-maintained. This is one way that we try to support and foster an open source ecosystem. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Supabase Tool: - - PostgREST - - - - GoTrue - - - - Realtime - - - - Storage - - - - Edge Functions - -
JavaScript (TypeScript) - - supabase-js - - - - postgrest-js - - - - gotrue-js - - - - realtime-js - - - - storage-js - - - - functions-js - -
Dart - - supabase-dart - - - - postgrest-dart - - - - gotrue-dart - - - - realtime-dart - - - - storage-dart - - - - functions-dart - -
Flutter - - supabase-flutter - - -----
Community
C# - - supabase-csharp - - - - postgrest-csharp - - - - gotrue-csharp - - - - realtime-csharp - - - - storage-csharp - - -
Go- - - postgrest-go - - -- - - storage-go - - -
Java-- - - gotrue-java - - ---
Kotlin- - - postgrest-kt - - - - gotrue-kt - - ---
Python - - supabase-py - - - - postgrest-py - - - - gotrue-py - - - - realtime-py - - - - storage-py - - -
Ruby - - supabase-rb - - - - postgrest-rb - - ----
Rust- - - postgrest-rs - - ----
Swift - - supabase-swift - - - - postgrest-swift - - - - gotrue-swift - - - - realtime-swift - - - - storage-swift - - -
+Guides here \ No newline at end of file diff --git a/apps/reference/docs/reference.mdx b/apps/reference/docs/reference.mdx new file mode 100644 index 00000000000..9c49afdc589 --- /dev/null +++ b/apps/reference/docs/reference.mdx @@ -0,0 +1,114 @@ +--- +id: reference +title: Reference Documentation +sidebar_label: About +hide_table_of_contents: true +--- + +import Link from '@docusaurus/Link' + +The Supabase Reference Docs provide technical descriptions of the products and how to use them. + +
+
+ {/* Database */} +
+ +
+

JavaScript

+

JavaScript and TypeScript documentation.

+
+ +
+ {/* Auth */} +
+ +
+

Dart

+

Dart and Flutter documentation.

+
+ +
+ {/* Examples - coming soon */} +
+ +
+

Supabase CLI

+

Manage your Supabase projects.

+
+ +
+ {/* CLI */} +
+ +
+

Supabase API

+

Manage your Supabase projects.

+
+ +
+ {/* */} +
+
+ +## Community + +The Supabase Reference Docs provide technical descriptions of the products and how to use them. + +
+
+ {/* Auth */} +
+ +
+

Auth Helpers

+

+ A collection of framework specific Auth utilities for working with + Supabase. +

+
+ +
+ {/* */} +
+
+ +## Self-Hosting + +The Supabase Reference Docs provide technical descriptions of the products and how to use them. + +
+
+ {/* Examples - coming soon */} +
+ +
+

Auth Server

+

Auth reference.

+
+ +
+ {/* */} +
+ +
+

Storage

+

Storage reference.

+
+ +
+ {/* */} +
+
diff --git a/apps/reference/docusaurus.config.js b/apps/reference/docusaurus.config.js index 26e1aacbb49..7b1202651d6 100644 --- a/apps/reference/docusaurus.config.js +++ b/apps/reference/docusaurus.config.js @@ -1,20 +1,21 @@ // @ts-nocheck // Note: type annotations allow type checking and IDEs autocompletion -const lightCodeTheme = require('prism-react-renderer/themes/github') -const darkCodeTheme = require('prism-react-renderer/themes/dracula') +const lightCodeTheme = require('@kiwicopple/prism-react-renderer/themes/vsDark') +const darkCodeTheme = require('@kiwicopple/prism-react-renderer/themes/vsDark') const mainNavbar = require('./nav/_referenceNavbar') /** @type {import('@docusaurus/types').Config} */ const config = { - title: 'Supabase Tools', - tagline: 'Documentation for the Supabase Ecosystem', - url: 'https://supabase.tools', - baseUrl: '/', + title: 'Supabase', + tagline: 'The open source Firebase alternative.', + url: 'https://supabase.com', + baseUrl: '/docs/', onBrokenLinks: 'ignore', // TODO: remove this when going into prod // onBrokenLinks: 'throw', onBrokenMarkdownLinks: 'warn', - favicon: 'img/favicon.ico', + favicon: '/favicon.ico', + themes: ['docusaurus-theme-search-typesense'], // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. @@ -35,7 +36,7 @@ const config = { { id: '_api', path: '_api', - routeBasePath: 'api', + routeBasePath: '/reference/api', sidebarPath: require.resolve('./nav/api_sidebars.js'), breadcrumbs: false, }, @@ -45,7 +46,7 @@ const config = { { id: '_cli', path: '_cli', - routeBasePath: 'cli', + routeBasePath: '/reference/cli', sidebarPath: require.resolve('./nav/cli_sidebars.js'), breadcrumbs: false, }, @@ -55,7 +56,7 @@ const config = { { id: '_gotrue', path: '_gotrue', - routeBasePath: 'auth', + routeBasePath: '/reference/auth', sidebarPath: require.resolve('./nav/gotrue_sidebars.js'), breadcrumbs: false, }, @@ -65,7 +66,7 @@ const config = { { id: '_storage', path: '_storage', - routeBasePath: 'storage', + routeBasePath: '/reference/storage', sidebarPath: require.resolve('./nav/storage_sidebars.js'), breadcrumbs: false, }, @@ -75,7 +76,7 @@ const config = { { id: '_supabase_dart', path: '_supabase_dart', - routeBasePath: 'supabase-dart', + routeBasePath: '/reference/dart', sidebarPath: require.resolve('./nav/supabase_dart_sidebars.js'), breadcrumbs: false, }, @@ -85,9 +86,16 @@ const config = { { id: '_supabase_js', path: '_supabase_js', - routeBasePath: 'supabase-js', + routeBasePath: '/reference/javascript', sidebarPath: require.resolve('./nav/supabase_js_sidebars.js'), breadcrumbs: false, + lastVersion: 'current', + versions: { + current: { + label: 'v2', + // path: 'v2', + }, + }, }, ], [ @@ -95,7 +103,7 @@ const config = { { id: '_auth_helpers', path: '_auth_helpers', - routeBasePath: 'auth-helpers', + routeBasePath: '/reference/auth-helpers', sidebarPath: require.resolve('./nav/auth_helpers_sidebars.js'), breadcrumbs: false, }, @@ -124,11 +132,11 @@ const config = { /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ navbar: { - // title: 'Supabase Tools', + // title: 'Supabase Docs', logo: { - alt: 'Supabase Tools', - src: 'img/supabase-logo-wordmark--light.svg', - srcDark: 'img/supabase-logo-wordmark--dark.svg', + alt: 'Supabase Docs', + src: '/img/supabase-logo-wordmark--light.svg', + srcDark: '/img/supabase-logo-wordmark--dark.svg', }, items: mainNavbar.navbar, }, @@ -223,6 +231,27 @@ const config = { theme: lightCodeTheme, darkTheme: darkCodeTheme, }, + + typesense: { + typesenseCollectionName: 'supabase', // Replace with your own doc site's name. Should match the collection name in the scraper settings. + + typesenseServerConfig: { + nodes: [ + { + host: 'doc-search.supabase.com', + port: 443, + protocol: 'https', + }, + ], + apiKey: 't0HAJQy4KtcMk3aYGnm8ONqab2oAysJz', + }, + + // Optional: Typesense search parameters: https://typesense.org/docs/0.21.0/api/documents.md#search-parameters + typesenseSearchParameters: {}, + + // Optional + contextualSearch: true, + }, }), } diff --git a/apps/reference/nav/_referenceNavbar.js b/apps/reference/nav/_referenceNavbar.js index 2cad0a73f75..641f0f40482 100644 --- a/apps/reference/nav/_referenceNavbar.js +++ b/apps/reference/nav/_referenceNavbar.js @@ -1,14 +1,16 @@ const navbar = [ { - href: 'https://supabase.com/docs/guides', + to: '/', label: 'Guides', + activeBaseRegex: + '.*.docs/$|^/docs/architecture|(^/docs/guides/(database|auth|storage|api|examples!))|(^/docs/guides/(examples|with-angular|with-flutter|with-nextjs|with-nuxt-3|with-react|with-redwoodjs|with-svelte|with-vue-3)|^/docs/faq|^/docs/going-into-prod|^/docs/handbook|^/docs/company)', position: 'left', }, { - href: '/', + to: '/reference', label: 'Reference', position: 'left', - // activeLinkRegex: '', + activeBaseRegex: '^/docs/reference$|^/docs/reference/$', // exactly match "/docs/reference/" only }, { href: 'https://app.supabase.com', label: 'Login', position: 'right' }, @@ -34,10 +36,10 @@ const navbar = [ // API { - to: 'api', + to: 'reference/api', position: 'left', label: 'API', - supabaseCustomNavBarRegex: '(^/api$|api/)', + supabaseCustomNavBarRegex: '(^/docs/reference/api$|docs/reference/api/)', }, // { // type: 'docsVersionDropdown', @@ -48,10 +50,10 @@ const navbar = [ // CLI { - to: 'cli', + to: 'reference/cli', position: 'left', label: 'CLI', - supabaseCustomNavBarRegex: '(^/cli$|cli/)', + supabaseCustomNavBarRegex: '(^/docs/reference/cli$|docs/reference/cli/)', }, // { // type: 'docsVersionDropdown', @@ -62,16 +64,18 @@ const navbar = [ // supabase-js { - to: 'supabase-js', + to: 'reference/javascript', position: 'left', label: 'JavaScript Library', - supabaseCustomNavBarRegex: '(^/supabase-js$|supabase-js/)', + supabaseCustomNavBarRegex: + '(^/docs/reference/javascript$|docs/reference/javascript/)', }, { type: 'docsVersionDropdown', position: 'left', docsPluginId: '_supabase_js', - supabaseCustomNavBarRegex: '(^/supabase-js$|supabase-js/)', + supabaseCustomNavBarRegex: + '(^/docs/reference/javascript$|docs/reference/javascript/)', }, /** @@ -80,10 +84,10 @@ const navbar = [ // GoTrue { - to: 'auth', + to: 'reference/auth', position: 'left', label: 'Auth Server', - supabaseCustomNavBarRegex: '(^/auth$|auth/)', + supabaseCustomNavBarRegex: '(^/docs/reference/auth$|docs/reference/auth/)', }, // { // type: 'docsVersionDropdown', @@ -94,10 +98,11 @@ const navbar = [ // Storage { - to: 'storage', + to: 'reference/storage', position: 'left', label: 'Storage Server', - supabaseCustomNavBarRegex: '(^/storage$|storage/)', + supabaseCustomNavBarRegex: + '(^/docs/reference/storage$|docs/reference/storage/)', }, // { // type: 'docsVersionDropdown', @@ -110,10 +115,10 @@ const navbar = [ * COMMUNITY */ { - to: 'supabase-dart', + to: 'reference/supabase-dart', position: 'left', label: 'Dart Library', - supabaseCustomNavBarRegex: '(^/supabase-dart$|supabase-dart/)', + supabaseCustomNavBarRegex: '(^/docs/reference/dart$|docs/reference/dart/)', }, // { // type: 'docsVersionDropdown', @@ -123,10 +128,11 @@ const navbar = [ // }, { - to: 'auth-helpers', + to: 'reference/auth-helpers', position: 'left', label: 'Auth Helpers', - supabaseCustomNavBarRegex: '(^/auth-helpers$|auth-helpers/)', + supabaseCustomNavBarRegex: + '(^/docs/reference/auth-helpers$|docs/reference/auth-helpers/)', }, // { // type: 'docsVersionDropdown', diff --git a/apps/reference/nav/_referenceSidebars.js b/apps/reference/nav/_referenceSidebars.js index ebd7567546d..e7838225a80 100644 --- a/apps/reference/nav/_referenceSidebars.js +++ b/apps/reference/nav/_referenceSidebars.js @@ -1,36 +1,30 @@ -/** - * Creating a sidebar enables you to: - - create an ordered group of docs - - render a sidebar for each doc of that group - - provide next/previous navigation - - The sidebars can be generated from the filesystem, or explicitly defined here. - - Create as many sidebars as you want. - */ - -// @ts-check - -/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ const sidebars = { - mainSidebar: [ + guides: [ + { + type: 'category', + label: 'Overview', + items: ['about'], + collapsed: true, + }, + ], + reference: [ { type: 'category', label: 'Reference', - link: { type: 'doc', id: 'about' }, + link: { type: 'doc', id: 'reference' }, collapsed: false, items: [ - { type: 'link', label: 'Supabase CLI', href: '/cli' }, - { type: 'link', label: 'Supabase API', href: '/api' }, + { type: 'link', label: 'Supabase CLI', href: '/reference/cli' }, + { type: 'link', label: 'Supabase API', href: '/reference/api' }, { type: 'link', label: 'Supabase JavaScript Library', - href: '/supabase-js', + href: '/reference/javascript', }, { type: 'link', label: 'Supabase Dart Library', - href: '/supabase-dart', + href: '/reference/dart', }, ], }, @@ -43,7 +37,7 @@ const sidebars = { { type: 'link', label: 'Supabase Auth Helpers', - href: '/auth-helpers', + href: '/reference/auth-helpers', }, ], }, @@ -52,8 +46,8 @@ const sidebars = { label: 'Self hosted', collapsed: false, items: [ - { type: 'link', label: 'Auth Server', href: '/auth' }, - { type: 'link', label: 'Storage Server', href: '/storage' }, + { type: 'link', label: 'Auth Server', href: '/reference/auth' }, + { type: 'link', label: 'Storage Server', href: '/reference/storage' }, ], }, // { diff --git a/apps/reference/package-lock.json b/apps/reference/package-lock.json index 923837d6718..357e2332a1b 100644 --- a/apps/reference/package-lock.json +++ b/apps/reference/package-lock.json @@ -10,8 +10,10 @@ "dependencies": { "@docusaurus/core": "^2.0.1", "@docusaurus/preset-classic": "^2.0.1", + "@kiwicopple/prism-react-renderer": "github:kiwicopple/prism-react-renderer", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", + "docusaurus-theme-search-typesense": "^0.5.3", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", "react-dom": "^17.0.2" @@ -2131,7 +2133,6 @@ "version": "2.0.0-rc.1", "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-2.0.0-rc.1.tgz", "integrity": "sha512-la7D8ggFP8I5nOp/Epl6NqTeDWcbofPVMOaVisRxQbx5iuF9Al+AITbaDgm4CXpFLJACsqhsXD5W4BnKX8ZxfA==", - "dev": true, "dependencies": { "@docusaurus/react-loadable": "5.5.2", "@docusaurus/types": "2.0.0-rc.1", @@ -2706,7 +2707,6 @@ "version": "2.0.0-rc.1", "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-2.0.0-rc.1.tgz", "integrity": "sha512-wX25FOZa/aKnCGA5ljWPaDpMW3TuTbs0BtjQ8WTC557p8zDvuz4r+g2/FPHsgWE0TKwUMf4usQU1m3XpJLPN+g==", - "devOptional": true, "dependencies": { "@types/history": "^4.7.11", "@types/react": "*", @@ -2866,6 +2866,17 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@kiwicopple/prism-react-renderer": { + "version": "1.0.2", + "resolved": "git+ssh://git@github.com/kiwicopple/prism-react-renderer.git#4a09100a587bce2d94d7ac8ed3564a61c6e70781", + "license": "MIT", + "dependencies": { + "prismjs": "^1.22.0" + }, + "peerDependencies": { + "react": ">=0.14.9" + } + }, "node_modules/@leichtgewicht/ip-codec": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", @@ -5564,6 +5575,290 @@ "node": ">=6" } }, + "node_modules/docusaurus-theme-search-typesense": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/docusaurus-theme-search-typesense/-/docusaurus-theme-search-typesense-0.5.3.tgz", + "integrity": "sha512-LjbUTjyFziFwrQH7l7Jn/7d+11wIr+b3t1NrQwHXQnjMuRhUFxxQgzUx4S+HH6ySoPYLEy/IUjO2c5dj1USYJg==", + "dependencies": { + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/plugin-content-docs": "2.0.0-rc.1", + "@docusaurus/theme-translations": "2.0.0-rc.1", + "@docusaurus/utils": "2.0.0-rc.1", + "@docusaurus/utils-validation": "2.0.0-rc.1", + "algoliasearch-helper": "^3.10.0", + "clsx": "^1.2.1", + "eta": "^1.12.3", + "fs-extra": "^10.1.0", + "lodash": "^4.17.21", + "tslib": "^2.4.0", + "typesense-docsearch-react": "^0.2.3", + "typesense-instantsearch-adapter": "^2.4.2-1", + "utility-types": "^3.10.0" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "@docusaurus/core": "2.0.0-rc.1", + "@docusaurus/theme-common": "2.0.0-rc.1", + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0" + } + }, + "node_modules/docusaurus-theme-search-typesense/node_modules/@docusaurus/cssnano-preset": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-2.0.0-rc.1.tgz", + "integrity": "sha512-9/KmQvF+eTlMqUqG6UcXbRgxbGed/8bQInXuKEs+95/jI6jO/3xSzuRwuHHHP0naUvSVWjnNI9jngPrQerXE5w==", + "dependencies": { + "cssnano-preset-advanced": "^5.3.8", + "postcss": "^8.4.14", + "postcss-sort-media-queries": "^4.2.1", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.14" + } + }, + "node_modules/docusaurus-theme-search-typesense/node_modules/@docusaurus/logger": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-2.0.0-rc.1.tgz", + "integrity": "sha512-daa3g+SXuO9K60PVMiSUmDEK9Vro+Ed7i7uF8CH6QQJLcNZy/zJc0Xz62eH7ip1x77fmeb6Rg4Us1TqTFc9AbQ==", + "dependencies": { + "chalk": "^4.1.2", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.14" + } + }, + "node_modules/docusaurus-theme-search-typesense/node_modules/@docusaurus/mdx-loader": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-2.0.0-rc.1.tgz", + "integrity": "sha512-8Fg0c/ceu39knmr7w0dutm7gq3YxKYCqWVS2cB/cPATzChCCNH/AGLfBT6sz/Z4tjVXE+NyREq2pfOFvkhjVXg==", + "dependencies": { + "@babel/parser": "^7.18.8", + "@babel/traverse": "^7.18.8", + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/utils": "2.0.0-rc.1", + "@mdx-js/mdx": "^1.6.22", + "escape-html": "^1.0.3", + "file-loader": "^6.2.0", + "fs-extra": "^10.1.0", + "image-size": "^1.0.1", + "mdast-util-to-string": "^2.0.0", + "remark-emoji": "^2.2.0", + "stringify-object": "^3.3.0", + "tslib": "^2.4.0", + "unified": "^9.2.2", + "unist-util-visit": "^2.0.3", + "url-loader": "^4.1.1", + "webpack": "^5.73.0" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0" + } + }, + "node_modules/docusaurus-theme-search-typesense/node_modules/@docusaurus/plugin-content-docs": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.0.0-rc.1.tgz", + "integrity": "sha512-Yk5Hu6uaw3tRplzJnbDygwRhmZ3PCzEXD4SJpBA6cPC73ylfqOEh6qhiU+BWhMTtDXNhY+athk5Kycfk3DW1aQ==", + "dependencies": { + "@docusaurus/core": "2.0.0-rc.1", + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/mdx-loader": "2.0.0-rc.1", + "@docusaurus/module-type-aliases": "2.0.0-rc.1", + "@docusaurus/types": "2.0.0-rc.1", + "@docusaurus/utils": "2.0.0-rc.1", + "@docusaurus/utils-validation": "2.0.0-rc.1", + "@types/react-router-config": "^5.0.6", + "combine-promises": "^1.1.0", + "fs-extra": "^10.1.0", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "lodash": "^4.17.21", + "tslib": "^2.4.0", + "utility-types": "^3.10.0", + "webpack": "^5.73.0" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0" + } + }, + "node_modules/docusaurus-theme-search-typesense/node_modules/@docusaurus/plugin-content-docs/node_modules/@docusaurus/core": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-2.0.0-rc.1.tgz", + "integrity": "sha512-b9FX0Z+EddfQ6wAiNh+Wx4fysKfcvEcWJrZ5USROn3C+EVU5P4luaa8mwWK//O+hTwD9ur7/A44IZ/tWCTAoLQ==", + "dependencies": { + "@babel/core": "^7.18.6", + "@babel/generator": "^7.18.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-transform-runtime": "^7.18.6", + "@babel/preset-env": "^7.18.6", + "@babel/preset-react": "^7.18.6", + "@babel/preset-typescript": "^7.18.6", + "@babel/runtime": "^7.18.6", + "@babel/runtime-corejs3": "^7.18.6", + "@babel/traverse": "^7.18.8", + "@docusaurus/cssnano-preset": "2.0.0-rc.1", + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/mdx-loader": "2.0.0-rc.1", + "@docusaurus/react-loadable": "5.5.2", + "@docusaurus/utils": "2.0.0-rc.1", + "@docusaurus/utils-common": "2.0.0-rc.1", + "@docusaurus/utils-validation": "2.0.0-rc.1", + "@slorber/static-site-generator-webpack-plugin": "^4.0.7", + "@svgr/webpack": "^6.2.1", + "autoprefixer": "^10.4.7", + "babel-loader": "^8.2.5", + "babel-plugin-dynamic-import-node": "^2.3.3", + "boxen": "^6.2.1", + "chalk": "^4.1.2", + "chokidar": "^3.5.3", + "clean-css": "^5.3.0", + "cli-table3": "^0.6.2", + "combine-promises": "^1.1.0", + "commander": "^5.1.0", + "copy-webpack-plugin": "^11.0.0", + "core-js": "^3.23.3", + "css-loader": "^6.7.1", + "css-minimizer-webpack-plugin": "^4.0.0", + "cssnano": "^5.1.12", + "del": "^6.1.1", + "detect-port": "^1.3.0", + "escape-html": "^1.0.3", + "eta": "^1.12.3", + "file-loader": "^6.2.0", + "fs-extra": "^10.1.0", + "html-minifier-terser": "^6.1.0", + "html-tags": "^3.2.0", + "html-webpack-plugin": "^5.5.0", + "import-fresh": "^3.3.0", + "leven": "^3.1.0", + "lodash": "^4.17.21", + "mini-css-extract-plugin": "^2.6.1", + "postcss": "^8.4.14", + "postcss-loader": "^7.0.0", + "prompts": "^2.4.2", + "react-dev-utils": "^12.0.1", + "react-helmet-async": "^1.3.0", + "react-loadable": "npm:@docusaurus/react-loadable@5.5.2", + "react-loadable-ssr-addon-v5-slorber": "^1.0.1", + "react-router": "^5.3.3", + "react-router-config": "^5.1.1", + "react-router-dom": "^5.3.3", + "rtl-detect": "^1.0.4", + "semver": "^7.3.7", + "serve-handler": "^6.1.3", + "shelljs": "^0.8.5", + "terser-webpack-plugin": "^5.3.3", + "tslib": "^2.4.0", + "update-notifier": "^5.1.0", + "url-loader": "^4.1.1", + "wait-on": "^6.0.1", + "webpack": "^5.73.0", + "webpack-bundle-analyzer": "^4.5.0", + "webpack-dev-server": "^4.9.3", + "webpack-merge": "^5.8.0", + "webpackbar": "^5.0.2" + }, + "bin": { + "docusaurus": "bin/docusaurus.mjs" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "react": "^16.8.4 || ^17.0.0", + "react-dom": "^16.8.4 || ^17.0.0" + } + }, + "node_modules/docusaurus-theme-search-typesense/node_modules/@docusaurus/plugin-content-docs/node_modules/@docusaurus/core/node_modules/@docusaurus/utils-common": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-2.0.0-rc.1.tgz", + "integrity": "sha512-+iZICpeFPZJ9oGJXuG92WTWee6WRnVx5BdzlcfuKf/f5KQX8PvwXR2tDME78FGGhShB8zr+vjuNEXuLvXT7j2A==", + "dependencies": { + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "@docusaurus/types": "*" + }, + "peerDependenciesMeta": { + "@docusaurus/types": { + "optional": true + } + } + }, + "node_modules/docusaurus-theme-search-typesense/node_modules/@docusaurus/theme-translations": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-2.0.0-rc.1.tgz", + "integrity": "sha512-JLhNdlnbQhxVQzOnLyiCaTzKFa1lpVrM3nCrkGQKscoG2rY6ARGYMgMN2DkoH6hm7TflQ8+PE1S5MzzASeLs4Q==", + "dependencies": { + "fs-extra": "^10.1.0", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.14" + } + }, + "node_modules/docusaurus-theme-search-typesense/node_modules/@docusaurus/utils": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-2.0.0-rc.1.tgz", + "integrity": "sha512-ym9I1OwIYbKs1LGaUajaA/vDG8VweJj/6YoZjHp+eDQHhTRIrHXiYoGDqorafRhftKwnA1EnyomuXpNd9bq8Gg==", + "dependencies": { + "@docusaurus/logger": "2.0.0-rc.1", + "@svgr/webpack": "^6.2.1", + "file-loader": "^6.2.0", + "fs-extra": "^10.1.0", + "github-slugger": "^1.4.0", + "globby": "^11.1.0", + "gray-matter": "^4.0.3", + "js-yaml": "^4.1.0", + "lodash": "^4.17.21", + "micromatch": "^4.0.5", + "resolve-pathname": "^3.0.0", + "shelljs": "^0.8.5", + "tslib": "^2.4.0", + "url-loader": "^4.1.1", + "webpack": "^5.73.0" + }, + "engines": { + "node": ">=16.14" + }, + "peerDependencies": { + "@docusaurus/types": "*" + }, + "peerDependenciesMeta": { + "@docusaurus/types": { + "optional": true + } + } + }, + "node_modules/docusaurus-theme-search-typesense/node_modules/@docusaurus/utils-validation": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-2.0.0-rc.1.tgz", + "integrity": "sha512-lj36gm9Ksu4tt/EUeLDWoMbXe3sfBxeIPIUUdqYcBYkF/rpQkh+uL/dncjNGiw6uvBOqXhOfsFVP045HtgShVw==", + "dependencies": { + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/utils": "2.0.0-rc.1", + "joi": "^17.6.0", + "js-yaml": "^4.1.0", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.14" + } + }, "node_modules/dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -7754,6 +8049,18 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" }, + "node_modules/loglevel": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.0.tgz", + "integrity": "sha512-G6A/nJLRgWOuuwdNuA6koovfEV1YpqqAG4pRUlFaz3jj2QNZ8M4vBqnVA+HBTmU/AMNUtlOsMmSpF6NyOjztbA==", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -11395,6 +11702,60 @@ "node": ">=4.2.0" } }, + "node_modules/typesense": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/typesense/-/typesense-1.4.0.tgz", + "integrity": "sha512-+Y6WYNB3+z5bR1/F5AfHQyqdeKGOZW0k2l0HSFgCFl+3wo6oY42lAhJG2JZk6k8ux3j4866IyruKsCG5NtlHMQ==", + "dependencies": { + "axios": "^0.26.0", + "loglevel": "^1.8.0" + }, + "peerDependencies": { + "@babel/runtime": "^7.17.2" + } + }, + "node_modules/typesense-docsearch-css": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/typesense-docsearch-css/-/typesense-docsearch-css-0.3.0.tgz", + "integrity": "sha512-+/t9Jz5dwH52Xpk9ikpJaQZs+McX/a4aY+8Iw+IiD9yu9+JJddEA5RYjBgkcQ140gUtp9L213z/V0g2bC3B/hw==" + }, + "node_modules/typesense-docsearch-react": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/typesense-docsearch-react/-/typesense-docsearch-react-0.2.3.tgz", + "integrity": "sha512-2eODhYFk3KLhwEF+shzcTsiB0zU8GefPFZGzNlGdwdUJiUxjh8SgS7VtylXGdKQZxh33wbWN4wr94CG2WxcIIw==", + "dependencies": { + "@algolia/autocomplete-core": "1.7.1", + "@algolia/autocomplete-preset-algolia": "1.7.1", + "typesense": "^1.4.0-3", + "typesense-docsearch-css": "^0.3.0", + "typesense-instantsearch-adapter": "^2.4.2-1" + }, + "peerDependencies": { + "@types/react": ">= 16.8.0 < 19.0.0", + "react": ">= 16.8.0 < 19.0.0", + "react-dom": ">= 16.8.0 < 19.0.0" + } + }, + "node_modules/typesense-instantsearch-adapter": { + "version": "2.4.2-1", + "resolved": "https://registry.npmjs.org/typesense-instantsearch-adapter/-/typesense-instantsearch-adapter-2.4.2-1.tgz", + "integrity": "sha512-reo1riIstYeHmg0g4amaZNY2wcBPORDIuanMsbIca3G6kMUxr1KyG+4pv8/qt4b+o/cp6AX72aoV6zbcdrhpYg==", + "hasInstallScript": true, + "dependencies": { + "typesense": "^1.4.0-1" + }, + "peerDependencies": { + "@babel/runtime": "^7.17.2" + } + }, + "node_modules/typesense/node_modules/axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "dependencies": { + "follow-redirects": "^1.14.8" + } + }, "node_modules/ua-parser-js": { "version": "0.7.31", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", @@ -14088,7 +14449,6 @@ "version": "2.0.0-rc.1", "resolved": "https://registry.npmjs.org/@docusaurus/module-type-aliases/-/module-type-aliases-2.0.0-rc.1.tgz", "integrity": "sha512-la7D8ggFP8I5nOp/Epl6NqTeDWcbofPVMOaVisRxQbx5iuF9Al+AITbaDgm4CXpFLJACsqhsXD5W4BnKX8ZxfA==", - "dev": true, "requires": { "@docusaurus/react-loadable": "5.5.2", "@docusaurus/types": "2.0.0-rc.1", @@ -14544,7 +14904,6 @@ "version": "2.0.0-rc.1", "resolved": "https://registry.npmjs.org/@docusaurus/types/-/types-2.0.0-rc.1.tgz", "integrity": "sha512-wX25FOZa/aKnCGA5ljWPaDpMW3TuTbs0BtjQ8WTC557p8zDvuz4r+g2/FPHsgWE0TKwUMf4usQU1m3XpJLPN+g==", - "devOptional": true, "requires": { "@types/history": "^4.7.11", "@types/react": "*", @@ -14665,6 +15024,13 @@ "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "@kiwicopple/prism-react-renderer": { + "version": "git+ssh://git@github.com/kiwicopple/prism-react-renderer.git#4a09100a587bce2d94d7ac8ed3564a61c6e70781", + "from": "@kiwicopple/prism-react-renderer@https://github.com/kiwicopple/prism-react-renderer.git", + "requires": { + "prismjs": "^1.22.0" + } + }, "@leichtgewicht/ip-codec": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", @@ -16657,6 +17023,229 @@ "@leichtgewicht/ip-codec": "^2.0.1" } }, + "docusaurus-theme-search-typesense": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/docusaurus-theme-search-typesense/-/docusaurus-theme-search-typesense-0.5.3.tgz", + "integrity": "sha512-LjbUTjyFziFwrQH7l7Jn/7d+11wIr+b3t1NrQwHXQnjMuRhUFxxQgzUx4S+HH6ySoPYLEy/IUjO2c5dj1USYJg==", + "requires": { + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/plugin-content-docs": "2.0.0-rc.1", + "@docusaurus/theme-translations": "2.0.0-rc.1", + "@docusaurus/utils": "2.0.0-rc.1", + "@docusaurus/utils-validation": "2.0.0-rc.1", + "algoliasearch-helper": "^3.10.0", + "clsx": "^1.2.1", + "eta": "^1.12.3", + "fs-extra": "^10.1.0", + "lodash": "^4.17.21", + "tslib": "^2.4.0", + "typesense-docsearch-react": "^0.2.3", + "typesense-instantsearch-adapter": "^2.4.2-1", + "utility-types": "^3.10.0" + }, + "dependencies": { + "@docusaurus/cssnano-preset": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/cssnano-preset/-/cssnano-preset-2.0.0-rc.1.tgz", + "integrity": "sha512-9/KmQvF+eTlMqUqG6UcXbRgxbGed/8bQInXuKEs+95/jI6jO/3xSzuRwuHHHP0naUvSVWjnNI9jngPrQerXE5w==", + "requires": { + "cssnano-preset-advanced": "^5.3.8", + "postcss": "^8.4.14", + "postcss-sort-media-queries": "^4.2.1", + "tslib": "^2.4.0" + } + }, + "@docusaurus/logger": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/logger/-/logger-2.0.0-rc.1.tgz", + "integrity": "sha512-daa3g+SXuO9K60PVMiSUmDEK9Vro+Ed7i7uF8CH6QQJLcNZy/zJc0Xz62eH7ip1x77fmeb6Rg4Us1TqTFc9AbQ==", + "requires": { + "chalk": "^4.1.2", + "tslib": "^2.4.0" + } + }, + "@docusaurus/mdx-loader": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/mdx-loader/-/mdx-loader-2.0.0-rc.1.tgz", + "integrity": "sha512-8Fg0c/ceu39knmr7w0dutm7gq3YxKYCqWVS2cB/cPATzChCCNH/AGLfBT6sz/Z4tjVXE+NyREq2pfOFvkhjVXg==", + "requires": { + "@babel/parser": "^7.18.8", + "@babel/traverse": "^7.18.8", + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/utils": "2.0.0-rc.1", + "@mdx-js/mdx": "^1.6.22", + "escape-html": "^1.0.3", + "file-loader": "^6.2.0", + "fs-extra": "^10.1.0", + "image-size": "^1.0.1", + "mdast-util-to-string": "^2.0.0", + "remark-emoji": "^2.2.0", + "stringify-object": "^3.3.0", + "tslib": "^2.4.0", + "unified": "^9.2.2", + "unist-util-visit": "^2.0.3", + "url-loader": "^4.1.1", + "webpack": "^5.73.0" + } + }, + "@docusaurus/plugin-content-docs": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.0.0-rc.1.tgz", + "integrity": "sha512-Yk5Hu6uaw3tRplzJnbDygwRhmZ3PCzEXD4SJpBA6cPC73ylfqOEh6qhiU+BWhMTtDXNhY+athk5Kycfk3DW1aQ==", + "requires": { + "@docusaurus/core": "2.0.0-rc.1", + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/mdx-loader": "2.0.0-rc.1", + "@docusaurus/module-type-aliases": "2.0.0-rc.1", + "@docusaurus/types": "2.0.0-rc.1", + "@docusaurus/utils": "2.0.0-rc.1", + "@docusaurus/utils-validation": "2.0.0-rc.1", + "@types/react-router-config": "^5.0.6", + "combine-promises": "^1.1.0", + "fs-extra": "^10.1.0", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "lodash": "^4.17.21", + "tslib": "^2.4.0", + "utility-types": "^3.10.0", + "webpack": "^5.73.0" + }, + "dependencies": { + "@docusaurus/core": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/core/-/core-2.0.0-rc.1.tgz", + "integrity": "sha512-b9FX0Z+EddfQ6wAiNh+Wx4fysKfcvEcWJrZ5USROn3C+EVU5P4luaa8mwWK//O+hTwD9ur7/A44IZ/tWCTAoLQ==", + "requires": { + "@babel/core": "^7.18.6", + "@babel/generator": "^7.18.7", + "@babel/plugin-syntax-dynamic-import": "^7.8.3", + "@babel/plugin-transform-runtime": "^7.18.6", + "@babel/preset-env": "^7.18.6", + "@babel/preset-react": "^7.18.6", + "@babel/preset-typescript": "^7.18.6", + "@babel/runtime": "^7.18.6", + "@babel/runtime-corejs3": "^7.18.6", + "@babel/traverse": "^7.18.8", + "@docusaurus/cssnano-preset": "2.0.0-rc.1", + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/mdx-loader": "2.0.0-rc.1", + "@docusaurus/react-loadable": "5.5.2", + "@docusaurus/utils": "2.0.0-rc.1", + "@docusaurus/utils-common": "2.0.0-rc.1", + "@docusaurus/utils-validation": "2.0.0-rc.1", + "@slorber/static-site-generator-webpack-plugin": "^4.0.7", + "@svgr/webpack": "^6.2.1", + "autoprefixer": "^10.4.7", + "babel-loader": "^8.2.5", + "babel-plugin-dynamic-import-node": "^2.3.3", + "boxen": "^6.2.1", + "chalk": "^4.1.2", + "chokidar": "^3.5.3", + "clean-css": "^5.3.0", + "cli-table3": "^0.6.2", + "combine-promises": "^1.1.0", + "commander": "^5.1.0", + "copy-webpack-plugin": "^11.0.0", + "core-js": "^3.23.3", + "css-loader": "^6.7.1", + "css-minimizer-webpack-plugin": "^4.0.0", + "cssnano": "^5.1.12", + "del": "^6.1.1", + "detect-port": "^1.3.0", + "escape-html": "^1.0.3", + "eta": "^1.12.3", + "file-loader": "^6.2.0", + "fs-extra": "^10.1.0", + "html-minifier-terser": "^6.1.0", + "html-tags": "^3.2.0", + "html-webpack-plugin": "^5.5.0", + "import-fresh": "^3.3.0", + "leven": "^3.1.0", + "lodash": "^4.17.21", + "mini-css-extract-plugin": "^2.6.1", + "postcss": "^8.4.14", + "postcss-loader": "^7.0.0", + "prompts": "^2.4.2", + "react-dev-utils": "^12.0.1", + "react-helmet-async": "^1.3.0", + "react-loadable": "npm:@docusaurus/react-loadable@5.5.2", + "react-loadable-ssr-addon-v5-slorber": "^1.0.1", + "react-router": "^5.3.3", + "react-router-config": "^5.1.1", + "react-router-dom": "^5.3.3", + "rtl-detect": "^1.0.4", + "semver": "^7.3.7", + "serve-handler": "^6.1.3", + "shelljs": "^0.8.5", + "terser-webpack-plugin": "^5.3.3", + "tslib": "^2.4.0", + "update-notifier": "^5.1.0", + "url-loader": "^4.1.1", + "wait-on": "^6.0.1", + "webpack": "^5.73.0", + "webpack-bundle-analyzer": "^4.5.0", + "webpack-dev-server": "^4.9.3", + "webpack-merge": "^5.8.0", + "webpackbar": "^5.0.2" + }, + "dependencies": { + "@docusaurus/utils-common": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-common/-/utils-common-2.0.0-rc.1.tgz", + "integrity": "sha512-+iZICpeFPZJ9oGJXuG92WTWee6WRnVx5BdzlcfuKf/f5KQX8PvwXR2tDME78FGGhShB8zr+vjuNEXuLvXT7j2A==", + "requires": { + "tslib": "^2.4.0" + } + } + } + } + } + }, + "@docusaurus/theme-translations": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/theme-translations/-/theme-translations-2.0.0-rc.1.tgz", + "integrity": "sha512-JLhNdlnbQhxVQzOnLyiCaTzKFa1lpVrM3nCrkGQKscoG2rY6ARGYMgMN2DkoH6hm7TflQ8+PE1S5MzzASeLs4Q==", + "requires": { + "fs-extra": "^10.1.0", + "tslib": "^2.4.0" + } + }, + "@docusaurus/utils": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/utils/-/utils-2.0.0-rc.1.tgz", + "integrity": "sha512-ym9I1OwIYbKs1LGaUajaA/vDG8VweJj/6YoZjHp+eDQHhTRIrHXiYoGDqorafRhftKwnA1EnyomuXpNd9bq8Gg==", + "requires": { + "@docusaurus/logger": "2.0.0-rc.1", + "@svgr/webpack": "^6.2.1", + "file-loader": "^6.2.0", + "fs-extra": "^10.1.0", + "github-slugger": "^1.4.0", + "globby": "^11.1.0", + "gray-matter": "^4.0.3", + "js-yaml": "^4.1.0", + "lodash": "^4.17.21", + "micromatch": "^4.0.5", + "resolve-pathname": "^3.0.0", + "shelljs": "^0.8.5", + "tslib": "^2.4.0", + "url-loader": "^4.1.1", + "webpack": "^5.73.0" + } + }, + "@docusaurus/utils-validation": { + "version": "2.0.0-rc.1", + "resolved": "https://registry.npmjs.org/@docusaurus/utils-validation/-/utils-validation-2.0.0-rc.1.tgz", + "integrity": "sha512-lj36gm9Ksu4tt/EUeLDWoMbXe3sfBxeIPIUUdqYcBYkF/rpQkh+uL/dncjNGiw6uvBOqXhOfsFVP045HtgShVw==", + "requires": { + "@docusaurus/logger": "2.0.0-rc.1", + "@docusaurus/utils": "2.0.0-rc.1", + "joi": "^17.6.0", + "js-yaml": "^4.1.0", + "tslib": "^2.4.0" + } + } + } + }, "dom-converter": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", @@ -18245,6 +18834,11 @@ "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" }, + "loglevel": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.0.tgz", + "integrity": "sha512-G6A/nJLRgWOuuwdNuA6koovfEV1YpqqAG4pRUlFaz3jj2QNZ8M4vBqnVA+HBTmU/AMNUtlOsMmSpF6NyOjztbA==" + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -20847,6 +21441,50 @@ "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "peer": true }, + "typesense": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/typesense/-/typesense-1.4.0.tgz", + "integrity": "sha512-+Y6WYNB3+z5bR1/F5AfHQyqdeKGOZW0k2l0HSFgCFl+3wo6oY42lAhJG2JZk6k8ux3j4866IyruKsCG5NtlHMQ==", + "requires": { + "axios": "^0.26.0", + "loglevel": "^1.8.0" + }, + "dependencies": { + "axios": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", + "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", + "requires": { + "follow-redirects": "^1.14.8" + } + } + } + }, + "typesense-docsearch-css": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/typesense-docsearch-css/-/typesense-docsearch-css-0.3.0.tgz", + "integrity": "sha512-+/t9Jz5dwH52Xpk9ikpJaQZs+McX/a4aY+8Iw+IiD9yu9+JJddEA5RYjBgkcQ140gUtp9L213z/V0g2bC3B/hw==" + }, + "typesense-docsearch-react": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/typesense-docsearch-react/-/typesense-docsearch-react-0.2.3.tgz", + "integrity": "sha512-2eODhYFk3KLhwEF+shzcTsiB0zU8GefPFZGzNlGdwdUJiUxjh8SgS7VtylXGdKQZxh33wbWN4wr94CG2WxcIIw==", + "requires": { + "@algolia/autocomplete-core": "1.7.1", + "@algolia/autocomplete-preset-algolia": "1.7.1", + "typesense": "^1.4.0-3", + "typesense-docsearch-css": "^0.3.0", + "typesense-instantsearch-adapter": "^2.4.2-1" + } + }, + "typesense-instantsearch-adapter": { + "version": "2.4.2-1", + "resolved": "https://registry.npmjs.org/typesense-instantsearch-adapter/-/typesense-instantsearch-adapter-2.4.2-1.tgz", + "integrity": "sha512-reo1riIstYeHmg0g4amaZNY2wcBPORDIuanMsbIca3G6kMUxr1KyG+4pv8/qt4b+o/cp6AX72aoV6zbcdrhpYg==", + "requires": { + "typesense": "^1.4.0-1" + } + }, "ua-parser-js": { "version": "0.7.31", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.31.tgz", diff --git a/apps/reference/package.json b/apps/reference/package.json index 41a8a314b7c..b71c17124d0 100644 --- a/apps/reference/package.json +++ b/apps/reference/package.json @@ -8,6 +8,7 @@ "docusaurus": "docusaurus start --port 3010", "swizzle": "docusaurus swizzle", "build": "docusaurus build", + "build:vercel": "docusaurus build --out-dir build/docs", "deploy": "docusaurus deploy", "clear": "docusaurus clear", "serve": "docusaurus serve", @@ -21,9 +22,11 @@ "dependencies": { "@docusaurus/core": "^2.0.1", "@docusaurus/preset-classic": "^2.0.1", + "@kiwicopple/prism-react-renderer": "github:kiwicopple/prism-react-renderer", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", "docusaurus-plugin-sass": "^0.2.2", + "docusaurus-theme-search-typesense": "^0.5.3", "prism-react-renderer": "^1.3.5", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/apps/reference/src/css/main.scss b/apps/reference/src/css/main.scss index cf691877fad..3c68d22b38c 100644 --- a/apps/reference/src/css/main.scss +++ b/apps/reference/src/css/main.scss @@ -256,6 +256,20 @@ --ifm-card-background-color: var(--custom-background-color-highlight); } +.markdown p a, +.markdown li a { + transition: box-shadow 0.1s ease-in-out; + padding-bottom: 2px; + color: var(--custom-content-color); + box-shadow: var(--custom-primary) 0px -3px 0px -1px inset; +} +.markdown p a:hover, +.markdown li a:hover { + box-shadow: inset 0 -30px 0 -1px var(--custom-primary); + /* text-shadow: 0px 0px 3px var(--custom-primary-darkest); */ + color: var(--custom-background-color); +} + .custom--navbar__link--hidden .navbar__item, .navbar-sidebar__item.menu > .menu__list @@ -396,3 +410,63 @@ html[data-theme='dark'] .navbar-item-discord:before { background-repeat: no-repeat; background-position: center; } + +/* PRISM */ + +.prism-code { + background-color: none; + word-break: break-word; + font-size: 0.8rem; + outline: none !important; +} +.prism-code div, +.prism-code div:focus, +.prism-code div:active { + outline: none !important; +} +.token.keyword.module, +.token.property-access, +.token.function { + font-style: normal !important; + color: #ccc !important; +} +.token.plain, +.token.parameter, +.token.punctuation, +.token.operator, +.token.console.class-name, +.token.doc-comment.parameter, +.token.doc-comment.optional-parameter, +.token.doc-comment.parameter.punctuation, +.token.doc-comment.optional-parameter.punctuation { + font-style: normal !important; + color: #ccc !important; +} +.token.keyword, +.token.doc-comment.keyword { + font-style: normal !important; + color: #569cd6 !important; +} +.token.string { + font-style: normal !important; + color: #24b47e !important; +} +.token.console { + font-style: normal !important; + color: #49c1ad !important; +} +.token.constant { + font-style: normal !important; + color: #569cd6 !important; +} +.token.comment { + font-style: normal !important; + color: #666 !important; +} +.token.number { + color: #b5cea8 !important; +} +.token.boolean, +.token.doc-comment.class-name { + @apply text-green-500; +} diff --git a/apps/reference/src/theme/DocItem/Paginator/index.js b/apps/reference/src/theme/DocItem/Paginator/index.js deleted file mode 100644 index d0d2debda36..00000000000 --- a/apps/reference/src/theme/DocItem/Paginator/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react' -import { useDoc } from '@docusaurus/theme-common/internal' -import DocPaginator from '@theme/DocPaginator' -/** - * This extra component is needed, because should remain generic. - * DocPaginator is used in non-docs contexts too: generated-index pages... - */ -export default function DocItemPaginator() { - return null // We don't need this at supabase: https://github.com/facebook/docusaurus/issues/7661 - const { metadata } = useDoc() - return -} diff --git a/apps/reference/src/theme/DocSidebar/Desktop/Content/index.js b/apps/reference/src/theme/DocSidebar/Desktop/Content/index.js index 5694db729d5..94a45501768 100644 --- a/apps/reference/src/theme/DocSidebar/Desktop/Content/index.js +++ b/apps/reference/src/theme/DocSidebar/Desktop/Content/index.js @@ -5,12 +5,12 @@ import Link from '@docusaurus/Link' const subNavRoutes = [ // Add any routes which should have a subnav - '/api', - '/cli', - '/auth', - '/storage', - '/supabase-js', - '/supabase-dart', + '/docs/reference/api', + '/docs/reference/cli', + '/docs/reference/auth', + '/docs/reference/storage', + '/docs/reference/javascript', + '/docs/reference/dart', ] const requiresSubNav = (pathname, routes) => { @@ -23,7 +23,7 @@ export default function ContentWrapper(props) { return (
{pathname && requiresSubNav(pathname, subNavRoutes) && ( - + Settings on [app.supabase.com](https://app.supabase.com) - - If "Email Confirmations" is turned on, a `user` is returned but `session` will be null - - If "Email Confirmations" is turned off, both a `user` and a `session` will be returned - - When the user confirms their email address, they will be redirected to localhost:3000 by default. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com) - - If signUp() is called for an existing confirmed user: - - If "Enable email confirmations" is enabled on the "Authentication" -> "Settings" page, an obfuscated / fake user object will be returned. - - If "Enable email confirmations" is disabled, an error with a message "User already registered" will be returned. - - To check if a user already exists, refer to getUser(). - usage: | - ```js - const { user, session, error } = await gotrue.signUp({ - email: 'example@email.com', - password: 'example-password', - }) - ``` - links: [] - attributes: - - id: 'param-signup-options' - title: 'signUpOptions' - required: true - description: 'Some description.' - type: ['number', 'other'] # {string[]} Any values you want to appear in the docs - - id: 'param-options' - title: 'options' - default: 'defaultValue' # OPTIONAL {string} a default value - required: false - description: 'Some description.' - ref: 'CustomType' # {string} If a "type" is not supplied, a "ref" must be. This is a pointer to the types below. - children: - - id: 'param-nested' - name: 'nestedOject' - required: false - description: 'Some description.' - type: ['string'] - children: - - id: 'param-deep' # We can nest as many as required. - name: 'deepNesting' - description: 'Some description.' - required: false - type: ['string'] - returns: - - id: 'returns-error' - title: 'Error' - value: | - ```js - Promise<{ data: null, error: PostgrestError } - ``` - ref: ['PostgrestError'] # OPTIONAL {string}. This is a pointer to the types below. - - id: 'returns-success' - title: 'Success' - value: | - ```js - Promise<{ data: PostgrestSuccess, error: null } - ``` - ref: ['PostgrestSuccess'] # OPTIONAL {string}. This is a pointer to the types below. - examples: - - id: 'example-signup-with-email' - title: 'Sign up with email' - description: | - Use an email and password for email sign up. - links: [] - code: | - ```js - const { user, session, error } = await supabase.auth.signUp({ - email: 'example@email.com', - password: 'example-password', - }) - ``` - returns: - - id: 'example-success' - title: 'Success' - value: | - ```js - Promise<{ data: any, session: any, error: null } - ``` - ref: ['AuthSuccess'] diff --git a/spec/supabase_js_v1_sdk.yaml b/spec/supabase_js_v2_sdk.yaml similarity index 100% rename from spec/supabase_js_v1_sdk.yaml rename to spec/supabase_js_v2_sdk.yaml diff --git a/spec/supabase_js_v2_sdk/combined.json b/spec/supabase_js_v2_sdk/combined.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/web/docusaurus.config.js b/web/docusaurus.config.js index 3f2d80faa64..529550f968f 100755 --- a/web/docusaurus.config.js +++ b/web/docusaurus.config.js @@ -7,7 +7,7 @@ module.exports = { title: 'Supabase', tagline: 'The open source Firebase alternative.', - url: 'https://supabase.com', + url: 'https://reference-docs.vercel.app', baseUrl: '/docs/', favicon: '/favicon.ico', organizationName: 'supabase', // Usually your GitHub org/user name.