Skip to content

Commit 17c8de6

Browse files
authored
Merge pull request supabase-community#25 from supabase-community/feat/rename-publish-to-deploy
Rename "Publish" to "Deploy"
2 parents 642c9ff + db89891 commit 17c8de6

File tree

5 files changed

+31
-27
lines changed

5 files changed

+31
-27
lines changed

apps/postgres-new/components/sidebar.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '~/components/ui/tooltip
2323
import { useDatabaseDeleteMutation } from '~/data/databases/database-delete-mutation'
2424
import { useDatabaseUpdateMutation } from '~/data/databases/database-update-mutation'
2525
import { useDatabasesQuery } from '~/data/databases/databases-query'
26-
import { usePublishWaitlistCreateMutation } from '~/data/publish-waitlist/publish-waitlist-create-mutation'
27-
import { useIsOnPublishWaitlistQuery } from '~/data/publish-waitlist/publish-waitlist-query'
26+
import { useDeployWaitlistCreateMutation } from '~/data/deploy-waitlist/deploy-waitlist-create-mutation'
27+
import { useIsOnDeployWaitlistQuery } from '~/data/deploy-waitlist/deploy-waitlist-query'
2828
import { Database } from '~/lib/db'
2929
import { cn } from '~/lib/utils'
3030
import { useApp } from './app-provider'
@@ -214,28 +214,28 @@ function DatabaseMenuItem({ database, isActive }: DatabaseMenuItemProps) {
214214
const { mutateAsync: updateDatabase } = useDatabaseUpdateMutation()
215215

216216
const [isRenaming, setIsRenaming] = useState(false)
217-
const [isPublishDialogOpen, setIsPublishDialogOpen] = useState(false)
217+
const [isDeployDialogOpen, setIsDeployDialogOpen] = useState(false)
218218

219-
const { data: isOnPublishWaitlist } = useIsOnPublishWaitlistQuery()
220-
const { mutateAsync: joinPublishWaitlist } = usePublishWaitlistCreateMutation()
219+
const { data: isOnDeployWaitlist } = useIsOnDeployWaitlistQuery()
220+
const { mutateAsync: joinDeployWaitlist } = useDeployWaitlistCreateMutation()
221221

222222
return (
223223
<>
224224
<Dialog
225-
open={isPublishDialogOpen}
225+
open={isDeployDialogOpen}
226226
onOpenChange={(open) => {
227-
setIsPublishDialogOpen(open)
227+
setIsDeployDialogOpen(open)
228228
}}
229229
>
230230
<DialogContent className="max-w-2xl">
231231
<DialogHeader>
232-
<DialogTitle>Database publishing is in Private Alpha</DialogTitle>
232+
<DialogTitle>Deployments are in Private Alpha</DialogTitle>
233233
<div className="py-2 border-b" />
234234
</DialogHeader>
235-
<h2 className="font-medium">What is database publishing?</h2>
235+
<h2 className="font-medium">What are deployments?</h2>
236236
<p>
237-
Publish your database so that it can be accessed outside the browser using any Postgres
238-
client:
237+
Deploy your database to a serverless PGlite instance so that it can be accessed outside
238+
the browser using any Postgres client:
239239
</p>
240240
<CodeBlock
241241
className="language-curl bg-neutral-800"
@@ -247,11 +247,11 @@ function DatabaseMenuItem({ database, isActive }: DatabaseMenuItemProps) {
247247
</CodeBlock>
248248
<div className="flex justify-center items-center mt-3">
249249
<AnimatePresence initial={false}>
250-
{!isOnPublishWaitlist ? (
250+
{!isOnDeployWaitlist ? (
251251
<button
252252
className="px-4 py-3 bg-black text-white rounded-md"
253253
onClick={async () => {
254-
await joinPublishWaitlist()
254+
await joinDeployWaitlist()
255255
}}
256256
>
257257
Join Private Alpha
@@ -266,8 +266,8 @@ function DatabaseMenuItem({ database, isActive }: DatabaseMenuItemProps) {
266266
initial="hidden"
267267
animate="show"
268268
>
269-
<h3 className="font-medium mb-2">🎉 You&apos;re on the list!</h3>
270-
<p>We&apos;ll let you know when you have access to publish.</p>
269+
<h3 className="font-medium mb-2">🎉 You&apos;re on the waitlist!</h3>
270+
<p>We&apos;ll send you an email when you have access to deploy.</p>
271271
</m.div>
272272
)}
273273
</AnimatePresence>
@@ -364,14 +364,14 @@ function DatabaseMenuItem({ database, isActive }: DatabaseMenuItemProps) {
364364
onClick={async (e) => {
365365
e.preventDefault()
366366

367-
setIsPublishDialogOpen(true)
367+
setIsDeployDialogOpen(true)
368368
setIsPopoverOpen(false)
369369
}}
370370
disabled={user === undefined}
371371
>
372372
<Upload size={16} strokeWidth={2} className="flex-shrink-0" />
373373

374-
<span>Publish</span>
374+
<span>Deploy</span>
375375
</Button>
376376
<Button
377377
className="bg-inherit text-destructive-600 justify-start hover:bg-neutral-200 flex gap-3"

apps/postgres-new/data/publish-waitlist/publish-waitlist-create-mutation.ts renamed to apps/postgres-new/data/deploy-waitlist/deploy-waitlist-create-mutation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
22
import { createClient } from '~/utils/supabase/client'
3-
import { getIsOnPublishWaitlistQueryKey } from './publish-waitlist-query'
3+
import { getIsOnDeployWaitlistQueryKey } from './deploy-waitlist-query'
44

5-
export const usePublishWaitlistCreateMutation = ({
5+
export const useDeployWaitlistCreateMutation = ({
66
onSuccess,
77
onError,
88
...options
@@ -13,15 +13,15 @@ export const usePublishWaitlistCreateMutation = ({
1313
mutationFn: async () => {
1414
const supabase = createClient()
1515

16-
const { error } = await supabase.from('publish_waitlist').insert({})
16+
const { error } = await supabase.from('deploy_waitlist').insert({})
1717

1818
if (error) {
1919
throw error
2020
}
2121
},
2222
async onSuccess(data, variables, context) {
2323
await Promise.all([
24-
queryClient.invalidateQueries({ queryKey: getIsOnPublishWaitlistQueryKey() }),
24+
queryClient.invalidateQueries({ queryKey: getIsOnDeployWaitlistQueryKey() }),
2525
])
2626
return onSuccess?.(data, variables, context)
2727
},

apps/postgres-new/data/publish-waitlist/publish-waitlist-query.ts renamed to apps/postgres-new/data/deploy-waitlist/deploy-waitlist-query.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { UseQueryOptions, useQuery } from '@tanstack/react-query'
22
import { createClient } from '~/utils/supabase/client'
33

4-
export const useIsOnPublishWaitlistQuery = (
4+
export const useIsOnDeployWaitlistQuery = (
55
options: Omit<UseQueryOptions<boolean, Error>, 'queryKey' | 'queryFn'> = {}
66
) => {
77
const supabase = createClient()
88

99
return useQuery<boolean, Error>({
1010
...options,
11-
queryKey: getIsOnPublishWaitlistQueryKey(),
11+
queryKey: getIsOnDeployWaitlistQueryKey(),
1212
queryFn: async () => {
1313
const { data, error } = await supabase.auth.getUser()
1414
if (error) {
@@ -17,7 +17,7 @@ export const useIsOnPublishWaitlistQuery = (
1717
const { user } = data
1818

1919
const { data: waitlistRecord, error: waitlistError } = await supabase
20-
.from('publish_waitlist')
20+
.from('deploy_waitlist')
2121
.select('*')
2222
.eq('user_id', user.id)
2323
.maybeSingle()
@@ -33,4 +33,4 @@ export const useIsOnPublishWaitlistQuery = (
3333
})
3434
}
3535

36-
export const getIsOnPublishWaitlistQueryKey = () => ['publish-waitlist']
36+
export const getIsOnDeployWaitlistQueryKey = () => ['deploy-waitlist']

apps/postgres-new/utils/supabase/db-types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export type Database = {
3434
}
3535
public: {
3636
Tables: {
37-
publish_waitlist: {
37+
deploy_waitlist: {
3838
Row: {
3939
created_at: string
4040
id: number
@@ -52,7 +52,7 @@ export type Database = {
5252
}
5353
Relationships: [
5454
{
55-
foreignKeyName: "publish_waitlist_user_id_fkey"
55+
foreignKeyName: "deploy_waitlist_user_id_fkey"
5656
columns: ["user_id"]
5757
isOneToOne: false
5858
referencedRelation: "users"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
alter table public.publish_waitlist
2+
rename to deploy_waitlist;
3+
4+
alter table public.deploy_waitlist rename constraint publish_waitlist_user_id_fkey to deploy_waitlist_user_id_fkey;

0 commit comments

Comments
 (0)