Skip to content

Commit 575a64e

Browse files
committed
docs: add planning document for schema system
1 parent 985de05 commit 575a64e

File tree

2 files changed

+512
-6
lines changed

2 files changed

+512
-6
lines changed

.dev/00-implementation-plan.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@
2020
1. Create `src/schema/` module
2121
2. Implement RON parsing for `ZervFormat`
2222
3. Add `zerv-default` preset with tier-aware logic
23-
4. Unit tests for schema parsing
23+
4. Implement `create_zerv_version` function - Takes `ZervVars` + schema and produces `Zerv` object
24+
5. Unit tests for schema parsing and version creation
2425

2526
**Files**:
2627

27-
- `src/schema/mod.rs` - Schema parsing
28+
- `src/schema/mod.rs` - Schema parsing and `create_zerv_version` function
2829
- `src/schema/presets.rs` - Built-in schemas
2930

3031
### Step 3: CLI Pipeline (1-2 days)
@@ -48,11 +49,14 @@ pub fn run_version_pipeline(args: VersionArgs) -> Result<String> {
4849
// 2. Convert to ZervVars
4950
let vars = vcs_data_to_zerv_vars(vcs_data)?;
5051

51-
// 3. Apply schema and output format
52+
// 3. Create Zerv version object from vars and schema
53+
let zerv = create_zerv_version(vars, &args.schema, args.schema_ron.as_deref())?;
54+
55+
// 4. Apply output format
5256
match args.output_format.as_deref() {
53-
Some("pep440") => Ok(PEP440::from_zerv(&vars)?.to_string()),
54-
Some("semver") => Ok(SemVer::from_zerv(&vars)?.to_string()),
55-
_ => Ok(vars.to_string()),
57+
Some("pep440") => Ok(PEP440::from(zerv).to_string()),
58+
Some("semver") => Ok(SemVer::from(zerv).to_string()),
59+
_ => Ok(zerv.to_string()),
5660
}
5761
}
5862
```

0 commit comments

Comments
 (0)