Skip to content

Commit fd0ca3d

Browse files
authored
docs: rewritten (#161)
* init * skeleton * home page * fix links * home page * structure * wip * redirect * /docs/getting-started * /docs/getting-started * /docs/getting-started * /docs/openapi/getting-started * /docs/procedure * /docs/procedure * /docs/router * /docs/middleware * /docs/context * /docs/context * /docs/error-handling * /docs/file-upload-download * /docs/event-iterator * /docs/rpc-handler * /docs/contract-first/define-contract * /docs/rpc-handler * /docs/rpc-handler * /docs/contract-first/implement-contract * /docs/router * /docs/openapi/routing * /docs/openapi/input-output-structure * /docs/openapi/error-handling * integrations * integrations * integrations * integrations * integrations * integrations * plugins * /docs/server-action * /docs/client/server-side * /docs/client/client-side * integrations * integrations * /docs/client/server-side * /docs/client/error-handling * /docs/client/event-iterator * /docs/client/rpc-link * /docs/client/dynamic-link * /docs/tanstack-query * /docs/pinia-colada * comparison and playgrounds * /docs/advanced/validation-errors * wip * /docs/lifecycle * /docs/openapi/bracket-notation * improve * /docs/openapi/openapi-handler * /docs/openapi/specification * /docs/openapi/client/openapi-link * /docs/openapi/plugins/zod-smart-coercion * /docs/advanced/rpc-protocol * improve * /examples/openai-streaming * /sponsor * fix
1 parent ff5907c commit fd0ca3d

File tree

140 files changed

+6749
-7371
lines changed

Some content is hidden

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

140 files changed

+6749
-7371
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
!.*.example
66
!.vscode/
77
!.github/
8+
!.vitepress/
89

910
# Common generated folders
1011
logs/

apps/content/.gitignore

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,24 @@
1-
# deps
2-
/node_modules
3-
4-
# generated content
5-
.contentlayer
6-
.content-collections
7-
.source
8-
9-
# test & build
10-
/coverage
11-
/.next/
12-
/out/
13-
/build
14-
*.tsbuildinfo
15-
16-
# misc
17-
.DS_Store
18-
*.pem
19-
/.pnp
20-
.pnp.js
21-
npm-debug.log*
22-
yarn-debug.log*
23-
yarn-error.log*
24-
25-
# others
26-
.env*.local
27-
.vercel
28-
next-env.d.ts
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

apps/content/.vitepress/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
cache

apps/content/.vitepress/config.ts

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
2+
import { defineConfig } from 'vitepress'
3+
import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons'
4+
5+
export default defineConfig({
6+
lang: 'en-US',
7+
title: 'oRPC',
8+
description:
9+
'oRPC makes it easy to build APIs that are end-to-end type-safe and adhere to OpenAPI standards, ensuring a smooth and enjoyable developer experience.',
10+
lastUpdated: true,
11+
ignoreDeadLinks: true,
12+
cleanUrls: true,
13+
markdown: {
14+
theme: {
15+
light: 'github-light',
16+
dark: 'github-dark',
17+
},
18+
config(md) {
19+
md.use(groupIconMdPlugin)
20+
},
21+
codeTransformers: [
22+
transformerTwoslash(),
23+
],
24+
},
25+
themeConfig: {
26+
logo: '/logo.webp',
27+
siteTitle: '',
28+
socialLinks: [
29+
{ icon: 'github', link: 'https://github.com/unnoq/orpc' },
30+
{ icon: 'discord', link: 'https://discord.gg/TXEbwRBvQn' },
31+
{ icon: 'x', link: 'https://x.com/unnoqcom' },
32+
{ icon: 'bluesky', link: 'https://bsky.app/profile/unnoq.com' },
33+
],
34+
editLink: {
35+
pattern: 'https://github.com/unnoq/orpc/blob/main/apps/content/:path',
36+
text: 'Edit on GitHub',
37+
},
38+
footer: {
39+
message: 'Released under the MIT License.',
40+
copyright: 'Copyright © 2024-present Unnoq & oRPC contributors.',
41+
},
42+
nav: [
43+
{ text: 'Docs', link: '/docs/getting-started', activeMatch: '/docs/(?!openapi/)' },
44+
{ text: 'OpenAPI', link: '/docs/openapi/getting-started', activeMatch: '/docs/openapi/' },
45+
{ text: 'Examples', link: '/examples/openai-streaming', activeMatch: '/examples/' },
46+
{ text: 'Sponsor', link: '/sponsor' },
47+
{
48+
text: 'About',
49+
items: [
50+
{ text: 'Releases', link: 'https://github.com/unnoq/orpc/releases' },
51+
],
52+
},
53+
{ text: 'Discussions', link: 'https://github.com/unnoq/orpc/discussions' },
54+
],
55+
sidebar: {
56+
'/docs/': [
57+
{ text: 'Getting Started', link: '/docs/getting-started' },
58+
{ text: 'Procedure', link: '/docs/procedure' },
59+
{ text: 'Router', link: '/docs/router' },
60+
{ text: 'Middleware', link: '/docs/middleware' },
61+
{ text: 'Context', link: '/docs/context' },
62+
{ text: 'Error Handling', link: '/docs/error-handling' },
63+
{ text: 'File Upload/Download', link: '/docs/file-upload-download' },
64+
{ text: 'Event Iterator (SSE)', link: '/docs/event-iterator' },
65+
{ text: 'Server Action', link: '/docs/server-action' },
66+
{ text: 'RPC Handler', link: '/docs/rpc-handler' },
67+
{ text: 'Lifecycle', link: '/docs/lifecycle' },
68+
{
69+
text: 'Contract First',
70+
collapsed: true,
71+
items: [
72+
{ text: 'Define Contract', link: '/docs/contract-first/define-contract' },
73+
{ text: 'Implement Contract', link: '/docs/contract-first/implement-contract' },
74+
],
75+
},
76+
{
77+
text: 'Integrations',
78+
collapsed: true,
79+
items: [
80+
{ text: 'Fetch server', link: '/docs/integrations/fetch-server' },
81+
{ text: 'Node', link: '/docs/integrations/node' },
82+
{ text: 'Bun', link: '/docs/integrations/bun' },
83+
{ text: 'Cloudflare Workers', link: '/docs/integrations/cloudflare-workers' },
84+
{ text: 'Deno', link: '/docs/integrations/deno' },
85+
{ text: 'Express', link: '/docs/integrations/express' },
86+
{ text: 'Next.js', link: '/docs/integrations/nextjs' },
87+
{ text: 'Nuxt', link: '/docs/integrations/nuxt' },
88+
{ text: 'Hono', link: '/docs/integrations/hono' },
89+
{ text: 'Tanstack Start', link: '/docs/integrations/tanstack-start' },
90+
{ text: 'Elysia', link: '/docs/integrations/elysia' },
91+
{ text: 'SvelteKit', link: '/docs/integrations/svelte-kit' },
92+
{ text: 'Remix', link: '/docs/integrations/remix' },
93+
{ text: 'SolidStart', link: '/docs/integrations/solid-start' },
94+
],
95+
},
96+
{
97+
text: 'Plugins',
98+
collapsed: true,
99+
items: [
100+
{ text: 'CORS', link: '/docs/plugins/cors' },
101+
{ text: 'Response Headers', link: '/docs/plugins/response-headers' },
102+
],
103+
},
104+
{
105+
text: 'Client',
106+
collapsed: true,
107+
items: [
108+
{ text: 'Server-Side', link: '/docs/client/server-side' },
109+
{ text: 'Client-Side', link: '/docs/client/client-side' },
110+
{ text: 'Error Handling', link: '/docs/client/error-handling' },
111+
{ text: 'Event Iterator', link: '/docs/client/event-iterator' },
112+
{ text: 'RPC Link', link: '/docs/client/rpc-link' },
113+
{ text: 'Dynamic Link', link: '/docs/client/dynamic-link' },
114+
],
115+
},
116+
{
117+
text: 'Tanstack Query',
118+
collapsed: true,
119+
items: [
120+
{ text: 'Basic', link: '/docs/tanstack-query/basic' },
121+
{ text: 'React', link: '/docs/tanstack-query/react' },
122+
{ text: 'Vue', link: '/docs/tanstack-query/vue' },
123+
],
124+
},
125+
{
126+
text: 'Advanced',
127+
collapsed: true,
128+
items: [
129+
{ text: 'Validation Errors', link: '/docs/advanced/validation-errors' },
130+
{ text: 'RPC Protocol', link: '/docs/advanced/rpc-protocol' },
131+
],
132+
},
133+
{
134+
text: 'Others',
135+
collapsed: true,
136+
items: [
137+
{ text: 'Pinia Colada', link: '/docs/pinia-colada' },
138+
{ text: 'Playgrounds', link: '/docs/playgrounds' },
139+
{ text: 'Comparison', link: '/docs/comparison' },
140+
],
141+
},
142+
],
143+
'/docs/openapi/': [
144+
{ text: 'Getting Started', link: '/docs/openapi/getting-started' },
145+
{ text: 'Routing', link: '/docs/openapi/routing' },
146+
{ text: 'Input/Output Structure', link: '/docs/openapi/input-output-structure' },
147+
{ text: 'Error Handling', link: '/docs/openapi/error-handling' },
148+
{ text: 'Bracket Notation', link: '/docs/openapi/bracket-notation' },
149+
{ text: 'OpenAPI Handler', link: '/docs/openapi/openapi-handler' },
150+
{ text: 'OpenAPI Specification', link: '/docs/openapi/openapi-specification' },
151+
{
152+
text: 'Plugins',
153+
collapsed: true,
154+
items: [
155+
{ text: 'Zod Smart Coercion', link: '/docs/openapi/plugins/zod-smart-coercion' },
156+
],
157+
},
158+
{
159+
text: 'Client',
160+
collapsed: true,
161+
items: [
162+
{ text: 'OpenAPI Link', link: '/docs/openapi/client/openapi-link' },
163+
],
164+
},
165+
],
166+
'/examples/': [
167+
{ text: 'OpenAI Streaming', link: '/examples/openai-streaming' },
168+
],
169+
},
170+
},
171+
head: [
172+
['meta', { property: 'og:image', content: 'https://orpc.unnoq.com/og.jpg' }],
173+
['meta', { property: 'og:type', content: 'website' }],
174+
['meta', { property: 'twitter:domain', content: 'orpc.unnoq.com' }],
175+
['meta', { property: 'twitter:image', content: 'https://orpc.unnoq.com/og.jpg' }],
176+
['meta', { property: 'twitter:card', content: 'summary_large_image' }],
177+
['link', { rel: 'shortcut icon', href: '/icon.svg', type: 'image/svg+xml' }],
178+
],
179+
titleTemplate: ':title - oRPC',
180+
vite: {
181+
plugins: [
182+
groupIconVitePlugin({
183+
customIcon: {
184+
cloudflare: 'logos:cloudflare-workers-icon',
185+
},
186+
}),
187+
],
188+
},
189+
})
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
:root {
2+
--vp-font-family-base: -apple-system, BlinkMacSystemFont, segoe ui, Helvetica, Arial, sans-serif, apple color emoji,
3+
segoe ui emoji;
4+
--vp-font-family-mono: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;
5+
}
6+
7+
.vp-doc h1,
8+
.vp-doc h2,
9+
.vp-doc h3,
10+
.vp-doc h4,
11+
.vp-doc h5,
12+
.vp-doc h6 {
13+
font-weight: 700;
14+
}
15+
16+
.title {
17+
font-weight: 700 !important;
18+
}
19+
20+
.tagline {
21+
max-width: 500px !important;
22+
}
23+
24+
body {
25+
-webkit-font-smoothing: subpixel-antialiased;
26+
}
27+
28+
.VPImage.image-src {
29+
padding-top: 12%;
30+
max-width: 512px;
31+
max-height: 512px;
32+
}
33+
34+
@media screen and (max-width: 960px) {
35+
.VPHero.has-image .image {
36+
display: none;
37+
}
38+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type { EnhanceAppContext } from 'vitepress'
2+
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
3+
import Theme from 'vitepress/theme'
4+
5+
import 'virtual:group-icons.css'
6+
import '@shikijs/vitepress-twoslash/style.css'
7+
import './custom.css'
8+
9+
export default {
10+
extends: Theme,
11+
enhanceApp({ app }: EnhanceAppContext) {
12+
app.use(TwoslashFloatingVue)
13+
},
14+
}

apps/content/README.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)