From c7246366216f23b85b33ab01d07e47b7c0055392 Mon Sep 17 00:00:00 2001 From: Copple <10214025+kiwicopple@users.noreply.github.com> Date: Wed, 4 Mar 2026 11:17:00 +0100 Subject: [PATCH 1/2] clean up old README --- CONTRIBUTING.md | 71 +++++++++++++++++ PLAN.md | 201 ------------------------------------------------ README.md | 167 +++------------------------------------- 3 files changed, 80 insertions(+), 359 deletions(-) create mode 100644 CONTRIBUTING.md delete mode 100644 PLAN.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..54ae50fc --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,71 @@ +# Developers + +The [`supabase/dbdev`](https://github.com/supabase/dbdev) repository hosts the source code for both the database.dev package registry and its accompanying website. It also hosts the work-in-progress CLI for authors manage their packages. + +### Package Registry + +The package registry `supabase/`, is a [Supabase](https://supabase.com) project where accounts, organizations, and packages are normalized into database tables. For more info of the registry, see the [architecture](#architecture) section + +Requires: +- [Supabase CLI](https://github.com/supabase/cli) +- [docker](https://www.docker.com/) + +``` +supabase start +``` + +which returns a set of endpoints for each service + +```text +supabase local development setup is running. + + API URL: http://localhost:54321 + GraphQL URL: http://localhost:54321/graphql/v1 + DB URL: postgresql://postgres:postgres@localhost:54322/postgres + Studio URL: http://localhost:54323 + Inbucket URL: http://localhost:54324 + JWT secret: SECRET + anon key: KEY +service_role key: KEY +``` + +The *API URL* and *anon key* values will be used in the next section to setup environment variables. + + +### Website (database.dev) + +The website/ directory contains a Next.js project, which serves as the visual interface for users to interact with the registry. + +Requires: +- [node 14+](https://nodejs.org/en) + +Copy `.env.example` file to `.env.local`: + +``` +cp .env.example .env.local +``` + +Edit the `.env.local` file with your favourite text editor to set the environment variables `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY`: + +``` +NEXT_PUBLIC_SUPABASE_URL="" +NEXT_PUBLIC_SUPABASE_ANON_KEY="" +``` + +Start the development environment: + +``` +cd website +npm install +npm run dev +``` + +Navigate to [http://localhost:3000](http://localhost:3000) + + +### Architecture + +- The core tables are located in the `app` schema. +- The public API is located in the `public` schema. + +![ERD](assets/erd.png) diff --git a/PLAN.md b/PLAN.md deleted file mode 100644 index 7963e703..00000000 --- a/PLAN.md +++ /dev/null @@ -1,201 +0,0 @@ -# Upgrade Plan: Next.js 16 & shadcn/ui Updates - -## Overview - -This plan outlines the steps to upgrade the dbdev website from Next.js 15.4.10 to Next.js 16.x and update shadcn/ui components to follow the latest patterns. - ---- - -## Current State - -| Component | Current | Target | -|-----------|---------|--------| -| Next.js | 15.4.10 | 16.1.x | -| React | 19.1.0 | 19.x (compatible) | -| shadcn/ui | Installed components | Latest patterns | -| Turbopack | Not default | Default (Next.js 16) | - ---- - -## Phase 1: Next.js 16 Upgrade - -### 1.1 Update Core Dependencies - -```bash -cd website -npm install next@latest react@latest react-dom@latest -``` - -### 1.2 Address Breaking Changes - -Based on Next.js 16 upgrade guide: - -- [ ] **Turbopack is now default** - Remove any `--turbo` flags, now automatic -- [ ] **Middleware renamed to proxy** - Check if any middleware needs updates -- [ ] **React Compiler** - Consider enabling for automatic memoization -- [ ] **Cache Components** - Evaluate `"use cache"` directive for applicable pages - -### 1.3 Configuration Updates - -Update `next.config.js` if needed: -- Review experimental flags that may now be stable -- Enable React Compiler if desired - -### 1.4 Test the Upgrade - -```bash -npm run dev -npm run build -npm run lint -``` - ---- - -## Phase 2: shadcn/ui Configuration Updates - -### 2.1 Update components.json - -Current configuration has `"rsc": false`. For App Router, consider enabling RSC: - -```json -{ - "$schema": "https://ui.shadcn.com/schema.json", - "style": "default", - "rsc": true, - "tsx": true, - "tailwind": { - "config": "tailwind.config.js", - "css": "styles/globals.css", - "baseColor": "slate", - "cssVariables": true - }, - "aliases": { - "components": "~/components", - "utils": "~/lib/utils" - } -} -``` - -### 2.2 Update Radix UI Dependencies - -Current versions to update: - -| Package | Current | Action | -|---------|---------|--------| -| @radix-ui/react-avatar | ^1.1.10 | Check for updates | -| @radix-ui/react-dialog | ^1.1.14 | Check for updates | -| @radix-ui/react-dropdown-menu | ^2.1.15 | Check for updates | -| @radix-ui/react-label | ^2.1.7 | Check for updates | -| @radix-ui/react-separator | ^1.1.7 | Check for updates | -| @radix-ui/react-slot | ^1.2.3 | Check for updates | -| @radix-ui/react-tabs | ^1.1.12 | Check for updates | -| @radix-ui/react-toast | ^1.2.14 | Check for updates | - -```bash -npm update @radix-ui/react-avatar @radix-ui/react-dialog @radix-ui/react-dropdown-menu @radix-ui/react-label @radix-ui/react-separator @radix-ui/react-slot @radix-ui/react-tabs @radix-ui/react-toast -``` - -### 2.3 Update Utility Dependencies - -```bash -npm update class-variance-authority clsx tailwind-merge lucide-react -``` - ---- - -## Phase 3: Component Pattern Updates - -### 3.1 Review Existing Components - -Components in `website/components/ui/`: -- [ ] avatar.tsx -- [ ] badge.tsx -- [ ] button.tsx -- [ ] card.tsx -- [ ] dropdown-menu.tsx -- [ ] input.tsx -- [ ] label.tsx -- [ ] separator.tsx -- [ ] tabs.tsx -- [ ] toast.tsx - -### 3.2 Consider Adding New Components - -shadcn/ui has added new components. Evaluate if any would benefit the project: -- Sonner (modern toast alternative) -- Drawer -- Resizable -- Carousel -- Chart - ---- - -## Phase 4: Testing & Validation - -### 4.1 Development Testing - -```bash -npm run dev -``` - -- [ ] Verify all pages load correctly -- [ ] Test component functionality -- [ ] Check dark mode theming -- [ ] Verify form submissions - -### 4.2 Build Testing - -```bash -npm run build -npm run start -``` - -- [ ] Ensure production build succeeds -- [ ] No TypeScript errors -- [ ] No ESLint errors - -### 4.3 Visual Regression - -- [ ] Compare UI before/after upgrade -- [ ] Verify styling consistency - ---- - -## Rollback Plan - -If issues arise: - -1. Revert `package.json` changes -2. Delete `node_modules` and `package-lock.json` -3. Run `npm install` -4. Verify application works on previous versions - ---- - -## Files to Modify - -| File | Changes | -|------|---------| -| `website/package.json` | Update Next.js, React, Radix UI versions | -| `website/components.json` | Enable RSC support | -| `website/next.config.js` | Review for deprecated options | -| `website/components/ui/*` | Update component patterns if needed | - ---- - -## Timeline Considerations - -- Phase 1 (Next.js upgrade): Core dependency update -- Phase 2 (shadcn config): Configuration alignment -- Phase 3 (Components): Pattern updates as needed -- Phase 4 (Testing): Validation before merge - ---- - -## References - -- [Next.js 16 Release Notes](https://nextjs.org/blog/next-16) -- [Next.js 16.1 Release Notes](https://nextjs.org/blog/next-16-1) -- [Next.js 16 Upgrade Guide](https://nextjs.org/docs/app/guides/upgrading/version-16) -- [shadcn/ui Documentation](https://ui.shadcn.com) -- [shadcn/ui Changelog](https://github.com/shadcn-ui/ui/releases) diff --git a/README.md b/README.md index 1d7d346a..d545dc2a 100644 --- a/README.md +++ b/README.md @@ -4,166 +4,17 @@ dbdev is a package manager for Postgres [trusted language extensions (TLE)](https://github.com/aws/pg_tle). -- Search for packages on [database.dev](https://database.dev). -- Documentation: [supabase.github.io/dbdev/](https://supabase.github.io/dbdev/) -- Publish your own Extension: [supabase.github.io/dbdev/publish-extension/](https://supabase.github.io/dbdev/publish-extension/) -- Read the dbdev [release blog post](https://supabase.com/blog/dbdev) - -### Warning - -Restoring a logical backup of a database with a TLE installed can fail. For this reason, dbdev should only be used with databases with physical backups enabled. - -## Usage - -Users primarily interact with the registry using the dbdev SQL client. Once present, packages can be installed as follows: - -```sql --- Load the package from the package index -select dbdev.install('olirice-index_advisor'); -``` -Where `olirice` is the handle of the publisher and `index_advisor` is the name of the package. - -Once installed, packages are visible in PostgreSQL as extensions. At that point they can be enabled with standard Postgres commands i.e. the `create extension` - -To improve reproducibility, we recommend __always__ specifying the package version in your `create extension` statements. - -For example: -```sql --- Enable the extension -create extension "olirice-index_advisor" - version '0.1.0'; -``` - -Which creates all tables/indexes/functions/etc specified by the extension. - -## Install the Client in Postgres - -The in-database SQL client for the package registry is named `dbdev`. You can bootstrap the client with: - -```sql -/*--------------------- ----- install dbdev ---- ----------------------- -Requires: - - pg_tle: https://github.com/aws/pg_tle - - pgsql-http: https://github.com/pramsey/pgsql-http -*/ -create extension if not exists http with schema extensions; -create extension if not exists pg_tle; -drop extension if exists "supabase-dbdev"; -select pgtle.uninstall_extension_if_exists('supabase-dbdev'); -select - pgtle.install_extension( - 'supabase-dbdev', - resp.contents ->> 'version', - 'PostgreSQL package manager', - resp.contents ->> 'sql' - ) -from http( - ( - 'GET', - 'https://api.database.dev/rest/v1/' - || 'package_versions?select=sql,version' - || '&package_name=eq.supabase-dbdev' - || '&order=version.desc' - || '&limit=1', - array[ - ('apiKey', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InhtdXB0cHBsZnZpaWZyYndtbXR2Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODAxMDczNzIsImV4cCI6MTk5NTY4MzM3Mn0.z2CN0mvO2No8wSi46Gw59DFGCTJrzM0AQKsu_5k134s')::http_header - ], - null, - null - ) -) x, -lateral ( - select - ((row_to_json(x) -> 'content') #>> '{}')::json -> 0 -) resp(contents); -create extension "supabase-dbdev"; -select dbdev.install('supabase-dbdev'); -drop extension if exists "supabase-dbdev"; -create extension "supabase-dbdev"; -``` - -With the client ready, search for packages on [database.dev](database.dev) and install them -```sql -select dbdev.install('handle-package_name'); -create extension "handle-package_name" - schema 'public' - version '1.2.3'; -``` - -## Developers - -The [`supabase/dbdev`](https://github.com/supabase/dbdev) repository hosts the source code for both the database.dev package registry and its accompanying website. It also hosts the work-in-progress CLI for authors manage their packages. - -### Package Registry - -The package registry `supabase/`, is a [Supabase](https://supabase.com) project where accounts, organizations, and packages are normalized into database tables. For more info of the registry, see the [architecture](#architecture) section - -Requires: -- [Supabase CLI](https://github.com/supabase/cli) -- [docker](https://www.docker.com/) +## Links -``` -supabase start -``` - -which returns a set of endpoints for each service - -```text -supabase local development setup is running. - - API URL: http://localhost:54321 - GraphQL URL: http://localhost:54321/graphql/v1 - DB URL: postgresql://postgres:postgres@localhost:54322/postgres - Studio URL: http://localhost:54323 - Inbucket URL: http://localhost:54324 - JWT secret: SECRET - anon key: KEY -service_role key: KEY -``` - -The *API URL* and *anon key* values will be used in the next section to setup environment variables. - - -### Website (database.dev) - -The website/ directory contains a Next.js project, which serves as the visual interface for users to interact with the registry. - -Requires: -- [node 14+](https://nodejs.org/en) - -Copy `.env.example` file to `.env.local`: - -``` -cp .env.example .env.local -``` - -Edit the `.env.local` file with your favourite text editor to set the environment variables `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_ANON_KEY`: - -``` -NEXT_PUBLIC_SUPABASE_URL="" -NEXT_PUBLIC_SUPABASE_ANON_KEY="" -``` - -Start the development environment: - -``` -cd website -npm install -npm run dev -``` - -Navigate to [http://localhost:3000](http://localhost:3000) - - -### CLI +- Search for packages on [database.dev](https://database.dev) +- Documentation: [database.dev/docs](https://database.dev/docs) +- Publish your own Extension: [database.dev/docs/publish-extension](https://database.dev/docs/publish-extension) +- Read the dbdev [release blog post](https://supabase.com/blog/dbdev) -Coming soon in the `cli/` directory +## What is a Trusted Language Extension? -### Architecture +Trusted Language Extensions (TLE) allow PostgreSQL extensions to be installed by non-superusers by restricting them to trusted languages such as SQL and PL/pgSQL. Because these languages cannot access the operating system or unsafe memory, the extensions can run safely in managed environments where superuser access is not available. TLEs are commonly used in hosted PostgreSQL services to enable a safer extension ecosystem without granting elevated privileges. -- The core tables are located in the `app` schema. -- The public API is located in the `public` schema. +## Licence -![ERD](assets/erd.png) +Apache 2.0 \ No newline at end of file From 5e64de418a4f1e53f805c08927391e71deadc360 Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Wed, 4 Mar 2026 16:01:02 +0530 Subject: [PATCH 2/2] fix: README.md eol needed a newline --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d545dc2a..f1b51917 100644 --- a/README.md +++ b/README.md @@ -17,4 +17,4 @@ Trusted Language Extensions (TLE) allow PostgreSQL extensions to be installed by ## Licence -Apache 2.0 \ No newline at end of file +Apache 2.0