@zpress/config 0.3.0 → 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 -7
- package/dist/index.d.ts +715 -1192
- package/dist/index.mjs +112 -58
- package/package.json +3 -3
- package/schemas/schema.json +429 -337
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
|
|
@@ -339,7 +339,7 @@ Zod schemas for validation:
|
|
|
339
339
|
|
|
340
340
|
## Error Handling
|
|
341
341
|
|
|
342
|
-
|
|
342
|
+
All fallible operations return Result tuples instead of throwing exceptions.
|
|
343
343
|
|
|
344
344
|
### Result Type
|
|
345
345
|
|