@zpress/config 0.2.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -8
- package/dist/index.d.ts +887 -1427
- package/dist/index.mjs +150 -59
- package/package.json +7 -6
- package/schemas/schema.json +481 -290
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ This package provides comprehensive configuration management for zpress, includi
|
|
|
12
12
|
- **Type-safe config definitions** with `defineConfig` helper
|
|
13
13
|
- **Runtime validation** using Zod schemas
|
|
14
14
|
- **JSON Schema generation** for IDE autocomplete and validation
|
|
15
|
-
- **Result-based error handling**
|
|
15
|
+
- **Result-based error handling** with typed error tuples
|
|
16
16
|
- **Theme integration** via `@zpress/theme` package
|
|
17
17
|
- **c12-powered loader** for flexible config resolution
|
|
18
18
|
|
|
@@ -21,7 +21,7 @@ This package provides comprehensive configuration management for zpress, includi
|
|
|
21
21
|
This package is typically installed as a dependency of `@zpress/core`:
|
|
22
22
|
|
|
23
23
|
```bash
|
|
24
|
-
|
|
24
|
+
npm install @zpress/config
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## Usage
|
|
@@ -52,7 +52,7 @@ export default defineConfig({
|
|
|
52
52
|
|
|
53
53
|
```json
|
|
54
54
|
{
|
|
55
|
-
"$schema": "https://raw.githubusercontent.com/joggrdocs/zpress/v0.
|
|
55
|
+
"$schema": "https://raw.githubusercontent.com/joggrdocs/zpress/v0.3.0/packages/config/schemas/schema.json",
|
|
56
56
|
"title": "My Documentation",
|
|
57
57
|
"theme": {
|
|
58
58
|
"name": "arcade",
|
|
@@ -70,7 +70,7 @@ export default defineConfig({
|
|
|
70
70
|
### YAML Config with Schema
|
|
71
71
|
|
|
72
72
|
```yaml
|
|
73
|
-
# yaml-language-server: $schema=https://raw.githubusercontent.com/joggrdocs/zpress/v0.
|
|
73
|
+
# yaml-language-server: $schema=https://raw.githubusercontent.com/joggrdocs/zpress/v0.3.0/packages/config/schemas/schema.json
|
|
74
74
|
|
|
75
75
|
title: My Documentation
|
|
76
76
|
theme:
|
|
@@ -165,7 +165,7 @@ Add `$schema` property to your `zpress.config.json`:
|
|
|
165
165
|
|
|
166
166
|
```json
|
|
167
167
|
{
|
|
168
|
-
"$schema": "https://raw.githubusercontent.com/joggrdocs/zpress/v0.
|
|
168
|
+
"$schema": "https://raw.githubusercontent.com/joggrdocs/zpress/v0.3.0/packages/config/schemas/schema.json"
|
|
169
169
|
}
|
|
170
170
|
```
|
|
171
171
|
|
|
@@ -174,7 +174,7 @@ Add `$schema` property to your `zpress.config.json`:
|
|
|
174
174
|
Add a modeline comment to your `zpress.config.yaml`:
|
|
175
175
|
|
|
176
176
|
```yaml
|
|
177
|
-
# yaml-language-server: $schema=https://raw.githubusercontent.com/joggrdocs/zpress/v0.
|
|
177
|
+
# yaml-language-server: $schema=https://raw.githubusercontent.com/joggrdocs/zpress/v0.3.0/packages/config/schemas/schema.json
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
### Versioned Schemas
|
|
@@ -213,7 +213,6 @@ You can reference a specific version using GitHub tags:
|
|
|
213
213
|
#### System Types
|
|
214
214
|
|
|
215
215
|
- `Paths` - Directory paths configuration
|
|
216
|
-
- `OpenAPIConfig` - OpenAPI spec integration config
|
|
217
216
|
- `ResolvedPage` - Resolved page metadata
|
|
218
217
|
- `ResolvedSection` - Resolved section with pages
|
|
219
218
|
|
|
@@ -340,7 +339,7 @@ Zod schemas for validation:
|
|
|
340
339
|
|
|
341
340
|
## Error Handling
|
|
342
341
|
|
|
343
|
-
|
|
342
|
+
All fallible operations return Result tuples instead of throwing exceptions.
|
|
344
343
|
|
|
345
344
|
### Result Type
|
|
346
345
|
|