Skip to content

Commit 5d3da98

Browse files
authored
feat(server)!: rename .func() to .handler() (#60)
* refactor(server): Renamed .func() to .handler() * feat(docs): Redesigned docs
1 parent c29cb6d commit 5d3da98

85 files changed

Lines changed: 317 additions & 311 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<image align="center" src="./logo.png" width=400 />
2+
<image align="center" src="./logo.webp" width=280 />
33
</div>
44

55
<h1></h1>

apps/content/app/(home)/page.tsx

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Popup, PopupContent, PopupTrigger } from 'fumadocs-twoslash/ui'
44
import { CodeBlock, Pre } from 'fumadocs-ui/components/codeblock'
55
import { Tab, Tabs } from 'fumadocs-ui/components/tabs'
66
import { DocsBody } from 'fumadocs-ui/page'
7+
import Image from 'next/image'
78
import Link from 'next/link'
89

910
const mdxComponents = {
@@ -39,48 +40,37 @@ export default function HomePage() {
3940
<div className="mx-auto lg:col-span-6 lg:flex lg:items-center justify-center text-center">
4041
<div className="relative z-10 lg:h-auto pt-[90px] lg:pt-[90px] lg:min-h-[300px] flex flex-col items-center justify-center sm:mx-auto md:w-3/4 lg:mx-0 lg:w-full gap-4 lg:gap-8">
4142
<div className="flex flex-col items-center">
42-
<h1 className="max-w-5xl text-foreground text-4xl sm:text-5xl sm:leading-none lg:text-6xl">
43-
<span className="block text-foreground">
44-
End-to-End Typesafe API Builder for Developers
45-
</span>
46-
{/* <span className="block md:ml-0">Developer-first simplicity</span> */}
43+
<Image src="/logo.webp" alt="oRPC" width={500} height={100} unoptimized />
44+
<h1 className="max-w-4xl mt-5 text-#b4befe font-semibold text-4xl sm:text-5xl sm:leading-none lg:text-5xl">
45+
Typesafe API's Made Simple 🪄
4746
</h1>
4847
<p className="max-w-2xl pt-2 text-foreground my-3 text-xs sm:mt-5 lg:mb-0 sm:text-sm lg:text-base">
49-
<strong className="font-semibold">oRPC</strong>
50-
{' '}
51-
is an open-source toolkit that helps developers build robust TypeScript functions
52-
and expose them to the internet using typesafe clients, OpenAPI standards, or even server actions.
53-
Our focus is on
48+
End-to-End Typesafe API's made easy in a toolkit that helps developers build robust TypeScript API's with a focus on
5449
{' '}
5550
<strong className="font-semibold">developer experience</strong>
5651
,
5752
{' '}
58-
<strong className="font-semibold">performance</strong>
59-
, and
60-
{' '}
6153
<strong className="font-semibold">reliability</strong>
6254
.
63-
{/* <br className="hidden md:block" /> */}
6455
</p>
6556
</div>
66-
<div className="flex items-center gap-2">
67-
<a
68-
data-size="medium"
57+
<div className="flex items-center gap-5">
58+
<Link
6959
type="button"
70-
className="relative justify-center cursor-pointer inline-flex items-center space-x-2 text-center font-regular ease-out duration-200 rounded-md outline-none transition-all outline-0 focus-visible:outline-4 focus-visible:outline-offset-1 border bg-brand-400 dark:bg-brand-500 hover:bg-brand/80 dark:hover:bg-brand/50 text-foreground border-brand-500/75 dark:border-brand/30 hover:border-brand-600 dark:hover:border-brand focus-visible:outline-brand-600 data-[state=open]:bg-brand-400/80 dark:data-[state=open]:bg-brand-500/80 data-[state=open]:outline-brand-600 text-sm px-4 py-2 h-[38px]"
71-
href="https://github.com/unnoq/orpc"
72-
rel="noreferrer noopener"
73-
target="_blank"
60+
className="bg-fd-primary/80 flex py-3 px-8 rounded-full cursor-pointer"
61+
href="/docs"
62+
7463
>
75-
<span className="truncate">View on GitHub</span>
76-
</a>
64+
<span className="font-medium text-white/80">Quick start</span>
65+
</Link>
7766
<Link
78-
data-size="medium"
7967
type="button"
80-
className="relative justify-center cursor-pointer inline-flex items-center space-x-2 text-center font-regular ease-out duration-200 rounded-md outline-none transition-all outline-0 focus-visible:outline-4 focus-visible:outline-offset-1 border text-foreground bg-alternative dark:bg-muted hover:bg-selection border-strong hover:border-stronger focus-visible:outline-brand-600 data-[state=open]:bg-selection data-[state=open]:outline-brand-600 data-[state=open]:border-button-hover text-sm px-4 py-2 h-[38px]"
81-
href="/docs"
68+
className="bg-fd-primary/20 bg-opacity-20 flex py-3 px-8 rounded-full cursor-pointer"
69+
href="https://github.com/unnoq/orpc"
70+
rel="noreferrer noopener"
71+
target="_blank"
8272
>
83-
<span className="truncate">Quick start</span>
73+
<span className="text-fd-primary font-medium">View on GitHub</span>
8474
</Link>
8575
</div>
8676
</div>

apps/content/app/layout.config.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared'
22
import { Bluesky, Discord, Twitter } from '@/components/icons'
3+
import NavbarLogo from '@/components/ui/NavbarLogo'
34

45
/**
56
* Shared layout configurations
@@ -11,7 +12,7 @@ import { Bluesky, Discord, Twitter } from '@/components/icons'
1112
export const baseOptions: BaseLayoutProps = {
1213
githubUrl: 'https://github.com/unnoq/orpc',
1314
nav: {
14-
title: 'oRPC',
15+
title: <NavbarLogo />,
1516
},
1617
links: [
1718
{

apps/content/app/layout.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Metadata } from 'next'
2-
import { RootProvider } from 'fumadocs-ui/provider'
2+
import { Banner } from 'fumadocs-ui/components/banner'
33

4+
import { RootProvider } from 'fumadocs-ui/provider'
45
import { GeistMono } from 'geist/font/mono'
56
import { GeistSans } from 'geist/font/sans'
67
import './global.css'
@@ -24,6 +25,12 @@ export default function Layout({ children }: { children: React.ReactNode }) {
2425
suppressHydrationWarning
2526
>
2627
<body className="flex flex-col min-h-screen">
28+
<Banner>
29+
oRPC is currently pre-stable, please report any issues on our
30+
{' '}
31+
{' '}
32+
Discord or GitHub 🚧
33+
</Banner>
2734
<RootProvider
2835
search={{
2936
options: {

apps/content/components/icons.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function Discord(props: React.ComponentProps<'svg'>) {
1919
>
2020
<path
2121
d="M216.856 16.597A208.502 208.502 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046-19.692-2.961-39.203-2.961-58.533 0-1.832-4.4-4.55-9.933-6.846-14.046a207.809 207.809 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161.094 161.094 0 0 0 79.735 175.3a136.413 136.413 0 0 1-21.846-10.632 108.636 108.636 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a131.66 131.66 0 0 0 5.355 4.237 136.07 136.07 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848 21.142-6.58 42.646-16.637 64.815-33.213 5.316-56.288-9.08-105.09-38.056-148.36ZM85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2c12.867 0 23.236 11.804 23.015 26.2.02 14.375-10.148 26.18-23.015 26.18Zm85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2 0 14.375-10.148 26.18-23.015 26.18Z"
22-
fill="#5865F2"
22+
fill="currentColor"
2323
/>
2424
</svg>
2525
)
@@ -36,7 +36,7 @@ export function Bluesky(props: React.ComponentProps<'svg'>) {
3636
{...props}
3737
>
3838
<path
39-
fill="#1185FE"
39+
fill="currentColor"
4040
d="M55.491 15.172c29.35 22.035 60.917 66.712 72.509 90.686 11.592-23.974 43.159-68.651 72.509-90.686C221.686-.727 256-13.028 256 26.116c0 7.818-4.482 65.674-7.111 75.068-9.138 32.654-42.436 40.983-72.057 35.942 51.775 8.812 64.946 38 36.501 67.187-54.021 55.433-77.644-13.908-83.696-31.676-1.11-3.257-1.63-4.78-1.637-3.485-.008-1.296-.527.228-1.637 3.485-6.052 17.768-29.675 87.11-83.696 31.676-28.445-29.187-15.274-58.375 36.5-67.187-29.62 5.041-62.918-3.288-72.056-35.942C4.482 91.79 0 33.934 0 26.116 0-13.028 34.314-.727 55.491 15.172Z"
4141
/>
4242
</svg>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Image from 'next/image'
2+
3+
export default function NavbarLogo() {
4+
return (
5+
<Image src="/logo.webp" alt="oRPC" width={60} height={100} unoptimized />
6+
)
7+
}

apps/content/content/docs/client/react-query.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ const router = {
145145
user: {
146146
list: os
147147
.input(z.object({ cursor: z.number(), limit: z.number() }))
148-
.func((input) => ({
148+
.handler((input) => ({
149149
nextCursor: input.cursor + input.limit,
150150
users: [], // Fetch your actual data here
151151
})),

apps/content/content/docs/client/react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const router = {
9292
user: {
9393
list: os
9494
.input(z.object({ cursor: z.number(), limit: z.number() }))
95-
.func((input) => {
95+
.handler((input) => {
9696
return {
9797
nextCursor: input.cursor + input.limit,
9898
users: []

apps/content/content/docs/client/vue-query.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const router = {
8585
user: {
8686
list: os
8787
.input(z.object({ cursor: z.number(), limit: z.number() }))
88-
.func((input) => ({
88+
.handler((input) => ({
8989
nextCursor: input.cursor + input.limit,
9090
users: [], // Fetch your actual data here
9191
})),

apps/content/content/docs/contract-first.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,23 @@ export const authed /** require authed */ = os
9595
.contract(contract)
9696

9797
export const router = pub.router({
98-
getting: pub.getting.func((input, context, meta) => {
98+
getting: pub.getting.handler((input, context, meta) => {
9999
return {
100100
message: `Hello, ${input.name}!`,
101101
}
102102
}),
103103

104104
post: {
105105
find: pub.post.find
106-
.func((input, context, meta) => {
106+
.handler((input, context, meta) => {
107107
return {
108108
id: 'example',
109109
title: 'example',
110110
description: 'example',
111111
}
112112
}),
113113

114-
create: authed.post.create.func((input, context, meta) => {
114+
create: authed.post.create.handler((input, context, meta) => {
115115
return {
116116
id: 'example',
117117
title: input.title,

0 commit comments

Comments
 (0)