ubiquity-os-marketplace / daemon-pricing

0 stars 12 forks source link

Generate the Supabase types instead of committing the generated file #2

Closed gentlementlegen closed 5 months ago

gentlementlegen commented 6 months ago

Currently, the TypeScript types that are generated by Supabase are committed in the repository. It might be a better practice to generate them on a build step. This would give some benefits:

The drawback would be that for contributors who do not have a Service Role Key, they would only be able to generate the schema locally.

The expected fix would be to have a prebuild step that generates the types properly.

Refers to https://github.com/ubiquibot/assistive-pricing/pull/1#discussion_r1529509069

whilefoo commented 6 months ago

If you want to generate types you need to push migrations to a DB and then generate types (for some weird reason, it can't generate types without a database). Running a local DB requires Docker which not everybody has installed - in my case I use a Macbook which needs a VM for Docker so I usually have it turned off.

gentlementlegen commented 6 months ago

If you want to generate types you need to push migrations to a DB and then generate types (for some weird reason, it can't generate types without a database). Running a local DB requires Docker which not everybody has installed - in my case I use a Macbook which needs a VM for Docker so I usually have it turned off.

I am aware of this problem indeed. However, I also use a Macbook and have no issue running Docker instances, is it because you are using an older version of MacOS? To fix this, it is possible to deploy your own Supabase version using the Supabase CLI to a free account as well, I do this to test the db without having to run everything locally.

0x4007 commented 6 months ago

Can you set a time estimate label @FernandVEYRIER

Also I just realized that this is for a plugin. This is an example of why I think we should use Cloudflare KV instead of Supabase. Its simpler.

Perhaps we should use KV and close this issue as unplanned. @whilefoo rfc


I just saw this comment https://github.com/ubiquibot/assistive-pricing/pull/1#discussion_r1529093790 which explains why we need to use Supabase (for GitHub Actions.) The documentation doesn't suggest this is true. It can be initialized as a "workers" project but just not deployed on Cloudflare as a Worker, right?

It just seems that a full Supabase database per plugin isn't worth it.

gentlementlegen commented 6 months ago

I am really not sure to understand the use of Cloudflare in general at that point, I never tried to set it up locally. What I like about Supabase is to spin up my local instance with one command line, and being able to manipulate everything without the worry to break it. Because on Cloudflare case how do I set up KV values without admin access? Should I have my own account and my own instances?

For this issue it should consist of calling a prebuild command running Supabase CLI https://supabase.com/docs/guides/api/rest/generating-types

0x4007 commented 6 months ago

Should I have my own account and my own instances?

Yes

I never tried to set it up locally.

They have a tool built in called miniflare that runs everything locally! Including KV locally! I'm very bullish on Cloudflare developer experience.

ubiquibot[bot] commented 5 months ago
+ Evaluating results. Please wait...
ubiquity-os-main[bot] commented 5 months ago

[ 4.758 WXDAI ]

@whilefoo
Contributions Overview
View Contribution Count Reward
Issue Comment 1 4.758
Conversation Incentives
Comment Formatting Relevance Reward
If you want to generate types you need to push migrations to a D…
6.1
p:
  count: 61
  score: 1
0.78 4.758

[ 53.48 WXDAI ]

@gentlementlegen
Contributions Overview
View Contribution Count Reward
Issue Task 1 25
Issue Specification 1 10
Issue Comment 2 18.48
Conversation Incentives
Comment Formatting Relevance Reward
Currently, the TypeScript types that are generated by Supabase a…
10
p:
  count: 99
  score: 1
code:
  count: 1
  score: 1
1 10
I am aware of this problem indeed. However, I also use a Macbook…
13.2
p:
  count: 66
  score: 1
0.48 6.336
I am really not sure to understand the use of Cloudflare in gene…
18.4
p:
  count: 91
  score: 1
code:
  count: 1
  score: 1
0.66 12.144

[ 4.301 WXDAI ]

@0x4007
Contributions Overview
View Contribution Count Reward
Issue Comment 2 4.301
Conversation Incentives
Comment Formatting Relevance Reward
Can you set a time estimate label @FernandVEYRIER Also I just r…
10.6
p:
  count: 105
  score: 1
a:
  count: 1
  score: 1
0.23 2.438
Yes They have a tool built in called miniflare that runs everyth…
2.3
p:
  count: 23
  score: 1
0.81 1.863
ubiquibot[bot] commented 5 months ago

[ 15.8 WXDAI ]

@0x4007
Contributions Overview
ViewContributionCountReward
IssueComment215.8
Conversation Incentives
CommentFormattingRelevanceReward
Can you set a time estimate label @FernandVEYRIER Also I jus...
13.4
a:
  count: 1
  score: "1"
  words: 1
hr:
  count: 1
  score: "1"
  words: 0
0.413.4
> Should I have my own account and my own instances? Yes >...
2.40.712.4

[ 83 WXDAI ]

@gentlementlegen
Contributions Overview
ViewContributionCountReward
IssueSpecification124
IssueTask125
IssueComment234
IssueComment20
Conversation Incentives
CommentFormattingRelevanceReward
Currently, the TypeScript types that are generated by Supabase a...
24
li:
  count: 2
  score: "2"
  words: 22
code:
  count: 1
  score: "1"
  words: 1
124
> If you want to generate types you need to push migrations to a...
13.20.4613.2
I am really not sure to understand the use of Cloudflare in gene...
20.8
code:
  count: 1
  score: "1"
  words: 1
0.8420.8
> If you want to generate types you need to push migrations to a...
-0.46-
I am really not sure to understand the use of Cloudflare in gene...
-
code:
  count: 1
  score: "0"
  words: 1
0.84-

[ 6.1 WXDAI ]

@whilefoo
Contributions Overview
ViewContributionCountReward
IssueComment16.1
Conversation Incentives
CommentFormattingRelevanceReward
If you want to generate types you need to push migrations to a D...
6.10.556.1