Skip to content

Commit 866ad55

Browse files
authored
Merge pull request #1577 from phk422/main
Translate for Chinese
2 parents ede4797 + c8accf5 commit 866ad55

File tree

12 files changed

+1377
-56
lines changed

12 files changed

+1377
-56
lines changed

docs/.vitepress/zh.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const zh = defineConfig({
3131
items: [
3232
{ text: "快速上手", link: "/zh/openapi-fetch/" },
3333
{
34-
text: "中间件与认证方式",
34+
text: "中间件 & 身份认证",
3535
link: "/zh/openapi-fetch/middleware-auth",
3636
},
3737
{ text: "测试", link: "/zh/openapi-fetch/testing" },

docs/openapi-fetch/api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const client = createClient({
8888
| form (exploded) | `/users?role=admin&firstName=Alex` |
8989
| **deepObject (default)** | `/users?id[role]=admin&id[firstName]=Alex` |
9090

91-
::: note
91+
::: tip
9292

9393
**deepObject** is always exploded, so it doesn’t matter if you set `explode: true` or `explode: false`—it’ll generate the same output.
9494

docs/scripts/update-contributors.js

+2
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ const OPENAPI_TS_CONTRIBUTORS = [
132132
"WickyNilliams",
133133
"hrsh7th",
134134
"davidleger95",
135+
"phk422",
135136
]),
136137
];
137138

@@ -155,6 +156,7 @@ export const OPENAPI_FETCH_CONTRIBUTORS = [
155156
"Fumaz",
156157
"darwish",
157158
"kaechele",
159+
"phk422",
158160
]),
159161
];
160162

docs/zh/about.md

+45-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: About openapi-typescript
2+
title: 关于 openapi-typescript
33
description: Additional info about this project
44
---
55

@@ -8,31 +8,53 @@ description: Additional info about this project
88
import contributors from '../data/contributors.json';
99
</script>
1010

11-
# About openapi-typescript
11+
# 关于 openapi-typescript
1212

13-
::: warning
13+
## 使用者
1414

15-
This article is a stub. Please help [expand it](https://github.com/drwpow/openapi-typescript/tree/main/docs/zh/)!
15+
- [**Bigcommerce**](https://github.com/bigcommerce/bigcommerce-api-node): 用于 BigCommerce API 的 Node SDK
16+
- [**Budibase**](https://github.com/Budibase/budibase): 用于创建内部工具、工作流和管理面板的低代码平台
17+
- [**Fedora `fmn`**](https://github.com/fedora-infra/fmn): Fedora 消息基础设施的工具和 API
18+
- [**Fingerprint**](https://github.com/fingerprintjs/fingerprintjs-pro-server-api-node-sdk): 高规模应用的设备指纹技术
19+
- [**Google Firebase CLI**](https://github.com/firebase/firebase-tools): 用于 Google Firebase 平台的官方 CLI
20+
- [**GitHub Octokit**](https://github.com/octokit): GitHub API 的官方 SDK
21+
- [**Lotus**](https://github.com/uselotus/lotus): 开源定价和打包基础设施
22+
- [**Jitsu**](https://github.com/jitsucom/jitsu): 现代、开源的数据摄取/数据流水线
23+
- [**Medusa**](https://github.com/medusajs/medusa): 数字商务的构建模块
24+
- [**Netlify**](https://netlify.com): 现代开发平台
25+
- [**Nuxt**](https://github.com/unjs/nitro): 直观的 Vue 框架
26+
- [**Relevance AI**](https://github.com/RelevanceAI/relevance-js-sdk): 构建和部署 AI 链
27+
- [**Revolt**](https://github.com/revoltchat/api): 开源用户优先的聊天平台
28+
- [**Spacebar**](https://github.com/spacebarchat): 免费、开源、可自托管的与 Discord 兼容的聊天/语音/视频平台
29+
- [**Supabase**](https://github.com/supabase/supabase): 开源的 Firebase 替代方案
30+
- [**Twitter API**](https://github.com/twitterdev/twitter-api-typescript-sdk): Twitter API 的官方 SDK
1631

17-
:::
32+
## 项目目标
1833

19-
## Used by
34+
1. 支持将任何有效的 OpenAPI 模式转换为 TypeScript 类型,无论多么复杂。
35+
2. 生成的类型应该是静态分析的、无运行时依赖的(有一些例外,比如 [enums](https://www.typescriptlang.org/docs/handbook/enums.html))。
36+
3. 生成的类型应尽可能与原始模式匹配,保留原始的大写形式等。
37+
4. Typegen 只需要 Node.js 来运行(不需要 Java、Python 等),可以在任何环境中运行。
38+
5. 支持从文件以及本地和远程服务器获取 OpenAPI 模式。
2039

21-
- [**Bigcommerce**](https://github.com/bigcommerce/bigcommerce-api-node): Node SDK for the BigCommerce API
22-
- [**Budibase**](https://github.com/Budibase/budibase): low code platform for creating internal tools, workflows, and admin panels
23-
- [**Fedora `fmn`**](https://github.com/fedora-infra/fmn): tools and APIs for Fedora’s messaging infra
24-
- [**Fingerprint**](https://github.com/fingerprintjs/fingerprintjs-pro-server-api-node-sdk): device fingerprinting for high-scale applications
25-
- [**Google Firebase CLI**](https://github.com/firebase/firebase-tools): Official CLI for Google’s Firebase platform
26-
- [**GitHub Octokit**](https://github.com/octokit): Official SDK for the GitHub API
27-
- [**Lotus**](https://github.com/uselotus/lotus): open source pricing & packaging infra
28-
- [**Jitsu**](https://github.com/jitsucom/jitsu): modern, open source data ingestion / data pipelines
29-
- [**Medusa**](https://github.com/medusajs/medusa): building blocks for digital commerce
30-
- [**Netlify**](https://netlify.com): the modern development platform
31-
- [**Nuxt**](https://github.com/unjs/nitro): The Intuitive Vue framework
32-
- [**Relevance AI**](https://github.com/RelevanceAI/relevance-js-sdk): build and deploy AI chains
33-
- [**Revolt**](https://github.com/revoltchat/api): open source user-first chat platform
34-
- [**Spacebar**](https://github.com/spacebarchat): a free, open source, self-hostable Discord-compatible chat/voice/video platform
35-
- [**Supabase**](https://github.com/supabase/supabase): The open source Firebase alternative.
36-
- [**Twitter API**](https://github.com/twitterdev/twitter-api-typescript-sdk): Official SDK for the Twitter API
40+
## 差异
3741

38-
## Project goals
42+
### 与 swagger-codegen 比较
43+
44+
openapi-typescript 专门为 swagger-codegen 的轻量、易于使用的替代方案而创建,它不需要 Java 运行时或运行 OpenAPI 服务器。它也不生成庞大的客户端端代码。实际上,openapi-typescript 生成的所有代码都是**无运行时的静态类型**,以实现最大性能和最小的客户端体积。
45+
46+
### 与 openapi-typescript-codegen 比较
47+
48+
这两个项目无关。openapi-typescript-codegen 是原始 swagger-codegen 的 Node.js 替代方案,但实际上是一样的。openapi-typescript 具有与 openapi-typescript-codegen 相同的优势,即**无运行时**,而 openapi-typescript-codegen 可以生成相当庞大的捆绑包,取决于模式的复杂性,可以达到 `250 kB` 或更多。
49+
50+
### 与 tRPC 比较
51+
52+
[tRPC](https://trpc.io/) 是一个对服务器和客户端都进行类型安全的框架。它要求服务器和客户端都使用 tRPC 编写(这意味着后端使用 Node.js)。
53+
54+
如果您符合此用例,那么这将是一次很好的体验!但对于其他所有人,openapi-typescript(和 openapi-fetch)是一个更灵活、更低级的解决方案,可以适用于任何技术选择(甚至可以在没有任何成本的情况下逐步采用)。
55+
56+
## 贡献者
57+
58+
没有这些出色的贡献者,这个库将不可能存在:
59+
60+
<VPTeamMembers size="small" :members="contributors['openapi-typescript']" />

0 commit comments

Comments
 (0)