Skip to content

Commit 8e66b7d

Browse files
committed
docs(README): update example configuration to include defaultRoute and nav overrides
1 parent ed4c677 commit 8e66b7d

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,35 +122,38 @@ Configs live in `configs/` and follow the schema defined in `configs/client-conf
122122
}
123123
```
124124

125-
**Example — production with pinned versions (`configs/client-prod-v1.json`):**
125+
**Example — production with pinned versions, a nav override, and a default route:**
126126

127127
```json
128128
{
129129
"$schema": "./client-config.schema.json",
130130
"clientId": "client-prod-v1",
131+
"defaultRoute": "@nacs/feature-a",
131132
"features": [
132-
{ "module": "@nacs/feature-dashboard", "version": "1.0.0" },
133+
{ "module": "@nacs/feature-dashboard", "version": "1.0.0", "overrides": { "title": "Home", "icon": "🏠" } },
133134
{ "module": "@nacs/feature-a", "version": "1.0.0" }
134135
]
135136
}
136137
```
137138

138139
Routing metadata (path, export name, nav title, icon) is **not declared in the config**. It is discovered from the feature library's own `package.json` at build time — see [Feature Contributions & Extensions](#feature-contributions--extensions) below.
139140

140-
### Feature config fields
141+
### Config fields
142+
143+
| Field | Required | Description |
144+
| -------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
145+
| `clientId` | Yes | Unique identifier for this client configuration. |
146+
| `features` | Yes | Ordered list of feature modules to include. The first entry is the default redirect unless `defaultRoute` is set. |
147+
| `defaultRoute` | No | Module name (must match a `features[].module` value) whose route is the default redirect. |
148+
149+
### Feature fields
141150

142151
| Field | Required | Description |
143152
| ----------- | -------- | ------------------------------------------------------------------------------------------- |
144-
| `module` | Yes | npm package name for the feature library |
153+
| `module` | Yes | npm package name for the feature library. |
145154
| `version` | No | Pins to a specific published version from the registry. Omit to use local workspace source. |
146155
| `overrides` | No | Optionally override `title` or `icon` discovered from the library for this client only. |
147156

148-
**Example with overrides:**
149-
150-
```json
151-
{ "module": "@nacs/feature-dashboard", "overrides": { "title": "Home", "icon": "🏠" } }
152-
```
153-
154157
To add a new client environment, create a new `configs/<client-name>.json` file referencing the schema and run:
155158

156159
```sh

0 commit comments

Comments
 (0)