i18n - docs translations (#18636)
Created by Github action Co-authored-by: github-actions <github-actions@twenty.com>
This commit is contained in:
committed by
GitHub
parent
55d675bba7
commit
2a8912b17a
@@ -1263,12 +1263,12 @@ The build process:
|
||||
1. **Parses and validates the manifest** — reads all `defineX()` entities from your source files and validates the manifest structure.
|
||||
2. **Compiles logic functions and front components** — bundles TypeScript sources into ESM `.mjs` files using esbuild.
|
||||
3. **Generates checksums** — computes MD5 hashes for each built file, stored in the manifest as `builtHandlerChecksum` / `builtComponentChecksum`.
|
||||
4. **Generates the typed API client** — introspects the GraphQL schema and generates typed `CoreApiClient` and `MetadataApiClient` clients.
|
||||
5. **Runs a TypeScript type check** — runs `tsc --noEmit` to catch type errors before publishing.
|
||||
6. **Rebuilds with the generated client** — performs a second compilation pass so the generated client types are included.
|
||||
7. **Optionally creates a tarball** — if `--tarball` is passed, runs `npm pack` to create a `.tgz` file ready for distribution.
|
||||
4. **生成类型化的 API 客户端** — 对 GraphQL 架构进行自省,并生成带类型的 `CoreApiClient` 和 `MetadataApiClient` 客户端。
|
||||
5. **运行 TypeScript 类型检查** — 运行 `tsc --noEmit` 以在发布前捕获类型错误。
|
||||
6. **使用生成的客户端重新构建** — 执行第二次编译,以便包含生成的客户端类型。
|
||||
7. **可选地创建一个 tar 包** — 如果传入 `--tarball`,则运行 `npm pack` 以创建用于分发的 `.tgz` 文件。
|
||||
|
||||
The build output in `.twenty/output/` contains:
|
||||
`.twenty/output/` 中的构建产物包含:
|
||||
|
||||
```text
|
||||
.twenty/output/
|
||||
@@ -1282,16 +1282,16 @@ The build output in `.twenty/output/` contains:
|
||||
└── my-app-1.0.0.tgz # Only with --tarball flag
|
||||
```
|
||||
|
||||
| 选项 | 描述 |
|
||||
| ----------- | --------------------------------------------------------- |
|
||||
| `[appPath]` | Path to the app directory (defaults to current directory) |
|
||||
| `--tarball` | Also pack the output into a `.tgz` tarball |
|
||||
| 选项 | 描述 |
|
||||
| ----------- | ----------------------- |
|
||||
| `[appPath]` | 应用目录的路径(默认为当前目录) |
|
||||
| `--tarball` | 同时将输出打包为一个 `.tgz` tar 包 |
|
||||
|
||||
## Publishing your app
|
||||
## 发布你的应用
|
||||
|
||||
Use `app:publish` to distribute your app — either to the npm registry or directly to a Twenty server.
|
||||
使用 `app:publish` 分发你的应用 — 可以发布到 npm 注册表,或直接发布到 Twenty 服务器。
|
||||
|
||||
### Publish to npm (default)
|
||||
### 发布到 npm(默认)
|
||||
|
||||
```bash filename="Terminal"
|
||||
# Publish to npm (requires npm login)
|
||||
@@ -1301,57 +1301,57 @@ yarn twenty app:publish
|
||||
yarn twenty app:publish --tag beta
|
||||
```
|
||||
|
||||
This builds the app and runs `npm publish` from the `.twenty/output/` directory. The published package can then be installed from the Twenty marketplace by any workspace.
|
||||
这会构建应用,并在 `.twenty/output/` 目录下运行 `npm publish`。 发布后的软件包可由任何工作区从 Twenty 市场进行安装。
|
||||
|
||||
### Publish to a Twenty server
|
||||
### 发布到 Twenty 服务器
|
||||
|
||||
```bash filename="Terminal"
|
||||
# Publish directly to a Twenty server
|
||||
yarn twenty app:publish --server https://app.twenty.com
|
||||
```
|
||||
|
||||
This builds the app with a tarball, uploads it to the server via the `uploadAppTarball` GraphQL mutation, and triggers installation in one step. This is useful for private deployments or testing against a specific server.
|
||||
这会以 tar 包方式构建应用,通过 `uploadAppTarball` GraphQL 变更将其上传到服务器,并在一步中触发安装。 这对于私有部署或针对特定服务器进行测试非常有用。
|
||||
|
||||
| 选项 | 描述 |
|
||||
| ----------------- | --------------------------------------------------------- |
|
||||
| `[appPath]` | Path to the app directory (defaults to current directory) |
|
||||
| `--server <url>` | Publish to a Twenty server instead of npm |
|
||||
| `--token <token>` | Authentication token for the target server |
|
||||
| `--tag <tag>` | npm dist-tag (e.g. `beta`, `next`) — only for npm publish |
|
||||
| 选项 | 描述 |
|
||||
| ----------------- | ------------------------------------------ |
|
||||
| `[appPath]` | 应用目录的路径(默认为当前目录) |
|
||||
| `--server <url>` | 发布到 Twenty 服务器(而非 npm) |
|
||||
| `--token <token>` | 目标服务器的身份验证令牌 |
|
||||
| `--tag <tag>` | npm dist-tag(例如 `beta`、`next`)— 仅用于发布到 npm |
|
||||
|
||||
## Application registration
|
||||
## 应用注册
|
||||
|
||||
Before an app can be installed in a workspace, it must be **registered**. A registration is a metadata record that describes where the app comes from and how to authenticate it. This is handled automatically by the CLI in most cases.
|
||||
在应用安装到工作区之前,必须先进行**注册**。 注册是一条元数据记录,用于描述应用的来源以及如何对其进行身份验证。 在大多数情况下,CLI 会自动处理这一流程。
|
||||
|
||||
### Source types
|
||||
### 来源类型
|
||||
|
||||
Each registration has a **source type** that determines how the app's files are resolved during installation:
|
||||
每个注册都有一个**来源类型**,用于决定安装期间如何解析应用的文件:
|
||||
|
||||
| Source type | How files are resolved | Typical use case |
|
||||
| ----------- | -------------------------------------------------------------------------- | -------------------------------------- |
|
||||
| `LOCAL` | Files are synced in real-time by the CLI watcher — installation is skipped | Development with `app:dev` |
|
||||
| `NPM` | Fetched from the npm registry via the `sourcePackage` field | Published apps on npm |
|
||||
| `TARBALL` | Extracted from an uploaded `.tgz` file stored on the server | Private apps published with `--server` |
|
||||
| 来源类型 | 文件的解析方式 | 典型用例 |
|
||||
| --------- | -------------------------------- | --------------------- |
|
||||
| `LOCAL` | 文件由 CLI 监听器实时同步——跳过安装步骤 | 使用 `app:dev` 进行开发 |
|
||||
| `NPM` | 通过 `sourcePackage` 字段从 npm 注册表获取 | 在 npm 上发布的应用 |
|
||||
| `TARBALL` | 从存储在服务器上的已上传 `.tgz` 文件中解压获得 | 使用 `--server` 发布的私有应用 |
|
||||
|
||||
### How registration happens
|
||||
### 注册如何进行
|
||||
|
||||
* **`app:dev`** — automatically creates a `LOCAL` registration the first time you run dev mode against a workspace.
|
||||
* **`app:publish --server`** — uploads a tarball and creates (or updates) a `TARBALL` registration, then installs the app.
|
||||
* **npm marketplace** — `NPM` registrations are created when apps are synced from the npm registry into the Twenty marketplace catalog.
|
||||
* **GraphQL API** — you can also create registrations programmatically via the `createApplicationRegistration` mutation.
|
||||
* **`app:dev`** — 第一次针对某个工作区运行开发模式时,会自动创建一个 `LOCAL` 注册。
|
||||
* **`app:publish --server`** — 上传一个 tar 包并创建(或更新)一个 `TARBALL` 注册,然后安装应用。
|
||||
* **npm 市场** — 当应用从 npm 注册表同步到 Twenty 市场目录时,会创建 `NPM` 注册。
|
||||
* **GraphQL API** — 你也可以通过 `createApplicationRegistration` 变更以编程方式创建注册。
|
||||
|
||||
### Registration vs installation
|
||||
### 注册与安装
|
||||
|
||||
**Registration** and **installation** are separate concepts:
|
||||
**注册** 与 **安装** 是两个独立的概念:
|
||||
|
||||
* A **registration** (`ApplicationRegistration`) is a global metadata record describing the app: its name, source type, OAuth credentials, and marketplace listing status. It exists independently of any workspace.
|
||||
* An **installation** (`Application`) is a per-workspace instance. When a user installs an app, Twenty resolves the package from the registration's source, writes the built files to storage, and synchronizes the manifest (creating objects, fields, logic functions, etc.) in that workspace.
|
||||
* **注册**(`ApplicationRegistration`)是一条全局元数据记录,用于描述应用:其名称、来源类型、OAuth 凭据以及在市场中的上架状态。 它独立于任何工作区存在。
|
||||
* **安装**(`Application`)是一个按工作区划分的实例。 当用户安装一个应用时,Twenty 会根据注册的来源解析软件包,将构建生成的文件写入存储,并同步清单(创建对象、字段、逻辑函数等) 到该工作区中。
|
||||
|
||||
One registration can be installed in many workspaces. Each workspace gets its own copy of the app's files and data model.
|
||||
一个注册可以安装到多个工作区。 每个工作区都会获得应用文件和数据模型的独立副本。
|
||||
|
||||
### OAuth credentials
|
||||
### OAuth 凭据
|
||||
|
||||
Each registration includes OAuth credentials (`oAuthClientId` and `oAuthClientSecret`) generated at creation time. These are used by the app to authenticate API requests on behalf of users. The client secret is returned **once** at creation — store it securely. You can rotate it later via the `rotateApplicationRegistrationClientSecret` mutation.
|
||||
每个注册都包含在创建时生成的 OAuth 凭据(`oAuthClientId` 和 `oAuthClientSecret`)。 应用使用这些凭据代表用户对 API 请求进行身份验证。 客户端密钥在创建时只会返回**一次**——请妥善保管。 你可以稍后通过 `rotateApplicationRegistrationClientSecret` 变更来轮换它。
|
||||
|
||||
## 手动设置(不使用脚手架)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user