Skip to content

Commit 247ffb3

Browse files
committed
doc: define module registration better
1 parent 56b5bd6 commit 247ffb3

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

frontend_omni/architecture/core.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,24 @@ The type of a module is also set in the `modules.json` but is usually defined so
8585

8686
### 4.4 Registering Modules
8787

88-
Modules needs to be registered in the `src/modules/moduleRegistry.ts`.
88+
To register and acitvate a module, it needs to be added to two places:
89+
* `src/modules/moduleRegistry.ts` to define it for typescript
90+
* `modules*.json` to define the module and its dependencies
91+
92+
93+
#### `src/modules/moduleRegistry.ts`**
94+
95+
Modules needs to be registered in the `src/modules/moduleRegistry.ts` like this:
96+
97+
```typescript
98+
export const moduleRegistry: Record<string, unknown> = {
99+
"@/modules/chat-layout/ChatSidebarItem": ChatSidebarItem,
100+
"@/modules/chat-layout/ChatRouterEntry": ChatRouterEntry,
101+
...
102+
}
103+
```
104+
105+
#### `modules*.json`
89106

90107
To also activate a module, it needs to be added to the `modules*.json`:
91108

0 commit comments

Comments
 (0)