Commit Graph

53 Commits

Author SHA1 Message Date
Ivan Vasilov 97a8df0a23 feat: Handle the classic-dark theme in www and docs apps (#45214)
This PR fixes a bug where a user might choose `classic-dark` as a theme
in `studio` but then `docs` and `marketing` apps will look weird.

To test:
- Change the localStorage value of `theme` to `classic-dark`
- Open `www` and `docs` apps, they should look ok

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a new "classic-dark" theme option for enhanced visual
customization.

* **Improvements**
* Unified and simplified theme handling across apps for more consistent
behavior.
* Improved system-theme detection and smoother transitions when
switching themes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-05 16:18:46 +02:00
Alaister Young 1b1d05ff96 chore: upgrade vite to v8 and vitest to v4 (#44833)
Upgrade vite and vitest to their latest major versions across the
monorepo, along with related packages.

**Changed:**
- `vite` catalog: `^7.3.2` → `^8.0.8` (Rolldown replaces esbuild/Rollup)
- `vitest` catalog: `^3.2.0` → `^4.1.4`
- `@vitejs/plugin-react`: `^4.3.4` → `^6.0.1`
- `@vitest/coverage-v8`: `^3.2.0` → `^4.1.4`
- `@vitest/ui`: `^3.2.0` → `^4.1.4`
- `vite-tsconfig-paths`: `^4.3.2` / `^5.1.4` → `^6.1.1`

**Pinned to vite 7:**
- `apps/lite-studio` — `@react-router/dev` hasn't declared vite 8
support yet
- `blocks/vue` — Nuxt plugins (`vite-plugin-inspect`, `vite-dev-rpc`,
`vite-hot-client`, `vite-plugin-vue-tracer`) haven't declared vite 8
support yet

**Test fixes for vitest 4 breaking changes:**
- **`apps/studio/lib/api/snippets.utils.test.ts`** — Replaced
`vi.mock('fs/promises')` automock with an explicit factory. Vitest 4's
automocking doesn't create mock functions for getter-based exports on
Node built-ins, so `mockedFS.access.mockResolvedValue` etc. were
`undefined`.
- **`apps/studio/lib/api/self-hosted/functions/index.test.ts`** —
Changed `mockReturnValue` to `mockImplementation(function() { ... })`
for a constructor mock. Vitest 4 no longer allows `mockReturnValue` when
the mock is called with `new`.
- **`apps/studio/tests/pages/api/mcp/index.test.ts`** — Changed arrow
function to regular `function` in `mockImplementation` for
`StreamableHTTPServerTransport`. Arrow functions can't be constructors,
and vitest 4 now enforces this.
- **`packages/ui-patterns/vitest.setup.ts`** — Changed `ResizeObserver`
mock from arrow function to regular `function` for the same constructor
enforcement reason. This was crashing Radix popover rendering in jsdom.

## To test

- `pnpm test:studio` — all 226 test files should pass
- `pnpm --filter ui-patterns vitest run` — all 183 tests should pass
- `pnpm --filter www test -- --run` — all 19 tests should pass
- `pnpm --filter ui vitest run` — all tests should pass
- `pnpm --filter dev-tools vitest run` — all tests should pass
- `pnpm --filter ai-commands vitest run` — all tests should pass

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Standardized and updated development tooling versions and version
sources for consistent installs across the repo (Vite, Vitest,
vite-tsconfig-paths and related plugins/catalog entries).
* **Tests**
* Improved test mocks and typings (updated mock
factories/implementations and tightened spy/type assertions) to increase
test reliability and compatibility with updated tooling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-04-16 00:13:48 +09:00
Ivan Vasilov bed5a96349 chore: Bump Typescript to v6 (#44204) 2026-03-26 15:27:35 +01:00
Sean Oliver 3570abad4d chore: update posthog-js to 1.357.0 (#43574)
PostHog flagged our SDK as outdated — we were on 1.257.2, latest is
1.357.0.

**Changes**
- Bumped `posthog-js` in `packages/common/package.json` from `^1.257.2`
to `^1.333.0` (resolved to 1.357.0)
- Updated lockfile

**Why is the lockfile diff so large?**
posthog-js added several new dependencies between 1.257.2 and 1.357.0: a
full `@opentelemetry/*` stack (for opt-in log exporting),
`@posthog/core` and `@posthog/types` (internal monorepo split),
`dompurify`, and `query-selector-shadow-dom`. None of these affect our
bundle unless explicitly enabled — they're opt-in features. The lockfile
entries are large because pnpm records each package with its full
resolution tree and checksums.

**Testing**
Spun up the full local stack and verified all three PostHog endpoints
return 200 with the new SDK version:
- `/e/` (event capture) — pageviews firing correctly
- `/flags/` (feature flag evaluation) — flags loading correctly
- `/i/v0/e/` (identify) — user identification working

No breaking changes in any of the 16 releases between our old and new
version (all Minor/Patch Changes). TypeScript compilation clean across
all apps.

GROWTH-589
2026-03-09 15:14:36 -07:00
Ivan Vasilov 036740b5b5 chore: Bump vulnerable deps (#42182)
* Bump @modelcontextprotocol/sdk.

* Bump qs.

* Bump preact.

* Bump react-router.

* Bump @smithy/config-resolver.

* Bump undici.

* Bump devalue.

* Bump h3.

* Bump tar.

* Bump diff.

* Bump lodash.

* Dedupe @aws-sdk/credential-providers.
2026-01-27 10:29:05 +01:00
Ivan Vasilov e8d2738acf chore: Bump vulnerable dependencies (#39909)
* Bump @playwright/test to fix a playwright vuln.

* Deduplicate msw.

* Deduplicate yaml.

* Deduplicate tsx.

* Add vitest to the catalog and bump it.

* Deduplicate vitest extra packages.

* Bump and deduplicate vite to v7.

* Bump prismjs.
2025-10-29 18:07:32 +01:00
Ivan Vasilov 051d31ef07 chore: Bump Typescript to 5.9 (#38945)
* Move typescript version definition to pnpm-workspace.

* Bump typescript to 5.9.

* Minor fixes to satisfy the compiler.

---------

Co-authored-by: Raúl Barroso <code@raulb.dev>
2025-09-23 16:50:54 +02:00
Saxon Fletcher 920aeb1e1a Improves the filter bar (#38389)
* Refactor Drawer component and add date-fns dependency

Refactored the Drawer component for improved slot-based structure, updated styles, and added 'use client' directive. Added 'date-fns' as a dependency in design-system, updated tsconfig paths for icons, and marked ToggleGroup as a client component.

* nit: add env for svg path

* fix: instructions

* add-ons design

* chore: new generated llms

* Rebuild the pnpm-lock file.

* fix: update vaul dep in ui for drawer

* chore: update radix dialog deps

* fix: clipPath prop on chart tooltip svg

* fix: update dialog deps

* fix: update hover card deps

* fix: remove legacy next link from nav menu docs

* fix: radio group dep update

* fix: scroll area example key

* fix: sheet form readOnly

* fix: slider dep update

* fix: hide empty toast view

* fix: toggle and toggle group dep update

* Rebuild the lockfile.

* chore: updating branch

* fix: remove unused prop in docs

Removes unused prop on Drawer component inside docs causing type error

* filtering refactor

filter refactor

more

* styling

* use popovers instead

* refactor and fine tune

* remove code

* fix portal popover dismissing

* custom component popover

* tests fix

* fix ts

* rm unrelated changes

* fix type error - remove type cast

* undo previewfilterpanel

* fix type

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
Co-authored-by: kemal <hello@kemal.earth>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2025-09-09 20:06:25 +02:00
Chris Chinchilla 6821c07811 docs: feature toggle tests (#38282)
* Docs feature toggle tests

* Prettier

* Types fix

* Hide unsupported languages

* Fix import

* Add unsupported code warning

* Further SDK toggling

* Temp intro text

* Auth toggles

* clean up conditional visibility code

* fix: typecheck, tests, tiny bug

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2025-09-04 16:46:08 +02:00
Joshen Lim 4124f0ed98 Shift useFlag hook and configcat library to common package, remove from Studio (#38203)
* Shift useFlag hook and configcat library to common package, remove from studio

* Fix test

* Fix test
2025-08-27 13:42:20 +07:00
Sean Oliver e3e8528f72 feat: add client-side PostHog telemetry tracking (#37442)
Adds client-side PostHog tracking to run in parallel with server-side telemetry across studio, docs, and www. This enables session replays and resolves a race condition where page views arrive before group assignments resulting in attribution errors.

Changes:
- Created PostHog client wrapper with consent-aware initialization in common package
- Integrated PostHog client calls into existing telemetry functions to send events to both PostHog (client) and backend (server)
- Updated CSP to allow connections to PostHog endpoints
- Added environment variable support for all apps
- PostHog client accepts consent as a parameter and respects user preferences
- Events can be distinguished in PostHog by $lib property (posthog-js vs posthog-node)
- PostHog URL configured based on environment (staging/local uses ph.supabase.green)
- Maintains full backward compatibility with existing telemetry system

Resolves GROWTH-438
Resolves GROWTH-271
2025-08-06 09:15:51 -07:00
Ivan Vasilov 64d3d1fb7f chore: Bump vulnerable dependencies (#36272)
* Bump vite version.

* Rename and bump the vercel/flags dependency.

* Bump all versions of esbuild to one.

* Bump image-size.

* Bump fastify.

* Bump prismjs.
2025-06-11 10:24:40 +02:00
Alaister Young 2b419c70a1 chore: add usercentrics for consent management (#35384)
* chore: add usercentrics for consent management

* client component to make next.js happy

* address feedback

* move consent state to common

* fix import

* ensure page events are sent correctly

* add feature flag provider to ui library site

* fix ui lib 500 error

* skip in test env

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jordi Enric <jordi.err@gmail.com>
2025-05-05 13:18:48 +08:00
Ivan Vasilov eadff19571 chore: Bump React to 18.3+ (#35029)
* Bump react and react-dom to 18.3+.

* Add tailwind to ui package to silence a peer dep warning.
2025-04-15 17:07:53 +02:00
Kang Ming 4278bd4ec1 fix: bump auth-js version to v2.67.3 (#31217)
* fix: bump auth-js version to v2.67.3

* chore: add supabase/auth and supabase/dashboard as codeowners

* Revert "chore: add supabase/auth and supabase/dashboard as codeowners"

This reverts commit 57fc5776ba.

* bump supabase-js version

* import user type from single gotrue

* fix auth-js version in studio

* remove auth-js dep in studio

* fix ts

* use catalog versions

* fix ts

* Bump realtime-js version to avoid having 2 versions.

* Add @supabase/realtime-js to the pnpm catalog.

* upgrade realtime-js

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-01-17 14:54:21 +08:00
Alaister Young 4577389177 chore: send feature flags for page events (#32590) 2025-01-13 13:08:50 +08:00
Ivan Vasilov 06aa80e9f0 chore: Bump next to non-vulnerable version (#31277)
* Add next to pnpm catalog and use that next version from all apps and packages.

* Remove vite direct dependency.

* Set the @types/node to version 20.

* Stabilize supports-color by adding it in the main package.json. This will make it appear in all packages that have it as optional.

* Use built-in matchers for vitest in @testing-library/jest-dom.

* Add libpg-query as a dependency to docs.

* Remove nextjs-node-loader for the built-in external packages feature on nextjs.

* Clean up extra comment.
2025-01-03 13:25:00 +01:00
Ivan Vasilov dd572efb0d 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.
2024-12-20 13:07:20 +01:00
Ivan Vasilov 9dd7deb990 chore: Add a clean script to all packages/apps (#29926)
Add a clean command.
2024-10-18 16:25:13 +02:00
Ivan Vasilov cb1e3a8170 chore: Prep work for pnpm (#29610)
* Add all missing libraries in the packages/apps.

* Add all missing Vitest imports to the tests.

* Add some missing exports to ui.

* Fix the admonition export.

* Fix various minor bugs.

* Migrate the ui package to use vitest.
2024-10-01 11:29:37 +02:00
Charis dfda9da26d feat(docs): add revalidation api route (#29378)
Add a route for manually revalidating cache contents by tag.

The route is protected by authentication to prevent abuse. Automated
actions in CI should be set up with a basic API key, which has a rate
limit of 6 hours between changes. Overriding is possible with an
override key, which should be used as an escape hatch.

Usage:
- API key provided in header `Authorization: Bearer <KEY>`
- Body has shape `{ tags: string[] }`
2024-09-19 14:28:07 -04:00
Ivan Vasilov df52ea7ee0 feat: Replace all toasts with sonner (#28250)
* Update the design of the sonner toasts. Add the close button by default.

* Migrate studio and www apps to use the SonnerToaster.

* Migrate all toasts from studio.

* Migrate all leftover toasts in studio.

* Add a new toast component with progress. Use it in studio.

* Migrate the design-system app.

* Refactor the consent toast to use sonner.

* Switch docs to use the new sonner toasts.

* Remove toast examples from the design-system app.

* Remove all toast-related components and old code.

* Fix the progress bar in the toast progress component. Also make the bottom components vertically centered.

* Fix the width of the toast progress.

* Use text-foreground-lighter instead of muted for ToastProgress text

* Rename ToastProgress to SonnerProgress.

* Shorten the text in sonner progress.

* Use the correct classes for the close button. Add a const var for the default toast duration. Remove the custom width class from sonner.

* Set the position for all progress toasts to bottom right. Set the duration for all toasts to the default (when reusing a toast id from loading/progress toast, the duration is set to infinity).

* Fix the playwright tests.

* Refactor imports to use ui instead of @ui.

* Change all imports of react-hot-toast with sonner. These components were merged since the last commit to this branch.

* Remove react-hot-toast lib.

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-08-31 07:50:51 +08:00
Ivan Vasilov 491f9803e0 chore: Bump typescript to version 5.5 (#27590)
Bump typescript to 5.5 in all apps and packages.
2024-06-28 12:26:57 +02:00
Kang Ming 87f7f6ce81 chore: bump supabase-js (#22361)
Revert "Revert "chore: bump supabase-js" (#22325)"

This reverts commit 67e1b1b00b.
2024-04-03 14:23:55 +08:00
Kang Ming 67e1b1b00b Revert "chore: bump supabase-js" (#22325)
Revert "chore: bump supabase-js (#22312)"

This reverts commit 0ff546a539.
2024-03-29 04:45:11 +00:00
Kang Ming 0ff546a539 chore: bump supabase-js (#22312)
* chore: bump supabase-js

* more gotrue renames

* chore: update types

* chore: prettier

* chore: typings

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Bobbie Soedirgo <bobbie@soedirgo.dev>
2024-03-29 11:18:04 +07:00
Alaister Young 42773a3a3b chore: upgrade to next 14 (#22234)
* chore: upgrade to next 14

* upgrade related next deps

* sync deps

* fix lock

* package lock

* bump deps

---------

Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-03-28 19:23:55 +11:00
Kevin Grüneberg 27f9f96ff7 chore: upgrade to node 20 (#22240) 2024-03-26 18:54:22 +07:00
Stojan Dimitrovski f22ae374f2 feat: explicit gotrue-js package dependency, version 2.58.0 (#19405) 2023-12-04 11:21:26 +01:00
Ivan Vasilov 1e7c27a27d fix: Move dat.gui dependency to the common package (#18793)
Remove dat.gui from docs and studio since it's not used directly. Add dat.gui as a dependency to common package.
2023-11-07 16:13:40 -03:30
Alaister Young 8057309e51 chore: upgrade next 13 + react 18 (#17839)
* update deps + image codemod (studio)

* update next links (studio)

* update deps

* update links (ui)

* remove next-transpile-modules

* move next-themes dependency

* chore: update ConfirmDialog

* chore: remove old ConfirmModal js file. migrated to TS

* dependency wrangling

* remove empty page

* update next links (www)

* First run bump react-data-grid-v7 beta 4

* fix package-lock.json

* more deps wrangling

* update recharts

* update sentry options

* fix some broken things in www

* studio fixes

* fix graphiql

* fix studio build

* fix menu hydration

* small build error

* update turbo

* fix www typescript errors

* docs image codemod

* links codemod docs

* fix docs typescript errors

* move useConsent to ui to prevent circular deps

* Fix links

* Fix homepage

* Fix links

* move studio/ to apps/

* Revert "move studio/ to apps/"

This reverts commit 1b0a985fcb.

* disable outputFileTracingRoot

* remove outputFileTracingRoot

* fix homepage product cards

* fix PrivacySettings links

* Fix links

* Fix the build for www.

* Minor fixes for JWTGenerator.

* Fix the docs and ui tests.

* Revert codehike back to 0.8.3

* remove ConfirmAlert()

* reenable babel because mobx hates me

* fix blog image and comparison page avatar

* Fix svg errors

* update image synthax

* Fix code hike

* Move the button in a div so that it doesn't inherit its parent height and make the button look weird.

* When components are defined in a component, they get recreated on each render. This makes them unstable in certain cases and causes infinite rerenders.

* Replace the next/head usage with next/script.

* Chore/upgrade next 13 fix table editor (#18431)

* fix table editor styling and fix row deletion logic

* Fix deleting selected rows from header, and fix checkboxes not clearing up

* Fix deleting all rows when filter applied, and fix deleting all rows

* Fix grid size styling issue

* Fix TS error

* Hydration errors

* studio org pages fixes

* fix more studio links

* audit logs fixes

* dropdown icon styling fixes

* fix some images in www

* upgrade to next 14

* try new sentry wrapper for api

* see if this is even invoked

* Revert "see if this is even invoked"

This reverts commit 86c3973ffa.

* Revert "try new sentry wrapper for api"

This reverts commit f67623ebad.

* Revert "upgrade to next 14"

This reverts commit a24dd6131e.

* chore: allow node version 19/20

* Try to fix the LogTable so that it renders with the newer "react-data-grid" version.

* Fix type errors in the log renderer code.

* Fix the replication screen.

* Add the CSS for the GraphiQL.

* Fix SQL editor results rendering

* Lint

* Fix SQL editor results height issue

* Fix auth RLS not invalidating RQ when toggling RLS

* Fix database tables new/edit column regressed

* Fix migrations page empty state if migrations schema not yet created

* Fix API side panel docs temp remove postgrest text for column description PK and FK

* Fix + improve timeout handling in SQL editor

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2023-10-31 05:51:46 +00:00
Anthony Shew 1281a9b9ce turbo type-check command and GHA (#11658)
* turbo type-check command and GHA

* Update quality.yml

* Update package.json

* Update packages/common/package.json

Co-authored-by: Ruggero Tomaselli <ruggerotomaselli@gmail.com>

* Run prettier.

* Updating package-lock.

* Fix all prettier errors.

* Add type-check command to studio. Remove the one from common package since it depends on ui package and cannot be built at the moment.

* Rename all commands to typecheck (without -) because it's easier to type.

* Add cache and concurrency to the typecheck github job.

* Rename the quality workflow to typecheck.yml.

---------

Co-authored-by: Ruggero Tomaselli <ruggerotomaselli@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2023-10-04 17:12:05 +11:00
Stojan Dimitrovski 5b2750e01c feat: bump @supabase/gotrue-js to v2.54.0 2023-09-20 16:56:23 +02:00
Stojan Dimitrovski 3ee84aea03 feat: adds a persisted auth debug log if supabase.dashboard.auth.debug.persisted is true 2023-09-13 13:54:33 +02:00
Stojan Dimitrovski cf7f7d97bb feat: bump gotrue-js to 2.48.0 which fixes race condition with visibility callback 2023-08-23 12:16:00 +02:00
Stojan Dimitrovski e009c459cd feat: bump gotrue-js to v2.47.0 2023-08-14 10:07:23 +02:00
Jonathan Summers-Muir ecc21bf819 fixed some package issues. 2023-07-26 23:53:20 +08:00
Stojan Dimitrovski 9bc1f03b6b feat: bump gotrue-js to v2.46.1 and bring back navigatorLock 2023-07-26 09:16:12 +02:00
Kang Ming 5b3916277f Revert "feat: bump to gotrue-js v2.45.0 and bring back navigatorLock"
This reverts commit 3dc2788d52.
2023-07-24 15:14:07 +08:00
Stojan Dimitrovski 3dc2788d52 feat: bump to gotrue-js v2.45.0 and bring back navigatorLock 2023-07-21 15:42:26 +02:00
Greg Richardson f02fa47548 fix: local gotrue-js to 2.42.0 2023-07-20 17:14:02 -06:00
Alaister Young b8a2753ff8 hotfix: downgrade gotrue-js 2023-07-21 09:00:34 +10:00
Stojan Dimitrovski fb08e55236 feat: add navigatorLock to GoTrueClient 2023-07-19 11:26:51 +02:00
Stojan Dimitrovski f9b36d2435 feat: bump gotrue-js to 2.43.0 2023-07-18 14:27:03 +02:00
Stojan Dimitrovski e302638d2a feat: enable gotrue debug flag via localstorage 2023-06-29 14:16:19 +02:00
Stojan Dimitrovski 2c10d3df28 feat: bump gotrue-js to v2.31.0 2023-06-20 14:16:04 +02:00
Alaister Young e522368842 uses syncpack to auto sync dependencies 2023-05-29 14:20:44 +10:00
Alaister Young d1a8aaac3f manual dependency version changes 2023-05-29 14:16:07 +10:00
Stojan Dimitrovski 0af9cbc75d feat: bump gotrue-js to v2.24.0 2023-04-26 18:40:31 +02:00
Alaister Young 1ecb57b76a fix: missing react-use common dependency 2023-04-20 10:21:23 +10:00