Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tips for building and contributing to the project #525

Open
colespencer1453 opened this issue Nov 9, 2024 · 8 comments
Open

Tips for building and contributing to the project #525

colespencer1453 opened this issue Nov 9, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@colespencer1453
Copy link

Hello!

I just started using this package and I'm wanting to dive deeper into how this is working and potentially contribute after learning more. Do you have any advice for building, running, and testing the project? I downloaded it and ran pnpm i with pnpm 9 and that went rather smoothly. Then I started the supabase instance and ran the tests in the projects. There were lots of failing tests so I wasn't sure if that was expected or I was still missing configuration.

I'm specifically getting this error when running tests:

Error: Failed to resolve entry for package "@supabase-cache-helpers/postgrest-core". The package may have incorrect main/module/exports specified in its package.json.

@colespencer1453 colespencer1453 added the enhancement New feature or request label Nov 9, 2024
@psteinroe
Copy link
Owner

hey @colespencer1453, thanks for your interest in contributing to this library. Highly appreciated!

we are using pnpm v8 still, although despite the updated lockfile I dont think there will be any problems when using v9 instead.

The test require the dependencies to be built. I just added the missing task definition to turbo for this (2349efd). if you run the test without turbo, you need to run the build manually. I usually just run pnpm -w run build:packages. Note that if you do any update to a dependency (e.g. postgrest-core when you want to run postgrest-swr tests), you have to rebuild that package for the changes to take effect. Further, some integration tests require supabase to run. So it's always a good idea to run pnpm supabase start before working on the project.

Let me know if you encounter any further issues or if something else is unclear. I would also appreciate a contributors guide!

@colespencer1453
Copy link
Author

colespencer1453 commented Nov 10, 2024

hey @colespencer1453, thanks for your interest in contributing to this library. Highly appreciated!

we are using pnpm v8 still, although despite the updated lockfile I dont think there will be any problems when using v9 instead.

The test require the dependencies to be built. I just added the missing task definition to turbo for this (2349efd). if you run the test without turbo, you need to run the build manually. I usually just run pnpm -w run build:packages. Note that if you do any update to a dependency (e.g. postgrest-core when you want to run postgrest-swr tests), you have to rebuild that package for the changes to take effect. Further, some integration tests require supabase to run. So it's always a good idea to run pnpm supabase start before working on the project.

Let me know if you encounter any further issues or if something else is unclear. I would also appreciate a contributors guide!

@psteinroe I think I'm making progress, but still struggling to run the tests specifically for postgrest-react-query. If I cd to the folder for it and run pnpm test all of the tests fail. If I run pnpm test from the root then it runs tests for @supabase-cache-helpers/storage-core:test: and all of them are passing. I'm not familiar with turbo so I'm probably missing something here. I have the supabase db up and running without issue.

UPDATE: The specific error that I'm getting when running these tests is "The schema must be one of the following: ". Currently debugging.

@colespencer1453
Copy link
Author

@psteinroe looks like the main issue here was the supabase config.toml file had an empty array for schemas exposed in the api. Is this intentional?

[api]
# Port to use for the API URL.
port = 54321
# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API
# endpoints. public and storage are always included.
schemas = []
# Extra schemas to add to the search_path of every request.
extra_search_path = ["extensions"]
# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size
# for accidental or malicious requests.
max_rows = 1000

@psteinroe
Copy link
Owner

it is, public and storage are always exposed. What errors do you get?

@colespencer1453
Copy link
Author

colespencer1453 commented Nov 10, 2024

I get "The schema must be one of the following :" with a blank list. When adding "public" to the array of schemas this error is resolved and most of the tests are passing.

Screenshot 2024-11-10 at 8 59 04 PM

@psteinroe
Copy link
Owner

that is indeed weird! Are you using the supabase cli version declared in the repo?

@colespencer1453
Copy link
Author

colespencer1453 commented Nov 10, 2024

All I see in the repo is "supabase":"latest" in the package.json. I upgraded my cli to latest and I"m still getting the same thing.

supabase cli version:
"1.219.2"

@colespencer1453
Copy link
Author

colespencer1453 commented Nov 10, 2024

Looks like I just had a bunch of older supabase docker images cached that needed to get cleared. All is well now. Also wasn't using pnpm supabase so was using latest cli version. Version in the project appears to be 1.183.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants