การมีส่วนร่วม
ยินดีต้อนรับรายงานบั๊ก, ไอเดีย, การแปล, เอกสาร และโค้ด หน้านี้จะอธิบายว่าควรพูดคุยที่ไหน, วิธีส่งการเปลี่ยนแปลง, ธรรมเนียมปฏิบัติของโค้ด และกฎระเบียบสำหรับปัญหาความปลอดภัยและสัญญาอนุญาต
ที่พูดคุย
ทุกอย่างเริ่มต้นที่คลัง community ไม่ว่าเป็นเรื่องส่วนใดของ Antimatter:
- บั๊กและคำขอฟีเจอร์: เปิด issue แล้วเลือก Bug report, Feature request หรือ Plugin or integration request ค้นหา issue ที่มีอยู่ก่อน; หากมีอยู่แล้ว ให้กด like หรือเพิ่มรายละเอียดของคุณ
- คำถามและไอเดีย: ในDiscussions ในหมวด Q&A หรือ Ideas
- ก่อนการเปลี่ยนแปลงครั้งใหญ่ ให้เปิด issue หรือ discussion เพื่อตกลงแนวทางก่อน ซึ่งจะช่วยประหยัด pull request ที่อาจไม่สามารถรวมโค้ดได้
ปัญหาท่ีติดป้าย good first issue และ help wanted เป็นจุดเริ่มต้นท่ีดี จงคอมเมนต์เพื่อบอกว่าท่านกำลงั ทำงานอยู่กบั ปญหาใด ปัญหาใหม่จะติดป้าย status/triage แลว้ ตามดวย status/accepted, status/planned หรือ status/wontfix ปัญหาจะอย่ใู น repository ของชุมชนไม่ว่าจะเกยี่ วกับอะไร: repository ของโค้ดไม่รับปัญหา งานท่ีวางแผนไว้จะอย่ทู ี่ Antimatter roadmap.
คลังโค้ดและสาขา
โค้ดอยู่ในองค์กร AntimatterChat; ที่เก็บโค้ด มีรายการคลังโค้ด ในแต่ละคลังโค้ด:
mainเป็นสาขาหลักและเก็บโค้ดของ Antimatter สร้างสาขาจากที่นี่และส่ง pull request ไปยังที่นี่- คลังโค้ดที่ fork จาก Mattermost ยังมีสาขา
upstreamซึ่งเป็น mirror ของโค้ด Mattermost ที่ใช้เพื่อนำการเปลี่ยนแปลงเข้ามา อย่าใช้สาขานี้เป็นฐานในการทำงาน
README ของแต่ละคลังโค้ดอธิบายวิธีสร้างและทดสอบ สำหรับเซิร์ฟเวอร์และอินเทอร์เฟซเว็บ ดูการสร้างจากซอร์สโค้ด; สำหรับแอป ดูสร้าง ติดตั้ง และดีบัก
คำขอรวมโค้ด (Pull request)
- Fork the repository and create a branch from
main. - Keep each pull request to one change. Small pull requests are reviewed faster.
- Follow the style of the code around you, and add or update tests where it makes sense.
- Describe what you changed and why, and link the issue it fixes:
Fixes AntimatterChat/community#123. - Make sure the checks pass. A maintainer reviews the pull request and may ask for changes.
In the server repository, fill in the pull request template: a สรุป, and the Release Note block, which must always be there. Write NONE in it when the change touches no API, configuration, database schema or visible behaviour.
By contributing, you agree that your contribution is licensed under the licence of the repository you contribute to.
Commits and code style
Commits
Commit messages in the history are one short sentence saying what changes, in sentence case and without a final full stop. Changes to one part are prefixed with it, for example Fusion: a compact conversation header on phones or Server: community attributes, and admin-only user attributes. One commit per change; explain the reasons in the body when they aren't obvious.
Server (Go)
- Run
make check-styleinserver/before pushing. - Never run
go mod tidydirectly; runmake modules-tidy. - In request paths, log with the request's logger. In the store layer, take a
request.CTX, not acontext.Context. - New API endpoints go in
server/channels/api4, with their types inserver/public/modeland, ideally, a method inmodel.Client4and in the TypeScript client.
Web interfaces (TypeScript and React)
- Run
make check-styleandmake check-typesinwebapp/. - The classic interface follows
webapp/STYLE_GUIDE.md: functional components, hooks for Redux, theme variables for colours, accessible markup. - Fusion's components live in
webapp/fusion/src/fusion, with their styles inwebapp/fusion/src/fusion/styles. They build class names with theam()helper and use Fusion's design tokens; follow the files next to yours. - Don't add new
window.*globals for apps. New app-facing utilities go underwindow.WebappUtils, aswebapp/AGENTS.mdexplains. - การแก้ไขใน registry ของแอป (
plugins/registry.ts) มักต้องทำในสำเนาของอินเทอร์เฟซทั้งสอง
การแปลภาษา
Antimatter และแอปที่รวมมาให้ได้รับการแปลเป็น 37 ภาษา ผู้มีส่วนร่วมเพิ่มข้อความภาษาอังกฤษ ส่วนภาษาอื่น ๆ จะได้รับการอัปเดตเป็นชุด
การเพิ่มข้อความในอินเทอร์เฟซเว็บ
- เขียนพร้อม ID และข้อความภาษาอังกฤษ:
formatMessage({id: 'fusion.channelMenu.settings', defaultMessage: 'Channel settings'})หรือ<FormattedMessage id='…' defaultMessage='…'/>ภาษาอังกฤษที่แสดงในแอปมาจากdefaultMessage - รัน
make i18n-extractในwebapp/(หรือnpm run i18n-extractในwebapp/fusionหรือwebapp/channels) ซึ่งจะทำให้อัปเดตsrc/i18n/en.jsonของแพ็กเกจนั้น - กรอก
descriptionของรายการใหม่ในen.json: ระบุตำแหน่งที่ข้อความปรากฏและวิธีการใช้งาน ซึ่งเป็นบริบทที่นักแปล (ไม่ว่าจะเป็นมนุษย์หรือเครื่องจักร) จะทำงานจาก
npm run i18n-extract:check จะล้มเหลวเมื่อ en.json ไม่ตรงกับโค้ด
การเพิ่มข้อความในเซิร์ฟเวอร์
- ใช้ ID ในโค้ด เช่น
model.NewAppError(…, "app.community_attributes.invalid.app_error", …)หรือi18n.T("…") - รัน
make i18n-extractในserver/ซึ่งจะช่วยเพิ่ม ID ไปยังserver/i18n/en.jsonในลำดับที่ถูกต้อง - เขียน
translationภาษาอังกฤษและdescriptionของรายการใหม่
ภาษาอื่น ๆ
แต่ละภาษามีไฟล์ของตัวเองถัดจาก en.json (fr.json, pt-BR.json, zh-TW.json…) หากต้องการรายงานการแปลที่ผิดพลาด ให้เปิด issue ใน repository ของชุมชนโดยระบุภาษา ข้อความ และตำแหน่งที่ปรากฏ
แอปที่รวมมาให้เก็บข้อความไว้ใน webapp/i18n/; ดู การแปลภาษา ในหน้าแอป
เอกสารและเว็บไซต์นี้
เว็บไซต์และเอกสารนี้อยู่ใน repository antimatter.chat หน้าต่าง ๆ เป็น HTML fragments ใน src/pages/; python3 src/build.py ใช้สร้างเว็บไซต์ ยินดีรับคำแก้ไขและคำอธิบายที่ขาดหายไปในรูปแบบของ issue หรือ pull request
ปัญหาความปลอดภัย
รายงานเป็นสว่นตวั ดวยการรายงานช่องโหว่ของ GitHub: เปิดแท็บ ความปลอดภัย ของ repository ท่ีได้รับผลกระทบ (เช่น เซิร์ฟเวอร์) และเลอื ก Report a vulnerability ถา้ ท่านไม่ทราบวา่ repository ไหนได้รับผลกระทบ ให้รายงานที่ repository ของชุมชน ระบุคอมโพเนนต์และเวอร์ชัน, ท่ีผ้ทู ะครุบสามารถทำได้, วิธีทำใหเ้ กิดซ้ำ, และการตัง้ ค่าท่ีเกยี่ วข้อง.
ผู้ดูแลจะตอบกลับที่นั่น อัปเดตสถานะให้คุณทราบระหว่างท่ีพวกเขากำลังแก้ไข และเผยแพร่ประกาศเมื่อมีเวอร์ชันท่ีแก้ไขแล้วออกมา กรุณาให้เวลาพวกเขาอย่างสมเหตุสมผลก่อนเปิดเผยปัญหา การแก้ไขจะรวมอยู่ในเวอร์ชันล่าสุด นโยบายความปลอดภัยฉบับเต็มอยู่ใน นโยบายความปลอดภัย
ลิขสิทธิ์
- เซิร์ฟเวอร์ อยู่ภายใต้ GNU Affero General Public License v3.0 (AGPL v3) ใน repository เดียวกัน เครื่องมือผู้ดูแลระบบและไฟล์การตั้งค่า (
server/templates/,server/i18n/,server/public/และwebapp/) อยู่ภายใต้ Apache License 2.0 ดูLICENSE.txtและNOTICE.txt - แอป: แอปของ Antimatter เอง เช่น Polls อยู่ภายใต้ AGPL v3; แอปท่ีแยกมาจาก Mattermost ยังคงใช้ลิขสิทธิ์เดิมของแต่ละ repository ระบุไว้ในไฟล์
LICENSE - แอปเดสก์ท็อปและมือถือ อยู่ภายใต้ Apache License 2.0 repository ของ Docker อยู่ภายใต้ Apache License 2.0 ยกเว้น
Dockerfileท่ีอยู่ภายใต้ AGPL v3
AGPL หมายความว่า หากคุณรันเซิร์ฟเวอร์ Antimatter ท่ีแก้ไขแล้วสำหรับผู้อื่นผ่านเครือข่าย คุณต้องเสนอซอร์สโค้ดของการเปลี่ยนแปลงเหล่านั้น Antimatter สร้างขึ้นจาก Mattermost; ไม่มีความเกี่ยวข้องหรือได้รับการรับรองจาก Mattermost, Inc.
ทุกคนท่ีมีส่วนร่วมต้องปฏิบัติตาม กฎระเบียบการประพฤติตน