Commit Graph

35 Commits

Author SHA1 Message Date
Joshen Lim 7f5865872a Enforce noUnusedLocals and noUnusedParameters in tsconfig.json + fix all related issues (#45264)
## Context

Enforce `noUnusedLocals` and `noUnusedParameters` in tsconfig.json + fix
all related issues
2026-04-27 17:42:34 +08:00
Charis 205cbe7d26 chore(studio}: enforce import order, remove bare import specifiers (#44585) 2026-04-07 20:34:10 -04:00
Charis 3b7052b5a9 cleanup: fix import order and prefixes for studio/data (#44501) 2026-04-03 09:15:57 +02:00
Saxon Fletcher 3f6cd1f188 error rates in functions list (#44006)
<img width="1835" height="886" alt="image"
src="https://github.com/user-attachments/assets/c4ab5be6-cddc-49b3-8d09-169acb706a20"
/>

Adds total request and error rate columns to edge functions table behind
a feature flag

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: SaxonF <1072756+SaxonF@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2026-03-25 17:23:46 +08:00
Joshen Lim c0692111b7 Capture exception in edge functions body query (#43628)
## Context

Trying to catch any parsing errors into sentry
2026-03-11 16:09:36 +07:00
Kalleby Santos 997203cd64 feat(studio-local): functions management api - function blob artifacts (#42349)
## What kind of change does this PR introduce?

Feature

## What is the current behavior?

Functions page on self-hosted differs from Platform

## What is the new behavior?

> [!NOTE]  
> This PR only add readonly operations. Function edit and deploy should
be implemented in a future one.

Adds the possibility to download and see function code in Self-Host
version.

<details>

<img width="1465" height="944" alt="image"
src="https://github.com/user-attachments/assets/4bbf8f5c-3390-4de6-9e8b-8ec9cd59ebad"
/>

</details>

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

* **New Features**
* API endpoint to stream function files/artifacts as
multipart/form-data.
* New function file entry type and server-side file listing for
functions.

* **Improvements**
  * Edge Functions "Code" navigation item always visible.
* Download popover reworked: ZIP download always available; CLI section
shown only on supported platforms.
* Editor set to read-only and file actions disabled on unsupported
environments.

* **Editor**
* Added JavaScript, TypeScript, and Markdown language modules for the
embedded editor.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
2026-02-06 20:06:37 +00:00
Kalleby Santos 8c3655cd71 feat(studio-local): functions management api - function details (#42322)
Functions page on self-hosted differs from Platform Adds the possibility to see function details page in Self-Host version.

## Summary by CodeRabbit

* **New Features**
* Edge function detail lookup added for self‑hosted deployments (new
retrieval endpoint & store method).
  * Consistent navigation to function pages from the functions list.

* **Improvements**
  * UI tabs, download, and test controls adapt to deployment type.
* Region, JWT verification, local development, and delete controls shown
only on the platform.
* Edit/save/delete controls enable/disable correctly based on deployment
and permissions.
  * Function details load reliably across deployments.
2026-01-30 21:14:28 +00:00
Kalleby Santos 1862b71745 feat(studio-local): functions management api - list functions (#40690)
## What is the current behaviour?

Functions page on self-hosted differs from Platform

## What is the new behaviour?

Adds the possibility to see a list of edge-functions in Self-Host
version.

## Summary by CodeRabbit

* **New Features**
* Added self-hosted edge functions support with filesystem-based
artifact listing and a new API endpoint to list local functions.
* Improved functions UI: unified view, enhanced search and adjacent sort
controls, and clearer local-hosting guidance.

* **Chores**
* Added environment configuration and docker volume for edge functions
management.
* Updated build/task config to pass through edge functions env and
include contentlayer outputs.

Co-authored-by: Ali Waseem <waseema393@gmail.com>
Co-authored-by: Charis Lam <26616127+charislam@users.noreply.github.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
2026-01-30 08:00:21 +08:00
Joshen Lim f293036ec7 Add UX guardrails for edge functions RE unsaved and unimported files (#41921)
* Add UX guardrails for edge functions RE unsaved and unimported files

* useLatest on hasUnsavedChanges

* Remove checking of unimported files + add VS code like indicator for modified and unsaved files

* Nit

* Fix TS

* Fix

* nit

* Fixes

* Nit

* move hasUnsavedChanges on demand

* code rabbit nit

* code rabbit nit 2

* prettier

---------

Co-authored-by: Alaister Young <a@alaisteryoung.com>
Co-authored-by: Danny White <3104761+dnywh@users.noreply.github.com>
2026-01-22 13:31:28 +08:00
Lakshan Perera 16e03f0de4 fix: use deno2 entrypoint when it's available (#41149) 2025-12-08 15:06:55 +08:00
Lakshan Perera 380dfbc91d Increase the max file size for Functions code editor to 20MB (#41005)
fix: increase max file size in function code editor to 20mb
2025-12-04 05:23:56 +11:00
Lakshan Perera 426c371d59 fix: correctly set entrypoint, import map path and static patterns for new functions (#40368)
* fix: correctly set entrypoint, import map path and static patterns for new functions

* Smol refactor

* Use TimestampInfo for last updated column in edge functions

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-11-12 17:13:22 +08:00
Ivan Vasilov 8b657165b5 chore: Migrate to use custom type for ReactQuery queries and mutations (#40073)
* Add custom types for queries, mutations and infinite queries.

* Migrate all queries to use the new type.

* Migrate all infinite queries to useCustomInfiniteQueryOptions.

* Migrate all mutations to use useCustomMutationOptions.

* Add type to all imports in `types` folder.
2025-11-03 13:18:13 +01:00
Joshen Lim 64e3e047eb Final final cleaning up barrel files (#40018)
* Final final cleaning up barrel files

* Fix merge conflict
2025-10-31 14:02:59 +08:00
Lakshan Perera 95eedb927e Updates to Edge Functions dashboard code editor (#39991)
* feat: use mgmt-api's function body endpoint

* skip json files from static patterns

* set the default content for deno.json

* feat: add drag and drop file support to FileExplorerAndEditor

- Add drag and drop functionality to accept files
- Dropped files are automatically read and added to the files list
- Visual feedback with drag overlay during drag operations
- Files maintain existing data format with id, name, content, and selected state
- Last dropped file is automatically selected for editing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add binary file handling to FileExplorerAndEditor

- Add binary file detection for common file extensions (.wasm, images, executables, etc.)
- Show "Cannot Edit Selected File" error message when trying to edit binary files
- Binary files dropped via drag-and-drop retain their original binary content
- Only show error in editor view, files remain accessible in file list
- Text files continue to work normally with full editing capabilities

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* do not ignore empty files

* exclude wasm files from static patterns

* Remove eszip parser test as dependency has been removed

* Fix TS issues

* Fix TS issues

* Fix pnpm-lock

* Fix

* Fix

* Nit

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-30 14:30:54 +08:00
Ivan Vasilov da4a40e308 chore: Migrate RQ functions to use object syntax style (#39895)
* Migrate all uses of invalidateQueries to use object syntax.

* Migrate the remainder of useInfiniteQuery.

* Migrate all setQueriesData.

* Migrate all fetchQuery uses.

* Migrate some leftover functions from RQ.

* Fix issues found by Charis.
2025-10-28 10:43:14 +01:00
Alaister Young 8855d05803 chore(studio): swap react-query to object syntax (#39842)
* chore(studio): swap react-query to object syntax

* Fix small issues found

* Fix realtime settings

* Nit

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-10-27 09:38:27 +01:00
냥냐챠 d29db69573 fix(edge-functions): parse eszip made from edge-runtime v1.69.x correctly (#38296)
* fix(edge-functions): parse eszip made from edge-runtime v1.69.x correctly

* stamp: update test

* stamp: format

* stamp: meow

* stamp: meowmeow

* stamp: format
2025-09-02 10:23:22 +09:00
Saxon Fletcher ea38c6d153 Review and merge branch (#36795)
* allow creating branching without git

* update branching modals

* add account connections

* edit branch

* copy

* update copy

* enable branch modal changes

* add gitless branching flag

* update account connections

* merge page

* merge experiment

* update merge

* update pull requests empty state

* use diff query

* branch diffing

* diff query

* Clean up

* refinements to gitless branching

* branching merge and status

* link

* branch function diffing

* update styling

* refactor

* remove hook

* error handling

* move

* remove enable branching modal

* re-add github linker

* abstract away enable and disable

* toggle fixes

* update logic to lean on connection status

* update form logic

* sheet layout

* gitless flag

* style and workflow updates

* fix side panel size

* fix duplicate onerror

* copy changes

* refetch

* merge mutation copy

* remove import

* add cost

* allow connection details on create

* initial queries

* push button

* merge cleanup

* Fix TS issues

* Fix TS issues

* Couple of clean ups

* Revert hardcode in useFlag

* Fix TS

* layout issues and github check

* refactor

* refactor to use new field

* cleanup

* style

* failed merge

* error positioning

* refactoring merge

* workflow refactor

* hook move

* clarification with github integration

* replace branch dropdown button

* update repo picker

* updates

* remove modal

* fix small nits

* change defaults

* clean up

* disable if not gitless and no connection

* clean up

* always show workflow run id

* optimistic

* fix branch query

* fix issues

* fetch edge diff

* confirm merge

* update edge functions key

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
Co-authored-by: Alaister Young <a@alaisteryoung.com>
2025-07-04 14:57:59 +10:00
Joshen Lim 232a26a68d Add custom error handler around fetch method (#35562)
* Add custom error handler for fetch error 'Failed to fetch'

* Refactor EdgeFunctionTesterSheet to use react query instead of manually calling fetch

* Use new fetchHandler for where we're calling fetch

* Revert
2025-05-09 15:22:55 +08:00
Saxon Fletcher 9549464ec9 handle string error (#34725) 2025-04-04 13:47:13 +10:00
Lakshan Perera a66278b811 Use relative paths in File editor and support existing entrypoint, import map settings (#34553)
* fix: add jsr:@std/path module

* fix: use relative paths for files in editor

* Smol fix

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-03-31 15:23:12 +08:00
Joshen Lim b9b748391d Add download edge functions CTA to edge function details header (#34501)
* Add download edge functions CTA to edge function details header

* Add CLI command

* Update copy

* Small tweak based on feedback
2025-03-31 14:06:25 +08:00
Saxon Fletcher 77dfe11248 Edit edge functions (#33727) 2025-03-26 19:54:12 +10:00
Joshen Lim 40ca927808 Chore/support updating email and unlinking identities (#33966)
* Support updating email address for email identity

* Support unlinking identity

* Deprecate AccountInformation component

* Invalidate identities after unlinking

* Address feedback

* Smol

* Fix type issues

* Update toast message

* Set up email change pending badge

* Fix

* Address feedback

* Resolve ts-expect-errors

* Fix TS issues + Fix GH icon on light mode + Address feedback
2025-03-21 17:15:05 +08:00
Saxon Fletcher 593625c574 Edge functions empty state (#33802)
* page components

* page component changes

* settings but broken saving

* rvert

* use sheet for provider

* styling

* remove things

* Some refactoring and fixing, added JSDocs to layouts

* Smol refactor

* Fix

* Update JSDocs

* updated scaffolding

* update edge functions layout

* remove params

* Clean up

* Spelling

* Clean up FormFieldWrappers

* One last clean up

* create edge functon

* use component

* flag

* fix merge errors

* fix imports

* fix merge issues

* fix import

* fix flag

* remove unused

* simple empty

* empty state improvements

* move templates

* re-add flag

* use templates

* flag

* copy functions

* feature flag it

* Fix issues and clean up

* Smol fix

* Add comment

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-02-28 01:15:59 +08:00
Kevin Grüneberg a283da6ddb chore: only include platform/v1 routes in api types (#33753) 2025-02-21 20:04:57 +08:00
Joshen Lim 3167c1f803 Edge function redirect if slug doesnt exist (#33479) 2025-02-10 21:59:56 +08:00
Saxon Fletcher d6245f4c08 deploy edge function mutaton (#33371)
* deploy edge function mutaton

* update url

* use openapi-fetch POST in the deploy mutation.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-02-06 08:08:24 +00:00
Joshen Lim 7dc467d843 Hide auth header from invoke command if enforce jwt is not true (#33209) 2025-02-03 11:36:04 +08: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
Alaister Young 6f6bcb9b08 chore: move edge functions to new fetchers (#26812)
* chore: move edge functions to new fetchers

* invalidate edge functions list query cache on update mutation
2024-05-28 16:53:39 +08:00
Kevin Grüneberg f9a55935f5 chore: use type imports for types/interfaces (#21738) 2024-03-04 20:48:22 +08:00
Kevin Grüneberg d12332ea5a chore: xmas cleanup (#19938) 2024-01-04 17:27:49 +01:00
Ivan Vasilov 436bdb10ae chore: Move the studio app to apps/studio (#18915)
* Move all studio files from /studio to /apps/studio.

* Move studio specific prettier ignores.

* Fix the ui references from studio.

* Fix the css imports.

* Fix all package.json issues.

* Fix the prettier setup for the studio app.

* Add .turbo folder to prettierignore.

* Fix the github workflows.
2023-11-15 12:38:55 +01:00