The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Adds code highlighting
Paul Copplestone73de9d31883c
diff --git a/README.md b/README.mdindex b4186ef6de3..a8474a79b53 100644--- a/README.md+++ b/README.md@@ -14,7 +14,7 @@ All of our documeentation is stored in this repo as a single source of truth. YoThis is monorepo. As much as we love `npm`, we have decided to use `yarn` to manage the separate workspaces.-```sh+```bashyarn # installs all dependencies for all workspaces.yarn workspaces dev # runs "dev" command in all workspaces.yarn workspace @supabase/web dev # runs "dev" command in the "web" workspace.diff --git a/package.json b/package.jsonindex 0b649e64361..4953890cefb 100644--- a/package.json+++ b/package.json@@ -3,8 +3,13 @@"private": true,"description": "Supabase Monorepo","workspaces": {- "packages": ["packages/*"],- "nohoist": ["**/bulma", "**/bulma/**"]+ "packages": [+ "packages/*"+ ],+ "nohoist": [+ "**/bulma",+ "**/bulma/**"+ ]},"engines": {"node": ">=10.13.0",diff --git a/packages/realtime-js/package.json b/packages/realtime-js/package.jsonindex 3f107afe842..2e1db758b4f 100644--- a/packages/realtime-js/package.json+++ b/packages/realtime-js/package.json@@ -17,6 +17,6 @@"devDependencies": {},"dependencies": {"@types/node": "^12.6.8",- "phoenix-channels": "^0.19.0"+ "phoenix-channels": "^1.0.0"}}diff --git a/packages/web/components/layouts/DocsLayout.js b/packages/web/components/layouts/DocsLayout.jsindex b2593ac74c5..453c3808fa4 100644--- a/packages/web/components/layouts/DocsLayout.js+++ b/packages/web/components/layouts/DocsLayout.js@@ -1,11 +1,11 @@import '~/styles/style.scss'-import Navbar from '../Navbar'-import NavbarDocs from '../NavbarDocs'-import Footer from '../Footer'-import Head from 'next/head'-import Link from 'next/link'-import { useRouter } from 'next/router'-import React, { useState, useEffect } from 'react'+import Navbar from '../Navbar'+import NavbarDocs from '../NavbarDocs'+import Footer from '../Footer'+import Head from 'next/head'+import Link from 'next/link'+import { useRouter } from 'next/router'+import React, { useState, useEffect } from 'react'export default function DocsLayout(props) {const [sidebarVisible, toggleSidebar] = useState(false)diff --git a/packages/web/content/docs/realtime/installation.mdx b/packages/web/content/docs/realtime/installation.mdxindex 8195c413c75..595b03b803e 100644--- a/packages/web/content/docs/realtime/installation.mdx+++ b/packages/web/content/docs/realtime/installation.mdx@@ -12,7 +12,7 @@ We have tried to keep the requirements to use this as simple as possible. HoweveMake sure your database has replication turned on:-```sh+```bashSHOW wal_level; # This should be "logical"SHOW max_replication_slots; # You need at least one free slot for Supabase```@@ -21,7 +21,7 @@ SHOW max_replication_slots; # You need at least one free slot for SupabaseCreate a publication for Supabase to listen to on all of your tables.-```sh+```bashCREATE PUBLICATION supabase_realtime FOR ALL TABLES;```@@ -30,7 +30,7 @@ CREATE PUBLICATION supabase_realtime FOR ALL TABLES;If you want to receive the data the previous data (i.e. what the fields were *before* updates), then you need to set each table to have a full replica identity:-```sh+```bashALTER TABLE YOUR_TABLE_NAME replica identity full; # Change YOUR_TABLE_NAME```diff --git a/packages/web/content/docs/realtime/realtime-js.mdx b/packages/web/content/docs/realtime/realtime-js.mdxindex 2d82c74a52d..cbb0e0f4c33 100644--- a/packages/web/content/docs/realtime/realtime-js.mdx+++ b/packages/web/content/docs/realtime/realtime-js.mdx@@ -6,7 +6,7 @@ export const metadata = {## Install-```sh+```bashnpm install --save @supabase/realtime-js```diff --git a/packages/web/next.config.js b/packages/web/next.config.jsindex ac95ba45387..def8fcbbb2a 100644--- a/packages/web/next.config.js+++ b/packages/web/next.config.js@@ -2,9 +2,13 @@ const withPlugins = require('next-compose-plugins')// Next Configconst nextConfig = {- experimental: { publicDirectory: true }+ experimental: { publicDirectory: true },}+// CSS+const withCSS = require('@zeit/next-css')+const withCssConfig = {}+// SASSconst withSass = require('@zeit/next-sass')const withSassConfig = {@@ -14,9 +18,16 @@ const withSassConfig = {}// Markdown+const rehypePrism = require('@mapbox/rehype-prism')const withMDX = require('@zeit/next-mdx')({- extension: /\.mdx?$/,+ extension: /\.(md|mdx)?$/,+ options: {+ hastPlugins: [rehypePrism],+ },})-const withMdxConfig = { }+const withMdxConfig = {}-module.exports = withPlugins([[withSass, withSassConfig], [withMDX, withMdxConfig]], nextConfig)+module.exports = withPlugins(+ [[withCSS, withCssConfig], [withSass, withSassConfig], [withMDX, withMdxConfig]],+ nextConfig+)diff --git a/packages/web/package.json b/packages/web/package.jsonindex 03531f77af5..9840fc91861 100644--- a/packages/web/package.json+++ b/packages/web/package.json@@ -11,13 +11,16 @@"static": "next build && next export"},"dependencies": {+ "@mapbox/rehype-prism": "^0.3.1","@mdx-js/loader": "^1.3.1",+ "@zeit/next-css": "^1.0.1","@zeit/next-mdx": "^1.2.0","@zeit/next-sass": "^1.0.0","bulma": "^0.7.5","next": "^9.0.5-canary.2","next-compose-plugins": "^2.2.0","node-sass": "^4.7.2",+ "prismjs": "^1.17.1","react": "^16.7.0","react-dom": "^16.7.0"},diff --git a/packages/web/pages/docs/[category]/[slug].js b/packages/web/pages/docs/[category]/[slug].jsindex 5c2012b38f2..10757a1b438 100644--- a/packages/web/pages/docs/[category]/[slug].js+++ b/packages/web/pages/docs/[category]/[slug].js@@ -1,8 +1,8 @@+import 'prismjs/themes/prism-tomorrow.css'import { useRouter } from 'next/router'import Layout from '~/components/layouts/DocsLayout'import Loading from '~/components/Loading'import Link from 'next/link'-import PropTypes from 'prop-types'const importReducer = ctx => {let keys = ctx.keys()@@ -26,34 +26,34 @@ Docs['baseless'] = importReducer(require.context('../../../content/docs/baseless// Set up all sidebarsvar Sidebars = []Sidebars['-'] = {- introduction: ['about', 'contributing'],+ Introduction: ['about', 'contributing'],}Sidebars['packaged'] = {- introduction: ['getting-started'],+ Introduction: ['getting-started'],}Sidebars['admin-api'] = {- introduction: ['getting-started'],+ Introduction: ['getting-started'],API: ['schemas', 'tables'],}Sidebars['realtime'] = {- introduction: ['getting-started', 'installation'],- 'Client libraries': ['realtime-js'],+ Introduction: ['getting-started', 'installation'],+ 'Client Libraries': ['realtime-js'],}Sidebars['restful'] = {- introduction: ['getting-started'],+ Introduction: ['getting-started'],}Sidebars['graphql'] = {- introduction: ['getting-started'],+ Introduction: ['getting-started'],}Sidebars['baseless'] = {- introduction: ['getting-started'],+ Introduction: ['getting-started'],}const CategoryDocs = props => {const router = useRouter()- let { category, slug } = router.query- if (!category || !slug) return <Loading />+ if (!router.query.category || !router.query.slug) return <Loading />+ const { category, slug } = router.queryconst categoryDocs = Docs[category]const categorySidebar = enrichSidebar(Sidebars[category], categoryDocs)const documentation = categoryDocs[`./${slug}.mdx`]diff --git a/yarn.lock b/yarn.lockindex 990dd5d3eb9..d0f906e665a 100644--- a/yarn.lock+++ b/yarn.lock@@ -837,6 +837,15 @@resolved "https://registry.yarnpkg.com/@csstools/convert-colors/-/convert-colors-1.4.0.tgz#ad495dc41b12e75d588c6db8b9834f08fa131eb7"integrity sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw==+"@mapbox/rehype-prism@^0.3.1":+ version "0.3.1"+ resolved "https://registry.yarnpkg.com/@mapbox/rehype-prism/-/rehype-prism-0.3.1.tgz#538e38737df0d0d1462beabf9ceae88fce4035a5"+ integrity sha512-3LVcYjRoyn13yRyAxGdHEOA9k2litvxJU60IbaOlPWStUiNA2GspgwiDSVHzhF+nLOu8Wed6SWFFLh18U/KEQw==+ dependencies:+ hast-util-to-string "^1.0.0"+ refractor "^2.3.0"+ unist-util-visit "^1.1.3"+"@mdx-js/loader@^0.15.0":version "0.15.7"resolved "https://registry.yarnpkg.com/@mdx-js/loader/-/loader-0.15.7.tgz#dd184301607579b3aa5021dc50e2ae2a04e478dc"@@ -912,6 +921,11 @@resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.5.1.tgz#f5f29bde5b09f8da3f4a4b43fa0a34bcf8ffc7cb"integrity sha512-8F8E5FPWKP/cHjjI+O6Sh4KLUktk0KKS1xrxqVoBQd14/PBDH+kUgSJVE99p9jSRGh+OjCBmqx0tXN+m32w1tA==+"@types/node@^12.6.8":+ version "12.11.7"+ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.11.7.tgz#57682a9771a3f7b09c2497f28129a0462966524a"+ integrity sha512-JNbGaHFCLwgHn/iCckiGSOZ1XYHsKFwREtzPwSGCVld1SGhOlmZw2D4ZI94HQCrBHbADzW9m4LER/8olJTRGHA==+"@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3":version "2.0.3"resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e"@@ -1073,7 +1087,7 @@resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d"integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==-"@zeit/[email protected]":+"@zeit/[email protected]", "@zeit/next-css@^1.0.1":version "1.0.1"resolved "https://registry.yarnpkg.com/@zeit/next-css/-/next-css-1.0.1.tgz#4f784e841e7ca1b21b3468a902e2c1fa95a3e75c"integrity sha512-yfHPRy/ne/5SddVClsoy+fpU7e0Cs1gkWA67/wm2uIu+9rznF45yQLxHEt5dPGF3h6IiIh7ZtIgA8VV8YKq87A==@@ -1893,6 +1907,15 @@ cli-spinners@^2.0.0:resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.2.0.tgz#e8b988d9206c692302d8ee834e7a85c0144d8f77"integrity sha512-tgU3fKwzYjiLEQgPMD9Jt+JjHVL9kW93FiIMX/l7rivvOD4/LL0Mf7gda3+4U2KJBloybwgj5KEoQgGRioMiKQ==+clipboard@^2.0.0:+ version "2.0.4"+ resolved "https://registry.yarnpkg.com/clipboard/-/clipboard-2.0.4.tgz#836dafd66cf0fea5d71ce5d5b0bf6e958009112d"+ integrity sha512-Vw26VSLRpJfBofiVaFb/I8PVfdI1OxKcYShe6fm0sP/DtmiWQNCjhM/okTvdCo0G+lMMm1rMYbk4IK4x1X+kgQ==+ dependencies:+ good-listener "^1.2.2"+ select "^1.1.2"+ tiny-emitter "^2.0.0"+cliui@^3.2.0:version "3.2.0"resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d"@@ -2455,6 +2478,11 @@ delayed-stream@~1.0.0:resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=+delegate@^3.1.2:+ version "3.2.0"+ resolved "https://registry.yarnpkg.com/delegate/-/delegate-3.2.0.tgz#b66b71c3158522e8ab5744f720d8ca0c2af59166"+ integrity sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==+delegates@^1.0.0:version "1.0.0"resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"@@ -3078,6 +3106,13 @@ globule@^1.0.0:lodash "~4.17.10"minimatch "~3.0.2"+good-listener@^1.2.2:+ version "1.2.2"+ resolved "https://registry.yarnpkg.com/good-listener/-/good-listener-1.2.2.tgz#d53b30cdf9313dffb7dc9a0d477096aa6d145c50"+ integrity sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=+ dependencies:+ delegate "^3.1.2"+graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2:version "4.2.2"resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02"@@ -3240,6 +3275,11 @@ hast-util-to-parse5@^5.0.0:xtend "^4.0.1"zwitch "^1.0.0"+hast-util-to-string@^1.0.0:+ version "1.0.2"+ resolved "https://registry.yarnpkg.com/hast-util-to-string/-/hast-util-to-string-1.0.2.tgz#fcf6d46bde2a50a1fbcaf6ed238971a51b622eac"+ integrity sha512-fQNr0n5KJmZW1TmBfXbc4DO0ucZmseUw3T6K4PDsUUTMtTGGLZMUYRB8mOKgPgtw7rtICdxxpRQZmWwo8KxlOA==+hastscript@^5.0.0:version "5.1.0"resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-5.1.0.tgz#a19b3cca6a26a2bcd0f1b1eac574af9427c1c7df"@@ -4423,7 +4463,7 @@ ms@^2.1.1:resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==-nan@^2.12.1, nan@^2.13.2:+nan@^2.12.1, nan@^2.13.2, nan@^2.14.0:version "2.14.0"resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==@@ -4982,7 +5022,7 @@ parse-asn1@^5.0.0:pbkdf2 "^3.0.3"safe-buffer "^5.1.1"-parse-entities@^1.1.0:+parse-entities@^1.1.0, parse-entities@^1.1.2:version "1.2.2"resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50"integrity sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg==@@ -5120,6 +5160,13 @@ performance-now@^2.1.0:resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=+phoenix-channels@^1.0.0:+ version "1.0.0"+ resolved "https://registry.yarnpkg.com/phoenix-channels/-/phoenix-channels-1.0.0.tgz#4de3a7a3427483deffc4908d8fecac725db06d6a"+ integrity sha1-TeOno0J0g97/xJCNj+yscl2wbWo=+ dependencies:+ websocket "^1.0.24"+pify@^2.0.0:version "2.3.0"resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"@@ -5608,6 +5655,13 @@ prettier@^1.18.2:resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==+prismjs@^1.17.1, prismjs@~1.17.0:+ version "1.17.1"+ resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.17.1.tgz#e669fcbd4cdd873c35102881c33b14d0d68519be"+ integrity sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q==+ optionalDependencies:+ clipboard "^2.0.0"+private@^0.1.6:version "0.1.8"resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"@@ -5901,6 +5955,15 @@ reflect.ownkeys@^0.2.0:resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=+refractor@^2.3.0:+ version "2.10.0"+ resolved "https://registry.yarnpkg.com/refractor/-/refractor-2.10.0.tgz#4cc7efc0028a87924a9b31d82d129dec831a287b"+ integrity sha512-maW2ClIkm9IYruuFYGTqKzj+m31heq92wlheW4h7bOstP+gf8bocmMec+j7ljLcaB1CAID85LMB3moye31jH1g==+ dependencies:+ hastscript "^5.0.0"+ parse-entities "^1.1.2"+ prismjs "~1.17.0"+regenerate-unicode-properties@^8.1.0:version "8.1.0"resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz#ef51e0f0ea4ad424b77bf7cb41f3e015c70a3f0e"@@ -6259,6 +6322,11 @@ scss-tokenizer@^0.2.3:js-base64 "^2.1.8"source-map "^0.4.2"+select@^1.1.2:+ version "1.1.2"+ resolved "https://registry.yarnpkg.com/select/-/select-1.1.2.tgz#0e7350acdec80b1108528786ec1d4418d11b396d"+ integrity sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=+"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0:version "5.7.1"resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"@@ -6832,6 +6900,11 @@ timers-browserify@^2.0.4:dependencies:setimmediate "^1.0.4"+tiny-emitter@^2.0.0:+ version "2.1.0"+ resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-2.1.0.tgz#1d1a56edfc51c43e863cbb5382a72330e3555423"+ integrity sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==+title-case@^2.1.0:version "2.1.1"resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa"@@ -7149,7 +7222,7 @@ [email protected]:unist-util-is "^4.0.0"unist-util-visit-parents "^3.0.0"-unist-util-visit@^1.0.0, unist-util-visit@^1.1.0, unist-util-visit@^1.3.0:+unist-util-visit@^1.0.0, unist-util-visit@^1.1.0, unist-util-visit@^1.1.3, unist-util-visit@^1.3.0:version "1.4.1"resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3"integrity sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw==@@ -7405,6 +7478,16 @@ [email protected]:watchpack "^1.6.0"webpack-sources "^1.4.1"+websocket@^1.0.24:+ version "1.0.30"+ resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.30.tgz#91d3bd00c3d43e916f0cf962f8f8c451bb0b2373"+ integrity sha512-aO6klgaTdSMkhfl5VVJzD5fm+Srhh5jLYbS15+OiI1sN6h/RU/XW6WN9J1uVIpUKNmsTvT3Hs35XAFjn9NMfOw==+ dependencies:+ debug "^2.2.0"+ nan "^2.14.0"+ typedarray-to-buffer "^3.1.5"+ yaeti "^0.0.6"+whatwg-fetch@>=0.10.0:version "3.0.0"resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"@@ -7491,6 +7574,11 @@ y18n@^3.2.1:resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b"integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==+yaeti@^0.0.6:+ version "0.0.6"+ resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577"+ integrity sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=+yallist@^2.1.2:version "2.1.2"resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"