|
| 1 | +# Contributing to OpenIM Documentation |
| 2 | + |
| 3 | +Thank you for improving OpenIM documentation. Contributions must preserve the accuracy of both the product content and the documentation system. |
| 4 | + |
| 5 | +## Before you start |
| 6 | + |
| 7 | +- Use Node.js 22.12 or newer and the pnpm version declared in `package.json`. |
| 8 | +- Read `AGENTS.md` and `docs/CONTENT_AUTHORING.md` before editing SDK or Platform API content. |
| 9 | +- Check `git status` and preserve unrelated work already present in the worktree. |
| 10 | +- Confirm that the target capability exists in the pinned OpenIM SDK, OpenIMServer source, OpenAPI document, or immutable audit evidence. |
| 11 | + |
| 12 | +## Language workflow |
| 13 | + |
| 14 | +Simplified Chinese is the editorial source for client SDK guides: |
| 15 | + |
| 16 | +1. Review the complete Chinese page and its evidence. |
| 17 | +2. Update the page manually; do not use scripts or machine translation for final prose. |
| 18 | +3. Update the page's audit record after the review. |
| 19 | +4. Translate the reviewed page manually into English. |
| 20 | +5. Verify that titles, parameters, examples, results, event boundaries, and links match the Chinese source and the target SDK. |
| 21 | + |
| 22 | +Do not publish an English SDK page while its Chinese source is incomplete or its English audit state is deferred. |
| 23 | + |
| 24 | +## Writing rules |
| 25 | + |
| 26 | +- Organize task pages by user operation, not by a mechanically repeated template. |
| 27 | +- Keep parameter and result explanations next to the API operation they describe. |
| 28 | +- Do not combine parameters from unrelated APIs in one table. |
| 29 | +- Explain Future or Promise completion, event delivery, and query reconciliation as separate stages. |
| 30 | +- Give each event one owning page. Other pages link to that owner instead of registering the same listener again. |
| 31 | +- Use stable business identifiers such as `conversationID`, `groupID`, `userID`, and `clientMsgID`; never use an array index or display name as a merge key. |
| 32 | +- Do not document deprecated, reserved, unsupported, or inferred capabilities as public features. |
| 33 | +- Mark commercial capabilities through the existing Enterprise metadata and ownership system. |
| 34 | + |
| 35 | +## Structural changes |
| 36 | + |
| 37 | +Adding, deleting, merging, or moving a page requires coordinated updates to: |
| 38 | + |
| 39 | +- English and Chinese content |
| 40 | +- route and sidebar structure |
| 41 | +- audit and API/event ownership records |
| 42 | +- search and localized generated data |
| 43 | +- approved redirects, when compatibility is required |
| 44 | +- tests covering the affected structure |
| 45 | + |
| 46 | +Historical design documents under `docs/superpowers/` are archival records. Do not rewrite their old paths as if they were current implementation guidance. |
| 47 | + |
| 48 | +## Validation |
| 49 | + |
| 50 | +Run the checks appropriate to the change: |
| 51 | + |
| 52 | +```bash |
| 53 | +pnpm content:check |
| 54 | +pnpm check |
| 55 | +``` |
| 56 | + |
| 57 | +Also run a production build for route, navigation, rendering, publication-state, or deployment changes: |
| 58 | + |
| 59 | +```bash |
| 60 | +pnpm build |
| 61 | +``` |
| 62 | + |
| 63 | +After `pnpm build`, keep the repository's expected `next-env.d.ts` import if Next.js rewrites it. |
| 64 | + |
| 65 | +## Pull requests |
| 66 | + |
| 67 | +A documentation pull request should state: |
| 68 | + |
| 69 | +- the pages or domains changed; |
| 70 | +- the SDK/server version or immutable source used for verification; |
| 71 | +- whether routes, event ownership, commercial metadata, or redirects changed; |
| 72 | +- the validation commands run and any remaining failure. |
| 73 | + |
| 74 | +Do not include tokens, private deployment addresses, customer data, internal screenshots, or sensitive diagnostic logs. |
0 commit comments