How mmdctjj/raetable works
1. What this repo is
- raetable is a React + Ant Design component library for building “easy table” page patterns.
- The package centers on a reusable table/form workflow rather than a standalone app.
2. Public API boundary
- The main entry point is src/index.ts, which re-exports the library’s components, hooks, enums, and utilities.
- This is the boundary consumers import from; everything under src/components, src/hooks, src/enum, and src/utils is internal implementation.
3. Primary component layer
- src/components contains the user-facing building blocks:
- ETable for the main table experience
- EPage for page-level composition
- EForm, EFormItem, ESelect for form/query controls
- ETitle, ECondition, EAnimation, ResizeTable, ETableProps
- The index.tsx files in each folder are the component entry points, and the accompanying .md files are documentation/examples for each component.
4. Page composition model
- EPage appears to be the highest-level composition component, likely combining title, conditions/query form, table, and related actions into a single page pattern.
- In architecture terms, this is the “container” surface that app code uses to assemble the full CRUD/list page experience.
5. Table subsystem
- ETable is the core data-display subsystem.
- Its demos (action, all, drawer, extend, loading, resizeTable) indicate support for:
- row actions
- complete table/page composition
- drawer-based details
- loading state
- extensibility via custom slots/props
- resizable columns or layout
- ETableProps and interface.ts suggest a config-driven API for shaping table behavior.
6. Form and query subsystem
- EForm and EFormItem form the library’s query/filter/edit form layer.
- The demos (base, extend, linked) show that forms support:
- basic field rendering
- extensible/customized fields
- linked or dependent fields
- This subsystem is likely used upstream by EPage and ETable to drive search/filter input and form-driven interactions.
7. Stateful coordination via hooks
- The hooks directory contains the behavioral core:
- useTable, usePage, useForm, useFormItem
- useCondition, useAnimation, useResize
- useFetch, useTrigger, useTitle
- useMediator, useExtendFormItem
- These hooks are where state, effects, async fetching, sizing, and orchestration live, keeping the components thinner and more declarative.
8. Cross-component coordination
- Files like mediator.ts in EFormItem and the useMediator hook imply a coordination pattern between parent forms and child form items.
- This is important for “linked” or “extended” form scenarios where item behavior is not isolated, but depends on shared state or sibling interactions.
9. Data flow
- Consumer configuration flows into the top-level components (EPage, ETable, EForm).
- Those components delegate state and behavior to hooks, which manage fetching, layout, and interaction logic.
- Results and events flow back outward through callbacks/props, while rendering is ultimately backed by Ant Design primitives.
10. Shared primitives
- src/enum and src/utils contain shared constants and helper functions used across the component and hook layers.
- These act as the low-level common boundary to avoid duplicating rules or mappings across table/form features.
11. Documentation and examples are first-class
- The docs/ tree is a Dumi-style documentation site with guides and component pages.
- Each component folder also has its own markdown docs and demos under demo/, which are used to illustrate behavior and likely power the online examples referenced in the README.
12. Build and release architecture
- .fatherrc.ts indicates the library build is managed with Father.
- .dumirc.ts and docs/ indicate Dumi is used for the documentation site.
- .github/workflows/gh-pages.yml shows the docs site is deployed to GitHub Pages.
- Husky, ESLint, Prettier, Stylelint, and commitlint define the code-quality and commit-gating boundary around the source.
13. How to draw the architecture
- A good diagram would show:
- Consumer app / docs site at the top
- Public library API (src/index.ts) in the middle
- Two main internal domains beneath it: table/page composition and form/query composition
- Hooks as the behavioral layer powering both domains
- Shared utils/enums as common dependencies
- Docs/demo system as a separate presentation and verification path
- The library is therefore best understood as a config-driven React component system for table-centric admin pages.
Main entry points: components Components · hooks/index.ts Hooks · src/index.ts Public API · index.tsx ETable
Components 21
Source
Library implementation and public API
- Public API · Top-level export surface for consumers
src/index.ts - Components · Reusable table, form, page, and control components
src/components - Hooks · State, effects, orchestration, and shared logic
src/hooks/index.ts - Enums · Cross-component constants and mappings
src/enum/index.tsx - Utils · Common helper functions used across the library
src/utils/index.ts - EPage · High-level page composition for list and CRUD flows
src/components/EPage/index.tsx - ETable · Primary data table subsystem
src/components/ETable/index.tsx - EForm · Form/query subsystem for filtering and editing
src/components/EForm/index.tsx - EFormItem · Form item integration and linked-field behavior
src/components/EFormItem/index.tsx - ESelect · Specialized select control for form usage
src/components/ESelect/index.tsx - ETitle · Page and section title display
src/components/ETitle/index.tsx - ECondition · Condition and filter container
src/components/ECondition/index.tsx - EAnimation · Animation helper component
src/components/EAnimation/index.tsx - ResizeTable · Resizable table layout support
src/components/ResizeTable/index.tsx - ETableProps · Table prop/config surface
src/components/ETableProps/index.tsx
Docs
Documentation site and component demos
- Docs Site · Documentation and examples site
docs/index.md - Component Docs · Per-component docs and demos
docs/guide/component.md - Light Theme · Lightweight documentation theme/page
docs/light/light.md
Tooling
Build, release, and code quality
- Father Build · Library build and packaging configuration
.fatherrc.ts - Dumi Config · Documentation site configuration
.dumirc.ts - Pages Deploy · GitHub Pages deployment workflow
.github/workflows/gh-pages.yml
Connections 30
- Public API → Components: exports · Re-exports component entry points
- Public API → Hooks: exports · Re-exports hook APIs
- Public API → Enums: exports · Re-exports shared enums
- Public API → Utils: exports · Re-exports shared utilities
- Components → EPage: contains · Page-level composition component
- Components → ETable: contains · Core table component
- Components → EForm: contains · Form/query component
- Components → EFormItem: contains · Form item integration
- Components → ESelect: contains · Supporting select control
- Components → ETitle: contains · Title component
- Components → ECondition: contains · Condition/filter container
- Components → EAnimation: contains · Animation helper
- Components → ResizeTable: contains · Resizable table helper
- ETable → ETableProps: configures · Table behavior and props contract
- EPage → EForm: composes · Uses form for query and filters
- EPage → ETable: composes · Uses table for list display
- EForm → EFormItem: renders · Builds fields from form items
- EFormItem → Hooks: coordinates · Depends on mediator and form hooks
- ETable → Hooks: driven by · Table state, fetch, resize, and triggers live in hooks
- EForm → Hooks: driven by · Form state and linkage live in hooks
- Hooks → Enums: uses · Shared behavior constants and modes
- Hooks → Utils: uses · Common helpers for orchestration logic
- Docs Site → Component Docs: includes · Guide pages and component documentation
- Docs Site → Light Theme: includes · Alternative docs presentation
- Component Docs → ETable: documents · Table usage examples and demos
- Component Docs → EForm: documents · Form usage examples and demos
- Component Docs → EPage: documents · Page composition examples and demos
- Father Build → Public API: builds · Packages the library entrypoint
- Dumi Config → Docs Site: drives · Configures the documentation site
- Pages Deploy → Docs Site: deploys · Publishes docs to GitHub Pages