chore: Switch repo to use pnpm (#29928)

* Fix some missing and duplicate dependencies.

* Fix the types for jest in ai-commands package.

* Replace all npm commands with pnpm. Add pnpm files and workspace links.

* Fix rimraf to work with pnpm.

* Refactor the github actions to work with pnpm.

* Delete package-lock.json.

* Fix the tailwind configs to not include node_modules.

* Fix random files.

* Add preinstall scripts to all packages.

* Fix the Dockerfile to work with pnpm.

* Update the DEVELOPERS documentation.
This commit is contained in:
Ivan Vasilov authored and GitHub committed 2024-12-20 13:07:20 +01:00
1 parent 8166551501
commit dd572efb0d
50 files changed
+28368 -43794

No files matched your search

+9 -4
View File
@@ -33,14 +33,19 @@ jobs:
with:
sparse-checkout: |
packages
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'
- name: Install deps
run: npm ci
run: pnpm i
- name: Type check
run: npm run typecheck
run: pnpm run typecheck
- name: Run tests
run: npm run test
run: pnpm run test
+8 -2
View File
@@ -23,15 +23,21 @@ jobs:
sparse-checkout: apps
ref: ${{ github.head_ref }}
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install required dependencies
run: npm ci
run: pnpm i
- name: Run Prettier in fix mode
run: npm run format
run: pnpm run format
- name: Commit changes and push to existing branch
run: |
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
exclude: |
*.css
**/package.json
**/package-lock.json
**/pnpm-lock.yaml
./.git/*
*.ipynb
./i18n/README.*.md
+9 -3
View File
@@ -26,20 +26,26 @@ jobs:
sparse-checkout: |
apps/docs
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Download dependencies
run: npm ci
run: pnpm i
- name: Update last-changed dates
working-directory: ./apps/docs
if: ${{ !inputs.reset }}
run: npm run last-changed
run: pnpm run last-changed
- name: Reset last-changed dates
working-directory: ./apps/docs
if: ${{ inputs.reset }}
run: npm run last-changed:reset
run: pnpm run last-changed:reset
+30 -24
View File
@@ -11,31 +11,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: master
sparse-checkout: |
apps/docs
- uses: actions/checkout@v4
with:
ref: master
sparse-checkout: |
apps/docs
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Install deps
run: npm ci
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Change to apps/docs/spec directory and run make command
working-directory: apps/docs/spec
run: make download.api.v1 dereference.api.v1 generate.sections.api.v1 format
- name: Install deps
run: pnpm i
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'feat: update mgmt api docs'
title: 'feat: update mgmt api docs'
body: 'This PR updates mgmt api docs automatically.'
branch: 'gha/auto-update-mgmt-api-docs'
base: 'master'
- name: Change to apps/docs/spec directory and run make command
working-directory: apps/docs/spec
run: make download.api.v1 dereference.api.v1 generate.sections.api.v1 format
- name: Create pull request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'feat: update mgmt api docs'
title: 'feat: update mgmt api docs'
body: 'This PR updates mgmt api docs automatically.'
branch: 'gha/auto-update-mgmt-api-docs'
base: 'master'
+9 -3
View File
@@ -22,14 +22,20 @@ jobs:
apps/docs
packages
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'
- name: Install deps
run: npm ci
run: pnpm i
- name: Run tests
run: npm --prefix="apps/docs" run test:smoke
run: pnpm --prefix="apps/docs" run test:smoke
+9 -3
View File
@@ -23,14 +23,20 @@ jobs:
examples
packages
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'
- name: Install deps
run: npm ci
run: pnpm i
- name: Run tests
run: npm run test:docs
run: pnpm run test:docs
+11 -6
View File
@@ -4,12 +4,12 @@ on:
branches: [master]
paths:
- 'apps/studio/**'
- 'package-lock.json'
- 'pnpm-lock.yaml'
pull_request:
branches: [master]
paths:
- 'apps/studio/**'
- 'package-lock.json'
- 'pnpm-lock.yaml'
# Cancel old builds on new commit for same workflow + branch/PR
concurrency:
@@ -23,18 +23,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'
- uses: supabase/setup-cli@v1
- name: Install dependencies
run: npm ci
run: pnpm i
- name: Install Playwright Browsers
run: npx playwright install --with-deps
run: pnpm -C playwright-tests exec playwright install --with-deps
- name: Run Playwright tests
run: npm run test:playwright
run: pnpm run test:playwright
# mark the action as succeeded even if the tests failed. This is temporarily until we make the tests more stable.
# continue-on-error: true
- uses: actions/upload-artifact@v4
+28 -13
View File
@@ -18,17 +18,22 @@ jobs:
uses: actions/checkout@v4
with:
sparse-checkout: apps
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# Installing all dependencies takes up to three minutes, hacking around to only installing prettier+deps
cache: 'pnpm'
- name: Download dependencies
run: |
npm ci
pnpm i
- name: Run prettier
run: |-
npm run test:prettier
pnpm run test:prettier
# i18n is not a node package, so we handle that one separately
format-i18n:
@@ -39,19 +44,22 @@ jobs:
with:
sparse-checkout: |
i18n
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# Installing all dependencies takes up to three minutes, hacking around to only installing prettier+deps
cache: 'pnpm'
- name: Download dependencies
run: |
rm package.json
rm package-lock.json
npm i prettier@4.0.0-alpha.8 prettier-plugin-sql-cst
pnpm i
- name: Run prettier
run: |-
npx prettier -c 'i18n/**/*.{js,jsx,ts,tsx,css,md,mdx,json}'
pnpm exec prettier -c 'i18n/**/*.{js,jsx,ts,tsx,css,md,mdx,json}'
format-sql:
runs-on: ubuntu-latest
@@ -62,13 +70,20 @@ jobs:
sparse-checkout: |
apps/docs/pages
apps/docs/content
# Installing all dependencies takes up to three minutes, hacking around to only installing prettier+deps
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Download dependencies
run: |
rm package.json
rm package-lock.json
npm i prettier@4.0.0-alpha.8 prettier-plugin-sql-cst
pnpm i
- name: Run prettier
run: |-
# Check mdx files which contain sql code blocks
grep -lr '```sql' apps/docs/{pages,content}/**/*.mdx | xargs npx prettier -c
grep -lr '```sql' apps/docs/{pages,content}/**/*.mdx | xargs pnpm exec prettier -c
+9 -3
View File
@@ -38,13 +38,19 @@ jobs:
apps/www/.env.local.example
supabase
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Download dependencies
run: npm ci
run: pnpm i
# Need the miscellaneous use API, which is available publicly (by design) in www
- name: Copy environment variables
@@ -53,9 +59,9 @@ jobs:
- name: Update embeddings
working-directory: ./apps/docs
if: ${{ !inputs.refresh }}
run: npm run embeddings
run: pnpm run embeddings
- name: Refresh embeddings
working-directory: ./apps/docs
if: ${{ inputs.refresh }}
run: npm run embeddings:refresh
run: pnpm run embeddings:refresh
+10 -5
View File
@@ -8,12 +8,12 @@ on:
branches: [master, studio]
paths:
- 'apps/studio/**'
- 'package-lock.json'
- 'pnpm-lock.yaml'
pull_request:
branches: [master, studio]
paths:
- 'apps/studio/**'
- 'package-lock.json'
- 'pnpm-lock.yaml'
# Cancel old builds on new commit for same workflow + branch/PR
concurrency:
@@ -31,17 +31,22 @@ jobs:
sparse-checkout: |
apps/studio
packages
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'
- name: Install deps
run: npm ci
run: pnpm i
working-directory: ./
- name: Run Tests
env:
# Default is 2 GB, increase to have less frequent OOM errors
NODE_OPTIONS: '--max_old_space_size=3072'
run: npm run test:studio
run: pnpm run test:studio
working-directory: ./
+10 -4
View File
@@ -19,17 +19,23 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'
- name: Install deps
run: npm ci
run: pnpm i
- name: Run TypeScript type check
run: npx turbo run typecheck
run: pnpm exec turbo run typecheck
- name: Run Lint
run: npx turbo run lint
run: pnpm exec turbo run lint
+9 -3
View File
@@ -21,14 +21,20 @@ jobs:
sparse-checkout: |
packages
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'
- name: Install deps
run: npm ci
run: pnpm i
- name: Run tests
run: npm run test:ui-patterns
run: pnpm run test:ui-patterns
+9 -3
View File
@@ -21,14 +21,20 @@ jobs:
sparse-checkout: |
packages
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.10.0
run_install: false
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'
- name: Install deps
run: npm ci
run: pnpm i
- name: Run tests
run: npm run test:ui
run: pnpm run test:ui
+7 -11
View File
@@ -38,7 +38,7 @@ You will need to install and configure the following dependencies on your machin
- [Git](http://git-scm.com/)
- [Node.js v20.x (LTS)](http://nodejs.org)
- [npm](https://www.npmjs.com/) version 10.x.x or higher
- [pnpm](https://pnpm.io/) version 9.x.x or higher
- [make](https://www.gnu.org/software/make/) or the equivalent to `build-essentials` for your OS
- [Docker](https://docs.docker.com/get-docker/) (to run studio locally)
@@ -70,7 +70,7 @@ To contribute code to [Supabase](https://supabase.com), you must fork the [Supab
1. Install the dependencies in the root of the repo.
```sh
npm install # install dependencies
pnpm install # install dependencies
```
2. Copy the example `.env.local.example` to `.env.local`
@@ -81,7 +81,7 @@ To contribute code to [Supabase](https://supabase.com), you must fork the [Supab
3. After that you can run the apps simultaneously with the following.
```sh
npm run dev # start all the applications
pnpm dev # start all the applications
```
Then visit, and edit, any of the following sites:
@@ -97,7 +97,7 @@ Then visit, and edit, any of the following sites:
You can run any of the sites individually by using the scope name. For example:
```sh
npm run dev:www
pnpm dev:www
```
Note: Particularly for `www` make sure you have copied `apps/www/.env.local.example` to `apps/www/.env.local`
@@ -115,17 +115,13 @@ The monorepo has a set of shared components under `/packages`:
#### Installing packages
Installing a package with NPM workspaces requires you to add the `-w` flag to tell NPM which workspace you want to install into. Do not install dependencies in their local folder, install them from the route using the `-w` flag.
The format is: `npm install <package name> -w=<workspace to install in>`.
Installing a package in a specific workspace requires you to move to the workspace and then run the install command.
For example:
- `npm install react -w common`: installs into `./packages/common`
- `npm install react -w www`: installs into `./apps/www`
- `npm install react -w studio`: installs into `./apps/studio`
1. `cd apps/studio`: move to the `studio` workspace
2. `pnpm add react`: installs `react` into `studio` workspace
You do not need to install `devDependencies` in each workspace. These can all be installed in the root package.
---
+9 -8
View File
@@ -4,8 +4,9 @@
"private": true,
"type": "module",
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "next dev --port 3003",
"build": "npm run content:build && npm run build:registry && next build",
"build": "pnpm run content:build && pnpm run build:registry && next build",
"build:registry": "tsx --tsconfig ./tsconfig.scripts.json ./scripts/build-registry.mts && prettier --log-level silent --write \"registry/**/*.{ts,tsx,mdx}\" --cache",
"start": "next start",
"lint": "next lint",
@@ -15,10 +16,9 @@
},
"dependencies": {
"@hookform/resolvers": "^3.1.1",
"@radix-ui/react-alert-dialog": "^1.0.5",
"contentlayer2": "0.4.6",
"eslint-config-supabase": "*",
"fs": "^0.0.1-security",
"eslint-config-supabase": "workspace:*",
"icons": "workspace:*",
"jotai": "^2.8.0",
"lodash.template": "4.5.0",
"lucide-react": "*",
@@ -41,8 +41,8 @@
"remark-gfm": "^4.0.0",
"sonner": "^1.5.0",
"ts-morph": "^22.0.0",
"ui": "*",
"ui-patterns": "*",
"ui": "workspace:*",
"ui-patterns": "workspace:*",
"unist-util-visit": "^5.0.0",
"zod": "^3.22.4"
},
@@ -53,13 +53,14 @@
"@types/react": "^18.2.65",
"@types/react-dom": "^18.2.22",
"autoprefixer": "^10.0.1",
"config": "*",
"config": "workspace:^",
"mdast-util-toc": "^6.1.1",
"postcss": "^8",
"rimraf": "^4.1.3",
"shiki": "^1.1.7",
"tailwindcss": "^3.3.0",
"tsconfig": "*",
"tsconfig": "workspace:*",
"tsx": "^4.7.0",
"typescript": "~5.5.0",
"unist-builder": "3.0.0"
}
+1 -1
View File
@@ -8,7 +8,7 @@ module.exports = config({
// purge styles from grid library
//
'./../../packages/ui/src/**/*.{tsx,ts,js}',
'./../../packages/ui-patterns/**/*.{tsx,ts,js}',
'./../../packages/ui-patterns/!(node_modules)/**/*.{tsx,ts,js}',
],
theme: {
extend: {
+19 -17
View File
@@ -3,25 +3,26 @@
"version": "0.0.0",
"private": true,
"scripts": {
"predev": "npm run codegen:references",
"preinstall": "npx only-allow pnpm",
"predev": "pnpm run codegen:references",
"dev": "next dev --port 3001",
"dev:secrets:pull": "AWS_PROFILE=supabase-dev node ../../scripts/getSecrets.js -n local/docs",
"prebuild": "npm run codegen:references",
"prebuild": "pnpm run codegen:references",
"build": "next build",
"build:analyze": "ANALYZE=true next build",
"build:sitemap": "tsx ./internals/generate-sitemap.ts",
"postbuild": "npm run build:sitemap",
"postbuild": "pnpm run build:sitemap",
"start": "next start",
"lint": "next lint",
"lint:mdx": "supa-mdx-lint content/guides --config ../../supa-mdx-lint.config.toml",
"typecheck": "tsc --noEmit",
"test": "vitest --exclude \"**/*.smoke.test.ts\"",
"test:smoke": "npm run codegen:references && vitest -t \"prod smoke test\"",
"test:smoke": "pnpm run codegen:references && vitest -t \"prod smoke test\"",
"embeddings": "tsx scripts/search/generate-embeddings.ts",
"embeddings:refresh": "npm run embeddings -- --refresh",
"embeddings:refresh": "pnpm run embeddings -- --refresh",
"troubleshooting:sync": "node features/docs/Troubleshooting.script.mjs",
"last-changed": "tsx scripts/last-changed.ts",
"last-changed:reset": "npm run last-changed -- --reset",
"last-changed:reset": "pnpm run last-changed -- --reset",
"codegen:references": "tsx features/docs/Reference.generated.script.ts",
"codemod:frontmatter": "node ./scripts/codemod/mdx-meta.mjs && prettier --write \"content/**/*.mdx\"",
"clean": "rimraf node_modules ./docs/features/docs/generated"
@@ -45,17 +46,17 @@
"@tanstack/react-query": "^5.13.4",
"acorn": "^8.11.3",
"acorn-typescript": "^1.4.13",
"ai-commands": "*",
"common": "*",
"ai-commands": "workspace:*",
"common": "workspace:*",
"common-tags": "^1.8.2",
"config": "*",
"eslint-config-supabase": "*",
"config": "workspace:*",
"eslint-config-supabase": "workspace:*",
"framer-motion": "^11.0.3",
"github-slugger": "^2.0.0",
"gray-matter": "^4.0.3",
"hast-util-has-property": "^2.0.1",
"hast-util-to-html": "^9.0.0",
"icons": "*",
"icons": "workspace:*",
"isbot": "^5.1.2",
"js-yaml": "^3.14.1",
"jsrsasign": "^11.0.0",
@@ -95,10 +96,10 @@
"remark-gfm": "^3.0.1",
"remark-math": "^6.0.0",
"server-only": "^0.0.1",
"shared-data": "*",
"shared-data": "workspace:*",
"toml": "^3.0.0",
"ui": "*",
"ui-patterns": "*",
"ui": "workspace:*",
"ui-patterns": "workspace:*",
"unist-builder": "^3.0.1",
"unist-util-filter": "^4.0.1",
"unist-util-visit": "^4.1.2",
@@ -118,9 +119,9 @@
"@types/react": "^18.2.24",
"@types/react-copy-to-clipboard": "^5.0.4",
"@types/unist": "^2.0.6",
"api-types": "*",
"api-types": "workspace:*",
"cheerio": "^1.0.0-rc.12",
"config": "*",
"config": "workspace:*",
"dotenv": "^16.0.3",
"ejs": "^3.1.10",
"globby": "^13.2.2",
@@ -130,9 +131,10 @@
"simple-git": "^3.24.0",
"slugify": "^1.6.6",
"smol-toml": "^1.3.0",
"tsconfig": "*",
"tsconfig": "workspace:*",
"tsx": "^4.6.2",
"typescript": "~5.5.0",
"unist-util-visit-parents": "5.1.3",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^2.0.2"
}
+1 -1
View File
@@ -10,7 +10,7 @@ module.exports = config({
'./layouts/**/*.tsx',
'./pages/**/*.{tsx,mdx}',
'./../../packages/ui/src/**/*.{tsx,ts,js}',
'./../../packages/ui-patterns/**/*.{tsx,ts,js}',
'./../../packages/ui-patterns/!(node_modules)/**/*.{tsx,ts,js}',
],
plugins: [
function ({ addUtilities, addVariant }) {
+14 -11
View File
@@ -8,7 +8,10 @@
# docker builder prune
# docker build . -f apps/studio/Dockerfile --target production -t studio:latest --no-cache
FROM node:20-slim as base
FROM node:20-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
# Fixes issues with Sentry CLI and SSL certificates during build
# TODO: Git is added because it's needed to build libpg, remove it once they publish a binary on the S3 bucket
@@ -24,33 +27,33 @@ RUN apt-get update -qq && \
WORKDIR /app
# Prune unneeded dependencies with turbo (from apps/ for example)
FROM base as turbo
FROM base AS turbo
COPY . .
RUN npx turbo@2.0.4 prune studio --docker
RUN pnpm dlx turbo@2.0.4 prune studio --docker
# Install dev dependencies (only if needed)
FROM base as deps
FROM base AS deps
COPY --from=turbo /app/out/json ./
COPY --from=turbo /app/out/package-lock.json ./
COPY --from=turbo /app/out/pnpm-lock.yaml ./
# No need to clean cache because production uses standalone build
RUN npm clean-install
RUN pnpm install --frozen-lockfile
# dev contains dependencies and source code not compiled
FROM deps as dev
FROM deps AS dev
COPY --from=turbo /app/out/full ./
ENTRYPOINT ["docker-entrypoint.sh"]
EXPOSE 8082
CMD ["npm", "run", "dev:studio"]
CMD ["pnpm", "dev:studio"]
# Compile Next.js
FROM dev as builder
FROM dev AS builder
RUN npx turbo@2.0.4 run build --filter studio -- --no-lint
RUN pnpm dlx turbo@2.0.4 run build --filter studio -- --no-lint
# Copy only compiled code and dependencies
FROM base as production
FROM base AS production
COPY --from=builder /app/apps/studio/public ./apps/studio/public
COPY --from=builder /app/apps/studio/.next/standalone ./
COPY --from=builder /app/apps/studio/.next/static ./apps/studio/.next/static
@@ -1,4 +1,4 @@
import { it } from 'vitest'
import { describe, expect, it } from 'vitest'
import { cronPattern, parseCronJobCommand, secondsPattern } from './CronJobs.utils'
describe('parseCronJobCommand', () => {
@@ -1,3 +1,4 @@
import { describe, expect, test } from 'vitest'
import { isReadOnlySelect } from './AIAssistant.utils'
describe('AIAssistant.utils.ts:isReadOnlySelect', () => {
+20 -13
View File
@@ -3,6 +3,7 @@
"version": "0.0.9",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "next dev -p 8082",
"dev:secrets:pull": "AWS_PROFILE=supabase-dev node ../../scripts/getSecrets.js -n local/studio",
"build": "next build",
@@ -38,7 +39,7 @@
"@stripe/stripe-js": "^3.0.5",
"@supabase/auth-helpers-react": "^0.4.2",
"@supabase/auth-js": "2.64.2",
"@supabase/pg-meta": "*",
"@supabase/pg-meta": "workspace:*",
"@supabase/realtime-js": "2.10.2",
"@supabase/shared-types": "0.1.74",
"@supabase/sql-to-rest": "^0.1.6",
@@ -51,21 +52,21 @@
"@vitejs/plugin-react": "^4.2.1",
"@zip.js/zip.js": "^2.7.29",
"ai": "^3.4.33",
"ai-commands": "*",
"ai-commands": "workspace:*",
"awesome-debounce-promise": "^2.1.0",
"common": "*",
"common": "workspace:*",
"common-tags": "^1.8.2",
"config": "*",
"config": "workspace:*",
"configcat-js": "^7.0.0",
"cronstrue": "^2.50.0",
"cron-parser": "^4.9.0",
"cronstrue": "^2.50.0",
"dayjs": "^1.11.10",
"dnd-core": "^16.0.1",
"file-saver": "^2.0.5",
"framer-motion": "^11.11.17",
"generate-password-browser": "^1.1.0",
"html-to-image": "^1.10.8",
"icons": "*",
"icons": "workspace:*",
"immutability-helper": "^3.1.1",
"ip-num": "^1.5.1",
"json-logic-js": "^2.0.2",
@@ -113,13 +114,14 @@
"recharts": "^2.8.0",
"remark-gfm": "^3.0.1",
"semver": "^6.3.1",
"shared-data": "*",
"shared-data": "workspace:*",
"sonner": "^1.5.0",
"sql-formatter": "^13.1.0",
"sqlstring": "^2.3.2",
"tus-js-client": "^4.1.0",
"ui": "*",
"ui-patterns": "*",
"ui": "workspace:*",
"ui-patterns": "workspace:*",
"use-debounce": "^7.0.1",
"uuid": "^9.0.1",
"valtio": "^1.12.0",
"vite-tsconfig-paths": "^4.3.2",
@@ -132,8 +134,10 @@
},
"devDependencies": {
"@aws-sdk/client-secrets-manager": "^3.410.0",
"@radix-ui/react-use-escape-keydown": "^1.0.3",
"@supabase/postgres-meta": "^0.64.4",
"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^13.5.0",
"@types/common-tags": "^1.8.1",
@@ -161,16 +165,19 @@
"@types/uuid": "^8.3.4",
"@types/zxcvbn": "^4.4.1",
"@vitest/ui": "^1.6.0",
"api-types": "*",
"api-types": "workspace:*",
"autoprefixer": "^10.4.14",
"common": "*",
"config": "*",
"eslint-config-supabase": "*",
"common": "workspace:*",
"config": "workspace:*",
"date-fns": "^2.30.0",
"eslint-config-supabase": "workspace:*",
"eslint-plugin-barrel-files": "^2.0.7",
"graphql-ws": "5.14.1",
"msw": "^2.3.0",
"next-router-mock": "^0.9.13",
"postcss": "^8.4.31",
"prettier": "3.2.4",
"supports-color": "5.5.0",
"tailwindcss": "^3.4.1",
"typescript": "~5.5.0"
}
+1 -1
View File
@@ -6,7 +6,7 @@ module.exports = config({
'./components/**/*.{js,ts,jsx,tsx}',
// purge styles from grid library
'./../../packages/ui/src/**/*.{tsx,ts,js}',
'./../../packages/ui-patterns/**/*.{tsx,ts,js}',
'./../../packages/ui-patterns/!(node_modules)/**/*.{tsx,ts,js}',
],
theme: {
extend: {
@@ -1,5 +1,5 @@
import { screen } from '@testing-library/react'
import { test, vi } from 'vitest'
import { beforeAll, test, vi } from 'vitest'
import { ApiReport } from 'pages/project/[ref]/reports/api-overview'
import { render } from '../../../helpers'
+18 -13
View File
@@ -4,13 +4,14 @@
"description": "Supabase main website",
"private": true,
"scripts": {
"preinstall": "npx only-allow pnpm",
"dev": "next --port 3000",
"build": "npm run content:build && next build",
"build": "pnpm run content:build && next build",
"export": "next export",
"start": "next start",
"lint": "next lint",
"clean": "rimraf node_modules",
"typecheck": "npm run content:build && tsc --noEmit",
"typecheck": "pnpm run content:build && tsc --noEmit",
"content:build": "contentlayer2 build && node scripts/generateLatestBlogPosts.mjs",
"prettier": "prettier --write \"./{pages,components,lib,stores,styles,tests}/**/*.{ts,tsx,md,js,jsx,json}\"",
"postbuild": "node ./internals/generate-sitemap.mjs"
@@ -32,22 +33,22 @@
"@supabase/auth-ui-react": "^0.4.5",
"@supabase/supabase-js": "^2.44.3",
"@vercel/og": "^0.6.2",
"ai-commands": "*",
"ai-commands": "workspace:*",
"animejs": "^3.2.2",
"classnames": "^2.3.1",
"clsx": "^1.2.1",
"cobe": "^0.6.2",
"common": "*",
"common": "workspace:*",
"common-tags": "^1.8.2",
"config": "*",
"config": "workspace:*",
"contentlayer2": "0.5.3",
"dat.gui": "^0.7.9",
"dayjs": "^1.11.12",
"eslint-config-supabase": "*",
"eslint-config-supabase": "workspace:*",
"framer-motion": "^11.0.3",
"globby": "^13.2.2",
"gray-matter": "^4.0.3",
"icons": "*",
"icons": "workspace:*",
"lodash": "^4.0.0",
"lucide-react": "*",
"markdown-toc": "^1.2.0",
@@ -72,18 +73,19 @@
"remark": "^15.0.1",
"remark-gfm": "^3.0.1",
"remark-html": "^16.0.1",
"shared-data": "*",
"shared-data": "workspace:*",
"swiper": "^11.0.7",
"three": "^0.170.0",
"typed.js": "^2.0.16",
"typescript": "~5.5.0",
"ui": "*",
"ui-patterns": "*",
"ui": "workspace:*",
"ui-patterns": "workspace:*",
"use-debounce": "^7.0.1",
"vanilla-tilt": "1.7.0",
"yup": "^1.4.0"
},
"devDependencies": {
"@hookform/resolvers": "^3.1.1",
"@types/animejs": "^3.1.12",
"@types/classnames": "^2.3.1",
"@types/common-tags": "^1.8.4",
@@ -97,11 +99,14 @@
"@types/react-dom": "^18.2.8",
"@types/react-syntax-highlighter": "^15.5.6",
"@types/three": "^0.169.0",
"api-types": "*",
"@types/uuid": "^9.0.8",
"api-types": "workspace:*",
"autoprefixer": "^10.4.14",
"config": "*",
"postcss": "^8.4.31",
"tsconfig": "*"
"react-hook-form": "^7.45.0",
"tsconfig": "workspace:*",
"uuid": "^9.0.1",
"zod": "^3.22.4"
},
"license": "MIT"
}
+1 -1
View File
@@ -9,7 +9,7 @@ module.exports = config({
'./lib/mdx/mdxComponents.tsx',
'./pages/**/*.{tsx,mdx}',
'./../../packages/ui/src/**/*.{tsx,ts,js}',
'./../../packages/ui-patterns/**/*.{tsx,ts,js}',
'./../../packages/ui-patterns/!(node_modules)/**/*.{tsx,ts,js}',
],
theme: {
extend: {
-43564
View File
File diff suppressed because it is too large. Load diff
+8 -7
View File
@@ -5,13 +5,13 @@
"author": "Supabase, Inc.",
"license": "Apache-2.0",
"private": true,
"workspaces": ["apps/*", "tests", "playwright-tests", "packages/*"],
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "turbo run build",
"build:studio": "turbo run build --filter=studio",
"build:design-system": "turbo run build --filter=design-system",
"build:docs": "turbo run build --filter=docs",
"clean": "turbo run clean --parallel && rimraf node_modules",
"clean": "turbo run clean --parallel && rimraf -G node_modules/{*,.bin,.modules.yaml}",
"dev": "turbo run dev --parallel",
"dev:reference": "turbo run dev --filter=reference --parallel",
"dev:studio": "turbo run dev --filter=studio --parallel",
@@ -31,11 +31,11 @@
"test:ui-patterns": "turbo run test --filter=ui-patterns",
"test:studio": "turbo run test --filter=studio",
"test:studio:watch": "turbo run test --filter=studio -- watch",
"test:playwright": "npm --prefix playwright-tests run test",
"test:playwright": "pnpm --prefix playwright-tests run test",
"perf:kong": "ab -t 5 -c 20 -T application/json http://localhost:8000/",
"perf:meta": "ab -t 5 -c 20 -T application/json http://localhost:5555/tables",
"generate:types": "supabase gen types typescript --local > ./supabase/functions/common/database-types.ts",
"api:codegen": "cd packages/api-types && npm run codegen"
"api:codegen": "cd packages/api-types && pnpm run codegen"
},
"devDependencies": {
"eslint": "^8.57.0",
@@ -44,16 +44,17 @@
"rimraf": "^6.0.0",
"sass": "^1.72.0",
"supabase": "^1.151.1",
"turbo": "2.0.4"
"turbo": "2.0.4",
"typescript": "~5.5.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/supabase/supabase.git"
},
"engines": {
"npm": "^10.0.0",
"pnpm": "^9.0.0",
"node": ">= 20"
},
"keywords": ["postgres", "firebase", "storage", "functions", "database", "auth"],
"packageManager": "npm@10.7.0"
"packageManager": "pnpm@9.10.0"
}
+5 -4
View File
@@ -6,6 +6,7 @@
"license": "MIT",
"sideEffects": false,
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules",
"typecheck": "tsc --noEmit",
"test": "jest"
@@ -15,28 +16,28 @@
"@supabase/supabase-js": "*",
"ai": "^3.4.33",
"common-tags": "^1.8.2",
"config": "*",
"config": "workspace:*",
"js-tiktoken": "^1.0.10",
"jsonrepair": "^3.5.0",
"openai": "^4.26.1"
},
"devDependencies": {
"api-types": "*",
"@ai-sdk/openai": "^0.0.72",
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.23.6",
"@jest/globals": "^29.7.0",
"@types/common-tags": "^1.8.4",
"api-types": "workspace:*",
"babel-jest": "^29.7.0",
"babel-plugin-transform-import-meta": "^2.2.1",
"chalk": "^5.3.0",
"dotenv": "^16.3.1",
"jest": "^29.7.0",
"libpg-query": "^15.2.0",
"libpg-query": "15.2.0",
"mdast-util-from-markdown": "^2.0.0",
"sql-formatter": "^15.0.2",
"ts-jest": "^29.1.1",
"tsconfig": "*",
"tsconfig": "workspace:*",
"typescript": "~5.5.0"
}
}
+5 -8
View File
@@ -1,11 +1,8 @@
import 'expect'
declare module 'expect' {
interface Matchers {
/**
* Check that a string matches a natural language criteria
* describing the expected output. Uses a LLM to evaluate.
*/
toMatchCriteria(criteria: string): Promise<void>
interface AsymmetricMatchers {
toMatchCriteria(criteria: string): void
}
interface Matchers<R> {
toMatchCriteria(criteria: string): R
}
}
+1
View File
@@ -5,6 +5,7 @@
"main": "./index.ts",
"types": "./index.ts",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules",
"codegen": "openapi-typescript http://localhost:8080/api-json -o types/api.d.ts --alphabetize && prettier --write types/api.d.ts"
},
+4
View File
@@ -8,6 +8,10 @@
"bin": {
"build-icons": "src/main.mjs"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules"
},
"engines": {
"node": ">= 16"
},
+2 -1
View File
@@ -1,7 +1,8 @@
// hooks/useTelemetryCookie.ts
import { IS_PROD, LOCAL_STORAGE_KEYS, useTelemetryProps } from 'common'
import { useRouter } from 'next/compat/router'
import { useEffect } from 'react'
import { LOCAL_STORAGE_KEYS, IS_PROD } from '../constants'
import { useTelemetryProps } from './useTelemetryProps'
interface UseTelemetryCookieProps {
hasAcceptedConsent: boolean
+4 -3
View File
@@ -5,13 +5,14 @@
"types": "./index.tsx",
"license": "MIT",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules",
"gen:types": "supabase gen types typescript --local >| ./database-types.ts",
"typecheck_CURRENTLY_IGNORED": "tsc --noEmit"
},
"dependencies": {
"@types/dat.gui": "^0.7.12",
"config": "*",
"config": "workspace:*",
"dat.gui": "^0.7.9",
"lodash": "^4.17.21",
"next-themes": "^0.3.0",
@@ -21,12 +22,12 @@
"@types/lodash": "4.17.5",
"@types/react": "^18.2.24",
"@types/react-dom": "^18.2.8",
"tsconfig": "*",
"tsconfig": "workspace:*",
"typescript": "~5.5.0"
},
"peerDependencies": {
"@supabase/supabase-js": "*",
"@supabase/auth-js": "^2.63.0",
"@supabase/supabase-js": "*",
"next": "*",
"react": "*",
"react-dom": "*"
+4
View File
@@ -3,6 +3,10 @@
"version": "0.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules"
},
"dependencies": {
"@mertasan/tailwindcss-variables": "^2.2.3",
"@radix-ui/colors": "^0.1.8",
@@ -3,6 +3,10 @@
"version": "1.0.0",
"main": "next.js",
"license": "MIT",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules"
},
"dependencies": {
"eslint-config-next": "^14.2.3",
"eslint-config-prettier": "^9.1.0",
+1
View File
@@ -5,6 +5,7 @@
"types": "./index.tsx",
"license": "MIT",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules",
"tsdoc:dereference:functions:v1": "tsx ./tsdoc.ts --input ../../apps/docs/spec/enrichments/tsdoc_v1/functions.json --output ../../apps/docs/spec/enrichments/tsdoc_v1/functions_dereferenced.json",
"tsdoc:dereference:gotrue:v1": "tsx ./tsdoc.ts --input ../../apps/docs/spec/enrichments/tsdoc_v1/gotrue.json --output ../../apps/docs/spec/enrichments/tsdoc_v1/gotrue_dereferenced.json",
+2 -1
View File
@@ -2,12 +2,13 @@
"name": "icons",
"main": "./src/icons/index.ts",
"scripts": {
"preinstall": "npx only-allow pnpm",
"build:icons": "build-icons --templateSrc=./scripts/exportTemplate.mjs --renderUniqueKey --iconFileExtension=.ts --exportFileName=index.ts",
"clean": "rimraf node_modules"
},
"dependencies": {
"typescript": "~5.5.0",
"@supabase/build-icons": "*"
"@supabase/build-icons": "workspace:*"
},
"devDependencies": {
"@types/react": "^18.2.24"
+4
View File
@@ -5,6 +5,10 @@
"author": "Supabase",
"main": "./src/index.ts",
"repository": "supabase/supabase",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules"
},
"dependencies": {
"zod": "^3.22.4"
},
+1
View File
@@ -5,6 +5,7 @@
"main": "./index.ts",
"types": "./index.ts",
"scripts": {
"preinstall": "npx only-allow pnpm",
"clean": "rimraf node_modules"
},
"author": "",
-1
View File
@@ -18,7 +18,6 @@ export * from './Dialogs/ConfirmDialog'
export * from './Dialogs/ConfirmationModal'
export * from './AssistantChat/AssistantChatForm'
export * from './AssistantChat/AssistantCommandsPopover'
export * from './SqlToRest'
export * from './PromoToast'
export * from './admonition'
export * from './ComputeBadge'
@@ -7,7 +7,7 @@ import {
MultiSelectorItem,
MultiSelectorList,
MultiSelectorTrigger,
} from 'ui-patterns/multi-select'
} from './index'
import { useState } from 'react'
// This fixes a "ReferenceError: ResizeObserver is not defined" error in the test
+5 -5
View File
@@ -5,6 +5,7 @@
"license": "MIT",
"sideEffects": false,
"scripts": {
"preinstall": "npx only-allow pnpm",
"test": "vitest",
"clean": "rimraf node_modules",
"typecheck": "tsc --noEmit"
@@ -16,7 +17,7 @@
"class-variance-authority": "^0.6.0",
"clsx": "^1.2.1",
"cmdk": "^1.0.0",
"common": "*",
"common": "workspace:*",
"common-tags": "^1.8.2",
"dayjs": "^1.11.13",
"framer-motion": "^11.1.9",
@@ -24,7 +25,6 @@
"lucide-react": "*",
"monaco-editor": "*",
"next-themes": "*",
"prism-react-renderer": "^2.3.1",
"openai": "^4.20.1",
"react-error-boundary": "^4.0.12",
"react-hook-form": "^7.45.0",
@@ -38,8 +38,8 @@
"sonner": "^1.5.0",
"sql-formatter": "^15.3.1",
"sse.js": "^2.2.0",
"tsconfig": "*",
"ui": "*",
"tsconfig": "workspace:*",
"ui": "workspace:*",
"valtio": "*",
"zod": "^3.22.4"
},
@@ -53,7 +53,7 @@
"@types/lodash": "^4.17.5",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"api-types": "*",
"api-types": "workspace:*",
"next-router-mock": "^0.9.13",
"typescript": "~5.5.0",
"vite": "^5.2.14",
+7 -5
View File
@@ -6,12 +6,13 @@
"license": "MIT",
"sideEffects": false,
"scripts": {
"preinstall": "npx only-allow pnpm",
"typecheck": "tsc --noEmit",
"generate-demo-tailwind-classes": "node internals/tokens/generate-demo-tailwind-classes.js",
"cleanse-css-for-tailwind": "node internals/tokens/cleanse-css-for-tailwind.js",
"transform-tokens": "node ./transformTokens.js",
"extract-design-tokens": "node internals/tokens/extract-design-tokens.js",
"generate-styles": "npm run extract-design-tokens && npm run transform-tokens && npm run cleanse-css-for-tailwind && npm run generate-demo-tailwind-classes",
"generate-styles": "pnpm run extract-design-tokens && pnpm run transform-tokens && pnpm run cleanse-css-for-tailwind && pnpm run generate-demo-tailwind-classes",
"clean": "rimraf node_modules",
"test": "vitest"
},
@@ -104,16 +105,17 @@
"@types/react-copy-to-clipboard": "^5.0.4",
"@types/react-dom": "^18.2.8",
"@types/react-syntax-highlighter": "^15.5.6",
"common": "*",
"config": "*",
"common": "workspace:*",
"config": "workspace:*",
"copyfiles": "^2.4.1",
"glob": "^8.1.0",
"sql-formatter": "^12.2.0",
"style-dictionary": "^3.7.1",
"tsconfig": "*",
"tsconfig": "workspace:*",
"tsconfig-paths-webpack-plugin": "^4.0.1",
"typescript": "~5.5.0",
"vitest": "^1.6.0"
"vite": "^5.0.0",
"vitest": "^2.0.0"
},
"peerDependencies": {
"next": "*",
@@ -1,34 +0,0 @@
import Countdown from 'react-countdown'
import { CountdownWidget } from 'ui-patterns'
const CountdownComponent = ({
date,
showCard = true,
}: {
date: string | number | Date
showCard?: boolean
}) => {
if (!date) return null
const renderer = ({ days, hours, minutes, seconds, completed }: any) => {
if (completed) {
// Render a completed state
return null
} else {
// Render countdown
return (
<CountdownWidget
days={days}
hours={hours}
minutes={minutes}
seconds={seconds}
showCard={showCard}
/>
)
}
}
return <Countdown date={new Date(date)} renderer={renderer} />
}
export default CountdownComponent
+3 -2
View File
@@ -4,11 +4,12 @@
"description": "",
"main": "index.js",
"scripts": {
"preinstall": "npx only-allow pnpm",
"env:setup": "supabase start -x studio && supabase status --output json > keys.json && node scripts/generate-env.js",
"pretest": "npm run env:setup",
"pretest": "pnpm run env:setup",
"test": "playwright test",
"posttest": "supabase stop --no-backup",
"codegen:setup": "npm run env:setup && NODE_ENV=test npm --prefix ../apps/studio run dev",
"codegen:setup": "pnpm run env:setup && NODE_ENV=test pnpm --prefix ../apps/studio run dev",
"codegen": "playwright codegen http://localhost:8082/project/default",
"clean": "rimraf node_modules"
},
+28043
View File
File diff suppressed because it is too large. Load diff
+5
View File
@@ -0,0 +1,5 @@
packages:
- "apps/*"
- "packages/*"
- "tests"
- "playwright-tests"
+4 -2
View File
@@ -3,6 +3,7 @@
"version": "1.0.0",
"description": "These tests can be run with Docker.",
"scripts": {
"preinstall": "npx only-allow pnpm",
"docker:up": "cd ../docker && ENABLE_EMAIL_AUTOCONFIRM=true docker compose --env-file ./.env -f docker-compose.yml -f dev/docker-compose.dev.yml up -d",
"docker:down": "cd ../docker && docker compose --env-file ./.env -f docker-compose.yml -f dev/docker-compose.dev.yml down",
"test": "jest",
@@ -11,7 +12,7 @@
"test:prod": "jest --detectOpenHandles",
"allure:generate": "rm -rf allure-report && node_modules/allure-commandline/bin/allure generate",
"allure:serve": "node_modules/allure-commandline/bin/allure serve",
"test:report": "npm run allure:generate && npm run allure:serve",
"test:report": "pnpm run allure:generate && pnpm run allure:serve",
"clean": "rimraf node_modules",
"format": "prettier --write \"./**/*.{js,jsx,ts,tsx,css,md}\""
},
@@ -28,10 +29,11 @@
"allure-commandline": "^2.17.2",
"allure-js-commons": "^2.0.0-beta.14",
"cross-fetch": "^3.1.5",
"ts-jest": "^29.1.1",
"jest": "^29.7.0",
"jest-allure2-adapter": "^0.3.12",
"jest-environment-jsdom": "^29.7.0",
"postgres": "^3.0.5",
"ts-jest": "^29.1.1",
"typescript": "~5.5.0"
}
}