Repository navigation
refactor: Extract internal/document package, simplify manifest format (#218) - #221
Merged
Merged
Conversation
added 4 commits
March 14, 2026 22:03
Add internal/document package with Read, ReadIfExists, and Write functions that encapsulate structured document I/O (YAML/JSON) with consistent error wrapping, permission modes, and directory creation. Migrate 24 call sites across 13 files to use the new package, eliminating repeated ReadFile+Unmarshal and Marshal+WriteFile boilerplate. Simplify packages-manifest format: replace polymorphic entries (bare string or single-key map) with uniform objects using explicit name/with fields. Delete Parse, parsePackageEntry, PackageOptions, and ValidateBytes — all artifacts of the old polymorphic format with zero external callers. Net: -231 lines (337 added, 568 deleted) across 17 files. Closes #218
Add internal/document package with Read, ReadIfExists, and Write functions that encapsulate structured document I/O (YAML/JSON) with consistent error wrapping, permission modes, and directory creation. Migrate 24 call sites across 13 files to use the new package, eliminating repeated ReadFile+Unmarshal and Marshal+WriteFile boilerplate. Simplify packages-manifest format: replace polymorphic entries (bare string or single-key map) with uniform objects using explicit name/with fields. Delete Parse, parsePackageEntry, PackageOptions, and ValidateBytes — all artifacts of the old polymorphic format with zero external callers. Net: -231 lines (337 added, 568 deleted) across 17 files. Closes #218
…or/devlore-cli into feature/structured-document-io
…ture/structured-document-io
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/documentpackage withRead,ReadIfExists, andWritefunctions that encapsulatestructured document I/O (YAML/JSON) with consistent error wrapping, permission modes, and directory creation.
ReadFile+UnmarshalandMarshal+WriteFileboilerplate.uniform objects using explicit
name/withfields. DeletedParse,parsePackageEntry,PackageOptions,and
ValidateBytes— all artifacts of the old polymorphic format with zero external callers.rewritten files.
Net: +579 lines (1202 added, 623 deleted) across 20 files.
Closes #218
Test plan
make vetpassesmake testpasses — all 22 new document tests + all existing testsmanifest_test.go,commands_test.go,builder_test.goParse/ValidateBytesAPIs deleted — greenfield, no downstream consumers