Giao diện
@digiforce-nc/plugin-export-schema
Plugin xuất schema — export cấu hình collection, fields, relations và UI schema ra file JSON để chia sẻ, backup, hoặc chuyển đổi giữa các môi trường.
Plugin này làm gì?
Khi cần di chuyển cấu hình giữa các môi trường (dev → staging → production) hoặc chia sẻ cấu hình cho đồng nghiệp, plugin cho phép export toàn bộ schema (collections, fields, relations, UI pages) ra file JSON chuẩn — có thể import lại bằng plugin-import-schema.
Năm tính năng chính
| # | Tính năng | Chi tiết |
|---|---|---|
| 1 | Collection export | Export định nghĩa collection: fields, index, relations, validators |
| 2 | UI schema export | Export page layout, block config, form schema |
| 3 | Selective export | Chọn collection/page cần export (không bắt buộc export tất cả) |
| 4 | Dependency resolve | Tự động include collections phụ thuộc (FK, relation) |
| 5 | JSON format | Output file JSON chuẩn, có thể version control (Git) |
Kiến trúc
Luồng export
Cấu trúc file JSON output
| Section | Nội dung |
|---|---|
collections | Danh sách collection: fields, indexes, relations, validators |
uiSchemas | Page layouts, block configs, form schemas |
menus | Menu structure (nếu có) |
metadata | Version, timestamp, source instance info |
Dependency resolution
Khi export collection orders, plugin tự động phát hiện và include:
- Collection
customers(FK relation) - Collection
products(M2M relation) - Shared scopes và validators
Thành phần client
| Thành phần | Mô tả |
|---|---|
ExportWizard | Wizard chọn nội dung export (checkbox tree) |
SchemaPreview | Preview schema JSON trước khi download |
ExportButton | Nút download file JSON |
DependencyTree | Hiển thị dependency tree của items được chọn |
Dependencies
| Package | Vai trò |
|---|---|
@digiforce-nc/server | Server framework |
@digiforce-nc/database | Database ORM |
@digiforce-nc/client | Client UI framework |
Mục lục chi tiết
(Xem trang tổng quan ở trên)