You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(packages/cli,deps): fix EMFILE error and upgrade to zod 4.x and type-fest 5.x (#27)
* fix(packages/cli,deps): fix EMFILE error and upgrade to zod 4.x and type-fest 5.x
- Fix EMFILE (too many open files) error on macOS by adding depth limit to chokidar
- Improve watcher output to show only first 3 paths + count instead of listing all paths
- Upgrade zod to 4.3.6 (from 3.24.1) with compatibility fixes for new API
- Upgrade type-fest to 5.4.4 (from 4.30.0)
- Upgrade turbo to 2.8.17
- Add zod and type-fest to pnpm workspace catalog for consistency
- Fix Zod 4.x API changes: errors -> issues, tuple syntax, record signature
- Replace forEach with map to comply with functional programming rules
Co-Authored-By: Claude <noreply@anthropic.com>
* feat(packages/ui): inline critical CSS to prevent FOUC
Fixes Flash of Unstyled Content (FOUC) by injecting minified critical
CSS directly into HTML <head> during build. Critical CSS includes
essential color variables and html/body background styling for
immediate first paint, while full CSS loads asynchronously.
Changes:
- Add critical-css.ts with minified theme-specific critical CSS
- Update config.ts to inject critical CSS via Rspress head config
- Support all built-in themes (base, midnight, arcade, arcade-fx)
Impact:
- Eliminates ~100-300ms white flash on cold page loads
- Improves first paint experience on production deployments
- ~1KB inline CSS per theme
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(packages/config): address PR review feedback
Fixes multiple schema and compatibility issues identified in PR review:
1. **Zod v3 compatibility**: Change to `import { z } from 'zod/v3'` for
compatibility with zod-to-json-schema@3.25.1, which requires Zod v3
schema objects. Redefined theme schema inline to avoid type conflicts.
2. **ConfigErrorType documentation**: Updated README to include all error
types (missing_field, invalid_entry, invalid_section, invalid_field,
invalid_icon, invalid_theme, duplicate_prefix, unknown).
3. **Schema strictness fixes**:
- Changed frontmatter.head to use tuple for fixed positions:
`z.tuple([z.string(), z.record(z.string(), z.string())])`
- Changed outline to use tuple instead of array for fixed positions
- Added deprecated fields (titleFrom, titleTransform) to entrySchema
for backward compatibility with existing configs
All packages build successfully and pass type checks.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
**`name` → `title`** on `WorkspaceCategory`: All types now use `title` consistently
58
70
59
71
```ts
60
72
// Before
61
-
workspaces: [{
62
-
name: 'Integrations',
63
-
items: [/* ... */],
64
-
}]
73
+
workspaces: [
74
+
{
75
+
name: 'Integrations',
76
+
items: [
77
+
/* ... */
78
+
],
79
+
},
80
+
]
65
81
66
82
// After
67
-
workspaces: [{
68
-
title: 'Integrations',
69
-
items: [/* ... */],
70
-
}]
83
+
workspaces: [
84
+
{
85
+
title: 'Integrations',
86
+
items: [
87
+
/* ... */
88
+
],
89
+
},
90
+
]
71
91
```
72
92
73
93
### Discovery Configuration
@@ -76,26 +96,30 @@ Workspace items now use a `discovery` field to configure content auto-discovery,
76
96
77
97
```ts
78
98
// Before
79
-
apps: [{
80
-
title: 'API',
81
-
path: '/apps/api',
82
-
from: 'docs/*.md',
83
-
titleFrom: 'frontmatter',
84
-
sort: 'alpha',
85
-
recursive: false,
86
-
}]
87
-
88
-
// After
89
-
apps: [{
90
-
title: 'API',
91
-
prefix: '/apps/api',
92
-
discovery: {
99
+
apps: [
100
+
{
101
+
title: 'API',
102
+
path: '/apps/api',
93
103
from: 'docs/*.md',
94
-
title: { from: 'auto' },
104
+
titleFrom: 'frontmatter',
95
105
sort: 'alpha',
96
106
recursive: false,
97
107
},
98
-
}]
108
+
]
109
+
110
+
// After
111
+
apps: [
112
+
{
113
+
title: 'API',
114
+
prefix: '/apps/api',
115
+
discovery: {
116
+
from: 'docs/*.md',
117
+
title: { from: 'auto' },
118
+
sort: 'alpha',
119
+
recursive: false,
120
+
},
121
+
},
122
+
]
99
123
```
100
124
101
125
**Note**: The `from` field in `discovery` is relative to the workspace's base path (derived from `prefix`). For example, `prefix: "/apps/api"` + `discovery.from: "docs/*.md"` resolves to `apps/api/docs/*.md` (repo-root relative).
@@ -105,6 +129,7 @@ apps: [{
105
129
**Default `titleFrom` changed from `'filename'` to `'auto'`**
106
130
107
131
The `'auto'` strategy uses a smart fallback chain:
132
+
108
133
1. Try frontmatter `title` field
109
134
2. Fall back to first `# heading`
110
135
3. Fall back to filename (kebab-to-title)
@@ -142,13 +167,14 @@ interface Discovery {
142
167
exclude?:GlobPattern[]
143
168
frontmatter?:Frontmatter
144
169
recursive?:boolean
145
-
indexFile?:string// Only when recursive: true
170
+
indexFile?:string// Only when recursive: true
146
171
}
147
172
```
148
173
149
174
### Enhanced Icon Documentation
150
175
151
176
Icon colors are now fully documented in types with the 8-color palette rotation:
177
+
152
178
- purple (default)
153
179
- blue
154
180
- green
@@ -163,18 +189,21 @@ Icon colors are now fully documented in types with the 8-color palette rotation:
163
189
### Automated Find/Replace
164
190
165
191
1.**Update workspace field names**:
192
+
166
193
```
167
194
Find: path: '/
168
195
Replace: prefix: '/
169
196
```
170
197
171
198
2.**Update workspace group names**:
199
+
172
200
```
173
201
Find: name: '
174
202
Replace: title: '
175
203
```
176
204
177
205
3.**Update type imports** (if using types directly):
@@ -189,24 +218,28 @@ Icon colors are now fully documented in types with the 8-color palette rotation:
189
218
190
219
```ts
191
220
// Before
192
-
apps: [{
193
-
title: 'API',
194
-
path: '/apps/api',
195
-
from: 'docs/*.md',
196
-
titleFrom: 'frontmatter',
197
-
sort: 'alpha',
198
-
}]
199
-
200
-
// After
201
-
apps: [{
202
-
title: 'API',
203
-
prefix: '/apps/api',
204
-
discovery: {
221
+
apps: [
222
+
{
223
+
title: 'API',
224
+
path: '/apps/api',
205
225
from: 'docs/*.md',
206
-
title: { from: 'auto' }, // Better default!
226
+
titleFrom: 'frontmatter',
207
227
sort: 'alpha',
208
228
},
209
-
}]
229
+
]
230
+
231
+
// After
232
+
apps: [
233
+
{
234
+
title: 'API',
235
+
prefix: '/apps/api',
236
+
discovery: {
237
+
from: 'docs/*.md',
238
+
title: { from: 'auto' }, // Better default!
239
+
sort: 'alpha',
240
+
},
241
+
},
242
+
]
210
243
```
211
244
212
245
2.**Verify title derivation behavior**: If you have sections with `titleFrom: 'filename'` and markdown files with frontmatter or headings, the default `'auto'` mode will now use those instead of the filename. To preserve old behavior, explicitly set `titleFrom: 'filename'`.
@@ -220,6 +253,7 @@ Icon colors are now fully documented in types with the 8-color palette rotation:
220
253
## Documentation
221
254
222
255
See updated guides:
256
+
223
257
-[Workspaces](/guides/workspaces) - New `prefix` and `discovery` fields
224
258
-[Auto-Discovery](/guides/auto-discovery) - New `'auto'` titleFrom mode and `TitleConfig`
225
259
-[Configuration Reference](/reference/configuration) - Full field reference
Add VS Code mode improvements: hide mobile navigation elements and scope all VS Code overrides to `html[data-zpress-env="vscode"]` selector for cleaner CSS without !important rules.
|`icon`|`IconConfig`| no | Icon ID string (from bundled collections) or `{ id: IconId, color: IconColor }` object. See [icon reference](/references/icons/overview) for supported icons. |
65
-
|`description`|`string`| yes | Short description for cards |
66
-
|`tags`|`string[]`| no | Technology tags (kebab-case) |
0 commit comments