Skip to content

feat: allow customization of the supabase root directory name and config paths #2139

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

Open
Bowbee opened this issue Apr 10, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@Bowbee
Copy link

Bowbee commented Apr 10, 2024

Is your feature request related to a problem? Please describe.
I have a monorepo that has a very specific naming structure with /apps and /libs folders. The option for --workdir is great when initializing a new project, however I would love to specify the name of the root directory alongside this.

Describe the solution you'd like
Having a cli flag for --rootname <folder name> would be great.

Describe alternatives you've considered
The alternative is to place a parent folder with the desired name before initializing a project. Eg: apps/testproject/supabase.
Something like this is required for multiple projects to exist within a monorepo.

Additional context
This appears to currently be hardcoded in internal/utils/misc.go.
I am unsure whether other considerations are needed such as an indicator for what is a supabase directory or not. Maybe the CLI can automatically detect this based off --workdir or the contents of the cwd.

@Bowbee Bowbee changed the title Allow customization of the supabase root directory name feat: Allow customization of the supabase root directory name Apr 10, 2024
@sweatybridge
Copy link
Contributor

Do you mean to customize like apps/testproject/custom-supabase? That wouldn't be possible because a lot of our platform's GitHub integrations depend on a directory named supabase.

If you mean apps/testproject/supabase, I think it's already supported with supabase init --workdir apps/testproject flag.

@Bowbee
Copy link
Author

Bowbee commented Apr 10, 2024

Yes I mean apps/testpropject/custom-supabase - this would be great. Maybe this can be accomplished by having the directory name specified in the config.toml instead of assumed to be supabase always?

project_id already exists in the config.toml, I assume to combat some of these issues already. Why not allow root_name or something similar as well?

@sweatybridge
Copy link
Contributor

config.toml lives inside supabase directory though. How would you suggest we find the right config.toml file if we support custom-supabase directory?

@tomx-sh
Copy link

tomx-sh commented Apr 10, 2024

@sweatybridge I'm also interested in the possibility to place Supabase directories anywhere I want in my project.
Next.JS docs encourage a structure where everything is in the src or app folder, and the root directory is only used for config files.
I can imagine a supabase.config.toml, or supabase.config.ts, or a .supabase directory in the root (personally prefer the first solution) where you would provide the paths of supabase stuff!

@sweatybridge sweatybridge added the enhancement New feature or request label Apr 15, 2024
@sweatybridge
Copy link
Contributor

I see, so perhaps a --config <path-to-toml> flag that can be passed to CLI to override the default location of supabase/config.toml.

Within config.toml, users can declare path overrides for other directories relative to the location of config.toml. For eg.

workdir = '..'

[migrations]
path = './migrations/*.sql'

[seed]
path = './seed.sql'

[functions.slug]
path = '../src/index.ts'

@baffioso
Copy link

baffioso commented Aug 1, 2024

I see, so perhaps a --config <path-to-toml> flag that can be passed to CLI to override the default location of supabase/config.toml.

Within config.toml, users can declare path overrides for other directories relative to the location of config.toml. For eg.

workdir = '..'

[migrations]
path = './migrations/*.sql'

[seed]
path = './seed.sql'

[functions.slug]
path = '../src/index.ts'

This could indeed be handy. I using a monorepo for multiple identical apps with the same supabase setup and would like to have separate config (with different project_id) for each project, but use the same migrations/seed etc. This would probably do the job.

@djhi
Copy link
Contributor

djhi commented Oct 16, 2024

I see, so perhaps a --config flag that can be passed to CLI to override the default location of supabase/config.toml.

This would also be handy to have separate containers and volumes for running e2e tests without touching your development instances.

@sweatybridge sweatybridge changed the title feat: Allow customization of the supabase root directory name feat: allow customization of the supabase root directory name and config paths Oct 30, 2024
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

5 participants