The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
chore: add auto-troubleshooting-template to local dev (#33128)
Charisa255acb5ea9d
diff --git a/apps/docs/package.json b/apps/docs/package.jsonindex cdbfc913762..784b3103692 100644--- a/apps/docs/package.json+++ b/apps/docs/package.json@@ -5,7 +5,8 @@"scripts": {"preinstall": "npx only-allow pnpm","predev": "pnpm run codegen:references && pnpm run codegen:examples",- "dev": "next dev --port 3001",+ "dev": "concurrently --kill-others \"next dev --port 3001\" \"pnpm run dev:watch:troubleshooting\"",+ "dev:watch:troubleshooting": "node ./scripts/troubleshooting/watch.mjs","dev:secrets:pull": "AWS_PROFILE=supabase-dev node ../../scripts/getSecrets.js -n local/docs","build": "next build","build:analyze": "ANALYZE=true next build",@@ -44,8 +45,8 @@"@supabase/supabase-js": "catalog:","@tailwindcss/container-queries": "^0.1.1","@tanstack/react-query": "^5.13.4",- "acorn-typescript": "^1.4.13","acorn": "^8.11.3",+ "acorn-typescript": "^1.4.13","ai-commands": "workspace:*","common": "workspace:*","common-tags": "^1.8.2",@@ -122,6 +123,8 @@"@types/unist": "^2.0.6","api-types": "workspace:*","cheerio": "^1.0.0-rc.12",+ "chokidar": "^4.0.3",+ "concurrently": "^9.1.2","config": "workspace:*","dotenv": "^16.0.3","ejs": "^3.1.10",diff --git a/apps/docs/scripts/troubleshooting/watch.mjs b/apps/docs/scripts/troubleshooting/watch.mjsnew file mode 100644index 00000000000..304954500bf--- /dev/null+++ b/apps/docs/scripts/troubleshooting/watch.mjs@@ -0,0 +1,61 @@+// @ts-check++import chokidar from 'chokidar'+import { closeSync, openSync, readFileSync, writeSync } from 'node:fs'+import { basename, join } from 'node:path'++const TROUBLESHOOTING_DIRECTORY = join(import.meta.dirname, '../../content/troubleshooting')++let __template = ''++function getTemplate() {+ if (!__template) {+ __template = readFileSync(join(TROUBLESHOOTING_DIRECTORY, '_template.mdx'), 'utf8')+ }+ return __template+}++const watcher = chokidar+ .watch(TROUBLESHOOTING_DIRECTORY, { ignoreInitial: true })+ .on('add', (path, stats) => {+ if (!stats?.isFile() || basename(path).startsWith('_')) return++ console.log(`File ${path} has been added.`)++ if (stats?.size !== 0) {+ console.log(`File ${path} already has content. Skipping template writing.`)+ return+ }++ try {+ console.log(`Writing template to ${path}...`)+ const fd = openSync(path, 'w')+ writeSync(fd, getTemplate())+ closeSync(fd)+ } catch (err) {+ console.error(`Error writing template to ${path}:`, err)+ }+ })++// Keep the process alive+const interval = setInterval(() => {}, 1000)++const shutdown = () => {+ console.log(`\nShutting down watcher...`)+ clearInterval(interval)+ watcher+ .close()+ .then(() => {+ console.log('Watcher closed. Exiting process.')+ process.exit(0)+ })+ .catch((err) => {+ console.error('Error closing watcher:', err)+ process.exit(1)+ })+}++process.on('SIGINT', shutdown)+process.on('SIGTERM', shutdown)+process.on('SIGHUP', shutdown)+process.on('SIGQUIT', shutdown)diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex bc3000998f9..9f9758b9813 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -475,6 +475,12 @@ importers:cheerio:specifier: ^1.0.0-rc.12version: 1.0.0-rc.12+ chokidar:+ specifier: ^4.0.3+ version: 4.0.3+ concurrently:+ specifier: ^9.1.2+ version: 9.1.2dotenv:specifier: ^16.0.3version: 16.3.1@@ -6463,6 +6469,10 @@ packages:resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==}engines: {node: '>= 8.10.0'}+ resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}+ engines: {node: '>= 14.16.0'}+resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}engines: {node: '>=10'}@@ -6651,6 +6661,11 @@ packages:resolution: {integrity: sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==}+ resolution: {integrity: sha512-H9MWcoPsYddwbOGM6difjVwVZHl63nwMEwDJG/L7VGtuaJhb12h2caPG2tVPWs7emuYix252iGfqOyrz1GczTQ==}+ engines: {node: '>=18'}+ hasBin: true+resolution: {integrity: sha512-9SxX4/6NzK1l+2iDWLyr/0tsli/eKzSJhBIepptF+GPy/7CprnA0coQz8fF8Gx1IF3wBZsJg0vRaC3LtNa0vRg==}@@ -10949,6 +10964,10 @@ packages:resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}engines: {node: '>=8.10.0'}+ resolution: {integrity: sha512-h80JrZu/MHUZCyHu5ciuoI0+WxsCxzxJTILn6Fs8rxSnFPh+UVHYfeIxK1nVGugMqkfC4vJcBOYbkfkwYK0+gw==}+ engines: {node: '>= 14.18.0'}+resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==}engines: {node: '>= 12.13.0'}@@ -11202,6 +11221,9 @@ packages:resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}+ resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==}+resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==}engines: {node: '>=6'}@@ -11970,6 +11992,10 @@ packages:peerDependencies:tslib: '2'+ resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==}+ hasBin: true+resolution: {integrity: sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==}@@ -18650,6 +18676,10 @@ snapshots:optionalDependencies:fsevents: 2.3.3+ dependencies:+ readdirp: 4.1.1+@@ -18820,6 +18850,16 @@ snapshots:dependencies:source-map: 0.6.1+ dependencies:+ chalk: 4.1.2+ lodash: 4.17.21+ rxjs: 7.8.1+ shell-quote: 1.8.1+ supports-color: 8.1.1+ tree-kill: 1.2.2+ yargs: 17.7.2+dependencies:tslib: 2.6.2@@ -24541,6 +24581,8 @@ snapshots:dependencies:picomatch: 2.3.1+ [email protected]: {}+@@ -24948,6 +24990,10 @@ snapshots:dependencies:queue-microtask: 1.2.3+ dependencies:+ tslib: 2.6.2+dependencies:mri: 1.2.0@@ -25848,6 +25894,8 @@ snapshots:dependencies:tslib: 2.6.2+ [email protected]: {}+